Skip to content

Commit 0b98a59

Browse files
committed
[VectorCombine] add tests for vector loads; NFC
1 parent 45901eb commit 0b98a59

File tree

1 file changed

+26
-0
lines changed
  • llvm/test/Transforms/VectorCombine/X86

1 file changed

+26
-0
lines changed

llvm/test/Transforms/VectorCombine/X86/load.ll

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,3 +373,29 @@ define <8 x i32> @casted_load_i32_insert_v8i32(<4 x i32>* align 4 dereferenceabl
373373
%r = insertelement <8 x i32> undef, i32 %s, i32 0
374374
ret <8 x i32> %r
375375
}
376+
377+
; TODO: Should load v4f32.
378+
379+
define <8 x float> @load_f32_insert_v8f32(float* align 16 dereferenceable(16) %p) {
380+
; CHECK-LABEL: @load_f32_insert_v8f32(
381+
; CHECK-NEXT: [[S:%.*]] = load float, float* [[P:%.*]], align 4
382+
; CHECK-NEXT: [[R:%.*]] = insertelement <8 x float> undef, float [[S]], i32 0
383+
; CHECK-NEXT: ret <8 x float> [[R]]
384+
;
385+
%s = load float, float* %p, align 4
386+
%r = insertelement <8 x float> undef, float %s, i32 0
387+
ret <8 x float> %r
388+
}
389+
390+
; TODO: Should load v4f32.
391+
392+
define <2 x float> @load_f32_insert_v2f32(float* align 16 dereferenceable(16) %p) {
393+
; CHECK-LABEL: @load_f32_insert_v2f32(
394+
; CHECK-NEXT: [[S:%.*]] = load float, float* [[P:%.*]], align 4
395+
; CHECK-NEXT: [[R:%.*]] = insertelement <2 x float> undef, float [[S]], i32 0
396+
; CHECK-NEXT: ret <2 x float> [[R]]
397+
;
398+
%s = load float, float* %p, align 4
399+
%r = insertelement <2 x float> undef, float %s, i32 0
400+
ret <2 x float> %r
401+
}

0 commit comments

Comments
 (0)