[aarch64] Distinguish the 'Q' and 'm' inline assembly memory constraints.

Summary:
But still handle them the same way since I don't know how they differ on
this target.

Clang also has code for 'Ump', 'Utf', 'Usa', and 'Ush' but calls
llvm_unreachable() on this code path so they are not converted to a
constraint id at the moment.

No functional change intended.

Reviewers: t.p.northover

Subscribers: aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D8177

llvm-svn: 232941
This commit is contained in:
Daniel Sanders 2015-03-23 11:33:15 +00:00
parent 3205f52198
commit f731eee322
2 changed files with 19 additions and 9 deletions

View File

@ -212,13 +212,19 @@ static bool isOpcWithIntImmediate(const SDNode *N, unsigned Opc,
bool AArch64DAGToDAGISel::SelectInlineAsmMemoryOperand( bool AArch64DAGToDAGISel::SelectInlineAsmMemoryOperand(
const SDValue &Op, unsigned ConstraintID, std::vector<SDValue> &OutOps) { const SDValue &Op, unsigned ConstraintID, std::vector<SDValue> &OutOps) {
assert(ConstraintID == InlineAsm::Constraint_m && switch(ConstraintID) {
"unexpected asm memory constraint"); default:
// Require the address to be in a register. That is safe for all AArch64 llvm_unreachable("Unexpected asm memory constraint");
// variants and it is hard to do anything much smarter without knowing case InlineAsm::Constraint_i:
// how the operand is used. case InlineAsm::Constraint_m:
OutOps.push_back(Op); case InlineAsm::Constraint_Q:
return false; // Require the address to be in a register. That is safe for all AArch64
// variants and it is hard to do anything much smarter without knowing
// how the operand is used.
OutOps.push_back(Op);
return false;
}
return true;
} }
/// SelectArithImmed - Select an immediate value that can be represented as /// SelectArithImmed - Select an immediate value that can be represented as

View File

@ -475,8 +475,12 @@ private:
unsigned getInlineAsmMemConstraint( unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override { const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently. if (ConstraintCode == "Q")
return InlineAsm::Constraint_m; return InlineAsm::Constraint_Q;
// FIXME: clang has code for 'Ump', 'Utf', 'Usa', and 'Ush' but these are
// followed by llvm_unreachable so we'll leave them unimplemented in
// the backend for now.
return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
} }
bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override; bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;