Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

spill avoidance (register pressure from loop fusion)

$
0
0

In the attached screen snip from VTune running on KNL, there appear to be stalls due to spills, mostly using AVX-512 moves to copy data chunks from (OpenMP shared) data arrays to stack.  I wondered if this happens because the compiler appears to fuse hundreds of short aligned for loops within the single parallel region into a single loop (note code from source line 833 next to 1070), and whether there is any way to avoid it.  It seems wasteful to make these stack copies of cache lines.  I have tried several combinations of #pragma nofusion and explicitly fusing a reasonable number of for loops, but it makes no difference when viewed as .asm file.

There are also many cases of a locally generated cache line  being spilled and later reloaded(like the first 2 stores in the attached snip, one of which is simply zeroing out that stack address). I don't see large numbers of clock tick event counts associated with those spills which don't follow immediately after loads.

With 32 separate named zmm registers available, the compiler should be capable of fusing many loops without incurring register pressure, but it seems to have found a way to go way past the limit.  I don't know enough about KNL to guess whether stalls may be incurred by having so many different memory operations in the same loop.  The code runs about 50% faster with the numactl setting to fast on-board memory (rather than default cached mode), so there does appear to be some memory bandwidth limitation.

I'm asking here rather than on MIC forum because it looks like a compiler question which isn't specific to MIC.

AttachmentSize
Downloadimage/pngCapture.PNG29.55 KB

Zone: 

Thread Topic: 

How-To

Viewing all articles
Browse latest Browse all 1175

Trending Articles