Pattern not recognized as reduction

Reduction Not Captured By LLVM

CODE_1

Hi,

LoopVectorizer only deals with reductions in registers, not in memory. In your original example, the running sum is stored back to memory at every iteration. There’s no way to do that with vector instructions.

Cheers,
Philip