aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/PredicateInfo.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-08-12 12:53:39 +0200
committerNikita Popov <npopov@redhat.com>2025-08-12 12:56:08 +0200
commitab323eb0c6b2ed8814c4516d4bce179d55372a5a (patch)
treed4bf45833a71309766f464071bb6e45aaf5203a5 /llvm/lib/Transforms/Utils/PredicateInfo.cpp
parent52f7cfb5ef0a21173f0c7ae2305c76e1662831c5 (diff)
downloadllvm-ab323eb0c6b2ed8814c4516d4bce179d55372a5a.zip
llvm-ab323eb0c6b2ed8814c4516d4bce179d55372a5a.tar.gz
llvm-ab323eb0c6b2ed8814c4516d4bce179d55372a5a.tar.bz2
[SCCP][PredicateInfo] Do not predicate argument of lifetime intrinsic
Replacing the argument with a no-op bitcast violates a verifier constraint, even if only temporarily. Any replacement based on it would result in a violation even after the copy has been removed. Fixes https://github.com/llvm/llvm-project/issues/153013.
Diffstat (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/PredicateInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index 38a312a..13c7ad2 100644
--- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp
+++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
@@ -291,6 +291,11 @@ void PredicateInfoBuilder::convertUsesToDFSOrdered(
Value *Op, SmallVectorImpl<ValueDFS> &DFSOrderedSet) {
for (auto &U : Op->uses()) {
if (auto *I = dyn_cast<Instruction>(U.getUser())) {
+ // Lifetime intrinsics must work directly on alloca, do not replace them
+ // with a predicated copy.
+ if (I->isLifetimeStartOrEnd())
+ continue;
+
ValueDFS VD;
// Put the phi node uses in the incoming block.
BasicBlock *IBlock;