forked from OSchip/llvm-project
Disable LoopSimplifyCFG terminator folding by default
llvm-svn: 347486
This commit is contained in:
parent
5f8fc76b4e
commit
e1c2dc27d3
|
@ -41,6 +41,9 @@ using namespace llvm;
|
||||||
|
|
||||||
#define DEBUG_TYPE "loop-simplifycfg"
|
#define DEBUG_TYPE "loop-simplifycfg"
|
||||||
|
|
||||||
|
static cl::opt<bool> EnableTermFolding("enable-loop-simplifycfg-term-folding",
|
||||||
|
cl::init(false));
|
||||||
|
|
||||||
STATISTIC(NumTerminatorsFolded,
|
STATISTIC(NumTerminatorsFolded,
|
||||||
"Number of terminators folded to unconditional branches");
|
"Number of terminators folded to unconditional branches");
|
||||||
|
|
||||||
|
@ -352,6 +355,9 @@ public:
|
||||||
/// Turn branches and switches with known constant conditions into unconditional
|
/// Turn branches and switches with known constant conditions into unconditional
|
||||||
/// branches.
|
/// branches.
|
||||||
static bool constantFoldTerminators(Loop &L, DominatorTree &DT, LoopInfo &LI) {
|
static bool constantFoldTerminators(Loop &L, DominatorTree &DT, LoopInfo &LI) {
|
||||||
|
if (!EnableTermFolding)
|
||||||
|
return false;
|
||||||
|
|
||||||
// To keep things simple, only process loops with single latch. We
|
// To keep things simple, only process loops with single latch. We
|
||||||
// canonicalize most loops to this form. We can support multi-latch if needed.
|
// canonicalize most loops to this form. We can support multi-latch if needed.
|
||||||
if (!L.getLoopLatch())
|
if (!L.getLoopLatch())
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||||
; REQUIRES: asserts
|
; REQUIRES: asserts
|
||||||
; RUN: opt -S -loop-simplifycfg -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
|
; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
|
||||||
; RUN: opt -S -passes='require<domtree>,loop(simplify-cfg)' -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
|
; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(simplify-cfg)' -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
|
||||||
; RUN: opt -S -loop-simplifycfg -enable-mssa-loop-dependency=true -verify-memoryssa -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
|
; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -enable-mssa-loop-dependency=true -verify-memoryssa -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
|
||||||
|
|
||||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||||
; RUN: opt -S -loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
|
; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
|
||||||
; RUN: opt -S -passes='require<domtree>,loop(simplify-cfg)' -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
|
; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(simplify-cfg)' -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
|
||||||
; RUN: opt -S -loop-simplifycfg -enable-mssa-loop-dependency=true -verify-memoryssa -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
|
; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -loop-simplifycfg -enable-mssa-loop-dependency=true -verify-memoryssa -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
|
||||||
|
|
||||||
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
|
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue