-
Notifications
You must be signed in to change notification settings - Fork 1
[MLIR][Affine] Fixed crash with invalid reduction op (Issue #64073) #8
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
base: issue_64073
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2505,6 +2505,8 @@ Value mlir::arith::getIdentityValue(AtomicRMWKind op, Type resultType, | |
| bool useOnlyFiniteValue) { | ||
| auto attr = | ||
| getIdentityValueAttr(op, resultType, builder, loc, useOnlyFiniteValue); | ||
| if (!attr) | ||
| return nullptr; | ||
| return builder.create<arith::ConstantOp>(loc, attr); | ||
| } | ||
|
|
||
|
|
@@ -2525,10 +2527,6 @@ Value mlir::arith::getReductionOp(AtomicRMWKind op, OpBuilder &builder, | |
| return builder.create<arith::MaximumFOp>(loc, lhs, rhs); | ||
| case AtomicRMWKind::minimumf: | ||
| return builder.create<arith::MinimumFOp>(loc, lhs, rhs); | ||
| case AtomicRMWKind::maxnumf: | ||
| return builder.create<arith::MaxNumFOp>(loc, lhs, rhs); | ||
| case AtomicRMWKind::minnumf: | ||
| return builder.create<arith::MinNumFOp>(loc, lhs, rhs); | ||
| case AtomicRMWKind::maxs: | ||
|
||
| return builder.create<arith::MaxSIOp>(loc, lhs, rhs); | ||
| case AtomicRMWKind::mins: | ||
|
|
||
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.
Addressing comment on lines 2528 to 2530 regarding deletion of maxnumf and minnumf as reduction op cases:
The 'getIdentityAttr()' method called here returns valid attr iff the op passed is a valid reductionOp else returns nullptr.
This method does not consider 'maxnumf' and 'minnumf' as valid reduction ops. If this is correct, then consequently maxnumf and minnumf cases should be safely removable from the "getReductionOp()", as done in this commit.