Skip to content

Commit 5704061

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3244)
2 parents b6927bc + 1532cb5 commit 5704061

File tree

129 files changed

+2183
-2107
lines changed

Some content is hidden

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

129 files changed

+2183
-2107
lines changed

.github/workflows/premerge.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ jobs:
8888
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8989
with:
9090
fetch-depth: 2
91-
- name: Setup ccache
92-
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
93-
with:
94-
variant: "sccache"
95-
max-size: "2000M"
9691
- name: Compute Projects
9792
id: vars
9893
run: |
@@ -115,7 +110,7 @@ jobs:
115110
shell: cmd
116111
run: |
117112
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
118-
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
113+
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
119114
- name: Upload Artifacts
120115
if: '!cancelled()'
121116
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

clang/docs/LanguageExtensions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,14 @@ of different sizes and signs is forbidden in binary and ternary builtins.
848848
semantics, see `LangRef
849849
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
850850
for the comparison.
851+
T __builtin_elementwise_maximumnum(T x, T y) return x or y, whichever is larger. Follows IEEE 754-2019 floating point types
852+
semantics, see `LangRef
853+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
854+
for the comparison.
855+
T __builtin_elementwise_minimumnum(T x, T y) return x or y, whichever is smaller. Follows IEEE 754-2019 floating point types
856+
semantics, see `LangRef
857+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
858+
for the comparison.
851859
============================================== ====================================================================== =========================================
852860

853861

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ Non-comprehensive list of changes in this release
344344
- Added `__builtin_elementwise_exp10`.
345345
- For AMDPGU targets, added `__builtin_v_cvt_off_f32_i4` that maps to the `v_cvt_off_f32_i4` instruction.
346346
- Added `__builtin_elementwise_minnum` and `__builtin_elementwise_maxnum`.
347+
- Added `__builtin_elementwise_minnumnum` and `__builtin_elementwise_maxnumnum`.
347348
- No longer crashing on invalid Objective-C categories and extensions when
348349
dumping the AST as JSON. (#GH137320)
349350
- Clang itself now uses split stacks instead of threads for allocating more
@@ -830,6 +831,8 @@ Bug Fixes in This Version
830831
- Fixed a failed assertion with an operator call expression which comes from a
831832
macro expansion when performing analysis for nullability attributes. (#GH138371)
832833
- Fixed a concept equivalent checking crash due to untransformed constraint expressions. (#GH146614)
834+
- Fixed a crash in `clang-scan-deps` when a module with the same name is found
835+
in different locations (#GH134404, #GH146976).
833836
- Fix a crash when marco name is empty in ``#pragma push_macro("")`` or
834837
``#pragma pop_macro("")``. (GH149762).
835838

clang/include/clang/Basic/Builtins.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,18 @@ def ElementwiseMinimum : Builtin {
13341334
let Prototype = "void(...)";
13351335
}
13361336

1337+
def ElementwiseMaximumNum : Builtin {
1338+
let Spellings = ["__builtin_elementwise_maximumnum"];
1339+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1340+
let Prototype = "void(...)";
1341+
}
1342+
1343+
def ElementwiseMinimumNum : Builtin {
1344+
let Spellings = ["__builtin_elementwise_minimumnum"];
1345+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1346+
let Prototype = "void(...)";
1347+
}
1348+
13371349
def ElementwiseCeil : Builtin {
13381350
let Spellings = ["__builtin_elementwise_ceil"];
13391351
let Attributes = [NoThrow, Const, CustomTypeChecking];

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ CODEGENOPT(SpeculativeLoadHardening, 1, 0, Benign) ///< Enable speculative load
313313
CODEGENOPT(FineGrainedBitfieldAccesses, 1, 0, Benign) ///< Enable fine-grained bitfield accesses.
314314
CODEGENOPT(StrictEnums , 1, 0, Benign) ///< Optimize based on strict enum definition.
315315
CODEGENOPT(StrictVTablePointers, 1, 0, Benign) ///< Optimize based on the strict vtable pointers
316-
CODEGENOPT(TimePasses , 1, 0, Benign) ///< Set when -ftime-report or -ftime-report= or -ftime-report-json is enabled.
316+
CODEGENOPT(TimePasses , 1, 0, Benign) ///< Set when -ftime-report, -ftime-report=, -ftime-report-json, or -stats-file-timers is enabled.
317317
CODEGENOPT(TimePassesPerRun , 1, 0, Benign) ///< Set when -ftime-report=per-pass-run is enabled.
318318
CODEGENOPT(TimePassesJson , 1, 0, Benign) ///< Set when -ftime-report-json is enabled.
319+
CODEGENOPT(TimePassesStatsFile , 1, 0, Benign) ///< Set when -stats-file-timers is enabled.
319320
CODEGENOPT(TimeTrace , 1, 0, Benign) ///< Set when -ftime-trace is enabled.
320321
VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500, Benign) ///< Minimum time granularity (in microseconds),
321322
///< traced by time profiler

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8439,6 +8439,9 @@ def stats_file : Joined<["-"], "stats-file=">,
84398439
def stats_file_append : Flag<["-"], "stats-file-append">,
84408440
HelpText<"If stats should be appended to stats-file instead of overwriting it">,
84418441
MarshallingInfoFlag<FrontendOpts<"AppendStats">>;
8442+
def stats_file_timers : Flag<["-"], "stats-file-timers">,
8443+
HelpText<"If stats should include timers.">,
8444+
MarshallingInfoFlag<CodeGenOpts<"TimePassesStatsFile">>;
84428445
def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">,
84438446
HelpText<"Dump record layout information in a simple form used for testing">,
84448447
MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsSimple">>;

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ using APSInt = llvm::APSInt;
2525
namespace clang {
2626
namespace interp {
2727

28+
static bool hasTrivialDefaultCtorParent(const FieldDecl *FD) {
29+
assert(FD);
30+
assert(FD->getParent()->isUnion());
31+
const auto *CXXRD = dyn_cast<CXXRecordDecl>(FD->getParent());
32+
return !CXXRD || CXXRD->hasTrivialDefaultConstructor();
33+
}
34+
2835
static bool refersToUnion(const Expr *E) {
2936
for (;;) {
3037
if (const auto *ME = dyn_cast<MemberExpr>(E)) {
3138
if (const auto *FD = dyn_cast<FieldDecl>(ME->getMemberDecl());
32-
FD && FD->getParent()->isUnion())
39+
FD && FD->getParent()->isUnion() && hasTrivialDefaultCtorParent(FD))
3340
return true;
3441
E = ME->getBase();
3542
continue;

clang/lib/Basic/TargetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : Triple(T) {
172172
ComplexLongDoubleUsesFP2Ret = false;
173173

174174
// Set the C++ ABI based on the triple.
175-
TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment()
175+
TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment() || Triple.isUEFI()
176176
? TargetCXXABI::Microsoft
177177
: TargetCXXABI::GenericItanium);
178178

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,6 +4108,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
41084108
return RValue::get(Result);
41094109
}
41104110

4111+
case Builtin::BI__builtin_elementwise_maximumnum: {
4112+
Value *Op0 = EmitScalarExpr(E->getArg(0));
4113+
Value *Op1 = EmitScalarExpr(E->getArg(1));
4114+
Value *Result = Builder.CreateBinaryIntrinsic(
4115+
Intrinsic::maximumnum, Op0, Op1, nullptr, "elt.maximumnum");
4116+
return RValue::get(Result);
4117+
}
4118+
4119+
case Builtin::BI__builtin_elementwise_minimumnum: {
4120+
Value *Op0 = EmitScalarExpr(E->getArg(0));
4121+
Value *Op1 = EmitScalarExpr(E->getArg(1));
4122+
Value *Result = Builder.CreateBinaryIntrinsic(
4123+
Intrinsic::minimumnum, Op0, Op1, nullptr, "elt.minimumnum");
4124+
return RValue::get(Result);
4125+
}
4126+
41114127
case Builtin::BI__builtin_reduce_max: {
41124128
auto GetIntrinsicID = [this](QualType QT) {
41134129
if (auto *VecTy = QT->getAs<VectorType>())

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ inferOffloadToolchains(Compilation &C, Action::OffloadKind Kind) {
10161016
C.getArgs().MakeArgString(Triple.split("-").first),
10171017
C.getArgs().MakeArgString("--offload-arch=" + Arch));
10181018
C.getArgs().append(A);
1019+
C.getArgs().AddSynthesizedArg(A);
10191020
Triples.insert(Triple);
10201021
}
10211022

0 commit comments

Comments
 (0)