[inlineasm] Propagate operand constraints to the backend
authorSimon Dardis <simon.dardis@imgtec.com>
Mon, 18 Jul 2016 13:17:31 +0000 (13:17 +0000)
committerSimon Dardis <simon.dardis@imgtec.com>
Mon, 18 Jul 2016 13:17:31 +0000 (13:17 +0000)
commitd32a2d30cbe10cb966d0d98819a657eb209d1b47
tree62023d4a385b771a72ac2bcb4464be96910bb71e
parentde69d406862c7978f35bdbcb0bd10a510e77560c
[inlineasm] Propagate operand constraints to the backend

When SelectionDAGISel transforms a node representing an inline asm
block, memory constraint information is not preserved. This can cause
constraints to be broken when a memory offset is of the form:

offset + frame index

when the frame is resolved.

By propagating the constraints all the way to the backend, targets can
enforce memory operands of inline assembly to conform to their constraints.

For MIPSR6, some instructions had their offsets reduced to 9 bits from
16 bits such as ll/sc. This becomes problematic when using inline assembly
to perform atomic operations, as an offset can generated that is too big to
encode in the instruction.

Reviewers: dsanders, vkalintris

Differential Review: https://reviews.llvm.org/D21615

llvm-svn: 275786
llvm/include/llvm/IR/InlineAsm.h
llvm/lib/CodeGen/MachineInstr.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/lib/Target/Mips/MipsSERegisterInfo.cpp
llvm/test/CodeGen/Mips/inlineasm-constraint_ZC_2.ll [new file with mode: 0644]