Skip to content

Commit 6203a67

Browse files
committed
Use --as-needed when adding libzircon
Created using spr 1.3.4
2 parents 70828dc + 310351d commit 6203a67

File tree

1,193 files changed

+38850
-17073
lines changed

Some content is hidden

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

1,193 files changed

+38850
-17073
lines changed

.ci/generate_test_report.py

Lines changed: 424 additions & 0 deletions
Large diffs are not rendered by default.

.ci/monolithic-linux.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ if [[ -n "${CLEAR_CACHE:-}" ]]; then
2828
ccache --clear
2929
fi
3030

31-
function show-stats {
31+
function at-exit {
3232
mkdir -p artifacts
3333
ccache --print-stats > artifacts/ccache_stats.txt
34+
35+
# If building fails there will be no results files.
36+
shopt -s nullglob
37+
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":linux: Linux x64 Test Results" \
38+
"linux-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
3439
}
35-
trap show-stats EXIT
40+
trap at-exit EXIT
3641

3742
projects="${1}"
3843
targets="${2}"
@@ -42,6 +47,7 @@ lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-outpu
4247
echo "--- cmake"
4348
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
4449
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
50+
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
4551
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4652
-D LLVM_ENABLE_PROJECTS="${projects}" \
4753
-G Ninja \

.ci/monolithic-windows.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,23 @@ if [[ -n "${CLEAR_CACHE:-}" ]]; then
2727
fi
2828

2929
sccache --zero-stats
30-
function show-stats {
30+
function at-exit {
3131
mkdir -p artifacts
3232
sccache --show-stats >> artifacts/sccache_stats.txt
33+
34+
# If building fails there will be no results files.
35+
shopt -s nullglob
36+
python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
37+
"windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
3338
}
34-
trap show-stats EXIT
39+
trap at-exit EXIT
3540

3641
projects="${1}"
3742
targets="${2}"
3843

3944
echo "--- cmake"
4045
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
46+
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
4147

4248
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
4349
# on fixing a build reliability issue on the build server, please

.ci/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
junitparser==3.2.0

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,12 @@ llvm:ir:
587587
- llvm/docs/LangRef.rst
588588
- llvm/unittests/IR/**
589589

590+
llvm:SandboxIR:
591+
- llvm/lib/SandboxIR/**
592+
- llvm/include/llvm/SandboxIR/**
593+
- llvm/docs/SandboxIR.md
594+
- llvm/unittests/SandboxIR/**
595+
590596
llvm:analysis:
591597
- llvm/lib/Analysis/**
592598
- llvm/include/llvm/Analysis/**

bolt/include/bolt/Core/Exceptions.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,14 @@ class CFIReaderWriter {
4343

4444
/// Generate .eh_frame_hdr from old and new .eh_frame sections.
4545
///
46-
/// Take FDEs from the \p NewEHFrame unless their initial_pc is listed
47-
/// in \p FailedAddresses. All other entries are taken from the
46+
/// Take FDEs from the \p NewEHFrame. All other entries are taken from the
4847
/// \p OldEHFrame.
4948
///
5049
/// \p EHFrameHeaderAddress specifies location of .eh_frame_hdr,
5150
/// and is required for relative addressing used in the section.
52-
std::vector<char>
53-
generateEHFrameHeader(const DWARFDebugFrame &OldEHFrame,
54-
const DWARFDebugFrame &NewEHFrame,
55-
uint64_t EHFrameHeaderAddress,
56-
std::vector<uint64_t> &FailedAddresses) const;
51+
std::vector<char> generateEHFrameHeader(const DWARFDebugFrame &OldEHFrame,
52+
const DWARFDebugFrame &NewEHFrame,
53+
uint64_t EHFrameHeaderAddress) const;
5754

5855
using FDEsMap = std::map<uint64_t, const dwarf::FDE *>;
5956

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,14 @@ class MCPlusBuilder {
15361536
llvm_unreachable("not implemented");
15371537
}
15381538

1539+
/// Match function \p BF to a long veneer for absolute code. Return true if
1540+
/// the match was successful and populate \p TargetAddress with an address of
1541+
/// the function veneer jumps to.
1542+
virtual bool matchAbsLongVeneer(const BinaryFunction &BF,
1543+
uint64_t &TargetAddress) const {
1544+
llvm_unreachable("not implemented");
1545+
}
1546+
15391547
virtual bool matchAdrpAddPair(const MCInst &Adrp, const MCInst &Add) const {
15401548
llvm_unreachable("not implemented");
15411549
return false;

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,6 @@ class RewriteInstance {
556556
return ErrOrSection ? &ErrOrSection.get() : nullptr;
557557
}
558558

559-
/// Keep track of functions we fail to write in the binary. We need to avoid
560-
/// rewriting CFI info for these functions.
561-
std::vector<uint64_t> FailedAddresses;
562-
563-
/// Keep track of which functions didn't fit in their original space in the
564-
/// last emission, so that we may either decide to split or not optimize them.
565-
std::set<uint64_t> LargeFunctions;
566-
567559
/// Section header string table.
568560
StringTableBuilder SHStrTab;
569561

bolt/lib/Core/Exceptions.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ Error BinaryFunction::parseLSDA(ArrayRef<uint8_t> LSDASectionData,
108108
DWARFDataExtractor Data(
109109
StringRef(reinterpret_cast<const char *>(LSDASectionData.data()),
110110
LSDASectionData.size()),
111-
BC.DwCtx->getDWARFObj().isLittleEndian(),
112-
BC.DwCtx->getDWARFObj().getAddressSize());
111+
BC.AsmInfo->isLittleEndian(), BC.AsmInfo->getCodePointerSize());
113112
uint64_t Offset = getLSDAAddress() - LSDASectionAddress;
114113
assert(Data.isValidOffset(Offset) && "wrong LSDA address");
115114

@@ -666,16 +665,13 @@ bool CFIReaderWriter::fillCFIInfoFor(BinaryFunction &Function) const {
666665
return true;
667666
}
668667

669-
std::vector<char> CFIReaderWriter::generateEHFrameHeader(
670-
const DWARFDebugFrame &OldEHFrame, const DWARFDebugFrame &NewEHFrame,
671-
uint64_t EHFrameHeaderAddress,
672-
std::vector<uint64_t> &FailedAddresses) const {
668+
std::vector<char>
669+
CFIReaderWriter::generateEHFrameHeader(const DWARFDebugFrame &OldEHFrame,
670+
const DWARFDebugFrame &NewEHFrame,
671+
uint64_t EHFrameHeaderAddress) const {
673672
// Common PC -> FDE map to be written into .eh_frame_hdr.
674673
std::map<uint64_t, uint64_t> PCToFDE;
675674

676-
// Presort array for binary search.
677-
llvm::sort(FailedAddresses);
678-
679675
// Initialize PCToFDE using NewEHFrame.
680676
for (dwarf::FrameEntry &Entry : NewEHFrame.entries()) {
681677
const dwarf::FDE *FDE = dyn_cast<dwarf::FDE>(&Entry);
@@ -690,13 +686,7 @@ std::vector<char> CFIReaderWriter::generateEHFrameHeader(
690686
continue;
691687

692688
// Add the address to the map unless we failed to write it.
693-
if (!std::binary_search(FailedAddresses.begin(), FailedAddresses.end(),
694-
FuncAddress)) {
695-
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: FDE for function at 0x"
696-
<< Twine::utohexstr(FuncAddress) << " is at 0x"
697-
<< Twine::utohexstr(FDEAddress) << '\n');
698-
PCToFDE[FuncAddress] = FDEAddress;
699-
}
689+
PCToFDE[FuncAddress] = FDEAddress;
700690
};
701691

702692
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: new .eh_frame contains "

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,18 @@ Error CheckLargeFunctions::runOnFunctions(BinaryContext &BC) {
588588
uint64_t HotSize, ColdSize;
589589
std::tie(HotSize, ColdSize) =
590590
BC.calculateEmittedSize(BF, /*FixBranches=*/false);
591-
if (HotSize > BF.getMaxSize()) {
591+
uint64_t MainFragmentSize = HotSize;
592+
if (BF.hasIslandsInfo()) {
593+
MainFragmentSize +=
594+
offsetToAlignment(BF.getAddress() + MainFragmentSize,
595+
Align(BF.getConstantIslandAlignment()));
596+
MainFragmentSize += BF.estimateConstantIslandSize();
597+
}
598+
if (MainFragmentSize > BF.getMaxSize()) {
592599
if (opts::PrintLargeFunctions)
593-
BC.outs() << "BOLT-INFO: " << BF << " size exceeds allocated space by "
594-
<< (HotSize - BF.getMaxSize()) << " bytes\n";
600+
BC.outs() << "BOLT-INFO: " << BF << " size of " << MainFragmentSize
601+
<< " bytes exceeds allocated space by "
602+
<< (MainFragmentSize - BF.getMaxSize()) << " bytes\n";
595603
BF.setSimple(false);
596604
}
597605
};

0 commit comments

Comments
 (0)