[llvm] 34c0ed5 - test/Transforms/Scalarizer: re-run update_test_checks.py
Nicolai Hähnle via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 5 12:25:21 PST 2022
Author: Nicolai Hähnle
Date: 2022-12-05T21:24:48+01:00
New Revision: 34c0ed58d20339d294862502f789069828bc2d07
URL: https://github.com/llvm/llvm-project/commit/34c0ed58d20339d294862502f789069828bc2d07
DIFF: https://github.com/llvm/llvm-project/commit/34c0ed58d20339d294862502f789069828bc2d07.diff
LOG: test/Transforms/Scalarizer: re-run update_test_checks.py
Goal is to get a cleaner diff in an upcoming functional change.
Added:
Modified:
llvm/test/Transforms/Scalarizer/basic-inseltpoison.ll
llvm/test/Transforms/Scalarizer/basic.ll
llvm/test/Transforms/Scalarizer/constant-extractelement.ll
llvm/test/Transforms/Scalarizer/constant-insertelement.ll
llvm/test/Transforms/Scalarizer/order-bug-inseltpoison.ll
llvm/test/Transforms/Scalarizer/order-bug.ll
llvm/test/Transforms/Scalarizer/phi-order.ll
llvm/test/Transforms/Scalarizer/scatter-order.ll
llvm/test/Transforms/Scalarizer/variable-extractelement.ll
llvm/test/Transforms/Scalarizer/vector-gep.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Scalarizer/basic-inseltpoison.ll b/llvm/test/Transforms/Scalarizer/basic-inseltpoison.ll
index 68f132b3a3080..ab6ae39300d65 100644
--- a/llvm/test/Transforms/Scalarizer/basic-inseltpoison.ll
+++ b/llvm/test/Transforms/Scalarizer/basic-inseltpoison.ll
@@ -174,20 +174,20 @@ exit:
define void @f3(ptr %src, ptr %dst) {
; CHECK-LABEL: @f3(
; CHECK-NEXT: [[DST_I1:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 1
-; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
-; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 3
+; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
+; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16, !tbaa [[TBAA0:![0-9]+]]
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4, !tbaa [[TBAA0]]
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8, !tbaa [[TBAA0]]
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4, !tbaa [[TBAA0]]
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST:%.*]], align 16, !tbaa [[TBAA3:![0-9]+]]
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST]], align 16, !tbaa [[TBAA3:![0-9]+]]
; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[DST_I1]], align 4, !tbaa [[TBAA3]]
; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[DST_I2]], align 8, !tbaa [[TBAA3]]
; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[DST_I3]], align 4, !tbaa [[TBAA3]]
@@ -203,20 +203,20 @@ define void @f3(ptr %src, ptr %dst) {
define void @f4(ptr %src, ptr %dst) {
; CHECK-LABEL: @f4(
; CHECK-NEXT: [[DST_I1:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 1
-; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
-; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 3
+; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
+; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16, !tbaa.struct !5
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4, !tbaa.struct !5
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8, !tbaa.struct !5
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4, !tbaa.struct !5
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST:%.*]], align 16, !tbaa.struct !5
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST]], align 16, !tbaa.struct !5
; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[DST_I1]], align 4, !tbaa.struct !5
; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[DST_I2]], align 8, !tbaa.struct !5
; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[DST_I3]], align 4, !tbaa.struct !5
@@ -243,18 +243,18 @@ define void @f5(i32 %count, ptr %src, ptr %dst) {
; CHECK-NEXT: [[THIS_DST_I1:%.*]] = getelementptr i32, ptr [[THIS_DST]], i32 1
; CHECK-NEXT: [[THIS_DST_I2:%.*]] = getelementptr i32, ptr [[THIS_DST]], i32 2
; CHECK-NEXT: [[THIS_DST_I3:%.*]] = getelementptr i32, ptr [[THIS_DST]], i32 3
-; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[THIS_SRC]], align 16, !llvm.access.group !6
-; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[THIS_SRC_I1]], align 4, !llvm.access.group !6
-; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[THIS_SRC_I2]], align 8, !llvm.access.group !6
-; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[THIS_SRC_I3]], align 4, !llvm.access.group !6
+; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[THIS_SRC]], align 16, !llvm.access.group [[ACC_GRP6:![0-9]+]]
+; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[THIS_SRC_I1]], align 4, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[THIS_SRC_I2]], align 8, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[THIS_SRC_I3]], align 4, !llvm.access.group [[ACC_GRP6]]
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[THIS_DST]], align 16, !llvm.access.group !6
-; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[THIS_DST_I1]], align 4, !llvm.access.group !6
-; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[THIS_DST_I2]], align 8, !llvm.access.group !6
-; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[THIS_DST_I3]], align 4, !llvm.access.group !6
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[THIS_DST]], align 16, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[THIS_DST_I1]], align 4, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[THIS_DST_I2]], align 8, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[THIS_DST_I3]], align 4, !llvm.access.group [[ACC_GRP6]]
; CHECK-NEXT: [[NEXT_INDEX]] = add i32 [[INDEX]], -1
; CHECK-NEXT: [[CONTINUE:%.*]] = icmp ne i32 [[NEXT_INDEX]], [[COUNT:%.*]]
; CHECK-NEXT: br i1 [[CONTINUE]], label [[LOOP]], label [[END:%.*]], !llvm.loop [[LOOP7:![0-9]+]]
@@ -305,20 +305,20 @@ define <4 x float> @f6(<4 x float> %x) {
define void @f7(ptr %src, ptr %dst) {
; CHECK-LABEL: @f7(
; CHECK-NEXT: [[DST_I1:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 1
-; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
-; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 3
+; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
+; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST:%.*]], align 16
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST]], align 16
; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[DST_I1]], align 4
; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[DST_I2]], align 8
; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[DST_I3]], align 4
@@ -334,8 +334,8 @@ define void @f7(ptr %src, ptr %dst) {
define void @f8(ptr %dest, <4 x ptr> %ptr0, <4 x i32> %i0,
; CHECK-LABEL: @f8(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST]], i32 3
; CHECK-NEXT: [[PTR0_I0:%.*]] = extractelement <4 x ptr> [[PTR0:%.*]], i32 0
; CHECK-NEXT: [[PTR0_I2:%.*]] = extractelement <4 x ptr> [[PTR0]], i32 2
; CHECK-NEXT: [[PTR0_I3:%.*]] = extractelement <4 x ptr> [[PTR0]], i32 3
@@ -345,7 +345,7 @@ define void @f8(ptr %dest, <4 x ptr> %ptr0, <4 x i32> %i0,
; CHECK-NEXT: [[VAL_I1:%.*]] = getelementptr float, ptr [[OTHER:%.*]], i32 [[I0_I1]]
; CHECK-NEXT: [[VAL_I2:%.*]] = getelementptr float, ptr [[PTR0_I2]], i32 100
; CHECK-NEXT: [[VAL_I3:%.*]] = getelementptr float, ptr [[PTR0_I3]], i32 [[I0_I3]]
-; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST:%.*]], align 32
+; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST]], align 32
; CHECK-NEXT: store ptr [[VAL_I1]], ptr [[DEST_I1]], align 8
; CHECK-NEXT: store ptr [[VAL_I2]], ptr [[DEST_I2]], align 16
; CHECK-NEXT: store ptr [[VAL_I3]], ptr [[DEST_I3]], align 8
@@ -364,16 +364,16 @@ define void @f8(ptr %dest, <4 x ptr> %ptr0, <4 x i32> %i0,
define void @f9(ptr %dest, ptr %src) {
; CHECK-LABEL: @f9(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load float, ptr [[SRC:%.*]], align 4
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load float, ptr [[SRC_I1]], align 4
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load float, ptr [[SRC_I2]], align 4
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load float, ptr [[SRC_I3]], align 4
-; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST:%.*]], align 8
+; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST]], align 8
; CHECK-NEXT: store float [[VAL_I1]], ptr [[DEST_I1]], align 4
; CHECK-NEXT: store float [[VAL_I2]], ptr [[DEST_I2]], align 8
; CHECK-NEXT: store float [[VAL_I3]], ptr [[DEST_I3]], align 4
@@ -388,16 +388,16 @@ define void @f9(ptr %dest, ptr %src) {
define void @f10(ptr %dest, ptr %src) {
; CHECK-LABEL: @f10(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load float, ptr [[SRC:%.*]], align 1
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load float, ptr [[SRC_I1]], align 1
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load float, ptr [[SRC_I2]], align 1
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load float, ptr [[SRC_I3]], align 1
-; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST:%.*]], align 2
+; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST]], align 2
; CHECK-NEXT: store float [[VAL_I1]], ptr [[DEST_I1]], align 2
; CHECK-NEXT: store float [[VAL_I2]], ptr [[DEST_I2]], align 2
; CHECK-NEXT: store float [[VAL_I3]], ptr [[DEST_I3]], align 2
@@ -557,8 +557,8 @@ define void @f11(ptr %dest, ptr %src0) {
define void @f13(ptr %dest, <4 x ptr> %ptr, <4 x i32> %i,
; CHECK-LABEL: @f13(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST]], i32 3
; CHECK-NEXT: [[I_I0:%.*]] = extractelement <4 x i32> [[I:%.*]], i32 0
; CHECK-NEXT: [[PTR_I0:%.*]] = extractelement <4 x ptr> [[PTR:%.*]], i32 0
; CHECK-NEXT: [[VAL_I0:%.*]] = getelementptr inbounds [4 x float], ptr [[PTR_I0]], i32 0, i32 [[I_I0]]
@@ -571,7 +571,7 @@ define void @f13(ptr %dest, <4 x ptr> %ptr, <4 x i32> %i,
; CHECK-NEXT: [[I_I3:%.*]] = extractelement <4 x i32> [[I]], i32 3
; CHECK-NEXT: [[PTR_I3:%.*]] = extractelement <4 x ptr> [[PTR]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = getelementptr inbounds [4 x float], ptr [[PTR_I3]], i32 3, i32 [[I_I3]]
-; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST:%.*]], align 32
+; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST]], align 32
; CHECK-NEXT: store ptr [[VAL_I1]], ptr [[DEST_I1]], align 8
; CHECK-NEXT: store ptr [[VAL_I2]], ptr [[DEST_I2]], align 16
; CHECK-NEXT: store ptr [[VAL_I3]], ptr [[DEST_I3]], align 8
@@ -820,8 +820,8 @@ define <2 x float> @f22(<2 x float> %x, <2 x float> %y, <2 x float> %z) {
; See https://reviews.llvm.org/D83101#2133062
define <2 x i32> @f23_crash(<2 x i32> %srcvec, i32 %v1) {
; CHECK-LABEL: @f23_crash(
-; CHECK-NEXT: [[V0:%.*]] = extractelement <2 x i32> [[SRCVEC:%.*]], i32 0
-; CHECK-NEXT: [[T1_UPTO0:%.*]] = insertelement <2 x i32> poison, i32 [[V0]], i32 0
+; CHECK-NEXT: [[SRCVEC_I0:%.*]] = extractelement <2 x i32> [[SRCVEC:%.*]], i32 0
+; CHECK-NEXT: [[T1_UPTO0:%.*]] = insertelement <2 x i32> poison, i32 [[SRCVEC_I0]], i32 0
; CHECK-NEXT: [[T1:%.*]] = insertelement <2 x i32> [[T1_UPTO0]], i32 [[V1:%.*]], i32 1
; CHECK-NEXT: ret <2 x i32> [[T1]]
;
diff --git a/llvm/test/Transforms/Scalarizer/basic.ll b/llvm/test/Transforms/Scalarizer/basic.ll
index 182e47d45ec13..9735b7b63b0d1 100644
--- a/llvm/test/Transforms/Scalarizer/basic.ll
+++ b/llvm/test/Transforms/Scalarizer/basic.ll
@@ -174,20 +174,20 @@ exit:
define void @f3(ptr %src, ptr %dst) {
; CHECK-LABEL: @f3(
; CHECK-NEXT: [[DST_I1:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 1
-; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
-; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 3
+; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
+; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16, !tbaa [[TBAA0:![0-9]+]]
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4, !tbaa [[TBAA0]]
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8, !tbaa [[TBAA0]]
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4, !tbaa [[TBAA0]]
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST:%.*]], align 16, !tbaa [[TBAA3:![0-9]+]]
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST]], align 16, !tbaa [[TBAA3:![0-9]+]]
; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[DST_I1]], align 4, !tbaa [[TBAA3]]
; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[DST_I2]], align 8, !tbaa [[TBAA3]]
; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[DST_I3]], align 4, !tbaa [[TBAA3]]
@@ -203,20 +203,20 @@ define void @f3(ptr %src, ptr %dst) {
define void @f4(ptr %src, ptr %dst) {
; CHECK-LABEL: @f4(
; CHECK-NEXT: [[DST_I1:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 1
-; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
-; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 3
+; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
+; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16, !tbaa.struct !5
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4, !tbaa.struct !5
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8, !tbaa.struct !5
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4, !tbaa.struct !5
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST:%.*]], align 16, !tbaa.struct !5
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST]], align 16, !tbaa.struct !5
; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[DST_I1]], align 4, !tbaa.struct !5
; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[DST_I2]], align 8, !tbaa.struct !5
; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[DST_I3]], align 4, !tbaa.struct !5
@@ -243,18 +243,18 @@ define void @f5(i32 %count, ptr %src, ptr %dst) {
; CHECK-NEXT: [[THIS_DST_I1:%.*]] = getelementptr i32, ptr [[THIS_DST]], i32 1
; CHECK-NEXT: [[THIS_DST_I2:%.*]] = getelementptr i32, ptr [[THIS_DST]], i32 2
; CHECK-NEXT: [[THIS_DST_I3:%.*]] = getelementptr i32, ptr [[THIS_DST]], i32 3
-; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[THIS_SRC]], align 16, !llvm.access.group !6
-; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[THIS_SRC_I1]], align 4, !llvm.access.group !6
-; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[THIS_SRC_I2]], align 8, !llvm.access.group !6
-; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[THIS_SRC_I3]], align 4, !llvm.access.group !6
+; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[THIS_SRC]], align 16, !llvm.access.group [[ACC_GRP6:![0-9]+]]
+; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[THIS_SRC_I1]], align 4, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[THIS_SRC_I2]], align 8, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[THIS_SRC_I3]], align 4, !llvm.access.group [[ACC_GRP6]]
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[THIS_DST]], align 16, !llvm.access.group !6
-; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[THIS_DST_I1]], align 4, !llvm.access.group !6
-; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[THIS_DST_I2]], align 8, !llvm.access.group !6
-; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[THIS_DST_I3]], align 4, !llvm.access.group !6
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[THIS_DST]], align 16, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[THIS_DST_I1]], align 4, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[THIS_DST_I2]], align 8, !llvm.access.group [[ACC_GRP6]]
+; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[THIS_DST_I3]], align 4, !llvm.access.group [[ACC_GRP6]]
; CHECK-NEXT: [[NEXT_INDEX]] = add i32 [[INDEX]], -1
; CHECK-NEXT: [[CONTINUE:%.*]] = icmp ne i32 [[NEXT_INDEX]], [[COUNT:%.*]]
; CHECK-NEXT: br i1 [[CONTINUE]], label [[LOOP]], label [[END:%.*]], !llvm.loop [[LOOP7:![0-9]+]]
@@ -305,20 +305,20 @@ define <4 x float> @f6(<4 x float> %x) {
define void @f7(ptr %src, ptr %dst) {
; CHECK-LABEL: @f7(
; CHECK-NEXT: [[DST_I1:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 1
-; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 2
-; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST:%.*]], i32 3
+; CHECK-NEXT: [[DST_I2:%.*]] = getelementptr i32, ptr [[DST]], i32 2
+; CHECK-NEXT: [[DST_I3:%.*]] = getelementptr i32, ptr [[DST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4
; CHECK-NEXT: [[ADD_I0:%.*]] = add i32 [[VAL_I0]], [[VAL_I0]]
; CHECK-NEXT: [[ADD_I1:%.*]] = add i32 [[VAL_I1]], [[VAL_I1]]
; CHECK-NEXT: [[ADD_I2:%.*]] = add i32 [[VAL_I2]], [[VAL_I2]]
; CHECK-NEXT: [[ADD_I3:%.*]] = add i32 [[VAL_I3]], [[VAL_I3]]
-; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST:%.*]], align 16
+; CHECK-NEXT: store i32 [[ADD_I0]], ptr [[DST]], align 16
; CHECK-NEXT: store i32 [[ADD_I1]], ptr [[DST_I1]], align 4
; CHECK-NEXT: store i32 [[ADD_I2]], ptr [[DST_I2]], align 8
; CHECK-NEXT: store i32 [[ADD_I3]], ptr [[DST_I3]], align 4
@@ -334,8 +334,8 @@ define void @f7(ptr %src, ptr %dst) {
define void @f8(ptr %dest, <4 x ptr> %ptr0, <4 x i32> %i0,
; CHECK-LABEL: @f8(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST]], i32 3
; CHECK-NEXT: [[PTR0_I0:%.*]] = extractelement <4 x ptr> [[PTR0:%.*]], i32 0
; CHECK-NEXT: [[PTR0_I2:%.*]] = extractelement <4 x ptr> [[PTR0]], i32 2
; CHECK-NEXT: [[PTR0_I3:%.*]] = extractelement <4 x ptr> [[PTR0]], i32 3
@@ -345,7 +345,7 @@ define void @f8(ptr %dest, <4 x ptr> %ptr0, <4 x i32> %i0,
; CHECK-NEXT: [[VAL_I1:%.*]] = getelementptr float, ptr [[OTHER:%.*]], i32 [[I0_I1]]
; CHECK-NEXT: [[VAL_I2:%.*]] = getelementptr float, ptr [[PTR0_I2]], i32 100
; CHECK-NEXT: [[VAL_I3:%.*]] = getelementptr float, ptr [[PTR0_I3]], i32 [[I0_I3]]
-; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST:%.*]], align 32
+; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST]], align 32
; CHECK-NEXT: store ptr [[VAL_I1]], ptr [[DEST_I1]], align 8
; CHECK-NEXT: store ptr [[VAL_I2]], ptr [[DEST_I2]], align 16
; CHECK-NEXT: store ptr [[VAL_I3]], ptr [[DEST_I3]], align 8
@@ -364,16 +364,16 @@ define void @f8(ptr %dest, <4 x ptr> %ptr0, <4 x i32> %i0,
define void @f9(ptr %dest, ptr %src) {
; CHECK-LABEL: @f9(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load float, ptr [[SRC:%.*]], align 4
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load float, ptr [[SRC_I1]], align 4
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load float, ptr [[SRC_I2]], align 4
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load float, ptr [[SRC_I3]], align 4
-; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST:%.*]], align 8
+; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST]], align 8
; CHECK-NEXT: store float [[VAL_I1]], ptr [[DEST_I1]], align 4
; CHECK-NEXT: store float [[VAL_I2]], ptr [[DEST_I2]], align 8
; CHECK-NEXT: store float [[VAL_I3]], ptr [[DEST_I3]], align 4
@@ -388,16 +388,16 @@ define void @f9(ptr %dest, ptr %src) {
define void @f10(ptr %dest, ptr %src) {
; CHECK-LABEL: @f10(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr float, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr float, ptr [[DEST]], i32 3
; CHECK-NEXT: [[VAL_I0:%.*]] = load float, ptr [[SRC:%.*]], align 1
-; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 1
+; CHECK-NEXT: [[SRC_I1:%.*]] = getelementptr float, ptr [[SRC]], i32 1
; CHECK-NEXT: [[VAL_I1:%.*]] = load float, ptr [[SRC_I1]], align 1
-; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 2
+; CHECK-NEXT: [[SRC_I2:%.*]] = getelementptr float, ptr [[SRC]], i32 2
; CHECK-NEXT: [[VAL_I2:%.*]] = load float, ptr [[SRC_I2]], align 1
-; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC:%.*]], i32 3
+; CHECK-NEXT: [[SRC_I3:%.*]] = getelementptr float, ptr [[SRC]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = load float, ptr [[SRC_I3]], align 1
-; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST:%.*]], align 2
+; CHECK-NEXT: store float [[VAL_I0]], ptr [[DEST]], align 2
; CHECK-NEXT: store float [[VAL_I1]], ptr [[DEST_I1]], align 2
; CHECK-NEXT: store float [[VAL_I2]], ptr [[DEST_I2]], align 2
; CHECK-NEXT: store float [[VAL_I3]], ptr [[DEST_I3]], align 2
@@ -557,8 +557,8 @@ define void @f11(ptr %dest, ptr %src0) {
define void @f13(ptr %dest, <4 x ptr> %ptr, <4 x i32> %i,
; CHECK-LABEL: @f13(
; CHECK-NEXT: [[DEST_I1:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 1
-; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 2
-; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST:%.*]], i32 3
+; CHECK-NEXT: [[DEST_I2:%.*]] = getelementptr ptr, ptr [[DEST]], i32 2
+; CHECK-NEXT: [[DEST_I3:%.*]] = getelementptr ptr, ptr [[DEST]], i32 3
; CHECK-NEXT: [[I_I0:%.*]] = extractelement <4 x i32> [[I:%.*]], i32 0
; CHECK-NEXT: [[PTR_I0:%.*]] = extractelement <4 x ptr> [[PTR:%.*]], i32 0
; CHECK-NEXT: [[VAL_I0:%.*]] = getelementptr inbounds [4 x float], ptr [[PTR_I0]], i32 0, i32 [[I_I0]]
@@ -571,7 +571,7 @@ define void @f13(ptr %dest, <4 x ptr> %ptr, <4 x i32> %i,
; CHECK-NEXT: [[I_I3:%.*]] = extractelement <4 x i32> [[I]], i32 3
; CHECK-NEXT: [[PTR_I3:%.*]] = extractelement <4 x ptr> [[PTR]], i32 3
; CHECK-NEXT: [[VAL_I3:%.*]] = getelementptr inbounds [4 x float], ptr [[PTR_I3]], i32 3, i32 [[I_I3]]
-; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST:%.*]], align 32
+; CHECK-NEXT: store ptr [[VAL_I0]], ptr [[DEST]], align 32
; CHECK-NEXT: store ptr [[VAL_I1]], ptr [[DEST_I1]], align 8
; CHECK-NEXT: store ptr [[VAL_I2]], ptr [[DEST_I2]], align 16
; CHECK-NEXT: store ptr [[VAL_I3]], ptr [[DEST_I3]], align 8
@@ -820,8 +820,8 @@ define <2 x float> @f22(<2 x float> %x, <2 x float> %y, <2 x float> %z) {
; See https://reviews.llvm.org/D83101#2133062
define <2 x i32> @f23_crash(<2 x i32> %srcvec, i32 %v1) {
; CHECK-LABEL: @f23_crash(
-; CHECK-NEXT: [[V0:%.*]] = extractelement <2 x i32> [[SRCVEC:%.*]], i32 0
-; CHECK-NEXT: [[T1_UPTO0:%.*]] = insertelement <2 x i32> poison, i32 [[V0]], i32 0
+; CHECK-NEXT: [[SRCVEC_I0:%.*]] = extractelement <2 x i32> [[SRCVEC:%.*]], i32 0
+; CHECK-NEXT: [[T1_UPTO0:%.*]] = insertelement <2 x i32> poison, i32 [[SRCVEC_I0]], i32 0
; CHECK-NEXT: [[T1:%.*]] = insertelement <2 x i32> [[T1_UPTO0]], i32 [[V1:%.*]], i32 1
; CHECK-NEXT: ret <2 x i32> [[T1]]
;
diff --git a/llvm/test/Transforms/Scalarizer/constant-extractelement.ll b/llvm/test/Transforms/Scalarizer/constant-extractelement.ll
index d3c66126f469d..50b7c3904999c 100644
--- a/llvm/test/Transforms/Scalarizer/constant-extractelement.ll
+++ b/llvm/test/Transforms/Scalarizer/constant-extractelement.ll
@@ -8,8 +8,8 @@ define i32 @f1(ptr %src, i32 %index) {
; ALL-LABEL: @f1(
; ALL-NEXT: [[SRC_I3:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 3
; ALL-NEXT: [[VAL0_I3:%.*]] = load i32, ptr [[SRC_I3]], align 4
-; ALL-NEXT: [[VAL2:%.*]] = shl i32 4, [[VAL0_I3]]
-; ALL-NEXT: ret i32 [[VAL2]]
+; ALL-NEXT: [[VAL1_I3:%.*]] = shl i32 4, [[VAL0_I3]]
+; ALL-NEXT: ret i32 [[VAL1_I3]]
;
%val0 = load <4 x i32> , ptr %src
%val1 = shl <4 x i32> <i32 1, i32 2, i32 3, i32 4>, %val0
diff --git a/llvm/test/Transforms/Scalarizer/constant-insertelement.ll b/llvm/test/Transforms/Scalarizer/constant-insertelement.ll
index e4934fefc1eb6..672462372b8cb 100644
--- a/llvm/test/Transforms/Scalarizer/constant-insertelement.ll
+++ b/llvm/test/Transforms/Scalarizer/constant-insertelement.ll
@@ -7,9 +7,9 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
define <4 x i32> @f1(ptr %src, i32 %repl, i32 %index) {
; ALL-LABEL: @f1(
; ALL-NEXT: [[VAL0_I0:%.*]] = load i32, ptr [[SRC:%.*]], align 16
-; ALL-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 1
+; ALL-NEXT: [[SRC_I1:%.*]] = getelementptr i32, ptr [[SRC]], i32 1
; ALL-NEXT: [[VAL0_I1:%.*]] = load i32, ptr [[SRC_I1]], align 4
-; ALL-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC:%.*]], i32 2
+; ALL-NEXT: [[SRC_I2:%.*]] = getelementptr i32, ptr [[SRC]], i32 2
; ALL-NEXT: [[VAL0_I2:%.*]] = load i32, ptr [[SRC_I2]], align 8
; ALL-NEXT: [[VAL2_I0:%.*]] = shl i32 1, [[VAL0_I0]]
; ALL-NEXT: [[VAL2_I1:%.*]] = shl i32 2, [[VAL0_I1]]
diff --git a/llvm/test/Transforms/Scalarizer/order-bug-inseltpoison.ll b/llvm/test/Transforms/Scalarizer/order-bug-inseltpoison.ll
index 2345d66b8929f..543b154e9821b 100644
--- a/llvm/test/Transforms/Scalarizer/order-bug-inseltpoison.ll
+++ b/llvm/test/Transforms/Scalarizer/order-bug-inseltpoison.ll
@@ -1,23 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt %s -passes='function(scalarizer)' -S -o - | FileCheck %s
-; This input caused the scalarizer to replace & erase gathered results when
+; This input caused the scalarizer to replace & erase gathered results when
; future gathered results depended on them being alive
define dllexport spir_func <4 x i32> @main(float %a) {
+; CHECK-LABEL: @main(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[Z:%.*]]
+; CHECK: y:
+; CHECK-NEXT: [[F_UPTO0:%.*]] = insertelement <4 x i32> poison, i32 [[B_I0:%.*]], i32 0
+; CHECK-NEXT: [[F_UPTO1:%.*]] = insertelement <4 x i32> [[F_UPTO0]], i32 [[B_I0]], i32 1
+; CHECK-NEXT: [[F_UPTO2:%.*]] = insertelement <4 x i32> [[F_UPTO1]], i32 [[B_I0]], i32 2
+; CHECK-NEXT: [[F:%.*]] = insertelement <4 x i32> [[F_UPTO2]], i32 [[B_I0]], i32 3
+; CHECK-NEXT: ret <4 x i32> [[F]]
+; CHECK: z:
+; CHECK-NEXT: [[B_I0]] = bitcast float [[A:%.*]] to i32
+; CHECK-NEXT: br label [[Y:%.*]]
+;
entry:
%i = insertelement <4 x float> poison, float %a, i32 0
br label %z
y:
-; CHECK: %f.upto0 = insertelement <4 x i32> poison, i32 %b.i0, i32 0
-; CHECK: %f.upto1 = insertelement <4 x i32> %f.upto0, i32 %b.i0, i32 1
-; CHECK: %f.upto2 = insertelement <4 x i32> %f.upto1, i32 %b.i0, i32 2
-; CHECK: %f = insertelement <4 x i32> %f.upto2, i32 %b.i0, i32 3
%f = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
ret <4 x i32> %f
z:
-; CHECK: %b.i0 = bitcast float %a to i32
%b = bitcast <4 x float> %i to <4 x i32>
br label %y
}
diff --git a/llvm/test/Transforms/Scalarizer/order-bug.ll b/llvm/test/Transforms/Scalarizer/order-bug.ll
index baa939303605a..dee7ce4b492a8 100644
--- a/llvm/test/Transforms/Scalarizer/order-bug.ll
+++ b/llvm/test/Transforms/Scalarizer/order-bug.ll
@@ -1,23 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt %s -passes='function(scalarizer)' -S -o - | FileCheck %s
; This input caused the scalarizer to replace & erase gathered results when
; future gathered results depended on them being alive
define dllexport spir_func <4 x i32> @main(float %a) {
+; CHECK-LABEL: @main(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[Z:%.*]]
+; CHECK: y:
+; CHECK-NEXT: [[F_UPTO0:%.*]] = insertelement <4 x i32> poison, i32 [[B_I0:%.*]], i32 0
+; CHECK-NEXT: [[F_UPTO1:%.*]] = insertelement <4 x i32> [[F_UPTO0]], i32 [[B_I0]], i32 1
+; CHECK-NEXT: [[F_UPTO2:%.*]] = insertelement <4 x i32> [[F_UPTO1]], i32 [[B_I0]], i32 2
+; CHECK-NEXT: [[F:%.*]] = insertelement <4 x i32> [[F_UPTO2]], i32 [[B_I0]], i32 3
+; CHECK-NEXT: ret <4 x i32> [[F]]
+; CHECK: z:
+; CHECK-NEXT: [[B_I0]] = bitcast float [[A:%.*]] to i32
+; CHECK-NEXT: br label [[Y:%.*]]
+;
entry:
%i = insertelement <4 x float> undef, float %a, i32 0
br label %z
y:
-; CHECK: %f.upto0 = insertelement <4 x i32> poison, i32 %b.i0, i32 0
-; CHECK: %f.upto1 = insertelement <4 x i32> %f.upto0, i32 %b.i0, i32 1
-; CHECK: %f.upto2 = insertelement <4 x i32> %f.upto1, i32 %b.i0, i32 2
-; CHECK: %f = insertelement <4 x i32> %f.upto2, i32 %b.i0, i32 3
%f = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> zeroinitializer
ret <4 x i32> %f
z:
-; CHECK: %b.i0 = bitcast float %a to i32
%b = bitcast <4 x float> %i to <4 x i32>
br label %y
}
diff --git a/llvm/test/Transforms/Scalarizer/phi-order.ll b/llvm/test/Transforms/Scalarizer/phi-order.ll
index 523daf3c900ae..38ff98ad3021f 100644
--- a/llvm/test/Transforms/Scalarizer/phi-order.ll
+++ b/llvm/test/Transforms/Scalarizer/phi-order.ll
@@ -1,20 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt %s -passes='function(scalarizer)' -S -o - | FileCheck %s
; This input caused the scalarizer to insert non-PHI nodes
; in between PHI nodes (%1 and %2).
define <3 x float> @func(i32 %inval) {
+; CHECK-LABEL: @func(
+; CHECK-NEXT: .entry:
+; CHECK-NEXT: br label [[TMP0:%.*]]
+; CHECK: 0:
+; CHECK-NEXT: [[DOTI01:%.*]] = phi float [ 0.000000e+00, [[DOTENTRY:%.*]] ], [ [[DOTI01]], [[TMP3:%.*]] ]
+; CHECK-NEXT: [[DOTI12:%.*]] = phi float [ 0.000000e+00, [[DOTENTRY]] ], [ [[DOTI12]], [[TMP3]] ]
+; CHECK-NEXT: [[DOTI23:%.*]] = phi float [ 0.000000e+00, [[DOTENTRY]] ], [ [[DOTI23]], [[TMP3]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi float [ 1.000000e+00, [[DOTENTRY]] ], [ 2.000000e+00, [[TMP3]] ]
+; CHECK-NEXT: [[DOTUPTO0:%.*]] = insertelement <3 x float> poison, float [[DOTI01]], i32 0
+; CHECK-NEXT: [[DOTUPTO1:%.*]] = insertelement <3 x float> [[DOTUPTO0]], float [[DOTI12]], i32 1
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <3 x float> [[DOTUPTO1]], float [[DOTI23]], i32 2
+; CHECK-NEXT: br label [[TMP3]]
+; CHECK: 3:
+; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[INVAL:%.*]], 0
+; CHECK-NEXT: br i1 [[COND]], label [[TMP0]], label [[EXIT:%.*]]
+; CHECK: exit:
+; CHECK-NEXT: ret <3 x float> [[TMP2]]
+;
.entry:
br label %0
0: ; preds = %3, %.entry
-; CHECK: %.i01 = phi float [ 0.000000e+00, %.entry ], [ %.i01, %3 ]
-; CHECK-NEXT: %.i12 = phi float [ 0.000000e+00, %.entry ], [ %.i12, %3 ]
-; CHECK-NEXT: %.i23 = phi float [ 0.000000e+00, %.entry ], [ %.i23, %3 ]
-; CHECK-NEXT: %1 = phi float [ 1.000000e+00, %.entry ], [ 2.000000e+00, %3 ]
-; CHECK-NEXT: %.upto0 = insertelement <3 x float> poison, float %.i01, i32 0
-; CHECK-NEXT: %.upto1 = insertelement <3 x float> %.upto0, float %.i12, i32 1
-; CHECK-NEXT: %2 = insertelement <3 x float> %.upto1, float %.i23, i32 2
%1 = phi <3 x float> [ <float 0.0, float 0.0, float 0.0>, %.entry], [ %1, %3 ]
%2 = phi float [ 1.0, %.entry], [ 2.0, %3 ]
br label %3
diff --git a/llvm/test/Transforms/Scalarizer/scatter-order.ll b/llvm/test/Transforms/Scalarizer/scatter-order.ll
index 0348c4e289bdd..9d0e92faf7cc7 100644
--- a/llvm/test/Transforms/Scalarizer/scatter-order.ll
+++ b/llvm/test/Transforms/Scalarizer/scatter-order.ll
@@ -64,7 +64,7 @@ define void @test4(ptr %ptr, <2 x i32> %val) {
; CHECK-NEXT: [[VAL_I0:%.*]] = extractelement <2 x i32> [[VAL:%.*]], i32 0
; CHECK-NEXT: store i32 [[VAL_I0]], ptr [[PTR:%.*]], align 8
; CHECK-NEXT: [[VAL_I1:%.*]] = extractelement <2 x i32> [[VAL]], i32 1
-; CHECK-NEXT: [[PTR_I1:%.*]] = getelementptr i32, ptr [[PTR:%.*]], i32 1
+; CHECK-NEXT: [[PTR_I1:%.*]] = getelementptr i32, ptr [[PTR]], i32 1
; CHECK-NEXT: store i32 [[VAL_I1]], ptr [[PTR_I1]], align 4
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/Scalarizer/variable-extractelement.ll b/llvm/test/Transforms/Scalarizer/variable-extractelement.ll
index da6f73695a248..7dd9a843e88fe 100644
--- a/llvm/test/Transforms/Scalarizer/variable-extractelement.ll
+++ b/llvm/test/Transforms/Scalarizer/variable-extractelement.ll
@@ -19,8 +19,8 @@ define i32 @f1(<4 x i32> %src, i32 %index) {
; DEFAULT-NEXT: [[RES_UPTO2:%.*]] = select i1 [[INDEX_IS_2]], i32 [[SRC_I2]], i32 [[RES_UPTO1]]
; DEFAULT-NEXT: [[INDEX_IS_3:%.*]] = icmp eq i32 [[INDEX]], 3
; DEFAULT-NEXT: [[SRC_I3:%.*]] = extractelement <4 x i32> [[SRC]], i32 3
-; DEFAULT-NEXT: [[RES:%.*]] = select i1 [[INDEX_IS_3]], i32 [[SRC_I3]], i32 [[RES_UPTO2]]
-; DEFAULT-NEXT: ret i32 [[RES]]
+; DEFAULT-NEXT: [[RES_UPTO3:%.*]] = select i1 [[INDEX_IS_3]], i32 [[SRC_I3]], i32 [[RES_UPTO2]]
+; DEFAULT-NEXT: ret i32 [[RES_UPTO3]]
;
; OFF-LABEL: @f1(
; OFF-NEXT: [[RES:%.*]] = extractelement <4 x i32> [[SRC:%.*]], i32 [[INDEX:%.*]]
@@ -48,8 +48,8 @@ define i32 @f2(ptr %src, i32 %index) {
; DEFAULT-NEXT: [[INDEX_IS_2:%.*]] = icmp eq i32 [[INDEX]], 2
; DEFAULT-NEXT: [[VAL2_UPTO2:%.*]] = select i1 [[INDEX_IS_2]], i32 [[VAL1_I2]], i32 [[VAL2_UPTO1]]
; DEFAULT-NEXT: [[INDEX_IS_3:%.*]] = icmp eq i32 [[INDEX]], 3
-; DEFAULT-NEXT: [[VAL2:%.*]] = select i1 [[INDEX_IS_3]], i32 [[VAL1_I3]], i32 [[VAL2_UPTO2]]
-; DEFAULT-NEXT: ret i32 [[VAL2]]
+; DEFAULT-NEXT: [[VAL2_UPTO3:%.*]] = select i1 [[INDEX_IS_3]], i32 [[VAL1_I3]], i32 [[VAL2_UPTO2]]
+; DEFAULT-NEXT: ret i32 [[VAL2_UPTO3]]
;
; OFF-LABEL: @f2(
; OFF-NEXT: [[VAL0:%.*]] = load <4 x i32>, ptr [[SRC:%.*]], align 16
diff --git a/llvm/test/Transforms/Scalarizer/vector-gep.ll b/llvm/test/Transforms/Scalarizer/vector-gep.ll
index b800dabfcc115..cdde5d1786d4f 100644
--- a/llvm/test/Transforms/Scalarizer/vector-gep.ll
+++ b/llvm/test/Transforms/Scalarizer/vector-gep.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes='function(scalarizer)' %s | FileCheck %s
; Check that the scalarizer can handle vector GEPs with scalar indices
@@ -9,6 +10,19 @@
; constant index
define void @test1() {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[TMP0:%.*]] = load <4 x ptr>, ptr @vec, align 32
+; CHECK-NEXT: [[DOTI0:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 0
+; CHECK-NEXT: [[DOTI01:%.*]] = getelementptr i16, ptr [[DOTI0]], i16 1
+; CHECK-NEXT: [[DOTI1:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 1
+; CHECK-NEXT: [[DOTI12:%.*]] = getelementptr i16, ptr [[DOTI1]], i16 1
+; CHECK-NEXT: [[DOTI2:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 2
+; CHECK-NEXT: [[DOTI23:%.*]] = getelementptr i16, ptr [[DOTI2]], i16 1
+; CHECK-NEXT: [[DOTI3:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 3
+; CHECK-NEXT: [[DOTI34:%.*]] = getelementptr i16, ptr [[DOTI3]], i16 1
+; CHECK-NEXT: ret void
+;
bb:
%0 = load <4 x ptr>, ptr @vec
%1 = getelementptr i16, <4 x ptr> %0, i16 1
@@ -16,18 +30,28 @@ bb:
ret void
}
-;CHECK-LABEL: @test1
-;CHECK: %[[I0:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 0
-;CHECK: getelementptr i16, ptr %[[I0]], i16 1
-;CHECK: %[[I1:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 1
-;CHECK: getelementptr i16, ptr %[[I1]], i16 1
-;CHECK: %[[I2:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 2
-;CHECK: getelementptr i16, ptr %[[I2]], i16 1
-;CHECK: %[[I3:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 3
-;CHECK: getelementptr i16, ptr %[[I3]], i16 1
-
; non-constant index
define void @test2() {
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[TMP0:%.*]] = load <4 x ptr>, ptr @vec, align 32
+; CHECK-NEXT: [[DOTI0:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 0
+; CHECK-NEXT: [[DOTI1:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 1
+; CHECK-NEXT: [[DOTI2:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 2
+; CHECK-NEXT: [[DOTI3:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 3
+; CHECK-NEXT: [[INDEX:%.*]] = load i16, ptr @index, align 2
+; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i16> poison, i16 [[INDEX]], i32 0
+; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i16> [[DOTSPLATINSERT]], <4 x i16> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[DOTSPLAT_I0:%.*]] = extractelement <4 x i16> [[DOTSPLAT]], i32 0
+; CHECK-NEXT: [[DOTI01:%.*]] = getelementptr i16, ptr [[DOTI0]], i16 [[DOTSPLAT_I0]]
+; CHECK-NEXT: [[DOTSPLAT_I1:%.*]] = extractelement <4 x i16> [[DOTSPLAT]], i32 1
+; CHECK-NEXT: [[DOTI12:%.*]] = getelementptr i16, ptr [[DOTI1]], i16 [[DOTSPLAT_I1]]
+; CHECK-NEXT: [[DOTSPLAT_I2:%.*]] = extractelement <4 x i16> [[DOTSPLAT]], i32 2
+; CHECK-NEXT: [[DOTI23:%.*]] = getelementptr i16, ptr [[DOTI2]], i16 [[DOTSPLAT_I2]]
+; CHECK-NEXT: [[DOTSPLAT_I3:%.*]] = extractelement <4 x i16> [[DOTSPLAT]], i32 3
+; CHECK-NEXT: [[DOTI34:%.*]] = getelementptr i16, ptr [[DOTI3]], i16 [[DOTSPLAT_I3]]
+; CHECK-NEXT: ret void
+;
bb:
%0 = load <4 x ptr>, ptr @vec
%index = load i16, ptr @index
@@ -36,76 +60,85 @@ bb:
ret void
}
-;CHECK-LABEL: @test2
-;CHECK: %0 = load <4 x ptr>, ptr @vec
-;CHECK: %[[I0:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 0
-;CHECK: %[[I1:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 1
-;CHECK: %[[I2:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 2
-;CHECK: %[[I3:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 3
-;CHECK: %index = load i16, ptr @index
-;CHECK: %.splatinsert = insertelement <4 x i16> poison, i16 %index, i32 0
-;CHECK: %.splat = shufflevector <4 x i16> %.splatinsert, <4 x i16> poison, <4 x i32> zeroinitializer
-;CHECK: %.splat[[I0]] = extractelement <4 x i16> %.splat, i32 0
-;CHECK: getelementptr i16, ptr %[[I0]], i16 %.splat[[I0]]
-;CHECK: %.splat[[I1]] = extractelement <4 x i16> %.splat, i32 1
-;CHECK: getelementptr i16, ptr %[[I1]], i16 %.splat[[I1]]
-;CHECK: %.splat[[I2]] = extractelement <4 x i16> %.splat, i32 2
-;CHECK: getelementptr i16, ptr %[[I2]], i16 %.splat[[I2]]
-;CHECK: %.splat[[I3]] = extractelement <4 x i16> %.splat, i32 3
-;CHECK: getelementptr i16, ptr %[[I3]], i16 %.splat[[I3]]
-
-
; Check that the scalarizer can handle vector GEPs with scalar pointer
; constant pointer
define <4 x ptr> @test3_constexpr() {
+; CHECK-LABEL: @test3_constexpr(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: ret <4 x ptr> getelementptr (i16, ptr @ptr, <4 x i64> <i64 0, i64 1, i64 2, i64 3>)
+;
bb:
ret <4 x ptr> getelementptr (i16, ptr @ptr, <4 x i64> <i64 0, i64 1, i64 2, i64 3>)
}
-; CHECK-LABEL: @test3_constexpr
-; CHECK: ret <4 x ptr> getelementptr (i16, ptr @ptr, <4 x i64> <i64 0, i64 1, i64 2, i64 3>)
-
define <4 x ptr> @test3_constbase(i16 %idx) {
+; CHECK-LABEL: @test3_constbase(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[OFFSET:%.*]] = getelementptr [4 x i16], ptr @ptr, i16 0, i16 [[IDX:%.*]]
+; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x ptr> poison, ptr [[OFFSET]], i32 0
+; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x ptr> [[DOTSPLATINSERT]], <4 x ptr> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[DOTSPLAT_I0:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 0
+; CHECK-NEXT: [[GEP_I0:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I0]], i16 0
+; CHECK-NEXT: [[DOTSPLAT_I1:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 1
+; CHECK-NEXT: [[GEP_I1:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I1]], i16 1
+; CHECK-NEXT: [[DOTSPLAT_I2:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 2
+; CHECK-NEXT: [[GEP_I2:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I2]], i16 2
+; CHECK-NEXT: [[DOTSPLAT_I3:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 3
+; CHECK-NEXT: [[GEP_I3:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I3]], i16 3
+; CHECK-NEXT: [[GEP_UPTO0:%.*]] = insertelement <4 x ptr> poison, ptr [[GEP_I0]], i32 0
+; CHECK-NEXT: [[GEP_UPTO1:%.*]] = insertelement <4 x ptr> [[GEP_UPTO0]], ptr [[GEP_I1]], i32 1
+; CHECK-NEXT: [[GEP_UPTO2:%.*]] = insertelement <4 x ptr> [[GEP_UPTO1]], ptr [[GEP_I2]], i32 2
+; CHECK-NEXT: [[GEP:%.*]] = insertelement <4 x ptr> [[GEP_UPTO2]], ptr [[GEP_I3]], i32 3
+; CHECK-NEXT: ret <4 x ptr> [[GEP]]
+;
bb:
%offset = getelementptr [4 x i16], ptr @ptr, i16 0, i16 %idx
%gep = getelementptr i16, ptr %offset, <4 x i16> <i16 0, i16 1, i16 2, i16 3>
ret <4 x ptr> %gep
}
-; CHECK-LABEL: @test3_constbase(
-; CHECK: %offset = getelementptr [4 x i16], ptr @ptr, i16 0, i16 %idx
-; CHECK: %.splatinsert = insertelement <4 x ptr> poison, ptr %offset, i32 0
-; CHECK: %.splat = shufflevector <4 x ptr> %.splatinsert, <4 x ptr> poison, <4 x i32> zeroinitializer
-; CHECK: %.splat[[I0:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 0
-; CHECK: getelementptr i16, ptr %.splat[[I0]], i16 0
-; CHECK: %.splat[[I1:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 1
-; CHECK: getelementptr i16, ptr %.splat[[I1]], i16 1
-; CHECK: %.splat[[I2:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 2
-; CHECK: getelementptr i16, ptr %.splat[[I2]], i16 2
-; CHECK: %.splat[[I3:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 3
-; CHECK: getelementptr i16, ptr %.splat[[I3]], i16 3
-
; Constant pointer with a variable vector offset
define <4 x ptr> @test3_varoffset(<4 x i16> %offset) {
+; CHECK-LABEL: @test3_varoffset(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[OFFSET_I0:%.*]] = extractelement <4 x i16> [[OFFSET:%.*]], i32 0
+; CHECK-NEXT: [[GEP_I0:%.*]] = getelementptr i16, ptr @ptr, i16 [[OFFSET_I0]]
+; CHECK-NEXT: [[OFFSET_I1:%.*]] = extractelement <4 x i16> [[OFFSET]], i32 1
+; CHECK-NEXT: [[GEP_I1:%.*]] = getelementptr i16, ptr @ptr, i16 [[OFFSET_I1]]
+; CHECK-NEXT: [[OFFSET_I2:%.*]] = extractelement <4 x i16> [[OFFSET]], i32 2
+; CHECK-NEXT: [[GEP_I2:%.*]] = getelementptr i16, ptr @ptr, i16 [[OFFSET_I2]]
+; CHECK-NEXT: [[OFFSET_I3:%.*]] = extractelement <4 x i16> [[OFFSET]], i32 3
+; CHECK-NEXT: [[GEP_I3:%.*]] = getelementptr i16, ptr @ptr, i16 [[OFFSET_I3]]
+; CHECK-NEXT: [[GEP_UPTO0:%.*]] = insertelement <4 x ptr> poison, ptr [[GEP_I0]], i32 0
+; CHECK-NEXT: [[GEP_UPTO1:%.*]] = insertelement <4 x ptr> [[GEP_UPTO0]], ptr [[GEP_I1]], i32 1
+; CHECK-NEXT: [[GEP_UPTO2:%.*]] = insertelement <4 x ptr> [[GEP_UPTO1]], ptr [[GEP_I2]], i32 2
+; CHECK-NEXT: [[GEP:%.*]] = insertelement <4 x ptr> [[GEP_UPTO2]], ptr [[GEP_I3]], i32 3
+; CHECK-NEXT: ret <4 x ptr> [[GEP]]
+;
bb:
%gep = getelementptr i16, ptr @ptr, <4 x i16> %offset
ret <4 x ptr> %gep
}
-; CHECK-LABEL: @test3_varoffset
-; CHECK: %offset.i0 = extractelement <4 x i16> %offset, i32 0
-; CHECK: %gep.i0 = getelementptr i16, ptr @ptr, i16 %offset.i0
-; CHECK: %offset.i1 = extractelement <4 x i16> %offset, i32 1
-; CHECK: %gep.i1 = getelementptr i16, ptr @ptr, i16 %offset.i1
-; CHECK: %offset.i2 = extractelement <4 x i16> %offset, i32 2
-; CHECK: %gep.i2 = getelementptr i16, ptr @ptr, i16 %offset.i2
-; CHECK: %offset.i3 = extractelement <4 x i16> %offset, i32 3
-; CHECK: %gep.i3 = getelementptr i16, ptr @ptr, i16 %offset.i3
-
; non-constant pointer
define void @test4() {
+; CHECK-LABEL: @test4(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @ptrptr, align 8
+; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP0]], i32 0
+; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x ptr> [[DOTSPLATINSERT]], <4 x ptr> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: [[DOTSPLAT_I0:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 0
+; CHECK-NEXT: [[DOTI0:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I0]], i16 0
+; CHECK-NEXT: [[DOTSPLAT_I1:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 1
+; CHECK-NEXT: [[DOTI1:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I1]], i16 1
+; CHECK-NEXT: [[DOTSPLAT_I2:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 2
+; CHECK-NEXT: [[DOTI2:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I2]], i16 2
+; CHECK-NEXT: [[DOTSPLAT_I3:%.*]] = extractelement <4 x ptr> [[DOTSPLAT]], i32 3
+; CHECK-NEXT: [[DOTI3:%.*]] = getelementptr i16, ptr [[DOTSPLAT_I3]], i16 3
+; CHECK-NEXT: ret void
+;
bb:
%0 = load ptr, ptr @ptrptr
%1 = getelementptr i16, ptr %0, <4 x i16> <i16 0, i16 1, i16 2, i16 3>
@@ -113,21 +146,21 @@ bb:
ret void
}
-;CHECK-LABEL: @test4
-;CHECK: %0 = load ptr, ptr @ptrptr
-;CHECK: %.splatinsert = insertelement <4 x ptr> poison, ptr %0, i32 0
-;CHECK: %.splat = shufflevector <4 x ptr> %.splatinsert, <4 x ptr> poison, <4 x i32> zeroinitializer
-;CHECK: %.splat[[I0:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 0
-;CHECK: getelementptr i16, ptr %.splat[[I0]], i16 0
-;CHECK: %.splat[[I1:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 1
-;CHECK: getelementptr i16, ptr %.splat[[I1]], i16 1
-;CHECK: %.splat[[I2:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 2
-;CHECK: getelementptr i16, ptr %.splat[[I2]], i16 2
-;CHECK: %.splat[[I3:.i[0-9]*]] = extractelement <4 x ptr> %.splat, i32 3
-;CHECK: getelementptr i16, ptr %.splat[[I3]], i16 3
-
; constant index, inbounds
define void @test5() {
+; CHECK-LABEL: @test5(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[TMP0:%.*]] = load <4 x ptr>, ptr @vec, align 32
+; CHECK-NEXT: [[DOTI0:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 0
+; CHECK-NEXT: [[DOTI01:%.*]] = getelementptr inbounds i16, ptr [[DOTI0]], i16 1
+; CHECK-NEXT: [[DOTI1:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 1
+; CHECK-NEXT: [[DOTI12:%.*]] = getelementptr inbounds i16, ptr [[DOTI1]], i16 1
+; CHECK-NEXT: [[DOTI2:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 2
+; CHECK-NEXT: [[DOTI23:%.*]] = getelementptr inbounds i16, ptr [[DOTI2]], i16 1
+; CHECK-NEXT: [[DOTI3:%.*]] = extractelement <4 x ptr> [[TMP0]], i32 3
+; CHECK-NEXT: [[DOTI34:%.*]] = getelementptr inbounds i16, ptr [[DOTI3]], i16 1
+; CHECK-NEXT: ret void
+;
bb:
%0 = load <4 x ptr>, ptr @vec
%1 = getelementptr inbounds i16, <4 x ptr> %0, i16 1
@@ -135,13 +168,3 @@ bb:
ret void
}
-;CHECK-LABEL: @test5
-;CHECK: %[[I0:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 0
-;CHECK: getelementptr inbounds i16, ptr %[[I0]], i16 1
-;CHECK: %[[I1:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 1
-;CHECK: getelementptr inbounds i16, ptr %[[I1]], i16 1
-;CHECK: %[[I2:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 2
-;CHECK: getelementptr inbounds i16, ptr %[[I2]], i16 1
-;CHECK: %[[I3:.i[0-9]*]] = extractelement <4 x ptr> %0, i32 3
-;CHECK: getelementptr inbounds i16, ptr %[[I3]], i16 1
-
More information about the llvm-commits
mailing list