[Mlir-commits] [mlir] 60dd937 - [mlir][gpu] Fix build failure / silence windows build warnings

Christopher Bate llvmlistbot at llvm.org
Fri Jan 13 12:41:47 PST 2023


Author: Christopher Bate
Date: 2023-01-13T13:40:57-07:00
New Revision: 60dd937d56e6d941e45fdc43b1c7abb7b365788d

URL: https://github.com/llvm/llvm-project/commit/60dd937d56e6d941e45fdc43b1c7abb7b365788d
DIFF: https://github.com/llvm/llvm-project/commit/60dd937d56e6d941e45fdc43b1c7abb7b365788d.diff

LOG: [mlir][gpu] Fix build failure / silence windows build warnings

Fixes Windows build failure (C4715) caused by
6ca1a09f03e8e940f306bea73efa935e4ee38173.

Added: 
    

Modified: 
    mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
    mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
index f3cf780306e7..40fd9520a563 100644
--- a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
+++ b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
@@ -206,6 +206,8 @@ struct LowerGpuOpsToNVVMOpsPass
             case gpu::AddressSpace::Private:
               return 0;
             }
+            llvm_unreachable("unknown address space enum value");
+            return 0;
           });
       gpu::populateMemorySpaceLoweringPatterns(typeConverter, patterns);
       ConversionTarget target(getContext());

diff  --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
index 25571bd0ddb0..034188f4fade 100644
--- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
+++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
@@ -146,6 +146,8 @@ struct LowerGpuOpsToROCDLOpsPass
             case gpu::AddressSpace::Private:
               return 5;
             }
+            llvm_unreachable("unknown address space enum value");
+            return 0;
           });
       ConversionTarget target(getContext());
       gpu::populateLowerMemorySpaceOpLegality(target);


        


More information about the Mlir-commits mailing list