1. Jul 20, 2018
    • Chen Zheng's avatar
      [NFC][testcases] fold sdiv if two operands are negated and non-overflow · 0f609db6
      Chen Zheng authored
      llvm-svn: 337549
      0f609db6
    • Florian Hahn's avatar
      Recommit r328307: [IPSCCP] Use constant range information for comparisons of parameters. · 0a560d5d
      Florian Hahn authored
      This version contains a fix to add values for which the state in ParamState change
      to the worklist if the state in ValueState did not change. To avoid adding the
      same value multiple times, mergeInValue returns true, if it added the value to
      the worklist. The value is added to the worklist depending on its state in
      ValueState.
      
      Original message:
      For comparisons with parameters, we can use the ParamState lattice
      elements which also provide constant range information. This improves
      the code for PR33253 further and gets us closer to use
      ValueLatticeElement for all values.
      
      Also, as we are using the range information in the solver directly, we
      do not need tryToReplaceWithConstantRange afterwards anymore.
      
      Reviewers: dberlin, mssimpso, davide, efriedma
      
      Reviewed By: mssimpso
      
      Differential Revision: https://reviews.llvm.org/D43762
      
      llvm-svn: 337548
      0a560d5d
    • Simon Pilgrim's avatar
      [X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDemandedVectorElts · 6fb8b68b
      Simon Pilgrim authored
      This is an early step towards using SimplifyDemandedVectorElts for target shuffle combining - this merely moves the existing X86ISD::VBROADCAST simplification code to use the SimplifyDemandedVectorElts mechanism.
      
      Adds X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode to handle X86ISD::VBROADCAST - in time we can support all target shuffles (and other ops) here.
      
      llvm-svn: 337547
      6fb8b68b
    • Simon Pilgrim's avatar
      Regenerate remainder test. · cbf5af12
      Simon Pilgrim authored
      llvm-svn: 337546
      cbf5af12
    • Chen Zheng's avatar
      [InstSimplify] fold srem instruction if its two operands are negated. · f801d0fe
      Chen Zheng authored
      Differential Revision: https://reviews.llvm.org/D49423
      
      llvm-svn: 337545
      f801d0fe
    • Pavel Labath's avatar
      [DebugInfo] Generate .debug_names section when it makes sense · f9adc20a
      Pavel Labath authored
      Summary:
      This patch makes us generate the debug_names section in response to some
      user-facing commands (previously it was only generated if explicitly
      selected via the -accel-tables option).
      
      My goal was to make this work for DWARF>=5 (as it's an official part of
      that standard), and also, as an extension, for DWARF<5 if one is
      explicitly tuning for lldb as a debugger (because it brings a large
      performance improvement there).
      
      This is slightly complicated by the fact that the debug_names tables are
      incompatible with the DWARF v4 type units (they assume that the type
      units are in the debug_info section), and unfortunately, right now we
      generate DWARF v4-style type units even for -gdwarf-5. For this reason,
      I disable all accelerator tables if the user requested type unit
      generation. I do this even for apple tables, as they have the same
      problem (in fact generating type units for apple targets makes us crash
      even before we get around to emitting the accelerator tables).
      
      Reviewers: JDevlieghere, aprantl, dblaikie, echristo, probinson
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49420
      
      llvm-svn: 337544
      f9adc20a
    • Chen Zheng's avatar
      35395a67
    • Ulrich Weigand's avatar
      [SystemZ] Test case formatting fixes · 9dd23b84
      Ulrich Weigand authored
      Fix systematically wrong whitespace from a prior automated change.
      
      NFC.
      
      llvm-svn: 337542
      9dd23b84
    • Sam McCall's avatar
      Revert "[LSV] Refactoring + supporting bitcasts to a type of different size" · 57743883
      Sam McCall authored
      This reverts commit r337489.
      It causes asserts to fire in some TensorFlow tests, e.g.
      tensorflow/compiler/tests/gather_test.py on GPU.
      
      Example stack trace:
      Start test case: GatherTest.testHigherRank
      assertion failed at third_party/llvm/llvm/lib/Support/APInt.cpp:819 in llvm::APInt llvm::APInt::trunc(unsigned int) const: width && "Can't truncate to 0 bits"
          @     0x5559446ebe10  __assert_fail
          @     0x55593ef32f5e  llvm::APInt::trunc()
          @     0x55593d78f86e  (anonymous namespace)::Vectorizer::lookThroughComplexAddresses()
          @     0x55593d78f2bc  (anonymous namespace)::Vectorizer::areConsecutivePointers()
          @     0x55593d78d128  (anonymous namespace)::Vectorizer::isConsecutiveAccess()
          @     0x55593d78c926  (anonymous namespace)::Vectorizer::vectorizeInstructions()
          @     0x55593d78c221  (anonymous namespace)::Vectorizer::vectorizeChains()
          @     0x55593d78b948  (anonymous namespace)::Vectorizer::run()
          @     0x55593d78b725  (anonymous namespace)::LoadStoreVectorizer::runOnFunction()
          @     0x55593edf4b17  llvm::FPPassManager::runOnFunction()
          @     0x55593edf4e55  llvm::FPPassManager::runOnModule()
          @     0x55593edf563c  (anonymous namespace)::MPPassManager::runOnModule()
          @     0x55593edf5137  llvm::legacy::PassManagerImpl::run()
          @     0x55593edf5b71  llvm::legacy::PassManager::run()
          @     0x55593ced250d  xla::gpu::IrDumpingPassManager::run()
          @     0x55593ced5033  xla::gpu::(anonymous namespace)::EmitModuleToPTX()
          @     0x55593ced40ba  xla::gpu::(anonymous namespace)::CompileModuleToPtx()
          @     0x55593ced33d0  xla::gpu::CompileToPtx()
          @     0x55593b26b2a2  xla::gpu::NVPTXCompiler::RunBackend()
          @     0x55593b21f973  xla::Service::BuildExecutable()
          @     0x555938f44e64  xla::LocalService::CompileExecutable()
          @     0x555938f30a85  xla::LocalClient::Compile()
          @     0x555938de3c29  tensorflow::XlaCompilationCache::BuildExecutable()
          @     0x555938de4e9e  tensorflow::XlaCompilationCache::CompileImpl()
          @     0x555938de3da5  tensorflow::XlaCompilationCache::Compile()
          @     0x555938c5d962  tensorflow::XlaLocalLaunchBase::Compute()
          @     0x555938c68151  tensorflow::XlaDevice::Compute()
          @     0x55593f389e1f  tensorflow::(anonymous namespace)::ExecutorState::Process()
          @     0x55593f38a625  tensorflow::(anonymous namespace)::ExecutorState::ScheduleReady()::$_1::operator()()
      *** SIGABRT received by PID 7798 (TID 7837) from PID 7798; ***
      
      llvm-svn: 337541
      57743883
    • Yaxun Liu's avatar
      Sema: Fix explicit address space cast in C++ · 99a9f759
      Yaxun Liu authored
      Currently clang does not allow implicit cast of a pointer to a pointer type
      in different address space but allows C-style cast of a pointer to a pointer
      type in different address space. However, there is a bug in Sema causing
      incorrect Cast Expr in AST for the latter case, which in turn results in
      invalid LLVM IR in codegen.
      
      This is because Sema::IsQualificationConversion returns true for a cast of
      pointer to a pointer type in different address space, which in turn allows
      a standard conversion and results in a cast expression with no op in AST.
      
      This patch fixes that by let Sema::IsQualificationConversion returns false
      for a cast of pointer to a pointer type in different address space, which
      in turn disallows standard conversion, implicit cast, and static cast.
      Finally it results in an reinterpret cast and correct conversion kind is set.
      
      Differential Revision: https://reviews.llvm.org/D49294
      
      llvm-svn: 337540
      99a9f759
    • Florian Hahn's avatar
      [UBSan] Also use blacklist for 'Address; Undefined' setting · 5c608154
      Florian Hahn authored
      It looks like currently the UBSan blacklist is only applied when "Undefined" is selected.
      This patch updates the cmake file to apply it whenever Undefined is selected
       (e.g. 'Address; Undefined' ). This  allows us to use the workaround added in
      rL335525 when using AddressSan and UBSan together.
      
      Reviewers: eugenis, vitalybuka
      
      Reviewed By: eugenis
      
      Differential Revision: https://reviews.llvm.org/D49558
      
      llvm-svn: 337539
      5c608154
    • Jonas Paulsson's avatar
      [SystemZ] Reimplent SchedModel IssueWidth and WriteRes/ReadAdvance mappings. · c88d3f6a
      Jonas Paulsson authored
      As a consequence of recent discussions
      (http://lists.llvm.org/pipermail/llvm-dev/2018-May/123164.html), this patch
      changes the SystemZ SchedModels so that the IssueWidth is 6, which is the
      decoder capacity, and NumMicroOps become the number of decoder slots needed
      per instruction.
      
      In addition, the SchedWrite latencies now match the MachineInstructions
      def-operand indexes, and ReadAdvances have been added on instructions with
      one register operand and one memory operand.
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D47008
      
      llvm-svn: 337538
      c88d3f6a
    • Andrew V. Tischenko's avatar
      Improved sched model for X86 BSWAP* instrs. · ee2e3144
      Andrew V. Tischenko authored
      Differential Revision: https://reviews.llvm.org/D49477
      
      llvm-svn: 337537
      ee2e3144
    • David Carlier's avatar
      [Xray] fix c99 warning build about flexible array semantics · 12be7b7b
      David Carlier authored
      Reviewers: dberris
      
      Reviewed By: dberris
      
      Differential Revision: https://reviews.llvm.org/D49590
      
      llvm-svn: 337536
      12be7b7b
    • Matt Arsenault's avatar
      Reapply "AMDGPU: Fix handling of alignment padding in DAG argument lowering" · 4bec7d42
      Matt Arsenault authored
      Reverts r337079 with fix for msan error.
      
      llvm-svn: 337535
      4bec7d42
    • Sander de Smalen's avatar
      [AArch64][SVE] Asm: Support for bit/byte reverse operations. · 33f588ac
      Sander de Smalen authored
      This patch adds the following instructions:
      
        RBIT      reverse bits within each active elemnt (predicated), e.g.
                      rbit z0.d, p0/m, z1.d
      
                  for 8, 16, 32 and 64 bit elements.
      
        REV       reverse order of elements in data/predicate vector
                  (unpredicated), e.g.
                      rev z0.d, z1.d
                      rev p0.d, p1.d
      
                  for 8, 16, 32 and 64 bit elements.
      
        REVB      reverse order of bytes within each active element, e.g.
                      revb z0.d, p0/m, z1.d
      
                  for 16, 32 and 64 bit elements.
      
        REVH      reverse order of 16-bit half-words within each active
                  element, e.g.
                      revh z0.d, p0/m, z1.d
      
                  for 32 and 64 bit elements.
      
        REVW      reverse order of 32-bit words within each active element,
                  e.g.
                      revw z0.d, p0/m, z1.d
      
                  for 64 bit elements.
      
      llvm-svn: 337534
      33f588ac
    • Sander de Smalen's avatar
      [AArch64][SVE] Asm: Support for FTMAD instruction. · 3ed7f81c
      Sander de Smalen authored
      Floating-point trigonometric multiply-add coefficient,
      e.g.
      
        ftmad z0.h, z0.h, z1.h, #7
      
      with variants for 16, 32 and 64-bit elements.
      
      llvm-svn: 337533
      3ed7f81c
    • Eric Fiselier's avatar
      adjust incorrect comment · dc3c62f3
      Eric Fiselier authored
      llvm-svn: 337532
      dc3c62f3
    • Dmitry Vyukov's avatar
      sanitizers: consistently check result of MmapFixedNoReserve · f52726aa
      Dmitry Vyukov authored
      MmapFixedNoReserve does not terminate process on failure.
      Failure to check its result and die will always lead to harder
      to debug crashes later in execution. This was observed in Go
      processes due to some address space conflicts.
      
      Consistently check result of MmapFixedNoReserve.
      While we are here also add warn_unused_result attribute
      to prevent such bugs in future and change return type to bool
      as that's what all callers want.
      
      Reviewed in https://reviews.llvm.org/D49367
      
      llvm-svn: 337531
      f52726aa
    • Fangrui Song's avatar
      Change \t to spaces · 99337e24
      Fangrui Song authored
      llvm-svn: 337530
      99337e24
    • Eric Liu's avatar
      [Index] Set OrigD before D is changed. · 3e0051bb
      Eric Liu authored
      Reviewers: akyrtzi, arphaman
      
      Reviewed By: akyrtzi
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D49476
      
      llvm-svn: 337529
      3e0051bb
    • George Rimar's avatar
      [ELF] - Fix mistypes in test cases. · c2c7d154
      George Rimar authored
      llvm-svn: 337528
      c2c7d154
    • Sam McCall's avatar
      [clangd] FuzzyMatch exposes an API for its word segmentation. NFC · f7d18051
      Sam McCall authored
      Summary: This is intended to be used for indexing, e.g. in D49417
      
      Reviewers: ioeric, omtcyfz
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D49540
      
      llvm-svn: 337527
      f7d18051
    • Martin Storsjo's avatar
      [COFF] Write the debug directory and build id to a separate section for MinGW · a55fc716
      Martin Storsjo authored
      For dwarf debug info, an executable normally either contains the debug
      info, or it is stripped out. To reduce the storage needed (slightly)
      for the debug info kept separately from the released, stripped binaries,
      one can choose to only copy the debug data from the original executable
      (essentially the reverse of the strip operation), producing a file with
      only debug info.
      
      When copying the debug data from an executable with GNU objcopy,
      the build id and debug directory need to reside in a separate section,
      as this will be kept while the rest of the .rdata section is removed.
      
      Differential Revision: https://reviews.llvm.org/D49352
      
      llvm-svn: 337526
      a55fc716
    • John McCall's avatar
      Document -fobjc-weak as an extension. · ea9c5809
      John McCall authored
      Fixes rdar://24091053.
      
      llvm-svn: 337525
      ea9c5809
    • John McCall's avatar
      Fix and improve the ARC spec's wording about unmanaged objects. · 07fa4a49
      John McCall authored
      llvm-svn: 337524
      07fa4a49
    • Stephen Canon's avatar
      Add x86_64-unkown triple to llc for x86 test. · 34f58673
      Stephen Canon authored
      llvm-svn: 337523
      34f58673
    • Joel E. Denny's avatar
      [libFuzzer] Use separate test directory for each config · a47cb644
      Joel E. Denny authored
      Previously, check-all failed many tests for me.  It was running the
      X86_64DefaultLinuxConfig, X86_64LibcxxLinuxConfig, and
      X86_64StaticLibcxxLinuxConfig configs out of
      llvm-build/projects/compiler-rt/test/fuzzer.  Now, it runs them out of
      separate subdirectories there, and most tests pass.
      
      Reviewed By: morehouse, george.karpenkov
      
      Differential Revision: https://reviews.llvm.org/D49249
      
      llvm-svn: 337521
      a47cb644
    • Eric Fiselier's avatar
      Fix two test failures in <experimental/filesystem> · 3bf90e78
      Eric Fiselier authored
      First, <experimental/filesystem> didn't correctly guard
      against min/max macros. This adds the proper push/pop macro guards.
      
      Second, an internal time helper had been renamed but the test for
      it hadn't been updated. This patch updates those tests.
      
      llvm-svn: 337520
      3bf90e78
    • Eric Fiselier's avatar
    • Craig Topper's avatar
      [DAGCombiner] Fold X - (-Y *Z) -> X + (Y * Z) · d8734450
      Craig Topper authored
      llvm-svn: 337518
      d8734450
    • Eric Fiselier's avatar
      cleanup test assertion inside library · 4902bde5
      Eric Fiselier authored
      llvm-svn: 337517
      4902bde5
    • Eric Fiselier's avatar
      [libc++] Implement Directory Entry Caching -- Sort of. · c1699864
      Eric Fiselier authored
      Summary:
      This patch implements directory_entry caching *almost* as specified in P0317r1. However, I explicitly chose to deviate from the standard as I'll explain below.
      
      The approach I decided to take is a fully caching one. When `refresh()` is called, the cache is populated by calls to `stat` and `lstat` as needed.
      During directory iteration the cache is only populated with the `file_type` as reported by `readdir`.
      The cache can be in the following states:
      
      * `_Empty`: There is nothing in the cache (likely due to an error)
      * `_IterSymlink`: Created by directory iteration when we walk onto a symlink only the symlink file type is known.
      * `_IterNonSymlink`: Created by directory iteration when we walk onto a non-symlink. Both the regular file type and symlink file type are known.
      * `_RefreshSymlink` and `_RefreshNonSymlink`: A full cache created by `refresh()`.  This case includes dead symlinks.
      * `_RefreshSymlinkUnresolved`: A partial cache created by refresh when we fail to resolve the file pointed to by a symlink (likely due to permissions). Symlink attributes are cached, but attributes about the linked entity are not.
      
      As mentioned, this implementation purposefully deviates from the standard. According to some readings of the specification, and the Windows filesystem implementation, the constructors and modifiers which don't pass an `error_code` must throw when the `directory_entry` points to a entity which doesn't exist. or when attribute resolution fails for another reason. 
      
      @BillyONeal  has proposed a more reasonable set of requirements, where modifiers other than refresh ignore errors. This is the behavior libc++ currently implements, with the expectation some form of the new language will be accepted into the standard.
      
      Some additional semantics which differ from the Windows implementation:
      
      1. `refresh` will not throw when the entry doesn't exist. In this case we can still meet the functions specification, so we don't treat it as an error.
      2. We don't clear the path name when a constructor fails via refresh (this will hopefully be changed in the standard as well).
      
      It should be noted that libstdc++'s current implementation has the same behavior as libc++, except for point (2).
      
      If the changes to the specification don't get accepted, we'll be able to make the changes later.
      
      [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0317r1.html
      
      Reviewers: mclow.lists, gromer, ldionne, aaron.ballman
      
      Subscribers: BillyONeal, christof, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D49530
      
      llvm-svn: 337516
      c1699864
    • Jim Ingham's avatar
      Defend LoadImageUsingPaths against a path list · 40fa4a1a
      Jim Ingham authored
      with empty paths on it.
      
      llvm-svn: 337515
      40fa4a1a
    • Duncan P. N. Exon Smith's avatar
      Reapply "ADT: Shrink size of SmallVector by 8B on 64-bit platforms" · c03b04d5
      Duncan P. N. Exon Smith authored
      I'm optimistically reverting commit r337511, effectively reapplying
      r337504 *without* changes.
      
      The failing bots that had `SmallVector` in the backtrace recovered after
      the unrelated commit r337508.  The backtraces looked bogus anyway, with
      `SmallVector::size()` calling (e.g.) `ConstantArray::get()`.
      
      Here's the original commit message:
      
          ADT: Shrink size of SmallVector by 8B on 64-bit platforms
      
          Represent size and capacity directly as unsigned and calculate
          `end()` using `begin() + size()`.
      
          This limits the maximum size/capacity of a vector to UINT32_MAX.
      
          https://reviews.llvm.org/D48518
      
      llvm-svn: 337514
      c03b04d5
    • Michael J. Spencer's avatar
      Revert "[docs] Add support for Markdown documentation in Sphinx" · caefe42c
      Michael J. Spencer authored
      The buildbots have an old version of Sphinx (need at least 1.3).  Revert until they are upgraded.
      
      llvm-svn: 337513
      caefe42c
    • Heejin Ahn's avatar
      [WebAssembly] Disable a test that violates DR1696 · 022a37af
      Heejin Ahn authored
      Summary:
      lifetime2.C violates DR1696, which prevents reference members from being
      initialized to temporaries, whose lifetime would end at the end of ctor.
      
      Reviewers: sbc100
      
      Subscribers: dschuff, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49577
      
      llvm-svn: 337512
      022a37af
    • Duncan P. N. Exon Smith's avatar
      Revert "ADT: Shrink size of SmallVector by 8B on 64-bit platforms" · 42f20f3c
      Duncan P. N. Exon Smith authored
      This reverts commit r337504 while I investigate a TSan bot failure that
      seems related:
      
      http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/26526
      
          #8 0x000055581f2895d8 (/b/sanitizer-x86_64-linux-autoconf/build/tsan_debug_build/bin/clang-7+0x1eb45d8)
          #9 0x000055581f294323 llvm::ConstantAggrKeyType<llvm::ConstantArray>::create(llvm::ArrayType*) const /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/ConstantsContext.h:409:0
          #10 0x000055581f294323 llvm::ConstantUniqueMap<llvm::ConstantArray>::create(llvm::ArrayType*, llvm::ConstantAggrKeyType<llvm::ConstantArray>, std::pair<unsigned int, std::pair<llvm::ArrayType*, llvm::ConstantAggrKeyType<llvm::ConstantArray> > >&) /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/ConstantsContext.h:635:0
          #11 0x000055581f294323 llvm::ConstantUniqueMap<llvm::ConstantArray>::getOrCreate(llvm::ArrayType*, llvm::ConstantAggrKeyType<llvm::ConstantArray>) /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/ConstantsContext.h:654:0
          #12 0x000055581f2944cb llvm::ConstantArray::get(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>) /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/Constants.cpp:964:0
          #13 0x000055581fa27e19 llvm::SmallVectorBase::size() const /b/sanitizer-x86_64-linux-autoconf/build/llvm/include/llvm/ADT/SmallVector.h:53:0
          #14 0x000055581fa27e19 llvm::SmallVectorImpl<llvm::Constant*>::resize(unsigned long) /b/sanitizer-x86_64-linux-autoconf/build/llvm/include/llvm/ADT/SmallVector.h:347:0
          #15 0x000055581fa27e19 (anonymous namespace)::EmitArrayConstant(clang::CodeGen::CodeGenModule&, clang::ConstantArrayType const*, llvm::Type*, unsigned int, llvm::SmallVectorImpl<llvm::Constant*>&, llvm::Constant*) /b/sanitizer-x86_64-linux-autoconf/build/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp:669:0
      
      llvm-svn: 337511
      42f20f3c
    • Chandler Carruth's avatar
      [x86/SLH] Clean up helper naming for return instruction handling and · a3a03ac2
      Chandler Carruth authored
      remove dead declaration of a call instruction handling helper.
      
      This moves to the 'harden' terminology that I've been trying to settle
      on for returns. It also adds a really detailed comment explaining what
      all we're trying to accomplish with return instructions and why.
      Hopefully this makes it much more clear what exactly is being
      "hardened".
      
      Differential Revision: https://reviews.llvm.org/D49571
      
      llvm-svn: 337510
      a3a03ac2
    • Michael J. Spencer's avatar
      [docs] Add support for Markdown documentation in Sphinx · 326ffb70
      Michael J. Spencer authored
      Differential Revision: https://reviews.llvm.org/D44910
      
      llvm-svn: 337509
      326ffb70