1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -mtriple=amdgcn-amd-amdhsa -passes=load-store-vectorizer -S -o - %s | FileCheck %s
4 ; Vectorize and emit valid code (Issue #54896).
7 @S = external global %S
10 ; CHECK-LABEL: @order(
11 ; CHECK-NEXT: [[IDX0:%.*]] = getelementptr inbounds [[S:%.*]], ptr @S, i32 0, i32 0
12 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[IDX0]], align 8
13 ; CHECK-NEXT: [[L01:%.*]] = extractelement <2 x i64> [[TMP1]], i32 0
14 ; CHECK-NEXT: [[L12:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
15 ; CHECK-NEXT: [[ADD:%.*]] = add i64 [[L01]], [[L12]]
16 ; CHECK-NEXT: ret i64 [[ADD]]
18 %idx1 = getelementptr inbounds %S, ptr @S, i32 0, i32 1
19 %l1 = load i64, ptr %idx1, align 8
20 %idx0 = getelementptr inbounds %S, ptr @S, i32 0, i32 0
21 %l0 = load i64, ptr %idx0, align 8
22 %add = add i64 %l0, %l1