Skip to content

Commit 1702651

Browse files
committed
Merge remote-tracking branch 'origin/main' into wide-iv-step
2 parents 84af6da + 95d526f commit 1702651

File tree

170 files changed

+3407
-1459
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

+3407
-1459
lines changed

.github/workflows/premerge.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ jobs:
6565
export CXX=/opt/llvm/bin/clang++
6666
6767
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}"
68+
- name: "Upload artifact"
69+
- name: Upload Artifacts
70+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
71+
with:
72+
name: Premerge Artifacts
73+
path: artifacts/
74+
retention-days: 5
75+
include-hidden-files: 'true'
6876

6977
premerge-checks-windows:
7078
name: Windows Premerge Checks (Test Only - Please Ignore Results)
@@ -113,6 +121,13 @@ jobs:
113121
set MAX_PARALLEL_LINK_JOBS=64
114122
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
115123
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
124+
- name: Upload Artifacts
125+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
126+
with:
127+
name: Premerge Artifacts
128+
path: artifacts/
129+
retention-days: 5
130+
include-hidden-files: 'true'
116131

117132
premerge-check-macos:
118133
name: MacOS Premerge Checks

clang-tools-extra/clangd/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ if (CLANGD_ENABLE_REMOTE)
210210
include(AddGRPC)
211211
endif()
212212

