summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorVincent Lejeune <vljn@ovi.com>2013-12-07 01:49:19 +0000
committerVincent Lejeune <vljn@ovi.com>2013-12-07 01:49:19 +0000
commit92b0a64906757ded834bc6e9f8915d889402f3c2 (patch)
treec9a69c1fb74d053799bf2bfa187cdc9541c7ccaa /llvm/lib/CodeGen/BranchFolding.cpp
parentae7e96062cd49436cee8fa8459c0e9e316fb9fd1 (diff)
downloadbcm5719-llvm-92b0a64906757ded834bc6e9f8915d889402f3c2.tar.gz
bcm5719-llvm-92b0a64906757ded834bc6e9f8915d889402f3c2.zip
Add a RequireStructuredCFG Field to TargetMachine.
llvm-svn: 196634
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 9cd4208d646..a4a3712de8b 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -83,7 +83,11 @@ INITIALIZE_PASS(BranchFolderPass, "branch-folder",
bool BranchFolderPass::runOnMachineFunction(MachineFunction &MF) {
TargetPassConfig *PassConfig = &getAnalysis<TargetPassConfig>();
- BranchFolder Folder(PassConfig->getEnableTailMerge(), /*CommonHoist=*/true);
+ // TailMerge can create jump into if branches that make CFG irreducible for
+ // HW that requires structurized CFG.
+ bool EnableTailMerge = !MF.getTarget().requiresStructuredCFG() &&
+ PassConfig->getEnableTailMerge();
+ BranchFolder Folder(EnableTailMerge, /*CommonHoist=*/true);
return Folder.OptimizeFunction(MF,
MF.getTarget().getInstrInfo(),
MF.getTarget().getRegisterInfo(),
OpenPOWER on IntegriCloud