-
Notifications
You must be signed in to change notification settings - Fork 663
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
[NFC][Im2Col] Move im2col to affine.delinearize_index #19840
Conversation
Simplify the generated indexing code in im2call by using affine.delineraize_index instead of affine::delinearizeIndex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't followed the indexing for a while. I can approve it if we are switching to affine.delinearize_index approach. Just a couple of nits, thanks!
auto delinKOffsetOp = b.create<affine::AffineDelinearizeIndexOp>( | ||
nestedLoc, getValueOrCreateConstantIndexOp(b, loc, kIndex), kBasis, | ||
/*hasOuterBound=*/true); | ||
SmallVector<Value> delinKOffset = delinKOffsetOp.getResults(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just collapse them into a single statement because we do not use the op elsewhere.
auto delinKOffsetOp = b.create<affine::AffineDelinearizeIndexOp>( | |
nestedLoc, getValueOrCreateConstantIndexOp(b, loc, kIndex), kBasis, | |
/*hasOuterBound=*/true); | |
SmallVector<Value> delinKOffset = delinKOffsetOp.getResults(); | |
SmallVector<Value> delinKOffset = b.create<affine::AffineDelinearizeIndexOp>( | |
nestedLoc, getValueOrCreateConstantIndexOp(b, loc, kIndex), kBasis, | |
/*hasOuterBound=*/true).getResults(); |
auto delinMOffsetOp = b.create<affine::AffineDelinearizeIndexOp>( | ||
nestedLoc, getValueOrCreateConstantIndexOp(b, loc, linearMOffset), mBasis, | ||
/*hasOuterBound=*/true); | ||
SmallVector<Value> delinMOffset = delinMOffsetOp.getResults(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, we can just collapse them into a single statement.
Simplify the generated indexing code in im2col by using affine.delineraize_index instead of affine::delinearizeIndex.