diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 71 |
1 files changed, 45 insertions, 26 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index d867f3e09e9c..40083c614a6c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -145,7 +145,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { unsigned OpNo = getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 0 : 1; unsigned IID = cast<ConstantSDNode>(getOperand(OpNo))->getZExtValue(); if (IID < Intrinsic::num_intrinsics) - return Intrinsic::getName((Intrinsic::ID)IID, None); + return Intrinsic::getBaseName((Intrinsic::ID)IID).str(); else if (!G) return "Unknown intrinsic"; else if (const TargetIntrinsicInfo *TII = G->getTarget().getIntrinsicInfo()) @@ -231,6 +231,8 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::MUL: return "mul"; case ISD::MULHU: return "mulhu"; case ISD::MULHS: return "mulhs"; + case ISD::ABDS: return "abds"; + case ISD::ABDU: return "abdu"; case ISD::SDIV: return "sdiv"; case ISD::UDIV: return "udiv"; case ISD::SREM: return "srem"; @@ -288,7 +290,11 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::EXTRACT_SUBVECTOR: return "extract_subvector"; case ISD::SCALAR_TO_VECTOR: return "scalar_to_vector"; case ISD::VECTOR_SHUFFLE: return "vector_shuffle"; + case ISD::VECTOR_SPLICE: return "vector_splice"; case ISD::SPLAT_VECTOR: return "splat_vector"; + case ISD::SPLAT_VECTOR_PARTS: return "splat_vector_parts"; + case ISD::VECTOR_REVERSE: return "vector_reverse"; + case ISD::STEP_VECTOR: return "step_vector"; case ISD::CARRY_FALSE: return "carry_false"; case ISD::ADDC: return "addc"; case ISD::ADDE: return "adde"; @@ -336,7 +342,6 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::TRUNCATE: return "truncate"; case ISD::FP_ROUND: return "fp_round"; case ISD::STRICT_FP_ROUND: return "strict_fp_round"; - case ISD::FLT_ROUNDS_: return "flt_rounds"; case ISD::FP_EXTEND: return "fp_extend"; case ISD::STRICT_FP_EXTEND: return "strict_fp_extend"; @@ -410,6 +415,10 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const { case ISD::PREALLOCATED_ARG: return "call_alloc"; + // Floating point environment manipulation + case ISD::FLT_ROUNDS_: return "flt_rounds"; + case ISD::SET_ROUNDING: return "set_rounding"; + // Bit manipulation case ISD::ABS: return "abs"; case ISD::BITREVERSE: return "bitreverse"; @@ -828,26 +837,38 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { LLVM_DUMP_METHOD void SDDbgValue::print(raw_ostream &OS) const { OS << " DbgVal(Order=" << getOrder() << ')'; - if (isInvalidated()) OS << "(Invalidated)"; - if (isEmitted()) OS << "(Emitted)"; - switch (getKind()) { - case SDNODE: - if (getSDNode()) - OS << "(SDNODE=" << PrintNodeId(*getSDNode()) << ':' << getResNo() << ')'; - else - OS << "(SDNODE)"; - break; - case CONST: - OS << "(CONST)"; - break; - case FRAMEIX: - OS << "(FRAMEIX=" << getFrameIx() << ')'; - break; - case VREG: - OS << "(VREG=" << getVReg() << ')'; - break; + if (isInvalidated()) + OS << "(Invalidated)"; + if (isEmitted()) + OS << "(Emitted)"; + OS << "("; + bool Comma = false; + for (const SDDbgOperand &Op : getLocationOps()) { + if (Comma) + OS << ", "; + switch (Op.getKind()) { + case SDDbgOperand::SDNODE: + if (Op.getSDNode()) + OS << "SDNODE=" << PrintNodeId(*Op.getSDNode()) << ':' << Op.getResNo(); + else + OS << "SDNODE"; + break; + case SDDbgOperand::CONST: + OS << "CONST"; + break; + case SDDbgOperand::FRAMEIX: + OS << "FRAMEIX=" << Op.getFrameIx(); + break; + case SDDbgOperand::VREG: + OS << "VREG=" << Op.getVReg(); + break; + } + Comma = true; } + OS << ")"; if (isIndirect()) OS << "(Indirect)"; + if (isVariadic()) + OS << "(Variadic)"; OS << ":\"" << Var->getName() << '"'; #ifndef NDEBUG if (Expr->getNumElements()) @@ -892,12 +913,10 @@ static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) { LLVM_DUMP_METHOD void SelectionDAG::dump() const { dbgs() << "SelectionDAG has " << AllNodes.size() << " nodes:\n"; - for (allnodes_const_iterator I = allnodes_begin(), E = allnodes_end(); - I != E; ++I) { - const SDNode *N = &*I; - if (!N->hasOneUse() && N != getRoot().getNode() && - (!shouldPrintInline(*N, this) || N->use_empty())) - DumpNodes(N, 2, this); + for (const SDNode &N : allnodes()) { + if (!N.hasOneUse() && &N != getRoot().getNode() && + (!shouldPrintInline(N, this) || N.use_empty())) + DumpNodes(&N, 2, this); } if (getRoot().getNode()) DumpNodes(getRoot().getNode(), 2, this); |
