[llvm] [DropUnnecessaryAssumes] Add support for operand bundles (PR #160311)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 23 11:53:10 PDT 2025


================
@@ -26,8 +37,41 @@ DropUnnecessaryAssumesPass::run(Function &F, FunctionAnalysisManager &FAM) {
     if (!Assume)
       continue;
 
-    // TODO: Handle assumes with operand bundles.
-    if (Assume->hasOperandBundles())
+    SmallVector<WeakTrackingVH> DeadBundleArgs;
+    SmallVector<OperandBundleDef> KeptBundles;
+    unsigned NumBundles = Assume->getNumOperandBundles();
+    for (unsigned I = 0; I != NumBundles; ++I) {
+      // Handle operand bundle assumptions.
+      OperandBundleUse Bundle = Assume->getOperandBundleAt(I);
----------------
andjo403 wrote:

is there a need to special handle the `ignore` tag also maybe feels like the assume can be removed if that is the only type bundle

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


More information about the llvm-commits mailing list