diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-03-11 19:30:30 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-03-11 19:30:30 +0000 |
commit | 950d3db5f478a84242a90cafce0d8dfc4f8b1152 (patch) | |
tree | 88826e3fe1fc3cb62f89d113c8722abf9479bc95 | |
parent | 4839ded3bdf83a47c581b818e295669533cc9a9b (diff) | |
download | external_llvm-950d3db5f478a84242a90cafce0d8dfc4f8b1152.zip external_llvm-950d3db5f478a84242a90cafce0d8dfc4f8b1152.tar.gz external_llvm-950d3db5f478a84242a90cafce0d8dfc4f8b1152.tar.bz2 |
Revert r127459, "Optimize trivial branches in CodeGenPrepare, which often get
created from the", it broke some GCC test suite tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127477 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 14 | ||||
-rw-r--r-- | test/CodeGen/ARM/constants.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/CellSPU/jumptable.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb/dyn-stackalloc.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/2009-09-28-ITBlockBug.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/cross-rc-coalescing-2.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/X86/2008-04-16-ReMatBug.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/X86/MachineSink-PHIUse.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/X86/personality.ll | 4 | ||||
-rw-r--r-- | test/CodeGen/X86/pr3366.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/X86/sext-i1.ll | 4 | ||||
-rw-r--r-- | test/CodeGen/X86/zext-extract_subreg.ll | 1 | ||||
-rw-r--r-- | test/MC/ARM/simple-encoding.ll | 2 | ||||
-rw-r--r-- | test/Transforms/CodeGenPrepare/basic.ll | 3 |
16 files changed, 17 insertions, 31 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index f0babcc..887fa9f 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -58,10 +58,6 @@ STATISTIC(NumMemoryInsts, "Number of memory instructions whose address " STATISTIC(NumExtsMoved, "Number of [s|z]ext instructions combined with loads"); STATISTIC(NumExtUses, "Number of uses of [s|z]ext instructions optimized"); -static cl::opt<bool> DisableBranchOpts( - "disable-cgp-branch-opts", cl::Hidden, cl::init(false), - cl::desc("Disable branch optimizations in CodeGenPrepare")); - namespace { class CodeGenPrepare : public FunctionPass { /// TLI - Keep a pointer of a TargetLowering to consult for determining @@ -134,16 +130,6 @@ bool CodeGenPrepare::runOnFunction(Function &F) { SunkAddrs.clear(); - if (!DisableBranchOpts) { - MadeChange = false; - for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) - MadeChange |= ConstantFoldTerminator(BB); - - if (MadeChange && DT) - DT->DT->recalculate(F); - EverMadeChange |= MadeChange; - } - return EverMadeChange; } diff --git a/test/CodeGen/ARM/constants.ll b/test/CodeGen/ARM/constants.ll index a66ee41..542cf02 100644 --- a/test/CodeGen/ARM/constants.ll +++ b/test/CodeGen/ARM/constants.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=arm -disable-cgp-branch-opts | FileCheck %s +; RUN: llc < %s -march=arm | FileCheck %s define i32 @f1() { ; CHECK: f1 diff --git a/test/CodeGen/CellSPU/jumptable.ll b/test/CodeGen/CellSPU/jumptable.ll index 87376ef..42b41b3 100644 --- a/test/CodeGen/CellSPU/jumptable.ll +++ b/test/CodeGen/CellSPU/jumptable.ll @@ -1,4 +1,4 @@ -;RUN: llc --march=cellspu -disable-cgp-branch-opts %s -o - | FileCheck %s +;RUN: llc --march=cellspu %s -o - | FileCheck %s ; This is to check that emitting jumptables doesn't crash llc define i32 @test(i32 %param) { entry: diff --git a/test/CodeGen/Thumb/dyn-stackalloc.ll b/test/CodeGen/Thumb/dyn-stackalloc.ll index e698e00..1f31dca 100644 --- a/test/CodeGen/Thumb/dyn-stackalloc.ll +++ b/test/CodeGen/Thumb/dyn-stackalloc.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts | FileCheck %s +; RUN: llc < %s -mtriple=thumb-apple-darwin | FileCheck %s %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* } %struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* } diff --git a/test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll b/test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll index ff68e66..550b3ef 100644 --- a/test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll +++ b/test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll @@ -8,7 +8,7 @@ entry: ; CHECK: sub sp, #8 ; CHECK: push ; CHECK: add r7, sp, #4 -; CHECK: sub.w r4, r7, #4 +; CHECK: subs r4, r7, #4 ; CHECK: mov sp, r4 ; CHECK-NOT: mov sp, r7 ; CHECK: add sp, #8 diff --git a/test/CodeGen/Thumb2/2009-09-28-ITBlockBug.ll b/test/CodeGen/Thumb2/2009-09-28-ITBlockBug.ll index ac3e80a..b2ed8fc 100644 --- a/test/CodeGen/Thumb2/2009-09-28-ITBlockBug.ll +++ b/test/CodeGen/Thumb2/2009-09-28-ITBlockBug.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -disable-cgp-branch-opts | FileCheck %s +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 | FileCheck %s %struct.pix_pos = type { i32, i32, i32, i32, i32, i32 } diff --git a/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll b/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll index d2140a1..313728c 100644 --- a/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll +++ b/test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll @@ -8,7 +8,7 @@ declare void @bar() nounwind optsize define void @foo() nounwind optsize { ; CHECK: foo: ; CHECK: push -; CHECK: mov r7, sp +; CHECK: add r7, sp, #4 ; CHECK: sub sp, #4 entry: %m.i = alloca %struct.buf*, align 4 diff --git a/test/CodeGen/Thumb2/cross-rc-coalescing-2.ll b/test/CodeGen/Thumb2/cross-rc-coalescing-2.ll index edbf834..b8c8cb1 100644 --- a/test/CodeGen/Thumb2/cross-rc-coalescing-2.ll +++ b/test/CodeGen/Thumb2/cross-rc-coalescing-2.ll @@ -6,6 +6,8 @@ entry: br label %bb5 bb5: ; preds = %bb5, %entry +; CHECK: %bb5 +; CHECK: bne br i1 undef, label %bb5, label %bb.nph bb.nph: ; preds = %bb5 diff --git a/test/CodeGen/X86/2008-04-16-ReMatBug.ll b/test/CodeGen/X86/2008-04-16-ReMatBug.ll index bfe8ef5..6e8891b 100644 --- a/test/CodeGen/X86/2008-04-16-ReMatBug.ll +++ b/test/CodeGen/X86/2008-04-16-ReMatBug.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=i386-apple-darwin -disable-cgp-branch-opts | grep movw | not grep {, %e} +; RUN: llc < %s -mtriple=i386-apple-darwin | grep movw | not grep {, %e} %struct.DBC_t = type { i32, i8*, i16, %struct.DBC_t*, i8*, i8*, i8*, i8*, i8*, %struct.DBC_t*, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32*, i8, i16, %struct.DRVOPT*, i16 } %struct.DRVOPT = type { i16, i32, i8, %struct.DRVOPT* } diff --git a/test/CodeGen/X86/MachineSink-PHIUse.ll b/test/CodeGen/X86/MachineSink-PHIUse.ll index 3758fd8..728e377 100644 --- a/test/CodeGen/X86/MachineSink-PHIUse.ll +++ b/test/CodeGen/X86/MachineSink-PHIUse.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=x86_64-appel-darwin -disable-cgp-branch-opts -stats |& grep {machine-sink} +; RUN: llc < %s -mtriple=x86_64-appel-darwin -stats |& grep {machine-sink} define fastcc void @t() nounwind ssp { entry: diff --git a/test/CodeGen/X86/personality.ll b/test/CodeGen/X86/personality.ll index 705e489..6789bb0 100644 --- a/test/CodeGen/X86/personality.ll +++ b/test/CodeGen/X86/personality.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mtriple=x86_64-apple-darwin9 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X64 -; RUN: llc < %s -mtriple=i386-apple-darwin9 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X32 +; RUN: llc < %s -mtriple=x86_64-apple-darwin9 | FileCheck %s -check-prefix=X64 +; RUN: llc < %s -mtriple=i386-apple-darwin9 | FileCheck %s -check-prefix=X32 ; PR1632 define void @_Z1fv() { diff --git a/test/CodeGen/X86/pr3366.ll b/test/CodeGen/X86/pr3366.ll index 1127b60..f813e2e 100644 --- a/test/CodeGen/X86/pr3366.ll +++ b/test/CodeGen/X86/pr3366.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86 -disable-cgp-branch-opts | grep movzbl +; RUN: llc < %s -march=x86 | grep movzbl ; PR3366 define void @_ada_c34002a() nounwind { diff --git a/test/CodeGen/X86/sext-i1.ll b/test/CodeGen/X86/sext-i1.ll index 574769b..21c418d 100644 --- a/test/CodeGen/X86/sext-i1.ll +++ b/test/CodeGen/X86/sext-i1.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -march=x86 -disable-cgp-branch-opts | FileCheck %s -check-prefix=32 -; RUN: llc < %s -march=x86-64 -disable-cgp-branch-opts | FileCheck %s -check-prefix=64 +; RUN: llc < %s -march=x86 | FileCheck %s -check-prefix=32 +; RUN: llc < %s -march=x86-64 | FileCheck %s -check-prefix=64 ; rdar://7573216 ; PR6146 diff --git a/test/CodeGen/X86/zext-extract_subreg.ll b/test/CodeGen/X86/zext-extract_subreg.ll index 4f1dde3..e61e880 100644 --- a/test/CodeGen/X86/zext-extract_subreg.ll +++ b/test/CodeGen/X86/zext-extract_subreg.ll @@ -13,7 +13,6 @@ if.end: ; preds = %if.end.i ; CHECK: %if.end ; CHECK: movl (%{{.*}}), [[REG:%[a-z]+]] ; CHECK-NOT: movl [[REG]], [[REG]] -; CHECK-NEXT: testl [[REG]], [[REG]] ; CHECK-NEXT: xorb %tmp138 = select i1 undef, i32 0, i32 %tmp7.i %tmp867 = zext i32 %tmp138 to i64 diff --git a/test/MC/ARM/simple-encoding.ll b/test/MC/ARM/simple-encoding.ll index defeea9..0877e8e 100644 --- a/test/MC/ARM/simple-encoding.ll +++ b/test/MC/ARM/simple-encoding.ll @@ -1,4 +1,4 @@ -;RUN: llc -mtriple=armv7-apple-darwin -show-mc-encoding -disable-cgp-branch-opts < %s | FileCheck %s +;RUN: llc -mtriple=armv7-apple-darwin -show-mc-encoding < %s | FileCheck %s ;FIXME: Once the ARM integrated assembler is up and going, these sorts of tests diff --git a/test/Transforms/CodeGenPrepare/basic.ll b/test/Transforms/CodeGenPrepare/basic.ll index ebf10f0..3b1fca3 100644 --- a/test/Transforms/CodeGenPrepare/basic.ll +++ b/test/Transforms/CodeGenPrepare/basic.ll @@ -14,14 +14,13 @@ entry: br i1 %1, label %T, label %trap ; CHECK: entry: -; CHECK-NEXT: br label %T +; HECK-NEXT: ret i32 4 trap: ; preds = %0, %entry tail call void @llvm.trap() noreturn nounwind unreachable T: -; CHECK: ret i32 4 ret i32 4 } |