diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-11-12 22:11:09 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-11-12 22:11:09 +0000 |
commit | 98e427ccf2a78bf8811a9cce4791048a12a18007 (patch) | |
tree | 872e34cea7856848c1d997eaf802990107df0b87 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | e44a55dc98e0a311cf1f169681f21ca000ef39f8 (diff) | |
download | llvm-98e427ccf2a78bf8811a9cce4791048a12a18007.zip llvm-98e427ccf2a78bf8811a9cce4791048a12a18007.tar.gz llvm-98e427ccf2a78bf8811a9cce4791048a12a18007.tar.bz2 |
[InstCombine] narrow width of rotate patterns, part 2 (PR39624)
The sub-pattern for the shift amount in a rotate can take on
several different forms, and there's apparently no way to
canonicalize those without seeing the entire rotate sequence.
This is the form noted in:
https://bugs.llvm.org/show_bug.cgi?id=39624
https://rise4fun.com/Alive/qnT
%zx = zext i8 %x to i32
%maskedShAmt = and i32 %shAmt, 7
%shl = shl i32 %zx, %maskedShAmt
%negShAmt = sub i32 0, %shAmt
%maskedNegShAmt = and i32 %negShAmt, 7
%shr = lshr i32 %zx, %maskedNegShAmt
%rot = or i32 %shl, %shr
%r = trunc i32 %rot to i8
=>
%truncShAmt = trunc i32 %shAmt to i8
%maskedShAmt2 = and i8 %truncShAmt, 7
%shl2 = shl i8 %x, %maskedShAmt2
%negShAmt2 = sub i8 0, %truncShAmt
%maskedNegShAmt2 = and i8 %negShAmt2, 7
%shr2 = lshr i8 %x, %maskedNegShAmt2
%r = or i8 %shl2, %shr2
llvm-svn: 346713
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions