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

llvm-svn: 299351

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

index 88e6542..ab15fd8 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 94e7a7f..bc168dd 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))) {