1. Oct 26, 2023
  2. Oct 25, 2023
    • Arseny Kapoulkine's avatar
      [Sema] -Wzero-as-null-pointer-constant: don't warn for __null (#69126) · cd29e19e
      Arseny Kapoulkine authored
      The implementation of -Wzero-as-null-pointer-constant was done before
      the following fix has been committed to GCC:
      
      https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=752e7593b0f19af233a0b7e72daab8413662b605;hp=298434c916c14e8adca2cab8a746aee29038c5b3
      
      As a result, clang and gcc diverge on the use of `__null` and,
      consequently, on the use of `NULL` on systems like Linux/macOS where
      `NULL` is defined as `__null`.
      
      This is a problem for compatibility between gcc and clang, particularly
      for code bases that support C++98 or for single-source libraries that
      are implemented in C, but compiled as C++ via inclusion into a C++
      translation unit. Code like this can not be changed to use `nullptr`, as
      it needs to maintain compatibility with C before C23 or C++ before
      C++11, but warns on the use of `NULL` in clang.
      
      The warning `Wzero-as-null-pointer-constant` is still useful with this
      change, as it allows to change `0` to `NULL`, which fixes
      gcc warnings and helps the reader distinguish between pointers and
      non-pointers. Users who require a full C++11 modernization pass can
      still use clang-tidy for that purpose.
      cd29e19e
    • Simon Pilgrim's avatar
      c9c9bf0f
    • Juergen Ributzka's avatar
      [llvm] Followup fix for "Use XMACROS for MachO platforms" (#70140) · 2d292ab8
      Juergen Ributzka authored
      Fix the use of tapi_target in getPlatformFromName.
      2d292ab8
    • Joseph Huber's avatar
      [OpenMP][Obvious] Fix incompatbile function prototype causing failures · 8a181f43
      Joseph Huber authored
      Summary:
      This function needs `void` as the arguments to be ABI compatbile with
      what is actually defined. This is enforced when doing CUDA separable
      linking of the runtime.
      8a181f43
    • Joseph Huber's avatar
      [LinkerWrapper][Obvious] Fix dangling stringref on Xcuda-ptxas options · 9bdeab1e
      Joseph Huber authored
      Summary:
      This accidentally was a dangling reference and caused issues when
      actually used. Make sure that the memory is saved before the job is
      created.
      9bdeab1e
    • bjacob's avatar
      Add missing `linalg.batch_vecmat` named op (#70218) · 8c8336fc
      bjacob authored
      Linalg currently has these named ops:
      * `matmul`
      * `matvec`
      * `vecmat`
      * `batch_matmul`
      * `batch_matvec`
      
      But it does not have:
      * `batch_vecmat`
      
      This PRs adds that for consistency, and I have a short-term need for it
      ( https://github.com/openxla/iree/issues/15158 ), so not having this
      would cause some contortion on my end.
      8c8336fc
    • Youngsuk Kim's avatar
      [clang] Remove redundant ptr-to-ptr bitcasts (NFC) · 8e00d59d
      Youngsuk Kim authored
      Remove redundant bitcasts performed on instances of
      `llvm::GlobalVariable`, which are pointers.
      
      Opaque pointer cleanup effort. NFC.
      8e00d59d
    • Aart Bik's avatar
      [mlir][sparse] update block24 example (#70145) · a12d057b
      Aart Bik authored
      Removes TODO, shows how to define 8-bit crd (lacking 2-bit for now)
      a12d057b
    • Kiran Chandramohan's avatar
      [MLIR][OpenMP] Use opaque pointers in OpenMP translation tests 2/2 (#70138) · bbab5e47
      Kiran Chandramohan authored
      Second half of the tests switching to opaque pointers. All are the
      target related tests.
      
      Removes mlir/test/Target/LLVMIR/openmp-reduction-typed-pointers.mlir,
      since this seems to be added to test the typed pointers and probably not
      needed anymore.
      bbab5e47
    • Nikita Popov's avatar
      [InstCombine] Rename some variables (NFC) · ea99df2e
      Nikita Popov authored
      Split NFC rename out from #69882.
      ea99df2e
    • David Stenberg's avatar
      [SelectionDAG] Salvage debug info for non-constant ADDs (2nd try) (#68981) · 22f12179
      David Stenberg authored
      
      
      Teach SelectionDAG::salvageDebugInfo() to salvage debug information for
      ADD nodes where the RHS is non-constant.
      
      In the first try, the test case used the MIR output that was produced by
      using -stop-before=sparc-isel. Running -start-before=sparc-isel on that
      output resulted in the following verifier error with EXPENSIVE_CHECKS:
      
        "Function has NoVRegs property but there are VReg operands".
      
      In this re-attempt the test case has been rewritten to a .ll test by
      extracting the IR from the original MIR file. The test still starts
      before sparc-isel.
      
      Co-authored-by: default avatarMikael Holmen <mikael.holmen@ericsson.com>
      22f12179
    • spupyrev's avatar
      [CodeLayout] Faster basic block reordering, ext-tsp (#68617) · cc2fbc64
      spupyrev authored
      Aggressive inlining might produce huge functions with >10K of basic 
      blocks. Since BFI treats _all_ blocks and jumps as "hot" having 
      non-negative (but perhaps small) weight, the current implementation can
      be slow, taking minutes to produce an layout. This change introduces a
      few modifications that significantly (up to 50x on some instances) 
      speeds up the computation. Some notable changes:
      - reduced the maximum chain size to 512 (from the prior 4096);
      - introduced MaxMergeDensityRatio param to avoid merging chains with
      very different densities;
      - dropped a couple of params that seem unnecessary.
      
      Looking at some "offline" metrics (e.g., the number of created 
      fall-throughs), there shouldn't be problems; in fact, I do see some
      metrics go up. But it might be hard/impossible to measure perf 
      difference for such small changes. I did test the performance clang-14 
      binary and do not record a perf or i-cache-related differences.
      
      My 5 benchmarks, with ext-tsp runtime (the lower the better) and 
      "tsp-score" (the higher the better).
      **Before**:
      
      - benchmark 1:
        num functions: 13,047
        reordering running time is 2.4 seconds
        score: 125503458 (128.3102%)
      - benchmark 2:
        num functions: 16,438
        reordering running time is 3.4 seconds
        score: 12613997277 (129.7495%)
      - benchmark 3:
        num functions: 12,359
        reordering running time is 1.9 seconds
        score: 1315881613 (105.8991%)
      - benchmark 4:
        num functions: 96,588
        reordering running time is 7.3 seconds
        score: 89513906284 (100.3413%)
      - benchmark 5:
        num functions: 1
        reordering running time is 372 seconds
        score: 21292505965077 (99.9979%)
      - benchmark 6:
        num functions:  71,155
        reordering running time is 314 seconds
        score: 29795381626270671437824 (102.7519%)
      
      **After**:
      - benchmark 1:
        reordering running time is 2.2 seconds
        score: 125510418 (128.3130%)
      
      - benchmark 2:
        reordering running time is 2.6 seconds
        score: 12614502162 (129.7525%)
      
      - benchmark 3:
        reordering running time is 1.6 seconds
        score: 1315938168 (105.9024%)
      
      - benchmark 4:
        reordering running time is 4.9 seconds
        score: 89518095837 (100.3454%)
      
      - benchmark 5:
        reordering running time is 4.8 seconds
        score: 21292295939119 (99.9971%)
      
      - benchmark 6:
        reordering running time is 104 seconds
        score: 29796710925310302879744 (102.7565%)
      cc2fbc64
    • Benjamin Kramer's avatar
      [bazel] Add missing dependency · 28a8f1b9
      Benjamin Kramer authored
      28a8f1b9
    • Benjamin Kramer's avatar
      [bazel] Port 078ae8cd · 08e76537
      Benjamin Kramer authored
      08e76537
    • Joseph Huber's avatar
      [OpenMP][Obvious] Fix function prototype when used in C mode · 84d8ace5
      Joseph Huber authored
      Summary:
      The `llvm_omp_target_dynamic_shared_alloc` prototype in `omp.h`
      accidentally left the void argument unspecified. This created unintended
      code when called from the C language, causing some `nvlink` failures in
      certain scenarios.
      84d8ace5