<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 - PostgreSQL-Support Profile Guide Optimization"
   href="https://bugs.llvm.org/show_bug.cgi?id=52089">52089</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>PostgreSQL-Support Profile Guide Optimization
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </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>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hpcresearch.mspk@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Followed the below steps on Profile Guide Optimization with Clang on Postgresql
13.3 Environment.
And test benchmark environment used HammedDB v4.2.

Build LLVM:
==========
 wget
<a href="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-12.0.1.tar.gz">https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-12.0.1.tar.gz</a>
 mkdir build_llvm
 cd build_llvm
 cmake ../llvm-project-llvmorg-12.0.1/llvm/ -DCMAKE_INSTALL_PREFIX=/home/llvm
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt"
 make -j8 && make -j8 install

 Build Postgres with LLVM-Clang:
 ==============================
 $ CC=clang CXX=clang++ ../configure --prefix=<path-to-install> CFLAGS='-O3 
-fprofile-instr-generate' CXXFLAGS='-O3  -std=c++14 -stdlib=libc++
-fprofile-instr-generate'  
2.Run HammerDB client(tpcc-schmea + test run(vu's).  
3. default.profraw created in  PostgreSQL(<path-to-install>)
4.  convert the “raw” profile format by clang.(the merge
command:llvm-profdata tool) 
5. llvm-profdata merge -output=code.profdata code- default.profraw 
warning: default.profraw: Failed to uncompress data (zlib)
 error: No profiles could be merged.(step5)

We have done similar exercise with GCC, it is working there. Checked with
Postgres team and their response:
"I see no reason to believe that this is Postgres' problem to fix.
Try filing a bug with the Clang people."

Reference Link: 
<a href="https://www.postgresql.org/message-id/17200-d5d5c376327f7197@postgresql.org">https://www.postgresql.org/message-id/17200-d5d5c376327f7197@postgresql.org</a>
<a href="https://www.postgresql.org/message-id/2834314.1632836376%40sss.pgh.pa.us">https://www.postgresql.org/message-id/2834314.1632836376%40sss.pgh.pa.us</a></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>