Skip to content

Commit ca7e38e

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

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
@@ -5227,7 +5227,7 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
52275227
// definition.
52285228
const Function *F = I.getCalledFunction();
52295229
bool HasChain = !F->doesNotAccessMemory();
5230-
bool OnlyLoad = HasChain && F->onlyReadsMemory();
5230+
bool OnlyLoad = HasChain && F->onlyReadsMemory() && F->willReturn();
52315231

52325232
// Build the operand list.
52335233
SmallVector<SDValue, 8> Ops;

0 commit comments

Comments
 (0)