Skip to content

Commit 558c68f

Browse files
committed
merge main into amd-staging
2 parents b638f55 + bad1a88 commit 558c68f

File tree

119 files changed

+2525
-904
lines changed

Some content is hidden

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

119 files changed

+2525
-904
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp @nikic
2929
/llvm/lib/Transforms/InstCombine/ @nikic
3030

31+
# AMDGPU buffer pointer lowerings
32+
/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp @krzysz00
33+
3134
/clang/test/CXX/drs/ @Endilll
3235
/clang/www/cxx_dr_status.html @Endilll
3336
/clang/www/make_cxx_dr_status @Endilll

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ class BinaryContext {
11131113
return FragmentClasses.isEquivalent(LHS, RHS);
11141114
}
11151115

1116-
/// Add interprocedural reference for \p Function to \p Address
1116+
/// Add interprocedural branch reference from \p Function to \p Address.
11171117
void addInterproceduralReference(BinaryFunction *Function, uint64_t Address) {
11181118
InterproceduralReferences.push_back({Function, Address});
11191119
}
@@ -1128,7 +1128,8 @@ class BinaryContext {
11281128
/// argument is false.
11291129
bool handleAArch64Veneer(uint64_t Address, bool MatchOnly = false);
11301130

1131-
/// Resolve inter-procedural dependencies from
1131+
/// Resolve inter-procedural branch dependencies discovered during
1132+
/// disassembly.
11321133
void processInterproceduralReferences();
11331134

11341135
/// Skip functions with all parent and child fragments transitively.

bolt/lib/Core/BinaryContext.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,6 @@ void BinaryContext::processInterproceduralReferences() {
14381438
continue;
14391439
}
14401440

1441-
// Check if address falls in function padding space - this could be
1442-
// unmarked data in code. In this case adjust the padding space size.
14431441
ErrorOr<BinarySection &> Section = getSectionForAddress(Address);
14441442
assert(Section && "cannot get section for referenced address");
14451443

@@ -1451,7 +1449,7 @@ void BinaryContext::processInterproceduralReferences() {
14511449
if (SectionName == ".plt" || SectionName == ".plt.got")
14521450
continue;
14531451

1454-
// Check if it is aarch64 veneer written at Address
1452+
// Check if it is aarch64 veneer written at Address.
14551453
if (isAArch64() && handleAArch64Veneer(Address))
14561454
continue;
14571455

@@ -1463,6 +1461,8 @@ void BinaryContext::processInterproceduralReferences() {
14631461
exit(1);
14641462
}
14651463

1464+
// Check if the address falls into the function padding space - this could
1465+
// be an unmarked data in code. In this case, adjust the padding space size.
14661466
TargetFunction = getBinaryFunctionContainingAddress(Address,
14671467
/*CheckPastEnd=*/false,
14681468
/*UseMaxSize=*/true);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// UNSUPPORTED: system-windows
22

3-
// RUN: clang-tidy -p %S/Inputs/empty-database %s 2>&1 | FileCheck %s
3+
// RUN: clang-tidy -checks='-*,clang-analyzer-*' -p %S/Inputs/empty-database %s 2>&1 | FileCheck %s
44

55
// CHECK: 'directory' field of compilation database is empty; using the current working directory instead.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// UNSUPPORTED: system-windows
22

3-
// RUN: not --crash clang-tidy -p %S/Inputs/invalid-database %s 2>&1 | FileCheck %s
3+
// RUN: not --crash clang-tidy -checks='-*,clang-analyzer-*' -p %S/Inputs/invalid-database %s 2>&1 | FileCheck %s
44

55
// CHECK: LLVM ERROR: Cannot chdir into "/invalid/"!

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ Potentially Breaking Changes
8686
options-related code has been moved out of the Driver into a separate library.
8787
- The ``clangFrontend`` library no longer depends on ``clangDriver``, which may
8888
break downstream projects that relied on this transitive dependency.
89+
- Clang is now more precise with regards to the lifetime of temporary objects
90+
such as when aggregates are passed by value to a function, resulting in
91+
better sharing of stack slots and reduced stack usage. This change can lead
92+
to use-after-scope related issues in code that unintentionally relied on the
93+
previous behavior. If recompiling with ``-fsanitize=address`` shows a
94+
use-after-scope warning, then this is likely the case, and the report printed
95+
should be able to help users pinpoint where the use-after-scope is occurring.
96+
Users can use ``-Xclang -sloppy-temporary-lifetimes`` to retain the old
97+
behavior until they are able to find and resolve issues in their code.
8998

9099
C/C++ Language Potentially Breaking Changes
91100
-------------------------------------------

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ ENUM_CODEGENOPT(ZeroCallUsedRegs, ZeroCallUsedRegsKind,
475475
/// non-deleting destructors. (No effect on Microsoft ABI.)
476476
CODEGENOPT(CtorDtorReturnThis, 1, 0, Benign)
477477

478+
/// Set via -Xclang -sloppy-temporary-lifetimes to disable emission of lifetime
479+
/// marker intrinsic calls.
480+
CODEGENOPT(NoLifetimeMarkersForTemporaries, 1, 0, Benign)
481+
478482
/// Enables emitting Import Call sections on supported targets that can be used
479483
/// by the Windows kernel to enable import call optimization.
480484
CODEGENOPT(ImportCallOptimization, 1, 0, Benign)

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,36 @@ def CIR_ContinueOp : CIR_Op<"continue", [Terminator]> {
898898
let hasLLVMLowering = false;
899899
}
900900

901+
//===----------------------------------------------------------------------===//
902+
// Resume
903+
//===----------------------------------------------------------------------===//
904+
905+
def CIR_ResumeOp : CIR_Op<"resume", [
906+
ReturnLike, Terminator, HasParent<"cir::TryOp">
907+
]> {
908+
let summary = "Resumes execution after not catching exceptions";
909+
let description = [{
910+
The `cir.resume` operation handles an uncaught exception scenario.
911+
912+
Used as the terminator of a `CatchUnwind` region of `cir.try`, where it
913+
does not receive any arguments (implied from the `cir.try` scope).
914+
915+
This operation is used only before the CFG flatterning pass.
916+
917+
Examples:
918+
```mlir
919+
cir.try {
920+
cir.yield
921+
} unwind {
922+
cir.resume
923+
}
924+
```
925+
}];
926+
927+
let assemblyFormat = "attr-dict";
928+
let hasLLVMLowering = false;
929+
}
930+
901931
//===----------------------------------------------------------------------===//
902932
// ScopeOp
903933
//===----------------------------------------------------------------------===//

clang/include/clang/Options/Options.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8317,6 +8317,11 @@ def import_call_optimization : Flag<["-"], "import-call-optimization">,
83178317
def replaceable_function: Joined<["-"], "loader-replaceable-function=">,
83188318
MarshallingInfoStringVector<CodeGenOpts<"LoaderReplaceableFunctionNames">>;
83198319

8320+
def sloppy_temporary_lifetimes
8321+
: Flag<["-"], "sloppy-temporary-lifetimes">,
8322+
HelpText<"Don't emit lifetime markers for temporary objects">,
8323+
MarshallingInfoFlag<CodeGenOpts<"NoLifetimeMarkersForTemporaries">>;
8324+
83208325
} // let Visibility = [CC1Option]
83218326

83228327
//===----------------------------------------------------------------------===//

clang/lib/CIR/CodeGen/CIRGenDeclOpenACC.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ class OpenACCRoutineClauseEmitter final
355355
curValue.getZExtValue());
356356
}
357357
}
358+
359+
void VisitDeviceTypeClause(const OpenACCDeviceTypeClause &clause) {
360+
lastDeviceTypeValues.clear();
361+
362+
for (const DeviceTypeArgument &arg : clause.getArchitectures())
363+
lastDeviceTypeValues.push_back(decodeDeviceType(arg.getIdentifierInfo()));
364+
}
358365
};
359366
} // namespace
360367

0 commit comments

Comments
 (0)