[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)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 14:03:51 PDT 2017


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/minor changes applied, no further review needed.

Very nice.



================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:638
+      Instruction *CmpIn = cast<Instruction>(Cmp->getOperand(0));
+      if (isa<ConstantInt>(CmpConst) &&
+          CmpIn->getOpcode() == Instruction::Add) {
----------------
This would probably be clearer with either a matcher or a helper lambda.  


https://reviews.llvm.org/D33262





More information about the llvm-commits mailing list