SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions
authorTom Stellard <thomas.stellard@amd.com>
Sat, 27 Jul 2013 00:01:07 +0000 (00:01 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Sat, 27 Jul 2013 00:01:07 +0000 (00:01 +0000)
commit57e6b2d1f3de0bf459e96f7038e692d624f7e580
tree42204d51445bcb178a24fa07fe9da2d1d22818ff
parent018696db4587dc6a0d8081d0627543f5c08b6c97
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
17 files changed:
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/InitializePasses.h
include/llvm/Transforms/Scalar.h
include/llvm/Transforms/Utils/Local.h
lib/Analysis/TargetTransformInfo.cpp
lib/CodeGen/BasicTargetTransformInfo.cpp
lib/Target/R600/AMDGPU.h
lib/Target/R600/AMDGPUTargetMachine.cpp
lib/Target/R600/AMDGPUTargetMachine.h
lib/Target/R600/AMDGPUTargetTransformInfo.cpp [new file with mode: 0644]
lib/Target/R600/CMakeLists.txt
lib/Transforms/IPO/PassManagerBuilder.cpp
lib/Transforms/Scalar/Scalar.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
tools/lto/LTOCodeGenerator.cpp
tools/opt/opt.cpp