Make each target map all inline assembly memory constraints to InlineAsm::Constraint_m. NFC.

Summary:
This is instead of doing this in target independent code and is the last
non-functional change before targets begin to distinguish between
different memory constraints when selecting code for the ISD::INLINEASM
node.

Next, each target will individually move away from the idea that all
memory constraints behave like 'm'.

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 232373
This commit is contained in:
Daniel Sanders 2015-03-16 13:13:41 +00:00
parent ace93f3a90
commit bf5b80f5f9
12 changed files with 70 additions and 3 deletions

View File

@ -2627,9 +2627,9 @@ public:
virtual unsigned
getInlineAsmMemConstraint(const std::string &ConstraintCode) const {
// FIXME: This currently maps all constraints to the the same code.
// This will be corrected once all targets are updated.
return InlineAsm::Constraint_m;
if (ConstraintCode == "m")
return InlineAsm::Constraint_m;
return InlineAsm::Constraint_Unknown;
}
/// Try to replace an X constraint, which matches anything, with another that

View File

@ -473,6 +473,12 @@ private:
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
bool mayBeEmittedAsTailCall(CallInst *CI) const override;
bool getIndexedAddressParts(SDNode *Op, SDValue &Base, SDValue &Offset,

View File

@ -348,6 +348,12 @@ namespace llvm {
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
const ARMSubtarget* getSubtarget() const {
return Subtarget;
}

View File

@ -183,6 +183,12 @@ bool isPositiveHalfWord(SDNode *N);
const std::string &Constraint,
MVT VT) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
// Intrinsics
SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
/// isLegalAddressingMode - Return true if the addressing mode represented

View File

@ -102,6 +102,12 @@ namespace llvm {
const std::string &Constraint,
MVT VT) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
/// isTruncateFree - Return true if it's free to truncate a value of type
/// Ty1 to type Ty2. e.g. On msp430 it's free to truncate a i16 value in
/// register R15W to i8 by referencing its sub-register R15B.

View File

@ -503,6 +503,12 @@ namespace llvm {
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const override;
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;

View File

@ -497,6 +497,12 @@ public:
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
const NVPTXTargetMachine *nvTM;
// PTX always uses 32-bit shift amounts

View File

@ -519,6 +519,12 @@ namespace llvm {
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
/// isLegalAddressingMode - Return true if the addressing mode represented
/// by AM is legal for this target, for a load/store of the specified type.
bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const override;

View File

@ -85,6 +85,12 @@ namespace llvm {
const std::string &Constraint,
MVT VT) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
MVT getScalarShiftAmountTy(EVT LHSTy) const override { return MVT::i32; }

View File

@ -233,6 +233,13 @@ public:
std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
MachineBasicBlock *BB) const
override;

View File

@ -695,6 +695,12 @@ namespace llvm {
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
/// Given a physical register constraint
/// (e.g. {edx}), return the register number and the register class for the
/// register. This should only be used for C_Register constraints. On

View File

@ -177,6 +177,12 @@ namespace llvm {
const std::string &Constraint,
MVT VT) const override;
unsigned getInlineAsmMemConstraint(
const std::string &ConstraintCode) const override {
// FIXME: Map different constraints differently.
return InlineAsm::Constraint_m;
}
// Expand specifics
SDValue TryExpandADDWithMul(SDNode *Op, SelectionDAG &DAG) const;
SDValue ExpandADDSUB(SDNode *Op, SelectionDAG &DAG) const;