Skip to content

Commit 7664855

Browse files
authored
Merge branch 'main' into feature/clang-format-Add-ObjCSpaceBeforeMethodDeclColon
2 parents 9818413 + 02482f4 commit 7664855

File tree

748 files changed

+34689
-8658
lines changed

Some content is hidden

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

748 files changed

+34689
-8658
lines changed

.github/CODEOWNERS

Lines changed: 10 additions & 7 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
@@ -93,9 +96,9 @@
9396
/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp @MaheshRavishankar @nicolasvasilache
9497
/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp @dcaballe @MaheshRavishankar @nicolasvasilache
9598
/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp @MaheshRavishankar @nicolasvasilache
96-
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @hanhanW @nicolasvasilache
97-
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @hanhanW @nicolasvasilache
98-
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @hanhanW @nicolasvasilache @Groverkss
99+
/mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp @nicolasvasilache
100+
/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @dcaballe @nicolasvasilache
101+
/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp @banach-space @dcaballe @nicolasvasilache @Groverkss
99102

100103
# MemRef Dialect in MLIR.
101104
/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
@@ -112,16 +115,16 @@
112115
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
113116
/mlir/include/mlir/Dialect/Vector/IR @kuhar
114117
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache @Groverkss
115-
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @hanhanW @nicolasvasilache
118+
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @nicolasvasilache
116119
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @banach-space @dcaballe @MaheshRavishankar @nicolasvasilache
117-
/mlir/**/*EmulateNarrowType* @dcaballe @hanhanW
120+
/mlir/**/*EmulateNarrowType* @dcaballe
118121

119122
# Presburger library in MLIR
120123
/mlir/**/*Presburger* @Groverkss @Superty
121124

