-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[mlir][llvm] Add icmp folder #65343
[mlir][llvm] Add icmp folder #65343
Conversation
This revision adds a simple icmp folder that performs the following folds to the LLVM dialect icmp op: - cmpi(eq/ne, x, x) -> true/false - cmpi(eq/ne, alloca, null) -> false/true - cmpi(eq/ne, null, alloca) -> cmpi(eq/ne, alloca, null)
Looks good! Since you've gone through the effort of making this work with vector types as well, could you add at least one test that uses vector input types? |
and update constant materialization to support vectors.
Good point, the constant materialization did indeed not support vectors! |
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.
LGTM!
/// Returns a scalar or vector boolean attribute of the given type. | ||
static Attribute getBoolAttribute(Type type, MLIRContext *ctx, bool value) { | ||
auto boolAttr = BoolAttr::get(ctx, value); | ||
ShapedType shapedType = llvm::dyn_cast_or_null<ShapedType>(type); |
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.
ShapedType shapedType = llvm::dyn_cast_or_null<ShapedType>(type); | |
ShapedType shapedType = dyn_cast<ShapedType>(type); |
Please don't use subscribers teams to request reviews |
Could you elaborate what you mean? These are added automatically as they are code-owners of changed files. Isn't the intent of these teams being code-owners that they are automatically added as reviewers and members therefore notified? |
This revision adds a simple icmp folder that performs the following folds to the LLVM dialect icmp op: - cmpi(eq/ne, x, x) -> true/false - cmpi(eq/ne, alloca, null) -> false/true - cmpi(eq/ne, null, alloca) -> cmpi(eq/ne, alloca, null)
This revision adds a simple icmp folder that performs the following folds to the LLVM dialect icmp op: