1. Mar 14, 2024
    • Alexey Bataev's avatar
    • Alastair Houghton's avatar
      [libc++] Fix tests on musl (#85085) · b61fb184
      Alastair Houghton authored
      One or two of the tests need slight tweaks to make them pass when
      building with musl.
      
      rdar://118885724
      b61fb184
    • Craig Topper's avatar
    • Craig Topper's avatar
      [RISCV] Remove unnecessary ArrayRef. NFC · 417324a6
      Craig Topper authored
      417324a6
    • Mehdi Amini's avatar
      Revert "[AArch64] Improve lowering of truncating uzp1" (#85115) · 06e310fe
      Mehdi Amini authored
      Reverts llvm/llvm-project#82457
      
      The bot is broken, likely because of mid-air collision.
      06e310fe
    • Alexander Richardson's avatar
      [compiler-rt] Avoid generating coredumps when piped to a tool · 27e5312a
      Alexander Richardson authored
      I was trying to debug why `ninja check-compiler-rt` was taking so long
      to run on my system and after some debugging it turned out that most of
      the time was being spent generating core dumps.
      
      On many current Linux systems, coredumps are no longer dumped in the CWD
      but instead piped to a utility such as systemd-coredumpd that stores
      them in a deterministic location. This can be done by setting the
      kernel.core_pattern sysctl to start with a '|'. However, when using such
      a setup the kernel ignores a coredump limit of 0 (since there is no file
      being written) and we can end up piping many gigabytes of data to
      systemd-coredumpd which causes the test suite to freeze for a long time.
      While most piped coredump handlers do respect the crashing processes'
      RLIMIT_CORE, this is notable not the case for Debian's systemd-coredump
      due to a local patch that changes sysctl.d/50-coredump.conf to ignore
      the specified limit and instead use RLIM_INFINITY
      (https://sa...
      27e5312a
    • Alexander Richardson's avatar
      [compiler-rt] Remove llvm_gtest dependency from unit tests · 55b90b51
      Alexander Richardson authored
      All these unit tests already include ${COMPILER_RT_GTEST_SOURCE} as an
      input source file and the target llvm_gtest does not exist for
      standalone builds. Currently the DEPS argument is ignored for standalone
      builds so the missing target is not a problem, but as part of fixing a
      build race for standalone builds I am planning to include those
      dependencies in COMPILER_RT_TEST_STANDALONE_BUILD_LIBS configurations.
      
      Reviewed By: vitalybuka
      
      Pull Request: https://github.com/llvm/llvm-project/pull/83649
      55b90b51
    • Ian Anderson's avatar
      [clang][modules] giving the __stddef_ headers their own modules can cause... · f50d3582
      Ian Anderson authored
      [clang][modules] giving the __stddef_ headers their own modules can cause redeclaration errors with -fbuiltin-headers-in-system-modules (#84127)
      
      On Apple platforms, some of the stddef.h types are also declared in
      system headers. In particular NULL has a conflicting declaration in
      <sys/_types/_null.h>. When that's in a different module from
      <__stddef_null.h>, redeclaration errors can occur.
      
      Make the \_\_stddef_ headers be non-modular in
      -fbuiltin-headers-in-system-modules and restore them back to not
      respecting their header guards. Still define the header guards though.
      __stddef_max_align_t.h was in _Builtin_stddef_max_align_t prior to the
      addition of _Builtin_stddef, and it needs to stay in a module because
      struct's can't be type merged. __stddef_wint_t.h didn't used to have a
      module, but leave it in it current module since it doesn't really belong
      to stddef.h.
      f50d3582
    • Alexey Bataev's avatar
      [SLP][NFC]Add a test with reused buildvector node, being resized after · 3e6d5661
      Alexey Bataev authored
      minbitwidth analysis.
      3e6d5661
    • Jacek Caban's avatar
      [llvm-ar] Be explicit about archive format in coff-symtab.test tests. (#85112) · c4196616
      Jacek Caban authored
      Fixes test failures on AIX after #82898.
      c4196616
    • Florian Mayer's avatar
      0bb30f98
    • Craig Topper's avatar
      [RISCV] Add SMLoc to expanded vector pseudoinstructions in AsmParser. (#84875) · ab9564c3
      Craig Topper authored
      This is needed for llvm-mca to correctly apply vsetvli instruments to
      these instructions.
      
      Fixes #84799.
      ab9564c3
    • Sirraide's avatar
      [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit... · bd77a26e
      Sirraide authored
      
      [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (#81102)
      
      There were some bugs wrt explicit object parameters in lambdas in the
      constant evaluator:
      - The code evaluating a `CXXThisExpr` wasn’t checking for explicit
      object parameters at all and thus assumed that there was no `this` in
      the current context because the lambda didn’t have one, even though we
      were in a member function and had captured its `this`.
      - The code retrieving captures as lvalues *did* account for explicit
      object parameters, but it did not handle the case of the explicit object
      parameter being passed by value rather than by reference.
      
      This fixes #80997.
      
      ---------
      
      Co-authored-by: default avatarcor3ntin <corentinjabot@gmail.com>
      Co-authored-by: default avatarAaron Ballman <aaron@aaronballman.com>
      bd77a26e
    • Tom Stellard's avatar
      workflows: Add workaround for lld failures on MacOS (#85021) · 175b5337
      Tom Stellard authored
      See #81967
      175b5337
    • Aleksandr Popov's avatar
      [LoopConstrainer] Apply loop gurads to check that loop bounds are safe (#71531) · cd206007
      Aleksandr Popov authored
      
      
      Loop guards that apply to loop SCEV bounds allow IRCE for cases with
      compound loop bounds such as:
      
      if (K > 0 && M > 0)
        for (i = 0; i < min(K, M); i++) {...}
      
      if (K > 0 && M > 0)
        for (i = min(K, M); i >= 0; i--) {...}
      
      Otherwise SCEV couldn't prove that loops have safe bounds in these
      cases.
      
      Co-authored-by: default avatarAleksander Popov <apopov@azul.com>
      cd206007
    • Philip Reames's avatar
      Revert "Reapply "[analyzer] Accept C library functions from the `std` namespace"" · 13ccaf9b
      Philip Reames authored
      This reverts commit e48d5a83.
      
      Fails to build on x86-64 w/gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
      with the following message:
      
      ../llvm-project/clang/unittests/StaticAnalyzer/IsCLibraryFunctionTest.cpp:41:28: error: declaration of ‘std::unique_ptr<clang::ASTUnit> IsCLibraryFunctionTest::ASTUnit’ changes meaning of ‘ASTUnit’ [-fpermissive]
         41 |   std::unique_ptr<ASTUnit> ASTUnit;
            |                            ^~~~~~~
      In file included from ../llvm-project/clang/unittests/StaticAnalyzer/IsCLibraryFunctionTest.cpp:4:
      ../llvm-project/clang/include/clang/Frontend/ASTUnit.h:89:7: note: ‘ASTUnit’ declared here as ‘class clang::ASTUnit’
         89 | class ASTUnit {
            |       ^~~~~~~
      13ccaf9b
    • Chen Cheng's avatar
      [NFC] Corrected data type (#84880) · 35f5caea
      Chen Cheng authored
      On windows, "&Method.first" is of type "unsigned long long *", and a
      type conversion error occurs.
      35f5caea
    • Fangrui Song's avatar
      [llvm-objcopy] --[de]compress-debug-sections: don't compress SHF_ALLOC... · 122d368b
      Fangrui Song authored
      [llvm-objcopy] --[de]compress-debug-sections: don't compress SHF_ALLOC sections, only decompress .debug sections
      
      Simplify --[de]compress-debug-sections to make it easier to add custom section [de]compression.
      Change the following two behaviors to match GNU objcopy.
      
      * --compress-debug-sections compresses SHF_ALLOC sections while GNU
        doesn't.
      * --decompress-debug-sections decompresses non-debug sections while GNU
        doesn't.
      
      Pull Request: https://github.com/llvm/llvm-project/pull/84885
      122d368b
    • Nadeem, Usman's avatar
      [AArch64] Fix tests after PR82457 · 79cd2c0b
      Nadeem, Usman authored
      Change-Id: I44a7e4a10af750b3339d6564c6ce6c2e5c17778e
      79cd2c0b
    • Andrzej Warzyński's avatar
      [mlir][nfc] Update Linalg matmul -> Vector OP test (#81416) · 3b269485
      Andrzej Warzyński authored
      Updates "transform-op-matmul-to-outerproduct.mlir". Summary:
        * refines TD sequence so that it's easier to reason about the
           compilation pipeline (e.g.
           `transform.structured.vectorize_children_and_apply_patterns`
           is replaced with`transform.structured.vectorize `),
        * new input dims to be able to distinguish parallel from reduction
          dims,
        * updates LIT variable names (makes the output easier to follow),
        * removes "noise" from the expected LIT output (e.g. types).
      
      These Linalg -> Vector tests using Transform Dialect are great reference
      points for constructing lowering pipelines. This simplification +
      clean-up will hopefully make it easier to follow.
      3b269485
    • Changpeng Fang's avatar
      AMDGPU: Remove incorrect uses of SubtaretPredicate around DS_Reals (#85001) · e703c735
      Changpeng Fang authored
      SubtargetPredicate is copied from DS_Pseudo to DS_Real. We should not
      use another SubtargetPredicate assignment around DS_Real, because doing
      so will override the predicate from DS_Pseudo.
      
      For example, for DS_ADD_RTN_F64, SubtargetPredicate was set to
      HasLdsAtomicAddF64 in Pseudo. And it will be overridden to isGFX90APlus
      if we assign isGFX90APlus to SubtargetPredicate in Real definition.
      e703c735
    • Stephen Tozer's avatar
      [RemoveDI][NFC] Rename DPValue->DbgRecord in comments and varnames (#84939) · 360da838
      Stephen Tozer authored
      This patch continues the ongoing rename work, replacing DPValue with
      DbgRecord in comments and the names of variables, both members and
      fn-local. This is the most labour-intensive part of the rename, as it is
      where the most decisions have to be made about whether a given comment
      or variable is referring to DPValues (equivalent to debug variable
      intrinsics) or DbgRecords (a catch-all for all debug intrinsics); these
      decisions are not individually difficult, but comprise a fairly large
      amount of text to review.
      
      This patch still largely performs basic string substitutions followed by
      clang-format; there are almost* no places where, for example, a comment
      has been expanded or modified to reflect the semantic difference between
      DPValues and DbgRecords. I don't believe such a change is generally
      necessary in LLVM, but it may be useful in the docs, and so I'll be
      submitting docs changes as a separate patch.
      
      *In a few places, `dbg.values` was replaced with `debug intrinsics`.
      360da838
    • Sirraide's avatar
      [Clang] [Sema] Fix bug in `_Complex float`+`int` arithmetic (#83063) · 69afb9d7
      Sirraide authored
      C23 6.3.1.8 ‘Usual arithmetic conversions’ p1 states (emphasis mine): 
      > Otherwise, if the corresponding real type of either operand is
      `float`, the other operand is converted, *without change of type
      domain*, to a type whose corresponding real type is `float`.
      
      ‘type domain’ here refers to `_Complex` vs real (i.e. non-`_Complex`);
      there is another clause that states the same for `double`.
      
      Consider the following code:
      ```c++
      _Complex float f;
      int x;
      f / x;
      ```
      
      After talking this over with @AaronBallman, we came to the conclusion
      that `x` should be converted to `float` and *not* `_Complex float` (that
      is, we should perform a division of `_Complex float / float`, and *not*
      `_Complex float / _Complex float`; the same also applies to `-+*`). This
      was already being done correctly for cases where `x` was already a
      `float`; it’s just mixed `_Complex float`+`int` operations that
      currently suffer from this problem.
      
      This pr removes the extra `FloatingRealToComplex` conversion that we
      were erroneously inserting and adds some tests to make sure we’re
      actually doing `_Complex float / float` and not `_Complex float /
      _Complex float` (and analogously for `double` and `-+*`).
      
      The only exception here is `float / _Complex float`, which calls a
      library function (`__divsc3`) that takes 4 `float`s, so we end up having
      to convert the `float` to a `_Complex float` after all (and analogously
      for `double`); I don’t believe there is a way around this.
      
      Lastly, we were also missing tests for `_Complex` arithmetic at compile
      time, so this adds some tests for that as well.
      69afb9d7
    • Bhuminjay Soni's avatar
      Diagnose misuse of the cleanup attribute (#80040) · ccd16085
      Bhuminjay Soni authored
      This pull request fixes #79443 when the cleanup attribute is intended to
      be applied to a variable declaration, passing its address to a specified
      function. The problem arises when standard functions like free,
      closedir, fclose, etc., are used incorrectly with this attribute,
      leading to incorrect behavior.
      
      Fixes #79443
      ccd16085
    • Christian Sigg's avatar
    • Nick Desaulniers's avatar
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang][cuda] Enable cuda with -x cuda option (#84944) · 8a8ef1ca
      Flang driver was already able to enable the CUDA language feature base
      on the file extension but there was no command line option. This PR adds
      one.
      8a8ef1ca
    • Florian Hahn's avatar
      f1015d17
    • Usman Nadeem's avatar
      [AArch64] Improve lowering of truncating uzp1 (#82457) · 57b991ab
      Usman Nadeem authored
      There were two existing patterns:
          `concat_vectors(trunc(x), trunc(y)) -> uzp1(x, y)`
      `concat_vectors(assertzext(trunc(x)), assertzext(trunc(y))) -> uzp1(x,
      y)`
      
      Move them into a class and add the following `assertsext` pattern to it:
      `concat_vectors(assertsext(trunc(x)), assertsext(trunc(y))) -> uzp1(x,
      y)`
      
      Add the following transform for v8i8 and v4i16 result types to help with
      pattern matching:
        `truncating uzp1(x, y) -> trunc(concat(x, y))`
      And a pattern to go with it:
        `trunc(concat_vectors(x, y)) -> uzp1 (x, y)`
      
      Add another isel pattern for v8i8 and v4i16 result vector types, similar
      to
      the existing concat pattern, but with a trunc node in the begining:
      `trunc(concat_vectors(assertext_trunc(x), assertext_trunc(y))) ->
      xtn(uzp1(x, y))`
      57b991ab
    • David Blaikie's avatar
      Remove use of reference lifetime extension introduced in cdde0d96 · f15a790f
      David Blaikie authored
      Rather than dealing with which is more readable, the named variable
      doesn't seem to add value here - so omit it.
      f15a790f
  2. Mar 13, 2024