[llvm-commits] LDRB_POST_IMM crash

Stepan Dyatkovskiy stpworld at narod.ru
Thu Oct 4 11:03:45 PDT 2012


Hi all!

SDNode for LDRB_POST_IMM is invalid: number of registers added to SDNode 
fewer that described in .td.

7 ops is needed, but SDNode with only 6 is created. For fast comparison, 
you can look in generated code ARMGenInstrInfo.inc. At LDRB_POST_IMM 
description and its OperandInfo52.

In more details:
In ARMInstrInfo.td, in multiclass AI2_ldridx, in definition _POST_IMM, 
offset operand is defined as am2offset_imm. am2offset_imm is complex 
parameter type, and actually it consists from dummy register and imm 
itself. As I understood trick with dummy reg was made for AsmParser. In 
ARMISelLowering.cpp, this dummy register was not added to SDNode, and it 
cause crash in Peephole Optimizer pass.

Please find the patch in attachment.

-Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldrb_post_imm.patch
Type: text/x-patch
Size: 1638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121004/5f2c6c85/attachment.bin>


More information about the llvm-commits mailing list