From 01e2e6a19f8d419ae6edbf12c613fdc70e5fb56a Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 22 Jan 2019 22:33:55 +0000 Subject: [PATCH] [LegalizeTypes] Add debug prints to the top of PromoteFloatOperand and PromoteFloatResult. Also add debug prints in the default case of the switches in these routines. Most if not all of the type legalization handlers already do this so this makes promoting floats consistent git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351890 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp index e5842d3faf0..17dee8d3ed4 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -1748,6 +1748,8 @@ static ISD::NodeType GetPromotionOpcode(EVT OpVT, EVT RetVT) { } bool DAGTypeLegalizer::PromoteFloatOperand(SDNode *N, unsigned OpNo) { + LLVM_DEBUG(dbgs() << "Promote float operand " << OpNo << ": "; N->dump(&DAG); + dbgs() << "\n"); SDValue R = SDValue(); if (CustomLowerNode(N, N->getOperand(OpNo).getValueType(), false)) { @@ -1762,6 +1764,10 @@ bool DAGTypeLegalizer::PromoteFloatOperand(SDNode *N, unsigned OpNo) { // a part of PromoteFloatResult. switch (N->getOpcode()) { default: + #ifndef NDEBUG + dbgs() << "PromoteFloatOperand Op #" << OpNo << ": "; + N->dump(&DAG); dbgs() << "\n"; + #endif llvm_unreachable("Do not know how to promote this operator's operand!"); case ISD::BITCAST: R = PromoteFloatOp_BITCAST(N, OpNo); break; @@ -1872,6 +1878,8 @@ SDValue DAGTypeLegalizer::PromoteFloatOp_STORE(SDNode *N, unsigned OpNo) { //===----------------------------------------------------------------------===// void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, unsigned ResNo) { + LLVM_DEBUG(dbgs() << "Promote float result " << ResNo << ": "; N->dump(&DAG); + dbgs() << "\n"); SDValue R = SDValue(); switch (N->getOpcode()) { @@ -1880,6 +1888,10 @@ void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, unsigned ResNo) { case ISD::FP16_TO_FP: case ISD::FP_TO_FP16: default: +#ifndef NDEBUG + dbgs() << "PromoteFloatResult #" << ResNo << ": "; + N->dump(&DAG); dbgs() << "\n"; +#endif llvm_unreachable("Do not know how to promote this operator's result!"); case ISD::BITCAST: R = PromoteFloatRes_BITCAST(N); break; -- 2.50.1