diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 1946f8903b14..975cb83b8f3a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -5284,7 +5284,7 @@ static Instruction *foldFCmpReciprocalAndZero(FCmpInst &I, Instruction *LHSI, // Finally emit the new fcmp. Value *X = LHSI->getOperand(1); FCmpInst *NewFCI = new FCmpInst(Pred, X, RHSC); - NewFCI->setFastMathFlags(I.getFastMathFlags()); + NewFCI->copyFastMathFlags(&I); return NewFCI; }