mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 06:06:19 +00:00
start bringing targetoperand flags into isel, first up, ExternalSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74199 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7bba2333fb
commit
1af2231da6
@ -310,8 +310,8 @@ public:
|
||||
SDValue getBasicBlock(MachineBasicBlock *MBB, DebugLoc dl);
|
||||
SDValue getExternalSymbol(const char *Sym, MVT VT);
|
||||
SDValue getExternalSymbol(const char *Sym, DebugLoc dl, MVT VT);
|
||||
SDValue getTargetExternalSymbol(const char *Sym, MVT VT);
|
||||
SDValue getTargetExternalSymbol(const char *Sym, DebugLoc dl, MVT VT);
|
||||
SDValue getTargetExternalSymbol(const char *Sym, MVT VT,
|
||||
unsigned char TargetFlags = 0);
|
||||
SDValue getArgFlags(ISD::ArgFlagsTy Flags);
|
||||
SDValue getValueType(MVT);
|
||||
SDValue getRegister(unsigned Reg, MVT VT);
|
||||
@ -862,7 +862,8 @@ private:
|
||||
std::vector<SDNode*> ValueTypeNodes;
|
||||
std::map<MVT, SDNode*, MVT::compareRawBits> ExtendedValueTypeNodes;
|
||||
StringMap<SDNode*> ExternalSymbols;
|
||||
StringMap<SDNode*> TargetExternalSymbols;
|
||||
|
||||
std::map<std::pair<std::string, unsigned char>,SDNode*> TargetExternalSymbols;
|
||||
};
|
||||
|
||||
template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
|
||||
|
@ -2101,15 +2101,18 @@ public:
|
||||
|
||||
class ExternalSymbolSDNode : public SDNode {
|
||||
const char *Symbol;
|
||||
unsigned char TargetFlags;
|
||||
|
||||
friend class SelectionDAG;
|
||||
ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT VT)
|
||||
ExternalSymbolSDNode(bool isTarget, const char *Sym, unsigned char TF, MVT VT)
|
||||
: SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
|
||||
DebugLoc::getUnknownLoc(),
|
||||
getSDVTList(VT)), Symbol(Sym) {
|
||||
getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) {
|
||||
}
|
||||
public:
|
||||
|
||||
const char *getSymbol() const { return Symbol; }
|
||||
unsigned char getTargetFlags() const { return TargetFlags; }
|
||||
|
||||
static bool classof(const ExternalSymbolSDNode *) { return true; }
|
||||
static bool classof(const SDNode *N) {
|
||||
|
@ -632,10 +632,13 @@ bool SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
|
||||
case ISD::ExternalSymbol:
|
||||
Erased = ExternalSymbols.erase(cast<ExternalSymbolSDNode>(N)->getSymbol());
|
||||
break;
|
||||
case ISD::TargetExternalSymbol:
|
||||
Erased =
|
||||
TargetExternalSymbols.erase(cast<ExternalSymbolSDNode>(N)->getSymbol());
|
||||
case ISD::TargetExternalSymbol: {
|
||||
ExternalSymbolSDNode *ESN = cast<ExternalSymbolSDNode>(N);
|
||||
Erased = TargetExternalSymbols.erase(
|
||||
std::pair<std::string,unsigned char>(ESN->getSymbol(),
|
||||
ESN->getTargetFlags()));
|
||||
break;
|
||||
}
|
||||
case ISD::VALUETYPE: {
|
||||
MVT VT = cast<VTSDNode>(N)->getVT();
|
||||
if (VT.isExtended()) {
|
||||
@ -1108,16 +1111,19 @@ SDValue SelectionDAG::getExternalSymbol(const char *Sym, MVT VT) {
|
||||
SDNode *&N = ExternalSymbols[Sym];
|
||||
if (N) return SDValue(N, 0);
|
||||
N = NodeAllocator.Allocate<ExternalSymbolSDNode>();
|
||||
new (N) ExternalSymbolSDNode(false, Sym, VT);
|
||||
new (N) ExternalSymbolSDNode(false, Sym, 0, VT);
|
||||
AllNodes.push_back(N);
|
||||
return SDValue(N, 0);
|
||||
}
|
||||
|
||||
SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, MVT VT) {
|
||||
SDNode *&N = TargetExternalSymbols[Sym];
|
||||
SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, MVT VT,
|
||||
unsigned char TargetFlags) {
|
||||
SDNode *&N =
|
||||
TargetExternalSymbols[std::pair<std::string,unsigned char>(Sym,
|
||||
TargetFlags)];
|
||||
if (N) return SDValue(N, 0);
|
||||
N = NodeAllocator.Allocate<ExternalSymbolSDNode>();
|
||||
new (N) ExternalSymbolSDNode(true, Sym, VT);
|
||||
new (N) ExternalSymbolSDNode(true, Sym, TargetFlags, VT);
|
||||
AllNodes.push_back(N);
|
||||
return SDValue(N, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user