diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-11-12 22:52:25 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-11-12 22:52:25 +0000 |
commit | 35b1c2d19db5ba9e8340b4049f0f5283ed022279 (patch) | |
tree | b2c671c6b328ff3292351900283a5bab50fafabe /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 22dc538618a76c61117512afb83a08d7fd7f4995 (diff) | |
download | llvm-35b1c2d19db5ba9e8340b4049f0f5283ed022279.zip llvm-35b1c2d19db5ba9e8340b4049f0f5283ed022279.tar.gz llvm-35b1c2d19db5ba9e8340b4049f0f5283ed022279.tar.bz2 |
[InstCombine] narrow width of rotate patterns, part 3
This is a longer variant for the pattern handled in
rL346713
This one includes zexts.
Eventually, we should canonicalize all rotate patterns
to the funnel shift intrinsics, but we need a bit more
infrastructure to make sure the vectorizers handle those
intrinsics as well as the shift+logic ops.
https://rise4fun.com/Alive/FMn
Name: narrow rotateright
%neg = sub i8 0, %shamt
%rshamt = and i8 %shamt, 7
%rshamtconv = zext i8 %rshamt to i32
%lshamt = and i8 %neg, 7
%lshamtconv = zext i8 %lshamt to i32
%conv = zext i8 %x to i32
%shr = lshr i32 %conv, %rshamtconv
%shl = shl i32 %conv, %lshamtconv
%or = or i32 %shl, %shr
%r = trunc i32 %or to i8
=>
%maskedShAmt2 = and i8 %shamt, 7
%negShAmt2 = sub i8 0, %shamt
%maskedNegShAmt2 = and i8 %negShAmt2, 7
%shl2 = lshr i8 %x, %maskedShAmt2
%shr2 = shl i8 %x, %maskedNegShAmt2
%r = or i8 %shl2, %shr2
llvm-svn: 346716
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions