TableGen: Allow setting SDNodeProperties on intrinsics
Allows preserving MachineMemOperands on intrinsics
through selection. For reasons I don't understand, this
is a static property of the pattern and the selector
deliberately goes out of its way to drop if not present.
Intrinsics already inherit from SDPatternOperator allowing
them to be used directly in instruction patterns. SDPatternOperator
has a list of SDNodeProperty, but you currently can't set them on
the intrinsic. Without SDNPMemOperand, when the node is selected
any memory operands are always dropped. Allowing setting this
on the intrinsics avoids needing to introduce another equivalent
target node just to have SDNPMemOperand set.
llvm-svn: 321212
diff --git a/llvm/utils/TableGen/CodeGenTarget.h b/llvm/utils/TableGen/CodeGenTarget.h
index 89aa81b..7280d70 100644
--- a/llvm/utils/TableGen/CodeGenTarget.h
+++ b/llvm/utils/TableGen/CodeGenTarget.h
@@ -21,6 +21,7 @@
#include "CodeGenInstruction.h"
#include "CodeGenRegisters.h"
#include "InfoByHwMode.h"
+#include "SDNodeProperties.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Record.h"
#include <algorithm>
@@ -31,25 +32,6 @@
class CodeGenSchedModels;
class CodeGenTarget;
-// SelectionDAG node properties.
-// SDNPMemOperand: indicates that a node touches memory and therefore must
-// have an associated memory operand that describes the access.
-enum SDNP {
- SDNPCommutative,
- SDNPAssociative,
- SDNPHasChain,
- SDNPOutGlue,
- SDNPInGlue,
- SDNPOptInGlue,
- SDNPMayLoad,
- SDNPMayStore,
- SDNPSideEffect,
- SDNPMemOperand,
- SDNPVariadic,
- SDNPWantRoot,
- SDNPWantParent
-};
-
/// getValueType - Return the MVT::SimpleValueType that the specified TableGen
/// record corresponds to.
MVT::SimpleValueType getValueType(Record *Rec);