R600/SI: Add intrinsic for S_SENDMSG instruction
[oota-llvm.git] / lib / Target / R600 / SIInsertWaits.cpp
index 7ef662eb65b15b09da0c9d8d703352f615852768..695ec407fdbed3c56b58accf8352c15166b8c2de 100644 (file)
@@ -314,6 +314,12 @@ Counters SIInsertWaits::handleOperands(MachineInstr &MI) {
 
   Counters Result = ZeroCounts;
 
+  // S_SENDMSG implicitly waits for all outstanding LGKM transfers to finish,
+  // but we also want to wait for any other outstanding transfers before
+  // signalling other hardware blocks
+  if (MI.getOpcode() == AMDGPU::S_SENDMSG)
+    return LastIssued;
+
   // For each register affected by this
   // instruction increase the result sequence
   for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {