Skip to content

Commit

Permalink
Merge pull request #126 from ergawy/merge_24.07.2024
Browse files Browse the repository at this point in the history
Merge 24.07.2024
  • Loading branch information
ergawy authored Jul 25, 2024
2 parents f7d9fab + 69a15f5 commit b3b35ea
Show file tree
Hide file tree
Showing 2,661 changed files with 124,328 additions and 53,616 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ b9079baaddfed5e604fbfaa1d81a7a1c38e78c26

# [libc++][NFC] Run clang-format on libcxx/include again (#95874)
e2c2ffbe7a1b5d9e32a2ce64279475b50c4cba5b

# [lldb][nfc] Deindent ProcessGDBRemote::SetThreadStopInfo by two levels
b32931c5b32eb0d2cf37d688b34f8548c9674c19
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ clang/test/AST/Interp/ @tbaederr
/mlir/**/*VectorToLLVM* @banach-space @dcaballe @nicolasvasilache
/mlir/**/*X86Vector* @aartbik @dcaballe @nicolasvasilache
/mlir/include/mlir/Dialect/Vector @banach-space @dcaballe @nicolasvasilache
/mlir/include/mlir/Dialect/Vector/IR @kuhar
/mlir/lib/Dialect/Vector @banach-space @dcaballe @nicolasvasilache
/mlir/lib/Dialect/Vector/Transforms/* @banach-space @dcaballe @hanhanW @nicolasvasilache
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @banach-space @dcaballe @MaheshRavishankar @nicolasvasilache
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/issue-write.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@ jobs:
github.event.workflow_run.conclusion == 'failure'
)
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows/unprivileged-download-artifact/action.yml
sparse-checkout-cone-mode: false
- name: 'Download artifact'
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
uses: ./.github/workflows/unprivileged-download-artifact
id: download-artifact
with:
github-token: ${{ secrets.ISSUE_WRITE_DOWNLOAD_ARTIFACT }}
run-id: ${{ github.event.workflow_run.id }}
name: workflow-args
artifact-name: workflow-args

- name: 'Comment on PR'
if: steps.download-artifact.outputs.artifact-id != ''
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -144,5 +151,7 @@ jobs:
});
- name: Dump comments file
if: always()
if: >-
always() &&
steps.download-artifact.outputs.artifact-id != ''
run: cat comments
81 changes: 81 additions & 0 deletions .github/workflows/unprivileged-download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Unprivileged Download Artifact
description: >-
Download artifacts from another workflow run without using an access token.
inputs:
run-id:
description: >-
The run-id for the workflow run that you want to download the artifact
from. If ommitted it will download the most recently created artifact
from the repo with the artifact-name.
required: false
artifact-name:
desciption: The name of the artifact to download.
required: true


outputs:
filename:
description: >-
The filename of the downloaded artifact or the empty string if the
artifact was not found.
value: ${{ steps.download-artifact.outputs.filename }}
artifact-id:
description: "The id of the artifact being downloaded."
value: ${{ steps.artifact-url.outputs.id }}


runs:
using: "composite"
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
id: artifact-url
with:
script: |
var response;
if (!"${{ inputs.run-id }}") {
response = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: "${{ inputs.artifact-name }}"
})
} else {
response = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: "${{ inputs.run-id }}",
name: "${{ inputs.artifact-name }}"
})
}
console.log(response)
for (artifact of response.data.artifacts) {
console.log(artifact);
}
if (response.data.artifacts.length == 0) {
console.log("Could not find artifact ${{ inputs.artifact-name }} for workflow run ${{ inputs.run-id }}")
return;
}
const url_response = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: response.data.artifacts[0].id,
archive_format: "zip"
})
core.setOutput("url", url_response.url);
core.setOutput("id", response.data.artifacts[0].id);
- shell: bash
if: steps.artifact-url.outputs.url != ''
id: download-artifact
run: |
curl -L -o ${{ inputs.artifact-name }}.zip "${{ steps.artifact-url.outputs.url }}"
echo "filename=${{ inputs.artifact-name }}.zip" >> $GITHUB_OUTPUT
- shell: bash
if: steps.download-artifact.outputs.filename != ''
run: |
unzip ${{ steps.download-artifact.outputs.filename }}
2 changes: 1 addition & 1 deletion .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
- name: Version Check
run: |
version=$(grep -o 'LLVM_VERSION_\(MAJOR\|MINOR\|PATCH\) [0-9]\+' llvm/CMakeLists.txt | cut -d ' ' -f 2 | tr "\n" "." | sed 's/.$//g')
version=$(grep -o 'LLVM_VERSION_\(MAJOR\|MINOR\|PATCH\) [0-9]\+' cmake/Modules/LLVMVersion.cmake | cut -d ' ' -f 2 | tr "\n" "." | sed 's/.$//g')
.github/workflows/version-check.py "$version"
11 changes: 5 additions & 6 deletions bolt/docs/CommandLineArgumentReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

- `--comp-dir-override=<string>`

Overrides DW_AT_comp_dir, and provides an alterantive base location, which is
Overrides DW_AT_comp_dir, and provides an alternative base location, which is
used with DW_AT_dwo_name to construct a path to *.dwo files.

- `--create-debug-names-section`
Expand All @@ -113,11 +113,6 @@

Prints out offsets for abbrev and debug_info of Skeleton CUs that get patched.

- `--deterministic-debuginfo`

Disables parallel execution of tasks that may produce nondeterministic debug
info

- `--dot-tooltip-code`

Add basic block instructions as tool tips on nodes
Expand Down Expand Up @@ -686,6 +681,10 @@
threshold means fewer functions to process. E.g threshold of 90 means only top
10 percent of functions with profile will be processed.

- `--match-with-call-graph`

Match functions with call graph

- `--memcpy1-spec=<func1,func2:cs1:cs2,func3:cs1,...>`

List of functions with call sites for which to specialize memcpy() for size 1
Expand Down
1 change: 1 addition & 0 deletions bolt/docs/OptimizingClang.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ $ cd ${TOPLEV}/stage3
$ CPATH=${TOPLEV}/stage2-prof-use-lto/install/bin/
$ cmake -G Ninja ${TOPLEV}/llvm -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=$CPATH/clang -DCMAKE_CXX_COMPILER=$CPATH/clang++ \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_USE_LINKER=lld -DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage3/install
$ perf record -e cycles:u -j any,u -- ninja clang
```
Expand Down
4 changes: 2 additions & 2 deletions bolt/docs/generate_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def parse_bolt_options(output):
cleaned_line = line.strip()

if cleaned_line.casefold() in map(str.casefold, section_headers):
if prev_section != None: # Save last option from prev section
if prev_section is not None: # Save last option from prev section
add_info(sections, current_section, option, description)
option, description = None, []

Expand Down Expand Up @@ -76,7 +76,7 @@ def parse_bolt_options(output):
description = [descr]
if option.startswith("--print") or option.startswith("--time"):
current_section = "BOLT printing options:"
elif prev_section != None:
elif prev_section is not None:
current_section = prev_section
continue

Expand Down
21 changes: 17 additions & 4 deletions bolt/include/bolt/Core/BinaryContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCPseudoProbe.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
Expand Down Expand Up @@ -246,6 +247,9 @@ class BinaryContext {
/// DWP Context.
std::shared_ptr<DWARFContext> DWPContext;

/// Decoded pseudo probes.
std::shared_ptr<MCPseudoProbeDecoder> PseudoProbeDecoder;

/// A map of DWO Ids to CUs.
using DWOIdToCUMapType = std::unordered_map<uint64_t, DWARFUnit *>;
DWOIdToCUMapType DWOCUs;
Expand Down Expand Up @@ -377,6 +381,15 @@ class BinaryContext {
RtLibrary = std::move(Lib);
}

const MCPseudoProbeDecoder *getPseudoProbeDecoder() const {
return PseudoProbeDecoder.get();
}

void setPseudoProbeDecoder(std::shared_ptr<MCPseudoProbeDecoder> Decoder) {
assert(!PseudoProbeDecoder && "Cannot set pseudo probe decoder twice.");
PseudoProbeDecoder = Decoder;
}

/// Return BinaryFunction containing a given \p Address or nullptr if
/// no registered function contains the \p Address.
///
Expand Down Expand Up @@ -431,6 +444,9 @@ class BinaryContext {
return nullptr;
}

/// Deregister JumpTable registered at a given \p Address and delete it.
void deleteJumpTable(uint64_t Address);

unsigned getDWARFEncodingSize(unsigned Encoding) {
if (Encoding == dwarf::DW_EH_PE_omit)
return 0;
Expand Down Expand Up @@ -1436,10 +1452,7 @@ class BinaryContext {
std::unique_ptr<MCObjectWriter> OW = MAB->createObjectWriter(OS);
std::unique_ptr<MCStreamer> Streamer(TheTarget->createMCObjectStreamer(
*TheTriple, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), std::move(OW),
std::unique_ptr<MCCodeEmitter>(MCE), *STI,
/* RelaxAll */ false,
/* IncrementalLinkerCompatible */ false,
/* DWARFMustBeAtTheEnd */ false));
std::unique_ptr<MCCodeEmitter>(MCE), *STI));
return Streamer;
}

