From 38c71d62897980e84cf0e5d7f293f455fc5a3fac Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 3 Apr 2017 07:08:08 +0000 Subject: [PATCH] [InstCombine] Make foldOpWithConstantIntoOperand take a BinaryOperator instead of a generic Instruction. 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 | 2 +- lib/Transforms/InstCombine/InstructionCombining.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/InstCombine/InstCombineInternal.h b/lib/Transforms/InstCombine/InstCombineInternal.h index 88e654292b7..ab15fd84b24 100644 --- a/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/lib/Transforms/InstCombine/InstCombineInternal.h @@ -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. diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 94e7a7f2ade..bc168dd5776 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -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(I.getOperand(1)) && "Unexpected operand type"); if (auto *Sel = dyn_cast(I.getOperand(0))) { -- 2.50.1