diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-17 17:01:35 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-17 17:01:35 +0000 |
| commit | 3e140066bce1cbc40604274bd99a0cc2efed01f5 (patch) | |
| tree | cbb51d58de23cb07cb4f853a69c6f322318076b3 /llvm/lib/CodeGen | |
| parent | a7f09f3c9e68fab859f6e3283f9c01d5b6b39143 (diff) | |
| download | bcm5719-llvm-3e140066bce1cbc40604274bd99a0cc2efed01f5.tar.gz bcm5719-llvm-3e140066bce1cbc40604274bd99a0cc2efed01f5.zip | |
GlobalISel: Ignore callsite attributes when picking intrinsic type
A target intrinsic may be defined as possibly reading memory, but the
call site may have additional knowledge that it doesn't read
memory. The intrinsic lowering will expect the pessimistic assumption
of the intrinsic definition, so the chain should still be used.
I fixed the same bug in SelectionDAG in r287593.
llvm-svn: 363580
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index e900a797cc7..270341f6680 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -1242,8 +1242,10 @@ bool IRTranslator::translateCall(const User &U, MachineIRBuilder &MIRBuilder) { if (!CI.getType()->isVoidTy()) ResultRegs = getOrCreateVRegs(CI); + // Ignore the callsite attributes. Backend code is most likely not expecting + // an intrinsic to sometimes have side effects and sometimes not. MachineInstrBuilder MIB = - MIRBuilder.buildIntrinsic(ID, ResultRegs, !CI.doesNotAccessMemory()); + MIRBuilder.buildIntrinsic(ID, ResultRegs, !F->doesNotAccessMemory()); if (isa<FPMathOperator>(CI)) MIB->copyIRFlags(CI); |

