diff options
author | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2010-10-29 17:29:13 +0000 |
---|---|---|
committer | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2010-10-29 17:29:13 +0000 |
commit | e8360b7182d5965f507806a1167548d34e960ba7 (patch) | |
tree | 9b3e560ead159ef52ef017c8dc3d685083236597 /llvm/lib/Target/Alpha | |
parent | 5bc07d2bce68708893c65b42a317b4e3c24570d0 (diff) | |
download | bcm5719-llvm-e8360b7182d5965f507806a1167548d34e960ba7.tar.gz bcm5719-llvm-e8360b7182d5965f507806a1167548d34e960ba7.zip |
Inline asm multiple alternative constraints development phase 2 - improved basic logic, added initial platform support.
llvm-svn: 117667
Diffstat (limited to 'llvm/lib/Target/Alpha')
-rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.cpp | 25 | ||||
-rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.h | 5 |
2 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp index efd0d2c4a94..9ae06eab753 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp @@ -27,6 +27,7 @@ #include "llvm/Function.h" #include "llvm/Module.h" #include "llvm/Intrinsics.h" +#include "llvm/Type.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" @@ -803,6 +804,30 @@ AlphaTargetLowering::getConstraintType(const std::string &Constraint) const { return TargetLowering::getConstraintType(Constraint); } +/// Examine constraint type and operand type and determine a weight value. +/// This object must already have been set up with the operand type +/// and the current alternative constraint selected. +TargetLowering::ConstraintWeight +AlphaTargetLowering::getSingleConstraintMatchWeight( + AsmOperandInfo &info, const char *constraint) const { + ConstraintWeight weight = CW_Invalid; + Value *CallOperandVal = info.CallOperandVal; + // If we don't have a value, we can't do a match, + // but allow it at the lowest weight. + if (CallOperandVal == NULL) + return CW_Default; + // Look at the constraint type. + switch (*constraint) { + default: + weight = TargetLowering::getSingleConstraintMatchWeight(info, constraint); + break; + case 'f': + weight = CW_Register; + break; + } + return weight; +} + std::vector<unsigned> AlphaTargetLowering:: getRegClassForInlineAsmConstraint(const std::string &Constraint, EVT VT) const { diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.h b/llvm/lib/Target/Alpha/AlphaISelLowering.h index 46e0c7dc9f8..b429e9fc139 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.h +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.h @@ -87,6 +87,11 @@ namespace llvm { ConstraintType getConstraintType(const std::string &Constraint) const; + /// Examine constraint string and operand type and determine a weight value. + /// The operand object must already have been set up with the operand type. + ConstraintWeight getSingleConstraintMatchWeight( + AsmOperandInfo &info, const char *constraint) const; + std::vector<unsigned> getRegClassForInlineAsmConstraint(const std::string &Constraint, EVT VT) const; |