[Mlir-commits] [mlir] 0d84566 - [mlir] Fix asan errors in gpu transform dialect

Guray Ozen llvmlistbot at llvm.org
Fri Nov 11 02:57:18 PST 2022


Author: Guray Ozen
Date: 2022-11-11T11:57:00+01:00
New Revision: 0d845660f4e2c3dc3c1afc3db4c723db4bd32f01

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

LOG: [mlir] Fix asan errors in gpu transform dialect

Added: 
    

Modified: 
    mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp b/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
index 23420e886c7fa..460eb2f95fbc3 100644
--- a/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
+++ b/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
@@ -169,7 +169,8 @@ DiagnosedSilenceableFailure mlir::transform::gpu::mapForeachToBlocksImpl(
   SmallVector<int64_t> mapping;
   if (!foreachThreadOp.getMapping().has_value())
     return transformOp.emitSilenceableError() << "mapping must be present";
-  for (DeviceMappingAttrInterface map : *foreachThreadOp.getMapping()) {
+  for (DeviceMappingAttrInterface map :
+       foreachThreadOp.getMapping()->getValue()) {
     if (auto blockMap = map.dyn_cast<GPUBlockMappingAttr>()) {
       mapping.push_back((int64_t)blockMap.getBlock());
     } else {
@@ -351,7 +352,8 @@ static DiagnosedSilenceableFailure rewriteOneForeachThreadToGpuThreads(
   SmallVector<int64_t> mapping;
   if (!foreachThreadOp.getMapping().has_value())
     return failureHelper("mapping must be present");
-  for (DeviceMappingAttrInterface map : *foreachThreadOp.getMapping()) {
+  for (DeviceMappingAttrInterface map :
+       foreachThreadOp.getMapping()->getValue()) {
     if (auto threadMap = map.dyn_cast<GPUThreadMappingAttr>()) {
       mapping.push_back((int64_t)threadMap.getThread());
     } else {


        


More information about the Mlir-commits mailing list