[PATCH] D109883: [Analysis] Add support for vscale in computeKnownBitsFromOperator
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 17 05:11:05 PDT 2021
david-arm added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:1708
+
+ unsigned FirstSetBit = findFirstSet(VScaleRange.first);
+ if (FirstSetBit <= BitWidth)
----------------
foad wrote:
> Can min ever be zero here?
Yeah min can be zero. I think see the problem now because FirstSetBit will be set to UINT_MAX.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:1710
+ if (FirstSetBit <= BitWidth)
+ Known.Zero.setLowBits(FirstSetBit);
+
----------------
foad wrote:
> This assumes that vscale is a multiple of min, which is not documented in the langref.
Yes you're absolutely right. Of course if min=4, then a value of 5 would still set bit 0 too. I think that means I can only use min to check if it's equal to max.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109883/new/
https://reviews.llvm.org/D109883
More information about the llvm-commits
mailing list