Remove explicit control flow through the use of the 'not' script

llvm-svn: 6965
This commit is contained in:
Chris Lattner 2003-06-28 23:23:34 +00:00
parent 213fbb3bbb
commit a6fee9d6d5
62 changed files with 85 additions and 300 deletions

View File

@ -1,10 +1,7 @@
; Test that GCSE uses ds-aa to do alias analysis, which is capable of
; disambiguating some cases.
; RUN: if as < %s | opt -ds-aa -load-vn -gcse -instcombine -dce | dis | grep ELIM
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -ds-aa -load-vn -gcse -instcombine -dce | dis | not grep ELIM
%intpair = type {int*, int*}
implementation

View File

@ -4,10 +4,7 @@
; Check by running globaldce, which will remove the constant if there are
; no references to it!
;
; RUN: if as < %s | opt -globaldce | dis | grep constant
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -globaldce | dis | grep-not constant
;
%v1 = internal constant int 5
@ -15,7 +12,6 @@
implementation
int "createtask"()
begin
%v1 = alloca int ;; Alloca should have one use!
%reg112 = load int* %v1 ;; This load should not use the global!
ret int %reg112

View File

@ -1,9 +1,6 @@
; This test checks to make sure that constant exprs fold in some simple situations
; RUN: if as < %s | dis | grep cast
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | dis | grep-not cast
%A = global int* cast (sbyte* null to int*) ; Cast null -> fold
%B = global int** cast (int** %A to int**) ; Cast to same type -> fold

View File

