Skip to content

Commit 1574791

Browse files
committed
Merge remote-tracking branch 'origin/main' into lv-uniform-tailfold
2 parents e7e7564 + 710dab6 commit 1574791

File tree

17 files changed

+97
-106
lines changed

17 files changed

+97
-106
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,33 +1077,6 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
10771077
if (JA.isOffloading(Action::OFK_HIP))
10781078
getToolChain().AddHIPIncludeArgs(Args, CmdArgs);
10791079

1080-
// If we are compiling for a GPU target we want to override the system headers
1081-
// with ones created by the 'libc' project if present.
1082-
if (!Args.hasArg(options::OPT_nostdinc) &&
1083-
!Args.hasArg(options::OPT_nogpuinc) &&
1084-
!Args.hasArg(options::OPT_nobuiltininc)) {
1085-
// Without an offloading language we will include these headers directly.
1086-
// Offloading languages will instead only use the declarations stored in
1087-
// the resource directory at clang/lib/Headers/llvm_libc_wrappers.
1088-
if ((getToolChain().getTriple().isNVPTX() ||
1089-
getToolChain().getTriple().isAMDGCN()) &&
1090-
C.getActiveOffloadKinds() == Action::OFK_None) {
1091-
SmallString<128> P(llvm::sys::path::parent_path(D.Dir));
1092-
llvm::sys::path::append(P, "include");
1093-
llvm::sys::path::append(P, getToolChain().getTripleString());
1094-
CmdArgs.push_back("-internal-isystem");
1095-
CmdArgs.push_back(Args.MakeArgString(P));
1096-
} else if (C.getActiveOffloadKinds() == Action::OFK_OpenMP) {
1097-
// TODO: CUDA / HIP include their own headers for some common functions
1098-
// implemented here. We'll need to clean those up so they do not conflict.
1099-
SmallString<128> P(D.ResourceDir);
1100-
llvm::sys::path::append(P, "include");
1101-
llvm::sys::path::append(P, "llvm_libc_wrappers");
1102-
CmdArgs.push_back("-internal-isystem");
1103-
CmdArgs.push_back(Args.MakeArgString(P));
1104-
}
1105-
}
1106-
11071080
// If we are offloading to a target via OpenMP we need to include the
11081081
// openmp_wrappers folder which contains alternative system headers.
11091082
if (JA.isDeviceOffloading(Action::OFK_OpenMP) &&
@@ -1276,6 +1249,35 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
12761249
});
12771250
}
12781251

