Skip to content

Commit 006cc87

Browse files
Jay-Jiewu-Luigcbot
authored andcommitted
Set fastmath only for math Intrinsic
Set fastmath only for math Intrinsic
1 parent f471182 commit 006cc87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

IGC/Compiler/Optimizer/OCLBIUtils.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ void CCommand::replaceCallInst(IGCLLVM::Intrinsic intrinsicName, ArrayRef<Type*>
5959
Function* func = getFunctionDeclaration(intrinsicName, Tys);
6060
Instruction* newCall = CallInst::Create(func, m_args, m_pCallInst->getName(), m_pCallInst);
6161

62-
if (auto II = dyn_cast<IntrinsicInst>(newCall)) {
63-
II->copyFastMathFlags(m_pCallInst->getFastMathFlags());
62+
if (isa<FPMathOperator>(m_pCallInst)) {
63+
if (auto II = dyn_cast<IntrinsicInst>(newCall)) {
64+
II->copyFastMathFlags(m_pCallInst->getFastMathFlags());
65+
}
6466
}
6567

6668
newCall->setDebugLoc(m_DL);

0 commit comments

Comments
 (0)