[llvm] [SelectionDAG] Add space-optimized forms of OPC_EmitNode/OPC_MorphNodeTo (PR #73502)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 16:55:58 PST 2023
================
@@ -799,19 +799,49 @@ EmitMatcher(const Matcher *N, const unsigned Indent, unsigned CurrentIdx,
const EmitNodeMatcherCommon *EN = cast<EmitNodeMatcherCommon>(N);
OS << (isa<EmitNodeMatcher>(EN) ? "OPC_EmitNode" : "OPC_MorphNodeTo");
bool CompressVTs = EN->getNumVTs() < 3;
- if (CompressVTs)
+ bool CompressNodeInfo = false;
+ if (CompressVTs) {
OS << EN->getNumVTs();
+ if (!EN->hasChain() && !EN->hasInGlue() && !EN->hasOutGlue() &&
+ !EN->hasMemRefs() && EN->getNumFixedArityOperands() == -1) {
+ CompressNodeInfo = true;
+ OS << "None";
+ } else if (EN->hasChain() && !EN->hasInGlue() && !EN->hasOutGlue() &&
+ !EN->hasMemRefs() && EN->getNumFixedArityOperands() == -1) {
+ CompressNodeInfo = true;
+ OS << "Chain";
+ } else if (!EN->hasChain() && EN->hasInGlue() && !EN->hasOutGlue() &&
+ !EN->hasMemRefs() && EN->getNumFixedArityOperands() == -1) {
+ CompressNodeInfo = true;
+ OS << "GlueInput";
+ } else if (!EN->hasChain() && !EN->hasInGlue() && EN->hasOutGlue() &&
+ !EN->hasMemRefs() && EN->getNumFixedArityOperands() == -1) {
+ CompressNodeInfo = true;
+ OS << "GlueOutput";
+ } else if (!EN->hasChain() && !EN->hasInGlue() && !EN->hasOutGlue() &&
+ EN->hasMemRefs() && EN->getNumFixedArityOperands() == -1) {
+ CompressNodeInfo = true;
+ OS << "MemRefs";
----------------
topperc wrote:
> Does MemRefs ever appear by itself? Shouldn't it always be with Chain?
Ok I guess it appears 62 times without Chain with all of the default targets. That might not be worth optimizing for?
https://github.com/llvm/llvm-project/pull/73502
More information about the llvm-commits
mailing list