Skip to content

Commit 95606a5

Browse files
committed
[VectorCombine] Add tests for #67060 (NFC)
1 parent 01aa0c7 commit 95606a5

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,18 @@ define i31 @load_with_non_power_of_2_element_type(ptr %x) {
656656
ret i31 %r
657657
}
658658

659+
; FIXME: This is a miscompile.
660+
define i1 @load_with_non_power_of_2_element_type_2(ptr %x) {
661+
; CHECK-LABEL: @load_with_non_power_of_2_element_type_2(
662+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds <8 x i1>, ptr [[X:%.*]], i32 0, i32 1
663+
; CHECK-NEXT: [[R:%.*]] = load i1, ptr [[TMP1]], align 1
664+
; CHECK-NEXT: ret i1 [[R]]
665+
;
666+
%lv = load <8 x i1>, ptr %x
667+
%r = extractelement <8 x i1> %lv, i32 1
668+
ret i1 %r
669+
}
670+
659671
; Scalarizing the load for multiple constant indices may not be profitable.
660672
define i32 @load_multiple_extracts_with_constant_idx(ptr %x) {
661673
; CHECK-LABEL: @load_multiple_extracts_with_constant_idx(

llvm/test/Transforms/VectorCombine/load-insert-store.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ entry:
107107
ret void
108108
}
109109

110+
; FIXME: This is a miscompile.
111+
define void @insert_store_v32i1(ptr %p) {
112+
; CHECK-LABEL: @insert_store_v32i1(
113+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds <32 x i1>, ptr [[P:%.*]], i64 0, i64 0
114+
; CHECK-NEXT: store i1 true, ptr [[TMP1]], align 4
115+
; CHECK-NEXT: ret void
116+
;
117+
%vec = load <32 x i1>, ptr %p
118+
%ins = insertelement <32 x i1> %vec, i1 true, i64 0
119+
store <32 x i1> %ins, ptr %p
120+
ret void
121+
}
122+
110123
define void @insert_store_blk_differ(ptr %q, i16 zeroext %s) {
111124
; CHECK-LABEL: @insert_store_blk_differ(
112125
; CHECK-NEXT: entry:

0 commit comments

Comments
 (0)