aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/RustDemangle.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2021-06-23 11:31:22 -0400
committerSanjay Patel <spatel@rotateright.com>2021-06-23 11:46:46 -0400
commit656001e7b2b939d9bce4fb58831d314dc67ddf7a (patch)
tree041ab02d7fed6ebf349559c1695bce62863d7052 /llvm/lib/Demangle/RustDemangle.cpp
parent8cfc08013299d873edd364436aa78e7effb28dd4 (diff)
downloadllvm-656001e7b2b939d9bce4fb58831d314dc67ddf7a.zip
llvm-656001e7b2b939d9bce4fb58831d314dc67ddf7a.tar.gz
llvm-656001e7b2b939d9bce4fb58831d314dc67ddf7a.tar.bz2
[ValueTracking] look through bitcast of vector in computeKnownBits
This borrows as much as possible from the SDAG version of the code (originally added with D27129 and since updated with big endian support). In IR, we can test more easily for correctness than we did in the original patch. I'm using the simplest cases that I could find for InstSimplify: we computeKnownBits on variable shift amounts to see if they are zero or in range. So shuffle constant elements into a vector, cast it, and shift it. The motivating x86 example from https://llvm.org/PR50123 is also here. We computeKnownBits in the caller code, but we only check if the shift amount is in range. That could be enhanced to catch the 2nd x86 test - if the shift amount is known too big, the result is 0. Alive2 understands the datalayout and agrees that the tests here are correct - example: https://alive2.llvm.org/ce/z/KZJFMZ Differential Revision: https://reviews.llvm.org/D104472
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
0 files changed, 0 insertions, 0 deletions