summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-10-04 22:16:11 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-10-04 22:16:11 +0000
commitf304d4d185d24eec9f0ca84d566da0d51b2344ef (patch)
tree515be38bbf0d6a835b9600b54647ebd0bfd63912 /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
parentae738641d53e06b30b1189aedaa1c3dddd8d371d (diff)
downloadbcm5719-llvm-f304d4d185d24eec9f0ca84d566da0d51b2344ef.tar.gz
bcm5719-llvm-f304d4d185d24eec9f0ca84d566da0d51b2344ef.zip
[InstCombine] Right-shift shift amount reassociation with truncation (PR43564, PR42391)
Initially (D65380) i believed that if we have rightshift-trunc-rightshift, we can't do any folding. But as it usually happens, i was wrong. https://rise4fun.com/Alive/GEw https://rise4fun.com/Alive/gN2O In https://bugs.llvm.org/show_bug.cgi?id=43564 we happen to have this very sequence, of two right shifts separated by trunc. And "just" so that happens, we apparently can fold the pattern if the total shift amount is either 0, or it's equal to the bitwidth of the innermost widest shift - i.e. if we are left with only the original sign bit. Which is exactly what is wanted there. llvm-svn: 373801
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud