[PATCH] D52958: AMDGPU/GlobalISel: Select amdgcn.cvt.pkrtz to 64-bit instructions

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 8 10:52:26 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL343985: AMDGPU/GlobalISel: Select amdgcn.cvt.pkrtz to 64-bit instructions (authored by tstellar, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D52958

Files:
  llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td
  llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.cvt.pkrtz.mir


Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td
@@ -122,15 +122,14 @@
 }
 def : GISelVop3Pat2CommutePat <sra, V_ASHRREV_I32_e64, i32>;
 
-// FIXME: Select directly to _e32 so we don't need to deal with modifiers.
 // FIXME: We can't re-use SelectionDAG patterns here because they match
 // against a custom SDNode and we would need to create a generic machine
 // instruction that is equivalent to the custom SDNode.  This would also require
 // us to custom legalize the intrinsic to the new generic machine instruction,
 // but I can't get custom legalizing of intrinsic to work and I'm not sure if
 // this is even supported yet.
-defm : GISelVop2IntrPat <
-  int_amdgcn_cvt_pkrtz, V_CVT_PKRTZ_F16_F32_e32, v2f16, f32>;
+def : GISelVop3Pat2ModsPat <
+  int_amdgcn_cvt_pkrtz, V_CVT_PKRTZ_F16_F32_e64, v2f16, f32>;
 
 defm : GISelVop2IntrPat <int_maxnum, V_MAX_F32_e32, f32>;
 def : GISelVop3Pat2ModsPat <int_maxnum, V_MAX_F64, f64>;
Index: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.cvt.pkrtz.mir
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.cvt.pkrtz.mir
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.cvt.pkrtz.mir
@@ -1,4 +1,5 @@
 # RUN: llc -march=amdgcn -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s -check-prefixes=GCN
+# RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s -check-prefixes=GCN
 
 --- |
   define void @cvt_pkrtz(i32 addrspace(1)* %global0) { ret void }
@@ -23,15 +24,15 @@
     %3:vgpr(s64) = COPY $vgpr3_vgpr4
 
     ; cvt_pkrtz vs
-    ; GCN: V_CVT_PKRTZ_F16_F32_e32 [[SGPR0]], [[VGPR0]]
+    ; GCN: V_CVT_PKRTZ_F16_F32_e64 0, [[VGPR0]], 0, [[SGPR0]]
     %4:vgpr(<2 x s16>) = G_INTRINSIC intrinsic(@llvm.amdgcn.cvt.pkrtz), %1, %0
 
     ; cvt_pkrtz sv
-    ; GCN: V_CVT_PKRTZ_F16_F32_e32 [[SGPR0]], [[VGPR0]]
+    ; GCN: V_CVT_PKRTZ_F16_F32_e64 0, [[SGPR0]], 0, [[VGPR0]]
     %5:vgpr(<2 x s16>) = G_INTRINSIC intrinsic(@llvm.amdgcn.cvt.pkrtz), %0, %1
 
     ; cvt_pkrtz vv
-    ; GCN: V_CVT_PKRTZ_F16_F32_e32 [[VGPR0]], [[VGPR1]]
+    ; GCN: V_CVT_PKRTZ_F16_F32_e64 0, [[VGPR0]], 0, [[VGPR1]]
     %6:vgpr(<2 x s16>) = G_INTRINSIC intrinsic(@llvm.amdgcn.cvt.pkrtz), %1, %2
 
     %7:vgpr(s32) = G_BITCAST %4


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52958.168683.patch
Type: text/x-patch
Size: 2538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181008/e56bcc46/attachment.bin>


More information about the llvm-commits mailing list