Skip to content

Commit 4123fb3

Browse files
committed
fix conflicts
Signed-off-by: jinge90 <[email protected]>
2 parents 9b117ee + f4f83d9 commit 4123fb3

File tree

13,035 files changed

+632384
-883342
lines changed

Some content is hidden

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

13,035 files changed

+632384
-883342
lines changed

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ jobs:
151151
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-cov
152152
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-profdata
153153
cmake --build $GITHUB_WORKSPACE/build --target install-compiler-rt
154-
# TODO this should be resolved in CMakeLists.txt
155-
cmake --build $GITHUB_WORKSPACE/build --target install-lld || echo "skipped"
156154
157155
- name: Pack toolchain
158156
run: tar -cJf llvm_sycl.tar.xz -C $GITHUB_WORKSPACE/build/install .

bolt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Once you have `perf.fdata` ready, you can use it for optimizations with
180180
BOLT. Assuming your environment is setup to include the right path, execute
181181
`llvm-bolt`:
182182
```
183-
$ llvm-bolt <executable> -o <executable>.bolt -data=perf.fdata -reorder-blocks=ext-tsp -reorder-functions=hfsort -split-functions=2 -split-all-cold -split-eh -dyno-stats
183+
$ llvm-bolt <executable> -o <executable>.bolt -data=perf.fdata -reorder-blocks=ext-tsp -reorder-functions=hfsort -split-functions -split-all-cold -split-eh -dyno-stats
184184
```
185185

186186
If you do need an updated debug info, then add `-update-debug-sections` option

bolt/docs/OptimizingClang.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Notice that we are passing `clang-7` to `perf2bolt` which is the real binary tha
6464
the generated profile:
6565
```bash
6666
$ llvm-bolt $CPATH/clang-7 -o $CPATH/clang-7.bolt -b clang-7.yaml \
67-
-reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions=3 \
67+
-reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions \
6868
-split-all-cold -dyno-stats -icf=1 -use-gnu-stack
6969
```
7070
The output will look similar to the one below:

