summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-07-19 08:25:43 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-07-19 08:25:43 +0000
commita5f0824eb518ba82e4395b11e4207eaf5197556d (patch)
tree3539ee2e62fd0de599073b6d4818af9cbe826b61 /lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
parent3628d948f59365d4e1a12f67b77d9ee6a9e73227 (diff)
downloadbcm5719-llvm-a5f0824eb518ba82e4395b11e4207eaf5197556d.tar.gz
bcm5719-llvm-a5f0824eb518ba82e4395b11e4207eaf5197556d.zip
[InstCombine] Dropping redundant masking before left-shift [0/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: a. `(x & ((1 << MaskShAmt) - 1)) << ShiftShAmt` All these patterns can be simplified to just: `x << ShiftShAmt` iff: a. `(MaskShAmt+ShiftShAmt) u>= bitwidth(x)` alive proof: a: https://rise4fun.com/Alive/wi9 Indeed, not all of these patterns are canonical. But since this fold will only produce a single instruction i'm really interested in handling even uncanonical patterns, since i have this general kind of pattern in hotpaths, and it is not totally outlandish for bit-twiddling code. 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 Reviewers: spatel, nikic, huihuiz, xbolva00 Reviewed By: xbolva00 Subscribers: efriedma, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64512 llvm-svn: 366535
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud