Skip to content

Conversation

Max191
Copy link
Contributor

@Max191 Max191 commented Nov 11, 2023

No description provided.

Copy link

github-actions bot commented Nov 11, 2023

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 07fdc084fe75f971688d4140a5bd2dcb1d60eba2 f1c15b5850998c39e1ab6438e7c9a4ec4d581137 -- mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
View the diff from clang-format here.
diff --git a/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp b/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
index 553af2adb6..58bcf7b9dd 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
@@ -405,9 +405,10 @@ void memref::populateMemRefNarrowTypeEmulationPatterns(
     RewritePatternSet &patterns) {
 
   // Populate `memref.*` conversion patterns.
-  patterns.add<ConvertMemRefAlloc, ConvertMemRefLoad,
-               ConvertMemRefAssumeAlignment, ConvertMemRefSubview, ConvertMemrefStore>(
-      typeConverter, patterns.getContext());
+  patterns
+      .add<ConvertMemRefAlloc, ConvertMemRefLoad, ConvertMemRefAssumeAlignment,
+           ConvertMemRefSubview, ConvertMemrefStore>(typeConverter,
+                                                     patterns.getContext());
   memref::populateResolveExtractStridedMetadataPatterns(patterns);
 }
 

This adds a conversion for narrow type emulation of memref.store ops.
The conversion replaces the memref.store with two memref.atomic_rmw
ops. Atomics are used to prevent race conditions on same-byte accesses,
in the event that two threads are storing into the same byte.
@Max191 Max191 force-pushed the memref-store-subbyte-emulation branch from 5e4abca to f1c15b5 Compare November 22, 2023 21:45
@Max191 Max191 closed this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant