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