From 565706b93e3695da49aee8d2eb67006ffdb2591f Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 22 Nov 2006 23:49:16 +0000 Subject: 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 --- .../PredicateSimplifier/2006-11-04-ImpossibleGT.ll | 19 ++++++++ .../2006-11-04-ReplacingZeros.ll | 30 ++++++++++++ .../PredicateSimplifier/2006-11-05-CycleGTLT.ll | 14 ++++++ .../PredicateSimplifier/2006-11-11-Squeeze.ll | 31 +++++++++++++ .../PredicateSimplifier/2006-11-12-MergeNodes.ll | 54 ++++++++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll create mode 100644 test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll create mode 100644 test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll create mode 100644 test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll create mode 100644 test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll (limited to 'test/Transforms/PredicateSimplifier') diff --git a/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll b/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll new file mode 100644 index 0000000000..c401bfe256 --- /dev/null +++ b/test/Transforms/PredicateSimplifier/2006-11-04-ImpossibleGT.ll @@ -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 ; [#uses=1] + br bool %tmp2427, label %cond_next2429, label %bb2418 + +cond_next2429: ; preds = %bb2425 + ret void +} diff --git a/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll b/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll new file mode 100644 index 0000000000..f3c17c38cf --- /dev/null +++ b/test/Transforms/PredicateSimplifier/2006-11-04-ReplacingZeros.ll @@ -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 ; [#uses=1] + %min = select bool %tmp130, int 0, int 127 ; [#uses=2] + %tmp143 = load int* null ; [#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 ; [#uses=1] + %iftmp.380.0.p = select bool false, int 0, int %tmp205 ; [#uses=0] + ret int 0 + +bb303: ; preds = %cond_true114 + %tmp165 = seteq int %min, 0 ; [#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 +} diff --git a/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll b/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll new file mode 100644 index 0000000000..5aaf503dd1 --- /dev/null +++ b/test/Transforms/PredicateSimplifier/2006-11-05-CycleGTLT.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -predsimplify -disable-output + +void %diff(int %N) { +entry: + %tmp = setgt int %N, 0 ; [#uses=1] + br bool %tmp, label %bb519, label %bb744 + +bb519: ; preds = %entry + %tmp720101 = setlt int %N, 0 ; [#uses=1] + br bool %tmp720101, label %bb744, label %bb744 + +bb744: ; preds = %bb519, %entry + ret void +} diff --git a/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll b/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll new file mode 100644 index 0000000000..d260ae35d7 --- /dev/null +++ b/test/Transforms/PredicateSimplifier/2006-11-11-Squeeze.ll @@ -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) ; [#uses=2] + %tmp = setlt int %tmp, 0 ; [#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) ; [#uses=2] + %tmp5 = setlt int %tmp2, %tmp ; [#uses=1] + br bool %tmp5, label %bb, label %bb6 + +bb: ; preds = %cond_next, %entry + unreachable + +bb6: ; preds = %cond_next + %tmp98124 = setgt int %tmp2, 0 ; [#uses=1] + br bool %tmp98124, label %bb42, label %bb99 + +bb42: ; preds = %bb6 + ret void + +bb99: ; preds = %bb6 + ret void +} diff --git a/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll b/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll new file mode 100644 index 0000000000..134dd0fb1b --- /dev/null +++ b/test/Transforms/PredicateSimplifier/2006-11-12-MergeNodes.ll @@ -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( ) ; [#uses=2] + %tmp93 = setgt int %tmp91, 0 ; [#uses=1] + br bool %tmp93, label %cond_next84, label %bb94 + +cond_next84: ; preds = %entry + ret void + +bb94: ; preds = %entry + %tmp96 = seteq int %tmp91, 0 ; [#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 ; [#uses=1] + %tmp111 = load int* %tmp110 ; [#uses=1] + %tmp129 = seteq int %tmp111, 0 ; [#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() -- cgit v1.2.3-70-g09d2