[Mlir-commits] [mlir] [mlir][NVVM] Fix default label unreachable warning in `getVoteSyncIntrinsicId` (PR #134600)

Jorn Tuyls llvmlistbot at llvm.org
Mon Apr 7 02:18:46 PDT 2025


https://github.com/jtuyls created https://github.com/llvm/llvm-project/pull/134600

Fixes the following warning after the changes in https://github.com/llvm/llvm-project/pull/134309:

```
llvm-project/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp:134:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
  default:
  ^
1 warning generated.
```

>From ad0ed27fb28962a6b288718c04fa36a1eafcbd4c Mon Sep 17 00:00:00 2001
From: Jorn Tuyls <jorn.tuyls at gmail.com>
Date: Mon, 7 Apr 2025 04:10:45 -0500
Subject: [PATCH] [mlir][NVVM] Fix default label unreachable warning in
 `getVoteSyncIntrinsicId`

---
 .../lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
index beff90237562d..7dfe320cff2ab 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
@@ -131,9 +131,8 @@ static llvm::Intrinsic::ID getVoteSyncIntrinsicId(NVVM::VoteSyncKind kind) {
     return llvm::Intrinsic::nvvm_vote_ballot_sync;
   case NVVM::VoteSyncKind::uni:
     return llvm::Intrinsic::nvvm_vote_uni_sync;
-  default:
-    llvm_unreachable("unsupported vote kind");
   }
+  llvm_unreachable("unsupported vote kind");
 }
 
 /// Return the intrinsic ID associated with ldmatrix for the given paramters.



More information about the Mlir-commits mailing list