Skip to content

Commit 2089596

Browse files
committed
[NVPTX] Remove sub.s16x2 instruction
According to the PTX ISA this doesn't exist (and ptxas rejects it) See pytorch/pytorch#118589
1 parent d1d2932 commit 2089596

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
465465
case ISD::SMIN:
466466
case ISD::UMIN:
467467
case ISD::UMAX:
468-
case ISD::SUB:
469468
IsOpSupported = STI.getSmVersion() >= 90 && STI.getPTXVersion() >= 80;
470469
break;
471470
}

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,6 @@ defm ADD : I3<"add.s", add>;
838838
defm SUB : I3<"sub.s", sub>;
839839

840840
def ADD16x2 : I16x2<"add.s", add>;
841-
def SUB16x2 : I16x2<"sub.s", sub>;
842841

843842
// in32 and int64 addition and subtraction with carry-out.
844843
defm ADDCC : ADD_SUB_INT_CARRY<"add.cc", addc>;

llvm/test/CodeGen/NVPTX/i16x2-instructions.ll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,12 @@ define <2 x i16> @test_add_imm_1(<2 x i16> %a) #0 {
123123
; COMMON-DAG: ld.param.u32 [[A:%r[0-9]+]], [test_sub_param_0];
124124
;
125125
; COMMON-DAG: ld.param.u32 [[B:%r[0-9]+]], [test_sub_param_1];
126-
; I16x2: sub.s16x2 [[R:%r[0-9]+]], [[A]], [[B]];
127126
;
128-
; NO-I16x2-DAG: mov.b32 {[[RS0:%rs[0-9]+]], [[RS1:%rs[0-9]+]]}, [[A]];
129-
; NO-I16x2-DAG: mov.b32 {[[RS2:%rs[0-9]+]], [[RS3:%rs[0-9]+]]}, [[B]];
130-
; NO-I16x2-DAG: sub.s16 [[RS4:%rs[0-9]+]], [[RS0]], [[RS2]];
131-
; NO-I16x2-DAG: sub.s16 [[RS5:%rs[0-9]+]], [[RS1]], [[RS3]];
132-
; NO-I16x2-DAG: mov.b32 [[R:%r[0-9]+]], {[[RS4]], [[RS5]]};
127+
; COMMON-DAG: mov.b32 {[[RS0:%rs[0-9]+]], [[RS1:%rs[0-9]+]]}, [[A]];
128+
; COMMON-DAG: mov.b32 {[[RS2:%rs[0-9]+]], [[RS3:%rs[0-9]+]]}, [[B]];
129+
; COMMON-DAG: sub.s16 [[RS4:%rs[0-9]+]], [[RS0]], [[RS2]];
130+
; COMMON-DAG: sub.s16 [[RS5:%rs[0-9]+]], [[RS1]], [[RS3]];
131+
; COMMON-DAG: mov.b32 [[R:%r[0-9]+]], {[[RS4]], [[RS5]]};
133132
;
134133
; COMMON-NEXT: st.param.b32 [func_retval0+0], [[R]];
135134
; COMMON-NEXT: ret;

0 commit comments

Comments
 (0)