[InstCombine] Make foldOpWithConstantIntoOperand take a BinaryOperator instead of a generic Instruction.

It blindly assumes there are two operands so make it explicit.

llvm-svn: 299351
This commit is contained in:
Craig Topper 2017-04-03 07:08:08 +00:00
parent af940ae280
commit d0b053d229
2 changed files with 2 additions and 2 deletions

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

View 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))) {