[llvm] [DirectX] only allow intrinsics defined in DXIL.td (PR #128613)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 20:05:47 PST 2025


================
@@ -770,8 +770,14 @@ class OpLowerer {
         continue;
       Intrinsic::ID ID = F.getIntrinsicID();
       switch (ID) {
-      default:
+      case Intrinsic::dx_resource_casthandle:
+      case Intrinsic::not_intrinsic:
         continue;
+      default: {
+        DiagnosticInfoUnsupported Diag(F, "Unknown intrinsic?");
+        M.getContext().diagnose(Diag);
----------------
farzonl wrote:

I'll add it for consistency. We don't seem to be able to do multiple Diagnostic errors per test case. Ie I can only invoke `M.getContext().diagnose(...)` once. So setting HasErrors seemed pointless.

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


More information about the llvm-commits mailing list