summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSjoerd Meijer <sjoerd.meijer@arm.com>2017-10-16 14:07:30 +0000
committerSjoerd Meijer <sjoerd.meijer@arm.com>2017-10-16 14:07:30 +0000
commit7508fbd581fb0769ef7998dab5de42d7cf4373f0 (patch)
tree45e4a0f789b8e8a12f16c5d0aaea7946eebdb17e /llvm/lib
parent73bd5aa04952ccbb421de880253f56af43adaac9 (diff)
downloadbcm5719-llvm-7508fbd581fb0769ef7998dab5de42d7cf4373f0.tar.gz
bcm5719-llvm-7508fbd581fb0769ef7998dab5de42d7cf4373f0.zip
ISel type legalizer: debug messages. NFC.
Minor addition and follow up of r314773 and r311533: this adds more debug messages to the type legalizer. For each node, it dumps legalization info for results and operands nodes, rather than just the final legalized node. Differential Revision: https://reviews.llvm.org/D38726 llvm-svn: 315904
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp8
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp13
2 files changed, 17 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 75fec7bd1d4..68cac22a99e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -40,8 +40,10 @@ void DAGTypeLegalizer::PromoteIntegerResult(SDNode *N, unsigned ResNo) {
SDValue Res = SDValue();
// See if the target wants to custom expand this node.
- if (CustomLowerNode(N, N->getValueType(ResNo), true))
+ if (CustomLowerNode(N, N->getValueType(ResNo), true)) {
+ DEBUG(dbgs() << "Node has been custom expanded, done\n");
return;
+ }
switch (N->getOpcode()) {
default:
@@ -885,8 +887,10 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) {
DEBUG(dbgs() << "Promote integer operand: "; N->dump(&DAG); dbgs() << "\n");
SDValue Res = SDValue();
- if (CustomLowerNode(N, N->getOperand(OpNo).getValueType(), false))
+ if (CustomLowerNode(N, N->getOperand(OpNo).getValueType(), false)) {
+ DEBUG(dbgs() << "Node has been custom lowered, done\n");
return false;
+ }
switch (N->getOpcode()) {
default:
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index f331fc7c250..b42edf8e751 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -226,15 +226,21 @@ bool DAGTypeLegalizer::run() {
assert(N->getNodeId() == ReadyToProcess &&
"Node should be ready if on worklist!");
- if (IgnoreNodeResults(N))
+ DEBUG(dbgs() << "Legalizing node: "; N->dump());
+ if (IgnoreNodeResults(N)) {
+ DEBUG(dbgs() << "Ignoring node results\n");
goto ScanOperands;
+ }
// Scan the values produced by the node, checking to see if any result
// types are illegal.
for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i) {
EVT ResultVT = N->getValueType(i);
+ DEBUG(dbgs() << "Analyzing result type: " <<
+ ResultVT.getEVTString() << "\n");
switch (getTypeAction(ResultVT)) {
case TargetLowering::TypeLegal:
+ DEBUG(dbgs() << "Legal result type\n");
break;
// The following calls must take care of *all* of the node's results,
// not just the illegal result they were passed (this includes results
@@ -291,9 +297,12 @@ ScanOperands:
if (IgnoreNodeResults(N->getOperand(i).getNode()))
continue;
- EVT OpVT = N->getOperand(i).getValueType();
+ const auto Op = N->getOperand(i);
+ DEBUG(dbgs() << "Analyzing operand: "; Op.dump());
+ EVT OpVT = Op.getValueType();
switch (getTypeAction(OpVT)) {
case TargetLowering::TypeLegal:
+ DEBUG(dbgs() << "Legal operand\n");
continue;
// The following calls must either replace all of the node's results
// using ReplaceValueWith, and return "false"; or update the node's
OpenPOWER on IntegriCloud