-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix for Issue #1413 #179
Fix for Issue #1413 #179
Conversation
|
||
TLI_DEFINE_VECFUNC("__rs_exp_1", "__rs_exp_4", FIXED(4)) | ||
TLI_DEFINE_VECFUNC("__rs_exp_1", "__rs_exp_8", FIXED(8)) | ||
|
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.
nit: exta empty line not needed
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.
addressed this.
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.
ping @bryanpkc
PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
46facfb
to
6214c2d
Compare
@shivaramaarao could you consider cherry picking this to the |
@@ -276,6 +277,10 @@ static TargetLibraryInfoImpl *createTLII(llvm::Triple &TargetTriple, | |||
case CodeGenOptions::PGMATH: | |||
TLII->addVectorizableFunctionsFromVecLib(TargetLibraryInfoImpl::PGMATH, | |||
TargetTriple); | |||
if (std::find(TargetOpts.Features.begin(), TargetOpts.Features.end(), "+avx512f") != TargetOpts.Features.end()) { | |||
TLII->addVectorizableFunctionsFromVecLib(TargetLibraryInfoImpl::PGMATH_AVX512, | |||
TargetTriple); |
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.
Can you run clang-format
on this diff?
@@ -584,7 +589,7 @@ bool EmitAssemblyHelper::AddEmitPasses(legacy::PassManager &CodeGenPasses, | |||
raw_pwrite_stream *DwoOS) { | |||
// Add LibraryInfo. | |||
std::unique_ptr<TargetLibraryInfoImpl> TLII( | |||
createTLII(TargetTriple, CodeGenOpts)); | |||
createTLII(TargetTriple, CodeGenOpts,TargetOpts)); |
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.
clang-format
.
|
||
TLI_DEFINE_VECFUNC("__rd_cosh_1", "__rd_cosh_2", FIXED(2)) | ||
TLI_DEFINE_VECFUNC("__rd_cosh_1", "__rd_cosh_4", FIXED(4)) | ||
TLI_DEFINE_VECFUNC("__rd_cosh_1", "__rd_cosh_8", FIXED(8)) | ||
|
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.
Unnecessary and inconsistent blank line.
Could you also please add a test case? |
TLI_DEFINE_VECFUNC("__fs_pow_1", "__fs_pow_16", FIXED(16)) | ||
TLI_DEFINE_VECFUNC("__pd_pow_1", "__pd_pow_8", FIXED(8)) | ||
TLI_DEFINE_VECFUNC("__ps_pow_1", "__ps_pow_16", FIXED(16)) | ||
TLI_DEFINE_VECFUNC("__rd_pow_1", "__rd_pow_8", FIXED(8)) |
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.
__rs_pow_1
is missing here.
TLI_DEFINE_VECFUNC("__ps_pow_1", "__ps_pow_16", FIXED(16)) | ||
TLI_DEFINE_VECFUNC("__rd_pow_1", "__rd_pow_8", FIXED(8)) | ||
TLI_DEFINE_VECFUNC("__fs_powi_1", "__fs_powi_16", FIXED(16)) | ||
|
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.
Incorrect grouping of lines.
TLI_DEFINE_VECFUNC("__rd_log_1", "__rd_log_8", FIXED(8)) | ||
TLI_DEFINE_VECFUNC("__rs_log_1", "__rs_log_16", FIXED(16)) | ||
|
||
TLI_DEFINE_VECFUNC("__fs_exp_1", "__fs_exp_16", FIXED(16)) |
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.
Why are __fd_exp_1
and __fd_exp_8
not supported?
#include "llvm/Analysis/VecFuncs.def" | ||
}; | ||
addVectorizableFunctions(VecFuncs); | ||
|
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.
Unnecessary blank line.
PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
…lang-compiler#185) PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
…lang-compiler#185) PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
…lang-compiler#185) PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
…lang-compiler#185) PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
…lang-compiler#185) PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.
PGMATH has AVX512 runtime functions and can be executed only when the application is compiled in avx512 mode. The VecFuncs.def has no information about the TargetOptions and avx512 functions are selected even in avx2 mode. This issue is fixed by creating separate table for AVX512 functions and using them only when avx512 mode is specified.