[LLVMbugs] [Bug 652] NEW: Legalize drops conditions and selects

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Nov 1 16:10:39 PST 2005


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=652

           Summary: Legalize drops conditions and selects
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: alenhar2 at uiuc.edu


Legalize makes the last block mostly disappear, and that is bad.

  ; ModuleID = 'bugpoint.test.bc'
target endian = little
target pointersize = 64

implementation   ; Functions:

bool %l5_l14_g721_encoder_then_2E_i(int %tmp.46.reload, short* %tmp.5542.out) {
newFuncRoot:
        br label %then.i

cond_true.exitStub:             ; preds = %then.i
        store short %tmp.5542, short* %tmp.5542.out
        ret bool true

cond_false.exitStub:            ; preds = %then.i
        store short %tmp.5542, short* %tmp.5542.out
        ret bool false

then.i:         ; preds = %newFuncRoot
        %tmp.11.i = setne int %tmp.46.reload, 0         ; <bool> [#uses=1]
        %tmp.5542 = select bool %tmp.11.i, short -32768, short 0               
; <short> [#uses=3]
        %tmp.5744 = setlt short %tmp.5542, 0            ; <bool> [#uses=1]
        br bool %tmp.5744, label %cond_true.exitStub, label %cond_false.exitStub
}


Gets codegened into:
newFuncRoot:
        %$31 = BR mbb<then.i,0x120f11190>
cond_true.exitStub:
        STW %$0, 0, %$17
        %$0 = LDA 1, %$31
        %$31 = RET %$26, 1
cond_false.exitStub:
        STW %$0, 0, %$17
        %$0 = LDA 0, %$31
        %$31 = RET %$26, 1
then.i:
        %$0 = LDA 0, %$31
        %$31 = BR mbb<cond_false.exitStub,0x120f110d0>


then.i is clearly in bad shape.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list