1. Aug 06, 2021
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Overhaul G_EXTRACT legalization · 51bd4e87
      Jessica Paquette authored
      This simplifies our existing G_EXTRACT rules and adds some test coverage. Mostly
      changing this because it should make it easier to improve legalization for
      instructions which use G_EXTRACT as part of the legalization process.
      
      This also adds support for legalizing some weird types. Similar to other recent
      legalizer changes, this changes the order of widening/clamping.
      
      There was some dead code in our existing rules (e.g. the p0 case would never get
      hit), so this knocks those out and makes the types we want to handle explicit.
      
      This also removes some checks which, nowadays, are handled by the
      MachineVerifier.
      
      Differential Revision: https://reviews.llvm.org/D107505
      51bd4e87
    • Vitaly Buka's avatar
      [msan] Don't track origns in signal handlers · c2a3fb30
      Vitaly Buka authored
      Origin::CreateHeapOrigin is not async-signal-safe and can deadlock.
      
      Differential Revision: https://reviews.llvm.org/D107431
      c2a3fb30
    • Nico Weber's avatar
      [lldb] Stop referencing "host_lib" in cmake files · e71fdc1a
      Nico Weber authored
      It hasn't had an effect since https://reviews.llvm.org/rG7b968969db.
      
      No behavior change.
      
      Differential Revision: https://reviews.llvm.org/D107446
      e71fdc1a
    • Nathan Lanza's avatar
      Clean up instcombine stpcpy test · 7dd29ad4
      Nathan Lanza authored
      Deduplicate some code and add an additional test to verify that the
      sprintf->stpcpy optimization still works on android21 (which properly
      supports it).
      
      This follows up 58481663.
      
      Differential Revision: https://reviews.llvm.org/D107526
      7dd29ad4
    • Nico Weber's avatar
      [lldb] Remove a few unused .exports files · 11565320
      Nico Weber authored
      They used to be referenced from the .xcodeproj files, but those are long gone.
      
      No behavior change.
      
      Differential Revision: https://reviews.llvm.org/D107444
      11565320
    • Nico Weber's avatar
      ddb26e2e
    • Michael Kruse's avatar
      [Polly][test] Add tests for IslMaxOperationsGuard. · 0f50ffb3
      Michael Kruse authored
      Add unittests for IslMaxOperationsGuard and the behaviour of the isl-noexception.h wrapper under exceeded max_operations.
      
      Reviewed By: patacca
      
      Differential Revision: https://reviews.llvm.org/D107401
      0f50ffb3
    • Michael Kruse's avatar
      [Polly][test] Test difference between isl::stat:ok() and isl::stat::error(). · 50eaa82c
      Michael Kruse authored
      The foreach callback wrappers tests check the return values of isl::stat:ok() and isl::stat::error() separately. However, due to the the container they are iterating over containing just one element, they are actually not testing the difference between them.
      
      This patch changes to set to be iterated over to contain 2 element to make returning sl::stat:ok (continue iterating the next element) and isl::stat::error (break after current element) have different effects other than the return value of the foreach itself.
      
      Reviewed By: patacca
      
      Differential Revision: https://reviews.llvm.org/D107395
      50eaa82c
    • Matt Morehouse's avatar
      7ca2b9aa
    • Fangrui Song's avatar
      [clang] Implement -falign-loops=N (N is a power of 2) for non-LTO · c38efb48
      Fangrui Song authored
      GCC supports multiple forms of -falign-loops=.
      -falign-loops= is currently ignored in Clang.
      
      This patch implements the simplest but the most useful form where N is a
      power of 2.
      
      The underlying implementation uses a `llvm::TargetOptions` option for now.
      Bitcode generation ignores this option.
      
      Differential Revision: https://reviews.llvm.org/D106701
      c38efb48
    • Bill Wendling's avatar
      [llvm-diff] Create libLLVMDiff library · 4d293f21
      Bill Wendling authored
      Some tools may want to use the LLVM "diff" code. Move the code into a
      library for easy use.
      
      No functionality change intende.
      
      Differential Revision: https://reviews.llvm.org/D107392
      4d293f21
    • Jon Roelofs's avatar
      [AArch64][GlobalISel] Legalize ctpop s128 · 98f38c15
      Jon Roelofs authored
      This is re-landing the same patch again, but without the changes to
      LegalizerHelper that regressed the Mips test:
      
      test/CodeGen/Mips/GlobalISel/llvm-ir/ctpop.ll
      
      Differential revision: https://reviews.llvm.org/D106494
      98f38c15
    • Matt Morehouse's avatar
      Enable extra coverage counters on Windows · 881faf41
      Matt Morehouse authored
      - Enable extra coverage counters on Windows.
      - Update extra_counters.test to run on Windows also.
      - Update TableLookupTest.cpp to include the required pragma/declspec for the extra coverage counters.
      
      Patch By: MichaelSquires
      
      Reviewed By: morehouse
      
      Differential Revision: https://reviews.llvm.org/D106676
      881faf41
    • Arthur O'Dwyer's avatar
    • Chris Jackson's avatar
      {DebugInfo][LSR] Don't cache dbg.value that are already undef · 113a06f7
      Chris Jackson authored
      The SCEV-based salvaging method caches dbg.value information pre-LSR so
      that salvaging may be attempted post-LSR. If the dbg.value are already
      undef pre-LSR then a salvage attempt would be fruitless, so avoid
      caching them.
      
      Reviewed By: StephenTozer
      
      Differential Revision: https://reviews.llvm.org/D107448
      113a06f7
    • Matt Morehouse's avatar
      Revert "[llvm-diff] Create libLLVMDiff library" · ec513702
      Matt Morehouse authored
      This reverts commit 9854f2f3 since it
      broke all the builds.
      ec513702
    • Dimitry Andric's avatar
      sanitizer_common: disable thread safety annotations for googletest · b260f3fd
      Dimitry Andric authored
      Recently in 0da172b1 thread safety warnings-as-errors were enabled.
      However, googletest is currently not compatible with thread safety
      annotations. On FreeBSD, which has the pthread functions marked with
      such annotations, this results in errors when building the compiler-rt
      tests:
      
          In file included from compiler-rt/lib/interception/tests/interception_test_main.cpp:15:
          In file included from llvm/utils/unittest/googletest/include/gtest/gtest.h:62:
          In file included from llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:40:
          llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1636:3: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis]
            }
            ^
          llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1633:32: note: mutex acquired here
              GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
                                         ^
          llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1645:32: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis]
              GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
                                         ^
          2 errors generated.
      
      At some point googletest will hopefully be made compatible with thread
      safety annotations, but for now add corresponding `-Wno-thread-*` flags
      to `COMPILER_RT_GTEST_CFLAGS` to silence these warnings-as-errors.
      
      Reviewed By: dvyukov
      
      Differential Revision: https://reviews.llvm.org/D107491
      b260f3fd
    • Geoffrey Martin-Noble's avatar
      [Bazel] Update for 9854f2f3 (Diff library) · f8b6e1fa
      Geoffrey Martin-Noble authored
      Updates the Bazel build for
      https://github.com/llvm/llvm-project/commit/9854f2f30f by extracting a
      library from llvm-diff. Note that this does not include the new
      llvm-livepatch binary, for which the CMake file was added accidentally
      and reverted in https://github.com/llvm/llvm-project/commit/fec8f1a008.
      
      Differential Revision: https://reviews.llvm.org/D107586
      f8b6e1fa
    • Hedin Garca's avatar
      [libc] Add diff and perf targets for more math functions · a9628e96
      Hedin Garca authored
      Comparing the run time of math functions from LLVM libc
      with the MSVCRT libc:
      |function	|perf-LLVM libc		    |perf-MSVCRT
      |ceilf		|2.36 mins (141491389600 ns)|47.10 sec (47100940100 ns)
      |exp2f             |6.37 mins (358441794700 ns)|12.39 mins (719404388300 ns)
      |expf		|6.35 mins (381204661800 ns)|6.17 mins (346150163200 ns)
      |fabsf		|1.18 mins (78425546600 ns) |53.75 sec (53745301900 ns)
      |floorf		|3.15 mins (164770963800 ns)|45.94 sec (45935988400 ns)
      |logbf		|4.38 mins (262508058800 ns)|55.47 sec (55466377700 ns)
      |nearbyintf	|3.20 mins (167972868000 ns)|9.13 mins (523822963600 ns)
      |rintf		|3.20 mins (168001498700 ns)|22.35 mins (1341266448800 ns)
      |roundf		|2.35 mins (141151500600 ns)|1.42 mins (85326429800 ns)
      |truncf		|2.31 mins (114846424000 ns)|59.41 sec (59414309100 ns)
      
      Evaluating the number of differing results in Windows:
      |function	|diff
      |ceilf          |8388606 differing results
      |exp2f         |213303887 differing results
      |expf           |193922 differing results
      |fabsf          |8388606 differing results
      |floorf         |8388606 differing results
      |logbf          |0 differing results
      |nearbyintf     |0 differing results
      |rintf          |0 differing results
      |roundf         |0 differing results
      |truncf 	|0 differing results
      
      Reviewed By: sivachandra
      
      Differential Revision: https://reviews.llvm.org/D107462
      a9628e96
    • Bill Wendling's avatar
      Remove unintended commit. · fec8f1a0
      Bill Wendling authored
      fec8f1a0
    • Jon Chesterfield's avatar
      [clang] Replace asm with __asm__ in cuda header · 509854b6
      Jon Chesterfield authored
      Asm is a gnu extension for C, so at present -fopenmp -std=c99
      and similar fail to compile on nvptx, bug 51344
      
      Changing to `__asm__` or `__asm` works for openmp, all three appear to work
      for cuda. Suggesting `__asm__` here as `__asm` is used by MSVC with different
      syntax, so this should make for better error diagnostics if the header is
      passed to a compiler other than clang.
      
      Reviewed By: tra, emankov
      
      Differential Revision: https://reviews.llvm.org/D107492
      509854b6
    • Roman Lebedev's avatar
      [NFC][X86] combineX86ShuffleChain(): hoist Mask variable higher up · c0586ff0
      Roman Lebedev authored
      Having `NewMask` outside of an if and rebinding `BaseMask` `ArrayRef`
      to it is confusing. Instead, just move the `Mask` vector higher up,
      and change the code that earlier had no access to it but now does
      to use `Mask` instead of `BaseMask`.
      
      This has no other intentional changes.
      
      This is a recommit of 35c0848b,
      that was reverted to simplify reversion of an earlier change.
      c0586ff0
    • Roman Lebedev's avatar
    • Bill Wendling's avatar
      [llvm-diff] Create libLLVMDiff library · 9854f2f3
      Bill Wendling authored
      Some tools may want to use the LLVM "diff" code. Move the code into a
      library for easy use.
      
      No functionality change intende.
      
      Differential Revision: https://reviews.llvm.org/D107392
      9854f2f3
    • Fangrui Song's avatar
      [ELF] Support copy relocation on non-default version symbols · 72d070b4
      Fangrui Song authored
      Copy relocation on a non-default version symbol is unsupported and can crash at
      runtime. Fortunately there is a one-line fix which works for most cases:
      ensure `getSymbolsAt` unconditionally returns `ss`.
      
      If two non-default version symbols are defined at the same place and both
      are copy relocated, our implementation will copy relocated them into different
      addresses. The pointer inequality is very unlikely an issue. In GNU ld, copy
      relocating version aliases seems to create more pointer inequality problems than
      us.
      
      (
      In glibc, sys_errlist@GLIBC_2.2.5 sys_errlist@GLIBC_2.3 sys_errlist@GLIBC_2.4
      are defined at the same place, but it is unlikely they are all copy relocated in
      one executable. Even if so, the variables are read-only and pointer inequality
      should not be a problem.
      )
      
      Reviewed By: peter.smith
      
      Differential Revision: https://reviews.llvm.org/D107535
      72d070b4
    • Jonas Devlieghere's avatar
      [lldb] Refactor IRExecutionUnit::FindInSymbols (NFC) · a46bcc60
      Jonas Devlieghere authored
      This patch refactors IRExecutionUnit::FindInSymbols. It eliminates a few
      potential pitfalls and tries to be more explicit about the state carried
      between symbol resolution attempts.
      
      Differential revision: https://reviews.llvm.org/D107206
      a46bcc60
    • Jonas Devlieghere's avatar
      [lldb] Use a struct to pass function search options to Module::FindFunction · c020be17
      Jonas Devlieghere authored
      Rather than passing two booleans around, which is especially error prone
      with them being next to each other, use a struct with named fields
      instead.
      
      Differential revision: https://reviews.llvm.org/D107295
      c020be17
    • Dan Liew's avatar
      Fix COMPILER_RT_DEBUG build for targets that don't support thread local storage. · a756239e
      Dan Liew authored
      02243993 added code that is only enabled
      when COMPILER_RT_DEBUG is enabled. This code doesn't build on targets
      that don't support thread local storage because the code added uses the
      THREADLOCAL macro. Consequently the COMPILER_RT_DEBUG build broke for
      some Apple targets (e.g. 32-bit iOS simulators).
      
      ```
      /Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp:216:8: error: thread-local storage is not supported for the current target
      static THREADLOCAL InternalDeadlockDetector deadlock_detector;
             ^
      /Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:227:24: note: expanded from macro 'THREADLOCAL'
       # define THREADLOCAL   __thread
                              ^
      1 error generated.
      ```
      
      To fix this, this patch introduces a `SANITIZER_SUPPORTS_THREADLOCAL`
      macro that is `1` iff thread local storage is supported by the current
      target. That condition is then added to `SANITIZER_CHECK_DEADLOCKS` to
      ensure the code is only enabled when thread local storage is available.
      
      The implementation of `SANITIZER_SUPPORTS_THREADLOCAL` currently assumes
      Clang. See `llvm-project/clang/include/clang/Basic/Features.def` for the
      definition of the `tls` feature.
      
      rdar://81543007
      
      Differential Revision: https://reviews.llvm.org/D107524
      a756239e
    • Ramesh Peri's avatar
      [llvm-ar] Fix for handling thin archive with SYM64 and a test case for it · 976bd236
      Ramesh Peri authored
      WHen thin archives are created which have symbol table of type SYM64 then all the tools will not work since they cannot read the files properly.
      One can reproduce the problem as follows:
      1. Take a hello world program and create an archive out of it. The SYM64_THRESHOLD=0 will force the generation of SYM64 symbol table.
          clang -c hello.cpp
          SYM64_THRESHOLD=0 llvm-ar crsT mylib.a hello.o
      2. Now try to use any of the tools on this mylib.a and it will fail.
          llvm-nm -M mylib.a
      
      THis fix will eliminate these failures. A regression test is created in llvm/test/Object/archive-symtab.test
      
      Reviewed By: MaskRay, Ramesh
      
      Differential Revision: https://reviews.llvm.org/D107322
      976bd236
    • Jon Roelofs's avatar
      Fix clang-interpreter build after 2487db1f · b4c0307d
      Jon Roelofs authored
      b4c0307d
    • Benjamin Kramer's avatar
      Revert "[X86] combineX86ShuffleChain(): canonicalize mask elts picking from splats" · bd17ced1
      Benjamin Kramer authored
      This reverts commits f819e4c7 and
      35c0848b. It triggers an infinite loop during
      compilation.
      
      $ cat t.ll
      target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
      target triple = "x86_64-unknown-linux-gnu"
      
      define void @MaxPoolGradGrad_1.65() local_unnamed_addr #0 {
      entry:
        %wide.vec78 = load <64 x i32>, <64 x i32>* null, align 16
        %strided.vec83 = shufflevector <64 x i32> %wide.vec78, <64 x i32> poison, <8 x i32> <i32 4, i32 12, i32 20, i32 28, i32 36, i32 44, i32 52, i32 60>
        %0 = lshr <8 x i32> %strided.vec83, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
        %1 = add <8 x i32> zeroinitializer, %0
        %2 = shufflevector <8 x i32> %1, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
        %3 = shufflevector <16 x i32> %2, <16 x i32> undef, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
        %interleaved.vec = shufflevector <32 x i32> undef, <32 x i32> %3, <64 x i32> <i32 0, i32 8, i32 16, i32 24, i32 32, i32 40, i32 48, i32 56, i32 1, i32 9, i32 17, i32 25, i32 33, i32 41, i32 49, i32 57, i32 2, i32 10, i32 18, i32 26, i32 34, i32 42, i32 50, i32 58, i32 3, i32 11, i32 19, i32 27, i32 35, i32 43, i32 51, i32 59, i32 4, i32 12, i32 20, i32 28, i32 36, i32 44, i32 52, i32 60, i32 5, i32 13, i32 21, i32 29, i32 37, i32 45, i32 53, i32 61, i32 6, i32 14, i32 22, i32 30, i32 38, i32 46, i32 54, i32 62, i32 7, i32 15, i32 23, i32 31, i32 39, i32 47, i32 55, i32 63>
        store <64 x i32> %interleaved.vec, <64 x i32>* undef, align 16
        unreachable
      }
      
      $ llc < t.ll -mcpu=skylake
      <hang>
      bd17ced1
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Mark v16s8 <- v8s8, v8s8 G_CONCAT_VECTOR as legal · f3f3098a
      Jessica Paquette authored
      G_CONCAT_VECTORS shows up from time to time when legalizing other instructions.
      
      We actually import patterns for the v16s8 <- v8s8, v8s8 case so marking it
      as legal gives us selection for free.
      
      Differential Revision: https://reviews.llvm.org/D107512
      f3f3098a
    • Daniele Vettorel's avatar
      Add llvm-stress binary to Bazel build configuration. · 180f4a87
      Daniele Vettorel authored
      The `llvm-stress` binary is currently missing from the Bazel `BUILD` file for llvm. This patch adds it.
      
      Reviewed By: GMNGeoffrey
      
      Differential Revision: https://reviews.llvm.org/D107571
      180f4a87
    • Florian Hahn's avatar
      [SLP] Add additional memory version tests. · 97469d4c
      Florian Hahn authored
      97469d4c
  2. Aug 05, 2021