1. Jan 21, 2018
  2. Jan 20, 2018
    • Dimitry Andric's avatar
      Assume the shared library path variable is LD_LIBRARY_PATH on systems · e6de5a10
      Dimitry Andric authored
      except Darwin and Windows.  This prevents inserting an environment
      variable with an empty name (which is illegal and leads to a Python
      exception) on any of the BSDs.
      
      llvm-svn: 323041
      e6de5a10
    • Dimitry Andric's avatar
      Assume the shared library path variable is LD_LIBRARY_PATH on systems · 1dbf6096
      Dimitry Andric authored
      except Darwin and Windows.  This prevents inserting an environment
      variable with an empty name (which is illegal and leads to a Python
      exception) on any of the BSDs.
      
      llvm-svn: 323040
      1dbf6096
    • Kamil Rytarowski's avatar
      [compiler-rt] Implement __clear_cache() on OpenBSD/mips64 · f086a5ab
      Kamil Rytarowski authored
      Summary:
      Make __clear_cache() invoke the platform's cache flush function
      on OpenBSD/mips64.
      
      Reviewers: krytarowski
      
      Reviewed By: krytarowski
      
      Subscribers: sdardis, dberris, arichardson, krytarowski, llvm-commits, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42332
      
      llvm-svn: 323039
      f086a5ab
    • Martin Storsjo's avatar
      [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode · 3b611fa9
      Martin Storsjo authored
      This fixes PR35733.
      
      Differential Revision: https://reviews.llvm.org/D41632
      
      llvm-svn: 323036
      3b611fa9
    • Martin Storsjo's avatar
      [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode · f641d0d4
      Martin Storsjo authored
      This (together with the corresponding LLD commit, that contains the
      testcase updates) fixes PR35733.
      
      Differential Revision: https://reviews.llvm.org/D41631
      
      llvm-svn: 323035
      f641d0d4
    • David Green's avatar
      [Dominators] Fix some edge cases for PostDomTree updating · 990eb1fc
      David Green authored
      These fix some odd cfg cases where batch-updating the post
      dom tree fails. Usually around infinite loops and roots
      ending up being different.
      
      Differential Revision: https://reviews.llvm.org/D42247
      
      llvm-svn: 323034
      990eb1fc
    • Petr Hosek's avatar
      Revert "[Fuzzer] Parametrize add_custom_libcxx" · 81ac12d1
      Petr Hosek authored
      This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot.
      
      llvm-svn: 323033
      81ac12d1
    • Petr Hosek's avatar
      [Fuzzer] Parametrize add_custom_libcxx · 94e67be1
      Petr Hosek authored
      add_custom_libcxx uses the just built compiler and installs the
      built libc++, e.g. for testing, neither of which is desirable in
      case of Fuzzer where the libc++ should be built using the host
      compiler and it's only linked into the libFuzzer and should never
      be installed. This change introduces additional arguments to
      add_custom_libcxx to allow parametrizing its behavior.
      
      Differential Revision: https://reviews.llvm.org/D42330
      
      llvm-svn: 323032
      94e67be1
    • Craig Topper's avatar
      [X86] Add some more v32i1 shuffle tests with shuffles between mask creation... · a6c6d65b
      Craig Topper authored
      [X86] Add some more v32i1 shuffle tests with shuffles between mask creation and mask usage rather than being just shuffling input arguments.
      
      The existing tests just tested shuffles of v32i1 inputs, but arguments are promoted to v32i8. So it wasn't a good demonstration of v32i1 shuffle handling.
      
      The new test cases use compares and selects to get k-register operations around the shuffle.
      
      This is prep work for demonstrating changes from D42031.
      
      llvm-svn: 323031
      a6c6d65b
    • Craig Topper's avatar
      [X86] Add test cases for failures to use movzx due to various issues with demanded bits. · 4f141534
      Craig Topper authored
      D42265 and D42313 should help with some of these.
      
      llvm-svn: 323030
      4f141534
    • Petr Hosek's avatar
      Reland "Fix syntax error introduced in r322991" · aecae82f
      Petr Hosek authored
      This triggers compiler error when building sanitizers for Fuchsia.
      
      Differential Revision: https://reviews.llvm.org/D42328
      
      llvm-svn: 323029
      aecae82f
    • Petr Hosek's avatar
      Revert "[sanitizer] Fix syntax error introduced in r322991" · 2a262101
      Petr Hosek authored
      This reverts commit r323027: it breaks the SanitizerLintCheck.
      
      llvm-svn: 323028
      2a262101
    • Petr Hosek's avatar
      [sanitizer] Fix syntax error introduced in r322991 · 51bbea20
      Petr Hosek authored
      This triggers compiler error when building sanitizers for Fuchsia.
      
      Differential Revision: https://reviews.llvm.org/D42328
      
      llvm-svn: 323027
      51bbea20
    • Dan Liew's avatar
      Force lit to execute the ASan and TSan tests on iOS devices · 3fc243ae
      Dan Liew authored
      sequentially.
      
      The current implementation of commands in
      `test/sanitizer_common/ios_commands/` for iOS devices cannot be executed
      in parallel which results in the ASan and TSan tests failing when
      executed in parallel by lit which was the default behaviour.
      
      We now force the ASan and TSan tests to be a new parallelism group named
      `darwin-ios-device-sanitizer` which allows only one test to be run at a
      time.  We also emit a warning informing the user that tests are being
      run sequentially.
      
      This only applies if the target is an iOS device.
      
      Differential Revision: https://reviews.llvm.org/D42156
      
      llvm-svn: 323026
      3fc243ae
    • Sam Clegg's avatar
      [WebAssembly] Remove special handling of entry point export. · 0f0a4287
      Sam Clegg authored
      Its much easier to export it via setHidden(false), now that
      that is a thing.
      
      As a side effect the start function is not longer always exports first
      (becuase its being exported just like all the other function).
      
      Differential Revision: https://reviews.llvm.org/D42321
      
      llvm-svn: 323025
      0f0a4287
    • Sam Clegg's avatar
      [WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC. · 096aa50b
      Sam Clegg authored
      Differential Revision: https://reviews.llvm.org/D42327
      
      llvm-svn: 323024
      096aa50b
    • Saleem Abdulrasool's avatar
      test: fix ARM tests harder · d3169b47
      Saleem Abdulrasool authored
      Remove the missed check update for the removal of the x86 specific
      vector call on ARM.
      
      llvm-svn: 323023
      d3169b47
    • Kamil Rytarowski's avatar
      Link sanitized programs on NetBSD with -lkvm · bd9f5cc1
      Kamil Rytarowski authored
      Summary:
      kvm - kernel memory interface
      
      The kvm(3) functions like kvm_open(), kvm_getargv() or kvm_getenvv()
      are used in programs that can request information about a kernel and
      its processes. The LLVM sanitizers will make use of them on NetBSD.
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka, dvyukov
      
      Reviewed By: vitalybuka
      
      Subscribers: llvm-commits, cfe-commits, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42017
      
      llvm-svn: 323022
      bd9f5cc1
    • Saleem Abdulrasool's avatar
      test: move ARM test from x86 · 6f831d54
      Saleem Abdulrasool authored
      The ARM backend is not guaranteed to be present on x86, move the test to
      the ARM tests.
      
      llvm-svn: 323021
      6f831d54
    • Sam Clegg's avatar
      [WebAssembly] Remove custom handling for undefined entry · 77ee17d1
      Sam Clegg authored
      This code was needed back when we were not able to write
      out the synthetic symbol for main.
      
      Add tests to make sure we can handle this now.
      
      Differential Revision: https://reviews.llvm.org/D42322
      
      llvm-svn: 323020
      77ee17d1
    • Kamil Rytarowski's avatar
      Support the localtime interceptor for NetBSD · 0699f57b
      Kamil Rytarowski authored
      Summary:
      The localtime symbol is mangled to __locatime50
      on NetBSD.
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: kubamracek, llvm-commits, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42045
      
      llvm-svn: 323019
      0699f57b
    • Kamil Rytarowski's avatar
      Intercept accept4() on NetBSD · ada9d47c
      Kamil Rytarowski authored
      Summary:
      The accept4() function first appeared in NetBSD 8.0.
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: joerg, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: llvm-commits, srhines, kubamracek, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D42046
      
      llvm-svn: 323018
      ada9d47c
    • Saleem Abdulrasool's avatar
      CodeGen: handle llvm.used properly for COFF · 99f479ab
      Saleem Abdulrasool authored
      `llvm.used` contains a list of pointers to named values which the
      compiler, assembler, and linker are required to treat as if there is a
      reference that they cannot see.  Ensure that the symbols are preserved
      by adding an explicit `-include` reference to the linker command.
      
      llvm-svn: 323017
      99f479ab
    • Craig Topper's avatar
      [X86] Teach X86 codegen to use vector width preference to avoid promoting to... · 08bd1480
      Craig Topper authored
      [X86] Teach X86 codegen to use vector width preference to avoid promoting to 512-bit types when VLX is enabled and the preference is for a smaller size.
      
      This change applies to places where we would turn 128/256-bit code into 512-bit in order to get a wider element type through sext/zext. Any 512-bit types that already existed in the IR/DAG will be left that way.
      
      The width preference has no effect on codegen behavior when the target does not have AVX512 enabled. So AVX/AVX2 codegen cannot be limited via this mechanism yet.
      
      If the preference is lower than 256 we may still use a 256 bit type to do the operation. Constraining to 128 bits makes it much more difficult to support some operations. For many of these cases we need to change element width while keeping element count constant which is easiest done by switching between 256 and 128 bit.
      
      The preference is only obeyed when AVX512 and VLX are available. This means the preference is not obeyed for KNL, but is obeyed for SKX, Cannonlake, and Icelake. For KNL, the only way to do masked operation is on 512-bit registers so we would have to completely disable masking to obey the preference. We would also lose support for gather, scatter, ctlz, vXi64 multiplies, etc. This may change in the future, but this simplifies the initial implementation.
      
      Differential Revision: https://reviews.llvm.org/D41895
      
      llvm-svn: 323016
      08bd1480
    • Craig Topper's avatar
      [X86] Add support for passing 'prefer-vector-width' function attribute into... · 0d797a34
      Craig Topper authored
      [X86] Add support for passing 'prefer-vector-width' function attribute into X86Subtarget and exposing via X86's getRegisterWidth TTI interface.
      
      This will cause the vectorizers to do some limiting of the vector widths they create. This is not a strict limit. There are reasons I know of that the loop vectorizer will generate larger vectors for.
      
      I've written this in such a way that the interface will only return a properly supported width(0/128/256/512) even if the attribute says something funny like 384 or 10.
      
      This has been split from D41895 with the remainder in a follow up commit.
      
      llvm-svn: 323015
      0d797a34
    • Rui Ueyama's avatar
      Avoid divisions. · 2f8af799
      Rui Ueyama authored
      Compiler doesn't know the fact that Config->WordSize * 8 is always a
      power of two, so it had to use the div instruction to divide some
      number with C.
      
      llvm-svn: 323014
      2f8af799
    • Petar Jovanovic's avatar
      [TSan][MIPS] Expand sanitizer memory space to lower addresses · 6f10bd21
      Petar Jovanovic authored
      MemToShadowImpl() maps lower addresses to a memory space out of sanitizers
      range. The simplest example is address 0 which is mapped to 0x2000000000
      
      static const uptr kShadowBeg     = 0x2400000000ull;
      
      but accessing the address during tsan execution will lead to a segmentation
      fault.
      
      This patch expands the range used by the sanitizer and ensures that 1/8 of
      the maximum valid address in the virtual address spaces is used for shadow
      memory.
      
      Patch by Milos Stojanovic.
      
      Differential Revision: https://reviews.llvm.org/D41777
      
      llvm-svn: 323013
      6f10bd21
    • Derek Schuff's avatar
      [WebAssembly] Fix MSVC build · a83a665c
      Derek Schuff authored
      nullptr_t can't be used left of boolean &&
      
      llvm-svn: 323012
      a83a665c
    • Julie Hockett's avatar
      [clang-tidy] Adding Fuchsia checker for multiple inheritance · 587deb45
      Julie Hockett authored
      Adds a check to the Fuchsia module to warn when a class
      inherits from multiple classes that are not pure virtual.
      
      See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md
      for reference.
      
      Differential Revision: https://reviews.llvm.org/D40580
      
      llvm-svn: 323011
      587deb45
    • Rui Ueyama's avatar
      Make the bloom filter a bit larger. · 517366c7
      Rui Ueyama authored
      I created https://reviews.llvm.org/D42202 to see how large the bloom
      filter should be. With that patch, I tested various bloom filter sizes
      with the following commands:
      
        $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_LLD=true \
          -DLLVM_ENABLE_PROJECTS='clang;lld' -DBUILD_SHARED_LIBS=ON \
          -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-bloom-filter-bits=<some integer> \
          ../llvm-project/llvm
        $ rm -f $(find . -name \*.so.7.0.0svn)
        $ ninja lld
        $ LD_BIND_NOW=1 perf stat bin/ld.lld
      
      Here is the result:
      
        -bloom-filter-bits=8   0.220351609 seconds
        -bloom-filter-bits=10  0.217146597 seconds
        -bloom-filter-bits=12  0.206870826 seconds
        -bloom-filter-bits=16  0.209456312 seconds
        -bloom-filter-bits=32  0.195092075 seconds
      
      Currently we allocate 8 bits for a symbol, but according to the above
      result, that number is not optimal. Even though the numbers follow the
      diminishing return rule, the point where a marginal improvement becomes
      too small is not -bloom-filter-bits=8 but 12. So this patch sets it to 12.
      
      Differential Revision: https://reviews.llvm.org/D42204
      
      llvm-svn: 323010
      517366c7
    • Akira Hatanaka's avatar
      [ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call · 73ceb50d
      Akira Hatanaka authored
      to @objc_autorelease if its operand is a PHI and the PHI has an
      equivalent value that is used by a return instruction.
      
      For example, ARC optimizer shouldn't replace the call in the following
      example, as doing so breaks the AutoreleaseRV/RetainRV optimization:
      
        %v1 = bitcast i32* %v0 to i8*
        br label %bb3
      bb2:
        %v3 = bitcast i32* %v2 to i8*
        br label %bb3
      bb3:
        %p = phi i8* [ %v1, %bb1 ], [ %v3, %bb2 ]
        %retval = phi i32* [ %v0, %bb1 ], [ %v2, %bb2 ] ; equivalent to %p
        %v4 = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
        ret i32* %retval
      
      Also, make sure ObjCARCContract replaces @objc_autoreleaseReturnValue's
      operand uses with its value so that the call gets tail-called.
      
      rdar://problem/15894705
      
      llvm-svn: 323009
      73ceb50d
    • Volodymyr Sapsai's avatar
      [Lex] Fix crash on code completion in comment in included file. · 9d540f15
      Volodymyr Sapsai authored
      This fixes PR32732 by updating CurLexerKind to reflect available lexers.
      We were hitting null pointer in Preprocessor::Lex because CurLexerKind
      was CLK_Lexer but CurLexer was null. And we set it to null in
      Preprocessor::HandleEndOfFile when exiting a file with code completion
      point.
      
      To reproduce the crash it is important for a comment to be inside a
      class specifier. In this case in Parser::ParseClassSpecifier we improve
      error recovery by pushing a semicolon token back into the preprocessor
      and later on try to lex a token because we haven't reached the end of
      file.
      
      Also clang crashes only on code completion in included file, i.e. when
      IncludeMacroStack is not empty. Though we reset CurLexer even if include
      stack is empty. The difference is that during pushing back a semicolon
      token, preprocessor calls EnterCachingLexMode which decides it is
      already in caching mode because various lexers are null and
      IncludeMacroStack is not empty. As the result, CurLexerKind remains
      CLK_Lexer instead of updating to CLK_CachingLexer.
      
      rdar://problem/34787685
      
      Reviewers: akyrtzi, doug.gregor, arphaman
      
      Reviewed By: arphaman
      
      Subscribers: cfe-commits, kfunk, arphaman, nemanjai, kbarton
      
      Differential Revision: https://reviews.llvm.org/D41688
      
      llvm-svn: 323008
      9d540f15
    • Adrian Prantl's avatar
      Wrap all references to build artifacts in the LLDB testsuite (NFC) · 595048f3
      Adrian Prantl authored
      in TestBase::getBuildArtifact(). This NFC commit is in preparation for
      https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree).
      
      Differential Revision: https://reviews.llvm.org/D42280
      
      llvm-svn: 323007
      595048f3