[llvm] r233080 - R600/SI: Insert more NOPs after READLANE on VI, don't use NOPs on CI

Marek Olsak marek.olsak at amd.com
Tue Mar 24 06:40:38 PDT 2015


Author: mareko
Date: Tue Mar 24 08:40:38 2015
New Revision: 233080

URL: http://llvm.org/viewvc/llvm-project?rev=233080&view=rev
Log:
R600/SI: Insert more NOPs after READLANE on VI, don't use NOPs on CI

This is a candidate for stable.

Modified:
    llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp?rev=233080&r1=233079&r2=233080&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIRegisterInfo.cpp Tue Mar 24 08:40:38 2015
@@ -268,7 +268,22 @@ void SIRegisterInfo::eliminateFrameIndex
                   .addReg(SubReg);
         }
       }
-      TII->insertNOPs(MI, 3);
+
+      // TODO: only do this when it is needed
+      switch (MF->getSubtarget<AMDGPUSubtarget>().getGeneration()) {
+      case AMDGPUSubtarget::SOUTHERN_ISLANDS:
+        // "VALU writes SGPR" -> "SMRD reads that SGPR" needs "S_NOP 3" on SI
+        TII->insertNOPs(MI, 3);
+        break;
+      case AMDGPUSubtarget::SEA_ISLANDS:
+        break;
+      default: // VOLCANIC_ISLANDS and later
+        // "VALU writes SGPR -> VMEM reads that SGPR" needs "S_NOP 4" on VI
+        // and later. This also applies to VALUs which write VCC, but we're
+        // unlikely to see VMEM use VCC.
+        TII->insertNOPs(MI, 4);
+      }
+
       MI->eraseFromParent();
       break;
     }





More information about the llvm-commits mailing list