Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "LLVM and SPIRV-LLVM-Translator pulldown (WW41 2024)" #16023

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 1 addition & 6 deletions .github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ mlgo:
- llvm/lib/CodeGen/ML*
- llvm/unittests/CodeGen/ML*
- llvm/test/CodeGen/MLRegAlloc/**
- llvm/utils/mlgo-utils/**
- llvm/utils/mlgo-utils/*

tools:llvm-exegesis:
- llvm/tools/llvm-exegesis/**
Expand Down Expand Up @@ -1008,8 +1008,3 @@ bazel:

offload:
- offload/**

tablegen:
- llvm/include/TableGen/**
- llvm/lib/TableGen/**
- llvm/utils/TableGen/**
5 changes: 3 additions & 2 deletions .github/workflows/commit-access-review.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,11 @@ def main():
gh = github.Github(login_or_token=token)
org = gh.get_organization("llvm")
repo = org.get_repo("llvm-project")
team = org.get_team_by_slug("llvm-committers")
one_year_ago = datetime.datetime.now() - datetime.timedelta(days=365)
triage_list = {}
for collaborator in repo.get_collaborators(permission="push"):
triage_list[collaborator.login] = User(collaborator.login, triage_list)
for member in team.get_members():
triage_list[member.login] = User(member.login, triage_list)

print("Start:", len(triage_list), "triagers")
# Step 0 Check if users have requested commit access in the last year.
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ jobs:
- { config: mingw-dll, mingw: true }
- { config: mingw-static, mingw: true }
- { config: mingw-dll-i686, mingw: true }
- { config: mingw-incomplete-sysroot, mingw: true }
steps:
- uses: actions/checkout@v4
- name: Install dependencies
Expand All @@ -261,12 +260,6 @@ jobs:
del llvm-mingw*.zip
mv llvm-mingw* c:\llvm-mingw
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- name: Simulate a from-scratch build of llvm-mingw
if: ${{ matrix.config == 'mingw-incomplete-sysroot' }}
run: |
rm -r c:\llvm-mingw\include\c++
rm -r c:\llvm-mingw\*-w64-mingw32\lib\libc++*
rm -r c:\llvm-mingw\*-w64-mingw32\lib\libunwind*
- name: Add Git Bash to the path
run: |
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,22 +442,11 @@ jobs:
name: ${{ needs.prepare.outputs.release-binary-filename }}-attestation
path: ${{ needs.prepare.outputs.release-binary-filename }}.jsonl

- name: Checkout Release Scripts
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
sparse-checkout: |
llvm/utils/release/github-upload-release.py
llvm/utils/git/requirements.txt
sparse-checkout-cone-mode: false

- name: Install Python Requirements
run: |
pip install --require-hashes -r ./llvm/utils/git/requirements.txt

- name: Upload Release
shell: bash
run: |
./llvm/utils/release/github-upload-release.py \
sudo apt install python3-github
./llvm-project/llvm/utils/release/github-upload-release.py \
--token ${{ github.token }} \
--release ${{ needs.prepare.outputs.release-version }} \
upload \
Expand Down
81 changes: 16 additions & 65 deletions bolt/include/bolt/Profile/ProfileYAMLMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,24 @@ template <> struct MappingTraits<bolt::SuccessorInfo> {

namespace bolt {
struct PseudoProbeInfo {
uint32_t InlineTreeIndex = 0;
uint64_t BlockMask = 0; // bitset with probe indices from 1 to 64
std::vector<uint64_t> BlockProbes; // block probes with indices above 64
std::vector<uint64_t> CallProbes;
std::vector<uint64_t> IndCallProbes;
std::vector<uint32_t> InlineTreeNodes;
llvm::yaml::Hex64 GUID;
uint64_t Index;
uint8_t Type;

bool operator==(const PseudoProbeInfo &Other) const {
return InlineTreeIndex == Other.InlineTreeIndex &&
BlockProbes == Other.BlockProbes && CallProbes == Other.CallProbes &&
IndCallProbes == Other.IndCallProbes;
return GUID == Other.GUID && Index == Other.Index;
}
bool operator!=(const PseudoProbeInfo &Other) const {
return !(*this == Other);
}
};
} // end namespace bolt

template <> struct MappingTraits<bolt::PseudoProbeInfo> {
static void mapping(IO &YamlIO, bolt::PseudoProbeInfo &PI) {
YamlIO.mapOptional("blx", PI.BlockMask, 0);
YamlIO.mapOptional("blk", PI.BlockProbes, std::vector<uint64_t>());
YamlIO.mapOptional("call", PI.CallProbes, std::vector<uint64_t>());
YamlIO.mapOptional("icall", PI.IndCallProbes, std::vector<uint64_t>());
YamlIO.mapOptional("id", PI.InlineTreeIndex, 0);
YamlIO.mapOptional("ids", PI.InlineTreeNodes, std::vector<uint32_t>());
YamlIO.mapRequired("guid", PI.GUID);
YamlIO.mapRequired("id", PI.Index);
YamlIO.mapRequired("type", PI.Type);
}

static const bool flow = true;
Expand Down Expand Up @@ -163,35 +158,15 @@ template <> struct MappingTraits<bolt::BinaryBasicBlockProfile> {
std::vector<bolt::CallSiteInfo>());
YamlIO.mapOptional("succ", BBP.Successors,
std::vector<bolt::SuccessorInfo>());
YamlIO.mapOptional("probes", BBP.PseudoProbes,
YamlIO.mapOptional("pseudo_probes", BBP.PseudoProbes,
std::vector<bolt::PseudoProbeInfo>());
}
};

namespace bolt {
struct InlineTreeNode {
uint32_t ParentIndexDelta;
uint32_t CallSiteProbe;
// Index in PseudoProbeDesc.GUID, UINT32_MAX for same as previous (omitted)
uint32_t GUIDIndex;
bool operator==(const InlineTreeNode &) const { return false; }
};
} // end namespace bolt

template <> struct MappingTraits<bolt::InlineTreeNode> {
static void mapping(IO &YamlIO, bolt::InlineTreeNode &ITI) {
YamlIO.mapOptional("g", ITI.GUIDIndex, UINT32_MAX);
YamlIO.mapOptional("p", ITI.ParentIndexDelta, 0);
YamlIO.mapOptional("cs", ITI.CallSiteProbe, 0);
}

static const bool flow = true;
};
} // end namespace yaml
} // end namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::BinaryBasicBlockProfile)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::bolt::InlineTreeNode)

namespace llvm {
namespace yaml {
Expand All @@ -204,7 +179,8 @@ struct BinaryFunctionProfile {
llvm::yaml::Hex64 Hash{0};
uint64_t ExecCount{0};
std::vector<BinaryBasicBlockProfile> Blocks;
std::vector<InlineTreeNode> InlineTree;
llvm::yaml::Hex64 GUID{0};
llvm::yaml::Hex64 PseudoProbeDescHash{0};
bool Used{false};
};
} // end namespace bolt
Expand All @@ -218,8 +194,9 @@ template <> struct MappingTraits<bolt::BinaryFunctionProfile> {
YamlIO.mapRequired("nblocks", BFP.NumBasicBlocks);
YamlIO.mapOptional("blocks", BFP.Blocks,
std::vector<bolt::BinaryBasicBlockProfile>());
YamlIO.mapOptional("inline_tree", BFP.InlineTree,
std::vector<bolt::InlineTreeNode>());
YamlIO.mapOptional("guid", BFP.GUID, (uint64_t)0);
YamlIO.mapOptional("pseudo_probe_desc_hash", BFP.PseudoProbeDescHash,
(uint64_t)0);
}
};

Expand Down Expand Up @@ -269,33 +246,10 @@ template <> struct MappingTraits<bolt::BinaryProfileHeader> {
}
};

namespace bolt {
struct ProfilePseudoProbeDesc {
std::vector<Hex64> GUID;
std::vector<Hex64> Hash;
std::vector<uint32_t> GUIDHashIdx; // Index of hash for that GUID in Hash

bool operator==(const ProfilePseudoProbeDesc &Other) const {
// Only treat empty Desc as equal
return GUID.empty() && Other.GUID.empty() && Hash.empty() &&
Other.Hash.empty() && GUIDHashIdx.empty() &&
Other.GUIDHashIdx.empty();
}
};
} // end namespace bolt

template <> struct MappingTraits<bolt::ProfilePseudoProbeDesc> {
static void mapping(IO &YamlIO, bolt::ProfilePseudoProbeDesc &PD) {
YamlIO.mapRequired("gs", PD.GUID);
YamlIO.mapRequired("gh", PD.GUIDHashIdx);
YamlIO.mapRequired("hs", PD.Hash);
}
};
} // end namespace yaml
} // end namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::BinaryFunctionProfile)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::bolt::ProfilePseudoProbeDesc)

namespace llvm {
namespace yaml {
Expand All @@ -304,16 +258,13 @@ namespace bolt {
struct BinaryProfile {
BinaryProfileHeader Header;
std::vector<BinaryFunctionProfile> Functions;
ProfilePseudoProbeDesc PseudoProbeDesc;
};
} // namespace bolt

template <> struct MappingTraits<bolt::BinaryProfile> {
static void mapping(IO &YamlIO, bolt::BinaryProfile &BP) {
YamlIO.mapRequired("header", BP.Header);
YamlIO.mapRequired("functions", BP.Functions);
YamlIO.mapOptional("pseudo_probe_desc", BP.PseudoProbeDesc,
bolt::ProfilePseudoProbeDesc());
}
};

Expand Down
52 changes: 1 addition & 51 deletions bolt/include/bolt/Profile/YAMLProfileWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,8 @@ class YAMLProfileWriter {
/// Save execution profile for that instance.
std::error_code writeProfile(const RewriteInstance &RI);

using InlineTreeMapTy =
DenseMap<const MCDecodedPseudoProbeInlineTree *, uint32_t>;
struct InlineTreeDesc {
template <typename T> using GUIDMapTy = std::unordered_map<uint64_t, T>;
using GUIDNodeMap = GUIDMapTy<const MCDecodedPseudoProbeInlineTree *>;
using GUIDNumMap = GUIDMapTy<uint32_t>;
GUIDNodeMap TopLevelGUIDToInlineTree;
GUIDNumMap GUIDIdxMap;
GUIDNumMap HashIdxMap;
};

static std::tuple<std::vector<yaml::bolt::InlineTreeNode>, InlineTreeMapTy>
convertBFInlineTree(const MCPseudoProbeDecoder &Decoder,
const InlineTreeDesc &InlineTree, uint64_t GUID);

static std::tuple<yaml::bolt::ProfilePseudoProbeDesc, InlineTreeDesc>
convertPseudoProbeDesc(const MCPseudoProbeDecoder &PseudoProbeDecoder);

static yaml::bolt::BinaryFunctionProfile
convert(const BinaryFunction &BF, bool UseDFS,
const InlineTreeDesc &InlineTree,
const BoltAddressTranslation *BAT = nullptr);

/// Set CallSiteInfo destination fields from \p Symbol and return a target
Expand All @@ -61,39 +42,8 @@ class YAMLProfileWriter {
setCSIDestination(const BinaryContext &BC, yaml::bolt::CallSiteInfo &CSI,
const MCSymbol *Symbol, const BoltAddressTranslation *BAT,
uint32_t Offset = 0);

private:
struct InlineTreeNode {
const MCDecodedPseudoProbeInlineTree *InlineTree;
uint64_t GUID;
uint64_t Hash;
uint32_t ParentId;
uint32_t InlineSite;
};
static std::vector<InlineTreeNode>
collectInlineTree(const MCPseudoProbeDecoder &Decoder,
const MCDecodedPseudoProbeInlineTree &Root);

// 0 - block probe, 1 - indirect call, 2 - direct call
using ProbeList = std::array<SmallVector<uint64_t, 0>, 3>;
using NodeIdToProbes = DenseMap<uint32_t, ProbeList>;
static std::vector<yaml::bolt::PseudoProbeInfo>
convertNodeProbes(NodeIdToProbes &NodeProbes);

public:
template <typename T>
static std::vector<yaml::bolt::PseudoProbeInfo>
writeBlockProbes(T Probes, const InlineTreeMapTy &InlineTreeNodeId) {
NodeIdToProbes NodeProbes;
for (const MCDecodedPseudoProbe &Probe : Probes) {
auto It = InlineTreeNodeId.find(Probe.getInlineTreeNode());
if (It == InlineTreeNodeId.end())
continue;
NodeProbes[It->second][Probe.getType()].emplace_back(Probe.getIndex());
}
return convertNodeProbes(NodeProbes);
}
};

} // namespace bolt
} // namespace llvm

Expand Down
5 changes: 0 additions & 5 deletions bolt/include/bolt/Utils/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ std::string getEscapedName(const StringRef &Name);
/// Return the unescaped name
std::string getUnescapedName(const StringRef &Name);

/// Return a common part for a given \p Name wrt a given \p Suffixes list.
/// Preserve the suffix if \p KeepSuffix is set, only dropping characters
/// following it, otherwise drop the suffix as well.
std::optional<StringRef> getCommonName(const StringRef Name, bool KeepSuffix,
ArrayRef<StringRef> Suffixes);
/// LTO-generated function names take a form:
///
/// <function_name>.lto_priv.<decimal_number>/...
Expand Down
9 changes: 2 additions & 7 deletions bolt/lib/Passes/ADRRelaxationPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,10 @@ void ADRRelaxationPass::runOnFunction(BinaryFunction &BF) {
// Don't relax adr if it points to the same function and it is not split
// and BF initial size is < 1MB.
const unsigned OneMB = 0x100000;
if (BF.getSize() < OneMB) {
if (!BF.isSplit() && BF.getSize() < OneMB) {
BinaryFunction *TargetBF = BC.getFunctionForSymbol(Symbol);
if (TargetBF == &BF && !BF.isSplit())
if (TargetBF && TargetBF == &BF)
continue;
// No relaxation needed if ADR references a basic block in the same
// fragment.
if (BinaryBasicBlock *TargetBB = BF.getBasicBlockForLabel(Symbol))
if (BB.getFragmentNum() == TargetBB->getFragmentNum())
continue;
}

MCPhysReg Reg;
Expand Down
Loading
Loading