[Mlir-commits] [mlir] dbd99cf - [OpenMP][MLIR] Fix warning from getIsDevice OffloadModuleInterface function

Andrew Gozillon llvmlistbot at llvm.org
Tue Mar 28 10:06:25 PDT 2023


Author: Andrew Gozillon
Date: 2023-03-28T12:06:04-05:00
New Revision: dbd99cfc0aacd40b6d771ca1b1fd9872390d1849

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

LOG: [OpenMP][MLIR] Fix warning from getIsDevice OffloadModuleInterface function

Missed the default return component of the function on original
implementation, which is a warning that causes subsequent
failure (but regardless it's incorrect behaviour and should
have been fixed).

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
index 7262f07859884..69cb6050b1acc 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
@@ -79,6 +79,7 @@ def OffloadModuleInterface : OpInterface<"OffloadModuleInterface"> {
         if (Attribute isDevice = $_op->getAttr("omp.is_device"))
           if (isDevice.isa<mlir::omp::IsDeviceAttr>())
             return isDevice.dyn_cast<IsDeviceAttr>().getIsDevice();
+        return false;
       }]>,
   ];
 }


        


More information about the Mlir-commits mailing list