[llvm-commits] r64000 breaks PIC16

Alireza.Moshtaghi at microchip.com Alireza.Moshtaghi at microchip.com
Wed Feb 11 16:08:07 PST 2009


Looks like the problem is in sinking stuff; I disabled them and it
worked.
Too me it seems like sinker does not check if the instruction to sink is
providing a flag to a successor, if so it shouldn't move the
instruction.
In our case, blt is linked to subwf only through a flag (no register is
used... ) blt is kept in place and subwf is sinked, followed by all
instructions that provided to it.
How can we check if an instruction is used by a successor through a
flag?

Here is the correct (expected) code again:
foo:
        movlw 128
        banksel foo.arg.i
        xorwf foo.arg.i + 1, W
        movwf foo.tmp + 2
        movlw 127
        movwf foo.tmp + 1
        movf foo.tmp + 2, W
        subwf foo.tmp + 1, W
        blt .BB1_2      ; if.else  (correct - br after test)
.BB1_1  ; if.then
        movlw 255
        movwf foo.args + 0
        movwf foo.args + 1
        goto .BB1_3     ; return
.BB1_2  ; if.else
        movlw 1
        movwf foo.args + 0
        ...


Thanks
Ali

> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> bounces at cs.uiuc.edu] On Behalf Of sanjiv gupta
> Sent: Tuesday, February 10, 2009 8:58 PM
> To: gohman at apple.com
> Cc: Commit Messages and Patches for LLVM
> Subject: Re: [llvm-commits] r64000 breaks PIC16
> 
> 
> On Tue, 2009-02-10 at 12:24 -0800, Dan Gohman wrote:
> > On Feb 10, 2009, at 11:00 AM, sanjiv gupta wrote:
> > > The correct assembly is: (as per r63998)
> > [snip]
> > >
> > > The incorrect assembly is : (as per r64000)
> >
> > [snip]
> >
> > It looks like 63999, enabling sinking, is more likely to be the
> > revision that
> > introduces the change.  If it is, can you check to see if the
problem
> > is fixed
> > in the latest trunk?
> >
> > Dan
> >
> Dan,
> It still breaks as per 64285.
> 
> I have attached a .bc file.
> The problem with the generated assembly is that the branch (.blt) is
> happening before the test (subwf) insn.
> 
> 
> - Sanjiv
> 
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list