[llvm] fa87dd5 - [AMDGPU] Handle multiple occurences of an incoming value in break large PHIs
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 22 04:40:34 PDT 2023
Author: pvanhout
Date: 2023-05-22T13:40:26+02:00
New Revision: fa87dd52d4327ad7313e924c1f27b9321fb253d2
URL: https://github.com/llvm/llvm-project/commit/fa87dd52d4327ad7313e924c1f27b9321fb253d2
DIFF: https://github.com/llvm/llvm-project/commit/fa87dd52d4327ad7313e924c1f27b9321fb253d2.diff
LOG: [AMDGPU] Handle multiple occurences of an incoming value in break large PHIs
We naively broke all incoming values, assuming they'd be unique.
However it's not illegal to have multiple occurences of, e.g. `[BB0, V0]`
in a PHI node. What's illegal though is having the same basic block
multiple times but with different values, and it's exactly what the
transform caused. This broke in some rare applications where the pattern
arised.
Now we cache the `BasicBlock, Value` pairs we're breaking so we can reuse the values and preserve this invariant.
Solves SWDEV-399460
Reviewed By: #amdgpu, rovka
Differential Revision: https://reviews.llvm.org/D151069
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
index a07f23c228393..a1d5fa165d6ef 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
@@ -1556,6 +1556,73 @@ bool AMDGPUCodeGenPrepare::canBreakPHINode(const PHINode &I) {
return BreakPhiNodesCache[&I] = true;
}
+/// Helper class for "break large PHIs" (visitPHINode).
+///
+/// This represents a slice of a PHI's incoming value, which is made up of:
+/// - The type of the slice (Ty)
+/// - The index in the incoming value's vector where the slice starts (Idx)
+/// - The number of elements in the slice (NumElts).
+/// It also keeps track of the NewPHI node inserted for this particular slice.
+///
+/// Slice examples:
+/// <4 x i64> -> Split into four i64 slices.
+/// -> [i64, 0, 1], [i64, 1, 1], [i64, 2, 1], [i64, 3, 1]
+/// <5 x i16> -> Split into 2 <2 x i16> slices + a i16 tail.
+/// -> [<2 x i16>, 0, 2], [<2 x i16>, 2, 2], [i16, 4, 1]
+class VectorSlice {
+public:
+ VectorSlice(Type *Ty, unsigned Idx, unsigned NumElts)
+ : Ty(Ty), Idx(Idx), NumElts(NumElts) {}
+
+ Type *Ty = nullptr;
+ unsigned Idx = 0;
+ unsigned NumElts = 0;
+ PHINode *NewPHI = nullptr;
+
+ /// Slice \p Inc according to the information contained within this slice.
+ /// This is cached, so if called multiple times for the same \p BB & \p Inc
+ /// pair, it returns the same Sliced value as well.
+ ///
+ /// Note this *intentionally* does not return the same value for, say,
+ /// [%bb.0, %0] & [%bb.1, %0] as:
+ /// - It could cause issues with dominance (e.g. if bb.1 is seen first, then
+ /// the value in bb.1 may not be reachable from bb.0 if it's its
+ /// predecessor.)
+ /// - We also want to make our extract instructions as local as possible so
+ /// the DAG has better chances of folding them out. Duplicating them like
+ /// that is beneficial in that regard.
+ ///
+ /// This is both a minor optimization to avoid creating duplicate
+ /// instructions, but also a requirement for correctness. It is not forbidden
+ /// for a PHI node to have the same [BB, Val] pair multiple times. If we
+ /// returned a new value each time, those previously identical pairs would all
+ /// have
diff erent incoming values (from the same block) and it'd cause a "PHI
+ /// node has multiple entries for the same basic block with
diff erent incoming
+ /// values!" verifier error.
+ Value *getSlicedVal(BasicBlock *BB, Value *Inc, StringRef NewValName) {
+ Value *&Res = SlicedVals[{BB, Inc}];
+ if (Res)
+ return Res;
+
+ IRBuilder<> B(BB->getTerminator());
+ if (Instruction *IncInst = dyn_cast<Instruction>(Inc))
+ B.SetCurrentDebugLocation(IncInst->getDebugLoc());
+
+ if (NumElts > 1) {
+ SmallVector<int, 4> Mask;
+ for (unsigned K = Idx; K < (Idx + NumElts); ++K)
+ Mask.push_back(K);
+ Res = B.CreateShuffleVector(Inc, Mask, NewValName);
+ } else
+ Res = B.CreateExtractElement(Inc, Idx, NewValName);
+
+ return Res;
+ }
+
+private:
+ SmallDenseMap<std::pair<BasicBlock *, Value *>, Value *> SlicedVals;
+};
+
bool AMDGPUCodeGenPrepare::visitPHINode(PHINode &I) {
// Break-up fixed-vector PHIs into smaller pieces.
// Default threshold is 32, so it breaks up any vector that's >32 bits into
@@ -1577,14 +1644,6 @@ bool AMDGPUCodeGenPrepare::visitPHINode(PHINode &I) {
if (!ForceScalarizeLargePHIs && !canBreakPHINode(I))
return false;
- struct VectorSlice {
- Type *Ty = nullptr;
- unsigned Idx = 0;
- unsigned NumElts = 0;
- std::vector<Value *> IncomingValues = {};
- PHINode *NewPHI = nullptr;
- };
-
std::vector<VectorSlice> Slices;
Type *EltTy = FVT->getElementType();
@@ -1599,47 +1658,36 @@ bool AMDGPUCodeGenPrepare::visitPHINode(PHINode &I) {
Type *SubVecTy = FixedVectorType::get(EltTy, SubVecSize);
for (unsigned End = alignDown(NumElts, SubVecSize); Idx < End;
Idx += SubVecSize)
- Slices.push_back(VectorSlice{SubVecTy, Idx, SubVecSize});
+ Slices.emplace_back(SubVecTy, Idx, SubVecSize);
}
// Scalarize all remaining elements.
for (; Idx < NumElts; ++Idx)
- Slices.push_back(VectorSlice{EltTy, Idx, 1});
+ Slices.emplace_back(EltTy, Idx, 1);
}
if (Slices.size() == 1)
return false;
- // Break up this PHI's incoming values.
- for (unsigned Idx = 0; Idx < I.getNumIncomingValues(); ++Idx) {
- Value *Inc = I.getIncomingValue(Idx);
-
- IRBuilder<> B(I.getIncomingBlock(Idx)->getTerminator());
- if (Instruction *IncInst = dyn_cast<Instruction>(Inc))
- B.SetCurrentDebugLocation(IncInst->getDebugLoc());
-
- unsigned NameSuffix = 0;
- for (VectorSlice &S : Slices) {
- const auto ValName =
- "largephi.extractslice" + std::to_string(NameSuffix++);
- if (S.NumElts > 1) {
- SmallVector<int, 4> Mask;
- for (unsigned K = S.Idx; K < (S.Idx + S.NumElts); ++K)
- Mask.push_back(K);
- S.IncomingValues.push_back(B.CreateShuffleVector(Inc, Mask, ValName));
- } else
- S.IncomingValues.push_back(B.CreateExtractElement(Inc, S.Idx, ValName));
- }
- }
-
- // Now create one PHI per vector piece.
- IRBuilder<> B(I.getParent()->getFirstNonPHI());
+ // Create one PHI per vector piece. The "VectorSlice" class takes care of
+ // creating the necessary instruction to extract the relevant slices of each
+ // incoming value.
+ IRBuilder<> B(I.getParent());
B.SetCurrentDebugLocation(I.getDebugLoc());
+ unsigned IncNameSuffix = 0;
for (VectorSlice &S : Slices) {
+ // We need to reset the build on each iteration, because getSlicedVal may
+ // have inserted something into I's BB.
+ B.SetInsertPoint(I.getParent()->getFirstNonPHI());
S.NewPHI = B.CreatePHI(S.Ty, I.getNumIncomingValues());
- for (const auto &[Idx, BB] : enumerate(I.blocks()))
- S.NewPHI->addIncoming(S.IncomingValues[Idx], BB);
+
+ for (const auto &[Idx, BB] : enumerate(I.blocks())) {
+ S.NewPHI->addIncoming(S.getSlicedVal(BB, I.getIncomingValue(Idx),
+ "largephi.extractslice" +
+ std::to_string(IncNameSuffix++)),
+ BB);
+ }
}
// And replace this PHI with a vector of all the previous PHI values.
diff --git a/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll b/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll
index 4ff8647f5eaa2..bae5eac347015 100644
--- a/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll
+++ b/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis-heuristics.ll
@@ -12,19 +12,19 @@ define amdgpu_kernel void @constant_inc(<5 x double> %in, ptr %out, i1 %cond) {
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ 3.140000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ 9.900000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 6.140000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ poison, [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ poison, [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 9.900000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ 6.140000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ poison, [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ poison, [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -57,19 +57,19 @@ define amdgpu_kernel void @zeroinit_inc(<5 x double> %in, ptr %out, i1 %cond) {
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -101,19 +101,19 @@ define amdgpu_kernel void @poison_inc(<5 x double> %in, ptr %out, i1 %cond) {
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ poison, [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ poison, [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ poison, [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ poison, [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ poison, [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ poison, [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ poison, [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ poison, [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ poison, [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -145,25 +145,25 @@ define amdgpu_kernel void @shufflevec_inc_with_cst_op(<5 x double> %in, ptr %out
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: [[SHUFFLED:%.*]] = shufflevector <5 x double> [[IN]], <5 x double> poison, <5 x i32> <i32 0, i32 3, i32 2, i32 1, i32 4>
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 0
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 4
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
-; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE01]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE12]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE34]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -196,26 +196,26 @@ define amdgpu_kernel void @shufflevec_inc_with_local_lhs(<5 x double> %in, ptr %
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: [[LOCAL_SHUFFLE_SRC:%.*]] = insertelement <5 x double> [[IN]], double 3.250000e+00, i64 2
; CHECK-NEXT: [[SHUFFLED:%.*]] = shufflevector <5 x double> [[LOCAL_SHUFFLE_SRC]], <5 x double> [[IN]], <5 x i32> <i32 7, i32 3, i32 2, i32 5, i32 4>
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 0
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 4
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
-; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE01]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE12]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE34]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -249,26 +249,26 @@ define amdgpu_kernel void @shufflevec_inc_with_local_rhs(<5 x double> %in, ptr %
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: [[LOCAL_SHUFFLE_SRC:%.*]] = insertelement <5 x double> [[IN]], double 3.250000e+00, i64 2
; CHECK-NEXT: [[SHUFFLED:%.*]] = shufflevector <5 x double> [[IN]], <5 x double> [[LOCAL_SHUFFLE_SRC]], <5 x i32> <i32 7, i32 3, i32 2, i32 5, i32 4>
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 0
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[SHUFFLED]], i64 4
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
-; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE01]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE12]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE34]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -340,24 +340,24 @@ define amdgpu_kernel void @trivial_insertelt_chain(<5 x double> %in, ptr %out, i
; CHECK-NEXT: [[TMP2:%.*]] = insertelement <5 x double> [[TMP1]], double [[Z:%.*]], i64 3
; CHECK-NEXT: [[X_4:%.*]] = insertelement <5 x double> [[TMP2]], double [[X]], i64 4
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X_4]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X_4]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X_4]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X_4]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X_4]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X_4]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X_4]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X_4]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X_4]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[IN:%.*]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[IN]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[IN]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[IN]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[IN]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[IN:%.*]], i64 0
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[IN]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[IN]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[IN]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[IN]], i64 4
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE01]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE12]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE34]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP7:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP7:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP3]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP4]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP5]], i64 2
@@ -394,24 +394,24 @@ define amdgpu_kernel void @trivial_folded_insertelt_chain(<5 x double> %in, ptr
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <5 x double> <double 3.140000e+00, double 9.900000e+00, double 6.140000e+00, double poison, double poison>, double [[X:%.*]], i64 3
; CHECK-NEXT: [[X_4:%.*]] = insertelement <5 x double> [[TMP0]], double [[X]], i64 4
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X_4]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X_4]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X_4]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X_4]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X_4]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X_4]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X_4]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X_4]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X_4]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[IN:%.*]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[IN]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[IN]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[IN]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[IN]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[IN:%.*]], i64 0
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[IN]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[IN]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[IN]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[IN]], i64 4
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE01]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE12]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE34]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP1]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP2]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP3]], i64 2
@@ -446,24 +446,24 @@ define amdgpu_kernel void @insertelt_shufflevec(<5 x double> %in, ptr %out, i1 %
; CHECK-NEXT: [[TMP0:%.*]] = shufflevector <5 x double> [[X_1]], <5 x double> <double poison, double poison, double poison, double 6.140000e+00, double 9.900000e+00>, <5 x i32> <i32 0, i32 1, i32 poison, i32 8, i32 9>
; CHECK-NEXT: [[X_4:%.*]] = insertelement <5 x double> [[TMP0]], double [[X]], i64 2
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X_4]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X_4]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X_4]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X_4]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X_4]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X_4]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X_4]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X_4]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X_4]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[IN:%.*]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[IN]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[IN]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[IN]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[IN]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[IN:%.*]], i64 0
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[IN]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[IN]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[IN]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[IN]], i64 4
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE01]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE12]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE34]], [[ELSE]] ]
-; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP1]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP2]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP3]], i64 2
@@ -571,19 +571,19 @@ define amdgpu_kernel void @used_by_breakable_phi(<5 x double> %in, ptr %out, i1
; CHECK: then:
; CHECK-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i64 3
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; CHECK-NEXT: br label [[FINALLY:%.*]]
; CHECK: else:
; CHECK-NEXT: br label [[FINALLY]]
; CHECK: finally:
; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ 0.000000e+00, [[ELSE]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
@@ -593,17 +593,17 @@ define amdgpu_kernel void @used_by_breakable_phi(<5 x double> %in, ptr %out, i1
; CHECK-NEXT: br i1 [[COND2:%.*]], label [[THEN1:%.*]], label [[END:%.*]]
; CHECK: then1:
; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE01:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 0
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 1
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 2
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 3
-; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 4
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE22:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 1
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE43:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 2
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE64:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 3
+; CHECK-NEXT: [[LARGEPHI_EXTRACTSLICE85:%.*]] = extractelement <5 x double> [[LARGEPHI_INSERTSLICE4]], i64 4
; CHECK-NEXT: br label [[END]]
; CHECK: end:
; CHECK-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE01]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
-; CHECK-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
-; CHECK-NEXT: [[TMP7:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE23]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
-; CHECK-NEXT: [[TMP8:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE34]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
-; CHECK-NEXT: [[TMP9:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE45]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
+; CHECK-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE22]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
+; CHECK-NEXT: [[TMP7:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE43]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
+; CHECK-NEXT: [[TMP8:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE64]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
+; CHECK-NEXT: [[TMP9:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE85]], [[THEN1]] ], [ 0.000000e+00, [[FINALLY]] ]
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE06:%.*]] = insertelement <5 x double> poison, double [[TMP5]], i64 0
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE17:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE06]], double [[TMP6]], i64 1
; CHECK-NEXT: [[LARGEPHI_INSERTSLICE28:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE17]], double [[TMP7]], i64 2
diff --git a/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis.ll b/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis.ll
index ab8f2388ef289..192bf7c249817 100644
--- a/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis.ll
+++ b/llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-break-large-phis.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -mtriple=amdgcn-- -amdgpu-codegenprepare -amdgpu-codegenprepare-force-break-large-phis %s | FileCheck %s --check-prefixes=OPT
+; RUN: opt -S -mtriple=amdgcn-- -amdgpu-codegenprepare -amdgpu-codegenprepare-force-break-large-phis -verify %s | FileCheck %s --check-prefixes=OPT
; RUN: opt -S -mtriple=amdgcn-- -amdgpu-codegenprepare --global-isel %s | FileCheck %s --check-prefixes=NOOPT
; RUN: opt -S -mtriple=amdgcn-- -amdgpu-codegenprepare -amdgpu-codegenprepare-break-large-phis=0 %s | FileCheck %s --check-prefixes=NOOPT
@@ -9,32 +9,32 @@ define amdgpu_kernel void @phi_v5f64(<5 x double> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <5 x double> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <5 x double> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <5 x double> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <5 x double> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <5 x double> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <5 x double> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <5 x double> [[X]], i64 4
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <5 x double> [[IN]], double 9.140000e+00, i32 2
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <5 x double> [[Y]], i64 0
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <5 x double> [[Y]], i64 1
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <5 x double> [[Y]], i64 2
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <5 x double> [[Y]], i64 3
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <5 x double> [[Y]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <5 x double> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[Y]], i64 4
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP10:%.*]] = phi double [ [[TMP0]], [[THEN]] ], [ [[TMP5]], [[ELSE]] ]
-; OPT-NEXT: [[TMP11:%.*]] = phi double [ [[TMP1]], [[THEN]] ], [ [[TMP6]], [[ELSE]] ]
-; OPT-NEXT: [[TMP12:%.*]] = phi double [ [[TMP2]], [[THEN]] ], [ [[TMP7]], [[ELSE]] ]
-; OPT-NEXT: [[TMP13:%.*]] = phi double [ [[TMP3]], [[THEN]] ], [ [[TMP8]], [[ELSE]] ]
-; OPT-NEXT: [[TMP14:%.*]] = phi double [ [[TMP4]], [[THEN]] ], [ [[TMP9]], [[ELSE]] ]
-; OPT-NEXT: [[TMP15:%.*]] = insertelement <5 x double> poison, double [[TMP10]], i64 0
-; OPT-NEXT: [[TMP16:%.*]] = insertelement <5 x double> [[TMP15]], double [[TMP11]], i64 1
-; OPT-NEXT: [[TMP17:%.*]] = insertelement <5 x double> [[TMP16]], double [[TMP12]], i64 2
-; OPT-NEXT: [[TMP18:%.*]] = insertelement <5 x double> [[TMP17]], double [[TMP13]], i64 3
-; OPT-NEXT: [[TMP19:%.*]] = insertelement <5 x double> [[TMP18]], double [[TMP14]], i64 4
-; OPT-NEXT: store <5 x double> [[TMP19]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE2]], double [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE3]], double [[TMP4]], i64 4
+; OPT-NEXT: store <5 x double> [[LARGEPHI_INSERTSLICE4]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v5f64(
@@ -71,40 +71,40 @@ define amdgpu_kernel void @phi_v7f64(<7 x double> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <7 x double> [[IN:%.*]], double 3.140000e+00, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <7 x double> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <7 x double> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <7 x double> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <7 x double> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <7 x double> [[X]], i64 4
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <7 x double> [[X]], i64 5
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <7 x double> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <7 x double> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <7 x double> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <7 x double> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <7 x double> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <7 x double> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <7 x double> [[X]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <7 x double> [[X]], i64 6
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <7 x double> [[IN]], double 9.140000e+00, i32 6
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <7 x double> [[Y]], i64 0
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <7 x double> [[Y]], i64 1
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <7 x double> [[Y]], i64 2
-; OPT-NEXT: [[TMP10:%.*]] = extractelement <7 x double> [[Y]], i64 3
-; OPT-NEXT: [[TMP11:%.*]] = extractelement <7 x double> [[Y]], i64 4
-; OPT-NEXT: [[TMP12:%.*]] = extractelement <7 x double> [[Y]], i64 5
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <7 x double> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <7 x double> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <7 x double> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <7 x double> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <7 x double> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <7 x double> [[Y]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <7 x double> [[Y]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <7 x double> [[Y]], i64 6
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP14:%.*]] = phi double [ [[TMP0]], [[THEN]] ], [ [[TMP7]], [[ELSE]] ]
-; OPT-NEXT: [[TMP15:%.*]] = phi double [ [[TMP1]], [[THEN]] ], [ [[TMP8]], [[ELSE]] ]
-; OPT-NEXT: [[TMP16:%.*]] = phi double [ [[TMP2]], [[THEN]] ], [ [[TMP9]], [[ELSE]] ]
-; OPT-NEXT: [[TMP17:%.*]] = phi double [ [[TMP3]], [[THEN]] ], [ [[TMP10]], [[ELSE]] ]
-; OPT-NEXT: [[TMP18:%.*]] = phi double [ [[TMP4]], [[THEN]] ], [ [[TMP11]], [[ELSE]] ]
-; OPT-NEXT: [[TMP19:%.*]] = phi double [ [[TMP5]], [[THEN]] ], [ [[TMP12]], [[ELSE]] ]
-; OPT-NEXT: [[TMP20:%.*]] = phi double [ [[TMP6]], [[THEN]] ], [ [[TMP13]], [[ELSE]] ]
-; OPT-NEXT: [[TMP21:%.*]] = insertelement <7 x double> poison, double [[TMP14]], i64 0
-; OPT-NEXT: [[TMP22:%.*]] = insertelement <7 x double> [[TMP21]], double [[TMP15]], i64 1
-; OPT-NEXT: [[TMP23:%.*]] = insertelement <7 x double> [[TMP22]], double [[TMP16]], i64 2
-; OPT-NEXT: [[TMP24:%.*]] = insertelement <7 x double> [[TMP23]], double [[TMP17]], i64 3
-; OPT-NEXT: [[TMP25:%.*]] = insertelement <7 x double> [[TMP24]], double [[TMP18]], i64 4
-; OPT-NEXT: [[TMP26:%.*]] = insertelement <7 x double> [[TMP25]], double [[TMP19]], i64 5
-; OPT-NEXT: [[TMP27:%.*]] = insertelement <7 x double> [[TMP26]], double [[TMP20]], i64 6
-; OPT-NEXT: store <7 x double> [[TMP27]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <7 x double> poison, double [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <7 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <7 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <7 x double> [[LARGEPHI_INSERTSLICE2]], double [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <7 x double> [[LARGEPHI_INSERTSLICE3]], double [[TMP4]], i64 4
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <7 x double> [[LARGEPHI_INSERTSLICE4]], double [[TMP5]], i64 5
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <7 x double> [[LARGEPHI_INSERTSLICE5]], double [[TMP6]], i64 6
+; OPT-NEXT: store <7 x double> [[LARGEPHI_INSERTSLICE6]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v7f64(
@@ -141,56 +141,56 @@ define amdgpu_kernel void @phi_v11f64(<11 x double> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <11 x double> [[IN:%.*]], double 3.140000e+00, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <11 x double> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <11 x double> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <11 x double> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <11 x double> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <11 x double> [[X]], i64 4
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <11 x double> [[X]], i64 5
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <11 x double> [[X]], i64 6
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <11 x double> [[X]], i64 7
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <11 x double> [[X]], i64 8
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <11 x double> [[X]], i64 9
-; OPT-NEXT: [[TMP10:%.*]] = extractelement <11 x double> [[X]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <11 x double> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <11 x double> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <11 x double> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <11 x double> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <11 x double> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <11 x double> [[X]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <11 x double> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = extractelement <11 x double> [[X]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE16:%.*]] = extractelement <11 x double> [[X]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE18:%.*]] = extractelement <11 x double> [[X]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE20:%.*]] = extractelement <11 x double> [[X]], i64 10
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <11 x double> [[IN]], double 9.140000e+00, i32 6
-; OPT-NEXT: [[TMP11:%.*]] = extractelement <11 x double> [[Y]], i64 0
-; OPT-NEXT: [[TMP12:%.*]] = extractelement <11 x double> [[Y]], i64 1
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <11 x double> [[Y]], i64 2
-; OPT-NEXT: [[TMP14:%.*]] = extractelement <11 x double> [[Y]], i64 3
-; OPT-NEXT: [[TMP15:%.*]] = extractelement <11 x double> [[Y]], i64 4
-; OPT-NEXT: [[TMP16:%.*]] = extractelement <11 x double> [[Y]], i64 5
-; OPT-NEXT: [[TMP17:%.*]] = extractelement <11 x double> [[Y]], i64 6
-; OPT-NEXT: [[TMP18:%.*]] = extractelement <11 x double> [[Y]], i64 7
-; OPT-NEXT: [[TMP19:%.*]] = extractelement <11 x double> [[Y]], i64 8
-; OPT-NEXT: [[TMP20:%.*]] = extractelement <11 x double> [[Y]], i64 9
-; OPT-NEXT: [[TMP21:%.*]] = extractelement <11 x double> [[Y]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <11 x double> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <11 x double> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <11 x double> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <11 x double> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <11 x double> [[Y]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <11 x double> [[Y]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <11 x double> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = extractelement <11 x double> [[Y]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE17:%.*]] = extractelement <11 x double> [[Y]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE19:%.*]] = extractelement <11 x double> [[Y]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE21:%.*]] = extractelement <11 x double> [[Y]], i64 10
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP22:%.*]] = phi double [ [[TMP0]], [[THEN]] ], [ [[TMP11]], [[ELSE]] ]
-; OPT-NEXT: [[TMP23:%.*]] = phi double [ [[TMP1]], [[THEN]] ], [ [[TMP12]], [[ELSE]] ]
-; OPT-NEXT: [[TMP24:%.*]] = phi double [ [[TMP2]], [[THEN]] ], [ [[TMP13]], [[ELSE]] ]
-; OPT-NEXT: [[TMP25:%.*]] = phi double [ [[TMP3]], [[THEN]] ], [ [[TMP14]], [[ELSE]] ]
-; OPT-NEXT: [[TMP26:%.*]] = phi double [ [[TMP4]], [[THEN]] ], [ [[TMP15]], [[ELSE]] ]
-; OPT-NEXT: [[TMP27:%.*]] = phi double [ [[TMP5]], [[THEN]] ], [ [[TMP16]], [[ELSE]] ]
-; OPT-NEXT: [[TMP28:%.*]] = phi double [ [[TMP6]], [[THEN]] ], [ [[TMP17]], [[ELSE]] ]
-; OPT-NEXT: [[TMP29:%.*]] = phi double [ [[TMP7]], [[THEN]] ], [ [[TMP18]], [[ELSE]] ]
-; OPT-NEXT: [[TMP30:%.*]] = phi double [ [[TMP8]], [[THEN]] ], [ [[TMP19]], [[ELSE]] ]
-; OPT-NEXT: [[TMP31:%.*]] = phi double [ [[TMP9]], [[THEN]] ], [ [[TMP20]], [[ELSE]] ]
-; OPT-NEXT: [[TMP32:%.*]] = phi double [ [[TMP10]], [[THEN]] ], [ [[TMP21]], [[ELSE]] ]
-; OPT-NEXT: [[TMP33:%.*]] = insertelement <11 x double> poison, double [[TMP22]], i64 0
-; OPT-NEXT: [[TMP34:%.*]] = insertelement <11 x double> [[TMP33]], double [[TMP23]], i64 1
-; OPT-NEXT: [[TMP35:%.*]] = insertelement <11 x double> [[TMP34]], double [[TMP24]], i64 2
-; OPT-NEXT: [[TMP36:%.*]] = insertelement <11 x double> [[TMP35]], double [[TMP25]], i64 3
-; OPT-NEXT: [[TMP37:%.*]] = insertelement <11 x double> [[TMP36]], double [[TMP26]], i64 4
-; OPT-NEXT: [[TMP38:%.*]] = insertelement <11 x double> [[TMP37]], double [[TMP27]], i64 5
-; OPT-NEXT: [[TMP39:%.*]] = insertelement <11 x double> [[TMP38]], double [[TMP28]], i64 6
-; OPT-NEXT: [[TMP40:%.*]] = insertelement <11 x double> [[TMP39]], double [[TMP29]], i64 7
-; OPT-NEXT: [[TMP41:%.*]] = insertelement <11 x double> [[TMP40]], double [[TMP30]], i64 8
-; OPT-NEXT: [[TMP42:%.*]] = insertelement <11 x double> [[TMP41]], double [[TMP31]], i64 9
-; OPT-NEXT: [[TMP43:%.*]] = insertelement <11 x double> [[TMP42]], double [[TMP32]], i64 10
-; OPT-NEXT: store <11 x double> [[TMP43]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[TMP8:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE16]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE17]], [[ELSE]] ]
+; OPT-NEXT: [[TMP9:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE18]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE19]], [[ELSE]] ]
+; OPT-NEXT: [[TMP10:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE20]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE21]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <11 x double> poison, double [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE2]], double [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE3]], double [[TMP4]], i64 4
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE4]], double [[TMP5]], i64 5
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE5]], double [[TMP6]], i64 6
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE6]], double [[TMP7]], i64 7
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE8:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE7]], double [[TMP8]], i64 8
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE9:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE8]], double [[TMP9]], i64 9
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE10:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE9]], double [[TMP10]], i64 10
+; OPT-NEXT: store <11 x double> [[LARGEPHI_INSERTSLICE10]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v11f64(
@@ -227,42 +227,42 @@ define amdgpu_kernel void @phi_v11f64_cst(<11 x double> %in, ptr %out, i1 %cond)
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[FINALLY:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <11 x double> [[IN:%.*]], double 3.140000e+00, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <11 x double> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <11 x double> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <11 x double> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <11 x double> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <11 x double> [[X]], i64 4
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <11 x double> [[X]], i64 5
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <11 x double> [[X]], i64 6
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <11 x double> [[X]], i64 7
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <11 x double> [[X]], i64 8
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <11 x double> [[X]], i64 9
-; OPT-NEXT: [[TMP10:%.*]] = extractelement <11 x double> [[X]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <11 x double> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <11 x double> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <11 x double> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <11 x double> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <11 x double> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <11 x double> [[X]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <11 x double> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = extractelement <11 x double> [[X]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE16:%.*]] = extractelement <11 x double> [[X]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE18:%.*]] = extractelement <11 x double> [[X]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE20:%.*]] = extractelement <11 x double> [[X]], i64 10
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP11:%.*]] = phi double [ [[TMP0]], [[THEN]] ], [ 0.000000e+00, [[ENTRY:%.*]] ]
-; OPT-NEXT: [[TMP12:%.*]] = phi double [ [[TMP1]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP13:%.*]] = phi double [ [[TMP2]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP14:%.*]] = phi double [ [[TMP3]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP15:%.*]] = phi double [ [[TMP4]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP16:%.*]] = phi double [ [[TMP5]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP17:%.*]] = phi double [ [[TMP6]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP18:%.*]] = phi double [ [[TMP7]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP19:%.*]] = phi double [ [[TMP8]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP20:%.*]] = phi double [ [[TMP9]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP21:%.*]] = phi double [ [[TMP10]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
-; OPT-NEXT: [[TMP22:%.*]] = insertelement <11 x double> poison, double [[TMP11]], i64 0
-; OPT-NEXT: [[TMP23:%.*]] = insertelement <11 x double> [[TMP22]], double [[TMP12]], i64 1
-; OPT-NEXT: [[TMP24:%.*]] = insertelement <11 x double> [[TMP23]], double [[TMP13]], i64 2
-; OPT-NEXT: [[TMP25:%.*]] = insertelement <11 x double> [[TMP24]], double [[TMP14]], i64 3
-; OPT-NEXT: [[TMP26:%.*]] = insertelement <11 x double> [[TMP25]], double [[TMP15]], i64 4
-; OPT-NEXT: [[TMP27:%.*]] = insertelement <11 x double> [[TMP26]], double [[TMP16]], i64 5
-; OPT-NEXT: [[TMP28:%.*]] = insertelement <11 x double> [[TMP27]], double [[TMP17]], i64 6
-; OPT-NEXT: [[TMP29:%.*]] = insertelement <11 x double> [[TMP28]], double [[TMP18]], i64 7
-; OPT-NEXT: [[TMP30:%.*]] = insertelement <11 x double> [[TMP29]], double [[TMP19]], i64 8
-; OPT-NEXT: [[TMP31:%.*]] = insertelement <11 x double> [[TMP30]], double [[TMP20]], i64 9
-; OPT-NEXT: [[TMP32:%.*]] = insertelement <11 x double> [[TMP31]], double [[TMP21]], i64 10
-; OPT-NEXT: store <11 x double> [[TMP32]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ 0.000000e+00, [[ENTRY:%.*]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP8:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE16]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP9:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE18]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[TMP10:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE20]], [[THEN]] ], [ 0.000000e+00, [[ENTRY]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <11 x double> poison, double [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE2]], double [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE3]], double [[TMP4]], i64 4
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE4]], double [[TMP5]], i64 5
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE5]], double [[TMP6]], i64 6
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE6]], double [[TMP7]], i64 7
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE8:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE7]], double [[TMP8]], i64 8
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE9:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE8]], double [[TMP9]], i64 9
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE10:%.*]] = insertelement <11 x double> [[LARGEPHI_INSERTSLICE9]], double [[TMP10]], i64 10
+; OPT-NEXT: store <11 x double> [[LARGEPHI_INSERTSLICE10]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v11f64_cst(
@@ -293,72 +293,72 @@ define amdgpu_kernel void @phi_v15i64(<15 x i64> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <15 x i64> [[IN:%.*]], i64 42, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <15 x i64> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <15 x i64> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <15 x i64> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <15 x i64> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <15 x i64> [[X]], i64 4
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <15 x i64> [[X]], i64 5
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <15 x i64> [[X]], i64 6
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <15 x i64> [[X]], i64 7
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <15 x i64> [[X]], i64 8
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <15 x i64> [[X]], i64 9
-; OPT-NEXT: [[TMP10:%.*]] = extractelement <15 x i64> [[X]], i64 10
-; OPT-NEXT: [[TMP11:%.*]] = extractelement <15 x i64> [[X]], i64 11
-; OPT-NEXT: [[TMP12:%.*]] = extractelement <15 x i64> [[X]], i64 12
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <15 x i64> [[X]], i64 13
-; OPT-NEXT: [[TMP14:%.*]] = extractelement <15 x i64> [[X]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <15 x i64> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <15 x i64> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <15 x i64> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <15 x i64> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <15 x i64> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <15 x i64> [[X]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <15 x i64> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = extractelement <15 x i64> [[X]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE16:%.*]] = extractelement <15 x i64> [[X]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE18:%.*]] = extractelement <15 x i64> [[X]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE20:%.*]] = extractelement <15 x i64> [[X]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE22:%.*]] = extractelement <15 x i64> [[X]], i64 11
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE24:%.*]] = extractelement <15 x i64> [[X]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE26:%.*]] = extractelement <15 x i64> [[X]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE28:%.*]] = extractelement <15 x i64> [[X]], i64 14
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <15 x i64> [[IN]], i64 64, i32 6
-; OPT-NEXT: [[TMP15:%.*]] = extractelement <15 x i64> [[Y]], i64 0
-; OPT-NEXT: [[TMP16:%.*]] = extractelement <15 x i64> [[Y]], i64 1
-; OPT-NEXT: [[TMP17:%.*]] = extractelement <15 x i64> [[Y]], i64 2
-; OPT-NEXT: [[TMP18:%.*]] = extractelement <15 x i64> [[Y]], i64 3
-; OPT-NEXT: [[TMP19:%.*]] = extractelement <15 x i64> [[Y]], i64 4
-; OPT-NEXT: [[TMP20:%.*]] = extractelement <15 x i64> [[Y]], i64 5
-; OPT-NEXT: [[TMP21:%.*]] = extractelement <15 x i64> [[Y]], i64 6
-; OPT-NEXT: [[TMP22:%.*]] = extractelement <15 x i64> [[Y]], i64 7
-; OPT-NEXT: [[TMP23:%.*]] = extractelement <15 x i64> [[Y]], i64 8
-; OPT-NEXT: [[TMP24:%.*]] = extractelement <15 x i64> [[Y]], i64 9
-; OPT-NEXT: [[TMP25:%.*]] = extractelement <15 x i64> [[Y]], i64 10
-; OPT-NEXT: [[TMP26:%.*]] = extractelement <15 x i64> [[Y]], i64 11
-; OPT-NEXT: [[TMP27:%.*]] = extractelement <15 x i64> [[Y]], i64 12
-; OPT-NEXT: [[TMP28:%.*]] = extractelement <15 x i64> [[Y]], i64 13
-; OPT-NEXT: [[TMP29:%.*]] = extractelement <15 x i64> [[Y]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <15 x i64> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <15 x i64> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <15 x i64> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <15 x i64> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <15 x i64> [[Y]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <15 x i64> [[Y]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <15 x i64> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = extractelement <15 x i64> [[Y]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE17:%.*]] = extractelement <15 x i64> [[Y]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE19:%.*]] = extractelement <15 x i64> [[Y]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE21:%.*]] = extractelement <15 x i64> [[Y]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <15 x i64> [[Y]], i64 11
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE25:%.*]] = extractelement <15 x i64> [[Y]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE27:%.*]] = extractelement <15 x i64> [[Y]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE29:%.*]] = extractelement <15 x i64> [[Y]], i64 14
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP30:%.*]] = phi i64 [ [[TMP0]], [[THEN]] ], [ [[TMP15]], [[ELSE]] ]
-; OPT-NEXT: [[TMP31:%.*]] = phi i64 [ [[TMP1]], [[THEN]] ], [ [[TMP16]], [[ELSE]] ]
-; OPT-NEXT: [[TMP32:%.*]] = phi i64 [ [[TMP2]], [[THEN]] ], [ [[TMP17]], [[ELSE]] ]
-; OPT-NEXT: [[TMP33:%.*]] = phi i64 [ [[TMP3]], [[THEN]] ], [ [[TMP18]], [[ELSE]] ]
-; OPT-NEXT: [[TMP34:%.*]] = phi i64 [ [[TMP4]], [[THEN]] ], [ [[TMP19]], [[ELSE]] ]
-; OPT-NEXT: [[TMP35:%.*]] = phi i64 [ [[TMP5]], [[THEN]] ], [ [[TMP20]], [[ELSE]] ]
-; OPT-NEXT: [[TMP36:%.*]] = phi i64 [ [[TMP6]], [[THEN]] ], [ [[TMP21]], [[ELSE]] ]
-; OPT-NEXT: [[TMP37:%.*]] = phi i64 [ [[TMP7]], [[THEN]] ], [ [[TMP22]], [[ELSE]] ]
-; OPT-NEXT: [[TMP38:%.*]] = phi i64 [ [[TMP8]], [[THEN]] ], [ [[TMP23]], [[ELSE]] ]
-; OPT-NEXT: [[TMP39:%.*]] = phi i64 [ [[TMP9]], [[THEN]] ], [ [[TMP24]], [[ELSE]] ]
-; OPT-NEXT: [[TMP40:%.*]] = phi i64 [ [[TMP10]], [[THEN]] ], [ [[TMP25]], [[ELSE]] ]
-; OPT-NEXT: [[TMP41:%.*]] = phi i64 [ [[TMP11]], [[THEN]] ], [ [[TMP26]], [[ELSE]] ]
-; OPT-NEXT: [[TMP42:%.*]] = phi i64 [ [[TMP12]], [[THEN]] ], [ [[TMP27]], [[ELSE]] ]
-; OPT-NEXT: [[TMP43:%.*]] = phi i64 [ [[TMP13]], [[THEN]] ], [ [[TMP28]], [[ELSE]] ]
-; OPT-NEXT: [[TMP44:%.*]] = phi i64 [ [[TMP14]], [[THEN]] ], [ [[TMP29]], [[ELSE]] ]
-; OPT-NEXT: [[TMP45:%.*]] = insertelement <15 x i64> poison, i64 [[TMP30]], i64 0
-; OPT-NEXT: [[TMP46:%.*]] = insertelement <15 x i64> [[TMP45]], i64 [[TMP31]], i64 1
-; OPT-NEXT: [[TMP47:%.*]] = insertelement <15 x i64> [[TMP46]], i64 [[TMP32]], i64 2
-; OPT-NEXT: [[TMP48:%.*]] = insertelement <15 x i64> [[TMP47]], i64 [[TMP33]], i64 3
-; OPT-NEXT: [[TMP49:%.*]] = insertelement <15 x i64> [[TMP48]], i64 [[TMP34]], i64 4
-; OPT-NEXT: [[TMP50:%.*]] = insertelement <15 x i64> [[TMP49]], i64 [[TMP35]], i64 5
-; OPT-NEXT: [[TMP51:%.*]] = insertelement <15 x i64> [[TMP50]], i64 [[TMP36]], i64 6
-; OPT-NEXT: [[TMP52:%.*]] = insertelement <15 x i64> [[TMP51]], i64 [[TMP37]], i64 7
-; OPT-NEXT: [[TMP53:%.*]] = insertelement <15 x i64> [[TMP52]], i64 [[TMP38]], i64 8
-; OPT-NEXT: [[TMP54:%.*]] = insertelement <15 x i64> [[TMP53]], i64 [[TMP39]], i64 9
-; OPT-NEXT: [[TMP55:%.*]] = insertelement <15 x i64> [[TMP54]], i64 [[TMP40]], i64 10
-; OPT-NEXT: [[TMP56:%.*]] = insertelement <15 x i64> [[TMP55]], i64 [[TMP41]], i64 11
-; OPT-NEXT: [[TMP57:%.*]] = insertelement <15 x i64> [[TMP56]], i64 [[TMP42]], i64 12
-; OPT-NEXT: [[TMP58:%.*]] = insertelement <15 x i64> [[TMP57]], i64 [[TMP43]], i64 13
-; OPT-NEXT: [[TMP59:%.*]] = insertelement <15 x i64> [[TMP58]], i64 [[TMP44]], i64 14
-; OPT-NEXT: store <15 x i64> [[TMP59]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[TMP8:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE16]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE17]], [[ELSE]] ]
+; OPT-NEXT: [[TMP9:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE18]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE19]], [[ELSE]] ]
+; OPT-NEXT: [[TMP10:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE20]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE21]], [[ELSE]] ]
+; OPT-NEXT: [[TMP11:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE22]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
+; OPT-NEXT: [[TMP12:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE24]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE25]], [[ELSE]] ]
+; OPT-NEXT: [[TMP13:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE26]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE27]], [[ELSE]] ]
+; OPT-NEXT: [[TMP14:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE28]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE29]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <15 x i64> poison, i64 [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE0]], i64 [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE1]], i64 [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE2]], i64 [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE3]], i64 [[TMP4]], i64 4
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE4]], i64 [[TMP5]], i64 5
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE5]], i64 [[TMP6]], i64 6
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE6]], i64 [[TMP7]], i64 7
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE8:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE7]], i64 [[TMP8]], i64 8
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE9:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE8]], i64 [[TMP9]], i64 9
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE10:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE9]], i64 [[TMP10]], i64 10
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE11:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE10]], i64 [[TMP11]], i64 11
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE12:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE11]], i64 [[TMP12]], i64 12
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE13:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE12]], i64 [[TMP13]], i64 13
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE14:%.*]] = insertelement <15 x i64> [[LARGEPHI_INSERTSLICE13]], i64 [[TMP14]], i64 14
+; OPT-NEXT: store <15 x i64> [[LARGEPHI_INSERTSLICE14]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v15i64(
@@ -395,68 +395,68 @@ define amdgpu_kernel void @phi_v27i16(<27 x i16> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <27 x i16> [[IN:%.*]], i16 42, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP1:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP2:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP3:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 6, i32 7>
-; OPT-NEXT: [[TMP4:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 8, i32 9>
-; OPT-NEXT: [[TMP5:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 10, i32 11>
-; OPT-NEXT: [[TMP6:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 12, i32 13>
-; OPT-NEXT: [[TMP7:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 14, i32 15>
-; OPT-NEXT: [[TMP8:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 16, i32 17>
-; OPT-NEXT: [[TMP9:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 18, i32 19>
-; OPT-NEXT: [[TMP10:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 20, i32 21>
-; OPT-NEXT: [[TMP11:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 22, i32 23>
-; OPT-NEXT: [[TMP12:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 24, i32 25>
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <27 x i16> [[X]], i64 26
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 6, i32 7>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 8, i32 9>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 10, i32 11>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 12, i32 13>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 14, i32 15>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE16:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 16, i32 17>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE18:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 18, i32 19>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE20:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 20, i32 21>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE22:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 22, i32 23>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE24:%.*]] = shufflevector <27 x i16> [[X]], <27 x i16> poison, <2 x i32> <i32 24, i32 25>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE26:%.*]] = extractelement <27 x i16> [[X]], i64 26
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <27 x i16> [[IN]], i16 64, i32 6
-; OPT-NEXT: [[TMP14:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP15:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP16:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP17:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 6, i32 7>
-; OPT-NEXT: [[TMP18:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 8, i32 9>
-; OPT-NEXT: [[TMP19:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 10, i32 11>
-; OPT-NEXT: [[TMP20:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 12, i32 13>
-; OPT-NEXT: [[TMP21:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 14, i32 15>
-; OPT-NEXT: [[TMP22:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 16, i32 17>
-; OPT-NEXT: [[TMP23:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 18, i32 19>
-; OPT-NEXT: [[TMP24:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 20, i32 21>
-; OPT-NEXT: [[TMP25:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 22, i32 23>
-; OPT-NEXT: [[TMP26:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 24, i32 25>
-; OPT-NEXT: [[TMP27:%.*]] = extractelement <27 x i16> [[Y]], i64 26
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 6, i32 7>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 8, i32 9>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 10, i32 11>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 12, i32 13>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 14, i32 15>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE17:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 16, i32 17>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE19:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 18, i32 19>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE21:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 20, i32 21>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 22, i32 23>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE25:%.*]] = shufflevector <27 x i16> [[Y]], <27 x i16> poison, <2 x i32> <i32 24, i32 25>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE27:%.*]] = extractelement <27 x i16> [[Y]], i64 26
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP28:%.*]] = phi <2 x i16> [ [[TMP0]], [[THEN]] ], [ [[TMP14]], [[ELSE]] ]
-; OPT-NEXT: [[TMP29:%.*]] = phi <2 x i16> [ [[TMP1]], [[THEN]] ], [ [[TMP15]], [[ELSE]] ]
-; OPT-NEXT: [[TMP30:%.*]] = phi <2 x i16> [ [[TMP2]], [[THEN]] ], [ [[TMP16]], [[ELSE]] ]
-; OPT-NEXT: [[TMP31:%.*]] = phi <2 x i16> [ [[TMP3]], [[THEN]] ], [ [[TMP17]], [[ELSE]] ]
-; OPT-NEXT: [[TMP32:%.*]] = phi <2 x i16> [ [[TMP4]], [[THEN]] ], [ [[TMP18]], [[ELSE]] ]
-; OPT-NEXT: [[TMP33:%.*]] = phi <2 x i16> [ [[TMP5]], [[THEN]] ], [ [[TMP19]], [[ELSE]] ]
-; OPT-NEXT: [[TMP34:%.*]] = phi <2 x i16> [ [[TMP6]], [[THEN]] ], [ [[TMP20]], [[ELSE]] ]
-; OPT-NEXT: [[TMP35:%.*]] = phi <2 x i16> [ [[TMP7]], [[THEN]] ], [ [[TMP21]], [[ELSE]] ]
-; OPT-NEXT: [[TMP36:%.*]] = phi <2 x i16> [ [[TMP8]], [[THEN]] ], [ [[TMP22]], [[ELSE]] ]
-; OPT-NEXT: [[TMP37:%.*]] = phi <2 x i16> [ [[TMP9]], [[THEN]] ], [ [[TMP23]], [[ELSE]] ]
-; OPT-NEXT: [[TMP38:%.*]] = phi <2 x i16> [ [[TMP10]], [[THEN]] ], [ [[TMP24]], [[ELSE]] ]
-; OPT-NEXT: [[TMP39:%.*]] = phi <2 x i16> [ [[TMP11]], [[THEN]] ], [ [[TMP25]], [[ELSE]] ]
-; OPT-NEXT: [[TMP40:%.*]] = phi <2 x i16> [ [[TMP12]], [[THEN]] ], [ [[TMP26]], [[ELSE]] ]
-; OPT-NEXT: [[TMP41:%.*]] = phi i16 [ [[TMP13]], [[THEN]] ], [ [[TMP27]], [[ELSE]] ]
-; OPT-NEXT: [[TMP42:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> poison, <2 x i16> [[TMP28]], i64 0)
-; OPT-NEXT: [[TMP43:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP42]], <2 x i16> [[TMP29]], i64 2)
-; OPT-NEXT: [[TMP44:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP43]], <2 x i16> [[TMP30]], i64 4)
-; OPT-NEXT: [[TMP45:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP44]], <2 x i16> [[TMP31]], i64 6)
-; OPT-NEXT: [[TMP46:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP45]], <2 x i16> [[TMP32]], i64 8)
-; OPT-NEXT: [[TMP47:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP46]], <2 x i16> [[TMP33]], i64 10)
-; OPT-NEXT: [[TMP48:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP47]], <2 x i16> [[TMP34]], i64 12)
-; OPT-NEXT: [[TMP49:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP48]], <2 x i16> [[TMP35]], i64 14)
-; OPT-NEXT: [[TMP50:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP49]], <2 x i16> [[TMP36]], i64 16)
-; OPT-NEXT: [[TMP51:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP50]], <2 x i16> [[TMP37]], i64 18)
-; OPT-NEXT: [[TMP52:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP51]], <2 x i16> [[TMP38]], i64 20)
-; OPT-NEXT: [[TMP53:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP52]], <2 x i16> [[TMP39]], i64 22)
-; OPT-NEXT: [[TMP54:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[TMP53]], <2 x i16> [[TMP40]], i64 24)
-; OPT-NEXT: [[TMP55:%.*]] = insertelement <27 x i16> [[TMP54]], i16 [[TMP41]], i64 26
-; OPT-NEXT: store <27 x i16> [[TMP55]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[TMP8:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE16]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE17]], [[ELSE]] ]
+; OPT-NEXT: [[TMP9:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE18]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE19]], [[ELSE]] ]
+; OPT-NEXT: [[TMP10:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE20]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE21]], [[ELSE]] ]
+; OPT-NEXT: [[TMP11:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE22]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
+; OPT-NEXT: [[TMP12:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE24]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE25]], [[ELSE]] ]
+; OPT-NEXT: [[TMP13:%.*]] = phi i16 [ [[LARGEPHI_EXTRACTSLICE26]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE27]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> poison, <2 x i16> [[TMP0]], i64 0)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE0]], <2 x i16> [[TMP1]], i64 2)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE1]], <2 x i16> [[TMP2]], i64 4)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE2]], <2 x i16> [[TMP3]], i64 6)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE3]], <2 x i16> [[TMP4]], i64 8)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE4]], <2 x i16> [[TMP5]], i64 10)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE5]], <2 x i16> [[TMP6]], i64 12)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE6]], <2 x i16> [[TMP7]], i64 14)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE8:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE7]], <2 x i16> [[TMP8]], i64 16)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE9:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE8]], <2 x i16> [[TMP9]], i64 18)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE10:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE9]], <2 x i16> [[TMP10]], i64 20)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE11:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE10]], <2 x i16> [[TMP11]], i64 22)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE12:%.*]] = call <27 x i16> @llvm.vector.insert.v27i16.v2i16(<27 x i16> [[LARGEPHI_INSERTSLICE11]], <2 x i16> [[TMP12]], i64 24)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE13:%.*]] = insertelement <27 x i16> [[LARGEPHI_INSERTSLICE12]], i16 [[TMP13]], i64 26
+; OPT-NEXT: store <27 x i16> [[LARGEPHI_INSERTSLICE13]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v27i16(
@@ -494,44 +494,44 @@ define amdgpu_kernel void @phi_v23i8(<23 x i8> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <23 x i8> [[IN:%.*]], i8 42, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
-; OPT-NEXT: [[TMP1:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-; OPT-NEXT: [[TMP2:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
-; OPT-NEXT: [[TMP3:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
-; OPT-NEXT: [[TMP4:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 16, i32 17, i32 18, i32 19>
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <23 x i8> [[X]], i64 20
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <23 x i8> [[X]], i64 21
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <23 x i8> [[X]], i64 22
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = shufflevector <23 x i8> [[X]], <23 x i8> poison, <4 x i32> <i32 16, i32 17, i32 18, i32 19>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <23 x i8> [[X]], i64 20
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <23 x i8> [[X]], i64 21
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = extractelement <23 x i8> [[X]], i64 22
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <23 x i8> [[IN]], i8 64, i32 6
-; OPT-NEXT: [[TMP8:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
-; OPT-NEXT: [[TMP9:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-; OPT-NEXT: [[TMP10:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
-; OPT-NEXT: [[TMP11:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
-; OPT-NEXT: [[TMP12:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 16, i32 17, i32 18, i32 19>
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <23 x i8> [[Y]], i64 20
-; OPT-NEXT: [[TMP14:%.*]] = extractelement <23 x i8> [[Y]], i64 21
-; OPT-NEXT: [[TMP15:%.*]] = extractelement <23 x i8> [[Y]], i64 22
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 16, i32 17, i32 18, i32 19>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <23 x i8> [[Y]], i64 20
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <23 x i8> [[Y]], i64 21
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = extractelement <23 x i8> [[Y]], i64 22
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP16:%.*]] = phi <4 x i8> [ [[TMP0]], [[THEN]] ], [ [[TMP8]], [[ELSE]] ]
-; OPT-NEXT: [[TMP17:%.*]] = phi <4 x i8> [ [[TMP1]], [[THEN]] ], [ [[TMP9]], [[ELSE]] ]
-; OPT-NEXT: [[TMP18:%.*]] = phi <4 x i8> [ [[TMP2]], [[THEN]] ], [ [[TMP10]], [[ELSE]] ]
-; OPT-NEXT: [[TMP19:%.*]] = phi <4 x i8> [ [[TMP3]], [[THEN]] ], [ [[TMP11]], [[ELSE]] ]
-; OPT-NEXT: [[TMP20:%.*]] = phi <4 x i8> [ [[TMP4]], [[THEN]] ], [ [[TMP12]], [[ELSE]] ]
-; OPT-NEXT: [[TMP21:%.*]] = phi i8 [ [[TMP5]], [[THEN]] ], [ [[TMP13]], [[ELSE]] ]
-; OPT-NEXT: [[TMP22:%.*]] = phi i8 [ [[TMP6]], [[THEN]] ], [ [[TMP14]], [[ELSE]] ]
-; OPT-NEXT: [[TMP23:%.*]] = phi i8 [ [[TMP7]], [[THEN]] ], [ [[TMP15]], [[ELSE]] ]
-; OPT-NEXT: [[TMP24:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> poison, <4 x i8> [[TMP16]], i64 0)
-; OPT-NEXT: [[TMP25:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP24]], <4 x i8> [[TMP17]], i64 4)
-; OPT-NEXT: [[TMP26:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP25]], <4 x i8> [[TMP18]], i64 8)
-; OPT-NEXT: [[TMP27:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP26]], <4 x i8> [[TMP19]], i64 12)
-; OPT-NEXT: [[TMP28:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP27]], <4 x i8> [[TMP20]], i64 16)
-; OPT-NEXT: [[TMP29:%.*]] = insertelement <23 x i8> [[TMP28]], i8 [[TMP21]], i64 20
-; OPT-NEXT: [[TMP30:%.*]] = insertelement <23 x i8> [[TMP29]], i8 [[TMP22]], i64 21
-; OPT-NEXT: [[TMP31:%.*]] = insertelement <23 x i8> [[TMP30]], i8 [[TMP23]], i64 22
-; OPT-NEXT: store <23 x i8> [[TMP31]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi <4 x i8> [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi <4 x i8> [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi <4 x i8> [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi <4 x i8> [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi <4 x i8> [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi i8 [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi i8 [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi i8 [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> poison, <4 x i8> [[TMP0]], i64 0)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE0]], <4 x i8> [[TMP1]], i64 4)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE1]], <4 x i8> [[TMP2]], i64 8)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE2]], <4 x i8> [[TMP3]], i64 12)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE3]], <4 x i8> [[TMP4]], i64 16)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <23 x i8> [[LARGEPHI_INSERTSLICE4]], i8 [[TMP5]], i64 20
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <23 x i8> [[LARGEPHI_INSERTSLICE5]], i8 [[TMP6]], i64 21
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <23 x i8> [[LARGEPHI_INSERTSLICE6]], i8 [[TMP7]], i64 22
+; OPT-NEXT: store <23 x i8> [[LARGEPHI_INSERTSLICE7]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v23i8(
@@ -571,33 +571,33 @@ define amdgpu_kernel void @phi_v23i8_zeroinit(<23 x i8> %in, ptr %out, i1 %cond)
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <23 x i8> [[IN:%.*]], i8 64, i32 6
-; OPT-NEXT: [[TMP0:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
-; OPT-NEXT: [[TMP1:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-; OPT-NEXT: [[TMP2:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
-; OPT-NEXT: [[TMP3:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
-; OPT-NEXT: [[TMP4:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 16, i32 17, i32 18, i32 19>
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <23 x i8> [[Y]], i64 20
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <23 x i8> [[Y]], i64 21
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <23 x i8> [[Y]], i64 22
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 12, i32 13, i32 14, i32 15>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = shufflevector <23 x i8> [[Y]], <23 x i8> poison, <4 x i32> <i32 16, i32 17, i32 18, i32 19>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <23 x i8> [[Y]], i64 20
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <23 x i8> [[Y]], i64 21
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = extractelement <23 x i8> [[Y]], i64 22
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP8:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[TMP0]], [[ELSE]] ]
-; OPT-NEXT: [[TMP9:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[TMP1]], [[ELSE]] ]
-; OPT-NEXT: [[TMP10:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[TMP2]], [[ELSE]] ]
-; OPT-NEXT: [[TMP11:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[TMP3]], [[ELSE]] ]
-; OPT-NEXT: [[TMP12:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[TMP4]], [[ELSE]] ]
-; OPT-NEXT: [[TMP13:%.*]] = phi i8 [ 0, [[THEN]] ], [ [[TMP5]], [[ELSE]] ]
-; OPT-NEXT: [[TMP14:%.*]] = phi i8 [ 0, [[THEN]] ], [ [[TMP6]], [[ELSE]] ]
-; OPT-NEXT: [[TMP15:%.*]] = phi i8 [ 0, [[THEN]] ], [ [[TMP7]], [[ELSE]] ]
-; OPT-NEXT: [[TMP16:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> poison, <4 x i8> [[TMP8]], i64 0)
-; OPT-NEXT: [[TMP17:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP16]], <4 x i8> [[TMP9]], i64 4)
-; OPT-NEXT: [[TMP18:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP17]], <4 x i8> [[TMP10]], i64 8)
-; OPT-NEXT: [[TMP19:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP18]], <4 x i8> [[TMP11]], i64 12)
-; OPT-NEXT: [[TMP20:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[TMP19]], <4 x i8> [[TMP12]], i64 16)
-; OPT-NEXT: [[TMP21:%.*]] = insertelement <23 x i8> [[TMP20]], i8 [[TMP13]], i64 20
-; OPT-NEXT: [[TMP22:%.*]] = insertelement <23 x i8> [[TMP21]], i8 [[TMP14]], i64 21
-; OPT-NEXT: [[TMP23:%.*]] = insertelement <23 x i8> [[TMP22]], i8 [[TMP15]], i64 22
-; OPT-NEXT: store <23 x i8> [[TMP23]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi <4 x i8> [ zeroinitializer, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi i8 [ 0, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi i8 [ 0, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi i8 [ 0, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> poison, <4 x i8> [[TMP0]], i64 0)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE0]], <4 x i8> [[TMP1]], i64 4)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE1]], <4 x i8> [[TMP2]], i64 8)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE2]], <4 x i8> [[TMP3]], i64 12)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = call <23 x i8> @llvm.vector.insert.v23i8.v4i8(<23 x i8> [[LARGEPHI_INSERTSLICE3]], <4 x i8> [[TMP4]], i64 16)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <23 x i8> [[LARGEPHI_INSERTSLICE4]], i8 [[TMP5]], i64 20
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <23 x i8> [[LARGEPHI_INSERTSLICE5]], i8 [[TMP6]], i64 21
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <23 x i8> [[LARGEPHI_INSERTSLICE6]], i8 [[TMP7]], i64 22
+; OPT-NEXT: store <23 x i8> [[LARGEPHI_INSERTSLICE7]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v23i8_zeroinit(
@@ -634,27 +634,27 @@ define amdgpu_kernel void @phi_v15i8_random_constant_init(<15 x i8> %in, ptr %ou
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <15 x i8> [[IN:%.*]], i8 64, i32 6
-; OPT-NEXT: [[TMP0:%.*]] = shufflevector <15 x i8> [[Y]], <15 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
-; OPT-NEXT: [[TMP1:%.*]] = shufflevector <15 x i8> [[Y]], <15 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-; OPT-NEXT: [[TMP2:%.*]] = shufflevector <15 x i8> [[Y]], <15 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <15 x i8> [[Y]], i64 12
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <15 x i8> [[Y]], i64 13
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <15 x i8> [[Y]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = shufflevector <15 x i8> [[Y]], <15 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = shufflevector <15 x i8> [[Y]], <15 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = shufflevector <15 x i8> [[Y]], <15 x i8> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <15 x i8> [[Y]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <15 x i8> [[Y]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <15 x i8> [[Y]], i64 14
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP6:%.*]] = phi <4 x i8> [ <i8 poison, i8 1, i8 2, i8 3>, [[THEN]] ], [ [[TMP0]], [[ELSE]] ]
-; OPT-NEXT: [[TMP7:%.*]] = phi <4 x i8> [ <i8 4, i8 undef, i8 6, i8 7>, [[THEN]] ], [ [[TMP1]], [[ELSE]] ]
-; OPT-NEXT: [[TMP8:%.*]] = phi <4 x i8> [ <i8 9, i8 10, i8 11, i8 12>, [[THEN]] ], [ [[TMP2]], [[ELSE]] ]
-; OPT-NEXT: [[TMP9:%.*]] = phi i8 [ 13, [[THEN]] ], [ [[TMP3]], [[ELSE]] ]
-; OPT-NEXT: [[TMP10:%.*]] = phi i8 [ 14, [[THEN]] ], [ [[TMP4]], [[ELSE]] ]
-; OPT-NEXT: [[TMP11:%.*]] = phi i8 [ undef, [[THEN]] ], [ [[TMP5]], [[ELSE]] ]
-; OPT-NEXT: [[TMP12:%.*]] = call <15 x i8> @llvm.vector.insert.v15i8.v4i8(<15 x i8> poison, <4 x i8> [[TMP6]], i64 0)
-; OPT-NEXT: [[TMP13:%.*]] = call <15 x i8> @llvm.vector.insert.v15i8.v4i8(<15 x i8> [[TMP12]], <4 x i8> [[TMP7]], i64 4)
-; OPT-NEXT: [[TMP14:%.*]] = call <15 x i8> @llvm.vector.insert.v15i8.v4i8(<15 x i8> [[TMP13]], <4 x i8> [[TMP8]], i64 8)
-; OPT-NEXT: [[TMP15:%.*]] = insertelement <15 x i8> [[TMP14]], i8 [[TMP9]], i64 12
-; OPT-NEXT: [[TMP16:%.*]] = insertelement <15 x i8> [[TMP15]], i8 [[TMP10]], i64 13
-; OPT-NEXT: [[TMP17:%.*]] = insertelement <15 x i8> [[TMP16]], i8 [[TMP11]], i64 14
-; OPT-NEXT: store <15 x i8> [[TMP17]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi <4 x i8> [ <i8 poison, i8 1, i8 2, i8 3>, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi <4 x i8> [ <i8 4, i8 undef, i8 6, i8 7>, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi <4 x i8> [ <i8 9, i8 10, i8 11, i8 12>, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi i8 [ 13, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi i8 [ 14, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi i8 [ undef, [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = call <15 x i8> @llvm.vector.insert.v15i8.v4i8(<15 x i8> poison, <4 x i8> [[TMP0]], i64 0)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = call <15 x i8> @llvm.vector.insert.v15i8.v4i8(<15 x i8> [[LARGEPHI_INSERTSLICE0]], <4 x i8> [[TMP1]], i64 4)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = call <15 x i8> @llvm.vector.insert.v15i8.v4i8(<15 x i8> [[LARGEPHI_INSERTSLICE1]], <4 x i8> [[TMP2]], i64 8)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <15 x i8> [[LARGEPHI_INSERTSLICE2]], i8 [[TMP3]], i64 12
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <15 x i8> [[LARGEPHI_INSERTSLICE3]], i8 [[TMP4]], i64 13
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <15 x i8> [[LARGEPHI_INSERTSLICE4]], i8 [[TMP5]], i64 14
+; OPT-NEXT: store <15 x i8> [[LARGEPHI_INSERTSLICE5]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v15i8_random_constant_init(
@@ -689,104 +689,104 @@ define amdgpu_kernel void @phi_v23i32(<23 x i32> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <23 x i32> [[IN:%.*]], i32 42, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <23 x i32> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <23 x i32> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <23 x i32> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <23 x i32> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <23 x i32> [[X]], i64 4
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <23 x i32> [[X]], i64 5
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <23 x i32> [[X]], i64 6
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <23 x i32> [[X]], i64 7
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <23 x i32> [[X]], i64 8
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <23 x i32> [[X]], i64 9
-; OPT-NEXT: [[TMP10:%.*]] = extractelement <23 x i32> [[X]], i64 10
-; OPT-NEXT: [[TMP11:%.*]] = extractelement <23 x i32> [[X]], i64 11
-; OPT-NEXT: [[TMP12:%.*]] = extractelement <23 x i32> [[X]], i64 12
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <23 x i32> [[X]], i64 13
-; OPT-NEXT: [[TMP14:%.*]] = extractelement <23 x i32> [[X]], i64 14
-; OPT-NEXT: [[TMP15:%.*]] = extractelement <23 x i32> [[X]], i64 15
-; OPT-NEXT: [[TMP16:%.*]] = extractelement <23 x i32> [[X]], i64 16
-; OPT-NEXT: [[TMP17:%.*]] = extractelement <23 x i32> [[X]], i64 17
-; OPT-NEXT: [[TMP18:%.*]] = extractelement <23 x i32> [[X]], i64 18
-; OPT-NEXT: [[TMP19:%.*]] = extractelement <23 x i32> [[X]], i64 19
-; OPT-NEXT: [[TMP20:%.*]] = extractelement <23 x i32> [[X]], i64 20
-; OPT-NEXT: [[TMP21:%.*]] = extractelement <23 x i32> [[X]], i64 21
-; OPT-NEXT: [[TMP22:%.*]] = extractelement <23 x i32> [[X]], i64 22
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <23 x i32> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <23 x i32> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <23 x i32> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <23 x i32> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <23 x i32> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <23 x i32> [[X]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <23 x i32> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = extractelement <23 x i32> [[X]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE16:%.*]] = extractelement <23 x i32> [[X]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE18:%.*]] = extractelement <23 x i32> [[X]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE20:%.*]] = extractelement <23 x i32> [[X]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE22:%.*]] = extractelement <23 x i32> [[X]], i64 11
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE24:%.*]] = extractelement <23 x i32> [[X]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE26:%.*]] = extractelement <23 x i32> [[X]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE28:%.*]] = extractelement <23 x i32> [[X]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE30:%.*]] = extractelement <23 x i32> [[X]], i64 15
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE32:%.*]] = extractelement <23 x i32> [[X]], i64 16
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE34:%.*]] = extractelement <23 x i32> [[X]], i64 17
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE36:%.*]] = extractelement <23 x i32> [[X]], i64 18
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE38:%.*]] = extractelement <23 x i32> [[X]], i64 19
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE40:%.*]] = extractelement <23 x i32> [[X]], i64 20
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE42:%.*]] = extractelement <23 x i32> [[X]], i64 21
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE44:%.*]] = extractelement <23 x i32> [[X]], i64 22
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <23 x i32> [[IN]], i32 64, i32 6
-; OPT-NEXT: [[TMP23:%.*]] = extractelement <23 x i32> [[Y]], i64 0
-; OPT-NEXT: [[TMP24:%.*]] = extractelement <23 x i32> [[Y]], i64 1
-; OPT-NEXT: [[TMP25:%.*]] = extractelement <23 x i32> [[Y]], i64 2
-; OPT-NEXT: [[TMP26:%.*]] = extractelement <23 x i32> [[Y]], i64 3
-; OPT-NEXT: [[TMP27:%.*]] = extractelement <23 x i32> [[Y]], i64 4
-; OPT-NEXT: [[TMP28:%.*]] = extractelement <23 x i32> [[Y]], i64 5
-; OPT-NEXT: [[TMP29:%.*]] = extractelement <23 x i32> [[Y]], i64 6
-; OPT-NEXT: [[TMP30:%.*]] = extractelement <23 x i32> [[Y]], i64 7
-; OPT-NEXT: [[TMP31:%.*]] = extractelement <23 x i32> [[Y]], i64 8
-; OPT-NEXT: [[TMP32:%.*]] = extractelement <23 x i32> [[Y]], i64 9
-; OPT-NEXT: [[TMP33:%.*]] = extractelement <23 x i32> [[Y]], i64 10
-; OPT-NEXT: [[TMP34:%.*]] = extractelement <23 x i32> [[Y]], i64 11
-; OPT-NEXT: [[TMP35:%.*]] = extractelement <23 x i32> [[Y]], i64 12
-; OPT-NEXT: [[TMP36:%.*]] = extractelement <23 x i32> [[Y]], i64 13
-; OPT-NEXT: [[TMP37:%.*]] = extractelement <23 x i32> [[Y]], i64 14
-; OPT-NEXT: [[TMP38:%.*]] = extractelement <23 x i32> [[Y]], i64 15
-; OPT-NEXT: [[TMP39:%.*]] = extractelement <23 x i32> [[Y]], i64 16
-; OPT-NEXT: [[TMP40:%.*]] = extractelement <23 x i32> [[Y]], i64 17
-; OPT-NEXT: [[TMP41:%.*]] = extractelement <23 x i32> [[Y]], i64 18
-; OPT-NEXT: [[TMP42:%.*]] = extractelement <23 x i32> [[Y]], i64 19
-; OPT-NEXT: [[TMP43:%.*]] = extractelement <23 x i32> [[Y]], i64 20
-; OPT-NEXT: [[TMP44:%.*]] = extractelement <23 x i32> [[Y]], i64 21
-; OPT-NEXT: [[TMP45:%.*]] = extractelement <23 x i32> [[Y]], i64 22
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <23 x i32> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <23 x i32> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <23 x i32> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <23 x i32> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <23 x i32> [[Y]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <23 x i32> [[Y]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <23 x i32> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = extractelement <23 x i32> [[Y]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE17:%.*]] = extractelement <23 x i32> [[Y]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE19:%.*]] = extractelement <23 x i32> [[Y]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE21:%.*]] = extractelement <23 x i32> [[Y]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <23 x i32> [[Y]], i64 11
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE25:%.*]] = extractelement <23 x i32> [[Y]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE27:%.*]] = extractelement <23 x i32> [[Y]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE29:%.*]] = extractelement <23 x i32> [[Y]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE31:%.*]] = extractelement <23 x i32> [[Y]], i64 15
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE33:%.*]] = extractelement <23 x i32> [[Y]], i64 16
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE35:%.*]] = extractelement <23 x i32> [[Y]], i64 17
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE37:%.*]] = extractelement <23 x i32> [[Y]], i64 18
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE39:%.*]] = extractelement <23 x i32> [[Y]], i64 19
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE41:%.*]] = extractelement <23 x i32> [[Y]], i64 20
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE43:%.*]] = extractelement <23 x i32> [[Y]], i64 21
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE45:%.*]] = extractelement <23 x i32> [[Y]], i64 22
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP46:%.*]] = phi i32 [ [[TMP0]], [[THEN]] ], [ [[TMP23]], [[ELSE]] ]
-; OPT-NEXT: [[TMP47:%.*]] = phi i32 [ [[TMP1]], [[THEN]] ], [ [[TMP24]], [[ELSE]] ]
-; OPT-NEXT: [[TMP48:%.*]] = phi i32 [ [[TMP2]], [[THEN]] ], [ [[TMP25]], [[ELSE]] ]
-; OPT-NEXT: [[TMP49:%.*]] = phi i32 [ [[TMP3]], [[THEN]] ], [ [[TMP26]], [[ELSE]] ]
-; OPT-NEXT: [[TMP50:%.*]] = phi i32 [ [[TMP4]], [[THEN]] ], [ [[TMP27]], [[ELSE]] ]
-; OPT-NEXT: [[TMP51:%.*]] = phi i32 [ [[TMP5]], [[THEN]] ], [ [[TMP28]], [[ELSE]] ]
-; OPT-NEXT: [[TMP52:%.*]] = phi i32 [ [[TMP6]], [[THEN]] ], [ [[TMP29]], [[ELSE]] ]
-; OPT-NEXT: [[TMP53:%.*]] = phi i32 [ [[TMP7]], [[THEN]] ], [ [[TMP30]], [[ELSE]] ]
-; OPT-NEXT: [[TMP54:%.*]] = phi i32 [ [[TMP8]], [[THEN]] ], [ [[TMP31]], [[ELSE]] ]
-; OPT-NEXT: [[TMP55:%.*]] = phi i32 [ [[TMP9]], [[THEN]] ], [ [[TMP32]], [[ELSE]] ]
-; OPT-NEXT: [[TMP56:%.*]] = phi i32 [ [[TMP10]], [[THEN]] ], [ [[TMP33]], [[ELSE]] ]
-; OPT-NEXT: [[TMP57:%.*]] = phi i32 [ [[TMP11]], [[THEN]] ], [ [[TMP34]], [[ELSE]] ]
-; OPT-NEXT: [[TMP58:%.*]] = phi i32 [ [[TMP12]], [[THEN]] ], [ [[TMP35]], [[ELSE]] ]
-; OPT-NEXT: [[TMP59:%.*]] = phi i32 [ [[TMP13]], [[THEN]] ], [ [[TMP36]], [[ELSE]] ]
-; OPT-NEXT: [[TMP60:%.*]] = phi i32 [ [[TMP14]], [[THEN]] ], [ [[TMP37]], [[ELSE]] ]
-; OPT-NEXT: [[TMP61:%.*]] = phi i32 [ [[TMP15]], [[THEN]] ], [ [[TMP38]], [[ELSE]] ]
-; OPT-NEXT: [[TMP62:%.*]] = phi i32 [ [[TMP16]], [[THEN]] ], [ [[TMP39]], [[ELSE]] ]
-; OPT-NEXT: [[TMP63:%.*]] = phi i32 [ [[TMP17]], [[THEN]] ], [ [[TMP40]], [[ELSE]] ]
-; OPT-NEXT: [[TMP64:%.*]] = phi i32 [ [[TMP18]], [[THEN]] ], [ [[TMP41]], [[ELSE]] ]
-; OPT-NEXT: [[TMP65:%.*]] = phi i32 [ [[TMP19]], [[THEN]] ], [ [[TMP42]], [[ELSE]] ]
-; OPT-NEXT: [[TMP66:%.*]] = phi i32 [ [[TMP20]], [[THEN]] ], [ [[TMP43]], [[ELSE]] ]
-; OPT-NEXT: [[TMP67:%.*]] = phi i32 [ [[TMP21]], [[THEN]] ], [ [[TMP44]], [[ELSE]] ]
-; OPT-NEXT: [[TMP68:%.*]] = phi i32 [ [[TMP22]], [[THEN]] ], [ [[TMP45]], [[ELSE]] ]
-; OPT-NEXT: [[TMP69:%.*]] = insertelement <23 x i32> poison, i32 [[TMP46]], i64 0
-; OPT-NEXT: [[TMP70:%.*]] = insertelement <23 x i32> [[TMP69]], i32 [[TMP47]], i64 1
-; OPT-NEXT: [[TMP71:%.*]] = insertelement <23 x i32> [[TMP70]], i32 [[TMP48]], i64 2
-; OPT-NEXT: [[TMP72:%.*]] = insertelement <23 x i32> [[TMP71]], i32 [[TMP49]], i64 3
-; OPT-NEXT: [[TMP73:%.*]] = insertelement <23 x i32> [[TMP72]], i32 [[TMP50]], i64 4
-; OPT-NEXT: [[TMP74:%.*]] = insertelement <23 x i32> [[TMP73]], i32 [[TMP51]], i64 5
-; OPT-NEXT: [[TMP75:%.*]] = insertelement <23 x i32> [[TMP74]], i32 [[TMP52]], i64 6
-; OPT-NEXT: [[TMP76:%.*]] = insertelement <23 x i32> [[TMP75]], i32 [[TMP53]], i64 7
-; OPT-NEXT: [[TMP77:%.*]] = insertelement <23 x i32> [[TMP76]], i32 [[TMP54]], i64 8
-; OPT-NEXT: [[TMP78:%.*]] = insertelement <23 x i32> [[TMP77]], i32 [[TMP55]], i64 9
-; OPT-NEXT: [[TMP79:%.*]] = insertelement <23 x i32> [[TMP78]], i32 [[TMP56]], i64 10
-; OPT-NEXT: [[TMP80:%.*]] = insertelement <23 x i32> [[TMP79]], i32 [[TMP57]], i64 11
-; OPT-NEXT: [[TMP81:%.*]] = insertelement <23 x i32> [[TMP80]], i32 [[TMP58]], i64 12
-; OPT-NEXT: [[TMP82:%.*]] = insertelement <23 x i32> [[TMP81]], i32 [[TMP59]], i64 13
-; OPT-NEXT: [[TMP83:%.*]] = insertelement <23 x i32> [[TMP82]], i32 [[TMP60]], i64 14
-; OPT-NEXT: [[TMP84:%.*]] = insertelement <23 x i32> [[TMP83]], i32 [[TMP61]], i64 15
-; OPT-NEXT: [[TMP85:%.*]] = insertelement <23 x i32> [[TMP84]], i32 [[TMP62]], i64 16
-; OPT-NEXT: [[TMP86:%.*]] = insertelement <23 x i32> [[TMP85]], i32 [[TMP63]], i64 17
-; OPT-NEXT: [[TMP87:%.*]] = insertelement <23 x i32> [[TMP86]], i32 [[TMP64]], i64 18
-; OPT-NEXT: [[TMP88:%.*]] = insertelement <23 x i32> [[TMP87]], i32 [[TMP65]], i64 19
-; OPT-NEXT: [[TMP89:%.*]] = insertelement <23 x i32> [[TMP88]], i32 [[TMP66]], i64 20
-; OPT-NEXT: [[TMP90:%.*]] = insertelement <23 x i32> [[TMP89]], i32 [[TMP67]], i64 21
-; OPT-NEXT: [[TMP91:%.*]] = insertelement <23 x i32> [[TMP90]], i32 [[TMP68]], i64 22
-; OPT-NEXT: store <23 x i32> [[TMP91]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[TMP8:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE16]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE17]], [[ELSE]] ]
+; OPT-NEXT: [[TMP9:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE18]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE19]], [[ELSE]] ]
+; OPT-NEXT: [[TMP10:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE20]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE21]], [[ELSE]] ]
+; OPT-NEXT: [[TMP11:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE22]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
+; OPT-NEXT: [[TMP12:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE24]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE25]], [[ELSE]] ]
+; OPT-NEXT: [[TMP13:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE26]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE27]], [[ELSE]] ]
+; OPT-NEXT: [[TMP14:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE28]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE29]], [[ELSE]] ]
+; OPT-NEXT: [[TMP15:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE30]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE31]], [[ELSE]] ]
+; OPT-NEXT: [[TMP16:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE32]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE33]], [[ELSE]] ]
+; OPT-NEXT: [[TMP17:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE34]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE35]], [[ELSE]] ]
+; OPT-NEXT: [[TMP18:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE36]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE37]], [[ELSE]] ]
+; OPT-NEXT: [[TMP19:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE38]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE39]], [[ELSE]] ]
+; OPT-NEXT: [[TMP20:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE40]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE41]], [[ELSE]] ]
+; OPT-NEXT: [[TMP21:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE42]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE43]], [[ELSE]] ]
+; OPT-NEXT: [[TMP22:%.*]] = phi i32 [ [[LARGEPHI_EXTRACTSLICE44]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE45]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <23 x i32> poison, i32 [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE0]], i32 [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE1]], i32 [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE2]], i32 [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE3]], i32 [[TMP4]], i64 4
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE4]], i32 [[TMP5]], i64 5
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE5]], i32 [[TMP6]], i64 6
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE6]], i32 [[TMP7]], i64 7
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE8:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE7]], i32 [[TMP8]], i64 8
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE9:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE8]], i32 [[TMP9]], i64 9
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE10:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE9]], i32 [[TMP10]], i64 10
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE11:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE10]], i32 [[TMP11]], i64 11
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE12:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE11]], i32 [[TMP12]], i64 12
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE13:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE12]], i32 [[TMP13]], i64 13
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE14:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE13]], i32 [[TMP14]], i64 14
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE15:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE14]], i32 [[TMP15]], i64 15
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE16:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE15]], i32 [[TMP16]], i64 16
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE17:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE16]], i32 [[TMP17]], i64 17
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE18:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE17]], i32 [[TMP18]], i64 18
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE19:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE18]], i32 [[TMP19]], i64 19
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE20:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE19]], i32 [[TMP20]], i64 20
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE21:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE20]], i32 [[TMP21]], i64 21
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE22:%.*]] = insertelement <23 x i32> [[LARGEPHI_INSERTSLICE21]], i32 [[TMP22]], i64 22
+; OPT-NEXT: store <23 x i32> [[LARGEPHI_INSERTSLICE22]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v23i32(
@@ -823,76 +823,76 @@ define amdgpu_kernel void @phi_v16i64(<16 x i64> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <16 x i64> [[IN:%.*]], i64 42, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = extractelement <16 x i64> [[X]], i64 0
-; OPT-NEXT: [[TMP1:%.*]] = extractelement <16 x i64> [[X]], i64 1
-; OPT-NEXT: [[TMP2:%.*]] = extractelement <16 x i64> [[X]], i64 2
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <16 x i64> [[X]], i64 3
-; OPT-NEXT: [[TMP4:%.*]] = extractelement <16 x i64> [[X]], i64 4
-; OPT-NEXT: [[TMP5:%.*]] = extractelement <16 x i64> [[X]], i64 5
-; OPT-NEXT: [[TMP6:%.*]] = extractelement <16 x i64> [[X]], i64 6
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <16 x i64> [[X]], i64 7
-; OPT-NEXT: [[TMP8:%.*]] = extractelement <16 x i64> [[X]], i64 8
-; OPT-NEXT: [[TMP9:%.*]] = extractelement <16 x i64> [[X]], i64 9
-; OPT-NEXT: [[TMP10:%.*]] = extractelement <16 x i64> [[X]], i64 10
-; OPT-NEXT: [[TMP11:%.*]] = extractelement <16 x i64> [[X]], i64 11
-; OPT-NEXT: [[TMP12:%.*]] = extractelement <16 x i64> [[X]], i64 12
-; OPT-NEXT: [[TMP13:%.*]] = extractelement <16 x i64> [[X]], i64 13
-; OPT-NEXT: [[TMP14:%.*]] = extractelement <16 x i64> [[X]], i64 14
-; OPT-NEXT: [[TMP15:%.*]] = extractelement <16 x i64> [[X]], i64 15
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <16 x i64> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = extractelement <16 x i64> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <16 x i64> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <16 x i64> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = extractelement <16 x i64> [[X]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <16 x i64> [[X]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <16 x i64> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE14:%.*]] = extractelement <16 x i64> [[X]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE16:%.*]] = extractelement <16 x i64> [[X]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE18:%.*]] = extractelement <16 x i64> [[X]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE20:%.*]] = extractelement <16 x i64> [[X]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE22:%.*]] = extractelement <16 x i64> [[X]], i64 11
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE24:%.*]] = extractelement <16 x i64> [[X]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE26:%.*]] = extractelement <16 x i64> [[X]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE28:%.*]] = extractelement <16 x i64> [[X]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE30:%.*]] = extractelement <16 x i64> [[X]], i64 15
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <16 x i64> [[IN]], i64 64, i32 6
-; OPT-NEXT: [[TMP16:%.*]] = extractelement <16 x i64> [[Y]], i64 0
-; OPT-NEXT: [[TMP17:%.*]] = extractelement <16 x i64> [[Y]], i64 1
-; OPT-NEXT: [[TMP18:%.*]] = extractelement <16 x i64> [[Y]], i64 2
-; OPT-NEXT: [[TMP19:%.*]] = extractelement <16 x i64> [[Y]], i64 3
-; OPT-NEXT: [[TMP20:%.*]] = extractelement <16 x i64> [[Y]], i64 4
-; OPT-NEXT: [[TMP21:%.*]] = extractelement <16 x i64> [[Y]], i64 5
-; OPT-NEXT: [[TMP22:%.*]] = extractelement <16 x i64> [[Y]], i64 6
-; OPT-NEXT: [[TMP23:%.*]] = extractelement <16 x i64> [[Y]], i64 7
-; OPT-NEXT: [[TMP24:%.*]] = extractelement <16 x i64> [[Y]], i64 8
-; OPT-NEXT: [[TMP25:%.*]] = extractelement <16 x i64> [[Y]], i64 9
-; OPT-NEXT: [[TMP26:%.*]] = extractelement <16 x i64> [[Y]], i64 10
-; OPT-NEXT: [[TMP27:%.*]] = extractelement <16 x i64> [[Y]], i64 11
-; OPT-NEXT: [[TMP28:%.*]] = extractelement <16 x i64> [[Y]], i64 12
-; OPT-NEXT: [[TMP29:%.*]] = extractelement <16 x i64> [[Y]], i64 13
-; OPT-NEXT: [[TMP30:%.*]] = extractelement <16 x i64> [[Y]], i64 14
-; OPT-NEXT: [[TMP31:%.*]] = extractelement <16 x i64> [[Y]], i64 15
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <16 x i64> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <16 x i64> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = extractelement <16 x i64> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <16 x i64> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <16 x i64> [[Y]], i64 4
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <16 x i64> [[Y]], i64 5
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <16 x i64> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE15:%.*]] = extractelement <16 x i64> [[Y]], i64 7
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE17:%.*]] = extractelement <16 x i64> [[Y]], i64 8
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE19:%.*]] = extractelement <16 x i64> [[Y]], i64 9
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE21:%.*]] = extractelement <16 x i64> [[Y]], i64 10
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE23:%.*]] = extractelement <16 x i64> [[Y]], i64 11
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE25:%.*]] = extractelement <16 x i64> [[Y]], i64 12
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE27:%.*]] = extractelement <16 x i64> [[Y]], i64 13
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE29:%.*]] = extractelement <16 x i64> [[Y]], i64 14
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE31:%.*]] = extractelement <16 x i64> [[Y]], i64 15
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP32:%.*]] = phi i64 [ [[TMP0]], [[THEN]] ], [ [[TMP16]], [[ELSE]] ]
-; OPT-NEXT: [[TMP33:%.*]] = phi i64 [ [[TMP1]], [[THEN]] ], [ [[TMP17]], [[ELSE]] ]
-; OPT-NEXT: [[TMP34:%.*]] = phi i64 [ [[TMP2]], [[THEN]] ], [ [[TMP18]], [[ELSE]] ]
-; OPT-NEXT: [[TMP35:%.*]] = phi i64 [ [[TMP3]], [[THEN]] ], [ [[TMP19]], [[ELSE]] ]
-; OPT-NEXT: [[TMP36:%.*]] = phi i64 [ [[TMP4]], [[THEN]] ], [ [[TMP20]], [[ELSE]] ]
-; OPT-NEXT: [[TMP37:%.*]] = phi i64 [ [[TMP5]], [[THEN]] ], [ [[TMP21]], [[ELSE]] ]
-; OPT-NEXT: [[TMP38:%.*]] = phi i64 [ [[TMP6]], [[THEN]] ], [ [[TMP22]], [[ELSE]] ]
-; OPT-NEXT: [[TMP39:%.*]] = phi i64 [ [[TMP7]], [[THEN]] ], [ [[TMP23]], [[ELSE]] ]
-; OPT-NEXT: [[TMP40:%.*]] = phi i64 [ [[TMP8]], [[THEN]] ], [ [[TMP24]], [[ELSE]] ]
-; OPT-NEXT: [[TMP41:%.*]] = phi i64 [ [[TMP9]], [[THEN]] ], [ [[TMP25]], [[ELSE]] ]
-; OPT-NEXT: [[TMP42:%.*]] = phi i64 [ [[TMP10]], [[THEN]] ], [ [[TMP26]], [[ELSE]] ]
-; OPT-NEXT: [[TMP43:%.*]] = phi i64 [ [[TMP11]], [[THEN]] ], [ [[TMP27]], [[ELSE]] ]
-; OPT-NEXT: [[TMP44:%.*]] = phi i64 [ [[TMP12]], [[THEN]] ], [ [[TMP28]], [[ELSE]] ]
-; OPT-NEXT: [[TMP45:%.*]] = phi i64 [ [[TMP13]], [[THEN]] ], [ [[TMP29]], [[ELSE]] ]
-; OPT-NEXT: [[TMP46:%.*]] = phi i64 [ [[TMP14]], [[THEN]] ], [ [[TMP30]], [[ELSE]] ]
-; OPT-NEXT: [[TMP47:%.*]] = phi i64 [ [[TMP15]], [[THEN]] ], [ [[TMP31]], [[ELSE]] ]
-; OPT-NEXT: [[TMP48:%.*]] = insertelement <16 x i64> poison, i64 [[TMP32]], i64 0
-; OPT-NEXT: [[TMP49:%.*]] = insertelement <16 x i64> [[TMP48]], i64 [[TMP33]], i64 1
-; OPT-NEXT: [[TMP50:%.*]] = insertelement <16 x i64> [[TMP49]], i64 [[TMP34]], i64 2
-; OPT-NEXT: [[TMP51:%.*]] = insertelement <16 x i64> [[TMP50]], i64 [[TMP35]], i64 3
-; OPT-NEXT: [[TMP52:%.*]] = insertelement <16 x i64> [[TMP51]], i64 [[TMP36]], i64 4
-; OPT-NEXT: [[TMP53:%.*]] = insertelement <16 x i64> [[TMP52]], i64 [[TMP37]], i64 5
-; OPT-NEXT: [[TMP54:%.*]] = insertelement <16 x i64> [[TMP53]], i64 [[TMP38]], i64 6
-; OPT-NEXT: [[TMP55:%.*]] = insertelement <16 x i64> [[TMP54]], i64 [[TMP39]], i64 7
-; OPT-NEXT: [[TMP56:%.*]] = insertelement <16 x i64> [[TMP55]], i64 [[TMP40]], i64 8
-; OPT-NEXT: [[TMP57:%.*]] = insertelement <16 x i64> [[TMP56]], i64 [[TMP41]], i64 9
-; OPT-NEXT: [[TMP58:%.*]] = insertelement <16 x i64> [[TMP57]], i64 [[TMP42]], i64 10
-; OPT-NEXT: [[TMP59:%.*]] = insertelement <16 x i64> [[TMP58]], i64 [[TMP43]], i64 11
-; OPT-NEXT: [[TMP60:%.*]] = insertelement <16 x i64> [[TMP59]], i64 [[TMP44]], i64 12
-; OPT-NEXT: [[TMP61:%.*]] = insertelement <16 x i64> [[TMP60]], i64 [[TMP45]], i64 13
-; OPT-NEXT: [[TMP62:%.*]] = insertelement <16 x i64> [[TMP61]], i64 [[TMP46]], i64 14
-; OPT-NEXT: [[TMP63:%.*]] = insertelement <16 x i64> [[TMP62]], i64 [[TMP47]], i64 15
-; OPT-NEXT: store <16 x i64> [[TMP63]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE8]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE9]], [[ELSE]] ]
+; OPT-NEXT: [[TMP5:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[TMP6:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[TMP7:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE14]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE15]], [[ELSE]] ]
+; OPT-NEXT: [[TMP8:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE16]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE17]], [[ELSE]] ]
+; OPT-NEXT: [[TMP9:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE18]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE19]], [[ELSE]] ]
+; OPT-NEXT: [[TMP10:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE20]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE21]], [[ELSE]] ]
+; OPT-NEXT: [[TMP11:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE22]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE23]], [[ELSE]] ]
+; OPT-NEXT: [[TMP12:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE24]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE25]], [[ELSE]] ]
+; OPT-NEXT: [[TMP13:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE26]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE27]], [[ELSE]] ]
+; OPT-NEXT: [[TMP14:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE28]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE29]], [[ELSE]] ]
+; OPT-NEXT: [[TMP15:%.*]] = phi i64 [ [[LARGEPHI_EXTRACTSLICE30]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE31]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <16 x i64> poison, i64 [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE0]], i64 [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE1]], i64 [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE2]], i64 [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE3]], i64 [[TMP4]], i64 4
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE5:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE4]], i64 [[TMP5]], i64 5
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE6:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE5]], i64 [[TMP6]], i64 6
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE7:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE6]], i64 [[TMP7]], i64 7
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE8:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE7]], i64 [[TMP8]], i64 8
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE9:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE8]], i64 [[TMP9]], i64 9
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE10:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE9]], i64 [[TMP10]], i64 10
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE11:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE10]], i64 [[TMP11]], i64 11
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE12:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE11]], i64 [[TMP12]], i64 12
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE13:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE12]], i64 [[TMP13]], i64 13
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE14:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE13]], i64 [[TMP14]], i64 14
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE15:%.*]] = insertelement <16 x i64> [[LARGEPHI_INSERTSLICE14]], i64 [[TMP15]], i64 15
+; OPT-NEXT: store <16 x i64> [[LARGEPHI_INSERTSLICE15]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v16i64(
@@ -929,28 +929,28 @@ define amdgpu_kernel void @phi_v7i16(<7 x i16> %in, ptr %out, i1 %cond) {
; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; OPT: then:
; OPT-NEXT: [[X:%.*]] = insertelement <7 x i16> [[IN:%.*]], i16 3, i32 3
-; OPT-NEXT: [[TMP0:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP1:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP2:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <7 x i16> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <7 x i16> [[X]], i64 6
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <7 x i16> [[IN]], i16 9, i32 6
-; OPT-NEXT: [[TMP4:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP5:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP6:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <7 x i16> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <7 x i16> [[Y]], i64 6
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP8:%.*]] = phi <2 x i16> [ [[TMP0]], [[THEN]] ], [ [[TMP4]], [[ELSE]] ]
-; OPT-NEXT: [[TMP9:%.*]] = phi <2 x i16> [ [[TMP1]], [[THEN]] ], [ [[TMP5]], [[ELSE]] ]
-; OPT-NEXT: [[TMP10:%.*]] = phi <2 x i16> [ [[TMP2]], [[THEN]] ], [ [[TMP6]], [[ELSE]] ]
-; OPT-NEXT: [[TMP11:%.*]] = phi i16 [ [[TMP3]], [[THEN]] ], [ [[TMP7]], [[ELSE]] ]
-; OPT-NEXT: [[TMP12:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> poison, <2 x i16> [[TMP8]], i64 0)
-; OPT-NEXT: [[TMP13:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[TMP12]], <2 x i16> [[TMP9]], i64 2)
-; OPT-NEXT: [[TMP14:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[TMP13]], <2 x i16> [[TMP10]], i64 4)
-; OPT-NEXT: [[TMP15:%.*]] = insertelement <7 x i16> [[TMP14]], i16 [[TMP11]], i64 6
-; OPT-NEXT: store <7 x i16> [[TMP15]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE2]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE3]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi i16 [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> poison, <2 x i16> [[TMP0]], i64 0)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[LARGEPHI_INSERTSLICE0]], <2 x i16> [[TMP1]], i64 2)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[LARGEPHI_INSERTSLICE1]], <2 x i16> [[TMP2]], i64 4)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <7 x i16> [[LARGEPHI_INSERTSLICE2]], i16 [[TMP3]], i64 6
+; OPT-NEXT: store <7 x i16> [[LARGEPHI_INSERTSLICE3]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v7i16(
@@ -991,34 +991,34 @@ define amdgpu_kernel void @phi_v7i16_switch(<7 x i16> %in, ptr %out, i8 %cond) {
; OPT-NEXT: i8 3, label [[THEN_2:%.*]]
; OPT-NEXT: ]
; OPT: then.1:
-; OPT-NEXT: [[TMP0:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP1:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP2:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP3:%.*]] = extractelement <7 x i16> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <7 x i16> [[X]], i64 6
; OPT-NEXT: br label [[FINALLY:%.*]]
; OPT: then.2:
-; OPT-NEXT: [[TMP4:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP5:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP6:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP7:%.*]] = extractelement <7 x i16> [[X]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = shufflevector <7 x i16> [[X]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <7 x i16> [[X]], i64 6
; OPT-NEXT: br label [[FINALLY]]
; OPT: else:
; OPT-NEXT: [[Y:%.*]] = insertelement <7 x i16> [[IN]], i16 9, i32 6
-; OPT-NEXT: [[TMP8:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
-; OPT-NEXT: [[TMP9:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
-; OPT-NEXT: [[TMP10:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
-; OPT-NEXT: [[TMP11:%.*]] = extractelement <7 x i16> [[Y]], i64 6
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE2:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 0, i32 1>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE5:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 2, i32 3>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE8:%.*]] = shufflevector <7 x i16> [[Y]], <7 x i16> poison, <2 x i32> <i32 4, i32 5>
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE11:%.*]] = extractelement <7 x i16> [[Y]], i64 6
; OPT-NEXT: br label [[FINALLY]]
; OPT: finally:
-; OPT-NEXT: [[TMP12:%.*]] = phi <2 x i16> [ [[TMP0]], [[THEN_1]] ], [ [[TMP4]], [[THEN_2]] ], [ [[TMP8]], [[ELSE]] ]
-; OPT-NEXT: [[TMP13:%.*]] = phi <2 x i16> [ [[TMP1]], [[THEN_1]] ], [ [[TMP5]], [[THEN_2]] ], [ [[TMP9]], [[ELSE]] ]
-; OPT-NEXT: [[TMP14:%.*]] = phi <2 x i16> [ [[TMP2]], [[THEN_1]] ], [ [[TMP6]], [[THEN_2]] ], [ [[TMP10]], [[ELSE]] ]
-; OPT-NEXT: [[TMP15:%.*]] = phi i16 [ [[TMP3]], [[THEN_1]] ], [ [[TMP7]], [[THEN_2]] ], [ [[TMP11]], [[ELSE]] ]
-; OPT-NEXT: [[TMP16:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> poison, <2 x i16> [[TMP12]], i64 0)
-; OPT-NEXT: [[TMP17:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[TMP16]], <2 x i16> [[TMP13]], i64 2)
-; OPT-NEXT: [[TMP18:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[TMP17]], <2 x i16> [[TMP14]], i64 4)
-; OPT-NEXT: [[TMP19:%.*]] = insertelement <7 x i16> [[TMP18]], i16 [[TMP15]], i64 6
-; OPT-NEXT: store <7 x i16> [[TMP19]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: [[TMP0:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN_1]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[THEN_2]] ], [ [[LARGEPHI_EXTRACTSLICE2]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN_1]] ], [ [[LARGEPHI_EXTRACTSLICE4]], [[THEN_2]] ], [ [[LARGEPHI_EXTRACTSLICE5]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi <2 x i16> [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN_1]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[THEN_2]] ], [ [[LARGEPHI_EXTRACTSLICE8]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi i16 [ [[LARGEPHI_EXTRACTSLICE9]], [[THEN_1]] ], [ [[LARGEPHI_EXTRACTSLICE10]], [[THEN_2]] ], [ [[LARGEPHI_EXTRACTSLICE11]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> poison, <2 x i16> [[TMP0]], i64 0)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[LARGEPHI_INSERTSLICE0]], <2 x i16> [[TMP1]], i64 2)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = call <7 x i16> @llvm.vector.insert.v7i16.v2i16(<7 x i16> [[LARGEPHI_INSERTSLICE1]], <2 x i16> [[TMP2]], i64 4)
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <7 x i16> [[LARGEPHI_INSERTSLICE2]], i16 [[TMP3]], i64 6
+; OPT-NEXT: store <7 x i16> [[LARGEPHI_INSERTSLICE3]], ptr [[OUT:%.*]], align 1
; OPT-NEXT: ret void
;
; NOOPT-LABEL: @phi_v7i16_switch(
@@ -1058,3 +1058,142 @@ finally:
store <7 x i16> %val, ptr %out, align 1
ret void
}
+
+; Checks that we can deal with PHIs that have the same basic block/incoming value
+; pair appear more than once in the incoming blocks.
+; It's not illegal IR. However, if the pass lazily transforms all incoming values
+; without checking for duplicates, it could create a PHI with the same basic block
+; appearing multiple times, but with
diff erent incoming values, which is then illegal
+; IR.
+; The error was:
+; PHI node has multiple entries for the same basic block with
diff erent incoming values!
+define amdgpu_kernel void @multi_inc_same_bb(<5 x double> %in, ptr %out, i1 %cond) {
+; OPT-LABEL: @multi_inc_same_bb(
+; OPT-NEXT: entry:
+; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
+; OPT: then:
+; OPT-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i32 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[X]], i64 4
+; OPT-NEXT: br label [[FINALLY:%.*]]
+; OPT: else:
+; OPT-NEXT: [[Y:%.*]] = insertelement <5 x double> [[IN]], double 9.140000e+00, i32 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <5 x double> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <5 x double> [[Y]], i64 4
+; OPT-NEXT: br i1 [[COND]], label [[FINALLY]], label [[FINALLY]]
+; OPT: finally:
+; OPT-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE4]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE4]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE9]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE10]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE10]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE2]], double [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE3]], double [[TMP4]], i64 4
+; OPT-NEXT: store <5 x double> [[LARGEPHI_INSERTSLICE4]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: ret void
+;
+; NOOPT-LABEL: @multi_inc_same_bb(
+; NOOPT-NEXT: entry:
+; NOOPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
+; NOOPT: then:
+; NOOPT-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i32 3
+; NOOPT-NEXT: br label [[FINALLY:%.*]]
+; NOOPT: else:
+; NOOPT-NEXT: [[Y:%.*]] = insertelement <5 x double> [[IN]], double 9.140000e+00, i32 2
+; NOOPT-NEXT: br i1 [[COND]], label [[FINALLY]], label [[FINALLY]]
+; NOOPT: finally:
+; NOOPT-NEXT: [[VAL:%.*]] = phi <5 x double> [ [[X]], [[THEN]] ], [ [[Y]], [[ELSE]] ], [ [[Y]], [[ELSE]] ]
+; NOOPT-NEXT: store <5 x double> [[VAL]], ptr [[OUT:%.*]], align 1
+; NOOPT-NEXT: ret void
+;
+entry:
+ br i1 %cond, label %then, label %else
+then:
+ %x = insertelement <5 x double> %in, double 3.14, i32 3
+ br label %finally
+else:
+ %y = insertelement <5 x double> %in, double 9.14, i32 2
+ br i1 %cond, label %finally, label %finally
+finally:
+ %val = phi <5 x double> [%x, %then], [%y, %else], [%y, %else]
+ store <5 x double> %val, ptr %out, align 1
+ ret void
+}
+
+; Checks that we can ndeal with blocks that just have a PHI + terminator.
+define amdgpu_kernel void @minimal_block_with_only_phi(<5 x double> %in, ptr %out, i1 %cond) {
+; OPT-LABEL: @minimal_block_with_only_phi(
+; OPT-NEXT: entry:
+; OPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
+; OPT: then:
+; OPT-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i32 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE0:%.*]] = extractelement <5 x double> [[X]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE3:%.*]] = extractelement <5 x double> [[X]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE6:%.*]] = extractelement <5 x double> [[X]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE9:%.*]] = extractelement <5 x double> [[X]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE12:%.*]] = extractelement <5 x double> [[X]], i64 4
+; OPT-NEXT: br label [[FINALLY:%.*]]
+; OPT: else:
+; OPT-NEXT: [[Y:%.*]] = insertelement <5 x double> [[IN]], double 9.140000e+00, i32 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE1:%.*]] = extractelement <5 x double> [[Y]], i64 0
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE4:%.*]] = extractelement <5 x double> [[Y]], i64 1
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE7:%.*]] = extractelement <5 x double> [[Y]], i64 2
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE10:%.*]] = extractelement <5 x double> [[Y]], i64 3
+; OPT-NEXT: [[LARGEPHI_EXTRACTSLICE13:%.*]] = extractelement <5 x double> [[Y]], i64 4
+; OPT-NEXT: br i1 [[COND]], label [[FINALLY]], label [[FINALLY]]
+; OPT: finally:
+; OPT-NEXT: [[TMP0:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE0]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE1]], [[ELSE]] ]
+; OPT-NEXT: [[TMP1:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE3]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE4]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE4]], [[ELSE]] ]
+; OPT-NEXT: [[TMP2:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE6]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE7]], [[ELSE]] ]
+; OPT-NEXT: [[TMP3:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE9]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE10]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE10]], [[ELSE]] ]
+; OPT-NEXT: [[TMP4:%.*]] = phi double [ [[LARGEPHI_EXTRACTSLICE12]], [[THEN]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ], [ [[LARGEPHI_EXTRACTSLICE13]], [[ELSE]] ]
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE0:%.*]] = insertelement <5 x double> poison, double [[TMP0]], i64 0
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE1:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE0]], double [[TMP1]], i64 1
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE2:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE1]], double [[TMP2]], i64 2
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE3:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE2]], double [[TMP3]], i64 3
+; OPT-NEXT: [[LARGEPHI_INSERTSLICE4:%.*]] = insertelement <5 x double> [[LARGEPHI_INSERTSLICE3]], double [[TMP4]], i64 4
+; OPT-NEXT: br label [[REALLYFINALLY:%.*]]
+; OPT: reallyfinally:
+; OPT-NEXT: store <5 x double> [[LARGEPHI_INSERTSLICE4]], ptr [[OUT:%.*]], align 1
+; OPT-NEXT: ret void
+;
+; NOOPT-LABEL: @minimal_block_with_only_phi(
+; NOOPT-NEXT: entry:
+; NOOPT-NEXT: br i1 [[COND:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
+; NOOPT: then:
+; NOOPT-NEXT: [[X:%.*]] = insertelement <5 x double> [[IN:%.*]], double 3.140000e+00, i32 3
+; NOOPT-NEXT: br label [[FINALLY:%.*]]
+; NOOPT: else:
+; NOOPT-NEXT: [[Y:%.*]] = insertelement <5 x double> [[IN]], double 9.140000e+00, i32 2
+; NOOPT-NEXT: br i1 [[COND]], label [[FINALLY]], label [[FINALLY]]
+; NOOPT: finally:
+; NOOPT-NEXT: [[VAL:%.*]] = phi <5 x double> [ [[X]], [[THEN]] ], [ [[Y]], [[ELSE]] ], [ [[Y]], [[ELSE]] ]
+; NOOPT-NEXT: br label [[REALLYFINALLY:%.*]]
+; NOOPT: reallyfinally:
+; NOOPT-NEXT: store <5 x double> [[VAL]], ptr [[OUT:%.*]], align 1
+; NOOPT-NEXT: ret void
+;
+entry:
+ br i1 %cond, label %then, label %else
+then:
+ %x = insertelement <5 x double> %in, double 3.14, i32 3
+ br label %finally
+else:
+ %y = insertelement <5 x double> %in, double 9.14, i32 2
+ br i1 %cond, label %finally, label %finally
+finally:
+ %val = phi <5 x double> [%x, %then], [%y, %else], [%y, %else]
+ br label %reallyfinally
+reallyfinally:
+ store <5 x double> %val, ptr %out, align 1
+ ret void
+}
More information about the llvm-commits
mailing list