diff options
Diffstat (limited to 'llvm/lib/Analysis/CostModel.cpp')
-rw-r--r-- | llvm/lib/Analysis/CostModel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp index 0383cbfbbe4..36a1db664e1 100644 --- a/llvm/lib/Analysis/CostModel.cpp +++ b/llvm/lib/Analysis/CostModel.cpp @@ -504,8 +504,12 @@ unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const { for (unsigned J = 0, JE = II->getNumArgOperands(); J != JE; ++J) Args.push_back(II->getArgOperand(J)); + FastMathFlags FMF; + if (auto *FPMO = dyn_cast<FPMathOperator>(II)) + FMF = FPMO->getFastMathFlags(); + return TTI->getIntrinsicInstrCost(II->getIntrinsicID(), II->getType(), - Args); + Args, FMF); } return -1; default: |