Restricting register class to PointerRegClass for memory operands.
Also fix the PointerRegClass for AArch64 from GPR64 to GPR64sp, since XZR cannot hold a memory pointer while SP is.
Fixes PR33134.
Differential D34999
[AArch64] Avoid selecting XZR inline ASM memory operand kongyi on Jul 5 2017, 1:23 AM. Authored by
Details Restricting register class to PointerRegClass for memory operands. Also fix the PointerRegClass for AArch64 from GPR64 to GPR64sp, since XZR cannot hold a memory pointer while SP is. Fixes PR33134.
Diff Detail
Event TimelineComment Actions Is this really the best place to solve this issue? PowerPC has a similar problem (r0 can't be used for memory addresses); the PPC backend solves it in PPCDAGToDAGISel::SelectInlineAsmMemoryOperand. For non-memory inline asm operands, SelectionDAGBuilder::visitInlineAsm has code to constrain the register classes.
Comment Actions LGTM, with one minor comment.
|
Maybe put the test in test/CodeGen/AArch64/arm64-inline-asm.ll instead of its own file?