Expand Down
8 changes: 8 additions & 0 deletions bolt/include/bolt/Core/BinaryFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ class BinaryFunction {
/// different parameters by every pass.
mutable uint64_t Hash{0};

/// Function GUID assigned externally.
uint64_t GUID{0};

/// For PLT functions it contains a symbol associated with a function
/// reference. It is nullptr for non-PLT functions.
const MCSymbol *PLTSymbol{nullptr};
Expand Down Expand Up @@ -2256,6 +2259,11 @@ class BinaryFunction {
/// Returns the last computed hash value of the function.
size_t getHash() const { return Hash; }

/// Returns the function GUID.
uint64_t getGUID() const { return GUID; }

void setGUID(uint64_t Id) { GUID = Id; }

using OperandHashFuncTy =
function_ref<typename std::string(const MCOperand &)>;

Expand Down
12 changes: 2 additions & 10 deletions bolt/include/bolt/Core/DIEBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ class DIEBuilder {

/// Returns current state of the DIEBuilder
State &getState() { return *BuilderState.get(); }
/// Resolve the reference in DIE, if target is not loaded into IR,
/// pre-allocate it. \p RefCU will be updated to the Unit specific by \p
/// RefValue.
DWARFDie resolveDIEReference(
const DWARFFormValue &RefValue,
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec,
DWARFUnit *&RefCU, DWARFDebugInfoEntry &DwarfDebugInfoEntry);

/// Resolve the reference in DIE, if target is not loaded into IR,
/// pre-allocate it. \p RefCU will be updated to the Unit specific by \p
Expand All @@ -165,10 +158,9 @@ class DIEBuilder {
const DWARFFormValue &Val);

/// Clone an attribute in reference format.
void cloneDieReferenceAttribute(
void cloneDieOffsetReferenceAttribute(
DIE &Die, const DWARFUnit &U, const DWARFDie &InputDIE,
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec,
const DWARFFormValue &Val);
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec, uint64_t Ref);

/// Clone an attribute in block format.
void cloneBlockAttribute(
Expand Down
13 changes: 7 additions & 6 deletions bolt/include/bolt/Core/MCPlusBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ enum class IndirectBranchType : char {
POSSIBLE_PIC_JUMP_TABLE, /// Possibly a jump table for PIC.
POSSIBLE_GOTO, /// Possibly a gcc's computed goto.
POSSIBLE_FIXED_BRANCH, /// Possibly an indirect branch to a fixed location.
POSSIBLE_PIC_FIXED_BRANCH, /// Possibly an indirect jump to a fixed entry in a
/// PIC jump table.
};

class MCPlusBuilder {
Expand Down Expand Up @@ -1474,12 +1476,11 @@ class MCPlusBuilder {
/// will be set to the different components of the branch. \p MemLocInstr
/// is the instruction that loads up the indirect function pointer. It may
/// or may not be same as \p Instruction.
virtual IndirectBranchType
analyzeIndirectBranch(MCInst &Instruction, InstructionIterator Begin,
InstructionIterator End, const unsigned PtrSize,
MCInst *&MemLocInstr, unsigned &BaseRegNum,
unsigned &IndexRegNum, int64_t &DispValue,
const MCExpr *&DispExpr, MCInst *&PCRelBaseOut) const {
virtual IndirectBranchType analyzeIndirectBranch(
MCInst &Instruction, InstructionIterator Begin, InstructionIterator End,
const unsigned PtrSize, MCInst *&MemLocInstr, unsigned &BaseRegNum,
unsigned &IndexRegNum, int64_t &DispValue, const MCExpr *&DispExpr,
MCInst *&PCRelBaseOut, MCInst *&FixedEntryLoadInst) const {
llvm_unreachable("not implemented");
return IndirectBranchType::UNKNOWN;
}
Expand Down
Loading

0 comments on commit b3b35ea

Please sign in to comment.