[PATCH] D60824: AMDGPU: Force skip over SMRD, VMEM and s_waitcnt instructions

Rhys Perry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 06:55:11 PDT 2019


pendingchaos created this revision.
pendingchaos added a reviewer: arsen.
Herald added subscribers: llvm-commits, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.

This fixes a large Dawn of War 3 performance regression with RADV from Mesa 19.0 to master which was caused by creating less code in some branches.


Repository:
  rL LLVM

https://reviews.llvm.org/D60824

Files:
  lib/Target/AMDGPU/SIInsertSkips.cpp


Index: lib/Target/AMDGPU/SIInsertSkips.cpp
===================================================================
--- lib/Target/AMDGPU/SIInsertSkips.cpp
+++ lib/Target/AMDGPU/SIInsertSkips.cpp
@@ -137,6 +137,10 @@
       if (TII->hasUnwantedEffectsWhenEXECEmpty(*I))
         return true;
 
+      // These instructions are potentially expensive even if EXEC = 0.
+      if (TII->isSMRD(*I) || TII->isVMEM(*I) || I->getOpcode() == AMDGPU::S_WAITCNT)
+        return true;
+
       ++NumInstr;
       if (NumInstr >= SkipThreshold)
         return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60824.195560.patch
Type: text/x-patch
Size: 551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190417/595c0e61/attachment-0001.bin>


More information about the llvm-commits mailing list