213+
option(CLANGD_BUILD_DEXP "Build the dexp tool as part of Clangd" ON)
214+
llvm_canonicalize_cmake_booleans(CLANGD_BUILD_DEXP)
215+
213216
if(CLANG_INCLUDE_TESTS)
214217
add_subdirectory(test)
215218
add_subdirectory(unittests)
@@ -220,4 +223,7 @@ option(CLANGD_ENABLE_REMOTE "Use gRPC library to enable remote index support for
220223
set(GRPC_INSTALL_PATH "" CACHE PATH "Path to gRPC library manual installation.")
221224

222225
add_subdirectory(index/remote)
223-
add_subdirectory(index/dex/dexp)
226+
227+
if(CLANGD_BUILD_DEXP)
228+
add_subdirectory(index/dex/dexp)
229+
endif()

clang-tools-extra/clangd/test/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ set(CLANGD_TEST_DEPS
33
ClangdTests
44
clangd-indexer
55
split-file
6-
# No tests for it, but we should still make sure they build.
7-
dexp
86
)
97

108
if(CLANGD_BUILD_XPC)
119
list(APPEND CLANGD_TEST_DEPS clangd-xpc-test-client)
1210
list(APPEND CLANGD_TEST_DEPS ClangdXpcUnitTests)
1311
endif()
1412

13+
if(CLANGD_BUILD_DEXP)
14+
# No tests for it, but we should still make sure they build.
15+
list(APPEND CLANGD_TEST_DEPS dexp)
16+
endif()
17+
1518
if(CLANGD_ENABLE_REMOTE)
1619
list(APPEND CLANGD_TEST_DEPS clangd-index-server clangd-index-server-monitor)
1720
endif()

clang-tools-extra/clangd/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@"
1515
config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.."
1616
config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.."
1717
config.clangd_build_xpc = @CLANGD_BUILD_XPC@
18+
config.clangd_build_dexp = @CLANGD_BUILD_DEXP@
1819
config.clangd_enable_remote = @CLANGD_ENABLE_REMOTE@
1920
config.clangd_tidy_checks = @CLANGD_TIDY_CHECKS@
2021
config.have_zlib = @LLVM_ENABLE_ZLIB@

clang/docs/LanguageExtensions.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,23 @@ of different sizes and signs is forbidden in binary and ternary builtins.
818818
T __builtin_elementwise_fmod(T x, T y) return The floating-point remainder of (x/y) whose sign floating point types
819819
matches the sign of x.
820820
T __builtin_elementwise_max(T x, T y) return x or y, whichever is larger integer and floating point types
821+
For floating point types, follows semantics of maxNum
822+
in IEEE 754-2008. See `LangRef
823+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
824+
for the comparison.
821825
T __builtin_elementwise_min(T x, T y) return x or y, whichever is smaller integer and floating point types
826+
For floating point types, follows semantics of minNum
827+
in IEEE 754-2008. See `LangRef
828+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
829+
for the comparison.
830+
T __builtin_elementwise_maxnum(T x, T y) return x or y, whichever is larger. Follows IEEE 754-2008 floating point types
831+
semantics (maxNum) with +0.0>-0.0. See `LangRef
832+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
833+
for the comparison.
834+
T __builtin_elementwise_minnum(T x, T y) return x or y, whichever is smaller. Follows IEEE 754-2008 floating point types
835+
semantics (minNum) with +0.0>-0.0. See `LangRef
836+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
837+
for the comparison.
822838
T __builtin_elementwise_add_sat(T x, T y) return the sum of x and y, clamped to the range of integer types
823839
representable values for the signed/unsigned integer type.
824840
T __builtin_elementwise_sub_sat(T x, T y) return the difference of x and y, clamped to the range of integer types

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Potentially Breaking Changes
3838
- Fix missing diagnostics for uses of declarations when performing typename access,
3939
such as when performing member access on a '[[deprecated]]' type alias.
4040
(#GH58547)
41+
- For ARM targets when compiling assembly files, the features included in the selected CPU
42+
or Architecture's FPU are included. If you wish not to use a specific feature,
43+
the relevant ``+no`` option will need to be amended to the command line option.
4144

4245
C/C++ Language Potentially Breaking Changes
4346
-------------------------------------------
@@ -191,6 +194,7 @@ Non-comprehensive list of changes in this release
191194
- Support parsing the `cc` operand modifier and alias it to the `c` modifier (#GH127719).
192195
- Added `__builtin_elementwise_exp10`.
193196
- For AMDPGU targets, added `__builtin_v_cvt_off_f32_i4` that maps to the `v_cvt_off_f32_i4` instruction.
197+
- Added `__builtin_elementwise_minnum` and `__builtin_elementwise_maxnum`.
194198

195199
New Compiler Flags
196200
------------------
@@ -511,6 +515,7 @@ X86 Support
511515

512516
Arm and AArch64 Support
513517
^^^^^^^^^^^^^^^^^^^^^^^
518+
- For ARM targets, cc1as now considers the FPU's features for the selected CPU or Architecture.
514519

515520
Android Support
516521
^^^^^^^^^^^^^^^

clang/include/clang/Basic/Builtins.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,18 @@ def ElementwiseMin : Builtin {
13041304
let Prototype = "void(...)";
13051305
}
13061306

1307+
def ElementwiseMaxNum : Builtin {
1308+
let Spellings = ["__builtin_elementwise_maxnum"];
1309+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1310+
let Prototype = "void(...)";
1311+
}
1312+
1313+
def ElementwiseMinNum : Builtin {
1314+
let Spellings = ["__builtin_elementwise_minnum"];
1315+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1316+
let Prototype = "void(...)";
1317+
}
1318+
13071319
def ElementwiseMaximum : Builtin {
13081320
let Spellings = ["__builtin_elementwise_maximum"];
13091321
let Attributes = [NoThrow, Const, CustomTypeChecking];

clang/include/clang/Support/RISCVVIntrinsicUtils.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "llvm/ADT/ArrayRef.h"
1313
#include "llvm/ADT/BitmaskEnum.h"
14+
#include "llvm/ADT/Bitset.h"
1415
#include "llvm/ADT/SmallVector.h"
1516
#include "llvm/ADT/StringRef.h"
1617
#include <cstdint>
@@ -376,6 +377,8 @@ enum PolicyScheme : uint8_t {
376377
HasPolicyOperand,
377378
};
378379

380+
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, enum PolicyScheme PS);
381+
379382
// TODO refactor RVVIntrinsic class design after support all intrinsic
380383
// combination. This represents an instantiation of an intrinsic with a
381384
// particular type and prototype
@@ -507,6 +510,23 @@ enum RVVRequire {
507510
RVV_REQ_NUM,
508511
};
509512

513+
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, enum RVVRequire Require);
514+
515+
struct RequiredExtensionBits {
516+
llvm::Bitset<RVV_REQ_NUM> Bits;
517+
RequiredExtensionBits() {}
518+
RequiredExtensionBits(std::initializer_list<RVVRequire> Init) {
519+
for (auto I : Init)
520+
Bits.set(I);
521+
}
522+
523+
void set(unsigned I) { Bits.set(I); }
524+
bool operator[](unsigned I) const { return Bits[I]; }
525+
};
526+
527+
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
528+
const RequiredExtensionBits &Exts);
529+
510530
// Raw RVV intrinsic info, used to expand later.
511531
// This struct is highly compact for minimized code size.
512532
struct RVVIntrinsicRecord {
@@ -518,7 +538,7 @@ struct RVVIntrinsicRecord {
518538
const char *OverloadedName;
519539

520540
// Required target features for this intrinsic.
521-
uint32_t RequiredExtensions[(RVV_REQ_NUM + 31) / 32];
541+
RequiredExtensionBits RequiredExtensions;
522542

523543
// Prototype for this intrinsic, index of RVVSignatureTable.
524544
uint16_t PrototypeIndex;

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ bool isConstexprUnknown(const Pointer &P) {
307307
if (P.isDummy())
308308
return false;
309309
const VarDecl *VD = P.block()->getDescriptor()->asVarDecl();
310-
return VD && VD->hasLocalStorage();
310+
return VD && VD->hasLocalStorage() && !isa<ParmVarDecl>(VD);
311311
}
312312

313313
bool CheckBCPResult(InterpState &S, const Pointer &Ptr) {

clang/lib/AST/ByteCode/Interp.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,11 @@ bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
771771
bool CanOverflow) {
772772
assert(!Ptr.isDummy());
773773

774+
if (!S.inConstantContext()) {
775+
if (isConstexprUnknown(Ptr))
776+
return false;
777+
}
778+
774779
if constexpr (std::is_same_v<T, Boolean>) {
775780
if (!S.getLangOpts().CPlusPlus14)
776781
return Invalid(S, OpPC);

0 commit comments

Comments
 (0)