[PATCH] D144445: [AggressiveInstCombine] folding load for constant global patterened arrays and structs by alignment
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 07:02:59 PDT 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:855-880
+ std::optional<APInt> Stride;
+ APInt ConstOffset = APInt(BW, 0);
+ if (isa<GlobalVariable>(PtrOp)) {
+ Stride = APInt(BW, 1);
+ }
+
+ // Any possible offset could be multiple of GEP stride. And any valid
----------------
Some simplifications.
I think as far as foldPatternedLoads is concerned, we don't need the std::optional around Stride, because a Stride of 1 is always conservatively correct. It's only relevant internally while calculating GEP stride in the next patch.
================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:856
+ std::optional<APInt> Stride;
+ APInt ConstOffset = APInt(BW, 0);
+ if (isa<GlobalVariable>(PtrOp)) {
----------------
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144445/new/
https://reviews.llvm.org/D144445
More information about the llvm-commits
mailing list