diff options
author | Nikita Popov <npopov@redhat.com> | 2025-08-04 10:02:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-04 10:02:04 +0200 |
commit | 86727fe9a13daf313429c04fe602f45dbf35036c (patch) | |
tree | 18b890674ae3ce47cb5169638e0ca250a311b53e /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | d95dadff8f094e793b79eec57737ec397fad7724 (diff) | |
download | llvm-86727fe9a13daf313429c04fe602f45dbf35036c.zip llvm-86727fe9a13daf313429c04fe602f45dbf35036c.tar.gz llvm-86727fe9a13daf313429c04fe602f45dbf35036c.tar.bz2 |
[IR] Allow poison argument to lifetime markers (#151148)
This slightly relaxes the invariant established in #149310, by also
allowing the lifetime argument to be poison. This is to support the
typical pattern of RAUWing with poison when removing an instruction.
It's worth noting that this does not require any conservative
assumptions, lifetimes with poison arguments can simply be skipped.
Fixes https://github.com/llvm/llvm-project/issues/151119.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 306e068..ac0440f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -7598,7 +7598,9 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, if (TM.getOptLevel() == CodeGenOptLevel::None) return; - const AllocaInst *LifetimeObject = cast<AllocaInst>(I.getArgOperand(1)); + const AllocaInst *LifetimeObject = dyn_cast<AllocaInst>(I.getArgOperand(1)); + if (!LifetimeObject) + return; // First check that the Alloca is static, otherwise it won't have a // valid frame index. |