forked from OSchip/llvm-project
For PR1043:
Bye, Bye Booly. Remove the use of the bool type from non-upgraded test cases and from grep expressions. The parser doesn't accept it and the asm writer doesn't produce it any more. llvm-svn: 33183
This commit is contained in:
parent
58a8db0a3f
commit
985e52f7c6
|
@ -1,4 +1,6 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -anders-aa -load-vn -gcse -instcombine | llvm-dis | grep 'ret bool true'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | \
|
||||
; RUN: opt -anders-aa -load-vn -gcse -instcombine | llvm-dis | \
|
||||
; RUN: grep 'ret i1 true'
|
||||
|
||||
%G = internal global int* null
|
||||
declare int *%ext()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: llvm-as < %s | llvm-dis | grep bitcast
|
||||
define bool %main(i32 %X) {
|
||||
%res = bitcast bool true to bool
|
||||
ret bool %res
|
||||
define i1 %main(i32 %X) {
|
||||
%res = bitcast i1 true to i1
|
||||
ret i1 %res
|
||||
}
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
|
||||
implementation ; Functions:
|
||||
|
||||
define bool %someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
|
||||
ret bool true
|
||||
define i1 %someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
|
||||
ret i1 true
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
define csretcc void %__divsc3({ float, float }* %agg.result, float %a, float %b, float %c, float %d) {
|
||||
entry:
|
||||
br bool false, label %bb, label %cond_next375
|
||||
br i1 false, label %bb, label %cond_next375
|
||||
|
||||
bb: ; preds = %entry
|
||||
%tmp81 = tail call float %copysignf( float 0x7FF0000000000000, float %c ) ; <float> [#uses=1]
|
||||
|
@ -16,6 +16,6 @@ cond_next375: ; preds = %bb, %entry
|
|||
|
||||
declare float %fabsf(float)
|
||||
|
||||
declare bool %llvm.isunordered.f32(float, float)
|
||||
declare i1 %llvm.isunordered.f32(float, float)
|
||||
|
||||
declare float %copysignf(float, float)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
define i32 %f7(float %a, float %b) {
|
||||
entry:
|
||||
%tmp = fcmp ueq float %a,%b
|
||||
%retval = select bool %tmp, i32 666, i32 42
|
||||
%retval = select i1 %tmp, i32 666, i32 42
|
||||
ret i32 %retval
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ define i32 %test2(i16 zext %X) {
|
|||
define void %test3() {
|
||||
%tmp.0 = call i16 %foo() sext ;; no extsh!
|
||||
%tmp.1 = icmp slt i16 %tmp.0, 1234
|
||||
br bool %tmp.1, label %then, label %UnifiedReturnBlock
|
||||
br i1 %tmp.1, label %then, label %UnifiedReturnBlock
|
||||
|
||||
then:
|
||||
call i32 %test1(i16 0 sext)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
define double %foo(i32 %a.u) {
|
||||
entry:
|
||||
%tmp = icmp eq i32 %a.u,0
|
||||
%retval = select bool %tmp, double 4.561230e+02, double 1.234560e+02
|
||||
%retval = select i1 %tmp, double 4.561230e+02, double 1.234560e+02
|
||||
ret double %retval
|
||||
}
|
||||
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
; An integer truncation to bool should be done with an and instruction to make
|
||||
; An integer truncation to i1 should be done with an and instruction to make
|
||||
; sure only the LSBit survives. Test that this is the case both for a returned
|
||||
; value and as the operand of a branch.
|
||||
; RUN: llvm-as < %s | llc -march=x86 &&
|
||||
; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | \
|
||||
; RUN: wc -l | grep 6
|
||||
|
||||
define bool %test1(i32 %X) zext {
|
||||
%Y = trunc i32 %X to bool
|
||||
ret bool %Y
|
||||
define i1 %test1(i32 %X) zext {
|
||||
%Y = trunc i32 %X to i1
|
||||
ret i1 %Y
|
||||
}
|
||||
|
||||
define bool %test2(i32 %val, i32 %mask) {
|
||||
define i1 %test2(i32 %val, i32 %mask) {
|
||||
entry:
|
||||
%mask = trunc i32 %mask to i8
|
||||
%shifted = ashr i32 %val, i8 %mask
|
||||
%anded = and i32 %shifted, 1
|
||||
%trunced = trunc i32 %anded to bool
|
||||
br bool %trunced, label %ret_true, label %ret_false
|
||||
%trunced = trunc i32 %anded to i1
|
||||
br i1 %trunced, label %ret_true, label %ret_false
|
||||
ret_true:
|
||||
ret bool true
|
||||
ret i1 true
|
||||
ret_false:
|
||||
ret bool false
|
||||
ret i1 false
|
||||
}
|
||||
|
||||
define i32 %test3(i8* %ptr) {
|
||||
%val = load i8* %ptr
|
||||
%tmp = trunc i8 %val to bool
|
||||
br bool %tmp, label %cond_true, label %cond_false
|
||||
%tmp = trunc i8 %val to i1
|
||||
br i1 %tmp, label %cond_true, label %cond_false
|
||||
cond_true:
|
||||
ret i32 21
|
||||
cond_false:
|
||||
|
@ -34,8 +34,8 @@ cond_false:
|
|||
}
|
||||
|
||||
define i32 %test4(i8* %ptr) {
|
||||
%tmp = ptrtoint i8* %ptr to bool
|
||||
br bool %tmp, label %cond_true, label %cond_false
|
||||
%tmp = ptrtoint i8* %ptr to i1
|
||||
br i1 %tmp, label %cond_true, label %cond_false
|
||||
cond_true:
|
||||
ret i32 21
|
||||
cond_false:
|
||||
|
@ -43,8 +43,8 @@ cond_false:
|
|||
}
|
||||
|
||||
define i32 %test5(float %f) {
|
||||
%tmp = fptoui float %f to bool
|
||||
br bool %tmp, label %cond_true, label %cond_false
|
||||
%tmp = fptoui float %f to i1
|
||||
br i1 %tmp, label %cond_true, label %cond_false
|
||||
cond_true:
|
||||
ret i32 21
|
||||
cond_false:
|
||||
|
@ -52,8 +52,8 @@ cond_false:
|
|||
}
|
||||
|
||||
define i32 %test6(double %d) {
|
||||
%tmp = fptosi double %d to bool
|
||||
br bool %tmp, label %cond_true, label %cond_false
|
||||
%tmp = fptosi double %d to i1
|
||||
br i1 %tmp, label %cond_true, label %cond_false
|
||||
cond_true:
|
||||
ret i32 21
|
||||
cond_false:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret bool false'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret i1 false'
|
||||
bool %test() {
|
||||
%X = trunc uint 320 to bool
|
||||
ret bool %X
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -instcombine | llvm-dis | grep 'ret bool true'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -instcombine | \
|
||||
; RUN: llvm-dis | grep 'ret i1 true'
|
||||
|
||||
;; check that global opt turns integers that only hold 0 or 1 into bools.
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -ipconstprop -instcombine | llvm-dis | grep 'ret bool true'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -ipconstprop -instcombine | \
|
||||
; RUN: llvm-dis | grep 'ret i1 true'
|
||||
implementation
|
||||
|
||||
internal int %foo(bool %C) {
|
||||
|
|
|
@ -21,8 +21,8 @@ bb: ; preds = %cond_next, %cond_true
|
|||
|
||||
bb2: ; preds = %bb, %entry
|
||||
%i.0 = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ; <i32> [#uses=4]
|
||||
%tmp = icmp eq i32 %i.0, 0 ; <bool> [#uses=1]
|
||||
br bool %tmp, label %cond_true, label %cond_next
|
||||
%tmp = icmp eq i32 %i.0, 0 ; <i1> [#uses=1]
|
||||
br i1 %tmp, label %cond_true, label %cond_next
|
||||
|
||||
cond_true: ; preds = %bb2
|
||||
br label %bb
|
||||
|
@ -30,8 +30,8 @@ cond_true: ; preds = %bb2
|
|||
cond_next: ; preds = %bb2
|
||||
%tmp = getelementptr [5 x i8]* %foo, i32 0, i32 %i.0 ; <i8*> [#uses=1]
|
||||
%tmp = load i8* %tmp ; <i8> [#uses=1]
|
||||
%tmp5 = icmp eq i8 %tmp, 0 ; <bool> [#uses=1]
|
||||
br bool %tmp5, label %bb6, label %bb
|
||||
%tmp5 = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
|
||||
br i1 %tmp5, label %bb6, label %bb
|
||||
|
||||
bb6: ; preds = %cond_next
|
||||
br label %return
|
||||
|
|
|
@ -11,7 +11,7 @@ bb:
|
|||
store double 0.000000e+00, double* %j
|
||||
%k = add i64 %i, 1
|
||||
%n = icmp eq i64 %k, 0
|
||||
br bool %n, label %return, label %bb
|
||||
br i1 %n, label %return, label %bb
|
||||
|
||||
return:
|
||||
ret void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret bool false'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret i1 false'
|
||||
bool %test(bool %V) {
|
||||
%Y = setlt bool %V, false
|
||||
ret bool %Y
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret bool true'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
|
||||
; RUN: grep 'ret i1 true'
|
||||
; PR586
|
||||
|
||||
%g_07918478 = external global uint ; <uint*> [#uses=1]
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
; This file contains various testcases that check to see that instcombine
|
||||
; is narrowing computations when possible.
|
||||
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret bool false'
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
|
||||
; RUN: grep 'ret i1 false'
|
||||
|
||||
; test1 - Eliminating the casts in this testcase (by narrowing the AND
|
||||
; operation) allows instcombine to realize the function always returns false.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
; Make sure that the compare instruction occurs after the increment to avoid
|
||||
; having overlapping live ranges that result in copies. We want the setcc instruction
|
||||
; immediately before the conditional branch.
|
||||
; having overlapping live ranges that result in copies. We want the setcc
|
||||
; instruction immediately before the conditional branch.
|
||||
;
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | %prcontext 'br bool' 1 | grep icmp
|
||||
; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
|
||||
; RUN: %prcontext 'br i1' 1 | grep icmp
|
||||
|
||||
void %foo(float* %D, uint %E) {
|
||||
entry:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | \
|
||||
; RUN: grep 'ret bool false'
|
||||
; RUN: grep 'ret i1 false'
|
||||
|
||||
bool %foo() {
|
||||
%X = and bool false, undef
|
||||
|
|
Loading…
Reference in New Issue