diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-07-27 00:01:07 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-07-27 00:01:07 +0000 |
commit | 57e6b2d1f3de0bf459e96f7038e692d624f7e580 (patch) | |
tree | 42204d51445bcb178a24fa07fe9da2d1d22818ff /lib/Analysis | |
parent | 018696db4587dc6a0d8081d0627543f5c08b6c97 (diff) | |
download | external_llvm-57e6b2d1f3de0bf459e96f7038e692d624f7e580.zip external_llvm-57e6b2d1f3de0bf459e96f7038e692d624f7e580.tar.gz external_llvm-57e6b2d1f3de0bf459e96f7038e692d624f7e580.tar.bz2 |
SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions
Merge consecutive if-regions if they contain identical statements.
Both transformations reduce number of branches. The transformation
is guarded by a target-hook, and is currently enabled only for +R600,
but the correctness has been tested on X86 target using a variety of
CPU benchmarks.
Patch by: Mei Ye
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/TargetTransformInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/TargetTransformInfo.cpp b/lib/Analysis/TargetTransformInfo.cpp index 4b2bf3c..4ad7162 100644 --- a/lib/Analysis/TargetTransformInfo.cpp +++ b/lib/Analysis/TargetTransformInfo.cpp @@ -88,6 +88,10 @@ unsigned TargetTransformInfo::getUserCost(const User *U) const { return PrevTTI->getUserCost(U); } +bool TargetTransformInfo::hasBranchDivergence() const { + return PrevTTI->hasBranchDivergence(); +} + bool TargetTransformInfo::isLoweredToCall(const Function *F) const { return PrevTTI->isLoweredToCall(F); } @@ -420,6 +424,8 @@ struct NoTTI : ImmutablePass, TargetTransformInfo { U->getOperand(0)->getType() : 0); } + bool hasBranchDivergence() const { return false; } + bool isLoweredToCall(const Function *F) const { // FIXME: These should almost certainly not be handled here, and instead // handled with the help of TLI or the target itself. This was largely |