Skip to content

Commit 6f68ba5

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:6e14d75f548e into amd-gfx:69bd3d5dbfaf
Local branch amd-gfx 69bd3d5 Merged main:34929853bc39 into amd-gfx:b0d0d197e7c8 Remote branch main 6e14d75 [RISCV] Fix some implicit conversions from Register to unsigned. NFC
2 parents 69bd3d5 + 6e14d75 commit 6f68ba5

File tree

246 files changed

+10835
-2345
lines changed

Some content is hidden

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

246 files changed

+10835
-2345
lines changed

bolt/test/AArch64/exceptions-plt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
// REQUIRES: system-linux
44

5-
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s -o %t.exe
5+
// RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
6+
// Link against a DSO to ensure PLT entries.
7+
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s %t.so -o %t.exe
68
// RUN: llvm-bolt %t.exe -o %t.bolt.exe --plt=all --print-only=.*main.* \
79
// RUN: --print-finalized 2>&1 | FileCheck %s
810

bolt/test/AArch64/plt-call.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Verify that PLTCall optimization works.
22

3-
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c \
3+
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
4+
// Link against a DSO to ensure PLT entries.
5+
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c %t.so \
46
RUN: -o %t -Wl,-q
57
RUN: llvm-bolt %t -o %t.bolt --plt=all --print-plt --print-only=foo | FileCheck %s
68

bolt/test/X86/callcont-fallthru.s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## Ensures that a call continuation fallthrough count is set when using
22
## pre-aggregated perf data.
33

4-
# RUN: %clangxx %cxxflags %s -o %t -Wl,-q -nostdlib
4+
# RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
5+
## Link against a DSO to ensure PLT entries.
6+
# RUN: %clangxx %cxxflags %s %t.so -o %t -Wl,-q -nostdlib
57
# RUN: link_fdata %s %t %t.pa1 PREAGG
68
# RUN: link_fdata %s %t %t.pa2 PREAGG2
79
# RUN: link_fdata %s %t %t.pa3 PREAGG3

bolt/test/X86/cfi-instrs-reordered.s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
55
# RUN: llvm-strip --strip-unneeded %t.o
6-
# RUN: %clangxx %cflags %t.o -o %t.exe
6+
# RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
7+
## Link against a DSO to ensure PLT entries.
8+
# RUN: %clangxx %cflags %t.o %t.so -o %t.exe
79
# RUN: llvm-bolt %t.exe -o %t --reorder-blocks=cache --print-after-lowering \
810
# RUN: --print-only=_Z10SolveCubicddddPiPd 2>&1 | FileCheck %s
911
#

bolt/test/X86/plt-call.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Verify that PLTCall optimization works.
22

3-
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c \
3+
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
4+
// Link against a DSO to ensure PLT entries.
5+
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c %t.so \
46
RUN: -o %t -Wl,-q
57
RUN: llvm-bolt %t -o %t.bolt --plt=all --print-plt --print-only=foo | FileCheck %s
68

bolt/test/runtime/exceptions-plt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
// REQUIRES: system-linux
44

5-
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s -o %t.exe
5+
// RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
6+
// Link against a DSO to ensure PLT entries.
7+
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s %t.so -o %t.exe
68
// RUN: llvm-bolt %t.exe -o %t.bolt.exe --plt=all
79
// RUN: %t.bolt.exe
810

bolt/test/runtime/plt-lld.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// This test checks that the pointers to PLT are properly updated.
2-
// The test is using lld linker.
2+
// The test uses lld and links against a DSO to ensure PLT entries.
3+
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
34

45
// Non-PIE:
5-
RUN: %clang %cflags -no-pie %p/../Inputs/plt.c -fuse-ld=lld \
6+
RUN: %clang %cflags -no-pie %p/../Inputs/plt.c %t.so -fuse-ld=lld \
67
RUN: -o %t.lld.exe -Wl,-q
78
RUN: llvm-bolt %t.lld.exe -o %t.lld.bolt.exe --use-old-text=0 --lite=0
89
RUN: %t.lld.bolt.exe | FileCheck %s
910

1011
// PIE:
11-
RUN: %clang %cflags -fPIC -pie %p/../Inputs/plt.c -fuse-ld=lld \
12+
RUN: %clang %cflags -fPIC -pie %p/../Inputs/plt.c %t.so -fuse-ld=lld \
1213
RUN: -o %t.lld.pie.exe -Wl,-q
1314
RUN: llvm-bolt %t.lld.pie.exe -o %t.lld.bolt.pie.exe --use-old-text=0 --lite=0
1415
RUN: %t.lld.bolt.pie.exe | FileCheck %s

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ Static Analyzer
243243
New features
244244
^^^^^^^^^^^^
245245

246+
A new flag - `-static-libclosure` was introduced to support statically linking
247+
the runtime for the Blocks extension on Windows. This flag currently only
248+
changes the code generation, and even then, only on Windows. This does not
249+
impact the linker behaviour like the other `-static-*` flags.
250+
246251
Crash and bug fixes
247252
^^^^^^^^^^^^^^^^^^^
248253

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ CODEGENOPT(CtorDtorReturnThis, 1, 0)
469469
/// by the Windows kernel to enable import call optimization.
470470
CODEGENOPT(ImportCallOptimization, 1, 0)
471471

