1. Jan 10, 2024
    • Simon Pilgrim's avatar
      [X86] Add test coverage for #77459 · 417df8ee
      Simon Pilgrim authored
      417df8ee
    • Simon Pilgrim's avatar
      [DAG] Use FoldConstantArithmetic for unary bitops constant folding. · c1173e4e
      Simon Pilgrim authored
      BSWAP/BITREVERSE/CTPOP/CTLZ/CTLZ_ZERO_UNDEF/CTTZ/CTTZ_ZERO_UNDEF are all handled by FoldConstantArithmetic - so use directly instead of testing for isConstantIntBuildVectorOrConstantInt and relying on DAG.getNode() to perform the constant fold.
      c1173e4e
    • Fangrui Song's avatar
      [MC,ELF] .section: unconditionally print section flag 'G' after 'o' · f972e4d3
      Fangrui Song authored
      * Placing 'G' before 'M' (SHF_MERGE) can be misleading as the sh_entsize
        argument goes before the section group name, if a reader doesn't know
        that the order of extra arguments is not affected by the order of flags.
      * 'a', 'w', and 'x' indicate basic permission-related flags. Separating
        them with 'G' is kinda ugly.
      
      Simplify code and move 'G' after 'o'. The new output is more similar to
      GCC.
      f972e4d3
    • Adrian Prantl's avatar
      [lldb] DWARFDIE: Follow DW_AT_specification when computing CompilerCo… (#77157) · fa928458
      Adrian Prantl authored
      …ntext
      
      Following the specification chain seems to be clearly the expected
      behavior of GetDeclContext(). Otherwise C++ methods have an empty
      CompilerContext instead of being nested in their struct/class.
      
      Theprimary motivation for this functionality is the Swift plugin. In
      order to test the change I added a proof-of-concept implementation of a
      Module::FindFunction() variant that takes a CompilerContext, expesed via
      lldb-test.
      
      rdar://120553412
      fa928458
    • Fangrui Song's avatar
      [MC] Parse SHF_LINK_ORDER argument before section group name (#77407) · 7620f03e
      Fangrui Song authored
      When both SHF_LINK_ORDER | SHF_GROUP flags are set, GNU assembler from
      2.35 onwards (https://sourceware.org/PR25381
      https://sourceware.org/binutils/docs/as/Section.html) parses the
      SHF_LINK_ORDER argument before section group name, different from us.
      
      This is unfortunate, but does not matter because the `.section` flag `o`
      is a niche feature only used by compiler instrumentations, not adopted
      by hand-written assembly, and using both flags is extremely rare. Let's
      just match GNU assembler. There is another benefit: we now support
      zero-flag section group with the SHF_LINK_ORDER flag, while previously
      there isn't a syntax.
      
      While here, print 'G' after 'o' to be clear that the 'G' argument is
      parsed after the 'o' argument. To make the diff smaller, we don't print
      'G' after 'w' in the absence of 'o' for now.
      7620f03e
    • Jake Egan's avatar
      [clang][modules] Objective-C test lacks support on AIX/zOS (#77485) · 1b8e39a1
      Jake Egan authored
      To fix error: `fatal error: error in backend: Objective-C support is
      unimplemented for object file format`
      
      Same rationale as 22f01cd4.
      1b8e39a1
    • martinboehme's avatar
      [clang][dataflow] Add an early-out to `flowConditionImplies()` / `flowConditionAllows()`. (#77453) · 03a0bfa9
      martinboehme authored
      This saves having to assemble the set of constraints and run the SAT
      solver in
      the trivial case where `F` is true.
      
      This is a performance win on the benchmarks for the Crubit nullability
      checker:
      
      ```
      name                              old cpu/op   new cpu/op   delta
      BM_PointerAnalysisCopyPointer     64.1µs ± 5%  63.1µs ± 0%   -1.56%  (p=0.000 n=20+17)
      BM_PointerAnalysisIntLoop          172µs ± 2%   171µs ± 0%     ~     (p=0.752 n=20+17)
      BM_PointerAnalysisPointerLoop      408µs ± 3%   355µs ± 0%  -12.99%  (p=0.000 n=20+17)
      BM_PointerAnalysisBranch           201µs ± 2%   184µs ± 0%   -8.28%  (p=0.000 n=20+19)
      BM_PointerAnalysisLoopAndBranch    684µs ± 2%   613µs ± 2%  -10.38%  (p=0.000 n=20+19)
      BM_PointerAnalysisTwoLoops         309µs ± 2%   308µs ± 2%     ~     (p=0.728 n=20+19)
      BM_PointerAnalysisJoinFilePath    37.9ms ± 2%  37.9ms ± 2%   +0.06%  (p=0.041 n=20+19)
      BM_PointerAnalysisCallInLoop      26.5ms ± 2%  26.4ms ± 4%   -0.59%  (p=0.024 n=20+20)
      ```
      
      When running clang-tidy on real-world code, the results are less clear.
      In
      three runs, averaged, on an arbitrarily chosen input file, I get 11.91 s
      of user
      time without this patch and 11.81 s with it, though with considerable
      measurement noise (I'm seeing up to 0.2 s of variation between runs).
      
      Still, this is a very simple change, and it is a clear win in
      benchmarks, so I
      think it is worth making.
      03a0bfa9
    • Mark de Wever's avatar
      [libc++][CI] Moves CI badge to main README. (#77247) · f0fd8fd7
      Mark de Wever authored
      The current CI badge is currently in libc++ documentation. This does not
      seem the right place:
      - The typical location on GitHub is on the main README.
      - The documentation is shipped as part of the release:
      - This link does not work in off-line mode. Currently our documentation
      works in off-line mode.
      - The status in the release documentation does not reflect the status of
      the shipped library. So users looking at it may see a red status and get
      confused.
      
      This moves the badge to the README.
      f0fd8fd7
    • Mark de Wever's avatar
      [libc++] Implements P2517R1. (#77239) · d2929723
      Mark de Wever authored
      As pointed out by @Zingam the paper was implemented in libc++ as an
      extension. This patch does the bookkeeping. The inital release version
      is based on historical release dates.
      
      Completes:
      - Add a conditional noexcept specification to std::apply
      d2929723
    • Nikita Popov's avatar
      Revert "[GVNSink] Skip debug intrinsics when identifying sinking candidates (#77419)" · 064e73cd
      Nikita Popov authored
      This reverts commit 51bf0dff.
      
      There are test failures on Windows.
      064e73cd
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang][openacc] Fix clauses check with device_type (#77389) · ed640420
      A couple of clauses are allowed multiple times when they are separated
      by a device_type clause. This patch updates the ACC.td file to move
      these clauses to the `allowedClause` list and the
      `CheckAllowedOncePerGroup` function is used to make sure they appear
      only once on the directive or for each device_type.
      ed640420
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [mlir][openacc] Restore unit tests for device_type functions (#77122) · 02fa434b
      These tests were initially pushed together with
      https://github.com/llvm/llvm-project/pull/75864 but they were triggering
      some buildbot failure (sanitizers). They now make use of the
      `OwningOpRef` so all the resources are correctly destroyed at the end of
      each tests.
      They will be extended to includes all the extra getter functions added
      with device_type support.
      02fa434b
    • David Green's avatar
      [Flang] Remove unnecessary static_assert · 90525125
      David Green authored
      Certain compilers do not seem to like the static assert with a string, causing
      a implicit conversion. It can be removed as it should not be reachable and the
      mlir::failure should handle it correctly in case it is.
      90525125
    • Cyndy Ishida's avatar
      [TextAPI] Skip adding empty attributes (#77400) · 8ca0364d
      Cyndy Ishida authored
      An empty string attribute value (e.g. a parent-umbrella: "") is
      equivalent to omitting it. Theres no reason to write it out.
      8ca0364d
    • David Green's avatar
      [Flang] Generate inline reduction loops for elemental count intrinsics (#75774) · 810c2915
      David Green authored
      This adds a ReductionElementalConversion transform to
      OptimizedBufferizationPass, taking hlfir::count(hlfir::elemental) and
      generating the inline loop to perform the count of true elements. This
      lets us generate a single loop instead of ending up as two plus a
      temporary.
      
      Any and All should be able to share the same code with a different
      function/initial value.
      810c2915
    • Piotr Zegar's avatar
      [clang-tidy] Improve performance of misc-const-correctness (#72705) · 6eb372e4
      Piotr Zegar authored
      Replaced certain AST matchers in ExprMutationAnalyzer with a more direct
      utilization of AST classes. The primary bottleneck was identified in the
      canResolveToExpr AST matcher. Since this matcher was employed multiple
      times and used recursively, each invocation led to the constant creation
      and destruction of other matchers within it. Additionally, the continual
      comparison of DynTypedNode resulted in significant performance
      degradation.
      
      The optimization was tested on the TargetLowering.cpp file. Originally,
      the check took 156 seconds on that file, but after implementing this
      enhancement, it now takes approximately 40 seconds, making it nearly
      four times faster.
      
      Despite this improvement, there are still numerous issues in this file.
      To further reduce the computational cost of this class, it is advisable
      to consider removing the remaining matchers and exploring alternatives
      such as leveraging RecursiveASTVisitor and increasing the direct use of
      AST classes.
      
      Closes #71786
      6eb372e4
    • Craig Topper's avatar
      [RISCV] Refactor GPRF64 register class to make it usable for Zacas. (#77408) · c9da4dc7
      Craig Topper authored
      -Rename to GPRPair.
      -Rename registers to be named like X10_X11 instead of X10_PD. Except X0
       which is now X0_Pair since it is not paired with X1.
      -Use unknown size and offset for the subreg indices. This might
       be a functional change, but does not affect any lit tests.
      c9da4dc7
    • Andrey Ali Khan Bolshakov's avatar
      [clang] Improve bit-field in ref NTTP diagnostic (#71077) · 79e17cd0
      Andrey Ali Khan Bolshakov authored
      Prior to this, attempts to bind a bit-field to an NTTP of reference type
      produced an error because references to subobjects in NTTPs are
      disallowed. But C++20 allows references to subobjects in NTTPs generally
      (see
      [P1907R1](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html)).
      Without this change, implementing P1907R1 would cause a bug allowing
      bit-fields to be bound to reference template arguments.
      
      Extracted from https://reviews.llvm.org/D140996
      79e17cd0
    • Matt Arsenault's avatar
      AMDGPU: Drop amdgpu-no-lds-kernel-id attribute in LDS lowering (#71481) · 888a20c4
      Matt Arsenault authored
      This is in preparation for moving the run of AMDGPUAttributor earlier.
      Currently it infers the lack of the corresponding intrinsic calls,
      so if we introduce new ones we need to remove the attribute from any
      possible transitive callers. This is more conservative than necessary,
      we could try to identify specific subgraphs where LDS globals are not
      used.
      
      Other options include teaching the attributor to avoid adding it in
      cases
      where the lowering may choose the table, but this seems more complex.
      Alternatively could add a second run which doesn't seem worth it.
      
      Depends #71349
      888a20c4
    • Krzysztof Drewniak's avatar
      [mlir][Vector] Add nontemporal attribute, mirroring memref (#76752) · 5cfe24ee
      Krzysztof Drewniak authored
      Since vector loads and stores from scalar memrefs translate to
      llvm.load/store, add the ability to tag said loads and stores as
      nontemporal. This mirrors functionality available in memref.load/store.
      5cfe24ee
    • Brad Smith's avatar
      dc03382d
    • Matt Arsenault's avatar
      AMDGPU: Break vop3p handling out of vop3 base patterns (#77472) · affd9e8e
      Matt Arsenault authored
      Add the vop3p op_sel fields in getInsVOP3P instead of getInsVOP3Base.
      Also start using defvar for some of the intermediate fields. let
      overrides of all the visible fields are really difficult to follow.
      affd9e8e
    • Benjamin Kramer's avatar
      c19995e9
    • Romaric Jodin's avatar
      libclc: generic: add half implementation for erf/erfc (#66901) · 9160f49e
      Romaric Jodin authored
      libclc does not have a half implementation for erf/erfc
      Add one based on the float implementation by extending the input and
      truncating the output.
      9160f49e
    • Shan Huang's avatar
      51bf0dff
    • Mark de Wever's avatar
      [lldb][libc++] Adds some C++20 calendar data formatters. (#76983) · b5f2db94
      Mark de Wever authored
      This adds a subset of the C++20 calendar data formatters:
      - day,
      - month,
      - year,
      - month_day,
      - month_day_last, and
      - year_month_day.
      
      A followup patch will add the missing calendar data formatters:
      - weekday,
      - weekday_indexed,
      - weekday_last,
      - month_weekday,
      - month_weekday_last,
      - year_month,
      - year_month_day_last
      - year_month_weekday, and
      - year_month_weekday_last.
      b5f2db94
    • Michael Buch's avatar
      [lldb][Type] Add TypeQuery::SetLanguages API (#75926) · 4ea5c603
      Michael Buch authored
      This is required for users of `TypeQuery` that limit the set of
      languages of the query using APIs such as
      `GetSupportedLanguagesForTypes` or
      `GetSupportedLanguagesForExpressions`.
      
      Example usage: https://github.com/apple/llvm-project/pull/7885
      4ea5c603
  2. Jan 09, 2024