summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/process/main.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-07-19 08:26:37 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-07-19 08:26:37 +0000
commit3c212ce3054a94d8f501a8d0184c4e298964e8ec (patch)
treed08b1baa0e7a47f0b555db6370d5e45865765c19 /lldb/packages/Python/lldbsuite/test/python_api/process/main.cpp
parent2ebe57386d65a60906036cb04d66c84da82c8fff (diff)
downloadbcm5719-llvm-3c212ce3054a94d8f501a8d0184c4e298964e8ec.tar.gz
bcm5719-llvm-3c212ce3054a94d8f501a8d0184c4e298964e8ec.zip
[InstCombine] Dropping redundant masking before left-shift [3/5] (PR42563)
Summary: If we have some pattern that leaves only some low bits set, and then performs left-shift of those bits, if none of the bits that are left after the final shift are modified by the mask, we can omit the mask. There are many variants to this pattern: d. `(x & ((-1 << MaskShAmt) >> MaskShAmt)) << ShiftShAmt` All these patterns can be simplified to just: `x << ShiftShAmt` iff: d. `(ShiftShAmt-MaskShAmt) s>= 0` (i.e. `ShiftShAmt u>= MaskShAmt`) alive proofs: d: https://rise4fun.com/Alive/I5Y For now let's start with patterns where both shift amounts are variable, with trivial constant "offset" between them, since i believe this is both simplest to handle and i think this is most common. But again, there are likely other variants where we could use ValueTracking/ConstantRange to handle more cases. https://bugs.llvm.org/show_bug.cgi?id=42563 Differential Revision: https://reviews.llvm.org/D64519 llvm-svn: 366538
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/process/main.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud