[PATCH] D41578: [SCEV] Do not cache S -> V if S is not equivalent of V

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 23:41:09 PST 2017


skatkov added inline comments.


================
Comment at: test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll:56
   %mLength = getelementptr inbounds %struct.Vector2, %struct.Vector2* %result, i64 0, i32 2
   %idx.ext21 = bitcast i64 %sub.ptr.div39 to i64
   %incdec.ptr.sum = add i64 %idx.ext21, -1
----------------
Actually I realized that this test shows that my solution is not complete. This is better than nothing and fixes the bug I'm working on but it is not a full solution.

The problem is that poison is transitive. Specifically within this patch it will to set SCEV->%sub.ptr.div39 mapping but will set SCEV->%idx.ext21.

And that is not correct.

I tend to land this patch and add TODO into SCEVLostPoisonFlags that we must consider not exactly instruction but really answer to the question whether I can lead to poison...

What do you think?


https://reviews.llvm.org/D41578





More information about the llvm-commits mailing list