blob: 3864d53062229d157be4f213b8474a09021c13b0 [file] [log] [blame]
Tanya Lattner16b222c2004-11-06 23:08:26 +00001; RUN: llvm-as -f %s -o - | llc
2
Vikram S. Advecf4c5a32003-05-28 13:54:41 +00003;; Date: May 27, 2003.
4;; From: Variant of 2003-05-27-usefsubasbool.ll
5;;
6;; Error: llc fails to save a boolean value in a register (and later uses an
7;; invalid register <NULL VALUE> in a BRNZ) for a boolean value
8;; used only by branches but in a different basic block.
9;;
10;; Cause: In SparcInstrSelection.cpp, for SetCC, when a result of setCC
11;; is used only for branches, it is not saved into an int. register.
12;; But if the boolean is used in a branch in a different basic block,
13;; that branch uses a BRNZ inst. instead of a branch-on-CC.
14;;
15;; LLC Output before fix:
16;; !****** Outputing Function: QRiterate_1 ******
17;;
18;; .section ".text"
19;; .align 4
20;; .global QRiterate_1
21;; .type QRiterate_1, 2
22;; QRiterate_1:
23;; .L_QRiterate_1_LL_0:
24;; save %o6, -192, %o6
25;; sethi %lm(LLVMGlobal__2), %o2
26;; sethi %hh(LLVMGlobal__2), %o1
27;; or %o1, %hm(LLVMGlobal__2), %o1
28;; sllx %o1, 32, %o1
29;; or %o2, %o1, %o2
30;; or %o2, %lo(LLVMGlobal__2), %o2
31;; ldd [%o2+0], %f32
32;; fcmpd %fcc0, %f0, %f32
33;; ba .L_QRiterate_1_LL_1
34;; nop
35;;
36;; .L_QRiterate_1_LL_1:
37;; brnz <NULL_VALUE>, .L_QRiterate_1_LL_1
38;; nop
39;; ba .L_QRiterate_1_LL_2
40;; nop
41;;
42;; .L_QRiterate_1_LL_2:
43;; jmpl %i7+8, %g0
44;; restore %g0, 0, %g0
45;;
46;; .EndOf_QRiterate_1:
47;; .size QRiterate_1, .EndOf_QRiterate_1-QRiterate_1
48;;
49
50target endian = big
51target pointersize = 64
52
53implementation ; Functions:
54
55internal void %QRiterate(double %tmp.212) {
56entry: ; No predecessors!
57 %tmp.213 = setne double %tmp.212, 0.000000e+00
58 br label %shortcirc_next.1
59
60shortcirc_next.1: ; preds = %entry
61 br bool %tmp.213, label %shortcirc_next.1, label %exit.1
62
63exit.1:
64 ret void
65}