1252+
// If we are compiling for a GPU target we want to override the system headers
1253+
// with ones created by the 'libc' project if present.
1254+
// TODO: This should be moved to `AddClangSystemIncludeArgs` by passing the
1255+
// OffloadKind as an argument.
1256+
if (!Args.hasArg(options::OPT_nostdinc) &&
1257+
!Args.hasArg(options::OPT_nogpuinc) &&
1258+
!Args.hasArg(options::OPT_nobuiltininc)) {
1259+
// Without an offloading language we will include these headers directly.
1260+
// Offloading languages will instead only use the declarations stored in
1261+
// the resource directory at clang/lib/Headers/llvm_libc_wrappers.
1262+
if ((getToolChain().getTriple().isNVPTX() ||
1263+
getToolChain().getTriple().isAMDGCN()) &&
1264+
C.getActiveOffloadKinds() == Action::OFK_None) {
1265+
SmallString<128> P(llvm::sys::path::parent_path(D.Dir));
1266+
llvm::sys::path::append(P, "include");
1267+
llvm::sys::path::append(P, getToolChain().getTripleString());
1268+
CmdArgs.push_back("-internal-isystem");
1269+
CmdArgs.push_back(Args.MakeArgString(P));
1270+
} else if (C.getActiveOffloadKinds() == Action::OFK_OpenMP) {
1271+
// TODO: CUDA / HIP include their own headers for some common functions
1272+
// implemented here. We'll need to clean those up so they do not conflict.
1273+
SmallString<128> P(D.ResourceDir);
1274+
llvm::sys::path::append(P, "include");
1275+
llvm::sys::path::append(P, "llvm_libc_wrappers");
1276+
CmdArgs.push_back("-internal-isystem");
1277+
CmdArgs.push_back(Args.MakeArgString(P));
1278+
}
1279+
}
1280+
12791281
// Add system include arguments for all targets but IAMCU.
12801282
if (!IsIAMCU)
12811283
forAllAssociatedToolChains(C, JA, getToolChain(),

clang/test/Driver/gpu-libc-headers.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --sysroot=./ \
55
// RUN: -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target=nvptx64-nvidia-cuda --offload-arch=sm_70 \
66
// RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS
7-
// CHECK-HEADERS: "-cc1"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}llvm_libc_wrappers"{{.*}}"-isysroot" "./"
8-
// CHECK-HEADERS: "-cc1"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}llvm_libc_wrappers"{{.*}}"-isysroot" "./"
7+
// CHECK-HEADERS: "-cc1"{{.*}}"-isysroot" "./"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}llvm_libc_wrappers"
8+
// CHECK-HEADERS: "-cc1"{{.*}}"-isysroot" "./"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}llvm_libc_wrappers"
99

1010
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx90a --sysroot=./ \
1111
// RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS-AMDGPU
1212
// RUN: %clang -### --target=nvptx64-nvidia-cuda -march=sm_89 --sysroot=./ \
1313
// RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS-NVPTX
14-
// CHECK-HEADERS-AMDGPU: "-cc1"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}amdgcn-amd-amdhsa"{{.*}}"-isysroot" "./"
15-
// CHECK-HEADERS-NVPTX: "-cc1"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}nvptx64-nvidia-cuda"{{.*}}"-isysroot" "./"
14+
// CHECK-HEADERS-AMDGPU: "-cc1"{{.*}}"-isysroot" "./"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}amdgcn-amd-amdhsa"
15+
// CHECK-HEADERS-NVPTX: "-cc1"{{.*}}"-isysroot" "./"{{.*}}"-internal-isystem" "{{.*}}include{{.*}}nvptx64-nvidia-cuda"
1616

1717
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -nogpulib \
1818
// RUN: -nogpuinc %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS-DISABLED

libcxx/include/vector

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,11 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<_Tp, _Allocator>::shrink_to_fit() _NOE
14431443
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
14441444
allocator_type& __a = this->__alloc();
14451445
__split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
1446-
__swap_out_circular_buffer(__v);
1446+
// The Standard mandates shrink_to_fit() does not increase the capacity.
1447+
// With equal capacity keep the existing buffer. This avoids extra work
1448+
// due to swapping the elements.
1449+
if (__v.capacity() < capacity())
1450+
__swap_out_circular_buffer(__v);
14471451
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
14481452
} catch (...) {
14491453
}

libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,56 @@ TEST_CONSTEXPR_CXX20 bool tests() {
7171
return true;
7272
}
7373

74+
#if TEST_STD_VER >= 23
75+
template <typename T>
76+
struct increasing_allocator {
77+
using value_type = T;
78+
std::size_t min_elements = 1000;
79+
increasing_allocator() = default;
80+
81+
template <typename U>
82+
constexpr increasing_allocator(const increasing_allocator<U>& other) noexcept : min_elements(other.min_elements) {}
83+
84+
constexpr std::allocation_result<T*> allocate_at_least(std::size_t n) {
85+
if (n < min_elements)
86+
n = min_elements;
87+
min_elements += 1000;
88+
return std::allocator<T>{}.allocate_at_least(n);
89+
}
90+
constexpr T* allocate(std::size_t n) { return allocate_at_least(n).ptr; }
91+
constexpr void deallocate(T* p, std::size_t n) noexcept { std::allocator<T>{}.deallocate(p, n); }
92+
};
93+
94+
template <typename T, typename U>
95+
bool operator==(increasing_allocator<T>, increasing_allocator<U>) {
96+
return true;
97+
}
98+
99+
// https://github.com/llvm/llvm-project/issues/95161
100+
constexpr bool test_increasing_allocator() {
101+
std::vector<int, increasing_allocator<int>> v;
102+
v.push_back(1);
103+
assert(is_contiguous_container_asan_correct(v));
104+
std::size_t capacity = v.capacity();
105+
v.shrink_to_fit();
106+
assert(v.capacity() <= capacity);
107+
assert(v.size() == 1);
108+
assert(is_contiguous_container_asan_correct(v));
109+
110+
return true;
111+
}
112+
#endif // TEST_STD_VER >= 23
113+
74114
int main(int, char**)
75115
{
76-
tests();
116+
tests();
77117
#if TEST_STD_VER > 17
78118
static_assert(tests());
79119
#endif
120+
#if TEST_STD_VER >= 23
121+
test_increasing_allocator();
122+
static_assert(test_increasing_allocator());
123+
#endif
124+
80125
return 0;
81126
}

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,8 +1669,8 @@ void AsmPrinter::emitPCSections(const MachineFunction &MF) {
16691669
}
16701670

