[PATCH] D144445: [AggressiveInstCombine] folding load for constant global patterened arrays and structs by alignment

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 04:48:17 PDT 2023


khei4 added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:860
+  } else if (!isa<GEPOperator>(PtrOp))
+    return false;
+
----------------
nikic wrote:
> These isa checks aren't needed in this patch: For the alignment case, we don't care what the operand is.
Seems like, I could not get the point of `ptrmask` cares! (Precisely, it seems like we need to check alignment-based and GEP-based separately for completeness) Thanks!


================
Comment at: llvm/test/Transforms/AggressiveInstCombine/patterned-load.ll:86
   ret i32 %2
 }
 
----------------
nikic wrote:
> I don't get how this one folds with just this patch. If align 1 we have stride 1, but constarray1 needs a stride of 2, no?
Ah, sorry seems like I just forgot to commit test changes...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144445/new/

https://reviews.llvm.org/D144445



More information about the llvm-commits mailing list