For PR950:

Update the test suite to accommodate the change from signed integer types
to signless integer types. The changes were of only a few kinds:

1. Make sure llvm-upgrade is run on the source which does the bulk of the
   changes automatically.

2. Change things like "grep 'int'" to "grep 'i32'"

3. In several tests bitcasting caused the same name to be reused in the
   same type plane. These had to be manually fixed. The fix was (generally)
   to leave the bitcast and provide the instruction with a new name. This
   should not affect the semantics of the test. In a few cases, the
   bitcasts were known to be superfluous and irrelevant to the test case
   so they were removed.

4. One test case uses a bytecode file which needed to be updated to the
   latest bytecode format.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32789 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-12-31 06:02:00 +00:00
parent 47857812e2
commit eacb7020ec
117 changed files with 285 additions and 299 deletions

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -argpromotion | llvm-dis | grep 'load int\* %A'
; RUN: llvm-upgrade < %s | llvm-as | opt -argpromotion | llvm-dis | grep 'load i32\* %A'
implementation

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep 'uint -1' &&
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep 'i32 -1' &&
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | not grep zeroinitializer
< 4 x uint> %test() {

View File

@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep 'ret int -1' &&
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep 'ret uint 1'
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep 'ret i32 -1' &&
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep 'ret i32 1'
int %test1() {
%A = sext bool true to int

View File

@@ -1,4 +1,4 @@
; RUN: llvm-as < %s | llvm-dis &&
; RUN: llvm-as < %s | llvm-dis | grep 0x36A0000000000000
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis &&
; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | grep 0x36A0000000000000
%A = global float bitcast (int 1 to float)

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep -F 'ret int* null' | wc -l | grep 2
; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | grep -F 'ret i32* null' | wc -l | grep 2
int* %test1() {
%X = cast float 0.0 to int*
ret int* %X

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | grep 'store int 1234567'
; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | grep 'store i32 1234567'
; Do not delete stores that are only partially killed.

View File

@@ -755,22 +755,22 @@ cond_true226.critedge: ; preds = %cond_false210
%tmp.i = load %struct.TType** %DP_TTable ; <%struct.TType*> [#uses=1]
%tmp.i7.b = load bool* %TTSize.b ; <bool> [#uses=1]
%tmp1.i = select bool %tmp.i7.b, uint 60000000, uint 0 ; <uint> [#uses=1]
%tmp.i = getelementptr %struct.TType* %tmp.i, int 0, uint 0 ; <sbyte*> [#uses=1]
call void %llvm.memset.i32( sbyte* %tmp.i, ubyte 0, uint %tmp1.i, uint 4 )
%tmp.i.sb = getelementptr %struct.TType* %tmp.i, int 0, uint 0 ; <sbyte*> [#uses=1]
call void %llvm.memset.i32( sbyte* %tmp.i.sb, ubyte 0, uint %tmp1.i, uint 4 )
%tmp2.i = load %struct.TType** %AS_TTable ; <%struct.TType*> [#uses=1]
%tmp3.i8.b = load bool* %TTSize.b ; <bool> [#uses=1]
%tmp4.i = select bool %tmp3.i8.b, uint 60000000, uint 0 ; <uint> [#uses=1]
%tmp2.i = getelementptr %struct.TType* %tmp2.i, int 0, uint 0 ; <sbyte*> [#uses=1]
call void %llvm.memset.i32( sbyte* %tmp2.i, ubyte 0, uint %tmp4.i, uint 4 )
%tmp.i = load %struct.QTType** %QS_TTable ; <%struct.QTType*> [#uses=1]
%tmp.i.QTT = load %struct.QTType** %QS_TTable ; <%struct.QTType*> [#uses=1]
%tmp5.i9.b = load bool* %TTSize.b ; <bool> [#uses=1]
%tmp6.i10 = select bool %tmp5.i9.b, uint 48000000, uint 0 ; <uint> [#uses=1]
%tmp7.i = getelementptr %struct.QTType* %tmp.i, int 0, uint 0 ; <sbyte*> [#uses=1]
%tmp7.i = getelementptr %struct.QTType* %tmp.i.QTT, int 0, uint 0 ; <sbyte*> [#uses=1]
call void %llvm.memset.i32( sbyte* %tmp7.i, ubyte 0, uint %tmp6.i10, uint 4 )
%tmp.i = load %struct.ECacheType** %ECache ; <%struct.ECacheType*> [#uses=1]
%tmp.i.ECache = load %struct.ECacheType** %ECache ; <%struct.ECacheType*> [#uses=1]
%tmp.i14.b = load bool* %ECacheSize.b ; <bool> [#uses=1]
%tmp1.i16 = select bool %tmp.i14.b, uint 12000000, uint 0 ; <uint> [#uses=1]
%tmp.i17 = cast %struct.ECacheType* %tmp.i to sbyte* ; <sbyte*> [#uses=1]
%tmp.i17 = cast %struct.ECacheType* %tmp.i.ECache to sbyte* ; <sbyte*> [#uses=1]
call void %llvm.memset.i32( sbyte* %tmp.i17, ubyte 0, uint %tmp1.i16, uint 4 )
call void %llvm.memset.i32( sbyte* cast ([300 x int]* %rootlosers to sbyte*), ubyte 0, uint 1200, uint 4 )
%tmp234.b = load bool* %is_pondering.b ; <bool> [#uses=1]
@@ -800,12 +800,12 @@ bb260: ; preds = %bb249
%tmp1.b.i = load bool* %PBSize.b ; <bool> [#uses=1]
%tmp1.i1 = select bool %tmp1.b.i, uint 200000, uint 0 ; <uint> [#uses=1]
%tmp.i2 = call sbyte* %calloc( uint %tmp1.i1, uint 44 ) ; <sbyte*> [#uses=1]
%tmp.i = cast sbyte* %tmp.i2 to ubyte* ; <ubyte*> [#uses=1]
store ubyte* %tmp.i, ubyte** %membuff
%tmp.i.ub = cast sbyte* %tmp.i2 to ubyte* ; <ubyte*> [#uses=1]
store ubyte* %tmp.i.ub, ubyte** %membuff
%tmp2.i3 = call sbyte* %calloc( uint 1, uint 44 ) ; <sbyte*> [#uses=3]
%tmp2.i = cast sbyte* %tmp2.i3 to %struct.node_t* ; <%struct.node_t*> [#uses=6]
%tmp.i = getelementptr [512 x %struct.move_s]* null, int 0, int 0 ; <%struct.move_s*> [#uses=3]
call fastcc void %gen( %struct.move_s* %tmp.i )
%tmp.i.move_s = getelementptr [512 x %struct.move_s]* null, int 0, int 0 ; <%struct.move_s*> [#uses=3]
call fastcc void %gen( %struct.move_s* %tmp.i.move_s )
%tmp3.i4 = load int* %numb_moves ; <int> [#uses=4]
%tmp3.i5 = cast int %tmp3.i4 to uint ; <uint> [#uses=0]
store bool false, bool* %alllosers.b
@@ -850,8 +850,8 @@ in_check.exit.i: ; preds = %bb260
cond_true43.i: ; preds = %cond_false12.i.i, %cond_true4.i.i
%tmp21.0.ph.i = phi int [ %tmp217.i, %cond_true4.i.i ], [ %tmp2120.i, %cond_false12.i.i ] ; <int> [#uses=1]
%i.0.0.i = cast uint 0 to int ; <int> [#uses=2]
call fastcc void %make( %struct.move_s* %tmp.i, int %i.0.0.i )
%tmp27.i = call fastcc uint %check_legal( %struct.move_s* %tmp.i, int %i.0.0.i, int %tmp21.0.ph.i ) ; <uint> [#uses=1]
call fastcc void %make( %struct.move_s* %tmp.i.move_s, int %i.0.0.i )
%tmp27.i = call fastcc uint %check_legal( %struct.move_s* %tmp.i.move_s, int %i.0.0.i, int %tmp21.0.ph.i ) ; <uint> [#uses=1]
%tmp.i6 = seteq uint %tmp27.i, 0 ; <bool> [#uses=0]
ret void

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep 'ret int 152'
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep 'ret i32 152'
int %main() {
entry:

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep 'ret int 27'
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep 'ret i32 27'
; Make sure to compute the right exit value based on negative strides.
; PR726

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -instcombine | llvm-dis | grep 'store int 0'
; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -instcombine | llvm-dis | grep 'store i32 0'
; Test that -indvars can reduce variable stride IVs. If it can reduce variable
; stride iv's, it will make %iv. and %m.0.0 isomorphic to each other without
; cycles, allowing the tmp.21 subtraction to be eliminated.
@@ -19,7 +19,7 @@ no_exit.preheader: ; preds = %entry
br label %no_exit
no_exit: ; preds = %no_exit, %no_exit.preheader
%iv. = phi uint [ 0, %no_exit.preheader ], [ %iv..inc, %no_exit ] ; <uint> [#uses=1]
%iv.ui = phi uint [ 0, %no_exit.preheader ], [ %iv..inc.ui, %no_exit ] ; <uint> [#uses=1]
%iv. = phi int [ %tmp.5, %no_exit.preheader ], [ %iv..inc, %no_exit ] ; <int> [#uses=2]
%m.0.0 = phi int [ %tmp.5, %no_exit.preheader ], [ %tmp.24, %no_exit ] ; <int> [#uses=2]
store int 2, int* %tmp.16
@@ -27,8 +27,8 @@ no_exit: ; preds = %no_exit, %no_exit.preheader
store int %tmp.21, int* %data
%tmp.24 = add int %m.0.0, %tmp.9 ; <int> [#uses=1]
%iv..inc = add int %tmp.9, %iv. ; <int> [#uses=1]
%iv..inc = add uint %iv., 1 ; <uint> [#uses=2]
%iv..inc1 = cast uint %iv..inc to int ; <int> [#uses=1]
%iv..inc.ui = add uint %iv.ui, 1 ; <uint> [#uses=2]
%iv..inc1 = cast uint %iv..inc.ui to int ; <int> [#uses=1]
%tmp.12 = setlt int %iv..inc1, %tmp.2 ; <bool> [#uses=1]
br bool %tmp.12, label %no_exit, label %return.loopexit

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | grep 'ret int 1'
; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | grep 'ret i32 1'
; ModuleID = 'short.opt.bc'
implementation ; Functions:

View File

@@ -10,7 +10,7 @@ implementation ; Functions:
int %mem_mono_copy_mono(%struct.gx_device* %dev, ubyte* %base, int %sourcex, int %raster, int %x, int %y, int %w, int %h, uint %zero, uint %one) {
entry:
%raster = cast int %raster to uint ; <uint> [#uses=3]
%raster.ui = cast int %raster to uint ; <uint> [#uses=3]
%tmp = seteq uint %one, %zero ; <bool> [#uses=1]
br bool %tmp, label %cond_true, label %cond_next
@@ -146,7 +146,6 @@ cond_true249: ; preds = %cond_true249, %cond_true249.preheader
%optr.3.2 = phi ubyte* [ %tmp232, %cond_true249 ], [ %dest.1.0, %cond_true249.preheader ] ; <ubyte*> [#uses=1]
%bptr.3.2 = phi ubyte* [ %tmp226, %cond_true249 ], [ %line.1.0, %cond_true249.preheader ] ; <ubyte*> [#uses=1]
%tmp. = add int %tmp109, %w ; <int> [#uses=1]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%tmp.58 = mul int %indvar, -8 ; <int> [#uses=1]
%tmp.57 = add int %tmp., -16 ; <int> [#uses=1]
%tmp246.2 = add int %tmp.58, %tmp.57 ; <int> [#uses=1]
@@ -236,10 +235,8 @@ cond_true295.us: ; preds = %cond_next280.us, %cond_true295.preheader.split.us
%dest.1.0.us = phi ubyte* [ %tmp286.us, %cond_next280.us ], [ %tmp100, %cond_true295.preheader.split.us ] ; <ubyte*> [#uses=3]
%dest_line.1.0.us = phi ubyte** [ %tmp282.us, %cond_next280.us ], [ %tmp96, %cond_true295.preheader.split.us ] ; <ubyte**> [#uses=1]
%tmp.89 = sub uint 0, %indvar86 ; <uint> [#uses=1]
%tmp.89 = cast uint %tmp.89 to int ; <int> [#uses=1]
%tmp292.0.us = add int %tmp.89, %tmp29222 ; <int> [#uses=1]
%tmp.91 = mul uint %indvar86, %raster ; <uint> [#uses=1]
%tmp.91 = cast uint %tmp.91 to int ; <int> [#uses=1]
%tmp.91 = mul uint %indvar86, %raster.ui ; <uint> [#uses=1]
%tmp104.sum101 = add int %tmp102, %tmp.91 ; <int> [#uses=1]
%line.1.0.us = getelementptr ubyte* %base, int %tmp104.sum101 ; <ubyte*> [#uses=2]
%tmp.us = load ubyte* %line.1.0.us ; <ubyte> [#uses=1]
@@ -313,10 +310,8 @@ cond_true295: ; preds = %cond_true295.preheader.split, %cond_next280
%dest.1.0 = phi ubyte* [ %tmp286, %cond_next280 ], [ %tmp100, %cond_true295.preheader.split ] ; <ubyte*> [#uses=4]
%dest_line.1.0 = phi ubyte** [ %tmp282, %cond_next280 ], [ %tmp96, %cond_true295.preheader.split ] ; <ubyte**> [#uses=1]
%tmp.63 = sub uint 0, %indvar60 ; <uint> [#uses=1]
%tmp.63 = cast uint %tmp.63 to int ; <int> [#uses=1]
%tmp292.0 = add int %tmp.63, %tmp29222 ; <int> [#uses=1]
%tmp.65 = mul uint %indvar60, %raster ; <uint> [#uses=1]
%tmp.65 = cast uint %tmp.65 to int ; <int> [#uses=1]
%tmp.65 = mul uint %indvar60, %raster.ui ; <uint> [#uses=1]
%tmp104.sum97 = add int %tmp102, %tmp.65 ; <int> [#uses=1]
%line.1.0 = getelementptr ubyte* %base, int %tmp104.sum97 ; <ubyte*> [#uses=3]
%tmp = load ubyte* %line.1.0 ; <ubyte> [#uses=1]
@@ -386,7 +381,6 @@ cond_true398: ; preds = %cond_true398, %cond_true398.preheader
%optr309.3.0 = phi ubyte* [ %optr309.3, %cond_true398 ], [ %optr309.353, %cond_true398.preheader ] ; <ubyte*> [#uses=2]
%optr309.3.in.0 = add uint %indvar66, %optr309.3.in51 ; <uint> [#uses=1]
%tmp.70 = add int %tmp109, %w ; <int> [#uses=1]
%indvar66 = cast uint %indvar66 to int ; <int> [#uses=1]
%tmp.72 = mul int %indvar66, -8 ; <int> [#uses=1]
%tmp.71 = add int %tmp.70, -8 ; <int> [#uses=1]
%count308.3.0 = add int %tmp.72, %tmp.71 ; <int> [#uses=1]
@@ -440,7 +434,6 @@ cond_true414: ; preds = %cond_true404
%tmp416 = load ubyte* %tmp410 ; <ubyte> [#uses=1]
%tmp416 = cast ubyte %tmp416 to uint ; <uint> [#uses=1]
%tmp418 = shr uint %tmp416, ubyte %tmp319 ; <uint> [#uses=1]
%tmp418 = cast uint %tmp418 to int ; <int> [#uses=1]
%tmp420 = add int %tmp418, %tmp408 ; <int> [#uses=1]
br label %cond_next422
@@ -479,7 +472,6 @@ cond_true457.preheader: ; preds = %cond_false299
%tmp354 = and uint %iftmp.37.0, %mask.1.1 ; <uint> [#uses=1]
%tmp361 = sub int %w, %tmp110 ; <int> [#uses=2]
%tmp39755 = setgt int %tmp361, 7 ; <bool> [#uses=1]
%iftmp.35.0 = cast uint %iftmp.35.0 to int ; <int> [#uses=1]
%tmp426 = cast uint %rmask.0.1 to ubyte ; <ubyte> [#uses=1]
%tmp426not = xor ubyte %tmp426, 255 ; <ubyte> [#uses=1]
%tmp428 = or ubyte %tmp347, %tmp426not ; <ubyte> [#uses=1]
@@ -492,10 +484,8 @@ cond_true457: ; preds = %cond_true457.preheader, %cond_next442
%dest.3.0 = phi ubyte* [ %tmp448, %cond_next442 ], [ %tmp100, %cond_true457.preheader ] ; <ubyte*> [#uses=3]
%dest_line.3.0 = phi ubyte** [ %tmp444, %cond_next442 ], [ %tmp96, %cond_true457.preheader ] ; <ubyte**> [#uses=1]
%tmp.77 = sub uint 0, %indvar74 ; <uint> [#uses=1]
%tmp.77 = cast uint %tmp.77 to int ; <int> [#uses=1]
%tmp454.0 = add int %tmp.77, %tmp45438 ; <int> [#uses=1]
%tmp.79 = mul uint %indvar74, %raster ; <uint> [#uses=1]
%tmp.79 = cast uint %tmp.79 to int ; <int> [#uses=1]
%tmp.79 = mul uint %indvar74, %raster.ui ; <uint> [#uses=1]
%tmp104.sum = add int %tmp102, %tmp.79 ; <int> [#uses=1]
%line.3.0 = getelementptr ubyte* %base, int %tmp104.sum ; <ubyte*> [#uses=3]
%tmp318 = load ubyte* %line.3.0 ; <ubyte> [#uses=2]

View File

@@ -9,8 +9,8 @@ void %test() {
entry:
%tmp = getelementptr { long, long, long, long }* null, int 0, uint 3
%tmp = load long* %tmp ; <long> [#uses=1]
%tmp8 = load ulong* null ; <ulong> [#uses=1]
%tmp8 = cast ulong %tmp8 to long ; <long> [#uses=1]
%tmp8.ui = load ulong* null ; <ulong> [#uses=1]
%tmp8 = cast ulong %tmp8.ui to long ; <long> [#uses=1]
%tmp9 = and long %tmp8, %tmp ; <long> [#uses=1]
%sext = cast long %tmp9 to int ; <int> [#uses=1]
%tmp27.i = cast int %sext to long ; <long> [#uses=1]

View File

@@ -2,10 +2,10 @@
; PR913
int %test(int* %tmp1) {
%tmp = load int* %tmp1 ; <int> [#uses=1]
%tmp = cast int %tmp to uint ; <uint> [#uses=1]
%tmp2 = shr uint %tmp, ubyte 5 ; <uint> [#uses=1]
%tmp2 = cast uint %tmp2 to int ; <int> [#uses=1]
%tmp.i = load int* %tmp1 ; <int> [#uses=1]
%tmp = cast int %tmp.i to uint ; <uint> [#uses=1]
%tmp2.ui = shr uint %tmp, ubyte 5 ; <uint> [#uses=1]
%tmp2 = cast uint %tmp2.ui to int ; <int> [#uses=1]
%tmp3 = and int %tmp2, 1 ; <int> [#uses=1]
%tmp3 = cast int %tmp3 to bool ; <bool> [#uses=1]
%tmp34 = cast bool %tmp3 to int ; <int> [#uses=1]

View File

@@ -1,5 +1,5 @@
; The optimizer should be able to remove cast operation here.
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | not grep 'sext.*int'
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | not grep 'sext.*i32'
bool %eq_signed_to_small_unsigned(sbyte %SB) {
%Y = cast sbyte %SB to uint ; <uint> [#uses=1]

View File

@@ -1,6 +1,6 @@
; This test case is reduced from llvmAsmParser.cpp
; The optimizer should not remove the cast here.
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | grep 'sext.*int'
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | grep 'sext.*i32'
bool %test(short %X) {
%A = cast short %X to uint

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret int %A'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret i32 %A'
int %test(int %A) {
%X = or bool false, false

View File

@@ -1,14 +1,14 @@
; Test some floating point casting cases
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | notcast
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep 'ret [us]byte \(-1\)\|\(255\)'
; RUN: grep 'ret i8 \(-1\)\|\(255\)'
sbyte %test() {
sbyte %test1() {
%x = fptoui float 255.0 to sbyte
ret sbyte %x
}
ubyte %test() {
ubyte %test2() {
%x = fptosi float -1.0 to ubyte
ret ubyte %x
}

View File

@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'lshr int' | wc -l | grep 2 &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'lshr i32' | wc -l | grep 2 &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep ashr
int %test1(int %X, ubyte %A) {

View File

@@ -1,7 +1,7 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'sub int %Cok, %Bok' | not grep sub
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'sub i32 %Cok, %Bok' | not grep sub
implementation

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'and int %Y, 8'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'and i32 %Y, 8'
int %test1(ubyte %X) {
%Y = cast ubyte %X to int

View File

@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | grep "X3.lcssa = phi int" &&
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | grep "%X4 = add int 3, %X3.lcssa"
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | grep "X3.lcssa = phi i32" &&
; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | grep "%X4 = add i32 3, %X3.lcssa"
void %lcssa(bool %S2) {
entry:
@@ -23,4 +23,4 @@ post.if:
loop.exit:
%X4 = add int 3, %X3
ret void
}
}

View File

@@ -1,12 +1,12 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis
void "testfunc"(int %i) {
void "testfunc"(int %i.s) {
br label %Loop
Loop:
%j = phi uint [0, %0], [%Next, %Loop]
%i = cast int %i to uint
%i = cast int %i.s to uint
%i2 = mul uint %i, 17
%Next = add uint %j, %i2
%cond = seteq uint %Next, 0

View File

@@ -1,7 +1,7 @@
; Test that LICM works when there is not a loop-preheader
; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis
void "testfunc"(int %i, bool %ifcond) {
void "testfunc"(int %i.s, bool %ifcond) {
br bool %ifcond, label %Then, label %Else
Then:
br label %Loop
@@ -10,7 +10,7 @@ Else:
Loop:
%j = phi uint [0, %Then], [12, %Else], [%Next, %Loop]
%i = cast int %i to uint
%i = cast int %i.s to uint
%i2 = mul uint %i, 17
%Next = add uint %j, %i2
%cond = seteq uint %Next, 0

View File

@@ -25,8 +25,8 @@ no_exit.1.outer: ; preds = %cond_true, %no_exit.1.preheader
br label %no_exit.1
no_exit.1: ; preds = %cond_continue, %no_exit.1.outer
%indvar = phi uint [ 0, %no_exit.1.outer ], [ %indvar.next, %cond_continue ] ; <uint> [#uses=2]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%indvar.ui = phi uint [ 0, %no_exit.1.outer ], [ %indvar.next, %cond_continue ] ; <uint> [#uses=2]
%indvar = cast uint %indvar.ui to int ; <int> [#uses=1]
%j.1.2 = add int %indvar, %j.1.2.ph ; <int> [#uses=2]
%tmp.11 = add int %j.1.2, %tmp.9 ; <int> [#uses=1]
%tmp.12 = cast int %tmp.11 to ubyte ; <ubyte> [#uses=1]
@@ -43,7 +43,7 @@ cond_true: ; preds = %no_exit.1
cond_continue: ; preds = %no_exit.1
%tmp.519 = setlt int %inc.1, %C ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
%indvar.next = add uint %indvar.ui, 1 ; <uint> [#uses=1]
br bool %tmp.519, label %no_exit.1, label %loopexit.1
loopexit.1: ; preds = %cond_continue, %cond_true, %loopentry.1

View File

@@ -1,17 +1,17 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep mul | wc -l | grep 1
; LSR should not make two copies of the Q*L expression in the preheader!
sbyte %test(sbyte* %A, sbyte* %B, int %L, int %Q, int %N) {
sbyte %test(sbyte* %A, sbyte* %B, int %L, int %Q, int %N.s) {
entry:
%tmp.6 = mul int %Q, %L ; <int> [#uses=1]
%N = cast int %N to uint ; <uint> [#uses=1]
%N = cast int %N.s to uint ; <uint> [#uses=1]
br label %no_exit
no_exit: ; preds = %no_exit, %no_exit.preheader
%indvar = phi uint [ 0, %entry], [ %indvar.next, %no_exit ] ; <uint> [#uses=2]
%indvar.ui = phi uint [ 0, %entry], [ %indvar.next, %no_exit ] ; <uint> [#uses=2]
%Sum.0.0 = phi sbyte [ 0, %entry], [ %tmp.21, %no_exit ] ; <sbyte> [#uses=1]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%N_addr.0.0 = sub int %N, %indvar ; <int> [#uses=1]
%indvar = cast uint %indvar.ui to int ; <int> [#uses=1]
%N_addr.0.0 = sub int %N.s, %indvar ; <int> [#uses=1]
%tmp.8 = add int %N_addr.0.0, %tmp.6 ; <int> [#uses=2]
%tmp.9 = getelementptr sbyte* %A, int %tmp.8 ; <sbyte*> [#uses=1]
%tmp.10 = load sbyte* %tmp.9 ; <sbyte> [#uses=1]
@@ -19,7 +19,7 @@ no_exit: ; preds = %no_exit, %no_exit.preheader
%tmp.18 = load sbyte* %tmp.17 ; <sbyte> [#uses=1]
%tmp.19 = sub sbyte %tmp.10, %tmp.18 ; <sbyte> [#uses=1]
%tmp.21 = add sbyte %tmp.19, %Sum.0.0 ; <sbyte> [#uses=2]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=2]
%indvar.next = add uint %indvar.ui, 1 ; <uint> [#uses=2]
%exitcond = seteq uint %indvar.next, %N ; <bool> [#uses=1]
br bool %exitcond, label %loopexit, label %no_exit

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep 'add uint %iv.*inc, 1'
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep 'add i32 %iv.*inc, 1'
;
; Make sure that the use of the IV outside of the loop (the store) uses the
; post incremented value of the IV, not the preincremented value. This
@@ -13,13 +13,13 @@ then.0:
br label %no_exit.2
no_exit.2: ; preds = %no_exit.2, %then.0
%indvar630 = phi uint [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <uint> [#uses=3]
%indvar630 = cast uint %indvar630 to int ; <int> [#uses=1]
%tmp.38 = getelementptr [700 x int]* %nbeaux_.0__558, int 0, uint %indvar630 ; <int*> [#uses=1]
%indvar630.ui = phi uint [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <uint> [#uses=3]
%indvar630 = cast uint %indvar630.ui to int ; <int> [#uses=1]
%tmp.38 = getelementptr [700 x int]* %nbeaux_.0__558, int 0, uint %indvar630.ui ; <int*> [#uses=1]
store int 0, int* %tmp.38
%inc.2 = add int %indvar630, 2 ; <int> [#uses=2]
%tmp.34 = call bool %pred(int %indvar630)
%indvar.next631 = add uint %indvar630, 1 ; <uint> [#uses=1]
%indvar.next631 = add uint %indvar630.ui, 1 ; <uint> [#uses=1]
br bool %tmp.34, label %no_exit.2, label %loopexit.2.loopexit
loopexit.2.loopexit: ; preds = %no_exit.2

View File

@@ -17,10 +17,10 @@ target triple = "i686-apple-darwin8"
implementation ; Functions:
void %foo(int %k, int %i) {
void %foo(int %k, int %i.s) {
entry:
%i = cast int %i to uint ; <uint> [#uses=2]
%k_addr.012 = shl int %i, ubyte 1 ; <int> [#uses=1]
%i = cast int %i.s to uint ; <uint> [#uses=2]
%k_addr.012 = shl int %i.s, ubyte 1 ; <int> [#uses=1]
%tmp14 = setgt int %k_addr.012, 8192 ; <bool> [#uses=1]
br bool %tmp14, label %return, label %bb.preheader
@@ -35,7 +35,7 @@ bb: ; preds = %bb, %bb.preheader
%k_addr.0.0 = cast uint %tmp.16 to int ; <int> [#uses=1]
%tmp = getelementptr [8193 x sbyte]* %flags2, int 0, uint %tmp.16 ; <sbyte*> [#uses=1]
store sbyte 0, sbyte* %tmp
%k_addr.0 = add int %k_addr.0.0, %i ; <int> [#uses=1]
%k_addr.0 = add int %k_addr.0.0, %i.s ; <int> [#uses=1]
%tmp = setgt int %k_addr.0, 8192 ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
br bool %tmp, label %return.loopexit, label %bb

View File

@@ -1421,8 +1421,8 @@ no_exit.53.outer:
no_exit.53: ; preds = %else.166, %else.168, %then.360, %no_exit.53.outer
%file.2.3.3.ph = phi int [ 0, %no_exit.53.outer ], [ %inc.551688, %then.360 ], [ %inc.551701, %else.168 ], [ %file.2.3.3.ph, %else.166 ] ; <int> [#uses=2]
%nempty.5.3.ph = phi int [ 0, %no_exit.53.outer ], [ %nempty.5.3, %then.360 ], [ %nempty.5.3, %else.168 ], [ %nempty.5.3.ph, %else.166 ] ; <int> [#uses=2]
%indvar2053 = phi uint [ 0, %no_exit.53.outer ], [ 0, %then.360 ], [ 0, %else.168 ], [ %indvar.next2054, %else.166 ] ; <uint> [#uses=2]
%indvar2053 = cast uint %indvar2053 to int ; <int> [#uses=2]
%indvar2053.ui = phi uint [ 0, %no_exit.53.outer ], [ 0, %then.360 ], [ 0, %else.168 ], [ %indvar.next2054, %else.166 ] ; <uint> [#uses=2]
%indvar2053 = cast uint %indvar2053.ui to int ; <int> [#uses=2]
%file.2.3.3 = add int %indvar2053, %file.2.3.3.ph ; <int> [#uses=4]
%nempty.5.3 = add int %indvar2053, %nempty.5.3.ph ; <int> [#uses=3]
%tmp.4749 = add int %file.2.3.3, %tmp.4747 ; <int> [#uses=1]
@@ -1472,7 +1472,7 @@ else.168: ; preds = %endif.358
else.166: ; preds = %no_exit.53
%inc.55 = add int %file.2.3.3, 1 ; <int> [#uses=1]
%tmp.47421705 = setlt int %inc.55, 8 ; <bool> [#uses=1]
%indvar.next2054 = add uint %indvar2053, 1 ; <uint> [#uses=1]
%indvar.next2054 = add uint %indvar2053.ui, 1 ; <uint> [#uses=1]
br bool %tmp.47421705, label %no_exit.53, label %loopexit.56
loopexit.56: ; preds = %else.166, %else.168, %then.360

View File

@@ -16,8 +16,8 @@ cond_true.outer: ; preds = %cond_true.i, %entry
br label %cond_true
cond_true: ; preds = %return.i, %cond_true.outer
%indvar = phi uint [ 0, %cond_true.outer ], [ %indvar.next, %return.i ] ; <uint> [#uses=2]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%indvar.ui = phi uint [ 0, %cond_true.outer ], [ %indvar.next, %return.i ] ; <uint> [#uses=2]
%indvar = cast uint %indvar.ui to int ; <int> [#uses=1]
%i.0.0 = add int %indvar, %i.0.0.ph ; <int> [#uses=3]
%savedstack = call sbyte* %llvm.stacksave( ) ; <sbyte*> [#uses=2]
%tmp.i = seteq int %i.0.0, 0 ; <bool> [#uses=1]
@@ -38,7 +38,7 @@ cond_true.i: ; preds = %cond_true
return.i: ; preds = %cond_true
call void %llvm.stackrestore( sbyte* %savedstack )
%tmp21 = setgt int %tmp5, 9999 ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
%indvar.next = add uint %indvar.ui, 1 ; <uint> [#uses=1]
br bool %tmp21, label %bb8, label %cond_true
bb8: ; preds = %return.i, %cond_true.i

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep 'ret int 0'
; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep 'ret i32 0'
int %f(int %a0, int %a1, int %a2, int %a3, int %a4) {
%tmp.2 = add int %a4, %a3 ; <int> [#uses=1]

View File

@@ -1,6 +1,6 @@
; With shl->mul reassociation, we can see that this is (shl A, 9) * A
;
; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep 'shl .*, ubyte 9'
; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep 'shl .*, i8 9'
int %test(int %A, int %B) {
%X = shl int %A, ubyte 5

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep 'ret int 1'
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep 'ret i32 1'
; This function definitely returns 1, even if we don't know the direction
; of the branch.

View File

@@ -105,8 +105,8 @@ implementation ; Functions:
void %gldLLVMVecPointRender(%struct.GLDContextRec* %ctx) {
entry:
%tmp = getelementptr %struct.GLDContextRec* %ctx, int 0, uint 22 ; <uint*> [#uses=1]
%tmp = load uint* %tmp ; <uint> [#uses=3]
%tmp.uip = getelementptr %struct.GLDContextRec* %ctx, int 0, uint 22 ; <uint*> [#uses=1]
%tmp = load uint* %tmp.uip ; <uint> [#uses=3]
%tmp91 = lshr uint %tmp, ubyte 5 ; <uint> [#uses=1]
%tmp92 = trunc uint %tmp91 to bool ; <bool> [#uses=1]
br bool %tmp92, label %cond_true93, label %cond_next116

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | grep -v 'ret int 17' | grep -v 'ret int undef' | not grep ret
; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | grep -v 'ret i32 17' | grep -v 'ret i32 undef' | not grep ret
implementation

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | grep -v 'ret int 0' | grep -v 'ret int undef' | not grep ret
; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | grep -v 'ret i32 0' | grep -v 'ret i32 undef' | not grep ret
implementation

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep 'ret int 0'
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep 'ret i32 0'
; Test that SCCP has basic knowledge of when and/or nuke overdefined values.

View File

@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis &&
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep -F 'alloca [2 x <4 x int>]'
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep -F 'alloca [2 x <4 x i32>]'
int %func(<4 x float> %v0, <4 x float> %v1) {
%vsiidx = alloca [2 x <4 x int>], align 16 ; <[2 x <4 x int>]*> [#uses=3]

View File

@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca &&
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'bitcast.*float.*int'
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'bitcast.*float.*i32'
int %test(float %X) {
%X_addr = alloca float

View File

@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca &&
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'ret sbyte'
; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'ret i8'
; PR892

View File

@@ -413,11 +413,11 @@ invcont222: ; preds = %cond_true220
cond_next225: ; preds = %invcont222, %cond_true217, %invcont213
%toPage.1 = phi int [ %tmp223, %invcont222 ], [ %tmp214, %cond_true217 ], [ %tmp214, %invcont213 ] ; <int> [#uses=2]
%fromPage.1 = phi int [ 1, %invcont222 ], [ %tmp211, %cond_true217 ], [ %tmp211, %invcont213 ] ; <int> [#uses=2]
%tmp = invoke uint %_ZNK8QPrinter9pageOrderEv( %struct.QPrinter* %printer )
%tmp.page = invoke uint %_ZNK8QPrinter9pageOrderEv( %struct.QPrinter* %printer )
to label %invcont227 unwind label %cleanup329 ; <uint> [#uses=1]
invcont227: ; preds = %cond_next225
%tmp228 = seteq uint %tmp, 1 ; <bool> [#uses=1]
%tmp228 = seteq uint %tmp.page, 1 ; <bool> [#uses=1]
br bool %tmp228, label %cond_true230, label %cond_next234
cond_true230: ; preds = %invcont227

View File

@@ -56,7 +56,7 @@ entry:
bb: ; preds = %bb33
%tmp = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1]
%tmp = call int %_IO_getc( %struct.FILE* %tmp ) ; <int> [#uses=1]
%tmp.r = call int %_IO_getc( %struct.FILE* %tmp ) ; <int> [#uses=1]
%tmp6 = call int %tolower( int %tmp ) ; <int> [#uses=1]
%tmp6 = trunc int %tmp6 to sbyte ; <sbyte> [#uses=1]
store sbyte %tmp6, sbyte* %c

View File

@@ -1,5 +1,5 @@
; Test that the ExitInMainOptimization pass works correctly
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | grep -c 'ret int 3' | grep 1
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | grep -c 'ret i32 3' | grep 1
declare void %exit(int)
declare void %exitonly(int)

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | grep 'call int %foo'
; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | grep 'call i32 %foo'
declare void %bar(int*)
int %foo(uint %N) {

View File

@@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | %prcontext alloca 1 | grep 'int %foo'
; RUN: llvm-upgrade < %s | llvm-as | opt -tailcallelim | llvm-dis | %prcontext alloca 1 | grep 'i32 %foo'
declare void %bar(int*)
int %foo() {