[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 00:21:47 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:1705
+        unsigned FirstZeroBit = 64 - countLeadingZeros(MaxVScale);
+        unsigned VScaleTypeSize = Q.DL.getTypeSizeInBits(II->getType()->getScalarType());
+        if (FirstZeroBit < VScaleTypeSize)
----------------
dmgreen wrote:
> Will VScaleTypeSize be BitWidth?
I can't see anything in the code that guarantees the result type of an instruction will have the same width as Known. However, I'm not sure this really matters? If VScaleTypeSize < BitWidth, then I'd expect any bits above BitWidth to also be zero. I looked at Instruction::ZExt as a guide just now and we first truncate Known to be the same as the input, compute the bits on that, then zero-extend back to the original BitWidth.

What specific problem were you worried about here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109883



More information about the llvm-commits mailing list