Fix for LDRB instruction:
authorStepan Dyatkovskiy <stpworld@narod.ru>
Wed, 10 Oct 2012 11:43:40 +0000 (11:43 +0000)
committerStepan Dyatkovskiy <stpworld@narod.ru>
Wed, 10 Oct 2012 11:43:40 +0000 (11:43 +0000)
commit283baa00275467618bb7eb6f104244f20b50f452
tree7797633eceec1336be887a8ec993ba189133783c
parentf13dbb8e243372cd5228620285c3d73fc5aa7c86
Fix for LDRB instruction:
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.

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.

The problem fixed by setting up additional dummy reg when emitting
LDRB_POST_IMM instruction.

llvm-svn: 165617
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/2012-10-04-LDRB_POST_IMM-Crash.ll [new file with mode: 0644]