-
Notifications
You must be signed in to change notification settings - Fork 100
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
Conversation
Signed-off-by: zhoujing <jing.zhou@terapines.com>
Signed-off-by: zhoujing <jing.zhou@terapines.com>
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.
Thanks for you first contributions! LGTM
@@ -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"); |
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 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.
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.
OK, @bcardosolopes I will do that in next PR
Add left long double types lowering for cos operation #565 --------- Signed-off-by: zhoujing <jing.zhou@terapines.com>
#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>
Add left long double types lowering for cos operation #565 --------- Signed-off-by: zhoujing <jing.zhou@terapines.com>
#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>
Add left long double types lowering for cos operation #565 --------- Signed-off-by: zhoujing <jing.zhou@terapines.com>
#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>
Add left long double types lowering for cos operation #565 --------- Signed-off-by: zhoujing <jing.zhou@terapines.com>
#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>
Add left long double types lowering for cos operation #565 --------- Signed-off-by: zhoujing <jing.zhou@terapines.com>
#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