[PATCH] D137632: [LoopPredication] Widen checks if condition operands constant ranges are known
Dmitry Makogon via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 29 00:21:41 PST 2022
dmakogon marked 10 inline comments as done.
dmakogon added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopPredication.cpp:404-405
+
+ auto &DL = L.getHeader()->getModule()->getDataLayout();
+ LazyValueInfo LVI(&AR.AC, &DL, &AR.TLI);
+
----------------
apilipenko wrote:
> This is a non-canonical way to get an analysis. This way it will not benefit from analysis manager caching. I guess you have to do this because LVI is a function analysis but a part of LoopStandardAnalysisResults.
>
> I'm not sure how we should go about it, but I suggest splitting the LVI off from the initial patch. You can still get the constant range from ValueTracking to get the basic version of this optimization.
Removed LVI from this patch. Please note the test changes. I explicitly inserted assumes of dominating branches conditions to allow for the widening to happen
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137632/new/
https://reviews.llvm.org/D137632
More information about the llvm-commits
mailing list