1. Apr 28, 2024
    • Krzysztof Parzyszek's avatar
    • Florian Hahn's avatar
      [LV] Consider all exit branch conditions uniform. · b6a8f548
      Florian Hahn authored
      If we vectorize a loop with multiple exits, all exiting branches should
      be considered uniform, as the resulting loop will be controlled by the
      canonical IV only. Previously we were overestimating the cost of values
      contributing to the other exits.
      b6a8f548
    • Mark de Wever's avatar
      [libc++][modules] Enable installation by default. (#90094) · 19d2d3fe
      Mark de Wever authored
      This was suggested during the review of
      https://github.com/llvm/llvm-project/pull/89413
      
      This does not change the experimental state of modules.
      19d2d3fe
    • Kiran Chandramohan's avatar
      [Flang][OpenMP] Remove deprecated FIR lowering tests (#90188) · 46321395
      Kiran Chandramohan authored
      Remove OpenMP FIR lowering tests. These are now replaced by HLFIR based
      tests. This might hopefully speedup testing as well.
      46321395
    • Joseph Huber's avatar
      bfd269d0
    • Chuanqi Xu's avatar
      [NFC] [Modules] Avoid scanning the stored decl list twice when replace · 367efa0b
      Chuanqi Xu authored
      external decls
      
      This patch fixes a FIXME in StoredDeclList::replaceExternalDecls.
      
      StoredDeclList::replaceExternalDecls will iterate the list first to
      remove some declarations and iterate the list again to get the tail of
      the list.
      
      It should be better to avoid the second iterations.
      367efa0b
    • Mark de Wever's avatar
      [libc++][format] Improves escaping performance. (#88533) · e3dea5e3
      Mark de Wever authored
      The previous patch implemented
      - P2713R1 Escaping improvements in std::format
      - LWG3965 Incorrect example in [format.string.escaped] p3 for formatting
      of combining characters
      
      These changes were correct, but had a size and performance penalty. This
      patch improves the size and performance of the previous patch. The
      performance is still worse than before since the lookups may require two
      property lookups instead of one before implementing the paper. The
      changes give a tighter coupling between the Unicode data and the
      algorithm. Additional tests are added to notify about changes in future
      Unicode updates.
      
      Before
      ```
      -----------------------------------------------------------------------
      Benchmark                             Time             CPU   Iterations
      -----------------------------------------------------------------------
      BM_ascii_escaped<char>           110704 ns       110696 ns         6206
      BM_unicode_escaped<char>         101371 ns       101374 ns         6862
      BM_cyrillic_escaped<char>         63329 ns        63327 ns        11013
      BM_japanese_escaped<char>         41223 ns        41225 ns        16938
      BM_emoji_escaped<char>           111022 ns       111021 ns         6304
      BM_ascii_escaped<wchar_t>        112441 ns       112443 ns         6231
      BM_unicode_escaped<wchar_t>      102776 ns       102779 ns         6813
      BM_cyrillic_escaped<wchar_t>      58977 ns        58975 ns        11868
      BM_japanese_escaped<wchar_t>      36885 ns        36886 ns        18975
      BM_emoji_escaped<wchar_t>        115885 ns       115881 ns         6051
      ```
      
      The first change is to manually encode the entire last area and make a
      manual exception for the 240 excluded entries. This reduced the table
      from 1077 to 729 entries and gave the following benchmark results.
      ```
      -----------------------------------------------------------------------
      Benchmark                             Time             CPU   Iterations
      -----------------------------------------------------------------------
      BM_ascii_escaped<char>           104777 ns       104776 ns         6550
      BM_unicode_escaped<char>          96980 ns        96982 ns         7238
      BM_cyrillic_escaped<char>         60254 ns        60251 ns        11670
      BM_japanese_escaped<char>         44452 ns        44452 ns        15734
      BM_emoji_escaped<char>           104557 ns       104551 ns         6685
      BM_ascii_escaped<wchar_t>        107456 ns       107454 ns         6505
      BM_unicode_escaped<wchar_t>       96219 ns        96216 ns         7301
      BM_cyrillic_escaped<wchar_t>      56921 ns        56904 ns        12288
      BM_japanese_escaped<wchar_t>      39530 ns        39529 ns        17492
      BM_emoji_escaped<wchar_t>        108494 ns       108496 ns         6408
      ```
      
      An entry in the table can only contain 2048 code points. For larger
      ranges there are multiple entries split in chunks with a maximum size of
      2048 entries. To encode the entire Unicode code point range 21 bits are
      required. The manual part starts at 0x323B0 this means all entries in
      the table fit in 18 bits. This allows to allocate 3 additional bits for
      the range. This allows entries to have 16384 elements. This range always
      avoids splitting the range in multiple chunks.
      
      This reduces the number of table elements from 729 to 711 and gives the
      following benchmark results.
      ```
      -----------------------------------------------------------------------
      Benchmark                             Time             CPU   Iterations
      -----------------------------------------------------------------------
      BM_ascii_escaped<char>           104289 ns       104289 ns         6619
      BM_unicode_escaped<char>          96682 ns        96681 ns         7215
      BM_cyrillic_escaped<char>         59673 ns        59673 ns        11732
      BM_japanese_escaped<char>         41983 ns        41982 ns        16646
      BM_emoji_escaped<char>           104119 ns       104120 ns         6683
      BM_ascii_escaped<wchar_t>        104503 ns       104505 ns         6693
      BM_unicode_escaped<wchar_t>       93426 ns        93423 ns         7489
      BM_cyrillic_escaped<wchar_t>      54858 ns        54859 ns        12742
      BM_japanese_escaped<wchar_t>      36385 ns        36384 ns        19259
      BM_emoji_escaped<wchar_t>        105608 ns       105610 ns         6592
      ```
      e3dea5e3
    • Chen Zheng's avatar
      [PPC]add DEBUG_COUNTER for PPCMIPeephole pass · 0a0f1f9f
      Chen Zheng authored
      0a0f1f9f
    • Piyou Chen's avatar
      [NFC][RISCV] Keep AVLReg define instr inside VSETVLInfo (#89180) · 5820ad92
      Piyou Chen authored
      Currently, the vsetvli pass tracks the define instruction through
      `MRI->getVRegDef` due to the SSA form.
      
      This patch keeps the AVLReg DefMI within VSETVLInfo during construction.
      And replace `MRI->getVRegDef(AVLReg)` with `getAVLRegDefMI()`.
      
      This information is useful when vsetvli pass live in post-ra situation.
      
      The testcases don't change because the VReg always has a unique def in
      SSA.
      5820ad92
    • Chuanqi Xu's avatar
      [Modules] Don't replace local declarations with external declaration with lower visibility · 487967af
      Chuanqi Xu authored
      Close https://github.com/llvm/llvm-project/issues/88400
      
      For the reproducer:
      
      ```
      //--- header.h
      
      namespace N {
          template<typename T>
          concept X = true;
      
          template<X T>
          class Y {
          public:
              template<X U>
              friend class Y;
          };
      
          inline Y<int> x;
      }
      
      //--- bar.cppm
      module;
      export module bar;
      namespace N {
          // To make sure N::Y won't get elided.
          using N::x;
      }
      
      //--- foo.cc
      // expected-no-diagnostics
      import bar;
      void y() {
          N::Y<int> y{};
      };
      ```
      
      it will crash. The root cause is that in
      `StoredDeclsList::replaceExternalDecls`, we will replace the
      existing declarations with external declarations.
      
      Then for the reproducer, the redecl chain for Y is like:
      
      ```
      Y (Local) -> Y (Local, friend) -> Y (Imported) -> Y(Imported, friend)
      ```
      
      Before the lookup, the stored lookup result is `Y(Local)` then we find
      `Y(Imported)`. And now we repalce `Y(Local)` with `Y(Imported)`. But
      `Y(Imported)` is not visible. So we tried to find if there is any
      redeclarations visible but we find `Y(Local, friend)`, then problem
      happens.
      
      The solution is try to avoid the replace to happen if the external
      declaration has lower visibility then we can always find the local
      declarations. This may help the lookup performance slightly.
      
      Also I found the implementation of
      `StoredDeclsList::replaceExternalDecls` is not efficiency. It has an
      `O(n*m)` complexities. But let's improve that in the future.
      487967af
    • Zhijin Zeng's avatar
      [RISC-V][ISel] Remove redundant czero.eqz like 'czero.eqz a0, a0, a0' (#90208) · 37eb9c96
      Zhijin Zeng authored
      
      
      In RISC-V ISel, the instruction `czero.eqz a0, a0, a0` is meaningless.
      This patch does the following folds in ISel:
      ```
      czero_eqz x, (setcc x, 0, ne) -> x
      czero_nez x, (setcc x, 0, eq) -> x
      ```
      
      ---------
      
      Signed-off-by: default avatarZhijin Zeng <zhijin.zeng@spacemit.com>
      37eb9c96
    • Pengcheng Wang's avatar
      [RISCV] Make fixed-point instructions commutable (#90035) · 2c1c887c
      Pengcheng Wang authored
      This PR includes:
      * vsadd.vv/vsaddu.vv
      * vaadd.vv/vaaddu.vv
      * vsmul.vv
      2c1c887c
    • Pengcheng Wang's avatar
      [RISCV] Generate profiles from RISCVProfiles.td · c705c684
      Pengcheng Wang authored
      So we can only mantain one place.
      
      Reviewers: preames, yetingk, topperc
      
      Reviewed By: topperc
      
      Pull Request: https://github.com/llvm/llvm-project/pull/90187
      c705c684
    • Pengcheng Wang's avatar
      [RISCV] Add subtarget features for profiles · f86d264d
      Pengcheng Wang authored
      This may simplify the usage of tools like `opt`, `llc`, etc.
      
      Reviewers: michaelmaitland, 4vtomat, preames, asb
      
      Reviewed By: michaelmaitland, preames, 4vtomat
      
      Pull Request: https://github.com/llvm/llvm-project/pull/84877
      f86d264d
    • Pengcheng Wang's avatar
      [RISCV][TableGen] Get right experimental extension name · 7037878d
      Pengcheng Wang authored
      We should remove the `experimental-` prefix when printing march
      string.
      
      We didn't meet this problem because there is no processor containing
      experimental extensions.
      
      Reviewers: fpetrogalli, asb, topperc
      
      Reviewed By: topperc, asb
      
      Pull Request: https://github.com/llvm/llvm-project/pull/90185
      7037878d
    • LLVM GN Syncbot's avatar
      [gn build] Port 1a462296 · 679e99d6
      LLVM GN Syncbot authored
      679e99d6
    • Congcong Cai's avatar
      Revert "Revert "[WebAssembly] remove instruction after builtin trap" (#90354)" (#90366) · 1a462296
      Congcong Cai authored
      `llvm.trap` will be convert as unreachable which is terminator.
      Instruction after terminator will cause validation failed.
      This PR introduces a pass to clean instruction after terminator.
      Fixes: https://github.com/llvm/llvm-project/issues/68770
      Reapply: #90207
      1a462296
    • Nathan Lanza's avatar
      [github] Add ClangIR codeowners (#86089) · ad1e10ae
      Nathan Lanza authored
      ad1e10ae
    • Tom Stellard's avatar
      [CMake][Release] Enable CMAKE_POSITION_INDEPENDENT_CODE (#90139) · 53ff002c
      Tom Stellard authored
      Set this in the cache file directly instead of via the test-release.sh
      script so that the release builds can be reproduced with just the cache
      file.
      53ff002c
    • Owen Pan's avatar
      b4af01ba
    • Florian Hahn's avatar
      [LV] Add additional cost model coverage for loops with casted inds. · 6084dcbf
      Florian Hahn authored
      Add test coverage for cost-model code-paths not covered by current unit
      tests in preparation for
       https://github.com/llvm/llvm-project/pull/67934.
      6084dcbf
    • Mehdi Amini's avatar
      Revert "[WebAssembly] remove instruction after builtin trap" (#90354) · 38a2051c
      Mehdi Amini authored
      Reverts llvm/llvm-project#90207
      
      LLD Bots are broken.
      38a2051c
    • Piotr Zegar's avatar
      [clang-tidy][DOC] Minor fixes to release notes · 0336328e
      Piotr Zegar authored
      Fix minor style problems in release notes.
      0336328e
    • Björn Svensson's avatar
      [clang-tidy] Enable C23 support in modernize-use-nullptr (#89990) · 803cbcbc
      Björn Svensson authored
      C23 introduces the `nullptr` constant similar to C++11 which means that
      the checker `modernize-use-nullptr` can be used on C23 code as well.
      
      This PR enables the checker to be run on C23 and adds testcases.
      
      See N3042:
      https://open-std.org/JTC1/SC22/WG14/www/docs/n3042.htm
      803cbcbc
    • Matt Arsenault's avatar
      SystemZ: Add more tests for fp128 atomics (#90269) · 738c135e
      Matt Arsenault authored
      These did not have proper floating point uses so weren't representative
      samples. The bitcast inserted by lowering could be absorbed by the
      load/store on the source/use.
      738c135e
  2. Apr 27, 2024