]> granicus.if.org Git - llvm/commitdiff
[InstCombine] Make foldOpWithConstantIntoOperand take a BinaryOperator instead of...
authorCraig Topper <craig.topper@gmail.com>
Mon, 3 Apr 2017 07:08:08 +0000 (07:08 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 3 Apr 2017 07:08:08 +0000 (07:08 +0000)
It blindly assumes there are two operands so make it explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299351 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineInternal.h
lib/Transforms/InstCombine/InstructionCombining.cpp

index 88e654292b7cab9efa01a8a7deee581d5837413a..ab15fd84b24a0688feef64b7f8b487d02f36d360 100644 (file)
@@ -571,7 +571,7 @@ private:
   Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI);
 
   /// This is a convenience wrapper function for the above two functions.
-  Instruction *foldOpWithConstantIntoOperand(Instruction &I);
+  Instruction *foldOpWithConstantIntoOperand(BinaryOperator &I);
 
   /// \brief Try to rotate an operation below a PHI node, using PHI nodes for
   /// its operands.
index 94e7a7f2ade47d5255273506353d6d146af2a358..bc168dd57765efac84f29495009134e3469dfb82 100644 (file)
@@ -967,7 +967,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) {
   return replaceInstUsesWith(I, NewPN);
 }
 
-Instruction *InstCombiner::foldOpWithConstantIntoOperand(Instruction &I) {
+Instruction *InstCombiner::foldOpWithConstantIntoOperand(BinaryOperator &I) {
   assert(isa<Constant>(I.getOperand(1)) && "Unexpected operand type");
 
   if (auto *Sel = dyn_cast<SelectInst>(I.getOperand(0))) {