472+
/// Controls whether we generate code for static linking of libclosure
473+
/// (BlocksRuntime) on Windows.
474+
CODEGENOPT(StaticClosure, 1, 0)
475+
472476
/// FIXME: Make DebugOptions its own top-level .def file.
473477
#include "DebugOptions.def"
474478

clang/include/clang/Basic/OpenMPKinds.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,14 @@ bool isOpenMPInformationalDirective(OpenMPDirectiveKind DKind);
399399
/// \return true - if the above condition is met for this directive
400400
/// otherwise - false.
401401
bool isOpenMPCapturingDirective(OpenMPDirectiveKind DKind);
402+
403+
/// Checks if the specified directive is an order concurrent nestable
404+
/// directive that can be nested within region corresponding to construct
405+
/// on which order clause was specified with concurrent as ordering argument.
406+
/// \param DKind Specified directive.
407+
/// \return true - if the above condition is met for this directive
408+
/// otherwise - false.
409+
bool isOpenMPOrderConcurrentNestableDirective(OpenMPDirectiveKind DKind);
402410
}
403411

404412
template <>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//===- CIRAttrVisitor.h - Visitor for CIR attributes ------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file defines the CirAttrVisitor interface.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRVISITOR_H
14+
#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRVISITOR_H
15+
16+
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
17+
18+
namespace cir {
19+
20+
template <typename ImplClass, typename RetTy> class CirAttrVisitor {
21+
public:
22+
// FIXME: Create a TableGen list to automatically handle new attributes
23+
RetTy visit(mlir::Attribute attr) {
24+
if (const auto intAttr = mlir::dyn_cast<cir::IntAttr>(attr))
25+
return getImpl().visitCirIntAttr(intAttr);
26+
if (const auto fltAttr = mlir::dyn_cast<cir::FPAttr>(attr))
27+
return getImpl().visitCirFPAttr(fltAttr);
28+
if (const auto ptrAttr = mlir::dyn_cast<cir::ConstPtrAttr>(attr))
29+
return getImpl().visitCirConstPtrAttr(ptrAttr);
30+
llvm_unreachable("unhandled attribute type");
31+
}
32+
33+
// If the implementation chooses not to implement a certain visit
34+
// method, fall back to the parent.
35+
RetTy visitCirIntAttr(cir::IntAttr attr) {
36+
return getImpl().visitCirAttr(attr);
37+
}
38+
RetTy visitCirFPAttr(cir::FPAttr attr) {
39+
return getImpl().visitCirAttr(attr);
40+
}
41+
RetTy visitCirConstPtrAttr(cir::ConstPtrAttr attr) {
42+
return getImpl().visitCirAttr(attr);
43+
}
44+
45+
RetTy visitCirAttr(mlir::Attribute attr) { return RetTy(); }
46+
47+
ImplClass &getImpl() { return *static_cast<ImplClass *>(this); }
48+
};
49+
50+
} // namespace cir
51+
52+
#endif // LLVM_CLANG_CIR_DIALECT_IR_CIRATTRVISITOR_H

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ struct MissingFeatures {
2727
// Address space related
2828
static bool addressSpace() { return false; }
2929

30+
// This isn't needed until we add support for bools.
31+
static bool convertTypeForMemory() { return false; }
32+
3033
// Unhandled global/linkage information.
3134
static bool opGlobalDSOLocal() { return false; }
3235
static bool opGlobalThreadLocal() { return false; }

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5827,6 +5827,9 @@ def start_no_unused_arguments : Flag<["--"], "start-no-unused-arguments">,
58275827
HelpText<"Don't emit warnings about unused arguments for the following arguments">;
58285828
def static_libgcc : Flag<["-"], "static-libgcc">;
58295829
def static_libstdcxx : Flag<["-"], "static-libstdc++">;
5830+
def static_libclosure : Flag<["-"], "static-libclosure">,
5831+
Visibility<[ClangOption, CC1Option]>,
5832+
HelpText<"Generate code for statically linking libclosure (BlocksRuntime)">;
58305833
def static : Flag<["-", "--"], "static">, Group<Link_Group>,
58315834
Visibility<[ClangOption, FlangOption]>,
58325835
Flags<[NoArgumentUnused]>;

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ class SemaHLSL : public SemaBase {
160160
ResourceBindings Bindings;
161161

162162
private:
163-
void collectResourcesOnVarDecl(VarDecl *D);
164-
void collectResourcesOnUserRecordDecl(const VarDecl *VD,
165-
const RecordType *RT);
163+
void collectResourceBindingsOnVarDecl(VarDecl *D);
164+
void collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
165+
const RecordType *RT);
166166
void processExplicitBindingsOnDecl(VarDecl *D);
167167
};
168168

clang/lib/Basic/OpenMPKinds.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,12 @@ bool clang::isOpenMPCapturingDirective(OpenMPDirectiveKind DKind) {
765765
return false;
766766
}
767767

768+
bool clang::isOpenMPOrderConcurrentNestableDirective(
769+
OpenMPDirectiveKind DKind) {
770+
return DKind == OMPD_atomic || DKind == OMPD_loop || DKind == OMPD_simd ||
771+
DKind == OMPD_parallel || isOpenMPLoopTransformationDirective(DKind);
772+
}
773+
768774
void clang::getOpenMPCaptureRegions(
769775
SmallVectorImpl<OpenMPDirectiveKind> &CaptureRegions,
770776
OpenMPDirectiveKind DKind) {

0 commit comments

Comments
 (0)