[PATCH] D109883: [Analysis] Add support for vscale in computeKnownBitsFromOperator

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 17 05:20:19 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:1710
+        if (FirstSetBit <= BitWidth)
+          Known.Zero.setLowBits(FirstSetBit);
+
----------------
david-arm wrote:
> 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.
Well, you could still deduce *some* extra info from an arbitrary (min,max) pair, but it's probably overkill to try to implement that in this patch. Maybe we should have general helpers for that sort of thing. It could be useful in value tracking passes to be able to convert a known value range into known bits, and vice versa.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109883/new/

https://reviews.llvm.org/D109883



More information about the llvm-commits mailing list