1. May 14, 2023
    • Sam James's avatar
      [cmake] Disable GCC lifetime DSE · 94f7c961
      Sam James authored
      LLVM data structures like llvm::User and llvm::MDNode rely on
      the value of object storage persisting beyond the lifetime of the
      object (#24952).  This is not standard compliant and causes a runtime
      crash if LLVM is built with GCC and LTO enabled (#57740).  Until
      these issues are fixed, we need to disable dead store eliminations
      eliminations based on object lifetime.
      
      Bug: https://github.com/llvm/llvm-project/issues/24952
      Bug: https://github.com/llvm/llvm-project/issues/57740
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106943
      
      Reviewed By: MaskRay, thesamesam, nikic
      
      Differential Revision: https://reviews.llvm.org/D150505
      94f7c961
    • Amir Ayupov's avatar
      [Clang][CMake] Use perf-training for Clang-BOLT · 76b2915f
      Amir Ayupov authored
      Leverage perf-training flow for BOLT profile collection, enabling reproducible
      BOLT optimization. Remove the use of bootstrapped build for profile collection.
      
      Test Plan:
      - Regular (single-stage) build
      ```
      $ cmake ... -C .../clang/cmake/caches/BOLT.cmake
      $ ninja clang-bolt
      ...
      [21/24] Instrumenting clang binary with BOLT
      [21/24] Generating BOLT profile for Clang
      [23/24] Merging BOLT fdata
      Profile from 2 files merged.
      [24/24] Optimizing Clang with BOLT
      ...
                1291202496 : executed instructions (-1.1%)
                  27005133 : taken branches (-71.5%)
      ...
      ```
      - Two stage build (ThinLTO+InstPGO)
      ```
      $ cmake ... -C .../clang/cmake/caches/BOLT.cmake -C .../clang/cmake/caches/BOLT-PGO.cmake
      $ ninja clang-bolt
      $ ninja stage2-clang-bolt
      ...
      [2756/2759] Instrumenting clang binary with BOLT
      [2756/2759] Generating BOLT profile for Clang
      [2758/2759] Merging BOLT fdata
      [2759/2759] Optimizing Clang with BOLT
      ...
      BOLT-INFO: 7092 out of 184104 functions in the binary (3.9%) have non-empty execution profile
                 756531927 : executed instructions (-0.5%)
                  15399400 : taken branches (-40.3%)
      ...
      ```
      
      Reviewed By: beanz
      
      Differential Revision: https://reviews.llvm.org/D143553
      76b2915f
  2. May 13, 2023