Update to new predicate simplifier VRP design. Fixes PR966 and PR967.

Remove predicate simplifier from default gcc3 pipeline. New design is too
slow to enable by default.
Add new testcases for problems encountered in development.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2006-11-22 23:49:16 +00:00
parent 6d0fbd4185
commit 565706b93e
8 changed files with 1328 additions and 651 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
; RUN: llvm-as < %s | opt -predsimplify -disable-output
void %readMotionInfoFromNAL() {
entry:
br bool false, label %bb2425, label %cond_next30
cond_next30: ; preds = %entry
ret void
bb2418: ; preds = %bb2425
ret void
bb2425: ; preds = %entry
%tmp2427 = setgt int 0, 3 ; <bool> [#uses=1]
br bool %tmp2427, label %cond_next2429, label %bb2418
cond_next2429: ; preds = %bb2425
ret void
}

View File

@ -0,0 +1,30 @@
; RUN: llvm-as < %s | opt -predsimplify -disable-output
int %test_wp_B_slice(int %select_method) {
entry:
br label %bb309
cond_true114: ; preds = %bb309
%tmp130 = setlt int 0, 128 ; <bool> [#uses=1]
%min = select bool %tmp130, int 0, int 127 ; <int> [#uses=2]
%tmp143 = load int* null ; <int> [#uses=1]
br bool false, label %bb303, label %bb314
cond_true166: ; preds = %bb303
ret int 0
cond_false200: ; preds = %bb303
%tmp205 = sdiv int %min, 2 ; <int> [#uses=1]
%iftmp.380.0.p = select bool false, int 0, int %tmp205 ; <int> [#uses=0]
ret int 0
bb303: ; preds = %cond_true114
%tmp165 = seteq int %min, 0 ; <bool> [#uses=1]
br bool %tmp165, label %cond_true166, label %cond_false200
bb309: ; preds = %bb19
br bool false, label %cond_true114, label %bb314
bb314: ; preds = %bb309
ret int 0
}

View File

@ -0,0 +1,14 @@
; RUN: llvm-as < %s | opt -predsimplify -disable-output
void %diff(int %N) {
entry:
%tmp = setgt int %N, 0 ; <bool> [#uses=1]
br bool %tmp, label %bb519, label %bb744
bb519: ; preds = %entry
%tmp720101 = setlt int %N, 0 ; <bool> [#uses=1]
br bool %tmp720101, label %bb744, label %bb744
bb744: ; preds = %bb519, %entry
ret void
}

View File

@ -0,0 +1,31 @@
; RUN: llvm-as < %s | opt -predsimplify -disable-output
%struct.cube_struct = type { int, int, int, int*, int*, int*, int*, int*, uint*, uint*, uint**, uint**, uint*, uint*, uint, int, int*, int, int }
%cube = external global %struct.cube_struct ; <%struct.cube_struct*> [#uses=2]
implementation ; Functions:
fastcc void %cube_setup() {
entry:
%tmp = load int* getelementptr (%struct.cube_struct* %cube, int 0, uint 2) ; <int> [#uses=2]
%tmp = setlt int %tmp, 0 ; <bool> [#uses=1]
br bool %tmp, label %bb, label %cond_next
cond_next: ; preds = %entry
%tmp2 = load int* getelementptr (%struct.cube_struct* %cube, int 0, uint 1) ; <int> [#uses=2]
%tmp5 = setlt int %tmp2, %tmp ; <bool> [#uses=1]
br bool %tmp5, label %bb, label %bb6
bb: ; preds = %cond_next, %entry
unreachable
bb6: ; preds = %cond_next
%tmp98124 = setgt int %tmp2, 0 ; <bool> [#uses=1]
br bool %tmp98124, label %bb42, label %bb99
bb42: ; preds = %bb6
ret void
bb99: ; preds = %bb6
ret void
}

View File

@ -0,0 +1,54 @@
; RUN: llvm-as < %s | opt -predsimplify -disable-output
; ModuleID = 'b.bc'
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"
deplibs = [ "c", "crtend" ]
%struct.VDIR_ST = type { int, int, int, %struct.acl*, %struct.pfile*, %struct.vlink*, %struct.vlink*, %struct.vlink*, %struct.VDIR_ST*, %struct.VDIR_ST* }
%struct.acl = type { int, sbyte*, sbyte*, sbyte*, %struct.restrict*, %struct.acl*, %struct.acl* }
%struct.avalue = type { sbyte* }
%struct.pattrib = type { sbyte, sbyte*, sbyte*, %struct.avalue, %struct.pattrib*, %struct.pattrib* }
%struct.pfile = type { int, int, int, int, int, %struct.vlink*, %struct.vlink*, %struct.pattrib*, %struct.pfile*, %struct.pfile* }
%struct.restrict = type { %struct.acl*, %struct.acl* }
%struct.vlink = type { int, sbyte*, sbyte, int, sbyte*, %struct.vlink*, %struct.vlink*, sbyte*, sbyte*, sbyte*, sbyte*, int, int, %struct.acl*, int, int, sbyte*, %struct.pattrib*, %struct.pfile*, %struct.vlink*, %struct.vlink* }
implementation ; Functions:
void %vl_insert(%struct.vlink* %vl) {
entry:
%tmp91 = call int %vl_comp( ) ; <int> [#uses=2]
%tmp93 = setgt int %tmp91, 0 ; <bool> [#uses=1]
br bool %tmp93, label %cond_next84, label %bb94
cond_next84: ; preds = %entry
ret void
bb94: ; preds = %entry
%tmp96 = seteq int %tmp91, 0 ; <bool> [#uses=1]
br bool %tmp96, label %cond_true97, label %cond_next203
cond_true97: ; preds = %bb94
br bool false, label %cond_next105, label %cond_true102
cond_true102: ; preds = %cond_true97
ret void
cond_next105: ; preds = %cond_true97
%tmp110 = getelementptr %struct.vlink* %vl, int 0, uint 12 ; <int*> [#uses=1]
%tmp111 = load int* %tmp110 ; <int> [#uses=1]
%tmp129 = seteq int %tmp111, 0 ; <bool> [#uses=1]
br bool %tmp129, label %cond_true130, label %cond_next133
cond_true130: ; preds = %cond_next105
ret void
cond_next133: ; preds = %cond_next105
ret void
cond_next203: ; preds = %bb94
ret void
}
declare int %vl_comp()

View File

@ -103,7 +103,6 @@ void AddConfiguredTransformationPasses(PassManager &PM) {
addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs
addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas
addPass(PM, createInstructionCombiningPass()); // Combine silly seq's
addPass(PM, createPredicateSimplifierPass()); // Canonicalize registers
addPass(PM, createCondPropagationPass()); // Propagate conditionals
addPass(PM, createTailCallEliminationPass()); // Eliminate tail calls

View File

@ -252,7 +252,6 @@ int llvm::GenerateBytecode(Module *M, int StripLevel, bool Internalize,
// The IPO passes may leave cruft around. Clean up after them.
addPass(Passes, createInstructionCombiningPass());
addPass(Passes, createPredicateSimplifierPass());
addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas