1. Mar 19, 2024
    • Michael Maitland's avatar
      [RISCV] Add IMinMax sched resources to P600SchedModel · e5f2ed37
      Michael Maitland authored
      CI checks were passing in #84962 (c48d8182) but
      that commit caused failures once merged due to ships passing since the
      PR was not rebased on #85131. This commit fixes this problem by adding
      sched resources for integer min max instructions from Zbb in P600 model.
      e5f2ed37
    • Michael Maitland's avatar
      [RISCV] Add SiFiveP600Model SchedModel that is used by sifive-p670 (#84962) · c48d8182
      Michael Maitland authored
      This PR includes an initial scheduler model shows improvement on
      multiple workloads over NoSchedModel and SiFive7Model for sifive-p670.
      We plan on making significant changes to this model in the future so
      that it is more accurate. This patch would close
      https://github.com/llvm/llvm-project/pull/80612.
      c48d8182
    • Nick Desaulniers's avatar
      [libc] fix up fileno tests (#85660) · 27d7bb86
      Nick Desaulniers authored
      Fixes #85628
      27d7bb86
    • Alexey Bataev's avatar
    • Fraser Cormack's avatar
      [IR][NFC] Suppress warnings in ternary operators · 67c5a98c
      Fraser Cormack authored
      Just doing this the same way as in AMDGPUPromoteAlloca.cpp
      67c5a98c
    • Alex Richardson's avatar
      Reland "[compiler-rt] Avoid generating coredumps when piped to a tool" · 0db2e1e9
      Alex Richardson authored
      Updated the corelimit.cpp test to handle buildbots with RLIMIT_CORE
      rlim_max already set to zero.
      
      Original commit message:
      
      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://salsa.debian.org/systemd-team/systemd/-/commit/64599ffe44f0d).
      
      Fortunately there is a workaround: the kernel recognizes the magic value
      of 1 for RLIMIT_CORE to disable coredumps when piping. One byte is also
      too small to generate any coredump, so it effectively behaves as if we
      had set the value to zero.
      
      The alternative to using RLIMIT_CORE=1 would be to use prctl() with the
      PR_SET_DUMPABLE flag, however that also prevents ptrace(), so makes it
      impossible to attach a debugger.
      
      Fixes: https://github.com/llvm/llvm-project/issues/45797
      
      This reverts commit 0b9f19a9.
      0db2e1e9
    • Joseph Huber's avatar
      [Clang] Fix preprocessing device only in HIP mode · 280c7a95
      Joseph Huber authored
      Summary:
      A recent change made the HIP compilation bundle by default. However we
      don't want to do this for `-E`, which silently broke some handling.
      280c7a95
    • alx32's avatar
      [lld-macho] Implement ObjC category merging (-objc_category_merging) (#82928) · ece2903c
      alx32 authored
      
      
      This change adds a flag to lld to enable category merging for MachoO +
      ObjC.
      It adds the '-objc_category_merging' flag for enabling this option and
      uses the existing '-no_objc_category_merging' flag for disabling it.
      In ld64, this optimization is enabled by default, but in lld, for now,
      we require explicitly passing the '-objc_category_merging' flag in order
      to enable it.
      
      Behavior: if in the same link unit, multiple categories are extending
      the same class, then they get merged into a single category.
      Ex: `Cat1(method1+method2,protocol1) + Cat2(method3+method4,protocol2,
      property1) = Cat1_2(method1+method2+method3+method4,
      protocol1+protocol2, property1)`
      
      Notes on implementation decisions made in this diff:
      1. There is a possibility to further improve the current implementation
      by directly merging the category data into the base class (if the base
      class is present in the link unit) - this improvement may be done as a
      follow-up. This improved functionality is already present in ld64.
      2. We do the merging on the raw inputSections - after dead-stripping
      (categories can't be dead stripped anyway).
      3. The changes are mostly self-contained to ObjC.cpp, except for adding
      a new flag (linkerOptimizeReason) to ConcatInputSection and StringPiece
      to mark that this data has been optimized away. Another way to do it
      would have been to just mark the pieces as not 'live' but this would
      cause the old symbols to show up in the linker map as being
      dead-stripped - even if dead-stripping is disabled. This flag allows us
      to match the ld64 behavior.
      
      ---------
      
      Co-authored-by: default avatarAlex B <alexborcan@meta.com>
      ece2903c
    • David Green's avatar
      [AArch64][GlobalISel] Legalize small G_TRUNC (#85625) · 9a784303
      David Green authored
      This is an alternative to #85610, that moreElement's small G_TRUNC
      vectors to widen the vectors. It needs to disable one of the existing
      Unmerge(Trunc(..)) combines, and some of the code is not as optimal as
      it could be. I believe with some extra optimizations it could look
      better (I was thinking combining trunc(buildvector) -> buildvector and
      possibly improving buildvector lowering by generating
      insert_vector_element earlier).
      9a784303
    • Endre Fülöp's avatar
      [clang][analyzer] Improve BlockInCriticalSectionsChecker (#80029) · 705788c8
      Endre Fülöp authored
      * Add support for multiple, potentially overlapping critical sections:
        The checker can now simultaneously handle several mutex's critical
        sections without confusing them.
      * Implement the handling of recursive mutexes:
        By identifying the lock events, recursive mutexes are now supported.
        A lock event is a pair of a lock expression, and the SVal of the mutex
        that it locks, so even multiple locks of the same mutex (and even by
        the same expression) is now supported.
      * Refine the note tags generated by the checker:
        The note tags now correctly show just for mutexes that are
        active at the point of error, and multiple acquisitions of the same mutex
        are also noted.
      705788c8
    • zhongyunde 00443407's avatar
    • Balaji V. Iyer's avatar
      Revert "[MLIR][XeGPU] Adding XeGPU 2d block operators (#84692)" (#85653) · 8d142043
      Balaji V. Iyer authored
      This reverts commit daebe5c4.
      
      This commit causes the following asan issue:
      
      ```
      <snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir | <snip>/llvm-project/build/bin/FileCheck <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir
      # executed command: <snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir
      # .---command stderr------------
      # | =================================================================
      # | ==2772558==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fd2c2c42b90 at pc 0x55e406d54614 bp 0x7ffc810e4070 sp 0x7ffc810e4068
      # | READ of size 8 at 0x7fd2c2c42b90 thread T0
      # |     #0 0x55e406d54613 in operator()<long int const*> /usr/include/c++/13/bits/predefined_ops.h:318
      # |     #1 0x55e406d54613 in __count_if<long int const*, __gnu_cxx::__ops::_Iter_pred<mlir::verifyListOfOperandsOrIntegers(Operation*, llvm::StringRef, unsigned int, llvm::ArrayRef<long int>, ValueRange)::<lambda(int64_t)> > > /usr/include/c++/13/bits/stl_algobase.h:2125
      # |     #2 0x55e406d54613 in count_if<long int const*, mlir::verifyListOfOperandsOrIntegers(Operation*, 
      ...
      ```
      8d142043
    • Shourya Goel's avatar
      [libc] Implement fileno (#85628) · ca04b56a
      Shourya Goel authored
      
      fixes: #85150
      ca04b56a
    • Mark de Wever's avatar
      Revert "[libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85262)" · f8042171
      Mark de Wever authored
      This reverts commit 4109b18e.
      
      It looks like the automatic detection has false positives. This broke
      the following build https://github.com/llvm/llvm-project/pull/85262
      f8042171
    • Andrei Golubev's avatar
      [mlir][OpInterfacesGen][NFC] Add newline after traits declaration (#85633) · 39c739ee
      Andrei Golubev authored
      
      
      Slightly improve the readability of the tablegen-generated code.
      
      Co-authored-by: default avatarOrest Chura <orest.chura@intel.com>
      39c739ee
  2. Mar 18, 2024