[llvm] [InstCombine][NFC] Drop ignore bundles when iterating the bundles (PR #202903)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 02:36:15 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/202903.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp (+4-2) 


``````````diff
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.

``````````

</details>


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


More information about the llvm-commits mailing list