Skip to content

Commit 5cb140c

Browse files
committed
Precommit tests
1 parent 64555e3 commit 5cb140c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

llvm/test/Transforms/InstCombine/shl-bo.ll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,3 +656,14 @@ define <16 x i8> @test_FoldShiftByConstant_CreateAnd(<16 x i8> %in0) {
656656
%vshl_n = shl <16 x i8> %tmp, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
657657
ret <16 x i8> %vshl_n
658658
}
659+
660+
define <vscale x 1 x i8> @test_FoldShiftByConstant_CreateAnd_scalable(<vscale x 1 x i8> %x) {
661+
; CHECK-LABEL: @test_FoldShiftByConstant_CreateAnd_scalable(
662+
; CHECK-NEXT: [[TMP1:%.*]] = and <vscale x 1 x i8> [[X:%.*]], splat (i8 2)
663+
; CHECK-NEXT: [[TMP2:%.*]] = shl nuw nsw <vscale x 1 x i8> [[TMP1]], splat (i8 2)
664+
; CHECK-NEXT: ret <vscale x 1 x i8> [[TMP2]]
665+
;
666+
%1 = and <vscale x 1 x i8> %x, splat (i8 2)
667+
%2 = shl <vscale x 1 x i8> %1, splat (i8 2)
668+
ret <vscale x 1 x i8> %2
669+
}

llvm/test/Transforms/InstCombine/shl-twice-constant.ll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@ define i64 @testfunc() {
1414
%shl2 = shl i64 %shl1, ptrtoint (ptr @c to i64)
1515
ret i64 %shl2
1616
}
17+
18+
define <vscale x 1 x i64> @scalable() {
19+
; CHECK-LABEL: @scalable(
20+
; CHECK-NEXT: [[SHL1:%.*]] = shl nuw <vscale x 1 x i64> splat (i64 1), shufflevector (<vscale x 1 x i64> insertelement (<vscale x 1 x i64> poison, i64 ptrtoint (ptr @c2 to i64), i64 0), <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer)
21+
; CHECK-NEXT: [[SHL2:%.*]] = shl <vscale x 1 x i64> [[SHL1]], shufflevector (<vscale x 1 x i64> insertelement (<vscale x 1 x i64> poison, i64 ptrtoint (ptr @c to i64), i64 0), <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer)
22+
; CHECK-NEXT: ret <vscale x 1 x i64> [[SHL2]]
23+
;
24+
%shl1 = shl <vscale x 1 x i64> splat (i64 1), splat (i64 ptrtoint (ptr @c2 to i64))
25+
%shl2 = shl <vscale x 1 x i64> %shl1, splat (i64 ptrtoint (ptr @c to i64))
26+
ret <vscale x 1 x i64> %shl2
27+
}

0 commit comments

Comments
 (0)