[PATCH] D26633: AMDGPU/GCN: Exit early in hazard recognizer if there is no vreg argument

Jan Vesely via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 13:27:58 PST 2016


jvesely created this revision.
jvesely added reviewers: tstellarAMD, arsenm.
jvesely added a subscriber: llvm-commits.
jvesely set the repository for this revision to rL LLVM.
Herald added subscribers: tony-tye, yaxunl, nhaehnle, wdng, kzhuravl.

wbinvl.* are vector instructions that do not use vector registers.


Repository:
  rL LLVM

https://reviews.llvm.org/D26633

Files:
  lib/Target/AMDGPU/GCNHazardRecognizer.cpp
  test/CodeGen/AMDGPU/llvm.amdgcn.buffer.wbinvl1.vol.ll


Index: test/CodeGen/AMDGPU/llvm.amdgcn.buffer.wbinvl1.vol.ll
===================================================================
--- test/CodeGen/AMDGPU/llvm.amdgcn.buffer.wbinvl1.vol.ll
+++ test/CodeGen/AMDGPU/llvm.amdgcn.buffer.wbinvl1.vol.ll
@@ -7,9 +7,11 @@
 ; GCN-NEXT: ; BB#0:
 ; CI-NEXT: buffer_wbinvl1_vol ; encoding: [0x00,0x00,0xc0,0xe1,0x00,0x00,0x00,0x00]
 ; VI-NEXT: buffer_wbinvl1_vol ; encoding: [0x00,0x00,0xfc,0xe0,0x00,0x00,0x00,0x00]
-; GCN-NEXT: s_endpgm
+; GCN: s_endpgm
 define void @test_buffer_wbinvl1_vol() #0 {
   call void @llvm.amdgcn.buffer.wbinvl1.vol()
+; This used to crash in hazard recognizer
+  store i8 0, i8 addrspace(1)* undef, align 1
   ret void
 }
 
Index: lib/Target/AMDGPU/GCNHazardRecognizer.cpp
===================================================================
--- lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+++ lib/Target/AMDGPU/GCNHazardRecognizer.cpp
@@ -398,6 +398,8 @@
   int VDataRCID = -1;
   if (VDataIdx != -1)
     VDataRCID = Desc.OpInfo[VDataIdx].RegClass;
+  else
+    return -1;
 
   if (TII->isMUBUF(MI) || TII->isMTBUF(MI)) {
     // For MUBUF/MTBUF instructions this hazard only exists if the


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26633.77874.patch
Type: text/x-patch
Size: 1156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161114/eb68b0de/attachment.bin>


More information about the llvm-commits mailing list