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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33183
91177308-0d34-0410-b5e6-
96231b3b80d8
18 files changed:
-; 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()
%G = internal global int* null
declare int *%ext()
; RUN: llvm-as < %s | llvm-dis | grep bitcast
; 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
implementation ; Functions:
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
define csretcc void %__divsc3({ float, float }* %agg.result, float %a, float %b, float %c, float %d) {
entry:
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]
bb: ; preds = %entry
%tmp81 = tail call float %copysignf( float 0x7FF0000000000000, float %c ) ; <float> [#uses=1]
declare float %fabsf(float)
declare float %fabsf(float)
-declare bool %llvm.isunordered.f32(float, float)
+declare i1 %llvm.isunordered.f32(float, float)
declare float %copysignf(float, float)
declare float %copysignf(float, float)
define i32 %f7(float %a, float %b) {
entry:
%tmp = fcmp ueq float %a,%b
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
define void %test3() {
%tmp.0 = call i16 %foo() sext ;; no extsh!
%tmp.1 = icmp slt i16 %tmp.0, 1234
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)
then:
call i32 %test1(i16 0 sext)
define double %foo(i32 %a.u) {
entry:
%tmp = icmp eq i32 %a.u,0
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
-; 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
; 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
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
}
define i32 %test3(i8* %ptr) {
%val = load i8* %ptr
}
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:
cond_true:
ret i32 21
cond_false:
}
define i32 %test4(i8* %ptr) {
}
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:
cond_true:
ret i32 21
cond_false:
}
define i32 %test5(float %f) {
}
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:
cond_true:
ret i32 21
cond_false:
}
define i32 %test6(double %d) {
}
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:
cond_true:
ret i32 21
cond_false:
-; 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
bool %test() {
%X = trunc uint 320 to bool
ret bool %X
-; 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.
;; check that global opt turns integers that only hold 0 or 1 into bools.
-; 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) {
implementation
internal int %foo(bool %C) {
bb2: ; preds = %bb, %entry
%i.0 = phi i32 [ 0, %entry ], [ %tmp1, %bb ] ; <i32> [#uses=4]
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
cond_true: ; preds = %bb2
br label %bb
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]
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
bb6: ; preds = %cond_next
br label %return
store double 0.000000e+00, double* %j
%k = add i64 %i, 1
%n = icmp eq i64 %k, 0
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
-; 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
bool %test(bool %V) {
%Y = setlt bool %V, false
ret bool %Y
-; 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]
; PR586
%g_07918478 = external global uint ; <uint*> [#uses=1]
; This file contains various testcases that check to see that instcombine
; is narrowing computations when possible.
; 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.
; test1 - Eliminating the casts in this testcase (by narrowing the AND
; operation) allows instcombine to realize the function always returns false.
; Make sure that the compare instruction occurs after the increment to avoid
; 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:
void %foo(float* %D, uint %E) {
entry:
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | \
; 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
bool %foo() {
%X = and bool false, undef