[llvm] [InstCombine][NFC] Drop ignore bundles when iterating the bundles (PR #202903)
Nikolas Klauser via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 02:35:38 PDT 2026
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/202903
None
>From ff6ef54572fa289dd90a36b03c9d8bd7e5421e66 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 10 Jun 2026 11:34:46 +0200
Subject: [PATCH] [InstCombine][NFC] Drop ignore bundles when iterating the
bundles
---
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 48a2c6a033c0f..a8d0d2eece49f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3700,6 +3700,9 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
break;
}
+ case BundleAttr::Ignore:
+ return CallBase::removeOperandBundleAt(II, Idx);
+
case BundleAttr::NonNull: {
auto [Ptr] = llvm::getAssumeNonNullInfo(OBU);
@@ -3749,7 +3752,6 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
// TODO: Drop these assumes when they are redundant
case BundleAttr::DereferenceableOrNull:
- case BundleAttr::Ignore:
case BundleAttr::NoUndef:
break;
@@ -3803,7 +3805,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
// then this one is redundant, and should be removed.
KnownBits Known(1);
computeKnownBits(IIOperand, Known, II);
- if (Known.isAllOnes() && isAssumeWithEmptyBundle(cast<AssumeInst>(*II)))
+ if (Known.isAllOnes() && !II->hasOperandBundles())
return eraseInstFromFunction(*II);
// assume(false) is unreachable.
More information about the llvm-commits
mailing list