[llvm] [AMDGPU] Add a trap lowering workaround for gfx11 (PR #85854)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 23 06:19:10 PDT 2024


================
@@ -443,6 +444,13 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
     return isAmdHsaOS() ? TrapHandlerAbi::AMDHSA : TrapHandlerAbi::NONE;
   }
 
+  // True on hardware where 's_trap 2' is treated as a nop that must be
+  // simulated.
+  bool requiresSimulatedTrap() const {
+    AMDGPU::IsaVersion V = AMDGPU::getIsaVersion(getCPU());
+    return V.Major == 11 && V.Minor <= 3;
----------------
arsenm wrote:

We shouldn't have to parse the target-cpu name in any query. Just define a proper feature for this?

https://github.com/llvm/llvm-project/pull/85854


More information about the llvm-commits mailing list