From: Krzysztof Parzyszek Date: Wed, 18 Mar 2015 17:20:51 +0000 (+0000) Subject: [Hexagon] Use pseudo-instructions for true/false predicate values X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0c2e71367e66729574b87ea30114ba9690658e08;p=oota-llvm.git [Hexagon] Use pseudo-instructions for true/false predicate values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232650 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp index 6e8d431ee10..22a7b27c12c 100644 --- a/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp +++ b/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp @@ -997,30 +997,13 @@ SDNode *HexagonDAGToDAGISel::SelectConstantFP(SDNode *N) { SDNode *HexagonDAGToDAGISel::SelectConstant(SDNode *N) { SDLoc dl(N); if (N->getValueType(0) == MVT::i1) { - SDNode* Result; + SDNode* Result = 0; int32_t Val = cast(N)->getSExtValue(); - if (Val == -1) { - // Create the IntReg = 1 node. - SDNode* IntRegTFR = - CurDAG->getMachineNode(Hexagon::A2_tfrsi, dl, MVT::i32, - CurDAG->getTargetConstant(0, MVT::i32)); - - // Pd = IntReg - SDNode* Pd = CurDAG->getMachineNode(Hexagon::C2_tfrrp, dl, MVT::i1, - SDValue(IntRegTFR, 0)); - - // not(Pd) - SDNode* NotPd = CurDAG->getMachineNode(Hexagon::C2_not, dl, MVT::i1, - SDValue(Pd, 0)); - - // xor(not(Pd)) - Result = CurDAG->getMachineNode(Hexagon::C2_xor, dl, MVT::i1, - SDValue(Pd, 0), SDValue(NotPd, 0)); - - // We have just built: - // Rs = Pd - // Pd = xor(not(Pd), Pd) - + if (Val == -1) + Result = CurDAG->getMachineNode(Hexagon::TFR_PdTrue, dl, MVT::i1); + else if (Val == 0) + Result = CurDAG->getMachineNode(Hexagon::TFR_PdFalse, dl, MVT::i1); + if (Result) { ReplaceUses(N, Result); return Result; }