1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -load-store-vectorizer -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
3 ; RUN: opt < %s -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
5 %rec = type { i32, i28 }
7 ; We currently do not optimize this scenario.
8 ; But we verify that we no longer crash when compiling this.
9 define void @test1(%rec* %out, %rec* %in) {
10 ; CHECK-LABEL: @test1(
11 ; CHECK-NEXT: [[IN1:%.*]] = getelementptr [[REC:%.*]], %rec* [[IN:%.*]], i16 0, i32 0
12 ; CHECK-NEXT: [[IN2:%.*]] = getelementptr [[REC]], %rec* [[IN]], i16 0, i32 1
13 ; CHECK-NEXT: [[VAL1:%.*]] = load i32, i32* [[IN1]], align 8
14 ; CHECK-NEXT: [[VAL2:%.*]] = load i28, i28* [[IN2]]
15 ; CHECK-NEXT: [[OUT1:%.*]] = getelementptr [[REC]], %rec* [[OUT:%.*]], i16 0, i32 0
16 ; CHECK-NEXT: [[OUT2:%.*]] = getelementptr [[REC]], %rec* [[OUT]], i16 0, i32 1
17 ; CHECK-NEXT: store i32 [[VAL1]], i32* [[OUT1]], align 8
18 ; CHECK-NEXT: store i28 [[VAL2]], i28* [[OUT2]]
19 ; CHECK-NEXT: ret void
21 %in1 = getelementptr %rec, %rec* %in, i16 0, i32 0
22 %in2 = getelementptr %rec, %rec* %in, i16 0, i32 1
23 %val1 = load i32, i32* %in1, align 8
24 %val2 = load i28, i28* %in2
25 %out1 = getelementptr %rec, %rec* %out, i16 0, i32 0
26 %out2 = getelementptr %rec, %rec* %out, i16 0, i32 1
27 store i32 %val1, i32* %out1, align 8
28 store i28 %val2, i28* %out2