Displaying 2 results from an estimated 2 matches for "constnod".
Did you mean:
constnode
2017 Dec 24
4
Canonical way to handle zero registers?
Thanks, that sounds like it would work. Was this based on what any other
target did? Or do any other targets take this approach?
I just want to make sure that we don't already have a hook suitable for
this. Overriding runOnFunction to run what could be described as just a
"late SelectionDAG pass" sounds pretty intrusive. Do you remember other
approaches that didn't work?
--
2017 Dec 26
2
Canonical way to handle zero registers?
...le the zero register in
TgtDAGToDAGISel::Select. Lanai also has a "-1" register and handles
that case in the same place.
Copying from LanaiDAGToDAGISel::Select:
EVT VT = Node->getValueType(0);
switch (Opcode) {
case ISD::Constant:
if (VT == MVT::i32) {
ConstantSDNode *ConstNode = cast<ConstantSDNode>(Node);
// Materialize zero constants as copies from R0. This allows the
coalescer
// to propagate these into other instructions.
if (ConstNode->isNullValue()) {
SDValue New = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),...