1. Jun 13, 2024
    • Florian Mayer's avatar
      fix · b31e2b5a
      Florian Mayer authored
      Created using spr 1.3.4
      b31e2b5a
    • Florian Mayer's avatar
      test cleanup · 2d5de0a9
      Florian Mayer authored
      Created using spr 1.3.4
      2d5de0a9
    • Florian Mayer's avatar
      more test · c4e41d1f
      Florian Mayer authored
      Created using spr 1.3.4
      c4e41d1f
    • Florian Mayer's avatar
      cleanup · a7d65dd0
      Florian Mayer authored
      Created using spr 1.3.4
      a7d65dd0
    • Florian Mayer's avatar
      [𝘀𝗽𝗿] initial version · b38d6b01
      Florian Mayer authored
      Created using spr 1.3.4
      b38d6b01
    • Vitaly Buka's avatar
      Revert " [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and... · 682d461d
      Vitaly Buka authored
      Revert " [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (#95299)
      
      Reverts llvm/llvm-project#68620
      
      Introduce or expose a memory leak and UB, see llvm/llvm-project#68620
      682d461d
    • Paul Kirth's avatar
      Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (#95281) · 294f3ce5
      Paul Kirth authored
      …f weights" #95136
      
      Reverts #95060, and relands #86609, with the unintended code generation
      changes addressed.
      
      This patch implements the changes to LLVM IR discussed in
      https://discourse.llvm.org/t/rfc-update-branch-weights-metadata-to-allow-tracking-branch-weight-origins/75032
      
      In this patch, we add an optional field to MD_prof meatdata nodes for
      branch weights, which can be used to distinguish weights added from
      llvm.expect* intrinsics from those added via other methods, e.g. from
      profiles or inserted by the compiler.
      
      One of the major motivations, is for use with MisExpect diagnostics,
      which need to know if branch_weight metadata originates from an
      llvm.expect intrinsic. Without that information, we end up checking
      branch weights multiple times in the case if ThinLTO + SampleProfiling,
      leading to some inaccuracy in how we report MisExpect related
      diagnostics to users.
      
      Since we change the format of MD_prof metadata in a fundamental way, we
      need to update code handling branch weights in a number of places.
      
      We also update the lang ref for branch weights to reflect the change.
      294f3ce5
    • Louis Dionne's avatar
      [libc++] Move the implementation of CPU-based basis operations to namespace __pstl (#95267) · 7b803842
      Louis Dionne authored
      They were always intended to be in that namespace but I was trying to
      keep changes orthogonal.
      7b803842
    • Jay Foad's avatar
      [CodeGenTypes] Speed up getVectorElementType and getVectorMinNumElements (#95282) · abedb3b8
      Jay Foad authored
      Implement MVT::getVectorElementType and MVT::getVectorMinNumElements
      with table lookup instead of switch.
      
      This speeds up "check-llvm-codegen-amdgpu" by about 7% in my Release
      build.
      abedb3b8
    • Simon Pilgrim's avatar
      [X86] SimplifyDemandedVectorEltsForTargetNode - use EVT for F16C nodes · 987b59ab
      Simon Pilgrim authored
      As we allow these nodes to be created pre-legalization, we can't rely on them having a simple VT
      
      Fixes #95278
      987b59ab
    • Simon Pilgrim's avatar
      [RISCV] Add test coverage for #95284 · 25af23f5
      Simon Pilgrim authored
      25af23f5
    • Kazu Hirata's avatar
      [ProfileData] Use std::vector for ValueData (NFC) (#95194) · 31440738
      Kazu Hirata authored
      This patch changes the type of ValueData to
      std::vector<InstrProfValueData> so that, in a follow-up patch, we can
      teach getValueForSite to return ArrayRef<InstrProfValueData>.
      
      Currently, a typical traversal over the value data looks like:
      
        uint32_t NV = Func.getNumValueDataForSite(VK, I);
      std::unique_ptr<InstrProfValueData[]> VD = Func.getValueForSite(VK, I);
        for (uint32_t V = 0; V < NV; V++)
          Do something with VD[V].Value and/or VD[V].Count;
      
      Note that we need to call getNumValueDataForSite and getValueForSite
      separately.  If getValueForSite returns ArrayRef<InstrProfValueData>
      in the future, then we'll be able to do something like:
      
        for (const auto &V : Func.getValueForSite(VK, I))
          Do something with V.Value and/or V.Count;
      
      If ArrayRef<InstrProfValueData> directly points to ValueData, then
      getValueForSite won't need to allocate memory with std::make_unique.
      
      Now, switching to std::vector requires us to update several places:
      
      - sortByTargetValues switches to llvm::sort because we don't need to
        worry about sort stability.
      
      - sortByCount retains sort stability because std::list::sort also
        performs stable sort.
      
      - merge builds another array and move it back to ValueData to avoid a
        potential quadratic behavior with std::vector::insert into the
        middle of a vector.
      31440738
    • Pierre d'Herbemont's avatar
      Support `guarded_by` attribute and related attributes inside C structs and... · af0d7128
      Pierre d'Herbemont authored
      Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (#94216)
      
      This fixes #20777.
      
      Previously the `guarded_by`, `pt_guarded_by`, `acquired_after`, and `acquired_before` attributes were only supported inside C++ classes or top level C/C++ declaration.
      
      This patch allows these attributes to be added to struct members in C. These attributes have also now support experimental late parsing. This is off by default but can be enabled by passing `-fexperimental-late-parse-attributes`. This is useful for referring to a struct member after the annotated member. E.g.
      
      ```
      struct Example {
        int a_value_defined_before __attribute__ ((guarded_by(a_mutex)));
        struct Mutex *a_mutex;
      };
      ```
      
      Patch by  Pierre d'Herbemont (@pdherbemont)
      af0d7128
    • Iman Hosseini's avatar
      [flang] Add reductions for CUF Kernels: Lowering (#95184) · 7665d3d9
      Iman Hosseini authored
      
      
      * Add reductionOperands and reductionAttrs to cuf's KernelOp. 
      * Parsing is already working and the tree has the info: here I make the
      Bridge emit the updated KernelOp with reduction information added.
      * Check |reductionAttrs| = |reductionOperands| in verifier
      * Add a test
      @clementval @vzakhari
      
      ---------
      
      Co-authored-by: default avatarIman Hosseini <imanh@nvidia.com>
      Co-authored-by: default avatarValentin Clement (バレンタイン クレメン) <clementval@gmail.com>
      7665d3d9
    • Simon Pilgrim's avatar
      ca33796d
    • Peiming Liu's avatar
    • Craig Topper's avatar
    • LLVM GN Syncbot's avatar
      [gn build] Port 1a0e67d7 · 15a699f9
      LLVM GN Syncbot authored
      15a699f9
    • Kazu Hirata's avatar
      [ProfileData] Compute sum in annotateValueSite (NFC) (#95199) · 00fa3fbf
      Kazu Hirata authored
      getValueForSite computes the total count -- the total number of times
      a given value site is visited.  The problem is that, excluding tests,
      annotateValueSite is the only place that needs the total count.
      
      This patch moves the total count computation to annotateValueSite.
      00fa3fbf
    • Simon Pilgrim's avatar
      [DAG] combineShiftToAVG - ensure the reduced demanded value type is smaller than the original. · 760ad23e
      Simon Pilgrim authored
      Now we have promotion support we should be able to remove the next-power-of-2 code entirely, but this is good enough for now.
      760ad23e
    • Simon Pilgrim's avatar
      04a09b9b
    • Peter Klausler's avatar
      [flang] Disable Fortran free form line continuation in non-source lin… (#94663) · e286ecfe
      Peter Klausler authored
      …e produced by keyword macro replacement
      
      When later initial keyword macro replacement will yield a line that is
      not Fortran source, don't interpret "&" as a Fortran source line
      continuation marker during tokenization of the line.
      
      Fixes https://github.com/llvm/llvm-project/issues/82579.
      e286ecfe
    • Ramkumar Ramachandra's avatar
      Reland "mlir/Presburger/MPInt: move into llvm/ADT" (#95254) · 1a0e67d7
      Ramkumar Ramachandra authored
      Change: remove guards on debug-printing, to allow Release builds without
      LLVM_ENABLE_DUMP to pass.
      
      MPInt is an arbitrary-precision integer library that builds on top of
      APInt, and has a fast-path when the number fits within 64 bits. It was
      originally written for the Presburger library in MLIR, but seems useful
      to the LLVM project in general, independently of the Presburger library
      or MLIR. Hence, move it into LLVM/ADT under the name DynamicAPInt.
      
      This patch is part of a project to move the Presburger library into
      LLVM.
      1a0e67d7
    • Mark de Wever's avatar
      [libc++][modules] Mark as implemented. (#90091) · 759fb590
      Mark de Wever authored
      The feature has been implemented in LLVM 18 as an experimental feature.
      This marks the paper as complete and sets the feature-test macro.
      
      Implements
      - P2465R3 Standard Library Modules std and std.compat
      
      Fixes: https://github.com/llvm/llvm-project/issues/89579
      759fb590
    • Mark de Wever's avatar
      [libc++] Adds __cpp_lib_three_way_comparison FTM. (#91515) · c36961bd
      Mark de Wever authored
      The paper
        P0768R1 Library Support for the Spaceship (Comparison) Operator
      did not add a feature-test macro. This omission has been corrected in
        P1353R0 Missing Feature Test Macros
      
      This enables the FTM for P0768R1
      
      Fixes: https://github.com/llvm/llvm-project/issues/73953
      
      
      
      ---------
      
      Co-authored-by: default avatarS. B. Tam <cpplearner@outlook.com>
      c36961bd
    • Michael Jones's avatar
      [libc] Add baremetal putchar (#95182) · 9a1611f9
      Michael Jones authored
      In #94685 I discussed my ideas for cleaner baremetal output writing.
      This patch is not that. This patch just uses `write_to_stderr` for
      outputting from putchar and printf on baremetal. I'm still planning to
      create a proper design for writing to stdout and stderr on various
      platforms, but that will be a followup patch.
      9a1611f9
    • LLVM GN Syncbot's avatar
      [gn build] Port 9540950a · 90a154e0
      LLVM GN Syncbot authored
      90a154e0
    • Felipe de Azevedo Piovezan's avatar
      [lldb] Fix linker flags in lldb tests · c5790206
      Felipe de Azevedo Piovezan authored
      This is a fixup to https://github.com/llvm/llvm-project/pull/93808,
      which used LDFLAGS instead of the correct LD_EXTRAS
      c5790206
    • Louis Dionne's avatar
      fe4cd104
    • Louis Dionne's avatar
    • Louis Dionne's avatar
      [libc++] Overhaul the PSTL dispatching mechanism (#88131) · 9540950a
      Louis Dionne authored
      The experimental PSTL's current dispatching mechanism was designed with
      flexibility in mind. However, while reviewing the in-progress OpenMP
      backend, I realized that the dispatching mechanism based on ADL and
      default definitions in the frontend had several downsides. To name a
      few:
      
      1. The dispatching of an algorithm to the back-end and its default
         implementation is bundled together via `_LIBCPP_PSTL_CUSTOMIZATION_POINT`.
         This makes the dispatching really confusing and leads to annoyances
         such as variable shadowing and weird lambda captures in the front-end.
      2. The distinction between back-end functions and front-end algorithms
         is not as clear as it could be, which led us to call one where we meant
         the other in a few cases. This is bad due to the exception requirements
         of the PSTL: calling a front-end algorithm inside the implementation of
         a back-end is incorrect for exception-safety.
      3. There are two levels of back-end dispatching in the PSTL, which treat
         CPU backends as a special case. This was confusing and not as flexible
         as we'd like. For example, there was no straightforward way to dispatch
         all uses of `unseq` to a specific back-end from the OpenMP backend,
         or for CPU backends to fall back on each other.
      
      This patch rewrites the backend dispatching mechanism to solve these
      problems, but doesn't touch any of the actual implementation of
      algorithms. Specifically, this rewrite has the following
      characteristics:
      
      - There is a single level of backend dispatching, however partial backends can
        be stacked to provide a full implementation of the PSTL. The two-level dispatching
        that was used for CPU-based backends is handled by providing CPU-based basis 
        operations as simple helpers that can easily be reused when defining any PSTL 
        backend.
      
      - The default definitions for algorithms are separated from their dispatching logic.
      
      - The front-end is thus simplified a whole lot and made very consistent
        for all algorithms, which makes it easier to audit the front-end for
        things like exception-correctness, appropriate forwarding, etc.
      
      Fixes #70718
      9540950a
    • Rodrigo Salazar's avatar
      [libcxx] Correct and clean-up filesystem operations error_code paths (#88341) · 11399028
      Rodrigo Salazar authored
      3 error_code related cleanups/corrections in the std::filesystem
      operations functions.
      
      1. In `__copy`, the `ec->clear()` is unnecessary as `ErrorHandler` at
      the start of each function clears the error_code as part of its
      initialization.
      
      2. In `__copy`, in the recursive codepath we are not checking the
      error_code result of `it.increment(m_ec2)` immediately after use in the
      for loop condition (and we aren't checking it after the final increment
      when we don't enter the loop).
      
      3. In `__weakly_canonical`, it makes calls to `__canonical` (which
      internally uses OS APIs implementing POSIX `realpath`) and we are not
      checking the error code result from the `__canonical` call. Both
      `weakly_canonical` and `canonical` are supposed to set the error_code
      when underlying OS APIs result in an error
      (https://eel.is/c++draft/fs.err.report#3.1). With this change we
      propagate up the error_code from `__canonical` caused by any underlying
      OS API failure up to the `__weakly_canonical`. Essentially, if
      `__canonical` thinks an error code should be set, then
      `__weakly_canonical` must as well. Before this change it would be
      throwing an exception in the non-error_code form of the function when
      `__canonical` fails, while not setting the error code in the error_code
      form of the function (an inconsistency).
      
      Added a little coverage in weakly_canonical.pass.cpp for the error_code
      forms of the API that was missing. Though I am lacking utilities in
      libcxx testing to add granular testing of the failure scenarios (like
      forcing realpath to fail for a given path, as it could if you had
      something like a flaky remote filesystem).
      11399028
    • Martin Storsjö's avatar
      [libcxx] [ci] Update Clang for Windows jobs to 18.1.x (#95228) · bce24987
      Martin Storsjö authored
      Pick the latest version available in Chocolatey (18.1.6) and llvm-mingw
      (20240606, which includes LLVM 18.1.7).
      
      Also add the flag "--allow-downgrade" when installing a specific version
      of LLVM. If the preinstalled version is higher than the requested one,
      Chocolatey would otherwise error out when requesting installing a lower
      version. This will avoid errors in the future, if the runner image comes
      preinstalled with a newer version of LLVM.
      
      (This currently seems to happen with a recent version of the GitHub
      Actions runner image, version 20240610.1.0 has LLVM 18.1.6 already
      preinstalled, and will error out when trying to install the 17.0.6
      version that we previously requested.)
      bce24987
    • Simon Pilgrim's avatar
      1216e704
  2. Jun 12, 2024