summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-05-13 22:44:57 +0000
committerJustin Bogner <mail@justinbogner.com>2016-05-13 22:44:57 +0000
commitc6afd4bb3606f5545f979c203e2fbff1eb6c0ad5 (patch)
tree0aaf49fdb41f0ed14b0b3dd5b750d9456b382d87 /llvm/lib/Target/WebAssembly
parent9b34e8a77027a1a09ef5d53ed93a09f6a7ec3169 (diff)
downloadbcm5719-llvm-c6afd4bb3606f5545f979c203e2fbff1eb6c0ad5.tar.gz
bcm5719-llvm-c6afd4bb3606f5545f979c203e2fbff1eb6c0ad5.zip
SDAG: Implement Select instead of SelectImpl in WebAssemblyDAGToDAGISel
This backend doesn't do anything custom here yet, so we just modernize the boilerplate. Part of llvm.org/pr26808. llvm-svn: 269506
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
index 235f149d8ca..88c38b3602b 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
@@ -54,7 +54,7 @@ public:
return SelectionDAGISel::runOnMachineFunction(MF);
}
- SDNode *SelectImpl(SDNode *Node) override;
+ void Select(SDNode *Node) override;
bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
std::vector<SDValue> &OutOps) override;
@@ -67,7 +67,7 @@ private:
};
} // end anonymous namespace
-SDNode *WebAssemblyDAGToDAGISel::SelectImpl(SDNode *Node) {
+void WebAssemblyDAGToDAGISel::Select(SDNode *Node) {
// Dump information about the Node being selected.
DEBUG(errs() << "Selecting: ");
DEBUG(Node->dump(CurDAG));
@@ -77,11 +77,10 @@ SDNode *WebAssemblyDAGToDAGISel::SelectImpl(SDNode *Node) {
if (Node->isMachineOpcode()) {
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
Node->setNodeId(-1);
- return nullptr;
+ return;
}
// Few custom selection stuff.
- SDNode *ResNode = nullptr;
EVT VT = Node->getValueType(0);
switch (Node->getOpcode()) {
@@ -92,16 +91,7 @@ SDNode *WebAssemblyDAGToDAGISel::SelectImpl(SDNode *Node) {
}
// Select the default instruction.
- ResNode = SelectCode(Node);
-
- DEBUG(errs() << "=> ");
- if (ResNode == nullptr || ResNode == Node)
- DEBUG(Node->dump(CurDAG));
- else
- DEBUG(ResNode->dump(CurDAG));
- DEBUG(errs() << "\n");
-
- return ResNode;
+ SelectCode(Node);
}
bool WebAssemblyDAGToDAGISel::SelectInlineAsmMemoryOperand(
OpenPOWER on IntegriCloud