1. Dec 15, 2023
    • Jon Roelofs's avatar
      [𝘀𝗽𝗿] changes introduced through rebase · b72edea2
      Jon Roelofs authored
      Created using spr 1.3.4
      
      [skip ci]
      b72edea2
    • Jon Roelofs's avatar
      [𝘀𝗽𝗿] changes introduced through rebase · 72bebd22
      Jon Roelofs authored
      Created using spr 1.3.4
      
      [skip ci]
      72bebd22
    • Vitaly Buka's avatar
      36477f75
    • David Spickett's avatar
      [lldb] Remove PopPlan asserts and skip test on Arm/AArch64 Linux · 1bce61e6
      David Spickett authored
      This reverts commit 481bb62e and
      71b4d749, along with the logging
      and assert I had added to the test previously.
      
      Now that I've caught it failing on Arm:
      https://lab.llvm.org/buildbot/#/builders/17/builds/46598
      
      Now I have enough to investigate, skip the test on the effected
      platforms while I do that.
      1bce61e6
    • Zequan Wu's avatar
      [Profile] Add binary profile correlation for code coverage. (#69493) · ab3430f8
      Zequan Wu authored
      ## Motivation
      Since we don't need the metadata sections at runtime, we can somehow
      offload them from memory at runtime. Initially, I explored [debug info
      correlation](https://discourse.llvm.org/t/instrprofiling-lightweight-instrumentation/59113),
      which is used for PGO with value profiling disabled. However, it
      currently only works with DWARF and it's be hard to add such artificial
      debug info for every function in to CodeView which is used on Windows.
      So, offloading profile metadata sections at runtime seems to be a
      platform independent option.
      
      ## Design
      The idea is to use new section names for profile name and data sections
      and mark them as metadata sections. Under this mode, the new sections
      are non-SHF_ALLOC in ELF. So, they are not loaded into memory at runtime
      and can be stripped away as a post-linking step. After the process
      exits, the generated raw profiles will contains only headers + counters.
      llvm-profdata can be used correlate raw profiles with the unstripped
      binary to generate indexed profile.
      
      ## Data
      For chromium base_unittests with code coverage on linux, the binary size
      overhead due to instrumentation reduced from 64M to 38.8M (39.4%) and
      the raw profile files size reduce from 128M to 68M (46.9%)
      ```
      $ bloaty out/cov/base_unittests.stripped -- out/no-cov/base_unittests.stripped
          FILE SIZE        VM SIZE
       --------------  --------------
        +121% +30.4Mi  +121% +30.4Mi    .text
        [NEW] +14.6Mi  [NEW] +14.6Mi    __llvm_prf_data
        [NEW] +10.6Mi  [NEW] +10.6Mi    __llvm_prf_names
        [NEW] +5.86Mi  [NEW] +5.86Mi    __llvm_prf_cnts
         +95% +1.75Mi   +95% +1.75Mi    .eh_frame
        +108%  +400Ki  +108%  +400Ki    .eh_frame_hdr
        +9.5%  +211Ki  +9.5%  +211Ki    .rela.dyn
        +9.2% +95.0Ki  +9.2% +95.0Ki    .data.rel.ro
        +5.0% +87.3Ki  +5.0% +87.3Ki    .rodata
        [ = ]       0   +13% +47.0Ki    .bss
         +40% +1.78Ki   +40% +1.78Ki    .got
         +12% +1.49Ki   +12% +1.49Ki    .gcc_except_table
        [ = ]       0   +65% +1.23Ki    .relro_padding
         +62% +1.20Ki  [ = ]       0    [Unmapped]
         +13%    +448   +19%    +448    .init_array
        +8.8%    +192  [ = ]       0    [ELF Section Headers]
        +0.0%    +136  +0.0%     +80    [7 Others]
        +0.1%     +96  +0.1%     +96    .dynsym
        +1.2%     +96  +1.2%     +96    .rela.plt
        +1.5%     +80  +1.2%     +64    .plt
        [ = ]       0 -99.2% -3.68Ki    [LOAD #5 [RW]]
        +195% +64.0Mi  +194% +64.0Mi    TOTAL
      $ bloaty out/cov-cor/base_unittests.stripped -- out/no-cov/base_unittests.stripped
          FILE SIZE        VM SIZE
       --------------  --------------
        +121% +30.4Mi  +121% +30.4Mi    .text
        [NEW] +5.86Mi  [NEW] +5.86Mi    __llvm_prf_cnts
         +95% +1.75Mi   +95% +1.75Mi    .eh_frame
        +108%  +400Ki  +108%  +400Ki    .eh_frame_hdr
        +9.5%  +211Ki  +9.5%  +211Ki    .rela.dyn
        +9.2% +95.0Ki  +9.2% +95.0Ki    .data.rel.ro
        +5.0% +87.3Ki  +5.0% +87.3Ki    .rodata
        [ = ]       0   +13% +47.0Ki    .bss
         +40% +1.78Ki   +40% +1.78Ki    .got
         +12% +1.49Ki   +12% +1.49Ki    .gcc_except_table
         +13%    +448   +19%    +448    .init_array
        +0.1%     +96  +0.1%     +96    .dynsym
        +1.2%     +96  +1.2%     +96    .rela.plt
        +1.2%     +64  +1.2%     +64    .plt
        +2.9%     +64  [ = ]       0    [ELF Section Headers]
        +0.0%     +40  +0.0%     +40    .data
        +1.2%     +32  +1.2%     +32    .got.plt
        +0.0%     +24  +0.0%      +8    [5 Others]
        [ = ]       0 -22.9%    -872    [LOAD #5 [RW]]
       -74.5% -1.44Ki  [ = ]       0    [Unmapped]
        [ = ]       0 -76.5% -1.45Ki    .relro_padding
        +118% +38.8Mi  +117% +38.8Mi    TOTAL
      ```
      
      A few things to note:
      1. llvm-profdata doesn't support filter raw profiles by binary id yet,
      so when a raw profile doesn't belongs to the binary being digested by
      llvm-profdata, merging will fail. Once this is implemented,
      llvm-profdata should be able to only merge raw profiles with the same
      binary id as the binary and discard the rest (with mismatched/missing
      binary id). The workflow I have in mind is to have scripts invoke
      llvm-profdata to get all binary ids for all raw profiles, and
      selectively choose the raw pnrofiles with matching binary id and the
      binary to llvm-profdata for merging.
      2. Note: In COFF, currently they are still loaded into memory but not
      used. I didn't do it in this patch because I noticed that `.lcovmap` and
      `.lcovfunc` are loaded into memory. A separate patch will address it.
      3. This should works with PGO when value profiling is disabled as debug
      info correlation currently doing, though I haven't tested this yet.
      ab3430f8
    • Vitaly Buka's avatar
      7e15fa91
    • Kevin Frei's avatar
      Fix a crash from character type confusion interaction with libedit (#75388) · 0544c781
      Kevin Frei authored
      
      
      If you type `settings show <tab>` LLDB might crash, depending on the
      version of libedit you're compiled with, and whether you're compiled
      with `-DLLDB_EDITLINE_USE_WCHAR=0` (and depending on how the optimizer
      lays out the stack...)
      
      The issue has to do with trying to figure out whether the libedit
      `getchar` callback is supposed to read a wide or 8 bit character. In
      order to maintain backward compatibility, there's really no 'clean' way
      to do it. We just have to make sure that we're invoking el_[w]getc with
      a buffer that is as wide as the getchar callback (registered by the
      `SetGetCharacterFunction` function further down in `Editline.cpp`.
      
      So, it's 'fixed' with a comment, and a wider version of the 'reply'
      variable.
      
      Co-authored-by: default avatarKevin Frei <freik@meta.com>
      0544c781
    • Fangrui Song's avatar
      [Sema] atomic_compare_exchange: check failure memory order (#74959) · fed56443
      Fangrui Song authored
      For
      
      `__atomic_compare_exchange{,_n}/__c11_atomic_compare_exchange_{strong,weak}`,
      GCC checks both the success memory order and the failure memory order
      under the default -Winvalid-memory-model ("memory model" is confusing
      here and "memory order" is much more common in the atomic context).
      
      * The failure memory order, if a constant, must be one of
        relaxed/consume/acquire/seq_cst.
      
      Clang checks just the success memory order under the default
      -Watomic-memory-ordering. This patch checks the failure memory order.
      fed56443
    • Fabian Mora's avatar
      [mlir][gpu] Fix crash in `gpu-module-to-binary` (#75477) · 419c45a3
      Fabian Mora authored
      This patch fixes the error in issue #75434. The crash was being caused
      by not checking for a lack of target attributes in a GPU module. It's
      now considered an error to invoke the pass with a GPU module with no
      target attributes.
      419c45a3
    • Aart Bik's avatar
    • Jon Roelofs's avatar
      [𝘀𝗽𝗿] changes introduced through rebase · f47afd07
      Jon Roelofs authored
      Created using spr 1.3.4
      
      [skip ci]
      f47afd07
    • Yinying Li's avatar
      [mlir][print]Add functions for printing memref f16/bf16/i16 (#75094) · 7bc6c4ab
      Yinying Li authored
      1. Added functions for printMemrefI16/f16/bf16.
      2. Added a new integration test for all the printMemref functions.
      7bc6c4ab
    • Mirko Brkusanin's avatar
      [AMDGPU][NFC] Regenerate .mir test · c6351b4c
      Mirko Brkusanin authored
      c6351b4c
    • Arthur Eubanks's avatar
      Reland [X86] Respect code models more when determining if a global reference... · ec92d74a
      Arthur Eubanks authored
      Reland [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386)
      
      For non-GlobalValue references, the small and medium code models can use
      32 bit constants.
      
      For GlobalValue references, use TargetMachine::isLargeGlobalObject().
      Look through aliases for determining if a GlobalValue is small or large.
      Even the large code model can reference small objects with 32 bit
      constants as long as we're in no-pic mode, or if the reference is offset
      from the GOT.
      
      Original commit broke the build...
      ec92d74a
    • David Blaikie's avatar
      Revert "[ADT][StringMap] Add ability to precompute and reuse the string hash" · f976719f
      David Blaikie authored
      Crash identified internally in lld's use of StringMap in
      `compareSections`. Will investigate offline before recommitting.
      
      This reverts commit 67c631d2.
      f976719f
    • David Blaikie's avatar
      Revert "lldb: Cache string hash during ConstString pool queries/insertions" · 5bc1adff
      David Blaikie authored
      Underlying StringMap API for providing a hash has caused some problems
      (observed a crash in lld) - so reverting this until I can figure out/fix
      what's going on there.
      
      This reverts commit 52ba0755.
      This reverts commit 2e197602.
      5bc1adff
    • Philip Reames's avatar
    • Arthur Eubanks's avatar
      Revert "[X86] Respect code models more when determining if a global reference... · f0c03da6
      Arthur Eubanks authored
      Revert "[X86] Respect code models more when determining if a global reference can fit in 32 bits" (#75500)
      
      Reverts llvm/llvm-project#75386
      
      Breaks build.
      f0c03da6
    • Simon Pilgrim's avatar
      [X86] combineLoad - allow constant loads to share matching 'lower constant... · 88f1a2c5
      Simon Pilgrim authored
      [X86] combineLoad - allow constant loads to share matching 'lower constant bits' with larger VBROADCAST_LOAD/SUBV_BROADCAST_LOAD nodes
      
      We already had separate support for VBROADCAST_LOAD - merge this with the generic load handling and add SUBV_BROADCAST_LOAD support as well.
      88f1a2c5
    • Arthur Eubanks's avatar
      [X86] Respect code models more when determining if a global reference can fit in 32 bits (#75386) · 5e38ba26
      Arthur Eubanks authored
      For non-GlobalValue references, the small and medium code models can use
      32 bit constants.
      
      For GlobalValue references, use TargetMachine::isLargeGlobalObject().
      Look through aliases for determining if a GlobalValue is small or large.
      Even the large code model can reference small objects with 32 bit
      constants as long as we're in no-pic mode, or if the reference is offset
      from the GOT.
      5e38ba26
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang] Add genEval to the AbstractConverter (#75140) · fedc54bf
      There was some discussion on discourse[1] about allowing call to FIR
      generation functions from other part of lowering belonging to OpenMP.
      
      This solution exposes a simple `genEval` member function on the
      `AbstractConverter` so that IR generation for PFT Evaluation objects can
      be called from lowering outside of the FirConverter but not exposing it.
      
      [1] https://discourse.llvm.org/t/openmp-lowering-from-pft-to-fir/75263
      fedc54bf
    • Krzysztof Parzyszek's avatar
      [flang][OpenMP] Avoid unnecessary init loop, use constructor instead,… (#75482) · 9cf9721d
      Krzysztof Parzyszek authored
      … NFC
      
      SmallVector has a constructor that fills it with a number of copies of a
      given value. Use it instead of a loop that does the same thing.
      9cf9721d
    • Juergen Ributzka's avatar
      [clang][modules] Strip LLVM options (#75405) · e007551b
      Juergen Ributzka authored
      Currently, the dep scanner does not remove LLVM options from the
      argument list.
      Since LLVM options shouldn't affect the AST, it is safe to remove them
      all.
      e007551b
    • Jerry Wu's avatar
      [mlir] Fix type transformation in DropUnitDimFromElementwiseOps (#75430) · 2c9ba9c3
      Jerry Wu authored
      Use operand and result types to build the corresponding new types in
      `DropUnitDimFromElementwiseOps`.
      2c9ba9c3
    • paperchalice's avatar
      [StandardInstrumentations] add `unwrapIR` to simplify code NFCI (#75474) · 726830f8
      paperchalice authored
      Use pointer to represent semantic of `optional`.
      726830f8
    • Philip Reames's avatar
    • Joseph Huber's avatar
      [Libomptarget] Move ELF symbol extraction to the ELF utility (#74717) · 0ab663d2
      Joseph Huber authored
      Summary:
      We shouldn't have the format specific ELF handling in the generic plugin
      manager. This patch moves that out of the implementation and into the
      ELF utilities. This patch changes the SHT_NOBITS case to be a hard
      error, which should be correct as the existing use already seemed to
      return an error if the result was a null pointer.
      
      This also uses a `const_cast`, which is bad practice. However,
      rebuilding the `constness` of all of this would be a massive overhaul,
      and this matches the previous behaviour (We would take a pointer to the
      image that is most likely read-only in the ELF).
      0ab663d2
    • Philip Reames's avatar
      1fdbdb84
    • David Spickett's avatar
      [lldb] Fixup PopPlan assert · 71b4d749
      David Spickett authored
      Fixes 481bb62e.
      71b4d749
    • David Spickett's avatar
      [lldb] Assert immediately prior to calling PopPlan · 481bb62e
      David Spickett authored
      This is part of ongoing attempts to catch the test from
      2684281d failing on Arm and AArch64.
      
      I did get logs for the failure but only on Arm, where the backtrace is
      truncated. So, let's do the assert that PopPlan was going to do,
      before we call it.
      
      Then I should know exactly which PopPlan is asserting.
      
      Technically I should take a mutex here, but technically I shouldn't
      be debugging via buildbot, so I'm going to take the risk temporarily.
      481bb62e
    • Shih-Po Hung's avatar
      [VPlan] Implement mayHaveSideEffects/mayWriteToMemory for VPInterleav… (#71360) · 3d422a98
      Shih-Po Hung authored
      …eRecipe
      
      This helps VPlanTransforms::removeDeadRecipes to work on
      VPInterleaveRecipe
      3d422a98
    • Felipe de Azevedo Piovezan's avatar
      [InstrRef][nfc] Remove usage of unique_ptrs of arrays (#74203) · 1b531d54
      Felipe de Azevedo Piovezan authored
      These are usually difficult to reason about, and they were being used to
      pass raw pointers around with array semantic (i.e., we were using
      operator [] on raw pointers). To put it in InstrRef terminology: we were
      passing a pointer to a ValueTable but using it as if it were a
      FuncValueTable.
      
      These could have easily been SmallVectors, which now allow us to have
      reference semantics in some places, as well as simpler initialization.
      
      In the future, we can use even more pass-by-reference with some extra
      changes in the code.
      1b531d54
    • David Spickett's avatar
      [llvm][llvm-exegesis] Fix unused private field warning on Windows · 0d02ecc6
      David Spickett authored
      ```
      [5323/5730] Building CXX object tools\llvm-exegesis\lib\CMakeFiles\LLVMExegesis.dir\Error.cpp.obj
      In file included from C:\Work\david.spickett\llvm-project\llvm\tools\llvm-exegesis\lib\Error.cpp:9:
      C:\Work\david.spickett\llvm-project\llvm\tools\llvm-exegesis\lib/Error.h(76,7): warning: private field 'SignalNumber' is not used [-Wunused-private-field]
         76 |   int SignalNumber;
            |       ^
      ```
      
      `SignalNumber` was only being used on Unixes.
      0d02ecc6
  2. Dec 14, 2023