]> granicus.if.org Git - llvm/commitdiff
Merging r233080:
authorTom Stellard <thomas.stellard@amd.com>
Wed, 29 Apr 2015 00:59:49 +0000 (00:59 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 29 Apr 2015 00:59:49 +0000 (00:59 +0000)
------------------------------------------------------------------------
r233080 | marek.olsak | 2015-03-24 09:40:38 -0400 (Tue, 24 Mar 2015) | 4 lines

R600/SI: Insert more NOPs after READLANE on VI, don't use NOPs on CI

This is a candidate for stable.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@236071 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/SIRegisterInfo.cpp

index a2c536c69420a085a74318f3aaead85ef2f5dd5f..f50299112604fa0ba43a7693583fa63647ba7fe3 100644 (file)
@@ -266,7 +266,22 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
                   .addReg(SubReg);
         }
       }
-      TII->insertNOPs(MI, 3);
+
+      // TODO: only do this when it is needed
+      switch (ST.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;
     }