Skip to content

Commit a0ebac4

Browse files
committed
[InstSimplify] add tests for rotates of 0/-1; NFC
1 parent 8533e78 commit a0ebac4

File tree

1 file changed

+36
-0
lines changed
  • llvm/test/Transforms/InstSimplify

1 file changed

+36
-0
lines changed

llvm/test/Transforms/InstSimplify/call.ll

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,42 @@ define i9 @fshr_ops_poison6() {
958958
ret i9 %r
959959
}
960960

961+
define i8 @fshl_zero(i8 %shamt) {
962+
; CHECK-LABEL: @fshl_zero(
963+
; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 0, i8 0, i8 [[SHAMT:%.*]])
964+
; CHECK-NEXT: ret i8 [[R]]
965+
;
966+
%r = call i8 @llvm.fshl.i8(i8 0, i8 0, i8 %shamt)
967+
ret i8 %r
968+
}
969+
970+
define <2 x i8> @fshr_zero_vec(<2 x i8> %shamt) {
971+
; CHECK-LABEL: @fshr_zero_vec(
972+
; CHECK-NEXT: [[R:%.*]] = call <2 x i8> @llvm.fshr.v2i8(<2 x i8> zeroinitializer, <2 x i8> <i8 0, i8 undef>, <2 x i8> [[SHAMT:%.*]])
973+
; CHECK-NEXT: ret <2 x i8> [[R]]
974+
;
975+
%r = call <2 x i8> @llvm.fshr.v2i8(<2 x i8> zeroinitializer, <2 x i8> <i8 0, i8 undef>, <2 x i8> %shamt)
976+
ret <2 x i8> %r
977+
}
978+
979+
define <2 x i7> @fshl_ones_vec(<2 x i7> %shamt) {
980+
; CHECK-LABEL: @fshl_ones_vec(
981+
; CHECK-NEXT: [[R:%.*]] = call <2 x i7> @llvm.fshl.v2i7(<2 x i7> <i7 undef, i7 -1>, <2 x i7> <i7 -1, i7 undef>, <2 x i7> [[SHAMT:%.*]])
982+
; CHECK-NEXT: ret <2 x i7> [[R]]
983+
;
984+
%r = call <2 x i7> @llvm.fshl.v2i7(<2 x i7> <i7 undef, i7 -1>, <2 x i7> <i7 -1, i7 undef>, <2 x i7> %shamt)
985+
ret <2 x i7> %r
986+
}
987+
988+
define i9 @fshr_ones(i9 %shamt) {
989+
; CHECK-LABEL: @fshr_ones(
990+
; CHECK-NEXT: [[R:%.*]] = call i9 @llvm.fshr.i9(i9 -1, i9 -1, i9 [[SHAMT:%.*]])
991+
; CHECK-NEXT: ret i9 [[R]]
992+
;
993+
%r = call i9 @llvm.fshr.i9(i9 -1, i9 -1, i9 %shamt)
994+
ret i9 %r
995+
}
996+
961997
declare double @llvm.fma.f64(double,double,double)
962998
declare double @llvm.fmuladd.f64(double,double,double)
963999

0 commit comments

Comments
 (0)