Skip to content

Commit 61ac8a0

Browse files
committed
address comments
1 parent 1a32b0a commit 61ac8a0

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,10 +2357,10 @@ bool NVPTXDAGToDAGISel::tryStoreParam(SDNode *N) {
23572357
default:
23582358
break;
23592359
case MVT::i32:
2360-
Opcode = NVPTX::StoreParamI8TruncI32;
2360+
Opcode = NVPTX::StoreParamI8TruncI32_r;
23612361
break;
23622362
case MVT::i64:
2363-
Opcode = NVPTX::StoreParamI8TruncI64;
2363+
Opcode = NVPTX::StoreParamI8TruncI64_r;
23642364
break;
23652365
}
23662366
}

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,18 +2637,15 @@ class LoadParamRegInst<NVPTXRegClass regclass, string opstr> :
26372637
[(set regclass:$dst, (LoadParam (i32 0), (i32 imm:$b)))]>;
26382638

26392639
let mayStore = true in {
2640-
class StoreParamInstReg<NVPTXRegClass regclass, string opstr> :
2641-
NVPTXInst<(outs), (ins regclass:$val, i32imm:$a, i32imm:$b),
2642-
"st.param" # opstr # " \t[param$a+$b], $val;",
2643-
[]>;
2644-
2645-
multiclass StoreParamInst<NVPTXRegClass regclass, Operand IMMType, string opstr> {
2646-
def _r: StoreParamInstReg<regclass, opstr>;
26472640

2648-
def _i:
2649-
NVPTXInst<(outs), (ins IMMType:$val, i32imm:$a, i32imm:$b),
2650-
"st.param" # opstr # " \t[param$a+$b], $val;",
2651-
[]>;
2641+
multiclass StoreParamInst<NVPTXRegClass regclass, Operand IMMType, string opstr, bit support_imm = true> {
2642+
foreach op = [IMMType, regclass] in
2643+
if !or(support_imm, !isa<NVPTXRegClass>(op)) then
2644+
def _ # !if(!isa<NVPTXRegClass>(op), "r", "i")
2645+
: NVPTXInst<(outs),
2646+
(ins op:$val, i32imm:$a, i32imm:$b),
2647+
"st.param" # opstr # " \t[param$a+$b], $val;",
2648+
[]>;
26522649
}
26532650

26542651
multiclass StoreParamV2Inst<NVPTXRegClass regclass, Operand IMMType, string opstr> {
@@ -2764,8 +2761,8 @@ defm StoreParamI32 : StoreParamInst<Int32Regs, i32imm, ".b32">;
27642761
defm StoreParamI16 : StoreParamInst<Int16Regs, i16imm, ".b16">;
27652762
defm StoreParamI8 : StoreParamInst<Int16Regs, i8imm, ".b8">;
27662763

2767-
def StoreParamI8TruncI32 : StoreParamInstReg<Int32Regs, ".b8">;
2768-
def StoreParamI8TruncI64 : StoreParamInstReg<Int64Regs, ".b8">;
2764+
defm StoreParamI8TruncI32 : StoreParamInst<Int32Regs, i8imm, ".b8", /* support_imm */ false>;
2765+
defm StoreParamI8TruncI64 : StoreParamInst<Int64Regs, i8imm, ".b8", /* support_imm */ false>;
27692766

27702767
defm StoreParamV2I64 : StoreParamV2Inst<Int64Regs, i64imm, ".b64">;
27712768
defm StoreParamV2I32 : StoreParamV2Inst<Int32Regs, i32imm, ".b32">;

0 commit comments

Comments
 (0)