1. Jun 09, 2020
  2. Jun 08, 2020
    • Sanjay Patel's avatar
      [InstCombine] improve matching for sext-lshr-trunc patterns · 42f488b6
      Sanjay Patel authored
      This is intended to preserve the logic of the existing transform,
      but remove unnecessary restrictions on uses and types.
      
      https://rise4fun.com/Alive/pYfR
      
        Pre: C1 <= width(C1) - 8
        %B = sext i8 %A
        %C = lshr %B, C1
        %r = trunc %C to i8
         =>
        %r = ashr i8 %A, trunc(umin(C1, 7))
      42f488b6
    • David Goldman's avatar
      [ObjC] Fix AST serialization for pseudo-strong parameters · 8b529e31
      David Goldman authored
      This bit was assumed to be always false for ParmVarDecls, but attribute
      objc_externally_retained now can produce it.
      
      Differential revision: https://reviews.llvm.org/D74417
      8b529e31
    • Alexander Belyaev's avatar
      80be54c0
    • Haojian Wu's avatar
      [AST] Fix a clang crash on an invalid for-range statement. · 936ec89e
      Haojian Wu authored
      Summary:
      crash stack:
      
      ```
      llvm-project/clang/lib/AST/ASTContext.cpp:2248: clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type *) const: Assertion `!A->getDeducedType().isNull() && "cannot request the size of an undeduced or dependent auto type"' failed.
      PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
      Stack dump:
       #0 0x00000000025bb0bf llvm::sys::PrintStackTrace(llvm::raw_ostream&) llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
       #1 0x00000000025b92b0 llvm::sys::RunSignalHandlers() llvm-project/llvm/lib/Support/Signals.cpp:69:18
       #2 0x00000000025bb535 SignalHandler(int) llvm-project/llvm/lib/Support/Unix/Signals.inc:396:3
       #3 0x00007f9ef9298110 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
       #4 0x00007f9ef8d72761 raise /build/glibc-M65Gwz/glibc-2.30/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
       #5 0x00007f9ef8d5c55b abort /build/glibc-M65Gwz/glibc-2.30/stdlib/abort.c:81:7
       #6 0x00007f9ef8d5c42f get_sysdep_segment_value /build/glibc-M65Gwz/glibc-2.30/intl/loadmsgcat.c:509:8
       #7 0x00007f9ef8d5c42f _nl_load_domain /build/glibc-M65Gwz/glibc-2.30/intl/loadmsgcat.c:970:34
       #8 0x00007f9ef8d6b092 (/lib/x86_64-linux-gnu/libc.so.6+0x34092)
       #9 0x000000000458abe0 clang::ASTContext::getTypeInfoImpl(clang::Type const*) const llvm-project/clang/lib/AST/ASTContext.cpp:0:5
      ```
      
      Reviewers: sammccall
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D81384
      936ec89e
    • Sam McCall's avatar
      [clangd] Resolve driver symlinks, and look up unknown relative drivers in PATH. · 806342b8
      Sam McCall authored
      Summary:
      This fixes a reported bug: if clang and libc++ are installed under
      /usr/lib/llvm-11/...  but there'- a symlink /usr/bin/clang++-11, then a
      compile_commands.json with "/usr/bin/clang++-11 -stdlib=libc++" would previously
      look for libc++ under /usr/include instead of /usr/lib/llvm-11/include.
      The PATH change makes this work if the compiler is just "clang++-11" too.
      
      As this is now doing IO potentially on every getCompileCommand(), we cache
      the results for each distinct driver.
      
      While here:
      - Added a Memoize helper for this as multithreaded caching is a bit noisy.
      - Used this helper to simplify QueryDriverDatabase and reduce blocking there.
        (This makes use of the fact that llvm::Regex is now threadsafe)
      
      Reviewers: kadircet
      
      Subscribers: jyknight, ormris, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D75414
      806342b8
    • Sanjay Patel's avatar
    • Sanjay Patel's avatar
      [InstCombine] add tests for sext+lshr+trunc; NFC · 2e5bba67
      Sanjay Patel authored
      Shows missing transforms with extra uses and vectors.
      2e5bba67
    • Shengchen Kan's avatar
      [TEST] TreeTest.cpp - Add a comma to avoid build error with -werror · 2c63ea6e
      Shengchen Kan authored
      Summary:
      The macro `INSTANTIATE_TEST_CASE_P` is defined as
      ```
      \# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
      ...
      ```
      
      If we build the test case with -werror, we will get an error like
      ```
      error: ISO C++11 requires at least one argument for the "..." in a
      variadic macro
      
      testing::ValuesIn(TestClangConfig::allConfigs()));
                                                      ^
      ```
      This patch fixes that.
      
      Reviewers: gribozavr, hlopko, eduucaldas, gribozavr2
      
      Reviewed By: gribozavr2
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D81388
      2c63ea6e
    • Aaron Puchert's avatar
      Thread safety analysis: Add note for double unlock · f70912f8
      Aaron Puchert authored
      Summary:
      When getting a warning that we release a capability that isn't held it's
      sometimes not clear why. So just like we do for double locking, we add a
      note on the previous release operation, which marks the point since when
      the capability isn't held any longer.
      
      We can find this previous release operation by looking up the
      corresponding negative capability.
      
      Reviewers: aaron.ballman, delesley
      
      Reviewed By: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D81352
      f70912f8
    • Aaron Puchert's avatar
      Thread safety analysis: Support deferring locks · 1850f56c
      Aaron Puchert authored
      Summary:
      The standard std::unique_lock can be constructed to manage a lock without
      initially acquiring it by passing std::defer_lock as second parameter.
      It can be acquired later by calling lock().
      
      To support this, we use the locks_excluded attribute. This might seem
      like an odd choice at first, but its consistent with the other
      annotations we support on scoped capability constructors. By excluding
      the lock we state that it is currently not in use and the function
      doesn't change that, which is exactly what the constructor does.
      
      Along the way we slightly simplify handling of scoped capabilities.
      
      Reviewers: aaron.ballman, delesley
      
      Reviewed By: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D81332
      1850f56c
    • Aaron Puchert's avatar
      Fix build after removing llvm/CodeGen/GlobalISel/Types.h · 31eeee1d
      Aaron Puchert authored
      Removing the include was probably just forgotten after
      f13ba222.
      31eeee1d
    • Guillaume Chatelet's avatar
      [Alignment][NFC] Deprecate dead code from CallingConvLower.h · 54076610
      Guillaume Chatelet authored
      Summary: This is a followup on D81196.
      
      Reviewers: courbet
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D81362
      54076610
    • Dmitry Vyukov's avatar
      tsan: add OpenBSD support for Go · fcf6ae2f
      Dmitry Vyukov authored
      With the race_debug_openbsd_amd64.syso file created via this diff,
      Go's race detector is able to detect a race in the example code
      from this link: https://golang.org/doc/articles/race_detector.html
      
      Reviewed-in: https://reviews.llvm.org/D80469
      Author: qbit (Aaron Bieber)
      fcf6ae2f
    • Xing GUO's avatar
      [ObjectYAML] Add support for error handling in DWARFYAML. NFC. · 9939f231
      Xing GUO authored
      This patch intends to be an NFC-patch. Test cases will be added in a follow-up patch.
      
      Reviewed By: jhenderson, grimar
      
      Differential Revision: https://reviews.llvm.org/D81356
      9939f231
    • Isuru Fernando's avatar
      [flang] Use LLVM's flags · 3862cbbc
      Isuru Fernando authored
      Summary:
      The only difference is that LLVM_ENABLE_WERROR is set to OFF
      by default, but we enable this in a standalone flang build
      
      This commit fixes some windows issues with the flags
      
      Reviewers: DavidTruby, jdoerfert, sscalpone
      
      Reviewed By: DavidTruby, sscalpone
      
      Subscribers: ormris, richard.barton.arm, mehdi_amini, Meinersbur, ChinouneMehdi, tskeith, mgorny, llvm-commits
      
      Tags: #llvm, #flang
      
      Differential Revision: https://reviews.llvm.org/D78306
      3862cbbc
    • Matt Arsenault's avatar
      GlobalISel: Remove dead include · 6c431fcf
      Matt Arsenault authored
      6c431fcf