Skip to content

Commit e365cfe

Browse files
committed
address comments
1 parent aad4cad commit e365cfe

File tree

3 files changed

+18
-26
lines changed

3 files changed

+18
-26
lines changed

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ void NVPTXDAGToDAGISel::Select(SDNode *N) {
163163
if (tryStoreParam(N))
164164
return;
165165
break;
166-
case ISD::INTRINSIC_WO_CHAIN:
167-
if (tryIntrinsicNoChain(N))
168-
return;
169-
break;
170166
case ISD::INTRINSIC_W_CHAIN:
171167
if (tryIntrinsicChain(N))
172168
return;
@@ -902,14 +898,6 @@ NVPTXDAGToDAGISel::insertMemoryInstructionFence(SDLoc DL, SDValue &Chain,
902898
return {InstructionOrdering, Scope};
903899
}
904900

905-
bool NVPTXDAGToDAGISel::tryIntrinsicNoChain(SDNode *N) {
906-
unsigned IID = N->getConstantOperandVal(0);
907-
switch (IID) {
908-
default:
909-
return false;
910-
}
911-
}
912-
913901
void NVPTXDAGToDAGISel::SelectAddrSpaceCast(SDNode *N) {
914902
SDValue Src = N->getOperand(0);
915903
AddrSpaceCastSDNode *CastN = cast<AddrSpaceCastSDNode>(N);

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class LLVM_LIBRARY_VISIBILITY NVPTXDAGToDAGISel : public SelectionDAGISel {
6969
#include "NVPTXGenDAGISel.inc"
7070

7171
void Select(SDNode *N) override;
72-
bool tryIntrinsicNoChain(SDNode *N);
7372
bool tryIntrinsicChain(SDNode *N);
7473
bool tryIntrinsicVoid(SDNode *N);
7574
void SelectTexSurfHandle(SDNode *N);

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,11 +1741,14 @@ def FMOV64i : MOVi<B64, "b64", f64, f64imm, fpimm>;
17411741

17421742

17431743
def to_tglobaladdr : SDNodeXForm<globaladdr, [{
1744-
return CurDAG->getTargetGlobalAddress(N->getGlobal(), SDLoc(N), N->getValueType(0), N->getOffset(), N->getTargetFlags());
1744+
return CurDAG->getTargetGlobalAddress(N->getGlobal(), SDLoc(N),
1745+
N->getValueType(0), N->getOffset(),
1746+
N->getTargetFlags());
17451747
}]>;
17461748

17471749
def to_texternsym : SDNodeXForm<externalsym, [{
1748-
return CurDAG->getTargetExternalSymbol(N->getSymbol(), N->getValueType(0), N->getTargetFlags());
1750+
return CurDAG->getTargetExternalSymbol(N->getSymbol(), N->getValueType(0),
1751+
N->getTargetFlags());
17491752
}]>;
17501753

17511754
def to_tframeindex : SDNodeXForm<frameindex, [{
@@ -2139,30 +2142,32 @@ foreach is_convergent = [0, 1] in {
21392142

21402143
let isCall = 1, isConvergent = is_convergent in {
21412144
def CALL # convergent_suffix :
2142-
NVPTXInst<(outs), (ins ADDR_base:$addr, CallOperand:$rets, CallOperand:$params, i32imm:$proto),
2145+
NVPTXInst<(outs),
2146+
(ins ADDR_base:$addr, CallOperand:$rets, CallOperand:$params,
2147+
i32imm:$proto),
21432148
"call${rets:RetList} $addr, (${params:ParamList}), prototype_$proto;", []>;
21442149

21452150
def CALL_UNI # convergent_suffix :
2146-
NVPTXInst<(outs), (ins ADDR_base:$addr, CallOperand:$rets, CallOperand:$params),
2151+
NVPTXInst<(outs),
2152+
(ins ADDR_base:$addr, CallOperand:$rets, CallOperand:$params),
21472153
"call.uni${rets:RetList} $addr, (${params:ParamList});", []>;
21482154
}
21492155

2150-
defvar inst = !cast<NVPTXInst>("CALL" # convergent_suffix);
2151-
defvar inst_uni = !cast<NVPTXInst>("CALL_UNI" # convergent_suffix);
2152-
2156+
defvar call_inst = !cast<NVPTXInst>("CALL" # convergent_suffix);
21532157
def : Pat<(call is_convergent, 1, imm:$rets, imm:$params, globaladdr:$addr, imm:$proto),
2154-
(inst (to_tglobaladdr $addr), imm:$rets, imm:$params, imm:$proto)>;
2158+
(call_inst (to_tglobaladdr $addr), imm:$rets, imm:$params, imm:$proto)>;
21552159
def : Pat<(call is_convergent, 1, imm:$rets, imm:$params, i32:$addr, imm:$proto),
2156-
(inst $addr, imm:$rets, imm:$params, imm:$proto)>;
2160+
(call_inst $addr, imm:$rets, imm:$params, imm:$proto)>;
21572161
def : Pat<(call is_convergent, 1, imm:$rets, imm:$params, i64:$addr, imm:$proto),
2158-
(inst $addr, imm:$rets, imm:$params, imm:$proto)>;
2162+
(call_inst $addr, imm:$rets, imm:$params, imm:$proto)>;
21592163

2164+
defvar call_uni_inst = !cast<NVPTXInst>("CALL_UNI" # convergent_suffix);
21602165
def : Pat<(call is_convergent, 0, imm:$rets, imm:$params, globaladdr:$addr, 0),
2161-
(inst_uni (to_tglobaladdr $addr), imm:$rets, imm:$params)>;
2166+
(call_uni_inst (to_tglobaladdr $addr), imm:$rets, imm:$params)>;
21622167
def : Pat<(call is_convergent, 0, imm:$rets, imm:$params, i32:$addr, 0),
2163-
(inst_uni $addr, imm:$rets, imm:$params)>;
2168+
(call_uni_inst $addr, imm:$rets, imm:$params)>;
21642169
def : Pat<(call is_convergent, 0, imm:$rets, imm:$params, i64:$addr, 0),
2165-
(inst_uni $addr, imm:$rets, imm:$params)>;
2170+
(call_uni_inst $addr, imm:$rets, imm:$params)>;
21662171
}
21672172

21682173
def LoadParamMemI64 : LoadParamMemInst<B64, ".b64">;

0 commit comments

Comments
 (0)