aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-05-08 08:00:09 +0200
committerGitHub <noreply@github.com>2025-05-08 08:00:09 +0200
commit9383fb23e18bb983d0024fb956a0a724ef9eb03d (patch)
treea2e386872c09368abfce4229ed6820e519b29058 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent334c1abdb0bee488477f810ebf4cc1d41c31e653 (diff)
downloadllvm-9383fb23e18bb983d0024fb956a0a724ef9eb03d.zip
llvm-9383fb23e18bb983d0024fb956a0a724ef9eb03d.tar.gz
llvm-9383fb23e18bb983d0024fb956a0a724ef9eb03d.tar.bz2
Reapply "IR: Remove uselist for constantdata (#137313)" (#138961)
Reapply "IR: Remove uselist for constantdata (#137313)" This reverts commit 5936c02c8b9c6d1476f7830517781ce8b6e26e75. Fix checking uselists of constants in assume bundle queries
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index f9dcb47..2c53a9c 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -8591,6 +8591,9 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI,
return false;
Value *X = Cmp->getOperand(0);
+ if (!X->hasUseList())
+ return false;
+
APInt CmpC = cast<ConstantInt>(Cmp->getOperand(1))->getValue();
for (auto *U : X->users()) {