diff options
author | Sanjay Patel <spatel@rotateright.com> | 2021-12-30 12:01:06 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2021-12-30 12:01:06 -0500 |
commit | 0c6979b2d64d97298671ba7ed44d1446c9f302cf (patch) | |
tree | 5d12ad2a18ef33e7fdad67570df11c8971b0c0ca /llvm/unittests/Support/CommandLineTest.cpp | |
parent | fd9cd3408baff99e4982be5357057909b7b2b005 (diff) | |
download | llvm-0c6979b2d64d97298671ba7ed44d1446c9f302cf.zip llvm-0c6979b2d64d97298671ba7ed44d1446c9f302cf.tar.gz llvm-0c6979b2d64d97298671ba7ed44d1446c9f302cf.tar.bz2 |
[InstCombine] fold opposite shifts around an add
((X << C) + Y) >>u C --> (X + (Y >>u C)) & (-1 >>u C)
https://alive2.llvm.org/ce/z/DY9DPg
This replaces a shift with an 'and', and in the case
where the add has a constant operand, it eliminates
both shifts.
As noted in the TODO comment, we already have this fold when
the shifts are in the opposite order (and that code handles
bitwise logic ops too).
Fixes #52851
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions