diff options
author | Sanjay Patel <spatel@rotateright.com> | 2020-11-15 15:08:41 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2020-11-15 15:09:49 -0500 |
commit | e56103d25016c9ce4e98f652ac1a09379793ccf5 (patch) | |
tree | 9eccfef60394929165228d2905bf48553bcb755e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 91aa211ea168306ba5d13830806f44aa41e1b5bc (diff) | |
download | llvm-e56103d25016c9ce4e98f652ac1a09379793ccf5.zip llvm-e56103d25016c9ce4e98f652ac1a09379793ccf5.tar.gz llvm-e56103d25016c9ce4e98f652ac1a09379793ccf5.tar.bz2 |
[InstCombine] add multi-use demanded bits fold for add with low-bit mask
I noticed an add example like the one from D91343, so here's a similar patch.
The logic is based on existing code for the single-use demanded bits fold.
But I only matched a constant instead of using compute known bits on the
operands because that was the motivating patterni that I noticed.
I think this will allow removing a special-case (but incomplete) dedicated
fold within visitAnd(), but I need to untangle the existing code to be sure.
https://rise4fun.com/Alive/V6fP
Name: add with low mask
Pre: (C1 & (-1 u>> countLeadingZeros(C2))) == 0
%a = add i8 %x, C1
%r = and i8 %a, C2
=>
%r = and i8 %x, C2
Differential Revision: https://reviews.llvm.org/D91415
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions