Skip to content

Commit 2834b09

Browse files
authored
Merge branch 'main' into x86-mmx-sse-constexpr-integer-max-min-intrinsics
2 parents 5bdb914 + 4829ded commit 2834b09

File tree

273 files changed

+40122
-11214
lines changed

Some content is hidden

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

273 files changed

+40122
-11214
lines changed

clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct IntegerLiteralCheck {
2929
// integer (wb), and can be a complex number ('i', 'j'). In MS compatibility
3030
// mode, suffixes like i32 are supported.
3131
static constexpr llvm::StringLiteral Suffixes =
32-
llvm::StringLiteral("uUlLzZwWbBiIjJ");
32+
llvm::StringLiteral("uUlLzZwWiIjJ");
3333
};
3434

3535
struct FloatingLiteralCheck {

clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,12 @@ void integer_suffix() {
128128
static_assert(is_same<decltype(v24), const unsigned long long>::value, "");
129129
static_assert(v24 == 1, "");
130130
}
131+
132+
void no_warning_on_hex_literals() {
133+
int a = 0xa;
134+
int b = 0xb;
135+
int c = 0xc;
136+
int d = 0xd;
137+
int e = 0xe;
138+
int f = 0xf;
139+
}

clang/docs/OpenMPSupport.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ implementation.
443443
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
444444
| Traits for default device envirable | :none:`unclaimed` | :none:`unclaimed` | |
445445
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
446-
| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/148048 |
446+
| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | (Parse) https://github.com/llvm/llvm-project/pull/148048, |
447+
| | | | (Sema) https://github.com/llvm/llvm-project/pull/152786 |
447448
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
448449
| Canonical loop sequences | :none:`unclaimed` | :part:`In Progress` | |
449450
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ OpenMP Support
482482
modifier in the ``adjust_args`` clause.
483483
- Allow array length to be omitted in array section subscript expression.
484484
- Fixed non-contiguous strided update in the ``omp target update`` directive with the ``from`` clause.
485+
- Properly handle array section/assumed-size array privatization in C/C++.
485486

486487
Improvements
487488
^^^^^^^^^^^^

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ def AnalyzerNoReturn : InheritableAttr {
979979
}
980980

981981
def InferredNoReturn : InheritableAttr {
982-
let Spellings = [];
982+
let Spellings = [];
983983
let SemaHandler = 0;
984984
let Subjects = SubjectList<[Function], ErrorDiag>;
985985
let Documentation = [InternalOnly];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10698,7 +10698,7 @@ def warn_dangling_reference_captured_by_unknown : Warning<
1069810698

1069910699
// Diagnostics based on the Lifetime safety analysis.
1070010700
def warn_lifetime_safety_loan_expires_permissive : Warning<
10701-
"object whose reference is captured does not live long enough">,
10701+
"object whose reference is captured does not live long enough">,
1070210702
InGroup<LifetimeSafetyPermissive>, DefaultIgnore;
1070310703
def warn_lifetime_safety_loan_expires_strict : Warning<
1070410704
"object whose reference is captured may not live long enough">,

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,12 +3752,23 @@ class CIR_UnaryFPToFPBuiltinOp<string mnemonic, string llvmOpName>
37523752
let llvmOp = llvmOpName;
37533753
}
37543754

3755+
def CIR_ACosOp : CIR_UnaryFPToFPBuiltinOp<"acos", "ACosOp"> {
3756+
let summary = "Computes the arcus cosine of the specified value";
3757+
let description = [{
3758+
`cir.acos`computes the arcus cosine of a given value and
3759+
returns a result of the same type.
3760+
3761+
Floating-point exceptions are ignored, and it does not set `errno`.
3762+
}];
3763+
}
3764+
37553765
def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> {
37563766
let summary = "Computes the floating-point absolute value";
37573767
let description = [{
37583768
`cir.fabs` computes the absolute value of a floating-point operand
3759-
and returns a result of the same type, ignoring floating-point
3760-
exceptions. It does not set `errno`.
3769+
and returns a result of the same type.
3770+
3771+
Floating-point exceptions are ignored, and it does not set `errno`.
37613772
}];
37623773
}
37633774

clang/lib/Analysis/LifetimeSafety.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ class FactGenerator : public ConstStmtVisitor<FactGenerator> {
445445
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE) {
446446
if (!hasOrigin(ICE->getType()))
447447
return;
448-
Visit(ICE->getSubExpr());
449448
// An ImplicitCastExpr node itself gets an origin, which flows from the
450449
// origin of its sub-expression (after stripping its own parens/casts).
451450
// TODO: Consider if this is actually useful in practice. Alternatively, we

clang/lib/CIR/CodeGen/CIRGenAtomic.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ bool AtomicInfo::requiresMemSetZero(mlir::Type ty) const {
159159
case cir::TEK_Scalar:
160160
return !isFullSizeType(cgf.cgm, ty, atomicSizeInBits);
161161
case cir::TEK_Complex:
162-
cgf.cgm.errorNYI(loc, "AtomicInfo::requiresMemSetZero: complex type");
163-
return false;
164-
162+
return !isFullSizeType(cgf.cgm,
163+
mlir::cast<cir::ComplexType>(ty).getElementType(),
164+
atomicSizeInBits / 2);
165165
// Padding in structs has an undefined bit pattern. User beware.
166166
case cir::TEK_Aggregate:
167167
return false;
@@ -556,9 +556,11 @@ void CIRGenFunction::emitAtomicInit(Expr *init, LValue dest) {
556556
return;
557557
}
558558

559-
case cir::TEK_Complex:
560-
cgm.errorNYI(init->getSourceRange(), "emitAtomicInit: complex type");
559+
case cir::TEK_Complex: {
560+
mlir::Value value = emitComplexExpr(init);
561+
atomics.emitCopyIntoMemory(RValue::get(value));
561562
return;
563+
}
562564

563565
case cir::TEK_Aggregate:
564566
cgm.errorNYI(init->getSourceRange(), "emitAtomicInit: aggregate type");

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ static RValue emitUnaryMaybeConstrainedFPBuiltin(CIRGenFunction &cgf,
8585
return RValue::get(call->getResult(0));
8686
}
8787

88+
template <class Operation>
89+
static RValue emitUnaryFPBuiltin(CIRGenFunction &cgf, const CallExpr &e) {
90+
mlir::Value arg = cgf.emitScalarExpr(e.getArg(0));
91+
auto call =
92+
Operation::create(cgf.getBuilder(), arg.getLoc(), arg.getType(), arg);
93+
return RValue::get(call->getResult(0));
94+
}
95+
8896
RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
8997
const CallExpr *e,
9098
ReturnValueSlot returnValue) {
@@ -349,6 +357,9 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
349357
case Builtin::BI__builtin_unreachable:
350358
emitUnreachable(e->getExprLoc(), /*createNewBlock=*/true);
351359
return RValue::get(nullptr);
360+
361+
case Builtin::BI__builtin_elementwise_acos:
362+
return emitUnaryFPBuiltin<cir::ACosOp>(*this, *e);
352363
}
353364

354365
// If this is an alias for a lib function (e.g. __builtin_sin), emit

0 commit comments

Comments
 (0)