[PATCH] D154717: [LV] Check if ops can safely be truncated in computeMinimumValueSizes.
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 7 12:58:28 PDT 2023
nikic added inline comments.
================
Comment at: llvm/lib/Analysis/VectorUtils.cpp:678
+ if (I.trunc(MinBW).zext(I.getBitWidth()) == I)
+ return false;
+ }
----------------
Hm, is this special case for constants correct? Consider a variant on the test case that does something like `%l = shl i32 %f, 24`. Then only the low 8 bits of `%f` would be demanded, and `24` can be truncated to 8 bits, but it still changes the result: Now the shift would return poison (while previously the shl + trunc would produce zero).
================
Comment at: llvm/lib/Analysis/VectorUtils.cpp:680
+ }
+ uint64_t BW = bit_width(DB.getDemandedBits(&U).getZExtValue());
+ return bit_ceil(BW) > MinBW;
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154717/new/
https://reviews.llvm.org/D154717
More information about the llvm-commits
mailing list