#
e9425c4f |
| 04-Feb-2017 |
Kyle Butt <kyle+llvm@iteratee.net> |
[CodeGen]: BlockPlacement: Apply const liberally. NFC
Anything that needs to be passed to AnalyzeBranch unfortunately can't be const, or more would be const. Added const_iterator to BlockChain to al
[CodeGen]: BlockPlacement: Apply const liberally. NFC
Anything that needs to be passed to AnalyzeBranch unfortunately can't be const, or more would be const. Added const_iterator to BlockChain to allow BlockChain to be const when we don't expect to change it.
llvm-svn: 294085
show more ...
|
#
58fcc9bd |
| 02-Feb-2017 |
Xinliang David Li <davidxl@google.com> |
[PGO] internal option cleanups
1. Added comments for options 2. Added missing option cl::desc field 3. Uniified function filter option for graph viewing. Now PGO count/raw-counts share the same
[PGO] internal option cleanups
1. Added comments for options 2. Added missing option cl::desc field 3. Uniified function filter option for graph viewing. Now PGO count/raw-counts share the same filter option: -view-bfi-func-name=.
llvm-svn: 293938
show more ...
|
#
1eb4ec6a |
| 02-Feb-2017 |
Xinliang David Li <davidxl@google.com> |
[PGO] make graph view internal options available for all builds
Differential Revision: https://reviews.llvm.org/D29259
llvm-svn: 293921
|
#
b15c0667 |
| 31-Jan-2017 |
Kyle Butt <kyle+llvm@iteratee.net> |
CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred a block that preserves the CFG unless there is a strong prob
CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred a block that preserves the CFG unless there is a strong probability the other direction. For small blocks that can be duplicated we now skip that requirement as well, subject to some simple frequency calculations.
Differential Revision: https://reviews.llvm.org/D28583
llvm-svn: 293716
show more ...
|
#
fd3f645f |
| 29-Jan-2017 |
Xinliang David Li <davidxl@google.com> |
Add support to dump dot graph block layout after MBP
Differential Revision: https://reviews.llvm.org/D29141
llvm-svn: 293408
|
Revision tags: llvmorg-4.0.0-rc1 |
|
#
efe56fed |
| 11-Jan-2017 |
Kyle Butt <kyle+llvm@iteratee.net> |
Revert "CodeGen: Allow small copyable blocks to "break" the CFG."
This reverts commit ada6595a526d71df04988eb0a4b4fe84df398ded.
This needs a simple probability check because there are some cases wh
Revert "CodeGen: Allow small copyable blocks to "break" the CFG."
This reverts commit ada6595a526d71df04988eb0a4b4fe84df398ded.
This needs a simple probability check because there are some cases where it is not profitable.
llvm-svn: 291695
show more ...
|
#
df27aa8c |
| 10-Jan-2017 |
Kyle Butt <kyle+llvm@iteratee.net> |
CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred a block that preserves the CFG unless there is a strong prob
CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred a block that preserves the CFG unless there is a strong probability the other direction. For small blocks that can be duplicated we now skip that requirement as well.
Differential revision: https://reviews.llvm.org/D27742
llvm-svn: 291609
show more ...
|
#
34f9d6ac |
| 15-Dec-2016 |
Hal Finkel <hfinkel@anl.gov> |
Trying to fix NDEBUG build after r289764
llvm-svn: 289766
|
#
d7389d62 |
| 15-Dec-2016 |
Sanjoy Das <sanjoy@playingwithpointers.com> |
[MachineBlockPlacement] Don't make blocks "uneditable"
Summary: This fixes an issue with MachineBlockPlacement due to a badly timed call to `analyzeBranch` with `AllowModify` set to true. The timel
[MachineBlockPlacement] Don't make blocks "uneditable"
Summary: This fixes an issue with MachineBlockPlacement due to a badly timed call to `analyzeBranch` with `AllowModify` set to true. The timeline is as follows:
1. `MachineBlockPlacement::maybeTailDuplicateBlock` calls `TailDup.shouldTailDuplicate` on its argument, which in turn calls `analyzeBranch` with `AllowModify` set to true.
2. This `analyzeBranch` call edits the terminator sequence of the block based on the physical layout of the machine function, turning an unanalyzable non-fallthrough block to a unanalyzable fallthrough block. Normally MBP bails out of rearranging such blocks, but this block was unanalyzable non-fallthrough (and thus rearrangeable) the first time MBP looked at it, and so it goes ahead and decides where it should be placed in the function.
3. When placing this block MBP fails to analyze and thus update the block in keeping with the new physical layout.
Concretely, before (1) we have something like:
``` LBL0: < unknown terminator op that may branch to LBL1 > jmp LBL1
LBL1: ... A
LBL2: ... B ```
In (2), analyze branch simplifies this to
``` LBL0: < unknown terminator op that may branch to LBL2 > ;; jmp LBL1 <- redundant jump removed
LBL1: ... A
LBL2: ... B ```
In (3), MachineBlockPlacement goes ahead with its plan of putting LBL2 after the first block since that is profitable.
``` LBL0: < unknown terminator op that may branch to LBL2 > ;; jmp LBL1 <- redundant jump
LBL2: ... B
LBL1: ... A ```
and the program now has incorrect behavior (we no longer fall-through from `LBL0` to `LBL1`) because MBP can no longer edit LBL0.
There are several possible solutions, but I went with removing the teeth off of the `analyzeBranch` calls in TailDuplicator. That makes thinking about the result of these calls easier, and breaks nothing in the lit test suite.
I've also added some bookkeeping to the MachineBlockPlacement pass and used that to write an assert that would have caught this.
Reviewers: chandlerc, gberry, MatzeB, iteratee
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D27783
llvm-svn: 289764
show more ...
|
Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1 |
|
#
66827427 |
| 16-Nov-2016 |
Rong Xu <xur@google.com> |
Make block placement deterministic
We fail to produce bit-to-bit matching stage2 and stage3 compiler in PGO bootstrap build. The reason is because LoopBlockSet is of SmallPtrSet type whose iterating
Make block placement deterministic
We fail to produce bit-to-bit matching stage2 and stage3 compiler in PGO bootstrap build. The reason is because LoopBlockSet is of SmallPtrSet type whose iterating order depends on the pointer value.
This patch fixes this issue by changing to use SmallSetVector.
Differential Revision: http://reviews.llvm.org/D26634
llvm-svn: 287148
show more ...
|
#
690f8e58 |
| 01-Nov-2016 |
Eric Christopher <echristo@gmail.com> |
Move the initialization of PreferredLoopExit into runOnMachineFunction to be near the other function specific initializations.
llvm-svn: 285758
|
#
2a36eee4 |
| 01-Nov-2016 |
Sam McCall <sam.mccall@gmail.com> |
Fix uninitialized access in MachineBlockPlacement.
Summary: Currently PreferredLoopExit is set only in buildLoopChains, which is never called if there are no MachineLoops.
MSan is currently broken
Fix uninitialized access in MachineBlockPlacement.
Summary: Currently PreferredLoopExit is set only in buildLoopChains, which is never called if there are no MachineLoops.
MSan is currently broken by this: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/145/steps/check-llvm%20msan/logs/stdio
This is a naive fix to get things green again. iteratee: you may have a better fix.
This change will also mean PreferredLoopExit will not carry over if buildCFGChains() is called a second time in runOnMachineFunction, this appears to be the right thing.
Reviewers: bkramer, iteratee, echristo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26069
llvm-svn: 285757
show more ...
|
#
ab9cca7b |
| 27-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
CodeGen: Handle missed case of block removal during BlockPlacement.
There is a use after free bug in the existing code. Loop layout selects a preferred exit block, and then lays out the loop. If thi
CodeGen: Handle missed case of block removal during BlockPlacement.
There is a use after free bug in the existing code. Loop layout selects a preferred exit block, and then lays out the loop. If this block is removed during layout, it needs to be invalidated to prevent a use after free.
llvm-svn: 285348
show more ...
|
#
0846e56e |
| 11-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise whe
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise when blocks are outlined. Because we want the updated CFG to affect subsequent placement decisions, this change must occur during placement.
In order to achieve this goal, TailDuplicationPass is split into a utility class, TailDuplicator, and the pass itself. The pass delegates nearly everything to the TailDuplicator object, except for looping over the blocks in a function. This allows the same code to be used for tail duplication in both places.
This change, in concert with outlining optional branches, allows triangle shaped code to perform much better, esepecially when the taken/untaken branches are correlated, as it creates a second spine when the tests are small enough.
Issue from previous rollback fixed, and a new test was added for that case as well. Issue was worklist/scheduling/taildup issue in layout.
Issue from 2nd rollback fixed, with 2 additional tests. Issue was tail merging/loop info/tail-duplication causing issue with loops that share a header block.
Issue with early tail-duplication of blocks that branch to a fallthrough predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll
Differential revision: https://reviews.llvm.org/D18226
llvm-svn: 283934
show more ...
|
#
0c42dc47 |
| 11-Oct-2016 |
Daniel Jasper <djasper@google.com> |
Revert "Codegen: Tail-duplicate during placement."
This reverts commit r283842.
test/CodeGen/X86/tail-dup-repeat.ll causes and llc crash with our internal testing. I'll share a link with you.
llvm
Revert "Codegen: Tail-duplicate during placement."
This reverts commit r283842.
test/CodeGen/X86/tail-dup-repeat.ll causes and llc crash with our internal testing. I'll share a link with you.
llvm-svn: 283857
show more ...
|
#
ae068a32 |
| 11-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise whe
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise when blocks are outlined. Because we want the updated CFG to affect subsequent placement decisions, this change must occur during placement.
In order to achieve this goal, TailDuplicationPass is split into a utility class, TailDuplicator, and the pass itself. The pass delegates nearly everything to the TailDuplicator object, except for looping over the blocks in a function. This allows the same code to be used for tail duplication in both places.
This change, in concert with outlining optional branches, allows triangle shaped code to perform much better, esepecially when the taken/untaken branches are correlated, as it creates a second spine when the tests are small enough.
Issue from previous rollback fixed, and a new test was added for that case as well. Issue was worklist/scheduling/taildup issue in layout.
Issue from 2nd rollback fixed, with 2 additional tests. Issue was tail merging/loop info/tail-duplication causing issue with loops that share a header block.
Issue with early tail-duplication of blocks that branch to a fallthrough predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll
Differential revision: https://reviews.llvm.org/D18226
llvm-svn: 283842
show more ...
|
#
2facd194 |
| 08-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Revert "Codegen: Tail-duplicate during placement."
This reverts commit 71c312652c10f1855b28d06697c08d47e7a243e4.
llvm-svn: 283647
|
#
37e676d8 |
| 07-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise whe
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise when blocks are outlined. Because we want the updated CFG to affect subsequent placement decisions, this change must occur during placement.
In order to achieve this goal, TailDuplicationPass is split into a utility class, TailDuplicator, and the pass itself. The pass delegates nearly everything to the TailDuplicator object, except for looping over the blocks in a function. This allows the same code to be used for tail duplication in both places.
This change, in concert with outlining optional branches, allows triangle shaped code to perform much better, esepecially when the taken/untaken branches are correlated, as it creates a second spine when the tests are small enough.
Issue from previous rollback fixed, and a new test was added for that case as well. Issue was worklist/scheduling/taildup issue in layout.
Issue from 2nd rollback fixed, with 2 additional tests. Issue was tail merging/loop info/tail-duplication causing issue with loops that share a header block.
Differential revision: https://reviews.llvm.org/D18226
llvm-svn: 283619
show more ...
|
#
25ac35d8 |
| 05-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Revert "Codegen: Tail-duplicate during placement."
This reverts commit 062ace9764953e9769142c1099281a345f9b6bdc.
Issue with loop info and block removal revealed by polly. I have a fix for this issu
Revert "Codegen: Tail-duplicate during placement."
This reverts commit 062ace9764953e9769142c1099281a345f9b6bdc.
Issue with loop info and block removal revealed by polly. I have a fix for this issue already in another patch, I'll re-roll this together with that fix, and a test case.
llvm-svn: 283292
show more ...
|
#
adabac2d |
| 04-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise whe
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise when blocks are outlined. Because we want the updated CFG to affect subsequent placement decisions, this change must occur during placement.
In order to achieve this goal, TailDuplicationPass is split into a utility class, TailDuplicator, and the pass itself. The pass delegates nearly everything to the TailDuplicator object, except for looping over the blocks in a function. This allows the same code to be used for tail duplication in both places.
This change, in concert with outlining optional branches, allows triangle shaped code to perform much better, esepecially when the taken/untaken branches are correlated, as it creates a second spine when the tests are small enough.
Issue from previous rollback fixed, and a new test was added for that case as well.
Differential revision: https://reviews.llvm.org/D18226
llvm-svn: 283274
show more ...
|
#
3ffb8529 |
| 04-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Revert "Codegen: Tail-duplicate during placement."
This reverts commit ff234efbe23528e4f4c80c78057b920a51f434b2.
Causing crashes on aarch64 build.
llvm-svn: 283172
|
#
396bfdd7 |
| 04-Oct-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise whe
Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication decisions. This is fine, but passes up duplication opportunities that may arise when blocks are outlined. Because we want the updated CFG to affect subsequent placement decisions, this change must occur during placement.
In order to achieve this goal, TailDuplicationPass is split into a utility class, TailDuplicator, and the pass itself. The pass delegates nearly everything to the TailDuplicator object, except for looping over the blocks in a function. This allows the same code to be used for tail duplication in both places.
This change, in concert with outlining optional branches, allows triangle shaped code to perform much better, esepecially when the taken/untaken branches are correlated, as it creates a second spine when the tests are small enough.
llvm-svn: 283164
show more ...
|
#
1b9fc8ed |
| 14-Sep-2016 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Finish renaming remaining analyzeBranch functions
llvm-svn: 281535
|
#
e8e0f5ca |
| 14-Sep-2016 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
Make analyzeBranch family of instruction names consistent
analyzeBranch was renamed to use lowercase first, rename the related set to match.
llvm-svn: 281506
|
Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2 |
|
#
64e42814 |
| 18-Aug-2016 |
Kyle Butt <kyle+llvm@iteratee.net> |
Branch Folding: Accept explicit threshold for tail merge size.
This is prep work for allowing the threshold to be different during layout, and to enforce a single threshold between merging and dupli
Branch Folding: Accept explicit threshold for tail merge size.
This is prep work for allowing the threshold to be different during layout, and to enforce a single threshold between merging and duplicating during layout. No observable change intended.
llvm-svn: 279117
show more ...
|