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)
commit2c2cb3c09f856975027becadb22dcca370683f30
tree091ea6e8eaf47cc0fd5a2170ed1704e5839b6de7
parent661afe75e81431a66de3ed8e22d5aa91443367b3
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165617 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/2012-10-04-LDRB_POST_IMM-Crash.ll [new file with mode: 0644]