[llvm-commits] [PATCH] Teach MachineInstr::isRegTiedToDefOperand() to correctly parse inline asm operands

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Jul 16 08:15:46 PDT 2009


Hi,

The method MachineInstr:: isRegTiedToDefOperand() tries to find the  
flag operand on an inline asm instruction by going backwards from a  
register operand until it sees an immediate operand. This fails for  
PowerPC "m"-type asm operands represented as (flag, imm, reg) triples,  
causing assertions when imm<0.

The attached patch changes isRegTiedToDefOperand to search for the  
operand flag from the beginning of the operand list. It is the only  
safe way.

After applying this patch the the machine code verifier no longer  
trips assertions in the CodeGen/PowerPC test suite.

Regards,
/jakob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asm-operands.patch
Type: application/octet-stream
Size: 2993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090716/3f1e360c/attachment.obj>
-------------- next part --------------



More information about the llvm-commits mailing list