16711671
/// Returns true if function begin and end labels should be emitted.
1672-
static bool needFuncLabels(const MachineFunction &MF) {
1673-
MachineModuleInfo &MMI = MF.getMMI();
1672+
static bool needFuncLabels(const MachineFunction &MF,
1673+
const MachineModuleInfo &MMI) {
16741674
if (!MF.getLandingPads().empty() || MF.hasEHFunclets() ||
16751675
MMI.hasDebugInfo() ||
16761676
MF.getFunction().hasMetadata(LLVMContext::MD_pcsections))
@@ -1944,7 +1944,7 @@ void AsmPrinter::emitFunctionBody() {
19441944
// are automatically sized.
19451945
bool EmitFunctionSize = MAI->hasDotTypeDotSizeDirective() && !TT.isWasm();
19461946

1947-
if (needFuncLabels(*MF) || EmitFunctionSize) {
1947+
if (needFuncLabels(*MF, *MMI) || EmitFunctionSize) {
19481948
// Create a symbol for the end of function.
19491949
CurrentFnEnd = createTempSymbol("func_end");
19501950
OutStreamer->emitLabel(CurrentFnEnd);
@@ -2587,8 +2587,9 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
25872587
bool NeedsLocalForSize = MAI->needsLocalForSize();
25882588
if (F.hasFnAttribute("patchable-function-entry") ||
25892589
F.hasFnAttribute("function-instrument") ||
2590-
F.hasFnAttribute("xray-instruction-threshold") || needFuncLabels(MF) ||
2591-
NeedsLocalForSize || MF.getTarget().Options.EmitStackSizeSection ||
2590+
F.hasFnAttribute("xray-instruction-threshold") ||
2591+
needFuncLabels(MF, *MMI) || NeedsLocalForSize ||
2592+
MF.getTarget().Options.EmitStackSizeSection ||
25922593
MF.getTarget().Options.BBAddrMap || MF.hasBBLabels()) {
25932594
CurrentFnBegin = createTempSymbol("func_begin");
25942595
if (NeedsLocalForSize)

llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void DwarfCFIException::beginFunction(const MachineFunction *MF) {
9090
shouldEmitLSDA = shouldEmitPersonality &&
9191
LSDAEncoding != dwarf::DW_EH_PE_omit;
9292

93-
const MCAsmInfo &MAI = *MF->getMMI().getContext().getAsmInfo();
93+
const MCAsmInfo &MAI = *MF->getContext().getAsmInfo();
9494
if (MAI.getExceptionHandlingType() != ExceptionHandling::None)
9595
shouldEmitCFI =
9696
MAI.usesCFIForEH() && (shouldEmitPersonality || shouldEmitMoves);

llvm/lib/Target/M68k/M68kFrameLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ MachineBasicBlock::iterator M68kFrameLowering::eliminateCallFramePseudoInstr(
246246
unsigned StackAlign = getStackAlignment();
247247
Amount = alignTo(Amount, StackAlign);
248248

249-
MachineModuleInfo &MMI = MF.getMMI();
250-
const auto &Fn = MF.getFunction();
251-
bool DwarfCFI = MMI.hasDebugInfo() || Fn.needsUnwindTableEntry();
249+
bool DwarfCFI = MF.needsFrameMoves();
252250

253251
// If we have any exception handlers in this function, and we adjust
254252
// the SP before calls, we may need to indicate this to the unwinder

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ static bool mergeReplicateRegionsIntoSuccessors(VPlan &Plan) {
278278
return UI && UI->getParent() == Then2;
279279
});
280280

281+
// Remove phi recipes that are unused after merging the regions.
282+
if (Phi1ToMove.getVPSingleValue()->getNumUsers() == 0) {
283+
Phi1ToMove.eraseFromParent();
284+
continue;
285+
}
281286
Phi1ToMove.moveBefore(*Merge2, Merge2->begin());
282287
}
283288

llvm/test/Transforms/LoopVectorize/AArch64/pr73894.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ define i32 @pr70988(ptr %src, i32 %n) {
3232
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 4
3333
; CHECK-NEXT: br label [[PRED_LOAD_CONTINUE]]
3434
; CHECK: pred.load.continue:
35-
; CHECK-NEXT: [[TMP7:%.*]] = phi ptr [ poison, [[VECTOR_BODY]] ], [ [[TMP5]], [[PRED_LOAD_IF]] ]
3635
; CHECK-NEXT: [[TMP8:%.*]] = phi i32 [ poison, [[VECTOR_BODY]] ], [ [[TMP6]], [[PRED_LOAD_IF]] ]
3736
; CHECK-NEXT: br i1 [[ACTIVE_LANE_MASK2]], label [[PRED_LOAD_IF4:%.*]], label [[PRED_LOAD_CONTINUE5]]
3837
; CHECK: pred.load.if4:
@@ -42,7 +41,6 @@ define i32 @pr70988(ptr %src, i32 %n) {
4241
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP11]], align 4
4342
; CHECK-NEXT: br label [[PRED_LOAD_CONTINUE5]]
4443
; CHECK: pred.load.continue5:
45-
; CHECK-NEXT: [[TMP13:%.*]] = phi ptr [ poison, [[PRED_LOAD_CONTINUE]] ], [ [[TMP11]], [[PRED_LOAD_IF4]] ]
4644
; CHECK-NEXT: [[TMP14:%.*]] = phi i32 [ poison, [[PRED_LOAD_CONTINUE]] ], [ [[TMP12]], [[PRED_LOAD_IF4]] ]
4745
; CHECK-NEXT: [[TMP15:%.*]] = tail call i32 @llvm.smax.i32(i32 [[TMP8]], i32 [[VEC_PHI]])
4846
; CHECK-NEXT: [[TMP16:%.*]] = tail call i32 @llvm.smax.i32(i32 [[TMP14]], i32 [[VEC_PHI3]])

llvm/test/Transforms/LoopVectorize/PowerPC/vplan-force-tail-with-evl.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {
4040
; CHECK-NEXT: Successor(s): pred.store.continue
4141
; CHECK-EMPTY:
4242
; CHECK-NEXT: pred.store.continue:
43-
; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[P1:%.+]]> = ir<%0>
44-
; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[P2:%.+]]> = ir<%1>
4543
; CHECK-NEXT: No successors
4644
; CHECK-NEXT: }
4745
; CHECK-NEXT: Successor(s): for.body.2

llvm/test/Transforms/LoopVectorize/X86/x86-predication.ll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
238238
; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP5]], i32 0
239239
; CHECK-NEXT: br label [[PRED_UDIV_CONTINUE]]
240240
; CHECK: pred.udiv.continue:
241-
; CHECK-NEXT: [[TMP7:%.*]] = phi i32 [ poison, [[VECTOR_BODY]] ], [ [[TMP4]], [[PRED_UDIV_IF]] ]
242241
; CHECK-NEXT: [[TMP8:%.*]] = phi <2 x i32> [ poison, [[VECTOR_BODY]] ], [ [[TMP6]], [[PRED_UDIV_IF]] ]
243242
; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x i1> [[BROADCAST_SPLAT]], i32 1
244243
; CHECK-NEXT: br i1 [[TMP9]], label [[PRED_UDIV_IF1:%.*]], label [[PRED_UDIV_CONTINUE2]]
@@ -250,7 +249,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
250249
; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x i32> [[TMP8]], i32 [[TMP13]], i32 1
251250
; CHECK-NEXT: br label [[PRED_UDIV_CONTINUE2]]
252251
; CHECK: pred.udiv.continue2:
253-
; CHECK-NEXT: [[TMP15:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE]] ], [ [[TMP12]], [[PRED_UDIV_IF1]] ]
254252
; CHECK-NEXT: [[TMP16:%.*]] = phi <2 x i32> [ [[TMP8]], [[PRED_UDIV_CONTINUE]] ], [ [[TMP14]], [[PRED_UDIV_IF1]] ]
255253
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[BROADCAST_SPLAT]], <2 x i32> [[TMP16]], <2 x i32> [[BROADCAST_SPLAT4]]
256254
; CHECK-NEXT: [[TMP18]] = add <2 x i32> [[VEC_PHI]], [[PREDPHI]]
@@ -314,7 +312,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
314312
; SINK-GATHER-NEXT: [[TMP6:%.*]] = insertelement <8 x i32> poison, i32 [[TMP5]], i32 0
315313
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE]]
316314
; SINK-GATHER: pred.udiv.continue:
317-
; SINK-GATHER-NEXT: [[TMP7:%.*]] = phi i32 [ poison, [[VECTOR_BODY]] ], [ [[TMP4]], [[PRED_UDIV_IF]] ]
318315
; SINK-GATHER-NEXT: [[TMP8:%.*]] = phi <8 x i32> [ poison, [[VECTOR_BODY]] ], [ [[TMP6]], [[PRED_UDIV_IF]] ]
319316
; SINK-GATHER-NEXT: [[TMP9:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 1
320317
; SINK-GATHER-NEXT: br i1 [[TMP9]], label [[PRED_UDIV_IF1:%.*]], label [[PRED_UDIV_CONTINUE2:%.*]]
@@ -326,7 +323,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
326323
; SINK-GATHER-NEXT: [[TMP14:%.*]] = insertelement <8 x i32> [[TMP8]], i32 [[TMP13]], i32 1
327324
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE2]]
328325
; SINK-GATHER: pred.udiv.continue2:
329-
; SINK-GATHER-NEXT: [[TMP15:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE]] ], [ [[TMP12]], [[PRED_UDIV_IF1]] ]
330326
; SINK-GATHER-NEXT: [[TMP16:%.*]] = phi <8 x i32> [ [[TMP8]], [[PRED_UDIV_CONTINUE]] ], [ [[TMP14]], [[PRED_UDIV_IF1]] ]
331327
; SINK-GATHER-NEXT: [[TMP17:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 2
332328
; SINK-GATHER-NEXT: br i1 [[TMP17]], label [[PRED_UDIV_IF3:%.*]], label [[PRED_UDIV_CONTINUE4:%.*]]
@@ -338,7 +334,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
338334
; SINK-GATHER-NEXT: [[TMP22:%.*]] = insertelement <8 x i32> [[TMP16]], i32 [[TMP21]], i32 2
339335
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE4]]
340336
; SINK-GATHER: pred.udiv.continue4:
341-
; SINK-GATHER-NEXT: [[TMP23:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE2]] ], [ [[TMP20]], [[PRED_UDIV_IF3]] ]
342337
; SINK-GATHER-NEXT: [[TMP24:%.*]] = phi <8 x i32> [ [[TMP16]], [[PRED_UDIV_CONTINUE2]] ], [ [[TMP22]], [[PRED_UDIV_IF3]] ]
343338
; SINK-GATHER-NEXT: [[TMP25:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 3
344339
; SINK-GATHER-NEXT: br i1 [[TMP25]], label [[PRED_UDIV_IF5:%.*]], label [[PRED_UDIV_CONTINUE6:%.*]]
@@ -350,7 +345,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
350345
; SINK-GATHER-NEXT: [[TMP30:%.*]] = insertelement <8 x i32> [[TMP24]], i32 [[TMP29]], i32 3
351346
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE6]]
352347
; SINK-GATHER: pred.udiv.continue6:
353-
; SINK-GATHER-NEXT: [[TMP31:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE4]] ], [ [[TMP28]], [[PRED_UDIV_IF5]] ]
354348
; SINK-GATHER-NEXT: [[TMP32:%.*]] = phi <8 x i32> [ [[TMP24]], [[PRED_UDIV_CONTINUE4]] ], [ [[TMP30]], [[PRED_UDIV_IF5]] ]
355349
; SINK-GATHER-NEXT: [[TMP33:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 4
356350
; SINK-GATHER-NEXT: br i1 [[TMP33]], label [[PRED_UDIV_IF7:%.*]], label [[PRED_UDIV_CONTINUE8:%.*]]
@@ -362,7 +356,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
362356
; SINK-GATHER-NEXT: [[TMP38:%.*]] = insertelement <8 x i32> [[TMP32]], i32 [[TMP37]], i32 4
363357
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE8]]
364358
; SINK-GATHER: pred.udiv.continue8:
365-
; SINK-GATHER-NEXT: [[TMP39:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE6]] ], [ [[TMP36]], [[PRED_UDIV_IF7]] ]
366359
; SINK-GATHER-NEXT: [[TMP40:%.*]] = phi <8 x i32> [ [[TMP32]], [[PRED_UDIV_CONTINUE6]] ], [ [[TMP38]], [[PRED_UDIV_IF7]] ]
367360
; SINK-GATHER-NEXT: [[TMP41:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 5
368361
; SINK-GATHER-NEXT: br i1 [[TMP41]], label [[PRED_UDIV_IF9:%.*]], label [[PRED_UDIV_CONTINUE10:%.*]]
@@ -374,7 +367,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
374367
; SINK-GATHER-NEXT: [[TMP46:%.*]] = insertelement <8 x i32> [[TMP40]], i32 [[TMP45]], i32 5
375368
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE10]]
376369
; SINK-GATHER: pred.udiv.continue10:
377-
; SINK-GATHER-NEXT: [[TMP47:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE8]] ], [ [[TMP44]], [[PRED_UDIV_IF9]] ]
378370
; SINK-GATHER-NEXT: [[TMP48:%.*]] = phi <8 x i32> [ [[TMP40]], [[PRED_UDIV_CONTINUE8]] ], [ [[TMP46]], [[PRED_UDIV_IF9]] ]
379371
; SINK-GATHER-NEXT: [[TMP49:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 6
380372
; SINK-GATHER-NEXT: br i1 [[TMP49]], label [[PRED_UDIV_IF11:%.*]], label [[PRED_UDIV_CONTINUE12:%.*]]
@@ -386,7 +378,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
386378
; SINK-GATHER-NEXT: [[TMP54:%.*]] = insertelement <8 x i32> [[TMP48]], i32 [[TMP53]], i32 6
387379
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE12]]
388380
; SINK-GATHER: pred.udiv.continue12:
389-
; SINK-GATHER-NEXT: [[TMP55:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE10]] ], [ [[TMP52]], [[PRED_UDIV_IF11]] ]
390381
; SINK-GATHER-NEXT: [[TMP56:%.*]] = phi <8 x i32> [ [[TMP48]], [[PRED_UDIV_CONTINUE10]] ], [ [[TMP54]], [[PRED_UDIV_IF11]] ]
391382
; SINK-GATHER-NEXT: [[TMP57:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 7
392383
; SINK-GATHER-NEXT: br i1 [[TMP57]], label [[PRED_UDIV_IF13:%.*]], label [[PRED_UDIV_CONTINUE14]]
@@ -398,7 +389,6 @@ define i32 @scalarize_and_sink_gather(ptr %a, i1 %c, i32 %x, i64 %n) {
398389
; SINK-GATHER-NEXT: [[TMP62:%.*]] = insertelement <8 x i32> [[TMP56]], i32 [[TMP61]], i32 7
399390
; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE14]]
400391
; SINK-GATHER: pred.udiv.continue14:
401-
; SINK-GATHER-NEXT: [[TMP63:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE12]] ], [ [[TMP60]], [[PRED_UDIV_IF13]] ]
402392
; SINK-GATHER-NEXT: [[TMP64:%.*]] = phi <8 x i32> [ [[TMP56]], [[PRED_UDIV_CONTINUE12]] ], [ [[TMP62]], [[PRED_UDIV_IF13]] ]
403393
; SINK-GATHER-NEXT: [[PREDPHI:%.*]] = select <8 x i1> [[BROADCAST_SPLAT]], <8 x i32> [[TMP64]], <8 x i32> [[BROADCAST_SPLAT16]]
404394
; SINK-GATHER-NEXT: [[TMP66]] = add <8 x i32> [[VEC_PHI]], [[PREDPHI]]

0 commit comments

Comments
 (0)