[llvm-commits] r64000 breaks PIC16

Chris Lattner clattner at apple.com
Wed Feb 11 22:08:44 PST 2009


On Feb 11, 2009, at 4:08 PM, Alireza.Moshtaghi at microchip.com wrote:

> 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?

Hi Alireza,

It looks like subfw isn't declared to implicitly set the flags  
register.  On X86 for example, all the instructions that mutate the  
flags are defined to implicitly set FLAGS, and all instructions that  
read the flags implicitly read FLAGS.  This prevents code motion from  
moving the instructions around.

-Chris




More information about the llvm-commits mailing list