Skip to content

Commit 36b9faa

Browse files
committed
[SDAG] Read-only intrinsics must have WillReturn to be treated as loads
1 parent 039a86d commit 36b9faa

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

52345234
// Build the operand list.
52355235
SmallVector<SDValue, 8> Ops;

0 commit comments

Comments
 (0)