diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-02-28 21:53:42 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-02-28 21:53:42 +0000 |
| commit | ff7fb60f2a7e2f3efd54df6480aadcb4adf5cab7 (patch) | |
| tree | 7204ffaf2b65ea7b49772943f5c8386a15a718a1 /include | |
| parent | 21221e357c6aa9ade3966ee86dab7d44c25220d0 (diff) | |
| download | external_llvm-ff7fb60f2a7e2f3efd54df6480aadcb4adf5cab7.zip external_llvm-ff7fb60f2a7e2f3efd54df6480aadcb4adf5cab7.tar.gz external_llvm-ff7fb60f2a7e2f3efd54df6480aadcb4adf5cab7.tar.bz2 | |
enhance the EmitNode/MorphNodeTo operands to take a bit that
specifies whether there is an output flag or not. Use this
instead of redundantly encoding the chain/flag results in the
output vtlist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/CodeGen/DAGISelHeader.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h index 3ffc6e9..9aec982 100644 --- a/include/llvm/CodeGen/DAGISelHeader.h +++ b/include/llvm/CodeGen/DAGISelHeader.h @@ -303,17 +303,18 @@ enum BuiltinOpcodes { }; enum { - OPFL_None = 0, // Node has no chain or flag input and isn't variadic. - OPFL_Chain = 1, // Node has a chain input. - OPFL_Flag = 2, // Node has a flag input. - OPFL_MemRefs = 4, // Node gets accumulated MemRefs. - OPFL_Variadic0 = 1<<3, // Node is variadic, root has 0 fixed inputs. - OPFL_Variadic1 = 2<<3, // Node is variadic, root has 1 fixed inputs. - OPFL_Variadic2 = 3<<3, // Node is variadic, root has 2 fixed inputs. - OPFL_Variadic3 = 4<<3, // Node is variadic, root has 3 fixed inputs. - OPFL_Variadic4 = 5<<3, // Node is variadic, root has 4 fixed inputs. - OPFL_Variadic5 = 6<<3, // Node is variadic, root has 5 fixed inputs. - OPFL_Variadic6 = 7<<3, // Node is variadic, root has 6 fixed inputs. + OPFL_None = 0, // Node has no chain or flag input and isn't variadic. + OPFL_Chain = 1, // Node has a chain input. + OPFL_FlagInput = 2, // Node has a flag input. + OPFL_FlagOutput = 4, // Node has a flag output. + OPFL_MemRefs = 8, // Node gets accumulated MemRefs. + OPFL_Variadic0 = 1<<4, // Node is variadic, root has 0 fixed inputs. + OPFL_Variadic1 = 2<<4, // Node is variadic, root has 1 fixed inputs. + OPFL_Variadic2 = 3<<4, // Node is variadic, root has 2 fixed inputs. + OPFL_Variadic3 = 4<<4, // Node is variadic, root has 3 fixed inputs. + OPFL_Variadic4 = 5<<4, // Node is variadic, root has 4 fixed inputs. + OPFL_Variadic5 = 6<<4, // Node is variadic, root has 5 fixed inputs. + OPFL_Variadic6 = 7<<4, // Node is variadic, root has 6 fixed inputs. OPFL_VariadicInfo = OPFL_Variadic6 }; @@ -322,7 +323,7 @@ enum { /// number of fixed arity values that should be skipped when copying from the /// root. static inline int getNumFixedFromVariadicInfo(unsigned Flags) { - return ((Flags&OPFL_VariadicInfo) >> 3)-1; + return ((Flags&OPFL_VariadicInfo) >> 4)-1; } struct MatchScope { @@ -793,7 +794,6 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, unsigned EmitNodeInfo = MatcherTable[MatcherIndex++]; // Get the result VT list. unsigned NumVTs = MatcherTable[MatcherIndex++]; - assert(NumVTs != 0 && "Invalid node result"); SmallVector<EVT, 4> VTs; for (unsigned i = 0; i != NumVTs; ++i) { MVT::SimpleValueType VT = @@ -802,6 +802,11 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, VTs.push_back(VT); } + if (EmitNodeInfo & OPFL_Chain) + VTs.push_back(MVT::Other); + if (EmitNodeInfo & OPFL_FlagOutput) + VTs.push_back(MVT::Flag); + // FIXME: Use faster version for the common 'one VT' case? SDVTList VTList = CurDAG->getVTList(VTs.data(), VTs.size()); @@ -837,7 +842,7 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, // If this has chain/flag inputs, add them. if (EmitNodeInfo & OPFL_Chain) Ops.push_back(InputChain); - if ((EmitNodeInfo & OPFL_Flag) && InputFlag.getNode() != 0) + if ((EmitNodeInfo & OPFL_FlagInput) && InputFlag.getNode() != 0) Ops.push_back(InputFlag); // Create the node. |
