forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Xilinx/dominik.bump_llvm_nov_14
Bump to green commit from Nov. 14
- Loading branch information
Showing
4,602 changed files
with
174,615 additions
and
76,840 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===- bolt/Passes/Hugify.h -------------------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef BOLT_PASSES_HUGIFY_H | ||
#define BOLT_PASSES_HUGIFY_H | ||
|
||
#include "bolt/Passes/BinaryPasses.h" | ||
|
||
namespace llvm { | ||
namespace bolt { | ||
|
||
class HugePage : public BinaryFunctionPass { | ||
public: | ||
HugePage(const cl::opt<bool> &PrintPass) : BinaryFunctionPass(PrintPass) {} | ||
|
||
void runOnFunctions(BinaryContext &BC) override; | ||
|
||
const char *getName() const override { return "HugePage"; } | ||
}; | ||
|
||
} // namespace bolt | ||
} // namespace llvm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
bolt/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//===-- RuntimeLibraryVariables.inc.in - bolt build variables -*- C++ -*---===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file is configured by the build system to define the runtime library | ||
// location. | ||
// | ||
// The variant of this file not ending with .in has been autogenerated by the | ||
// LLVM build. Do not edit! | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//===--- bolt/Passes/Hugify.cpp -------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "bolt/Passes/Hugify.h" | ||
#include "llvm/Support/CommandLine.h" | ||
|
||
#define DEBUG_TYPE "bolt-hugify" | ||
|
||
using namespace llvm; | ||
|
||
namespace llvm { | ||
namespace bolt { | ||
|
||
void HugePage::runOnFunctions(BinaryContext &BC) { | ||
auto *RtLibrary = BC.getRuntimeLibrary(); | ||
if (!RtLibrary || !BC.isELF() || !BC.StartFunctionAddress) { | ||
return; | ||
} | ||
|
||
auto createSimpleFunction = | ||
[&](std::string Title, std::vector<MCInst> Instrs) -> BinaryFunction * { | ||
BinaryFunction *Func = BC.createInjectedBinaryFunction(Title); | ||
|
||
std::vector<std::unique_ptr<BinaryBasicBlock>> BBs; | ||
BBs.emplace_back(Func->createBasicBlock(nullptr)); | ||
BBs.back()->addInstructions(Instrs.begin(), Instrs.end()); | ||
BBs.back()->setCFIState(0); | ||
BBs.back()->setOffset(BinaryBasicBlock::INVALID_OFFSET); | ||
|
||
Func->insertBasicBlocks(nullptr, std::move(BBs), | ||
/*UpdateLayout=*/true, | ||
/*UpdateCFIState=*/false); | ||
Func->updateState(BinaryFunction::State::CFG_Finalized); | ||
return Func; | ||
}; | ||
|
||
const BinaryFunction *const Start = | ||
BC.getBinaryFunctionAtAddress(*BC.StartFunctionAddress); | ||
assert(Start && "Entry point function not found"); | ||
const MCSymbol *StartSym = Start->getSymbol(); | ||
createSimpleFunction("__bolt_hugify_start_program", | ||
BC.MIB->createSymbolTrampoline(StartSym, BC.Ctx.get())); | ||
} | ||
} // namespace bolt | ||
} // namespace llvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.