<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - More registers are used when multiple target regions are compiled together"
href="https://bugs.llvm.org/show_bug.cgi?id=46450">46450</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>More registers are used when multiple target regions are compiled together
</td>
</tr>
<tr>
<th>Product</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Clang Compiler Support
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>xw111luoye@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>I initially spotted this issue with AOMP but it seems from upstream clang.
<a href="https://github.com/ROCm-Developer-Tools/aomp/issues/24">https://github.com/ROCm-Developer-Tools/aomp/issues/24</a>
reproducer:
git clone <a href="https://github.com/ye-luo/miniqmc">https://github.com/ye-luo/miniqmc</a>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>