bolt/include/bolt/Core/BinaryBasicBlock.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,12 @@ class BinaryBasicBlock {
634634

635635
/// Test if BB is a predecessor of this block.
636636
bool isPredecessor(const BinaryBasicBlock *BB) const {
637-
auto Itr = std::find(Predecessors.begin(), Predecessors.end(), BB);
638-
return Itr != Predecessors.end();
637+
return llvm::is_contained(Predecessors, BB);
639638
}
640639

641640
/// Test if BB is a successor of this block.
642641
bool isSuccessor(const BinaryBasicBlock *BB) const {
643-
auto Itr = std::find(Successors.begin(), Successors.end(), BB);
644-
return Itr != Successors.end();
642+
return llvm::is_contained(Successors, BB);
645643
}
646644

647645
/// Test if this BB has a valid execution count.

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,14 @@ class BinaryContext {
498498
/// to function \p BF.
499499
std::string generateJumpTableName(const BinaryFunction &BF, uint64_t Address);
500500

501+
/// Free memory used by jump table offsets
502+
void clearJumpTableOffsets() {
503+
for (auto &JTI : JumpTables) {
504+
JumpTable &JT = *JTI.second;
505+
JumpTable::OffsetsType Temp;
506+
Temp.swap(JT.OffsetEntries);
507+
}
508+
}
501509
/// Return true if the array of bytes represents a valid code padding.
502510
bool hasValidCodePadding(const BinaryFunction &BF);
503511

bolt/include/bolt/Core/BinaryData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class BinaryData {
112112
bool nameStartsWith(StringRef Prefix) const;
113113

114114
bool hasSymbol(const MCSymbol *Symbol) const {
115-
return std::find(Symbols.begin(), Symbols.end(), Symbol) != Symbols.end();
115+
return llvm::is_contained(Symbols, Symbol);
116116
}
117117

118118
bool isAbsolute() const;

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,8 @@ class BinaryFunction {
716716
BB->setOffset(Offset);
717717

718718
BasicBlockOffsets.emplace_back(Offset, BB);
719-
assert(std::is_sorted(BasicBlockOffsets.begin(), BasicBlockOffsets.end(),
720-
CompareBasicBlockOffsets()) &&
721-
std::is_sorted(begin(), end()));
719+
assert(llvm::is_sorted(BasicBlockOffsets, CompareBasicBlockOffsets()) &&
720+
llvm::is_sorted(blocks()));
722721

723722
return BB;
724723
}
@@ -888,8 +887,9 @@ class BinaryFunction {
888887

889888
/// Update layout of basic blocks used for output.
890889
void updateBasicBlockLayout(BasicBlockOrderType &NewLayout) {
891-
BasicBlocksPreviousLayout = BasicBlocksLayout;
890+
assert(NewLayout.size() == BasicBlocks.size() && "Layout size mismatch.");
892891

892+
BasicBlocksPreviousLayout = BasicBlocksLayout;
893893
if (NewLayout != BasicBlocksLayout) {
894894
ModifiedLayout = true;
895895
BasicBlocksLayout.clear();

bolt/include/bolt/Core/DynoStats.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ DynoStats getDynoStats(const BinaryFunction &BF);
146146

147147
/// Return program-wide dynostats.
148148
template <typename FuncsType>
149-
inline DynoStats getDynoStats(const FuncsType &Funcs) {
150-
bool IsAArch64 = Funcs.begin()->second.getBinaryContext().isAArch64();
149+
inline DynoStats getDynoStats(const FuncsType &Funcs, bool IsAArch64) {
151150
DynoStats dynoStats(IsAArch64);
152151
for (auto &BFI : Funcs) {
153152
auto &BF = BFI.second;
@@ -160,16 +159,16 @@ inline DynoStats getDynoStats(const FuncsType &Funcs) {
160159
/// Call a function with optional before and after dynostats printing.
161160
template <typename FnType, typename FuncsType>
162161
inline void callWithDynoStats(FnType &&Func, const FuncsType &Funcs,
163-
StringRef Phase, const bool Flag) {
164-
bool IsAArch64 = Funcs.begin()->second.getBinaryContext().isAArch64();
162+
StringRef Phase, const bool Flag,
163+
bool IsAArch64) {
165164
DynoStats DynoStatsBefore(IsAArch64);
166165
if (Flag)
167-
DynoStatsBefore = getDynoStats(Funcs);
166+
DynoStatsBefore = getDynoStats(Funcs, IsAArch64);
168167

169168
Func();
170169

171170
if (Flag) {
172-
const DynoStats DynoStatsAfter = getDynoStats(Funcs);
171+
const DynoStats DynoStatsAfter = getDynoStats(Funcs, IsAArch64);
173172
const bool Changed = (DynoStatsAfter != DynoStatsBefore);
174173
outs() << "BOLT-INFO: program-wide dynostats after running " << Phase
175174
<< (Changed ? "" : " (no change)") << ":\n\n"

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,14 @@ class MCPlusBuilder {
10461046
/// Return handler and action info for invoke instruction if present.
10471047
Optional<MCPlus::MCLandingPad> getEHInfo(const MCInst &Inst) const;
10481048

1049-
// Add handler and action info for call instruction.
1049+
/// Add handler and action info for call instruction.
10501050
void addEHInfo(MCInst &Inst, const MCPlus::MCLandingPad &LP);
10511051

1052+
/// Update exception-handling info for the invoke instruction \p Inst.
1053+
/// Return true on success and false otherwise, e.g. if the instruction is
1054+
/// not an invoke.
1055+
bool updateEHInfo(MCInst &Inst, const MCPlus::MCLandingPad &LP);
1056+
10521057
/// Return non-negative GNU_args_size associated with the instruction
10531058
/// or -1 if there's no associated info.
10541059
int64_t getGnuArgsSize(const MCInst &Inst) const;

bolt/include/bolt/Passes/BinaryPasses.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class DynoStatsPrintPass : public BinaryFunctionPass {
7171
bool shouldPrint(const BinaryFunction &BF) const override { return false; }
7272

7373
void runOnFunctions(BinaryContext &BC) override {
74-
const DynoStats NewDynoStats = getDynoStats(BC.getBinaryFunctions());
74+
const DynoStats NewDynoStats =
75+
getDynoStats(BC.getBinaryFunctions(), BC.isAArch64());
7576
const bool Changed = (NewDynoStats != PrevDynoStats);
7677
outs() << "BOLT-INFO: program-wide dynostats " << Title
7778
<< (Changed ? "" : " (no change)") << ":\n\n"

0 commit comments

Comments
 (0)