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

More registers are used when multiple target regions are compiled together #45795

Closed
ye-luo opened this issue Jun 25, 2020 · 2 comments
Closed
Labels
bugzilla Issues migrated from bugzilla openmp

Comments

@ye-luo
Copy link
Contributor

ye-luo commented Jun 25, 2020

Bugzilla Link 46450
Resolution FIXED
Resolved on Jul 14, 2020 20:39
Version unspecified
OS Linux
CC @hfinkel,@jdoerfert

Extended Description

I initially spotted this issue with AOMP but it seems from upstream clang.
ROCm/aomp#24

reproducer:
git clone https://github.com/ye-luo/miniqmc
cd miniqmc/build
cmake -DCMAKE_CXX_COMPILER=clang++ -DENABLE_OFFLOAD=ON
-DUSE_OBJECT_TARGET=ON -DCMAKE_EXE_LINKER_FLAGS="-v" ..
make -j32 check_spo_batched

all the 6 kernels use 254 registers.

Then I comment out "target teams" at 159, 311, 405.
make -j32 check_spo_batched
now all the 3 kernels left use 243 registers.

If I add
-DCMAKE_CXX_FLAGS="-Xcuda-ptxas -v" to cmake and print out register usage reported by ptxas. The three kernels take 146, 30, 30 registers when compiled.

I think the register usage is fine when kernels are compiled individually.
Somehow at linking, all the assembled kernels get the worst register usage among all the individual kernels.

It destroys performance completely.

@ye-luo
Copy link
Contributor Author

ye-luo commented Jun 25, 2020

Forgot to say, these line numbers 159, 311, 405 refers to source file src/QMCWaveFunctions/einspline_spo_omp.cpp

@jdoerfert
Copy link
Member

Partially resolved with 5b0581a and D83832. For better automatic results we need LTO. I'll mark this as fixed for now as the original issue is gone (I think).

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla openmp
Projects
None yet
Development

No branches or pull requests

2 participants