diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index 04fa2f95182..f09a67d96f3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -355,7 +355,8 @@ Instruction *InstCombiner::foldSelectOpOp(SelectInst &SI, Instruction *TI, Value *Op1 = MatchIsOpZero ? NewSI : MatchOp; if (auto *BO = dyn_cast<BinaryOperator>(TI)) { BinaryOperator *NewBO = BinaryOperator::Create(BO->getOpcode(), Op0, Op1); - NewBO->copyIRFlags(BO); + NewBO->copyIRFlags(TI); + NewBO->andIRFlags(FI); return NewBO; } if (auto *TGEP = dyn_cast<GetElementPtrInst>(TI)) { |