[Mlir-commits] [mlir] [MLIR] Update convert-gpu-to-spirv pass to prepare using GPU compilat… (PR #69941)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Oct 27 10:24:42 PDT 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff e214bdac51c46b554e1fb99de6b6b6c735b75bf1 02ff96c8185e30b730e5bf0230699a1abbc4dcc6 -- mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
index e1d3268bca08..0ee0bc2bd02e 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
@@ -76,14 +76,15 @@ void GPUToSPIRVPass::runOnOperation() {
     // This works fine for Vulkan shader that has a dedicated runner.
     // But OpenCL kernel needs SPIRV module placed inside original GPU module as
     // OpenCL uses GPU compilation pipeline.
-    const mlir::spirv::TargetEnv& targetEnv = getTargetEnvFromGPUModuleOp(moduleOp);
+    const mlir::spirv::TargetEnv &targetEnv =
+        getTargetEnvFromGPUModuleOp(moduleOp);
     FailureOr<spirv::MemoryModel> memoryModel =
         spirv::getMemoryModel(targetEnv);
     if (failed(memoryModel))
       return signalPassFailure();
     if (memoryModel == spirv::MemoryModel::OpenCL) {
       builder.setInsertionPoint(moduleOp.getBody(),
-                                    moduleOp.getBody()->begin());
+                                moduleOp.getBody()->begin());
     } else {
       builder.setInsertionPoint(moduleOp.getOperation());
     }
@@ -93,7 +94,8 @@ void GPUToSPIRVPass::runOnOperation() {
   // Run conversion for each module independently as they can have different
   // TargetEnv attributes.
   for (Operation *gpuModule : gpuModules) {
-    mlir::spirv::TargetEnvAttr targetAttr = spirv::lookupTargetEnvOrDefault(gpuModule);
+    mlir::spirv::TargetEnvAttr targetAttr =
+        spirv::lookupTargetEnvOrDefault(gpuModule);
     std::unique_ptr<ConversionTarget> target =
         SPIRVConversionTarget::get(targetAttr);
 
@@ -150,7 +152,8 @@ void GPUToSPIRVPass::runOnOperation() {
   // an empty func.func with same arguments as gpu.func. And it also needs
   // gpu.kernel attribute set.
   module.walk([&](gpu::GPUModuleOp moduleOp) {
-    const mlir::spirv::TargetEnv& targetEnv = getTargetEnvFromGPUModuleOp(moduleOp);
+    const mlir::spirv::TargetEnv &targetEnv =
+        getTargetEnvFromGPUModuleOp(moduleOp);
     FailureOr<spirv::MemoryModel> memoryModel =
         spirv::getMemoryModel(targetEnv);
     if (failed(memoryModel))

``````````

</details>


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


More information about the Mlir-commits mailing list