Skip to content
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

[CIR][Dialect] Add BinOpKind_Max #1201

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[CIR][Dialect] Add BinOpKind_Max #1201

wants to merge 1 commit into from

Conversation

ghehg
Copy link
Collaborator

@ghehg ghehg commented Dec 3, 2024

This would facilitate implementation of neon intrinsic neon_vmax_v and __builtin_elementwise_max, and potentially future optimizations. CIR BinOp supports vector type.
Floating point has already been supported by FMaxOp.

@ghehg ghehg requested a review from smeenai December 3, 2024 14:34
@ghehg ghehg marked this pull request as ready for review December 3, 2024 15:08
if (mlir::isa<cir::IntType, mlir::IntegerType>(type)) {
auto isUnsigned = mlir::isa<cir::IntType>(type)
? mlir::cast<cir::IntType>(type).isUnsigned()
: mlir::cast<mlir::IntegerType>(type).isUnsigned();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to check both CIR and LLVM types? If you get the type from the adaptor you only need to check the LLVM one? I see the same happens for cir::BinOpKind::{Div,Rem} but since you are here probably clean up that as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I was confused why we check mlir::IntegerType too, now it sounds like it might be just historical. I'll clean it up.

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.

2 participants