File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1068,3 +1068,18 @@ entry:
10681068 %res = call <2 x i31 > @llvm.fshl.v2i31 (<2 x i31 > %x , <2 x i31 > zeroinitializer , <2 x i31 > %y )
10691069 ret <2 x i31 > %res
10701070}
1071+
1072+ define i8 @fshl_range_trunc (i1 %x ) {
1073+ ; CHECK-LABEL: @fshl_range_trunc(
1074+ ; CHECK-NEXT: [[ZEXT:%.*]] = zext i1 [[X:%.*]] to i32
1075+ ; CHECK-NEXT: [[OR:%.*]] = or disjoint i32 [[ZEXT]], 126
1076+ ; CHECK-NEXT: [[FSHL:%.*]] = call range(i32 -4, 2) i32 @llvm.fshl.i32(i32 [[OR]], i32 -2, i32 1)
1077+ ; CHECK-NEXT: [[TR:%.*]] = trunc nuw i32 [[FSHL]] to i8
1078+ ; CHECK-NEXT: ret i8 [[TR]]
1079+ ;
1080+ %zext = zext i1 %x to i32
1081+ %or = or disjoint i32 %zext , -2
1082+ %fshl = call range(i32 -4 , 2 ) i32 @llvm.fshl.i32 (i32 %or , i32 %or , i32 1 )
1083+ %tr = trunc nsw i32 %fshl to i8
1084+ ret i8 %tr
1085+ }
You can’t perform that action at this time.
0 commit comments