[PATCH] D31686: [InstCombine] Support folding a subtract with a constant LHS into a phi node

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 07:46:17 PDT 2017


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

LGTM. See inline comments for a couple of minor bits.



================
Comment at: lib/Transforms/InstCombine/InstCombineInternal.h:565
   /// only possible if all operands to the PHI are constants).
-  Instruction *FoldOpIntoPhi(Instruction &I);
+  Instruction *FoldOpIntoPhi(Instruction &I, PHINode *PN);
 
----------------
Since we're changing the signature, how about fixing the capitalization to current fashion as a clean-up ?
foldOpIntoPhi()
foldOpIntoSelect()


================
Comment at: test/Transforms/InstCombine/sub.ll:749-754
+; CHECK-LABEL: @test53(
+; CHECK-NEXT:    [[SUB:%.*]] = xor <2 x i1> [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT:    ret <2 x i1> [[SUB]]
+;
   %sub = sub <2 x i1> %A, %B
   ret <2 x i1> %sub
----------------
Best to make this an NFC change before this commit.


https://reviews.llvm.org/D31686





More information about the llvm-commits mailing list