[llvm] 1c76958 - [NVPTX] Add unreachable for TMA Inst Printer (#117850)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 21:25:22 PST 2024


Author: Durgadoss R
Date: 2024-11-28T10:55:18+05:30
New Revision: 1c7695846559c2b191463aec46beb26c4a5c2bae

URL: https://github.com/llvm/llvm-project/commit/1c7695846559c2b191463aec46beb26c4a5c2bae
DIFF: https://github.com/llvm/llvm-project/commit/1c7695846559c2b191463aec46beb26c4a5c2bae.diff

LOG: [NVPTX] Add unreachable for TMA Inst Printer (#117850)

This patch adds the llvm_reachable() for TMA
reduction opcode printer method, outside the
switch.

We had this inside the default-case leading to
the warning below (and hence was removed):
error: default label in switch which covers all enumeration values
         [-Werror,-Wcovered-switch-default]

Signed-off-by: Durgadoss R <durgadossr at nvidia.com>

Added: 
    

Modified: 
    llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp b/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp
index 0f38f644e89af5..65e1893d3f3bdf 100644
--- a/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp
+++ b/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp
@@ -450,4 +450,6 @@ void NVPTXInstPrinter::printTmaReductionMode(const MCInst *MI, int OpNum,
     O << ".xor";
     return;
   }
+  llvm_unreachable(
+      "Invalid Reduction Op in printCpAsyncBulkTensorReductionMode");
 }


        


More information about the llvm-commits mailing list