Skip to content

Commit 9d52766

Browse files
author
z1.cciauto
committed
merge main into amd-staging
2 parents 2f7a35f + 5fa985e commit 9d52766

File tree

170 files changed

+2417
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+2417
-448
lines changed

clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AST_MATCHER_P(QualType, hasAnyType, std::vector<StringRef>, Names) {
3131
return false;
3232

3333
std::string Name = Node.getLocalUnqualifiedType().getAsString();
34-
return llvm::any_of(Names, [&Name](StringRef Ref) { return Ref == Name; });
34+
return llvm::is_contained(Names, Name);
3535
}
3636

3737
AST_MATCHER(FieldDecl, hasIntBitwidth) {

clang-tools-extra/clang-tidy/misc/ConfusableTable/BuildConfusableTable.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ int main(int argc, char *argv[]) {
5757
llvm::sort(Entries);
5858

5959
unsigned LargestValue =
60-
std::max_element(Entries.begin(), Entries.end(),
61-
[](const auto &Entry0, const auto &Entry1) {
62-
return Entry0.second.size() < Entry1.second.size();
63-
})
64-
->second.size();
60+
llvm::max_element(Entries, [](const auto &Entry0, const auto &Entry1) {
61+
return Entry0.second.size() < Entry1.second.size();
62+
})->second.size();
6563

6664
std::error_code Ec;
6765
llvm::raw_fd_ostream Os(argv[2], Ec);

clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,10 @@ static void addPlaceholderArgs(const LambdaProperties &LP,
333333

334334
ArrayRef<BindArgument> Args = LP.BindArguments;
335335

336-
const auto *MaxPlaceholderIt =
337-
std::max_element(Args.begin(), Args.end(),
338-
[](const BindArgument &B1, const BindArgument &B2) {
339-
return B1.PlaceHolderIndex < B2.PlaceHolderIndex;
340-
});
336+
const auto *MaxPlaceholderIt = llvm::max_element(
337+
Args, [](const BindArgument &B1, const BindArgument &B2) {
338+
return B1.PlaceHolderIndex < B2.PlaceHolderIndex;
339+
});
341340

342341
// Placeholders (if present) have index 1 or greater.
343342
if (!PermissiveParameterList && (MaxPlaceholderIt == Args.end() ||

clang-tools-extra/clangd/CompileCommands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
315315

316316
// Check whether the flag exists in the command.
317317
auto HasExact = [&](llvm::StringRef Flag) {
318-
return llvm::any_of(Cmd, [&](llvm::StringRef Arg) { return Arg == Flag; });
318+
return llvm::is_contained(Cmd, Flag);
319319
};
320320

321321
// Check whether the flag appears in the command as a prefix.

clang/include/clang/AST/ExprCXX.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5129,15 +5129,15 @@ class CXXParenListInitExpr final
51295129
return getTrailingObjects<Expr *>(NumExprs);
51305130
}
51315131

5132-
const ArrayRef<Expr *> getInitExprs() const {
5132+
ArrayRef<Expr *> getInitExprs() const {
51335133
return getTrailingObjects<Expr *>(NumExprs);
51345134
}
51355135

51365136
ArrayRef<Expr *> getUserSpecifiedInitExprs() {
51375137
return getTrailingObjects<Expr *>(NumUserSpecifiedExprs);
51385138
}
51395139

5140-
const ArrayRef<Expr *> getUserSpecifiedInitExprs() const {
5140+
ArrayRef<Expr *> getUserSpecifiedInitExprs() const {
51415141
return getTrailingObjects<Expr *>(NumUserSpecifiedExprs);
51425142
}
51435143

clang/include/clang/Serialization/ContinuousRangeMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ class ContinuousRangeMap {
119119
~Builder() {
120120
llvm::sort(Self.Rep, Compare());
121121
Self.Rep.erase(
122-
std::unique(
123-
Self.Rep.begin(), Self.Rep.end(),
122+
llvm::unique(
123+
Self.Rep,
124124
[](const_reference A, const_reference B) {
125125
// FIXME: we should not allow any duplicate keys, but there are
126126
// a lot of duplicate 0 -> 0 mappings to remove first.

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,9 +1044,8 @@ mlir::LogicalResult CIRToLLVMUnaryOpLowering::matchAndRewrite(
10441044
assert(op.getType() == op.getInput().getType() &&
10451045
"Unary operation's operand type and result type are different");
10461046
mlir::Type type = op.getType();
1047-
mlir::Type elementType = type;
1048-
bool isVector = false;
1049-
assert(!cir::MissingFeatures::vectorType());
1047+
mlir::Type elementType = elementTypeIfVector(type);
1048+
bool isVector = mlir::isa<cir::VectorType>(type);
10501049
mlir::Type llvmType = getTypeConverter()->convertType(type);
10511050
mlir::Location loc = op.getLoc();
10521051

@@ -1076,20 +1075,30 @@ mlir::LogicalResult CIRToLLVMUnaryOpLowering::matchAndRewrite(
10761075
rewriter.replaceOp(op, adaptor.getInput());
10771076
return mlir::success();
10781077
case cir::UnaryOpKind::Minus: {
1079-
assert(!isVector &&
1080-
"Add vector handling when vector types are supported");
1081-
mlir::LLVM::ConstantOp zero = rewriter.create<mlir::LLVM::ConstantOp>(
1082-
loc, llvmType, mlir::IntegerAttr::get(llvmType, 0));
1078+
mlir::Value zero;
1079+
if (isVector)
1080+
zero = rewriter.create<mlir::LLVM::ZeroOp>(loc, llvmType);
1081+
else
1082+
zero = rewriter.create<mlir::LLVM::ConstantOp>(
1083+
loc, llvmType, mlir::IntegerAttr::get(llvmType, 0));
10831084
rewriter.replaceOpWithNewOp<mlir::LLVM::SubOp>(
10841085
op, llvmType, zero, adaptor.getInput(), maybeNSW);
10851086
return mlir::success();
10861087
}
10871088
case cir::UnaryOpKind::Not: {
10881089
// bit-wise compliment operator, implemented as an XOR with -1.
1089-
assert(!isVector &&
1090-
"Add vector handling when vector types are supported");
1091-
mlir::LLVM::ConstantOp minusOne = rewriter.create<mlir::LLVM::ConstantOp>(
1092-
loc, llvmType, mlir::IntegerAttr::get(llvmType, -1));
1090+
mlir::Value minusOne;
1091+
if (isVector) {
1092+
const uint64_t numElements =
1093+
mlir::dyn_cast<cir::VectorType>(type).getSize();
1094+
std::vector<int32_t> values(numElements, -1);
1095+
mlir::DenseIntElementsAttr denseVec = rewriter.getI32VectorAttr(values);
1096+
minusOne =
1097+
rewriter.create<mlir::LLVM::ConstantOp>(loc, llvmType, denseVec);
1098+
} else {
1099+
minusOne = rewriter.create<mlir::LLVM::ConstantOp>(
1100+
loc, llvmType, mlir::IntegerAttr::get(llvmType, -1));
1101+
}
10931102
rewriter.replaceOpWithNewOp<mlir::LLVM::XOrOp>(
10941103
op, llvmType, adaptor.getInput(), minusOne);
10951104
return mlir::success();

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10952,8 +10952,7 @@ getNDSWDS(const FunctionDecl *FD, ArrayRef<ParamAttrTy> ParamAttrs) {
1095210952
}) &&
1095310953
"Invalid size");
1095410954

10955-
return std::make_tuple(*std::min_element(std::begin(Sizes), std::end(Sizes)),
10956-
*std::max_element(std::begin(Sizes), std::end(Sizes)),
10955+
return std::make_tuple(*llvm::min_element(Sizes), *llvm::max_element(Sizes),
1095710956
OutputBecomesInput);
1095810957
}
1095910958

clang/lib/CodeGen/CodeGenPGO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ CodeGenFunction::createProfileWeights(ArrayRef<uint64_t> Weights) const {
14861486
return nullptr;
14871487

14881488
// Check for empty weights.
1489-
uint64_t MaxWeight = *std::max_element(Weights.begin(), Weights.end());
1489+
uint64_t MaxWeight = *llvm::max_element(Weights);
14901490
if (MaxWeight == 0)
14911491
return nullptr;
14921492

clang/lib/CodeGen/MicrosoftCXXABI.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,9 +1818,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
18181818
// VFTablesMap, thus a simple zero check is not sufficient.
18191819

18201820
VFTableIdTy ID(RD, VPtrOffset);
1821-
VTablesMapTy::iterator I;
1822-
bool Inserted;
1823-
std::tie(I, Inserted) = VTablesMap.insert(std::make_pair(ID, nullptr));
1821+
auto [I, Inserted] = VTablesMap.try_emplace(ID);
18241822
if (!Inserted)
18251823
return I->second;
18261824

@@ -2036,10 +2034,7 @@ const VBTableGlobals &
20362034
MicrosoftCXXABI::enumerateVBTables(const CXXRecordDecl *RD) {
20372035
// At this layer, we can key the cache off of a single class, which is much
20382036
// easier than caching each vbtable individually.
2039-
llvm::DenseMap<const CXXRecordDecl*, VBTableGlobals>::iterator Entry;
2040-
bool Added;
2041-
std::tie(Entry, Added) =
2042-
VBTablesMap.insert(std::make_pair(RD, VBTableGlobals()));
2037+
auto [Entry, Added] = VBTablesMap.try_emplace(RD);
20432038
VBTableGlobals &VBGlobals = Entry->second;
20442039
if (!Added)
20452040
return VBGlobals;

clang/lib/Format/UsingDeclarationsSorter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,10 @@ void endUsingDeclarationBlock(
157157
};
158158
llvm::stable_sort(SortedUsingDeclarations, Comp);
159159
SortedUsingDeclarations.erase(
160-
std::unique(SortedUsingDeclarations.begin(),
161-
SortedUsingDeclarations.end(),
162-
[](const UsingDeclaration &a, const UsingDeclaration &b) {
163-
return a.Label == b.Label;
164-
}),
160+
llvm::unique(SortedUsingDeclarations,
161+
[](const UsingDeclaration &a, const UsingDeclaration &b) {
162+
return a.Label == b.Label;
163+
}),
165164
SortedUsingDeclarations.end());
166165
for (size_t I = 0, E = UsingDeclarations->size(); I < E; ++I) {
167166
if (I >= SortedUsingDeclarations.size()) {

clang/lib/Sema/SemaCUDA.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,10 @@ void SemaCUDA::EraseUnwantedMatches(
330330
};
331331

332332
// Find the best call preference among the functions in Matches.
333-
CUDAFunctionPreference BestCFP = GetCFP(*std::max_element(
334-
Matches.begin(), Matches.end(),
335-
[&](const Pair &M1, const Pair &M2) { return GetCFP(M1) < GetCFP(M2); }));
333+
CUDAFunctionPreference BestCFP =
334+
GetCFP(*llvm::max_element(Matches, [&](const Pair &M1, const Pair &M2) {
335+
return GetCFP(M1) < GetCFP(M2);
336+
}));
336337

337338
// Erase all functions with lower priority.
338339
llvm::erase_if(Matches,

clang/lib/Sema/SemaChecking.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9155,9 +9155,7 @@ static bool IsStdFunction(const FunctionDecl *FDecl,
91559155
enum class MathCheck { NaN, Inf };
91569156
static bool IsInfOrNanFunction(StringRef calleeName, MathCheck Check) {
91579157
auto MatchesAny = [&](std::initializer_list<llvm::StringRef> names) {
9158-
return std::any_of(names.begin(), names.end(), [&](llvm::StringRef name) {
9159-
return calleeName == name;
9160-
});
9158+
return llvm::is_contained(names, calleeName);
91619159
};
91629160

91639161
switch (Check) {

clang/lib/Sema/SemaLambda.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,8 +1632,8 @@ static void repeatForLambdaConversionFunctionCallingConvs(
16321632
CC_C, CC_X86StdCall, CC_X86FastCall, CC_X86VectorCall,
16331633
DefaultFree, DefaultMember, CallOpCC};
16341634
llvm::sort(Convs);
1635-
llvm::iterator_range<CallingConv *> Range(
1636-
std::begin(Convs), std::unique(std::begin(Convs), std::end(Convs)));
1635+
llvm::iterator_range<CallingConv *> Range(std::begin(Convs),
1636+
llvm::unique(Convs));
16371637
const TargetInfo &TI = S.getASTContext().getTargetInfo();
16381638

16391639
for (CallingConv C : Range) {

clang/test/CIR/CodeGen/vector-ext.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,63 @@ void foo7() {
337337
// OGCG: %[[NEW_VEC:.*]] = insertelement <4 x i32> %[[TMP2]], i32 %[[RES]], i32 2
338338
// OGCG: store <4 x i32> %[[NEW_VEC]], ptr %[[VEC]], align 16
339339

340+
341+
void foo8() {
342+
vi4 a = { 1, 2, 3, 4 };
343+
vi4 plus_res = +a;
344+
vi4 minus_res = -a;
345+
vi4 not_res = ~a;
346+
}
347+
348+
// CIR: %[[VEC:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["a", init]
349+
// CIR: %[[PLUS_RES:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["plus_res", init]
350+
// CIR: %[[MINUS_RES:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["minus_res", init]
351+
// CIR: %[[NOT_RES:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["not_res", init]
352+
// CIR: %[[CONST_1:.*]] = cir.const #cir.int<1> : !s32i
353+
// CIR: %[[CONST_2:.*]] = cir.const #cir.int<2> : !s32i
354+
// CIR: %[[CONST_3:.*]] = cir.const #cir.int<3> : !s32i
355+
// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !s32i
356+
// CIR: %[[VEC_VAL:.*]] = cir.vec.create(%[[CONST_1]], %[[CONST_2]], %[[CONST_3]], %[[CONST_4]] :
357+
// CIR-SAME: !s32i, !s32i, !s32i, !s32i) : !cir.vector<4 x !s32i>
358+
// CIR: cir.store %[[VEC_VAL]], %[[VEC]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
359+
// CIR: %[[TMP1:.*]] = cir.load %[[VEC]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
360+
// CIR: %[[PLUS:.*]] = cir.unary(plus, %[[TMP1]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
361+
// CIR: cir.store %[[PLUS]], %[[PLUS_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
362+
// CIR: %[[TMP2:.*]] = cir.load %[[VEC]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
363+
// CIR: %[[MINUS:.*]] = cir.unary(minus, %[[TMP2]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
364+
// CIR: cir.store %[[MINUS]], %[[MINUS_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
365+
// CIR: %[[TMP3:.*]] = cir.load %[[VEC]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
366+
// CIR: %[[NOT:.*]] = cir.unary(not, %[[TMP3]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
367+
// CIR: cir.store %[[NOT]], %[[NOT_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
368+
369+
// LLVM: %[[VEC:.*]] = alloca <4 x i32>, i64 1, align 16
370+
// LLVM: %[[PLUS_RES:.*]] = alloca <4 x i32>, i64 1, align 16
371+
// LLVM: %[[MINUS_RES:.*]] = alloca <4 x i32>, i64 1, align 16
372+
// LLVM: %[[NOT_RES:.*]] = alloca <4 x i32>, i64 1, align 16
373+
// LLVM: store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %[[VEC]], align 16
374+
// LLVM: %[[TMP1:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
375+
// LLVM: store <4 x i32> %[[TMP1]], ptr %[[PLUS_RES]], align 16
376+
// LLVM: %[[TMP2:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
377+
// LLVM: %[[SUB:.*]] = sub <4 x i32> zeroinitializer, %[[TMP2]]
378+
// LLVM: store <4 x i32> %[[SUB]], ptr %[[MINUS_RES]], align 16
379+
// LLVM: %[[TMP3:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
380+
// LLVM: %[[NOT:.*]] = xor <4 x i32> %[[TMP3]], splat (i32 -1)
381+
// LLVM: store <4 x i32> %[[NOT]], ptr %[[NOT_RES]], align 16
382+
383+
// OGCG: %[[VEC:.*]] = alloca <4 x i32>, align 16
384+
// OGCG: %[[PLUS_RES:.*]] = alloca <4 x i32>, align 16
385+
// OGCG: %[[MINUS_RES:.*]] = alloca <4 x i32>, align 16
386+
// OGCG: %[[NOT_RES:.*]] = alloca <4 x i32>, align 16
387+
// OGCG: store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %[[VEC]], align 16
388+
// OGCG: %[[TMP1:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
389+
// OGCG: store <4 x i32> %[[TMP1]], ptr %[[PLUS_RES]], align 16
390+
// OGCG: %[[TMP2:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
391+
// OGCG: %[[SUB:.*]] = sub <4 x i32> zeroinitializer, %[[TMP2]]
392+
// OGCG: store <4 x i32> %[[SUB]], ptr %[[MINUS_RES]], align 16
393+
// OGCG: %[[TMP3:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
394+
// OGCG: %[[NOT:.*]] = xor <4 x i32> %[[TMP3]], splat (i32 -1)
395+
// OGCG: store <4 x i32> %[[NOT]], ptr %[[NOT_RES]], align 16
396+
340397
void foo9() {
341398
vi4 a = {1, 2, 3, 4};
342399
vi4 b = {5, 6, 7, 8};

clang/test/CIR/CodeGen/vector.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,63 @@ void foo7() {
325325
// OGCG: %[[NEW_VEC:.*]] = insertelement <4 x i32> %[[TMP2]], i32 %[[RES]], i32 2
326326
// OGCG: store <4 x i32> %[[NEW_VEC]], ptr %[[VEC]], align 16
327327

328+
329+
void foo8() {
330+
vi4 a = { 1, 2, 3, 4 };
331+
vi4 plus_res = +a;
332+
vi4 minus_res = -a;
333+
vi4 not_res = ~a;
334+
}
335+
336+
// CIR: %[[VEC:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["a", init]
337+
// CIR: %[[PLUS_RES:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["plus_res", init]
338+
// CIR: %[[MINUS_RES:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["minus_res", init]
339+
// CIR: %[[NOT_RES:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["not_res", init]
340+
// CIR: %[[CONST_1:.*]] = cir.const #cir.int<1> : !s32i
341+
// CIR: %[[CONST_2:.*]] = cir.const #cir.int<2> : !s32i
342+
// CIR: %[[CONST_3:.*]] = cir.const #cir.int<3> : !s32i
343+
// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !s32i
344+
// CIR: %[[VEC_VAL:.*]] = cir.vec.create(%[[CONST_1]], %[[CONST_2]], %[[CONST_3]], %[[CONST_4]] :
345+
// CIR-SAME: !s32i, !s32i, !s32i, !s32i) : !cir.vector<4 x !s32i>
346+
// CIR: cir.store %[[VEC_VAL]], %[[VEC]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
347+
// CIR: %[[TMP1:.*]] = cir.load %[[VEC]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
348+
// CIR: %[[PLUS:.*]] = cir.unary(plus, %[[TMP1]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
349+
// CIR: cir.store %[[PLUS]], %[[PLUS_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
350+
// CIR: %[[TMP2:.*]] = cir.load %[[VEC]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
351+
// CIR: %[[MINUS:.*]] = cir.unary(minus, %[[TMP2]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
352+
// CIR: cir.store %[[MINUS]], %[[MINUS_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
353+
// CIR: %[[TMP3:.*]] = cir.load %[[VEC]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
354+
// CIR: %[[NOT:.*]] = cir.unary(not, %[[TMP3]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
355+
// CIR: cir.store %[[NOT]], %[[NOT_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
356+
357+
// LLVM: %[[VEC:.*]] = alloca <4 x i32>, i64 1, align 16
358+
// LLVM: %[[PLUS_RES:.*]] = alloca <4 x i32>, i64 1, align 16
359+
// LLVM: %[[MINUS_RES:.*]] = alloca <4 x i32>, i64 1, align 16
360+
// LLVM: %[[NOT_RES:.*]] = alloca <4 x i32>, i64 1, align 16
361+
// LLVM: store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %[[VEC]], align 16
362+
// LLVM: %[[TMP1:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
363+
// LLVM: store <4 x i32> %[[TMP1]], ptr %[[PLUS_RES]], align 16
364+
// LLVM: %[[TMP2:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
365+
// LLVM: %[[SUB:.*]] = sub <4 x i32> zeroinitializer, %[[TMP2]]
366+
// LLVM: store <4 x i32> %[[SUB]], ptr %[[MINUS_RES]], align 16
367+
// LLVM: %[[TMP3:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
368+
// LLVM: %[[NOT:.*]] = xor <4 x i32> %[[TMP3]], splat (i32 -1)
369+
// LLVM: store <4 x i32> %[[NOT]], ptr %[[NOT_RES]], align 16
370+
371+
// OGCG: %[[VEC:.*]] = alloca <4 x i32>, align 16
372+
// OGCG: %[[PLUS_RES:.*]] = alloca <4 x i32>, align 16
373+
// OGCG: %[[MINUS_RES:.*]] = alloca <4 x i32>, align 16
374+
// OGCG: %[[NOT_RES:.*]] = alloca <4 x i32>, align 16
375+
// OGCG: store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %[[VEC]], align 16
376+
// OGCG: %[[TMP1:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
377+
// OGCG: store <4 x i32> %[[TMP1]], ptr %[[PLUS_RES]], align 16
378+
// OGCG: %[[TMP2:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
379+
// OGCG: %[[SUB:.*]] = sub <4 x i32> zeroinitializer, %[[TMP2]]
380+
// OGCG: store <4 x i32> %[[SUB]], ptr %[[MINUS_RES]], align 16
381+
// OGCG: %[[TMP3:.*]] = load <4 x i32>, ptr %[[VEC]], align 16
382+
// OGCG: %[[NOT:.*]] = xor <4 x i32> %[[TMP3]], splat (i32 -1)
383+
// OGCG: store <4 x i32> %[[NOT]], ptr %[[NOT_RES]], align 16
384+
328385
void foo9() {
329386
vi4 a = {1, 2, 3, 4};
330387
vi4 b = {5, 6, 7, 8};

clang/tools/libclang/CIndex.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8872,9 +8872,8 @@ static void getCursorPlatformAvailabilityForDecl(
88728872
return LHS->getPlatform()->getName() < RHS->getPlatform()->getName();
88738873
});
88748874
ASTContext &Ctx = D->getASTContext();
8875-
auto It = std::unique(
8876-
AvailabilityAttrs.begin(), AvailabilityAttrs.end(),
8877-
[&Ctx](AvailabilityAttr *LHS, AvailabilityAttr *RHS) {
8875+
auto It = llvm::unique(
8876+
AvailabilityAttrs, [&Ctx](AvailabilityAttr *LHS, AvailabilityAttr *RHS) {
88788877
if (LHS->getPlatform() != RHS->getPlatform())
88798878
return false;
88808879

clang/utils/TableGen/ClangOptionDocEmitter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,8 @@ void emitOption(const DocumentedOption &Option, const Record *DocInfo,
336336
});
337337
assert(!SphinxOptionIDs.empty() && "no flags for option");
338338
static std::map<std::string, int> NextSuffix;
339-
int SphinxWorkaroundSuffix = NextSuffix[*std::max_element(
340-
SphinxOptionIDs.begin(), SphinxOptionIDs.end(),
341-
[&](const std::string &A, const std::string &B) {
339+
int SphinxWorkaroundSuffix = NextSuffix[*llvm::max_element(
340+
SphinxOptionIDs, [&](const std::string &A, const std::string &B) {
342341
return NextSuffix[A] < NextSuffix[B];
343342
})];
344343
for (auto &S : SphinxOptionIDs)

libcxx/include/__algorithm/shuffle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_randomizer {
6565
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) || defined(_LIBCPP_BUILDING_LIBRARY)
6666
class _LIBCPP_EXPORTED_FROM_ABI __rs_default;
6767

68+
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
6869
_LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
6970

7071
class _LIBCPP_EXPORTED_FROM_ABI __rs_default {
@@ -90,6 +91,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __rs_default {
9091
};
9192

9293
_LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
94+
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
9395

9496
template <class _RandomAccessIterator>
9597
_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX14 void

0 commit comments

Comments
 (0)