forked from OSchip/llvm-project
[AMDGPU] Avoid calling copyFastMathFlags in wrong context
Calling Instruction::copyFastMathFlags() assumes the caller is FPMathOperator. Avoid calling the function for instructions that are not instances of FPMathOperator.
This commit is contained in:
parent
f141d1afc5
commit
c7afb698ca
|
@ -159,7 +159,8 @@ simplifyAMDGCNImageIntrinsic(const GCNSubtarget *ST,
|
|||
CallInst *NewCall = IC.Builder.CreateCall(I, Args);
|
||||
NewCall->takeName(&II);
|
||||
NewCall->copyMetadata(II);
|
||||
NewCall->copyFastMathFlags(&II);
|
||||
if (isa<FPMathOperator>(NewCall))
|
||||
NewCall->copyFastMathFlags(&II);
|
||||
return IC.replaceInstUsesWith(II, NewCall);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue