[PATCH] D154953: [InstCombine] Remove the remainder loop if we know the mask is always true
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 02:38:28 PDT 2023
paulwalker-arm added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2019-2023
+ Attribute Attr = F->getFnAttribute(Attribute::VScaleRange);
+ unsigned AttrMin = Attr.getVScaleRangeMin();
+ std::optional<unsigned> AttrMax = Attr.getVScaleRangeMax();
+ // Reject if they are not power-of-two.
+ return isPowerOf2_32(AttrMin) && isPowerOf2_32(*AttrMax);
----------------
Based on my suggestion you shouldn't need to check the values of the `vscale_range` attribute. Simply having the attribute is enough to imply the power-of-two-ness.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154953/new/
https://reviews.llvm.org/D154953
More information about the llvm-commits
mailing list