[PATCH] D109309: [LoopFlatten] Make the analysis more robust after IV widening
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 8 00:37:12 PDT 2021
SjoerdMeijer added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:443
+ // Look through extends if the IV has been widened.
+ if (FI.Widened && isa<SExtInst>(MatchedItCount))
+ MatchedItCount = dyn_cast<SExtInst>(MatchedItCount)->getOperand(0);
----------------
dmgreen wrote:
> Do we know this is always valid? For any sext? Or do we need to check the types match the new IV?
Yes, I believe this is always valid. This is after widening, when all loop components and checks have been performed (twice actually, one on the narrow IV, and again on the wide IV). Thus, when there is an extend in the way at this point, I believe it is always in the shape that we expect it. But I will add an assert for the matching types, and check that MatchedItCount isn't null.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109309/new/
https://reviews.llvm.org/D109309
More information about the llvm-commits
mailing list