Skip to content

Commit f4496f8

Browse files
authored
merge main into amd-staging (llvm#2169)
2 parents 3dfd087 + 06ff789 commit f4496f8

File tree

189 files changed

+5725
-3523
lines changed

Some content is hidden

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

189 files changed

+5725
-3523
lines changed

bolt/test/X86/callcont-fallthru.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# RUN: %clangxx %cxxflags %s %t.so -o %t -Wl,-q -nostdlib
77
# RUN: link_fdata %s %t %t.pat PREAGGT1
88
# RUN: link_fdata %s %t %t.pat2 PREAGGT2
9-
# RUN: link_fdata %s %t %t.patplt PREAGGPLT
9+
# DONTRUN: link_fdata %s %t %t.patplt PREAGGPLT
1010

1111
# RUN: llvm-strip --strip-unneeded %t -o %t.strip
1212
# RUN: llvm-objcopy --remove-section=.eh_frame %t.strip %t.noeh
@@ -26,8 +26,8 @@
2626

2727
## Check pre-aggregated traces don't report zero-sized PLT fall-through as
2828
## invalid trace
29-
# RUN: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
30-
# RUN: --check-prefix=CHECK-PLT
29+
# DONTRUN: llvm-bolt %t.strip --pa -p %t.patplt -o %t.out | FileCheck %s \
30+
# DONTRUN: --check-prefix=CHECK-PLT
3131
# CHECK-PLT: traces mismatching disassembled function contents: 0
3232

3333
.globl foo

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ Improvements to Clang's diagnostics
536536
- Several compatibility diagnostics that were incorrectly being grouped under
537537
``-Wpre-c++20-compat`` are now part of ``-Wc++20-compat``. (#GH138775)
538538

539-
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
539+
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
540540
The warning message for non-overlapping cases has also been improved (#GH13473).
541541

542542
- Fixed a duplicate diagnostic when performing typo correction on function template
543543
calls with explicit template arguments. (#GH139226)
544-
544+
545545
- Explanatory note is printed when ``assert`` fails during evaluation of a
546546
constant expression. Prior to this, the error inaccurately implied that assert
547547
could not be used at all in a constant expression (#GH130458)
@@ -725,6 +725,7 @@ Bug Fixes to C++ Support
725725
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
726726
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
727727
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
728+
- Clang no longer segfaults when there is a configuration mismatch between modules and their users (http://crbug.com/400353616).
728729

729730
Bug Fixes to AST Handling
730731
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,6 +4819,12 @@ def HLSLResourceHandleFromBinding : LangBuiltin<"HLSL_LANG"> {
48194819
let Prototype = "void(...)";
48204820
}
48214821

4822+
def HLSLResourceHandleFromImplicitBinding : LangBuiltin<"HLSL_LANG"> {
4823+
let Spellings = ["__builtin_hlsl_resource_handlefromimplicitbinding"];
4824+
let Attributes = [NoThrow];
4825+
let Prototype = "void(...)";
4826+
}
4827+
48224828
def HLSLAll : LangBuiltin<"HLSL_LANG"> {
48234829
let Spellings = ["__builtin_hlsl_all"];
48244830
let Attributes = [NoThrow, Const];

clang/include/clang/Basic/Module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ class VisibleModuleSet {
888888

889889
/// Get the location at which the import of a module was triggered.
890890
SourceLocation getImportLoc(const Module *M) const {
891-
return M->getVisibilityID() < ImportLocs.size()
891+
return M && M->getVisibilityID() < ImportLocs.size()
892892
? ImportLocs[M->getVisibilityID()]
893893
: SourceLocation();
894894
}

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,20 @@ class SemaHLSL : public SemaBase {
175175
// buffer which will be created at the end of the translation unit.
176176
llvm::SmallVector<Decl *> DefaultCBufferDecls;
177177

178+
uint32_t ImplicitBindingNextOrderID = 0;
179+
178180
private:
179181
void collectResourceBindingsOnVarDecl(VarDecl *D);
180182
void collectResourceBindingsOnUserRecordDecl(const VarDecl *VD,
181183
const RecordType *RT);
182184
void processExplicitBindingsOnDecl(VarDecl *D);
183185

184186
void diagnoseAvailabilityViolations(TranslationUnitDecl *TU);
187+
188+
bool initGlobalResourceDecl(VarDecl *VD);
189+
uint32_t getNextImplicitBindingOrderID() {
190+
return ImplicitBindingNextOrderID++;
191+
}
185192
};
186193

187194
} // namespace clang

clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ class SMTConstraintManager : public clang::ento::SimpleConstraintManager {
301301
llvm_unreachable("Unsupported expression to reason about!");
302302
}
303303

304+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
304305
/// Dumps SMT formula
305306
LLVM_DUMP_METHOD void dump() const { Solver->dump(); }
307+
#endif
306308

307309
protected:
308310
// Check whether a new model is satisfiable, and update the program state.

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,8 +6113,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
61136113
case Builtin::BI__builtin_thread_pointer: {
61146114
if (!getContext().getTargetInfo().isTLSSupported())
61156115
CGM.ErrorUnsupported(E, "__builtin_thread_pointer");
6116-
// Fall through - it's already mapped to the intrinsic by ClangBuiltin.
6117-
break;
6116+
6117+
return RValue::get(Builder.CreateIntrinsic(llvm::Intrinsic::thread_pointer,
6118+
{GlobalsInt8PtrTy}, {}));
61186119
}
61196120
case Builtin::BI__builtin_os_log_format:
61206121
return emitBuiltinOSLogFormat(*E);

clang/lib/CodeGen/CGHLSLBuiltins.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,21 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
303303
HandleTy, CGM.getHLSLRuntime().getCreateHandleFromBindingIntrinsic(),
304304
ArrayRef<Value *>{SpaceOp, RegisterOp, RangeOp, IndexOp, NonUniform});
305305
}
306+
case Builtin::BI__builtin_hlsl_resource_handlefromimplicitbinding: {
307+
llvm::Type *HandleTy = CGM.getTypes().ConvertType(E->getType());
308+
Value *SpaceOp = EmitScalarExpr(E->getArg(1));
309+
Value *RangeOp = EmitScalarExpr(E->getArg(2));
310+
Value *IndexOp = EmitScalarExpr(E->getArg(3));
311+
Value *OrderID = EmitScalarExpr(E->getArg(4));
312+
// FIXME: NonUniformResourceIndex bit is not yet implemented
313+
// (llvm/llvm-project#135452)
314+
Value *NonUniform =
315+
llvm::ConstantInt::get(llvm::Type::getInt1Ty(getLLVMContext()), false);
316+
return Builder.CreateIntrinsic(
317+
HandleTy,
318+
CGM.getHLSLRuntime().getCreateHandleFromImplicitBindingIntrinsic(),
319+
ArrayRef<Value *>{OrderID, SpaceOp, RangeOp, IndexOp, NonUniform});
320+
}
306321
case Builtin::BI__builtin_hlsl_all: {
307322
Value *Op0 = EmitScalarExpr(E->getArg(0));
308323
return Builder.CreateIntrinsic(

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class CGHLSLRuntime {
119119
resource_getpointer)
120120
GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromBinding,
121121
resource_handlefrombinding)
122+
GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromImplicitBinding,
123+
resource_handlefromimplicitbinding)
122124
GENERATE_HLSL_INTRINSIC_FUNCTION(BufferUpdateCounter, resource_updatecounter)
123125
GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync,
124126
group_memory_barrier_with_group_sync)

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
16931693

16941694
const llvm::Triple &TT = CGM.getTriple();
16951695
const auto &CGOpts = CGM.getCodeGenOpts();
1696-
if (TT.isWindowsGNUEnvironment()) {
1696+
if (TT.isOSCygMing()) {
16971697
// In MinGW, variables without DLLImport can still be automatically
16981698
// imported from a DLL by the linker; don't mark variables that
16991699
// potentially could come from another DLL as DSO local.

0 commit comments

Comments
 (0)