[PATCH] D29641: [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 10:51:41 PST 2017


sanjoy added a comment.

You can't replace the operands of an instruction in a way that it computes a new value while still preserving SCEV, since SCEV keys off of the `Instruction *`.  Loop disposition is only //one// of the things that this breaks.  e.g. if you have `1 + %KnownPositive` and you replace the `%KnownPositive` operand with `%MayBeNegative` ("in place"), that breaks the `getRange` cache.

Can the loop vectorizer do without replacing `%cond` and `%cond14` to `undef`?


https://reviews.llvm.org/D29641





More information about the llvm-commits mailing list