mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add flags to indicate that there are "never" side effects or that there "may be"
side effects for machine instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -104,6 +104,8 @@ namespace llvm {
|
||||
bool hasCtrlDep;
|
||||
bool isNotDuplicable;
|
||||
bool hasOptionalDef;
|
||||
bool mayHaveSideEffects;
|
||||
bool neverHasSideEffects;
|
||||
|
||||
/// ParseOperandName - Parse an operand name like "$foo" or "$foo.bar",
|
||||
/// where $foo is a whole operand and $foo.bar refers to a suboperand.
|
||||
|
@@ -395,9 +395,15 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
||||
usesCustomDAGSchedInserter = R->getValueAsBit("usesCustomDAGSchedInserter");
|
||||
hasCtrlDep = R->getValueAsBit("hasCtrlDep");
|
||||
isNotDuplicable = R->getValueAsBit("isNotDuplicable");
|
||||
mayHaveSideEffects = R->getValueAsBit("mayHaveSideEffects");
|
||||
neverHasSideEffects = R->getValueAsBit("neverHasSideEffects");
|
||||
hasOptionalDef = false;
|
||||
hasVariableNumberOfOperands = false;
|
||||
|
||||
|
||||
if (mayHaveSideEffects && neverHasSideEffects)
|
||||
throw R->getName() +
|
||||
": cannot have both 'mayHaveSideEffects' and 'neverHasSideEffects' set!";
|
||||
|
||||
DagInit *DI;
|
||||
try {
|
||||
DI = R->getValueAsDag("OutOperandList");
|
||||
|
@@ -253,8 +253,9 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
|
||||
if (Inst.hasOptionalDef) OS << "|M_HAS_OPTIONAL_DEF";
|
||||
if (Inst.usesCustomDAGSchedInserter)
|
||||
OS << "|M_USES_CUSTOM_DAG_SCHED_INSERTION";
|
||||
if (Inst.hasVariableNumberOfOperands)
|
||||
OS << "|M_VARIABLE_OPS";
|
||||
if (Inst.hasVariableNumberOfOperands) OS << "|M_VARIABLE_OPS";
|
||||
if (Inst.mayHaveSideEffects) OS << "|M_MAY_HAVE_SIDE_EFFECTS";
|
||||
if (Inst.neverHasSideEffects) OS << "|M_NEVER_HAS_SIDE_EFFECTS";
|
||||
OS << ", 0";
|
||||
|
||||
// Emit all of the target-specific flags...
|
||||
|
Reference in New Issue
Block a user