Skip to content

Commit 1e83b39

Browse files
committed
[SDAG] Read-only intrinsics must have WillReturn to be treated as loads
1 parent 9effefb commit 1e83b39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5225,7 +5225,7 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
52255225
// definition.
52265226
const Function *F = I.getCalledFunction();
52275227
bool HasChain = !F->doesNotAccessMemory();
5228-
bool OnlyLoad = HasChain && F->onlyReadsMemory();
5228+
bool OnlyLoad = HasChain && F->onlyReadsMemory() && F->willReturn();
52295229

52305230
// Build the operand list.
52315231
SmallVector<SDValue, 8> Ops;

0 commit comments

Comments
 (0)