122125
# Tensor Dialect in MLIR.
123-
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @hanhanW @nicolasvasilache
124-
/mlir/lib/Dialect/Tensor/Transforms/* @hanhanW @nicolasvasilache
126+
/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @nicolasvasilache
127+
/mlir/lib/Dialect/Tensor/Transforms/* @nicolasvasilache
125128

126129
# Transform Dialect in MLIR.
127130
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache @rolfmorel

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/include/bolt/Core/BinaryFunction.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,10 +2356,9 @@ class BinaryFunction {
23562356
bool postProcessIndirectBranches(MCPlusBuilder::AllocatorIdTy AllocId);
23572357

23582358
/// Validate that all data references to function offsets are claimed by
2359-
/// recognized jump tables. Register externally referenced blocks as entry
2360-
/// points. Returns true if there are no unclaimed externally referenced
2361-
/// offsets.
2362-
bool validateExternallyReferencedOffsets();
2359+
/// recognized jump tables. Returns true if there are no unclaimed externally
2360+
/// referenced offsets.
2361+
bool validateInternalRefDataRelocations();
23632362

23642363
/// Return all call site profile info for this function.
23652364
IndirectCallSiteProfile &getAllCallSites() { return AllCallSites; }

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,6 @@ class MCPlusBuilder {
538538
llvm_unreachable("not implemented");
539539
}
540540

541-
virtual void createDirectBranch(MCInst &Inst, const MCSymbol *Target,
542-
MCContext *Ctx) {
543-
llvm_unreachable("not implemented");
544-
}
545-
546541
virtual MCPhysReg getX86R11() const { llvm_unreachable("not implemented"); }
547542

548543
virtual unsigned getShortBranchOpcode(unsigned Opcode) const {

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);

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,41 +2041,47 @@ void BinaryFunction::postProcessJumpTables() {
20412041
}
20422042
}
20432043

2044-
bool BinaryFunction::validateExternallyReferencedOffsets() {
2045-
SmallPtrSet<MCSymbol *, 4> JTTargets;
2046-
for (const JumpTable *JT : llvm::make_second_range(JumpTables))
2047-
JTTargets.insert_range(JT->Entries);
2048-
2049-
bool HasUnclaimedReference = false;
2050-
for (uint64_t Destination : ExternallyReferencedOffsets) {
2051-
// Ignore __builtin_unreachable().
2052-
if (Destination == getSize())
2053-
continue;
2054-
// Ignore constant islands
2055-
if (isInConstantIsland(Destination + getAddress()))
2056-
continue;
2044+
bool BinaryFunction::validateInternalRefDataRelocations() {
2045+
if (InternalRefDataRelocations.empty())
2046+
return true;
20572047

2058-
if (BinaryBasicBlock *BB = getBasicBlockAtOffset(Destination)) {
2059-
// Check if the externally referenced offset is a recognized jump table
2060-
// target.
2061-
if (JTTargets.contains(BB->getLabel()))
2062-
continue;
2048+
// Rely on the user hint that all data refs are valid and only used as
2049+
// destinations by indirect branch in the same function.
2050+
if (opts::StrictMode)
2051+
return true;
20632052

2064-
if (opts::Verbosity >= 1) {
2065-
BC.errs() << "BOLT-WARNING: unclaimed data to code reference (possibly "
2066-
<< "an unrecognized jump table entry) to " << BB->getName()
2067-
<< " in " << *this << "\n";
2068-
}
2069-
auto L = BC.scopeLock();
2070-
addEntryPoint(*BB);
2071-
} else {
2072-
BC.errs() << "BOLT-WARNING: unknown data to code reference to offset "
2073-
<< Twine::utohexstr(Destination) << " in " << *this << "\n";
2074-
setIgnored();
2053+
DenseSet<uint64_t> UnclaimedRelocations(InternalRefDataRelocations);
2054+
for (const JumpTable *JT : llvm::make_second_range(JumpTables)) {
2055+
uint64_t EntryAddress = JT->getAddress();
2056+
while (EntryAddress < JT->getAddress() + JT->getSize()) {
2057+
UnclaimedRelocations.erase(EntryAddress);
2058+
EntryAddress += JT->EntrySize;
20752059
}
2076-
HasUnclaimedReference = true;
20772060
}
2078-
return !HasUnclaimedReference;
2061+
2062+
if (UnclaimedRelocations.empty())
2063+
return true;
2064+
2065+
BC.errs() << "BOLT-WARNING: " << UnclaimedRelocations.size()
2066+
<< " unclaimed data relocation"
2067+
<< (UnclaimedRelocations.size() > 1 ? "s" : "")
2068+
<< " remain against function " << *this;
2069+
if (opts::Verbosity) {
2070+
BC.errs() << ":\n";
2071+
for (uint64_t RelocationAddress : UnclaimedRelocations) {
2072+
const Relocation *Relocation = BC.getRelocationAt(RelocationAddress);
2073+
BC.errs() << " ";
2074+
if (Relocation)
2075+
BC.errs() << *Relocation;
2076+
else
2077+
BC.errs() << "<missing relocation>";
2078+
BC.errs() << '\n';
2079+
}
2080+
} else {
2081+
BC.errs() << ". Re-run with -v=1 to see the list\n";
2082+
}
2083+
2084+
return false;
20792085
}
20802086

20812087
bool BinaryFunction::postProcessIndirectBranches(
@@ -2200,14 +2206,6 @@ bool BinaryFunction::postProcessIndirectBranches(
22002206
LastIndirectJumpBB->updateJumpTableSuccessors();
22012207
}
22022208

2203-
// Validate that all data references to function offsets are claimed by
2204-
// recognized jump tables. Register externally referenced blocks as entry
2205-
// points.
2206-
if (!opts::StrictMode && hasInternalReference()) {
2207-
if (!validateExternallyReferencedOffsets())
2208-
return false;
2209-
}
2210-
22112209
if (HasUnknownControlFlow && !BC.HasRelocations)
22122210
return false;
22132211

@@ -2496,12 +2494,18 @@ Error BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
24962494
CurrentState = State::CFG;
24972495

24982496
// Make any necessary adjustments for indirect branches.
2499-
if (!postProcessIndirectBranches(AllocatorId)) {
2500-
if (opts::Verbosity) {
2501-
BC.errs() << "BOLT-WARNING: failed to post-process indirect branches for "
2502-
<< *this << '\n';
2503-
}
2497+
bool ValidCFG = postProcessIndirectBranches(AllocatorId);
2498+
if (!ValidCFG && opts::Verbosity) {
2499+
BC.errs() << "BOLT-WARNING: failed to post-process indirect branches for "
2500+
<< *this << '\n';
2501+
}
2502+
2503+
// Validate that all data references to function offsets are claimed by
2504+
// recognized jump tables.
2505+
if (ValidCFG)
2506+
ValidCFG = validateInternalRefDataRelocations();
25042507

2508+
if (!ValidCFG) {
25052509
if (BC.isAArch64())
25062510
PreserveNops = BC.HasRelocations;
25072511

bolt/lib/Passes/Instrumentation.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,9 @@ void Instrumentation::instrumentIndirectTarget(BinaryBasicBlock &BB,
305305
: IndCallHandlerExitBBFunction->getSymbol(),
306306
IndCallSiteID, &*BC.Ctx);
307307

308-
if (!BC.isAArch64()) {
309-
Iter = BB.eraseInstruction(Iter);
310-
Iter = insertInstructions(CounterInstrs, BB, Iter);
311-
--Iter;
312-
} else
313-
Iter = insertInstructions(CounterInstrs, BB, Iter);
308+
Iter = BB.eraseInstruction(Iter);
309+
Iter = insertInstructions(CounterInstrs, BB, Iter);
310+
--Iter;
314311
}
315312

316313
bool Instrumentation::instrumentOneTarget(

0 commit comments

Comments
 (0)