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

Fix for Issue #1413 #179

Merged
merged 1 commit into from
May 14, 2024
Merged

Fix for Issue #1413 #179

merged 1 commit into from
May 14, 2024

Conversation

shivaramaarao
Copy link
Collaborator

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.


TLI_DEFINE_VECFUNC("__rs_exp_1", "__rs_exp_4", FIXED(4))
TLI_DEFINE_VECFUNC("__rs_exp_1", "__rs_exp_8", FIXED(8))

Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed this.

Copy link
Collaborator Author

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.
@pawosm-arm pawosm-arm merged commit 311671a into release_17x May 14, 2024
12 checks passed
@pawosm-arm
Copy link
Collaborator

@shivaramaarao could you consider cherry picking this to the release_18x branch?

@@ -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);
Copy link
Collaborator

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));
Copy link
Collaborator

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))

Copy link
Collaborator

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.

@bryanpkc
Copy link
Collaborator

Could you also please add a test case?

@shivaramaarao shivaramaarao deleted the shivaram_fix1413 branch June 26, 2024 14:05
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))
Copy link
Collaborator

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))

Copy link
Collaborator

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))
Copy link
Collaborator

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);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unnecessary blank line.

shivaramaarao added a commit that referenced this pull request Aug 11, 2024
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.
shivaramaarao added a commit that referenced this pull request Aug 12, 2024
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.
shivaramaarao added a commit that referenced this pull request Aug 13, 2024
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.
bryanpkc pushed a commit to Huawei-CPLLab/classic-flang-llvm-project that referenced this pull request Sep 19, 2024
…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.
bryanpkc pushed a commit to Huawei-CPLLab/classic-flang-llvm-project that referenced this pull request Sep 19, 2024
…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.
bryanpkc pushed a commit to Huawei-CPLLab/classic-flang-llvm-project that referenced this pull request Sep 25, 2024
…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.
bryanpkc pushed a commit to Huawei-CPLLab/classic-flang-llvm-project that referenced this pull request Sep 26, 2024
…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.
bryanpkc pushed a commit to Huawei-CPLLab/classic-flang-llvm-project that referenced this pull request Oct 2, 2024
…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.
bryanpkc pushed a commit that referenced this pull request Oct 14, 2024
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.
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.

3 participants