Skip to content

[CIR][CIRGen] handle __builtin_elementwise_acos #1362

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

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

FantasqueX
Copy link
Collaborator

@FantasqueX FantasqueX commented Feb 16, 2025

Traditional Clang implementation:

case Builtin::BI__builtin_elementwise_acos:
return RValue::get(emitBuiltinWithOneOverloadedType<1>(
*this, E, llvm::Intrinsic::acos, "elt.acos"));

I use the first argument type as the return type. It is OK for __builtin_elementwise_acos, however, I'm not sure it is OK for other builtin functions.

Resolves: #1361

@FantasqueX
Copy link
Collaborator Author

Since there is no LLVM_ACosOp in MLIR LLVM Dialect, I just use LLVMIntrinsicCallOp
Maybe wait for llvm/llvm-project#127317?

Copy link
Member

@Lancern Lancern left a comment

Choose a reason for hiding this comment

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

LGTM

@bcardosolopes
Copy link
Member

Since there is no LLVM_ACosOp in MLIR LLVM Dialect, I just use LLVMIntrinsicCallOp Maybe wait for llvm/llvm-project#127317?

@FantasqueX Just landed it for you over there, let's stay with this one for now, once we rebase next you can update, how about that? Can you file an issue so we don't forget about it?

@bcardosolopes bcardosolopes merged commit dbe544d into llvm:main Feb 19, 2025
6 checks passed
lanza pushed a commit that referenced this pull request Mar 18, 2025
Traditional Clang implementation:
https://github.com/llvm/clangir/blob/a0091e38f1027e35d17819e02ee1ae257a12d296/clang/lib/CodeGen/CGBuiltin.cpp#L4116-L4118

I use the first argument type as the return type. It is OK for
`__builtin_elementwise_acos`, however, I'm not sure it is OK for other
builtin functions.

Resolves: #1361
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.

CIRGen support for __builtin_elementwise_acos
3 participants