[llvm] [SDAG] Read-only intrinsics must have WillReturn attribute to be treated as loads (PR #99999)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 02:35:02 PDT 2024


================
@@ -5229,7 +5229,7 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
   // definition.
   const Function *F = I.getCalledFunction();
   bool HasChain = !F->doesNotAccessMemory();
----------------
nikic wrote:

We should probably also have `|| !F->willReturn()` here. If it's a readnone function that may diverge, it also needs a chain, right? This would probably also help identify intrinsics that are incorrectly missing the attribute.

https://github.com/llvm/llvm-project/pull/99999


More information about the llvm-commits mailing list