mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
[inline asm] Get the mayLoad/mayStore directly from the MIOp_ExtraInfo operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a9779bfbc9
commit
daeec8fad3
@ -58,10 +58,8 @@ public:
|
|||||||
NoFlags = 0,
|
NoFlags = 0,
|
||||||
FrameSetup = 1 << 0, // Instruction is used as a part of
|
FrameSetup = 1 << 0, // Instruction is used as a part of
|
||||||
// function frame setup code.
|
// function frame setup code.
|
||||||
InsideBundle = 1 << 1, // Instruction is inside a bundle (not
|
InsideBundle = 1 << 1 // Instruction is inside a bundle (not
|
||||||
// the first MI in a bundle)
|
// the first MI in a bundle)
|
||||||
MayLoad = 1 << 2, // Instruction could possibly read memory.
|
|
||||||
MayStore = 1 << 3 // Instruction could possibly modify memory.
|
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
const MCInstrDesc *MCID; // Instruction descriptor.
|
const MCInstrDesc *MCID; // Instruction descriptor.
|
||||||
@ -447,7 +445,12 @@ public:
|
|||||||
/// Instructions with this flag set are not necessarily simple load
|
/// Instructions with this flag set are not necessarily simple load
|
||||||
/// instructions, they may load a value and modify it, for example.
|
/// instructions, they may load a value and modify it, for example.
|
||||||
bool mayLoad(QueryType Type = AnyInBundle) const {
|
bool mayLoad(QueryType Type = AnyInBundle) const {
|
||||||
return hasProperty(MCID::MayLoad, Type) || (Flags & MayLoad);
|
if (isInlineAsm()) {
|
||||||
|
unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
|
||||||
|
if (ExtraInfo & InlineAsm::Extra_MayLoad)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return hasProperty(MCID::MayLoad, Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -456,7 +459,12 @@ public:
|
|||||||
/// instructions, they may store a modified value based on their operands, or
|
/// instructions, they may store a modified value based on their operands, or
|
||||||
/// may not actually modify anything, for example.
|
/// may not actually modify anything, for example.
|
||||||
bool mayStore(QueryType Type = AnyInBundle) const {
|
bool mayStore(QueryType Type = AnyInBundle) const {
|
||||||
return hasProperty(MCID::MayStore, Type) || (Flags & MayStore);
|
if (isInlineAsm()) {
|
||||||
|
unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
|
||||||
|
if (ExtraInfo & InlineAsm::Extra_MayStore)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return hasProperty(MCID::MayStore, Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
@ -897,19 +897,13 @@ EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned,
|
|||||||
const char *AsmStr = cast<ExternalSymbolSDNode>(AsmStrV)->getSymbol();
|
const char *AsmStr = cast<ExternalSymbolSDNode>(AsmStrV)->getSymbol();
|
||||||
MI->addOperand(MachineOperand::CreateES(AsmStr));
|
MI->addOperand(MachineOperand::CreateES(AsmStr));
|
||||||
|
|
||||||
// Add the HasSideEffect and isAlignStack bits.
|
// Add the HasSideEffect, isAlignStack, AsmDialect, MayLoad and MayStore
|
||||||
|
// bits.
|
||||||
int64_t ExtraInfo =
|
int64_t ExtraInfo =
|
||||||
cast<ConstantSDNode>(Node->getOperand(InlineAsm::Op_ExtraInfo))->
|
cast<ConstantSDNode>(Node->getOperand(InlineAsm::Op_ExtraInfo))->
|
||||||
getZExtValue();
|
getZExtValue();
|
||||||
MI->addOperand(MachineOperand::CreateImm(ExtraInfo));
|
MI->addOperand(MachineOperand::CreateImm(ExtraInfo));
|
||||||
|
|
||||||
// Set the MayLoad and MayStore flags.
|
|
||||||
if (ExtraInfo & InlineAsm::Extra_MayLoad)
|
|
||||||
MI->setFlag(MachineInstr::MayLoad);
|
|
||||||
|
|
||||||
if (ExtraInfo & InlineAsm::Extra_MayStore)
|
|
||||||
MI->setFlag(MachineInstr::MayStore);
|
|
||||||
|
|
||||||
// Remember to operand index of the group flags.
|
// Remember to operand index of the group flags.
|
||||||
SmallVector<unsigned, 8> GroupIdx;
|
SmallVector<unsigned, 8> GroupIdx;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user