Index: llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.h =================================================================== --- llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.h +++ llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.h @@ -58,7 +58,6 @@ bool tryIntrinsicNoChain(SDNode *N); bool tryIntrinsicChain(SDNode *N); void SelectTexSurfHandle(SDNode *N); - void SelectMatchAll(SDNode *N); bool tryLoad(SDNode *N); bool tryLoadVector(SDNode *N); bool tryLDGLDU(SDNode *N); Index: llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp =================================================================== --- llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp +++ llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp @@ -811,10 +811,6 @@ switch (IID) { default: return false; - case Intrinsic::nvvm_match_all_sync_i32p: - case Intrinsic::nvvm_match_all_sync_i64p: - SelectMatchAll(N); - return true; case Intrinsic::nvvm_ldg_global_f: case Intrinsic::nvvm_ldg_global_i: case Intrinsic::nvvm_ldg_global_p: @@ -1074,36 +1070,6 @@ MVT::i64, GlobalVal)); } -void NVPTXDAGToDAGISel::SelectMatchAll(SDNode *N) { - SDLoc DL(N); - enum { IS_I64 = 4, HAS_CONST_VALUE = 2, HAS_CONST_MASK = 1 }; - unsigned IID = cast(N->getOperand(1))->getZExtValue(); - unsigned OpcodeIndex = - (IID == Intrinsic::nvvm_match_all_sync_i64p) ? IS_I64 : 0; - SDValue MaskOp = N->getOperand(2); - SDValue ValueOp = N->getOperand(3); - if (ConstantSDNode *ValueConst = dyn_cast(ValueOp)) { - OpcodeIndex |= HAS_CONST_VALUE; - ValueOp = CurDAG->getTargetConstant(ValueConst->getZExtValue(), DL, - ValueConst->getValueType(0)); - } - if (ConstantSDNode *MaskConst = dyn_cast(MaskOp)) { - OpcodeIndex |= HAS_CONST_MASK; - MaskOp = CurDAG->getTargetConstant(MaskConst->getZExtValue(), DL, - MaskConst->getValueType(0)); - } - // Maps {IS_I64, HAS_CONST_VALUE, HAS_CONST_MASK} -> opcode - unsigned Opcodes[8] = { - NVPTX::MATCH_ALLP_SYNC_32rr, NVPTX::MATCH_ALLP_SYNC_32ri, - NVPTX::MATCH_ALLP_SYNC_32ir, NVPTX::MATCH_ALLP_SYNC_32ii, - NVPTX::MATCH_ALLP_SYNC_64rr, NVPTX::MATCH_ALLP_SYNC_64ri, - NVPTX::MATCH_ALLP_SYNC_64ir, NVPTX::MATCH_ALLP_SYNC_64ii}; - SDNode *NewNode = CurDAG->getMachineNode( - Opcodes[OpcodeIndex], DL, {ValueOp->getValueType(0), MVT::i1, MVT::Other}, - {MaskOp, ValueOp}); - ReplaceNode(N, NewNode); -} - void NVPTXDAGToDAGISel::SelectAddrSpaceCast(SDNode *N) { SDValue Src = N->getOperand(0); AddrSpaceCastSDNode *CastN = cast(N); Index: llvm/trunk/lib/Target/NVPTX/NVPTXIntrinsics.td =================================================================== --- llvm/trunk/lib/Target/NVPTX/NVPTXIntrinsics.td +++ llvm/trunk/lib/Target/NVPTX/NVPTXIntrinsics.td @@ -277,26 +277,22 @@ def ii : NVPTXInst<(outs regclass:$dest, Int1Regs:$pred), (ins i32imm:$mask, ImmOp:$value), "match.all.sync." # ptxtype # " \t$dest|$pred, $value, $mask;", - // If would be nice if tablegen could match multiple return values, - // but it does not seem to be the case. Thus we have an empty pattern and - // lower intrinsic to instruction manually. - // [(set regclass:$dest, Int1Regs:$pred, (IntOp imm:$value, imm:$mask))]>, - []>, + [(set regclass:$dest, Int1Regs:$pred, (IntOp imm:$mask, imm:$value))]>, Requires<[hasPTX60, hasSM70]>; def ir : NVPTXInst<(outs regclass:$dest, Int1Regs:$pred), (ins Int32Regs:$mask, ImmOp:$value), "match.all.sync." # ptxtype # " \t$dest|$pred, $value, $mask;", - []>, + [(set regclass:$dest, Int1Regs:$pred, (IntOp Int32Regs:$mask, imm:$value))]>, Requires<[hasPTX60, hasSM70]>; def ri : NVPTXInst<(outs regclass:$dest, Int1Regs:$pred), (ins i32imm:$mask, regclass:$value), "match.all.sync." # ptxtype # " \t$dest|$pred, $value, $mask;", - []>, + [(set regclass:$dest, Int1Regs:$pred, (IntOp imm:$mask, regclass:$value))]>, Requires<[hasPTX60, hasSM70]>; def rr : NVPTXInst<(outs regclass:$dest, Int1Regs:$pred), (ins Int32Regs:$mask, regclass:$value), "match.all.sync." # ptxtype # " \t$dest|$pred, $value, $mask;", - []>, + [(set regclass:$dest, Int1Regs:$pred, (IntOp Int32Regs:$mask, regclass:$value))]>, Requires<[hasPTX60, hasSM70]>; } defm MATCH_ALLP_SYNC_32 : MATCH_ALLP_SYNC