1. May 11, 2024
    • LLVM GN Syncbot's avatar
      [gn build] Port 05f88b17 · d009bd7c
      LLVM GN Syncbot authored
      d009bd7c
    • Joyce's avatar
      Generate a new requirements.txt to fix CVEs (#90109) · 00e3620a
      Joyce authored
      
      
      Hi! Here is a patch for #81859 that fix the vulnerabilities found in
      gitpython, cryptography, urllib3 and requests.
      
      I have just regenerated the requirements.txt files running pip-compile
      again. Fortunately, this was enough to set all the dependencies on safe
      versions.
      
      I have also checked if new vulnerabilities were introduced by running
      scorecard on my fork, but none has been introduced.
      
      Thanks!
      
      Signed-off-by: default avatarJoyce Brum <joycebrum@google.com>
      00e3620a
    • Momchil Velikov's avatar
      [AArch64] Combine getActiveLaneMask with vector_extract (#81139) · 88da8756
      Momchil Velikov authored
      ... into a `whilelo` instruction with a pair of predicate registers.
      88da8756
    • Justin Bogner's avatar
      Revert "[DirectX] Fix DXIL part header version encoding" (#91791) · d6550543
      Justin Bogner authored
      Test failures on big endian bots after this change.
      
      Reverts llvm/llvm-project#91506
      d6550543
    • Peiming Liu's avatar
      [mlir][sparse] allow multiple COO segments in sparse encodings. (#91786) · 13af97a7
      Peiming Liu authored
      **NOTE**: we still have implementation holes when handling multiple COO
      segments in the encoding. But the format should be considered to be
      legal.
      13af97a7
    • Mircea Trofin's avatar
      [ctx_profile] Fix signed-ness in CtxInstrProfilingTest.cpp · 77a59c32
      Mircea Trofin authored
      Follow-up from `265953cc`
      77a59c32
    • agozillon's avatar
      Revert "[Flang][OpenMP] Derived type member map fortran offload runtime tests" (#91784) · cfdc2bc7
      agozillon authored
      Reverts llvm/llvm-project#82850, applied accidentally without the rest of the PR series.
      cfdc2bc7
    • Nikolas Klauser's avatar
      [libc++][NFC] Replace __apply_cv with __copy_cv or __copy_cvref (#90867) · 05f88b17
      Nikolas Klauser authored
      `__apply_cv_t` and `__copy_cvref_t` are very closely related. They are
      in fact identical except that `__copy_cvref_t` handles rvalue references
      properly. Some uses don't actually require handling of references, so
      they are replaced with `__copy_cv_t`.
      05f88b17
    • agozillon's avatar
      [Flang][OpenMP] Derived type member map fortran offload runtime tests (#82850) · af0b293b
      agozillon authored
      This is a large series of runtime tests that help to add coverage for
      the specific cases intended to be supported by the PR stack
      that extends derived type map support in Flang+OpenMP. Primarily this will add functionality coverage, there's cases where
      things may work, but not optimally (or at least similarly to the status quo in Clang), additional IR tests are added in the
      relevant segments of the related PRs to test for breakages like that.
      af0b293b
    • Spenser Bauman's avatar
      [mlir][tosa] Cleanups for post-merge review comments in tosa-infer-shapes (#87660) · e513f2c6
      Spenser Bauman authored
      This change addresses some of the additional review feedback on
      https://github.com/llvm/llvm-project/pull/87234
      
      .
      
      A summary of the changes:
      
      1. Cleaned up the language to use 'roll back' rather than revert to
      reduce the chance of confusion. Improved some function names as well.
      2. Eliminated string comparisons on dialect names.
      3. Prevented the introduction of redundant tensor.cast operations for
      the same value.
      
      ---------
      
      Co-authored-by: default avatarSpenser Bauman <sabauma@fastmail>
      e513f2c6
    • Fangrui Song's avatar
      [Driver,test] Add -Werror to -ffp-contract/-ffp-model tests · 514d80b4
      Fangrui Song authored
      Test that these combinations do not lead to a warning.
      
      -funsafe-math-optimizations -ffp-contract=off
      and
      -ffast-math -ffp-contract=off
      
      may issue a warning after #91271.
      514d80b4
    • Tomas Matheson's avatar
      [AArch64] make +dit non-FMV-only (#90987) · 842f7b0f
      Tomas Matheson authored
      Required to fix an llvm-test-suite failure:
      
          error: expected writable system register or pstate: "msr DIT, x0"
      842f7b0f
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang][cuda] Reapply restriction on kernel subprogram but not device (#91764) · 7c555cb2
      The restriction was completely removed in #89677. This was a bit too
      much. Reapply the restriction on elemental, pure and recursive but only
      for kernel subprogram (`grid_global` and `global` attributes).
      7c555cb2
    • Mircea Trofin's avatar
    • Alex Langford's avatar
    • Pavel Labath's avatar
      [lldb-dap] Fix a race during shutdown (#91591) · 871f4839
      Pavel Labath authored
      lldb-dap was setting a flag which was meant to shut it down as soon as
      it sent a terminated event. The problem with this flag is two-fold:
      - as far as I can tell (definitely not an expert here), there's no
      justification for this in the protocol spec. The only way I found to
      shut the server down was to send it a disconnect request.
      - the flag did not actually work most of the time, because it's only
      checked between requests so nothing will happen if the server starts
      listening for a new request before a different thread manages to send
      the terminated event. And since the next request is usually the
      disconnect request, everything will operate normally.
      
      The combination of these two things meant that the issue was largely
      unnoticable, except for rare flaky test failures, which happened when
      the handler thread was too slow, and checked the flag after it has
      already been said. This caused the test suite to complain as it did not
      get a response to the disconnect request. This situation could be
      s(t)imulated by adding a sleep to the and of the main loop, which
      delayed the flag check, and caused the DAP tests to fail reliably.
      
      This patch changes the shutdown condition to only trigger when the
      disconnect request has been received. Since the flag can now only be set
      from the handler thread, it no longer needs to be atomic.
      871f4839
    • Cyndy Ishida's avatar
      [InstallAPI] Support mutually exclusive parse options (#90686) · 062f6fe3
      Cyndy Ishida authored
      Projects like libc use mutually exclusive macros to compile files
      multiple times and then merge the result into the final library. For
      installapi to accept these, we'd need to parse the same declarations in
      different ways. This patch adds the basic pipelining for installapi to
      create the correct TBD file.
      
      * -Xproject allows: -fmodules, -fobjc-arc, fvisibility=hidden, prefix
      headers
      * -Xlabel allows: -D and -U settings
      * Error on 'private' and 'public' labels -X<label>
      * Xplatform allows: -iframework <path> This is to support the case where
      zippered frameworks want to pass in iOSSupport search path.
      062f6fe3
    • Zequan Wu's avatar
      [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing... · 9a7262c2
      Zequan Wu authored
      [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing declaration DIEs. (#90663)
      
      This is the implementation for
      https://discourse.llvm.org/t/rfc-delay-definition-die-searching-when-parse-a-declaration-die-for-record-type/78526.
      
      #### Motivation
      Currently, lldb eagerly searches for definition DIE when parsing a
      declaration DIE for struct/class/union definition DIE. It will search
      for all definition DIEs with the same unqualified name (just
      `DW_AT_name` ) and then find out those DIEs with same fully qualified
      name. Then lldb will try to resolve those DIEs to create the Types from
      definition DIEs. It works fine most time. However, when built with
      `-gsimple-template-names`, the search graph expands very quickly,
      because for the specialized-template classes, they don’t have template
      parameter names encoded inside `DW_AT_name`. They have
      `DW_TAG_template_type_parameter` to reference the types used as template
      parameters. In order to identify if a definition DIE matches a
      declaration DIE, lldb needs to resolve all template parameter types
      first and those template parameter types might be template classes as
      well, and so on… So, the search graph explodes, causing a lot
      unnecessary searching/type-resolving to just get the fully qualified
      names for a specialized-template class. This causes lldb stack overflow
      for us internally on template-heavy libraries.
      
      #### Implementation
      Instead of searching for definition DIEs when parsing declaration DIEs,
      we always construct the record type from the DIE regardless if it's
      definition or declaration. The process of searching for definition DIE
      is refactored to `DWARFASTParserClang::FindDefinitionTypeForDIE` which
      is invoked when 1) completing the type on
      `SymbolFileDWARF::CompleteType`. 2) the record type needs to start its
      definition as a containing type so that nested classes can be added into
      it in `PrepareContextToReceiveMembers`.
      
      The key difference is `SymbolFileDWARF::ResolveType` return a `Type*`
      that might be created from declaration DIE, which means it hasn't starts
      its definition yet. We also need to change according in places where we
      want the type to start definition, like `PrepareContextToReceiveMembers`
      (I'm not aware of any other places, but this should be a simple call to
      `SymbolFileDWARF::FindDefinitionDIE`)
      
      #### Result
      It fixes the stack overflow of lldb for the internal binary built with
      simple template name. When constructing the fully qualified name built
      with `-gsimple-template-names`, it gets the name of the type parameter
      by resolving the referenced DIE, which might be a declaration (we won't
      try to search for the definition DIE to just get the name).
      I got rough measurement about the time using the same commands (set
      breakpoint, run, expr this, exit). For the binary built without
      `-gsimple-template-names`, this change has no impact on time, still
      taking 41 seconds to complete. When built with
      `-gsimple-template-names`, it also takes about 41 seconds to complete
      wit this change.
      9a7262c2
    • Haojian Wu's avatar
    • Vlad Serebrennikov's avatar
      ef71c79d
    • Vlad Serebrennikov's avatar
      [clang][NFC] Rename C++ CWG DR test files to use `cwg` prefix · d358b2de
      Vlad Serebrennikov authored
      This is a follow-up for ed128c7d
      d358b2de
  2. May 10, 2024
    • Craig Topper's avatar
      [RISCV] Don't pre-split before the loop in parseNormalizedArchString. (#91684) · d8f8ac8f
      Craig Topper authored
      We can extract each extension as we process them without much
      complexity.
      
      I changed the error message for cases where there are double underscores
      or a trailing underscore. I think this is an improvement over the
      previous error.
      d8f8ac8f
    • Schrodinger ZHU Yifan's avatar
      [libc] avoid cmpxchg on the fastpath of callonce (#91748) · b8f4f39d
      Schrodinger ZHU Yifan authored
      Avoid `cmpxchg` operation if the function has already been called.
      The destination operand of `cmpxchg` may receive a write cycle without
      regard to the result of the comparison
      b8f4f39d
    • Haojian Wu's avatar
      Update stale comments of the demangler, NFC (#91740) · 023cdfcc
      Haojian Wu authored
      To reflect what the actual code does.
      023cdfcc
    • lntue's avatar
      [libc][math] Fix exact cases for powf. (#91488) · 92dfe20a
      lntue authored
      It was reported from the CORE-MATH project that the `powf`
      implementation did not round correctly when `x^y` is either exact for
      exactly half-way.
      
      This PR deals with the potential exact cases when `y` is an integer `2 <
      y < 25`. In such cases, the results of `x^y` is exactly representable in
      double precision.
      92dfe20a
    • Razvan Lupusoru's avatar
      [flang] Use i16 instead of i2 for cmdstat (#91647) · c5c8ae43
      Razvan Lupusoru authored
      The code for preparing cmdstat was generating an i2 constant with value
      0, casting it, and then storing it into i16 storage. Just generate i16
      constant directly.
      c5c8ae43
    • Louis Dionne's avatar
      [libc++][NFC] Use TestEachPointerType in TestEachAtomicType (#91480) · 9232591b
      Louis Dionne authored
      That way, if we ever expand TestEachPointerType we will pick up those
      changes in TestEachAtomicType.
      9232591b
    • Hui's avatar
      [libc++] Make `constexpr std::variant`. Implement P2231R1 (#83335) · 52271a5c
      Hui authored
      Fixes #86686
      52271a5c
    • Jay Foad's avatar
      [AMDGPU] Remove unnecessary predicates from aliases. NFC. (#91602) · 331f22af
      Jay Foad authored
      So long as the target of the alias is predicated with HasImageInsts or
      similar, the alias itself does not need this predicate.
      331f22af
    • erichkeane's avatar
      [OpenACC][NFC] Fix isa behavior for OpenACC types · 63177422
      erichkeane authored
      I discovered while working on a different patch that I'd not implemented
      the 'classof' for any of the Clauses, which resulted in 'isa' always
      returning 'true' for all of the types.  This patch goes through all the
      existing clauses and adds 'classof' such that it will work correctly.
      
      Additionally, in doing this, I found a bug where I was doing a cast to
      the wrong type in the ASTWriter, so this fixes that problem as well.
      63177422
    • David Green's avatar
      [DAG] Lower frem of power-2 using div/trunc/mul+sub (#91148) · 8fc9e3d5
      David Green authored
      If we are lowering a frem and the divisor is known to be an integer power-2, we
      can use the formula 'frem = x - trunc(x / d) * d'. This avoids the more
      expensive call to fmod. The results are identical as fmod so long as d is a
      power-2 (so the mul does not round incorrectly), and the sign of the return is
      either always positive or not important for zeroes (nsz).
      
      Unfortunately Alive2 does not handle this well at the moment. I was using
      exhaustive checking to test this:
      (https://gist.github.com/davemgreen/6078015f30d3bacd1e9572f8db5d4b64).
      
      I found this in cpythons implementation of float_pow. I currently added it as a
      DAG combine for frem with power-2 fp constants.
      8fc9e3d5
    • Congcong Cai's avatar
    • Xiang Li's avatar
      [DirectX] Fix DXIL part header version encoding (#91506) · 195d8ac2
      Xiang Li authored
      Move MinorVersion be the lower 8 bit.
      Set DXIL version in DXContainerObjectWriter::writeObject.
      
      
      Fixes #89952
      195d8ac2
    • Xing Xue's avatar
      [OpenMP][AIX] Implement __kmp_get_load_balance() for AIX (#91520) · 561b6ab9
      Xing Xue authored
      AIX has the `/proc` filesystem where `/proc/<pid>/lwp/<tid>/lwpsinfo` has
      the thread state in binary, similar to Linux's
      `/proc/<pid>/task/<tid>/stat` where the state is in ASCII. However, the
      definition of state info `R` in `lwpsinfo` is `runnable`. In Linux,
      state `R` means the thread is `running`. Therefore, `lwpsinfo` is not
      ideal for our purpose of getting the current load of the system. This
      patch uses `perfstat_cpu()` in AIX system library `libperfstat.a` to
      obtain the number of threads current running on logical CPUs.
      561b6ab9
    • DianQK's avatar
      d48bf8ae
    • Alex Bradbury's avatar
      [InstCombine] Prefer to keep power-of-2 constants when combining ashr exact... · 3be8e2c9
      Alex Bradbury authored
      [InstCombine] Prefer to keep power-of-2 constants when combining ashr exact and slt/ult of a constant (#86111)
      
      We have flexibility in what constant to use when combining an `ashr
      exact` with a slt or ult of a constant, and it's not possible to revisit
      this decision later in the compilation pipeline after the `ashr exact`
      is removed. Keeping a constant close to power-of-2 (pow2val + 1) should
      be no worse than neutral, and in some cases may allow better codegen
      later on for targets that can more cheaply generate power of 2 (which
      may be selectable if converting back to setle/setge) or near power of 2
      constants.
      
      Alive2 proofs:
      <https://alive2.llvm.org/ce/z/2BmPnq> and
      <https://alive2.llvm.org/ce/z/DtuhnR>
      3be8e2c9
    • Alex Bradbury's avatar
      [InstCombine] Precommit tests for #86111 · 452f4393
      Alex Bradbury authored
      The upcoming patch adds logic to prefer to use constants close to
      power-of-two in these ashr exact + slt/ult patterns when it has a choice
      on which constant can be used.
      452f4393
    • Younan Zhang's avatar
      [Clang][Sema] Revise the transformation of CTAD parameters of nested class templates (#91628) · 8c852ab5
      Younan Zhang authored
      This fixes a regression introduced by bee78b88.
      
      When we form a deduction guide for a constructor, basically, we do the
      following work:
      - Collect template parameters from the constructor's surrounding class
      template, if present.
      - Collect template parameters from the constructor.
      - Splice these template parameters together into a new template
      parameter list.
      - Turn all the references (e.g. the function parameter list) to the
      invented parameter list by applying a `TreeTransform` to the function
      type.
      
      In the previous fix, we handled cases of nested class templates by
      substituting the "outer" template parameters (i.e. those not declared at
      the surrounding class template or the constructor) with the
      instantiating template arguments. The approach per se makes sense, but
      there was a flaw in the following case:
      
      ```cpp
      template <typename U, typename... Us> struct X {
        template <typename V> struct Y {
          template <typename T> Y(T) {}
        };
      
        template <typename T> Y(T) -> Y<T>;
      };
      
      X<int>::Y y(42);
      ```
      
      While we're transforming the parameters for `Y(T)`, we first attempt to
      transform all references to `V` and `T`; then, we handle the references
      to outer parameters `U` and `Us` using the template arguments from
      `X<int>` by transforming the same `ParamDecl`. However, the first step
      results in the reference `T` being `<template-param-0-1>` because the
      invented `T` is the last of the parameter list of the deduction guide,
      and what we're substituting with is a corresponding parameter pack
      (which is `Us`, though empty). Hence we're messing up the substitution.
      
      I think we can resolve it by reversing the substitution order, which
      means handling outer template parameters first and then the inner
      parameters.
      
      There's no release note because this is a regression in 18, and I hope
      we can catch up with the last release.
      
      Fixes https://github.com/llvm/llvm-project/issues/88142
      8c852ab5
    • Qizhi Hu's avatar
      [Clang][Sema] access checking of friend declaration should not be delayed (#91430) · 200f3bd3
      Qizhi Hu authored
      attempt to fix https://github.com/llvm/llvm-project/issues/12361
      Consider this example:
      ```cpp
      class D {
          class E{
              class F{};
              friend  void foo(D::E::F& q);
              };
          friend  void foo(D::E::F& q);
          };
      
      void foo(D::E::F& q) {}
      ```
      The first friend declaration of foo is correct. After that, the second
      friend declaration delayed access checking and set its previous
      declaration to be the first one. When doing access checking of `F`(which
      is private filed of `E`), we put its canonical declaration(the first
      friend declaration) into `EffectiveContext.Functions`. Actually, we are
      still checking the first one. This is incorrect due to the delayed
      checking.
      Creating a new scope to indicate we are parsing a friend declaration and
      doing access checking in time.
      200f3bd3
    • Florian Hahn's avatar
      [LAA] Drop x86_64 target triple to fix test on builds with X86. · f52ca632
      Florian Hahn authored
      Follow-up o fix test after 28767afd.
      f52ca632