1. Dec 07, 2018
    • George Karpenkov's avatar
    • Sanjay Patel's avatar
      [x86] add test for vector bitwise-logic-of-bswaps; NFC · b7156fb5
      Sanjay Patel authored
      llvm-svn: 348530
      b7156fb5
    • Louis Dionne's avatar
      [libc++] Improve diagnostics for non-const comparators and hashers in associative containers · 3560fbf3
      Louis Dionne authored
      Summary:
      When providing a non-const-callable comparator in a map or set, the
      warning diagnostic does not include the point of instantiation of
      the container that triggered the warning, which makes it difficult
      to track down the problem. This commit improves the diagnostic by
      placing it directly in the body of the associative container.
      
      The same change is applied to unordered associative containers, which
      had a similar problem.
      
      Finally, this commit cleans up the forward declarations of several
      map and unordered_map helpers, which are not needed anymore.
      
      <rdar://problem/41370747>
      
      Reviewers: EricWF, mclow.lists
      
      Subscribers: christof, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D48955
      
      llvm-svn: 348529
      3560fbf3
    • Aaron Smith's avatar
      [pecoff] Implement ObjectFilePECOFF::GetDependedModules() · 037ed1be
      Aaron Smith authored
      Summary:
      This parses entries in pecoff import tables for imported DLLs and
      is intended as the first step to allow LLDB to load a PE's shared
      modules when creating a target on the LLDB console. 
      
      
      Reviewers: rnk, zturner, aleksandr.urakov, lldb-commits, labath, asmith
      
      Reviewed By: labath, asmith
      
      Subscribers: labath, lemo, clayborg, Hui, mgorny, mgrang, teemperor
      
      Differential Revision: https://reviews.llvm.org/D53094
      
      llvm-svn: 348527
      037ed1be
    • Nathan Lanza's avatar
      Implement WindowsDYLD::DidAttach for use with gdb-server attach · 488214fe
      Nathan Lanza authored
      Summary:
      Windows lldb debugging currently uses a process plugin to handle
      launching and attaching to a process. Launching a process via a debug
      server (e.g. ds2) and attaching to it with `gdb-remote port` currently
      doesn't communicate address information of the executable properly.
      
      Implement DynamicLoaderWindowsDYLD::DidAttach which allow us to
      obtain the proper executable load address.
      
      Differential Revision: https://reviews.llvm.org/D55383
      
      llvm-svn: 348526
      488214fe
    • Louis Dionne's avatar
      [libcxx] Always convert 'use_system_cxx_lib' to an absolute path · 73b98491
      Louis Dionne authored
      Otherwise, some tests would fail when a relative path was passed,
      because they'd use the relative path from a different directory
      than the current working directory.
      
      llvm-svn: 348525
      73b98491
    • Michal Gorny's avatar
      [test] Add missing cmake include for building libFuzzer alone · ef4b6003
      Michal Gorny authored
      Include CompilerRTCompile in fuzzer tests explicitly.  Otherwise, when
      building only libFuzzer, CMake fails due to:
      
      CMake Error at cmake/Modules/AddCompilerRT.cmake:395 (sanitizer_test_compile):
        Unknown CMake command "sanitizer_test_compile".
      Call Stack (most recent call first):
        lib/fuzzer/tests/CMakeLists.txt:53 (generate_compiler_rt_tests)
      
      Differential Revision: https://reviews.llvm.org/D55378
      
      llvm-svn: 348524
      ef4b6003
    • Sanjay Patel's avatar
      [DAGCombiner] reduce indent; NFC · 03a3ef2a
      Sanjay Patel authored
        
      Unlike some of the folds in hoistLogicOpWithSameOpcodeHands()
      above this shuffle transform, this has the expected hasOneUse()
      checks in place.
      
      llvm-svn: 348523
      03a3ef2a
    • Andrea Di Biagio's avatar
      [DagCombiner][X86] Simplify a ConcatVectors of a scalar_to_vector with undef. · 52a2bac5
      Andrea Di Biagio authored
      This patch introduces a new DAGCombiner rule to simplify concat_vectors nodes:
      
      concat_vectors( bitcast (scalar_to_vector %A), UNDEF)
          --> bitcast (scalar_to_vector %A)
      
      This patch only partially addresses PR39257. In particular, it is enough to fix
      one of the two problematic cases mentioned in PR39257. However, it is not enough
      to fix the original test case posted by Craig; that particular case would
      probably require a more complicated approach (and knowledge about used bits).
      
      Before this patch, we used to generate the following code for function PR39257
      (-mtriple=x86_64 , -mattr=+avx):
      
      vmovsd  (%rdi), %xmm0           # xmm0 = mem[0],zero
      vxorps  %xmm1, %xmm1, %xmm1
      vblendps        $3, %xmm0, %xmm1, %xmm0 # xmm0 = xmm0[0,1],xmm1[2,3]
      vmovaps %ymm0, (%rsi)
      vzeroupper
      retq
      
      Now we generate this:
      
      vmovsd  (%rdi), %xmm0           # xmm0 = mem[0],zero
      vmovaps %ymm0, (%rsi)
      vzeroupper
      retq
      
      As a side note: that VZEROUPPER is completely redundant...
      
      I guess the vzeroupper insertion pass doesn't realize that the definition of
      %xmm0 from vmovsd is already zeroing the upper half of %ymm0. Note that on
      %-mcpu=btver2, we don't get that vzeroupper because pass vzeroupper insertion
      %pass is disabled.
      
      Differential Revision: https://reviews.llvm.org/D55274
      
      llvm-svn: 348522
      52a2bac5
    • Alexey Bataev's avatar
      [OPENMP][NVPTX]Correct type casting for printf args + simplified shfl64 function. · 653e8ba7
      Alexey Bataev authored
      Summary:
      Explicitly casted printf's args to the required types + simplified
      shfl64 function.
      
      Reviewers: gtbercea, kkwli0
      
      Subscribers: guansong, jfb, caomhin, openmp-commits
      
      Differential Revision: https://reviews.llvm.org/D55379
      
      llvm-svn: 348521
      653e8ba7
    • Louis Dionne's avatar
      [libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targets · bf3f90c3
      Louis Dionne authored
      The tests were marked to fail based on the 'availability' LIT feature.
      However, those tests should really only be failing when we run them
      against the dylibs that were deployed on macosx10.7 and macosx10.8,
      which the deployment target has nothing to do with.
      
      This caused the tests to unexpectedly pass when running the tests
      with deployment target macosx10.{7,8} but running with a recent dylib.
      
      llvm-svn: 348520
      bf3f90c3
    • Jim Ingham's avatar
    • Sanjay Patel's avatar
      [DAGCombiner] don't hoist logic op if operands have other uses, part 2 · bfc7ffa4
      Sanjay Patel authored
      The PPC test with 2 extra uses seems clearly better by avoiding this transform. 
      With 1 extra use, we also prevent an extra register move (although that might
      be an RA problem). The general rule should be to only make a change here if
      it is always profitable. The x86 diffs are all neutral.
      
      llvm-svn: 348518
      bfc7ffa4
    • Simon Pilgrim's avatar
      Fix Wdocumentation warning. NFCI. · 845d5a0a
      Simon Pilgrim authored
      llvm-svn: 348517
      845d5a0a
    • Sanjay Patel's avatar
      [PowerPC] add tests for hoisting bitwise logic; NFC · 273b7789
      Sanjay Patel authored
      llvm-svn: 348516
      273b7789
    • Nico Weber's avatar
      Allow forwarding -fdebug-compilation-dir to cc1as · 4c9fa4a0
      Nico Weber authored
      The flag -fdebug-compilation-dir is useful to make generated .o files
      independent of the path of the build directory, without making the compile
      command-line dependent on the path of the build directory, like
      -fdebug-prefix-map requires. This change makes it so that the driver can
      forward the flag to -cc1as, like it already can for -cc1. We might want to
      consider making -fdebug-compilation-dir a driver flag in a follow-up.
      
      (Since -fdebug-compilation-dir defaults to PWD, it's already possible to get
      this effect by setting PWD, but explicit compiler flags are better than env
      vars, because e.g. ninja tracks command lines and reruns commands that change.)
      
      Somewhat related to PR14625.
      
      Differential Revision: https://reviews.llvm.org/D55377
      
      llvm-svn: 348515
      4c9fa4a0
    • Zachary Turner's avatar
      Fix line endings in build.py · 56ff1fd5
      Zachary Turner authored
      llvm-svn: 348514
      56ff1fd5
    • Adrian Prantl's avatar
      Reapply "Avoid emitting redundant or unusable directories in DIFile metadata entries."" · 212c104e
      Adrian Prantl authored
      This reverts commit r348280 and reapplies D55085 without modifications.
      
      Original commit message:
      
          Avoid emitting redundant or unusable directories in DIFile metadata entries.
      
          As discussed on llvm-dev recently, Clang currently emits redundant
          directories in DIFile entries, such as
      
            .file      1 "/Volumes/Data/llvm" "/Volumes/Data/llvm/tools/clang/test/CodeGen/debug-info-abspath.c"
      
          This patch looks at any common prefix between the compilation
          directory and the (absolute) file path and strips the redundant
          part. More importantly it leaves the compilation directory empty if
          the two paths have no common prefix.
      
          After this patch the above entry is (assuming a compilation dir of "/Volumes/Data/llvm/_build"):
      
            .file 1 "/Volumes/Data/llvm" "tools/clang/test/CodeGen/debug-info-abspath.c"
      
          When building the FileCheck binary with debug info, this patch makes
          the build artifacts ~1kb smaller.
      
          Differential Revision: https://reviews.llvm.org/D55085
      
      llvm-svn: 348513
      212c104e
    • Adrian Prantl's avatar
      Reapply "Adapt gcov to changes in CFE." · fbeeac0e
      Adrian Prantl authored
      This reverts commit r348203 and reapplies D55085 with an additional
      GCOV bugfix to make the change NFC for relative file paths in .gcno files.
      
      Thanks to Ilya Biryukov for additional testing!
      
      Original commit message:
      
          Update Diagnostic handling for changes in CFE.
      
          The clang frontend no longer emits the current working directory for
          DIFiles containing an absolute path in the filename: and will move the
          common prefix between current working directory and the file into the
          directory: component.
      
          https://reviews.llvm.org/D55085
      
      llvm-svn: 348512
      fbeeac0e
    • Zachary Turner's avatar
      [build.py] Embed the output file name in generated object file names. · df0c7ec0
      Zachary Turner authored
      In compile-and-link mode, the user doesn't specify the name of the
      object files to generate, because there could be multiple inputs
      on a single command line and this would be hard to specify.  So the
      script just tries to be smart and figure out the best object file
      names.  However, if two build scripts are running in parallel and
      using the same source files as input, they would previously race
      to write the same object files, since the computed name only considered
      the source file names when computing the object file names.
      
      With this patch, we also consider the final executable name.  In a
      way, this "namespaces" the generated object files so that as long
      as the final executable file names don't clash, the intermediate
      object file names won't clash either.
      
      llvm-svn: 348511
      df0c7ec0
    • Evandro Menezes's avatar
      [AArch64] Fix Exynos predicate · 799b76ea
      Evandro Menezes authored
      Fix predicate for arithmetic instructions with shift and/or extend.
      
      llvm-svn: 348510
      799b76ea
    • Louis Dionne's avatar
      [libcxx] Add checks for unique value of array<T, 0>.begin() and array<T, 0>.end() · 7125b08d
      Louis Dionne authored
      The standard section [array.zero] requires the return value of begin()
      and end() methods of a zero-sized array to be unique. Eric Fiselier
      clarifies: "That unique value cannot be null, and must be properly aligned".
      This patch adds checks for the first part of this clarification: unique
      value returned by these methods cannot be null.
      
      Reviewed as https://reviews.llvm.org/D55366.
      Thanks to Andrey Maksimov for the patch.
      
      llvm-svn: 348509
      7125b08d
    • Sanjay Patel's avatar
      [DAGCombiner] don't hoist logic op if operands have other uses · c3717cd0
      Sanjay Patel authored
      The AVX512 diffs are neutral, but the bswap test shows a clear overreach in 
      hoistLogicOpWithSameOpcodeHands(). If we don't check for other uses, we can 
      increase the instruction count.
      
      This could also fight with transforms trying to go in the opposite direction 
      and possibly blow up/infinite loop. This might be enough to solve the bug 
      noted here:
      http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181203/608593.html
      
      I did not add the hasOneUse() checks to all opcodes because I see a perf 
      regression for at least one opcode. We may decide that's irrelevant in the
      face of potential compiler crashing, but I'll see if I can salvage that first.
      
      llvm-svn: 348508
      c3717cd0
    • Louis Dionne's avatar
      [libcxx] Add XFAILs for aligned allocation tests on AppleClang 9 · 2a23317e
      Louis Dionne authored
      Some people are still running the test suite using AppleClang 9.
      
      llvm-svn: 348507
      2a23317e
    • Sanjay Patel's avatar
      db6396b8
    • Zachary Turner's avatar
      [PDB] Move some code around. NFC. · a93458b0
      Zachary Turner authored
      llvm-svn: 348505
      a93458b0
    • Joel E. Denny's avatar
      [CUDA] Fix nvidia-cuda-toolkit detection on Ubuntu · 6dd34dc3
      Joel E. Denny authored
      This just extends D40453 (r319317) to Ubuntu.
      
      Reviewed By: Hahnfeld, tra
      
      Differential Revision: https://reviews.llvm.org/D55269
      
      llvm-svn: 348504
      6dd34dc3
    • Nico Weber's avatar
      [gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn · 1be23a90
      Nico Weber authored
      Tweak write_cmake_config.py to also handle variable references looking @FOO@
      (matching CMake's configure_file() function), and make it replace '\' 'n' in
      values with a newline literal since there's no good portable way of passing a
      real newline literal on a command line.
      
      Use that to process all the .def.in files in llvm/include/Config and add
      llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes
      them.
      
      Differential Revision: https://reviews.llvm.org/D55184
      
      llvm-svn: 348503
      1be23a90
    • Adrian Prantl's avatar
      Add another ArchSpec unit test. · 96f69637
      Adrian Prantl authored
      llvm-svn: 348502
      96f69637
    • Sanjay Patel's avatar
      [DAGCombiner] refactor function that hoists bitwise logic; NFCI · e9bf78fa
      Sanjay Patel authored
        
      Added FIXME and TODO comments for lack of safety checks.
      This function is a suspect in out-of-memory errors as discussed in
      the follow-up thread to r347917:
      http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181203/608593.html
      
      llvm-svn: 348501
      e9bf78fa
    • David Carlier's avatar
      [Sanitizer] getmntinfo support in FreeBSD · 51e820d0
      David Carlier authored
      Reviewers: krytarowski
      
      Reviewed By: krytarowski
      
      Differential Revision: https://reviews.llvm.org/D55354
      
      llvm-svn: 348500
      51e820d0
    • Zachary Turner's avatar
      Support skewed stream arrays. · 579264bd
      Zachary Turner authored
      VarStreamArray was built on the assumption that it is backed by a
      StreamRef, and offset 0 of that StreamRef is the first byte of the first
      record in the array.
      
      This is a logical and intuitive assumption, but unfortunately we have
      use cases where it doesn't hold. Specifically, a PDB module's symbol
      stream is prefixed by 4 bytes containing a magic value, and the first
      byte of record data in the array is actually at offset 4 of this byte
      sequence.
      
      Previously, we would just truncate the first 4 bytes and then construct
      the VarStreamArray with the resulting StreamRef, so that offset 0 of the
      underlying stream did correspond to the first byte of the first record,
      but this is problematic, because symbol records reference other symbol
      records by the absolute offset including that initial magic 4 bytes. So
      if another record wants to refer to the first record in the array, it
      would say "the record at offset 4".
      
      This led to extremely confusing hacks and semantics in loading code, and
      after spending 30 minutes trying to get some math right and failing, I
      decided to fix this in the underlying implementation of VarStreamArray.
      Now, we can say that a stream is skewed by a particular amount. This
      way, when we access a record by absolute offset, we can use the same
      values that the records themselves contain, instead of having to do
      fixups.
      
      Differential Revision: https://reviews.llvm.org/D55344
      
      llvm-svn: 348499
      579264bd
    • Simon Pilgrim's avatar
      [X86] Refactored IsSplatVector to use switch. NFCI. · bb650dae
      Simon Pilgrim authored
      Initial step towards making the function more generic (and probably move into SelectionDAG).
      
      This is necessary to avoid massive codegen bloat for PR38243 (Add modulo rotate support to LowerRotate).
      
      llvm-svn: 348498
      bb650dae
    • Alexey Bataev's avatar
      [DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are allowed. · 2e1a7821
      Alexey Bataev authored
      Summary:
      If the output of debug directives only is requested, we should drop
      emission of ',debug' option from the target directive. Required for
      supporting of nvprof profiler.
      
      Reviewers: echristo
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46061
      
      llvm-svn: 348497
      2e1a7821
    • Alexandros Lamprineas's avatar
      [GVN] Don't perform scalar PRE on GEPs · e4c91f5c
      Alexandros Lamprineas authored
      Partial Redundancy Elimination of GEPs prevents CodeGenPrepare from
      sinking the addressing mode computation of memory instructions back
      to its uses. The problem comes from the insertion of PHIs, which
      confuse CGP and make it bail.
      
      I've autogenerated the check lines of an existing test and added a
      store instruction to demonstrate the motivation behind this change.
      The store is now using the gep instead of a phi.
      
      Differential Revision: https://reviews.llvm.org/D55009
      
      llvm-svn: 348496
      e4c91f5c
    • Alexey Bataev's avatar
      [DEBUGINFO, NVPTX]Emit last debugging directives. · 64ad0ad5
      Alexey Bataev authored
      Summary:
      We may end up with not emitted debug directives at the end of the module
      emission. Patch fixes this problem emitting those last directives the
      end of the module emission.
      
      Reviewers: echristo
      
      Subscribers: jholewinski, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54320
      
      llvm-svn: 348495
      64ad0ad5
  2. Dec 06, 2018