Recommit r232027 with PR22883 fixed: Add infrastructure for support of multiple memor...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 13 Mar 2015 12:45:09 +0000 (12:45 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 13 Mar 2015 12:45:09 +0000 (12:45 +0000)
commit547ba56bd0dd4dddf79f7db95263fd25d4c3827a
tree5188265d691baed7f1b6d4f4ce9dc52b92523577
parent4716d39f4d6a8285ee868a1c8d29190d636f5e8c
Recommit r232027 with PR22883 fixed: Add infrastructure for support of multiple memory constraints.

The operand flag word for ISD::INLINEASM nodes now contains a 15-bit
memory constraint ID when the operand kind is Kind_Mem. This constraint
ID is a numeric equivalent to the constraint code string and is converted
with a target specific hook in TargetLowering.

This patch maps all memory constraints to InlineAsm::Constraint_m so there
is no functional change at this point. It just proves that using these
previously unused bits in the encoding of the flag word doesn't break
anything.

The next patch will make each target preserve the current mapping of
everything to Constraint_m for itself while changing the target independent
implementation of the hook to return Constraint_Unknown appropriately. Each
target will then be adapted in separate patches to use appropriate
Constraint_* values.

PR22883 was caused the matching operands copying the whole of the operand flags
for the matched operand. This included the constraint id which needed to be
replaced with the operand number. This has been fixed with a conversion
function. Following on from this, matching operands also used the operand
number as the constraint id. This has been fixed by looking up the matched
operand and taking it from there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232165 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/CodeGen/SelectionDAGISel.h
include/llvm/IR/InlineAsm.h
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/MC/ELFObjectWriter.cpp
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h
lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp
lib/Target/Mips/MipsISelDAGToDAG.h
lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
lib/Target/NVPTX/NVPTXISelDAGToDAG.h
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/XCore/XCoreISelDAGToDAG.cpp