[llvm] [InstCombine] Remove redundant alignment assumptions. (PR #123348)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 06:51:53 PDT 2025


================
@@ -3404,6 +3405,32 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
         MaybeSimplifyHint(OBU.Inputs[0]);
         MaybeSimplifyHint(OBU.Inputs[1]);
       }
+
+      // Try to remove redundant alignment assumptions.
+      if (OBU.getTagName() == "align" && OBU.Inputs.size() == 2) {
+        RetainedKnowledge RK = getKnowledgeFromBundle(
+            *cast<AssumeInst>(II), II->bundle_op_info_begin()[Idx]);
----------------
fhahn wrote:

Updated, thanks, it required adjusting `Idx` by `II->arg_size(0`

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


More information about the llvm-commits mailing list