Fix subset subview offset/layout and add upstream test#101
Open
TaoTao-real wants to merge 8 commits intozhangstevenunity:mainfrom
Open
Fix subset subview offset/layout and add upstream test#101TaoTao-real wants to merge 8 commits intozhangstevenunity:mainfrom
TaoTao-real wants to merge 8 commits intozhangstevenunity:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复内容
当指针处理。
memref.subview 的 layout mismatch 验证失败。
offset 为常量时做裁剪。
ubuf* 的非法强转。
之前错误原因
针运算,结果生成 (ubuf float*) tile 的非法 C++。
tile.data() 取地址。
静态时,memref.subview 的 verifier 需要 静态 offset 匹配,否则报错。
修改前后对比
只能把它当普通 memref/裸指针处理。
tile 语义和元信息贯通。
样例(IR 片段)
修改前:
%sub = pto.subset %src[%i, %j] sizes [32, 32] : !pto.tile_buf<...>
; 降成:
%subview = memref.subview %src_memref[%i, %j] [32, 32] [1, 1]
修改后:
%sub = pto.subset %src[%i, %j] sizes [32, 32] : !pto.tile_buf<...>
; 降成:
%subview = memref.subview %src_memref[%i, %j] [32, 32] [1, 1]
%subtile = pto.bind_tile %subview, %vrow, %vcol {config = ...} : memref<...> -> memref<...>