-
Notifications
You must be signed in to change notification settings - Fork 15k
[MLIR] Make 1-D memref flattening a prerequisite for vector narrow type emulation #157771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
686a25b
b061ab9
f523d84
6edd712
2e850c3
7c2a464
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also, could you add a high-level comment specifying what combination of patterns is tested and that we are merely verifying that narrow-type-emulation works for rank > 1 memrefs? Otherwise the lack of more thorough test lines feels a bit ad-hoc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added new tests except Also updated comments as well. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // RUN: mlir-opt --test-memref-flatten-and-vector-narrow-type-emulation --split-input-file %s | FileCheck %s | ||
|
|
||
| // ----- | ||
lialan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| func.func @vector_load_2d_i4(%arg0: index, %arg1: index) -> vector<8xi4> { | ||
lialan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| %0 = memref.alloc() : memref<4x8xi4> | ||
| %1 = vector.load %0[%arg0, %arg1] : memref<4x8xi4>, vector<8xi4> | ||
| return %1 : vector<8xi4> | ||
| } | ||
| // CHECK: func @vector_load_2d_i4 | ||
lialan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // CHECK: vector.load | ||
| // CHECK-SAME: memref<16xi8> | ||
lialan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // ----- | ||
|
|
||
| func.func @vector_maskedload_2d_i4(%arg0: index, %arg1: index, %passthru: vector<8xi4>) -> vector<8xi4> { | ||
| %0 = memref.alloc() : memref<4x8xi4> | ||
| %mask = vector.constant_mask [6] : vector<8xi1> | ||
| %1 = vector.maskedload %0[%arg0, %arg1], %mask, %passthru : | ||
| memref<4x8xi4>, vector<8xi1>, vector<8xi4> into vector<8xi4> | ||
| return %1 : vector<8xi4> | ||
| } | ||
| // CHECK: func @vector_maskedload_2d_i4( | ||
| // CHECK: vector.maskedload | ||
| // CHECK-SAME: memref<16xi8> | ||
|
|
||
| // ----- | ||
|
|
||
| func.func @vector_maskedstore_2d_i4(%arg0: index, %arg1: index, %value: vector<8xi4>) { | ||
| %0 = memref.alloc() : memref<4x8xi4> | ||
| %mask = vector.constant_mask [5] : vector<8xi1> | ||
| vector.maskedstore %0[%arg0, %arg1], %mask, %value : | ||
| memref<4x8xi4>, vector<8xi1>, vector<8xi4> | ||
| return | ||
| } | ||
| // CHECK: func @vector_maskedstore_2d_i4( | ||
| // CHECK: vector.maskedstore | ||
| // CHECK-SAME: memref<16xi8> | ||
Uh oh!
There was an error while loading. Please reload this page.