================
@@ -5605,6 +5605,25 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr 
&MI,
     return false;
   }
 
+  if (Opcode == AMDGPU::S_MONITOR_SLEEP ||
+      Opcode == AMDGPU::S_MONITOR_SLEEP_gfx12 ||
+      Opcode == AMDGPU::S_MONITOR_SLEEP_gfx13) {
+    const MachineOperand &Sleep = MI.getOperand(0);
+    if (!Sleep.isImm()) {
+      ErrInfo = "sleep duration must be an immediate";
+      return false;
+    }
+    int64_t Value = Sleep.getImm();
+    if (ST.hasNoSleepForever() && (Value & 0x8000)) {
+      ErrInfo = "sleep forever is unsupported on this target";
+      return false;
+    }
----------------
arsenm wrote:

```suggestion
    }
    
```

https://github.com/llvm/llvm-project/pull/241042
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to