[PATCH] D33262: [JumpThreading] Teach jump threading how to analyze (and (cmp A, C1), (cmp A, C2)) after InstCombine has turned it into (cmp (add A, C3), C4)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 12:11:02 PDT 2017

craig.topper updated this revision to Diff 102217.
craig.topper added a comment.

Implement by asking LVI for a ConstantRange for the add on the edge and propagate forward in JumpThreading.

I tried Farhana's suggestion of moving logic into getPredicateOnEdge, but I had some trouble with PHINode's on single basic block loops. It became difficult to know what the caller was trying to ask to know if we should look back for an instruction. I think this was also compounded by the fact that we use getPredicateOnEdge for select conditions and maybe other things that aren't real compare instructions.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33262.102217.patch
Type: text/x-patch
Size: 4806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170612/5d8eccdf/attachment.bin>

More information about the llvm-commits mailing list