@ -5,10 +5,7 @@
; RUN: echo "implementation internal int %foo() { ret int 7 }" | as > Output/%s.1.bc
; RUN: as < %s > Output/%s.2.bc
; RUN: if link Output/%s.[12].bc | dis | grep 'internal' | grep '%foo('
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: link Output/%s.[12].bc | dis | grep 'internal' | grep-not '%foo('
implementation
declare int %foo()

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -adce -simplifycfg | dis | grep then:
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -adce -simplifycfg | dis | not grep then:
void %dead_test8(int* %data.1, int %idx.1) {
entry: ; No predecessors!

View File

@ -1,10 +1,7 @@
; This is the test case taken from Appel's book that illustrates a hard case
; that SCCP gets right, and when followed by ADCE, is completely eliminated
;
; RUN: if as < %s | opt -sccp -adce -simplifycfg | dis | grep br
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp -adce -simplifycfg | dis | not grep br
int "test function"(int %i0, int %j0) {
BB1:

View File

@ -1,10 +1,7 @@
; This testcase tests for various features the basicaa test should be able to
; determine, as noted in the comments.
; RUN: if as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | grep REMOVE
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep REMOVE
%Global = external global { int }

View File

@ -2,10 +2,7 @@
; disambiguating some obvious cases. All loads should be removable in
; this testcase.
; RUN: if as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | grep load
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -basicaa -load-vn -gcse -instcombine -dce | dis | not grep load
%A = global int 7
%B = global int 8

View File

@ -3,10 +3,7 @@
; two pointers, then the load should be hoisted, and the store sunk. Thus
; the loop becomes empty and can be deleted by ADCE.
; RUN: if as < %s | opt -basicaa -licm --adce | dis | grep Loop
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -basicaa -licm --adce | dis | not grep Loop
%A = global int 7
%B = global int 8

View File

@ -4,10 +4,7 @@
; Fix #2: The unary not instruction now no longer exists. Change to xor.
; RUN: if as < %s | opt -constprop | dis | grep 'int 0'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop | dis | not grep 'int 0'
int "test1"() {
%R = xor int 123, -1

View File

@ -1,9 +1,6 @@
; SetCC on boolean values was not implemented!
; RUN: if as < %s | opt -constprop -die | dis | grep 'set'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop -die | dis | not grep 'set'
bool "test1"() {
%A = setle bool true, false

View File

@ -1,13 +1,9 @@
; This is a basic sanity check for constant propogation. The add instruction
; should be eliminated.
; RUN: if as < %s | opt -constprop -die | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop -die | dis | not grep add
int "test"(bool %B)
begin
int %test(bool %B) {
br bool %B, label %BB1, label %BB2
BB1:
%Val = add int 0, 0
@ -17,4 +13,4 @@ BB2:
BB3:
%Ret = phi int [%Val, %BB1], [1, %BB2]
ret int %Ret
end
}

View File

@ -1,9 +1,6 @@
; Ensure constant propogation of logical instructions is working correctly.
; RUN: if as < %s | opt -constprop -die | dis | ggrep -E 'and|or|xor'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop -die | dis | not ggrep -E 'and|or|xor'
int "test1"() { %R = and int 4,1234 ret int %R }

View File

@ -1,9 +1,6 @@
; Ensure constant propogation of 'not' instructions is working correctly.
; RUN: if as < %s | opt -constprop -die | dis | grep xor
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop -die | dis | not grep xor
int "test1"() {
%R = xor int 4, -1

View File

@ -1,13 +1,9 @@
; This is a basic sanity check for constant propogation. The add instruction
; should be eliminated.
; RUN: if as < %s | opt -constprop -die | dis | grep phi
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop -die | dis | not grep phi
int "test"(bool %B)
begin
int %test(bool %B) {
BB0:
br bool %B, label %BB1, label %BB3
BB1:
@ -15,4 +11,4 @@ BB1:
BB3:
%Ret = phi int [1, %BB0], [1, %BB1]
ret int %Ret
end
}

View File

@ -1,26 +1,23 @@
; Ensure constant propogation of remainder instructions is working correctly.
; Ensure constant propagation of remainder instructions is working correctly.
; RUN: if as < %s | opt -constprop -die | dis | grep rem
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -constprop -die | dis | not grep rem
int "test1"() {
int %test1() {
%R = rem int 4, 3
ret int %R
}
int "test2"() {
int %test2() {
%R = rem int 123, -23
ret int %R
}
float "test3"() {
float %test3() {
%R = rem float 12.45, 123.213
ret float %R
}
double "test4"() {
double %test4() {
%R = rem double 312.20213123, 12.3333412
ret double %R
}

View File

@ -12,10 +12,7 @@
; }
; }
;
; RUN: if as < %s | opt -cee -simplifycfg | dis | grep bb3
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -cee -simplifycfg | dis | not grep bb3
implementation
declare void %bar()

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -cee -constprop -instcombine -dce | dis | grep 'REMOVE'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -cee -constprop -instcombine -dce | dis | not grep 'REMOVE'
int %test1(int %A) {
%cond = seteq int %A, 40

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -cee -simplifycfg | dis | grep 'REMOVE'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -cee -simplifycfg | dis | not grep 'REMOVE'
implementation

View File

@ -11,10 +11,7 @@
;
; Note that this is a "feature" test, not a correctness test.
;
; RUN: if as < %s | opt -cee -simplifycfg | dis | grep cond213
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -cee -simplifycfg | dis | not grep cond213
;
implementation ; Functions:

View File

@ -1,10 +1,7 @@
; a load or store of a pointer indicates that the pointer is not null.
; Any succeeding uses of the pointer should get this info
; RUN: if as < %s | opt -cee -instcombine -simplifycfg | dis | grep br
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -cee -instcombine -simplifycfg | dis | not grep br
implementation ; Functions:

View File

@ -11,10 +11,7 @@
;
; This should eliminate all BB's except BB0, BB9, BB10
;
; RUN: if as < %s | opt -cee -instcombine -simplifycfg | dis | grep 'bb[2-8]'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -cee -instcombine -simplifycfg | dis | not grep 'bb[2-8]'
implementation ; Functions:

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -deadargelim | dis | grep DEADARG
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -deadargelim | dis | not grep DEADARG
implementation

View File

@ -1,16 +1,7 @@
; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved
; correctly.
;
; RUN: if as < %s | opt -funcresolve > /dev/null
; RUN: then echo "opt ok"
; RUN: else exit 1 # Make sure opt doesn't abort!
; RUN: fi
;
; RUN: if as < %s | opt -funcresolve | dis | grep external
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
;
; RUN: as < %s | opt -funcresolve | dis | not grep external
%X = external global [0 x int]
%X = global [4 x int] [ int 1, int 2, int 3, int 4 ]

View File

@ -1,10 +1,7 @@
; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved
; correctly. This doesn't have constantexprs
;
; RUN: if as < %s | opt -funcresolve | dis | grep external
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve | dis | not grep external
;
%X = external global [0 x int]

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -funcresolve -funcresolve | dis | grep declare
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve -funcresolve | dis | not grep declare
declare void %qsortg(sbyte*, int, int)

View File

@ -1,12 +1,5 @@
; RUN: if as < %s | opt -funcresolve > /dev/null
; RUN: then echo "opt ok"
; RUN: else exit 1 # Make sure opt doesn't abort!
; RUN: fi
;
; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve -instcombine | dis | not grep '\.\.\.'
declare int %foo(...)
declare int %foo(int)

View File

@ -1,7 +1,5 @@
; RUN: if as < %s | opt -funcresolve -disable-output 2>&1 | grep WARNING
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve -disable-output 2>&1 | not grep WARNING
%__popcount_tab = external constant [0 x ubyte]
%__popcount_tab = constant [4 x ubyte] c"\00\01\01\02"

View File

@ -1,9 +1,6 @@
; This testcase should not cause a warning!
; RUN: if (as < %s | opt -funcresolve -disable-output) 2>&1 | grep 'WARNING'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: (as < %s | opt -funcresolve -disable-output) 2>&1 | not grep 'WARNING'
%X = internal global float 1.0
%X = internal global int 1

View File

@ -1,7 +1,5 @@
; RUN: if as < %s | opt -funcresolve | dis | grep declare
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve | dis | not grep declare
%Table = constant int(...)* %foo
%Table2 = constant [1 x int(...)* ] [ int(...)* %foo ]

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -funcresolve | dis | grep declare
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve | dis | not grep declare
declare void %test(...)

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
declare int %foo(...)

View File

@ -1,14 +1,6 @@
; This shows where the function is called with the prototype indicating a
; return type exists, but it really doesn't.
; RUN: if as < %s | opt -funcresolve > /dev/null
; RUN: then echo "opt ok"
; RUN: else exit 1 # Make sure opt doesn't abort!
; RUN: fi
;
; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
declare int %foo(...)

View File

@ -1,15 +1,7 @@
; This shows where the function is called with the prototype indicating a
; return type doesn't exists, but it really does.
;
; RUN: if as < %s | opt -funcresolve > /dev/null
; RUN: then echo "opt ok"
; RUN: else exit 1 # Make sure opt doesn't abort!
; RUN: fi
;
; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | not grep call
declare void %foo(...)

View File

@ -1,10 +1,7 @@
; This entire chain of computation should be optimized away, but
; wasn't because the two multiplies were not detected as being identical.
;
; RUN: if as < %s | opt -gcse -instcombine -dce | dis | grep sub
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -gcse -instcombine -dce | dis | not grep sub
implementation ; Functions:

View File

@ -1,10 +1,7 @@
; This testcase shows a bug where an common subexpression exists, but there
; is no shared dominator block that the expression can be hoisted out to.
;
; RUN: if as < %s | opt -load-vn -gcse | dis | grep load
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -load-vn -gcse | dis | not grep load
int %test(int* %P) {
store int 5, int* %P

View File

@ -1,10 +1,7 @@
; This testcase ensures that redundant loads are eliminated when they should
; be. All RL variables (redundant loads) should be eliminated.
;
; RUN: if as < %s | opt -load-vn -gcse | dis | grep %RL
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -load-vn -gcse | dis | not grep %RL
;
int "test1"(int* %P) {
%A = load int* %P

View File

@ -1,10 +1,7 @@
; Make sure that functions are removed successfully if they are referred to by
; a global that is dead. Make sure any globals they refer to die as well.
; RUN: if as < %s | opt -globaldce | dis | grep foo
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -globaldce | dis | not grep foo
%b = internal global int ()* %foo ;; Unused, kills %foo

View File

@ -1,10 +1,7 @@
; This testcase tests that a worklist is being used, and that globals can be
; removed if they are the subject of a constexpr and ConstantPointerRef
; RUN: if as < %s | opt -globaldce | dis | grep global
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -globaldce | dis | not grep global
%t0 = internal global [4 x sbyte] c"foo\00"
%t1 = internal global [4 x sbyte] c"bar\00"

View File

@ -1,8 +1,4 @@
; RUN: if as < %s | opt -globaldce | dis | grep global
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -globaldce | dis | not grep global
%X = uninitialized global int
%Y = internal global int 7

View File

@ -3,10 +3,7 @@
; happens because preheader insertion doesn't insert a preheader for this
; case... bad.
; RUN: if as < %s | opt -licm -adce -simplifycfg | dis | grep 'br '
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -licm -adce -simplifycfg | dis | not grep 'br '
int %main(int %argc) {
br label %bb5

View File

@ -1,8 +1,5 @@
; Promoting some values allows promotion of other values.
; RUN: if as < %s | opt -mem2reg | dis | grep alloca
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -mem2reg | dis | not grep alloca
int %test2() {
%result = alloca int ; ty=int*

View File

@ -2,10 +2,7 @@
; generated code should perform the appropriate masking operations required
; depending on the endianness of the target...
; RUN: if as < %s | opt -mem2reg | dis | grep 'alloca'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -mem2reg | dis | not grep 'alloca'
implementation

View File

@ -1,8 +1,5 @@
; Simple sanity check testcase. Both alloca's should be eliminated.
; RUN: if as < %s | opt -mem2reg | dis | grep 'alloca'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -mem2reg | dis | not grep 'alloca'
implementation

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -pinodes -instcombine -die | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -pinodes -instcombine -die | dis | not grep add
int "test"(int %i, int %j) {
%c = seteq int %i, 0

View File

@ -1,9 +1,6 @@
; RUN: if as < %s | opt -reassociate -instcombine -constprop -dce | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -instcombine -constprop -dce | dis | not grep add
int "test"(int %A) {
int %test(int %A) {
%X = add int %A, 1
%Y = add int %A, 1
%r = sub int %X, %Y

View File

@ -1,9 +1,6 @@
; RUN: if as < %s | opt -reassociate -instcombine -constprop -die | dis | grep 5
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -instcombine -constprop -die | dis | not grep 5
int "test"(int %A, int %B) {
int %test(int %A, int %B) {
%W = add int %B, -5
%Y = add int %A, 5
%Z = add int %W, %Y

View File

@ -1,11 +1,8 @@
; With sub reassociation, constant folding can eliminate all of the constants.
;
; RUN: if as < %s | opt -reassociate -constprop -instcombine -dce | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -constprop -instcombine -dce | dis | not grep add
int "test"(int %A, int %B) {
int %test(int %A, int %B) {
%W = add int 5, %B
%X = add int -7, %A
%Y = sub int %X, %W

View File

@ -1,9 +1,6 @@
; With sub reassociation, constant folding can eliminate the two 12 constants.
;
; RUN: if as < %s | opt -reassociate -constprop -dce | dis | grep 12
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -constprop -dce | dis | not grep 12
int "test"(int %A, int %B, int %C, int %D) {
%M = add int %A, 12

View File

@ -1,11 +1,8 @@
; With reassociation, constant folding can eliminate the 12 and -12 constants.
;
; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep add
int "test"(int %arg) {
int %test(int %arg) {
%tmp1 = sub int -12, %arg
%tmp2 = add int %tmp1, 12
ret int %tmp2

View File

@ -1,9 +1,6 @@
; With reassociation, constant folding can eliminate the +/- 30 constants.
;
; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 30
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 30
int "test"(int %reg109, int %reg1111) {
%reg115 = add int %reg109, -30 ; <int> [#uses=1]

View File

@ -12,10 +12,7 @@
; In this case, we want to reassociate the specified expr so that i+j can be
; hoisted out of the inner most loop.
;
; RUN: if as < %s | opt -reassociate | dis | grep 115 | grep 117
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate | dis | grep 115 | not grep 117
%.LC0 = internal global [4 x sbyte] c"%d\0A\00" ; <[4 x sbyte]*> [#uses=1]

View File

@ -1,9 +1,6 @@
; Reassociation should apply to Add, Mul, And, Or, & Xor
;
; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 12
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
int "test_mul"(int %arg) {
%tmp1 = mul int 12, %arg

View File

@ -1,9 +1,6 @@
; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
;
; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 12
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
int "test"(int %A, int %B) {
%X = add int -12, %A

View File

@ -5,13 +5,9 @@
; real benchmark (mst from Olden benchmark, MakeGraph function). When SCCP is
; fixed, this should be eliminated by a single SCCP application.
;
; RUN: if as < %s | opt -sccp | dis | grep loop
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp | dis | not grep loop
int *"test"()
begin
int* %test() {
bb1:
%A = malloc int
br label %bb2
@ -24,5 +20,4 @@ bb2:
bb3:
ret int * %A
end
}

View File

@ -1,12 +1,7 @@
; RUN: if as < %s | opt -sccp | dis | grep sub
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp | dis | not grep sub
void "test3"(int, int)
begin
void %test3(int, int) {
add int 0, 0
sub int 0, 4
ret void
end
}

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -sccp | dis | grep '%X'
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp | dis | not grep '%X'
%G = uninitialized global [40x int]

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -sccp -simplifycfg | dis | grep then:
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp -simplifycfg | dis | not grep then:
void %cprop_test11(int* %data.1) {
entry: ; No predecessors!

View File

@ -1,13 +1,9 @@
; This is a basic sanity check for constant propogation. The add instruction
; should be eliminated.
; RUN: if as < %s | opt -sccp | dis | grep add
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp | dis | not grep add
int "test"(bool %B)
begin
int %test(bool %B) {
br bool %B, label %BB1, label %BB2
BB1:
%Val = add int 0, 0
@ -17,4 +13,4 @@ BB2:
BB3:
%Ret = phi int [%Val, %BB1], [1, %BB2]
ret int %Ret
end
}

View File

@ -1,13 +1,9 @@
; This is the test case taken from appel's book that illustrates a hard case
; that SCCP gets right. BB3 should be completely eliminated.
;
; RUN: if as < %s | opt -sccp -constprop -dce -cfgsimplify | dis | grep BB3
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -sccp -constprop -dce -cfgsimplify | dis | not grep BB3
int "test function"(int %i0, int %j0)
begin
int %test function(int %i0, int %j0) {
BB1:
br label %BB2
BB2:
@ -35,5 +31,4 @@ BB7:
%j4 = phi int [1, %BB5], [%k2, %BB6]
%k4 = phi int [%k3, %BB5], [%k5, %BB6]
br label %BB2
end
}

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -scalarrepl -mem2reg | dis | grep alloca
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -scalarrepl -mem2reg | dis | not grep alloca
int %test() {
%X = alloca [ 4 x int ]

View File

@ -1,7 +1,4 @@
; RUN: if as < %s | opt -scalarrepl -mem2reg | dis | grep alloca
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
; RUN: as < %s | opt -scalarrepl -mem2reg | dis | not grep alloca
int %test() {
%X = alloca { int, float }