diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-03-04 00:21:16 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-03-04 00:21:16 +0000 |
| commit | 878b3e46fb3944f337cf069e5bfcd91b4dbab92b (patch) | |
| tree | e386ce727482da6f3812ff81bc1f9016b4000bd5 | |
| parent | 2922641a7e014019c4041d9e099a76a1827633a0 (diff) | |
| download | bcm5719-llvm-878b3e46fb3944f337cf069e5bfcd91b4dbab92b.tar.gz bcm5719-llvm-878b3e46fb3944f337cf069e5bfcd91b4dbab92b.zip | |
inline CannotYetSelectIntrinsic into CannotYetSelect and simplify.
llvm-svn: 97690
| -rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAGISel.h | 1 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 35 |
2 files changed, 16 insertions, 20 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h index 23ff001b8d4..d9c1374a01d 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h @@ -276,7 +276,6 @@ private: SDNode *Select_UNDEF(SDNode *N); SDNode *Select_EH_LABEL(SDNode *N); void CannotYetSelect(SDNode *N); - void CannotYetSelectIntrinsic(SDNode *N); private: void DoInstructionSelection(); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 2e2020d6183..c1d159af63a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2711,29 +2711,26 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, void SelectionDAGISel::CannotYetSelect(SDNode *N) { - if (N->getOpcode() == ISD::INTRINSIC_W_CHAIN || - N->getOpcode() == ISD::INTRINSIC_WO_CHAIN || - N->getOpcode() == ISD::INTRINSIC_VOID) - return CannotYetSelectIntrinsic(N); - std::string msg; raw_string_ostream Msg(msg); Msg << "Cannot yet select: "; - N->printrFull(Msg, CurDAG); + + if (N->getOpcode() != ISD::INTRINSIC_W_CHAIN && + N->getOpcode() != ISD::INTRINSIC_WO_CHAIN && + N->getOpcode() != ISD::INTRINSIC_VOID) { + N->printrFull(Msg, CurDAG); + } else { + bool HasInputChain = N->getOperand(0).getValueType() == MVT::Other; + unsigned iid = + cast<ConstantSDNode>(N->getOperand(HasInputChain))->getZExtValue(); + if (iid < Intrinsic::num_intrinsics) + Msg << "intrinsic %" << Intrinsic::getName((Intrinsic::ID)iid); + else if (const TargetIntrinsicInfo *TII = TM.getIntrinsicInfo()) + Msg << "target intrinsic %" << TII->getName(iid); + else + Msg << "unknown intrinsic #" << iid; + } llvm_report_error(Msg.str()); } -void SelectionDAGISel::CannotYetSelectIntrinsic(SDNode *N) { - dbgs() << "Cannot yet select: "; - unsigned iid = - cast<ConstantSDNode>(N->getOperand(N->getOperand(0).getValueType() == - MVT::Other))->getZExtValue(); - if (iid < Intrinsic::num_intrinsics) - llvm_report_error("Cannot yet select: intrinsic %" + - Intrinsic::getName((Intrinsic::ID)iid)); - else if (const TargetIntrinsicInfo *tii = TM.getIntrinsicInfo()) - llvm_report_error(Twine("Cannot yet select: target intrinsic %") + - tii->getName(iid)); -} - char SelectionDAGISel::ID = 0; |

