diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-06-28 17:48:04 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-06-28 17:48:04 +0000 |
commit | 57bda365bfcee4708ea9ccde1d2a5e1fbf61c5ec (patch) | |
tree | f0eb1482011a03e89e429a821add0f11beb26187 /lldb/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py | |
parent | dafa198c96d29b5cb3694494a3cb01da72745772 (diff) | |
download | bcm5719-llvm-57bda365bfcee4708ea9ccde1d2a5e1fbf61c5ec.tar.gz bcm5719-llvm-57bda365bfcee4708ea9ccde1d2a5e1fbf61c5ec.zip |
[InstCombine] allow shl+mul combos with shuffle (select) fold (PR37806)
This is an enhancement to D48401 that was discussed in:
https://bugs.llvm.org/show_bug.cgi?id=37806
We can convert a shift-left-by-constant into a multiply (we canonicalize IR in the other
direction because that's generally better of course). This allows us to remove the shuffle
as we do in the regular opcodes-are-the-same cases.
This requires a small hack to make sure we don't introduce any extra poison:
https://rise4fun.com/Alive/ZGv
Other examples of opcodes where this would work are add+sub and fadd+fsub, but we already
canonicalize those subs into adds, so there's nothing to do for those cases AFAICT. There
are planned enhancements for opcode transforms such or -> add.
Note that there's a different fold needed if we've already managed to simplify away a binop
as seen in the test based on PR37806, but we manage to get that one case here because this
fold is positioned above the demanded elements fold currently.
Differential Revision: https://reviews.llvm.org/D48485
llvm-svn: 335888
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py')
0 files changed, 0 insertions, 0 deletions