llvm-project/llvm/lib/Transforms/InstCombine
Sanjay Patel 35b1c2d19d [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
2018-11-12 22:52:25 +00:00
..
CMakeLists.txt InstCombine/AMDGPU: Add dimension-aware image intrinsics to SimplifyDemanded 2018-06-21 13:37:31 +00:00
InstCombineAddSub.cpp [InstCombine] name change: foldShuffledBinop -> foldVectorBinop; NFC 2018-10-03 15:20:58 +00:00
InstCombineAndOrXor.cpp [InstCombine] try harder to form select from logic ops (2nd try) 2018-10-24 15:17:56 +00:00
InstCombineCalls.cpp [GC][InstCombine] Fix a potential iteration issue 2018-11-12 20:00:53 +00:00
InstCombineCasts.cpp [InstCombine] narrow width of rotate patterns, part 3 2018-11-12 22:52:25 +00:00
InstCombineCompares.cpp [InstCombine] propagate FMF for fcmp+fabs folds 2018-11-07 16:15:01 +00:00
InstCombineInternal.h [InstCombine] simplify code for merging stores; NFCI 2018-11-10 20:29:25 +00:00
InstCombineLoadStoreAlloca.cpp [InstCombine] simplify code for merging stores; NFCI 2018-11-10 20:29:25 +00:00
InstCombineMulDivRem.cpp Add a emitUnaryFloatFnCall version that fetches the function name from TLI 2018-10-18 06:27:53 +00:00
InstCombinePHI.cpp Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC 2018-10-19 06:12:02 +00:00
InstCombineSelect.cpp [InstSimplify] fold select (fcmp X, Y), X, Y 2018-11-05 21:51:39 +00:00
InstCombineShifts.cpp [InstCombine] Ensure nested shifts are in range (OSS-Fuzz #9880) 2018-11-06 11:28:22 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine] Demand bits of UMin 2018-10-11 11:28:27 +00:00
InstCombineTables.td InstCombine/AMDGPU: Add dimension-aware image intrinsics to SimplifyDemanded 2018-06-21 13:37:31 +00:00
InstCombineVectorOps.cpp [InstCombine] try to turn shuffle into insertelement 2018-10-30 15:26:39 +00:00
InstructionCombining.cpp fix typos aggressively; NFC 2018-11-07 14:35:36 +00:00
LLVMBuild.txt