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][Lowering] Add MLIR lowering support for CIR cos operations #565

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

zhoujingya
Copy link
Contributor

@zhoujingya zhoujingya commented Apr 25, 2024

#563 This PR add cir.cos lowering to MLIR math dialect, now it only surpport single and double float types, I add an assertation for the long double and other unimplemented types

Signed-off-by: zhoujing <jing.zhou@terapines.com>
Signed-off-by: zhoujing <jing.zhou@terapines.com>
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Thanks for you first contributions! LGTM

@bcardosolopes bcardosolopes merged commit d68fd8e into llvm:main Apr 25, 2024
6 checks passed
@@ -153,6 +166,11 @@ class CIRConstantOpLowering
if (mlir::isa<mlir::cir::BoolType>(op.getType())) {
auto boolValue = mlir::cast<mlir::cir::BoolAttr>(op.getValue());
value = rewriter.getIntegerAttr(ty, boolValue.getValue());
} else if (op.getType().isa<mlir::cir::CIRFPTypeInterface>()) {
assert(ty.isF32() || ty.isF64() && "NYI");
Copy link
Member

Choose a reason for hiding this comment

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

I missed this before I merged. During the lowering passes, you should return mlir::failure() for these instead, since it provides a more clean error message. If you could address that in another PR it'd be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, @bcardosolopes I will do that in next PR

bcardosolopes pushed a commit that referenced this pull request Apr 26, 2024
Add left long double types lowering for cos operation #565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Apr 29, 2024
#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Apr 29, 2024
Add left long double types lowering for cos operation #565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Apr 29, 2024
#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Apr 29, 2024
Add left long double types lowering for cos operation #565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Apr 29, 2024
#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Apr 29, 2024
Add left long double types lowering for cos operation #565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
…m#565)

llvm#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
…m#568)

Add left long double types lowering for cos operation llvm#565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
…m#565)

llvm#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
…m#568)

Add left long double types lowering for cos operation llvm#565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
…m#565)

llvm#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
…m#568)

Add left long double types lowering for cos operation llvm#565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Nov 5, 2024
#563 This PR add cir.cos lowering to MLIR math dialect, now it only
surpport single and double float types, I add an assertation for the
long double and other unimplemented types

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
lanza pushed a commit that referenced this pull request Nov 5, 2024
Add left long double types lowering for cos operation #565

---------

Signed-off-by: zhoujing <jing.zhou@terapines.com>
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