-
Notifications
You must be signed in to change notification settings - Fork 768
[NFCI][SYCL] Refactor selection of FP builtin calls #16966
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
Conversation
This is an upstream from a closed source repository. Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
Can we please add some details about this change in the PR description? Thanks |
Can you please comment on why we do not have any tests added here? Thanks |
}; | ||
|
||
FPBuiltinReplacement(Kind K, const StringRef &ImplName = StringRef()) | ||
: RepKind(K), AltMathFunctionImplName(ImplName) { |
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.
Do we want to assign to AltMathFunctionImplName even if K is not set to ReplaceWithAltMathFunction?
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 think not. In this case we should to either error out or attempt to lower to standard to LLVM instructions/intrinsics or target specific intrinsics if applicable (like nvvm approx math intrinsics).
Thanks @asudarsa , going one by one for your questions
No as details exposes internal code, that we don't plan to upstream.
Because it's a refactoring (aka NFC change). The original patch contained tests, but they are exposing other customizations that we don't plan to upstream. |
return FPBuiltinReplacement(FPBuiltinReplacement::ReplaceWithLLVMIR); | ||
return FPBuiltinReplacement(FPBuiltinReplacement::Unexpected0dot5); | ||
} | ||
// AltMathLibrary don't have implementation for CUDA approximate precision |
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.
Just curious: Does 'Accuracy > 0.5' map to 'approximate precision'?
Thanks
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.
'Accuracy > 0.5' maps on 'not-precise'. Regarding if it maps on nvvm approx intrinsics/nvptx approx instruction - it depends on the operation and what ptx spec mandates.
More details is in the discussion with Joshua in #16714 .
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.
Overall looks good. Please address questions/comments as convenient.
Thanks
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. Thanks
@intel/llvm-gatekeepers please help with the merge |
This is an upstream from a closed source repository.
Co-author: Stasenko, Alexander P alexander.p.stasenko@intel.com