Skip to content
  1. Sep 16, 2017
  2. Sep 15, 2017
    • Reid Kleckner's avatar
      [DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs · 3a66c1cb
      Reid Kleckner authored
      Summary:
      This comes up in optimized debug info for C++ programs that pass and
      return objects indirectly by address. In these programs,
      llvm.dbg.declare survives optimization, which causes us to emit indirect
      DBG_VALUE instructions. The fast register allocator knows to insert
      DW_OP_deref when spilling indirect DBG_VALUE instructions, but the
      LiveDebugVariables did not until this change.
      
      This fixes part of PR34513. I need to look into why this doesn't work at
      -O0 and I'll send follow up patches to handle that.
      
      Reviewers: aprantl, dblaikie, probinson
      
      Subscribers: qcolombet, hiraditya, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D37911
      
      llvm-svn: 313400
      3a66c1cb
    • Reid Kleckner's avatar
      [DebugInfo] Add missing DW_OP_deref when an NRVO pointer is spilled · 9e6c309e
      Reid Kleckner authored
      Summary:
      Fixes PR34513.
      
      Indirect DBG_VALUEs typically come from dbg.declares of non-trivially
      copyable C++ objects that must be passed by address. We were already
      handling the case where the virtual register gets allocated to a
      physical register and is later spilled. That's what usually happens for
      normal parameters that aren't NRVO variables: they usually appear in
      physical register parameters, and are spilled later in the function,
      which would correctly add deref.
      
      NRVO variables are different because the dbg.declare can come much later
      after earlier instructions cause the incoming virtual register to be
      spilled.
      
      Also, clean up this code. We only need to look at the first operand of a
      DBG_VALUE, which eliminates the operand loop.
      
      Reviewers: aprantl, dblaikie, probinson
      
      Subscribers: MatzeB, qcolombet, llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D37929
      
      llvm-svn: 313399
      9e6c309e
    • Steven Wu's avatar
      [AutoUpgrade] Fix a compatibility issue with module flag · ab211df5
      Steven Wu authored
      Summary:
      After r304661, module flag to record objective-c image info section is
      encoded without whitespaces after comma. The new name is equivalent to
      the old one, except that when LTO a module built by old compiler and a
      module built by a new compiler, it will fail with conflicting values.
      
      Fix the issue by removing whitespaces in bitcode upgrade path.
      
      rdar://problem/34416934
      
      Reviewers: compnerd
      
      Reviewed By: compnerd
      
      Subscribers: mehdi_amini, hans, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D37909
      
      llvm-svn: 313398
      ab211df5
    • Reid Kleckner's avatar
      Fix build for LLVM unittests · 1efbe2eb
      Reid Kleckner authored
      llvm-svn: 313397
      1efbe2eb
    • Sam Clegg's avatar
      [WebAssembly] MC: Create wasm data segments based on MCSections · 759631c7
      Sam Clegg authored
      This means that we can honor -fdata-sections rather than
      always creating a segment for each symbol.
      
      It also allows for a followup change to add .init_array and friends.
      
      Differential Revision: https://reviews.llvm.org/D37876
      
      llvm-svn: 313395
      759631c7
    • Davide Italiano's avatar
      [ConstantFold] Return the correct type when folding a GEP with vector indices. · dee018c5
      Davide Italiano authored
      As Eli pointed out (and I got wrong in the first place), langref says: "The
      getelementptr returns a vector of pointers, instead of a single address, when one
      or more of its arguments is a vector. In such cases, all vector arguments should
      have the same number of elements, and every scalar argument will be effectively
      broadcast into a vector during address calculation."
      
      Costantfold for gep doesn't really take in account this paragraph, returning a
      pointer instead of a vector of pointer which triggers an assertion in RAUW,
      as we're trying to replace values with mistmatching types.
      
      Differential Revision:  https://reviews.llvm.org/D37928
      
      llvm-svn: 313394
      dee018c5
    • Sam Clegg's avatar
      Change encodeU/SLEB128 to pad to certain number of bytes · 66a99e41
      Sam Clegg authored
      Previously the 'Padding' argument was the number of padding
      bytes to add. However most callers that use 'Padding' know
      how many overall bytes they need to write.  With the previous
      code this would mean encoding the LEB once to find out how
      many bytes it would occupy and then using this to calulate
      the 'Padding' value.
      
      See: https://reviews.llvm.org/D36595
      
      Differential Revision: https://reviews.llvm.org/D37494
      
      llvm-svn: 313393
      66a99e41
    • Vivek Pandya's avatar
      This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352 · b5ab895e
      Vivek Pandya authored
      It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with
      command line options.
      The diagnostic handler used to be callback now this patch adds a class
      DiagnosticHandler. It has virtual method to provide custom diagnostic handler
      and methods to control which particular remarks are enabled. 
      However LLVM-C API users can still provide callback function for diagnostic handler.
      
      llvm-svn: 313390
      b5ab895e
    • Mandeep Singh Grang's avatar
      [llvm] Fix some typos. NFC. · 1be19e6f
      Mandeep Singh Grang authored
      Reviewers: mcrosier
      
      Reviewed By: mcrosier
      
      Subscribers: mcrosier, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D37922
      
      llvm-svn: 313388
      1be19e6f
    • Vivek Pandya's avatar
      This reverts r313381 · df8598dc
      Vivek Pandya authored
      llvm-svn: 313387
      df8598dc
    • Sam Clegg's avatar
      [WebAssembly] Pass ArrayRef rather than SmallVector · 457fb0b4
      Sam Clegg authored
      This is more flexible and less verbose.
      
      Differential Revision: https://reviews.llvm.org/D37875
      
      llvm-svn: 313384
      457fb0b4
    • Adam Nemet's avatar
      Improve comment · 93d172f2
      Adam Nemet authored
      llvm-svn: 313383
      93d172f2
    • Vivek Pandya's avatar
      This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352 · 00d88744
      Vivek Pandya authored
      It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with
      command line options.
      The diagnostic handler used to be callback now this patch adds a class
      DiagnosticHandler. It has virtual method to provide custom diagnostic handler
      and methods to control which particular remarks are enabled. 
      However LLVM-C API users can still provide callback function for diagnostic handler.
      
      llvm-svn: 313382
      00d88744
    • Sam Clegg's avatar
      [WebAssembly] MC: Fix crash in getProvitionalValue on weak references · aff1c4df
      Sam Clegg authored
      - Create helper function for resolving weak references.
      - Add test that preproduces the crash.
      
      Differential Revision: https://reviews.llvm.org/D37916
      
      llvm-svn: 313381
      aff1c4df
    • Krzysztof Parzyszek's avatar
      Fix selecting legal types in TypeInfer::getLegalTypes · 89291f2a
      Krzysztof Parzyszek authored
      Collect all legal types for all modes.
      
      llvm-svn: 313380
      89291f2a
    • Hans Wennborg's avatar
      Revert r313343 "[X86] PR32755 : Improvement in CodeGen instruction selection for LEAs." · 534bfbd3
      Hans Wennborg authored
      This caused PR34629: asserts firing when building Chromium. It also broke some
      buildbots building test-suite as reported on the commit thread.
      
      > Summary:
      >    1/  Operand folding during complex pattern matching for LEAs has been
      >        extended, such that it promotes Scale to accommodate similar operand
      >        appearing in the DAG.
      >        e.g.
      >           T1 = A + B
      >           T2 = T1 + 10
      >           T3 = T2 + A
      >        For above DAG rooted at T3, X86AddressMode will no look like
      >           Base = B , Index = A , Scale = 2 , Disp = 10
      >
      >    2/  During OptimizeLEAPass down the pipeline factorization is now performed over LEAs
      >        so that if there is an opportunity then complex LEAs (having 3 operands)
      >        could be factored out.
      >        e.g.
      >           leal 1(%rax,%rcx,1), %rdx
      >           leal 1(%rax,%rcx,2), %rcx
      >        will be factored as following
      >           leal 1(%rax,%rcx,1), %rdx
      >           leal (%rdx,%rcx)   , %edx
      >
      >    3/ Aggressive operand folding for AM based selection for LEAs is sensitive to loops,
      >       thus avoiding creation of any complex LEAs within a loop.
      >
      > Reviewers: lsaba, RKSimon, craig.topper, qcolombet
      >
      > Reviewed By: lsaba
      >
      > Subscribers: spatel, igorb, llvm-commits
      >
      > Differential Revision: https://reviews.llvm.org/D35014
      
      llvm-svn: 313376
      534bfbd3
    • Adrian Prantl's avatar
      Fix indentation. · ea857d4c
      Adrian Prantl authored
      llvm-svn: 313375
      ea857d4c
    • Eric Beckmann's avatar
      Fix Bug 30978 by emitting cv file checksums. · 349746f0
      Eric Beckmann authored
      Summary:
      The checksums had already been placed in the IR, this patch allows
      MCCodeView to actually write it out to an MCStreamer.
      
      Subscribers: llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D37157
      
      llvm-svn: 313374
      349746f0
    • Craig Topper's avatar
      [X86] Prefer VPERMQ over VPERM2F128 for any unary shuffle, not just the ones... · 7a183e27
      Craig Topper authored
      [X86] Prefer VPERMQ over VPERM2F128 for any unary shuffle, not just the ones that can be done with a insertf128
      
      The early out for AVX2 in lowerV2X128VectorShuffle is positioned in a weird spot below some shuffle mask equivalency checks.
      
      But I think we want to allow VPERMQ for any unary shuffle.
      
      Differential Revision: https://reviews.llvm.org/D37893
      
      llvm-svn: 313373
      7a183e27
    • Adrian Prantl's avatar
      llvm-dwarfdump: Factor out the printing of the section header (NFC) · 8416802e
      Adrian Prantl authored
      llvm-svn: 313370
      8416802e
    • Simon Pilgrim's avatar
      Fix typo in vector reduction costs comment. NFCI. · a5b3bc6d
      Simon Pilgrim authored
      llvm-svn: 313368
      a5b3bc6d
    • Craig Topper's avatar
      [X86] Use SDNode::ops() instead of makeArrayRef and op_begin(). NFCI · f1620b25
      Craig Topper authored
      llvm-svn: 313367
      f1620b25
    • Craig Topper's avatar
      [X86] Don't create i64 constants on 32-bit targets when lowering v64i1 constant build vectors · e0d724cf
      Craig Topper authored
      When handling a v64i1 build vector of constants on 32-bit targets we were creating an illegal i64 constant that we then bitcasted back to v64i1. We need to instead create two 32-bit constants, bitcast them to v32i1 and concat the result. We should also take care to handle the halves being all zeros/ones after the split.
      
      This patch splits the build vector and then recursively lowers the two pieces. This allows us to handle the all ones and all zeros cases with minimal effort. Ideally we'd just do the split and concat, and let lowering get called again on the new nodes, but getNode has special handling for CONCAT_VECTORS that reassembles the pieces back into a single BUILD_VECTOR. Hopefully the two temporary BUILD_VECTORS we had to create to do this that don't get returned don't cause any issues.
      
      Fixes PR34605.
      
      Differential Revision: https://reviews.llvm.org/D37858
      
      llvm-svn: 313366
      e0d724cf
    • Craig Topper's avatar
      [X86] Add isel pattern infrastructure to begin recognizing when we're... · 143797eb
      Craig Topper authored
      [X86] Add isel pattern infrastructure to begin recognizing when we're inserting 0s into the upper portions of a vector register and the producing instruction as already produced the zeros.
      
      Currently if we're inserting 0s into the upper elements of a vector register we insert an explicit move of the smaller register to implicitly zero the upper bits. But if we can prove that they are already zero we can skip that. This is based on a similar idea of what we do to avoid emitting explicit zero extends for GR32->GR64.
      
      Unfortunately, this is harder for vector registers because there are several opcodes that don't have VEX equivalent instructions, but can write to XMM registers. Among these are SHA instructions and a MMX->XMM move. Bitcasts can also get in the way.
      
      So for now I'm starting with explicitly allowing only VPMADDWD because we emit zeros in combineLoopMAddPattern. So that is placing extra instruction into the reduction loop.
      
      I'd like to allow PSADBW as well after D37453, but that's currently blocked by a bitcast. We either need to peek through bitcasts or canonicalize insert_subvectors with zeros to remove bitcasts on the value being inserted.
      
      Longer term we should probably have a cleanup pass that removes superfluous zeroing moves even when the producer is in another basic block which is something these isel tricks can't do. See PR32544.
      
      Differential Revision: https://reviews.llvm.org/D37653
      
      llvm-svn: 313365
      143797eb
    • Anna Thomas's avatar
      [RuntimeUnroll] Add heuristic for unrolling multi-exit loop · f34537df
      Anna Thomas authored
      Add a profitability heuristic to enable runtime unrolling of multi-exit
      loop: There can be atmost two unique exit blocks for the loop and the
      second exit block should be a deoptimizing block. Also, there can be one
      other exiting block other than the latch exiting block. The reason for
      the latter is so that we limit the number of branches in the unrolled
      code to being at most the unroll factor.  Deoptimizing blocks are rarely
      taken so these additional number of branches created due to the
      unrolling are predictable, since one of their target is the deopt block.
      
      Reviewers: apilipenko, reames, evstupac, mkuper
      
      Subscribers: llvm-commits
      
      Reviewed by: reames
      
      Differential Revision: https://reviews.llvm.org/D35380
      
      llvm-svn: 313363
      f34537df
    • Krzysztof Parzyszek's avatar
      [Hexagon] Switch to parameterized register classes for HVX · 55772976
      Krzysztof Parzyszek authored
      This removes the duplicate HVX instruction set for the 128-byte mode.
      Single instruction set now works for both modes (64- and 128-byte).
      
      llvm-svn: 313362
      55772976
    • Ilya Biryukov's avatar
      Added optional validation of svn sources to Dockerfiles. · 8b62e088
      Ilya Biryukov authored
      Summary: This commit also adds a script to compute sha256 hashes of llvm checkouts.
      
      Reviewers: klimek, mehdi_amini
      
      Reviewed By: klimek
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D37099
      
      llvm-svn: 313359
      8b62e088
    • Anna Thomas's avatar
      [RuntimeUnrolling] Populate the VMap entry correctly when default generated through lookup · 512dde77
      Anna Thomas authored
      During runtime unrolling on loops with multiple exits, we update the
      exit blocks with the correct phi values from both original and remainder
      loop.
      In this process, we lookup the VMap for the mapped incoming phi values,
      but did not update the VMap if a default entry was generated in the VMap
      during the lookup. This default value is generated when constants or
      values outside the current loop are looked up.
      This patch fixes the assertion failure when null entries are present in
      the VMap because of this lookup. Added a testcase that showcases the
      problem.
      
      llvm-svn: 313358
      512dde77
    • Alexander Kornienko's avatar
      Remove unneeded forward declaration. NFC · 2a3209ed
      Alexander Kornienko authored
      llvm-svn: 313357
      2a3209ed
    • Alexander Kornienko's avatar
      Add a ReleaseNotes blurb for Execute.*Wait API change · 3cd2ce1e
      Alexander Kornienko authored
      ... in r313155, r313156.
      
      llvm-svn: 313356
      3cd2ce1e
    • Simon Pilgrim's avatar
      [X86][SSE] Add test cases vector for integer multiplies · 905e79c4
      Simon Pilgrim authored
      Mainly inspired by PR34474 / D37896
      
      llvm-svn: 313353
      905e79c4
    • Ilya Biryukov's avatar
      Revert "[SLPVectorizer] Failure to beneficially vectorize 'copyable' elements... · d23faa84
      Ilya Biryukov authored
      Revert "[SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in integer binary ops."
      
      This reverts commit r313348.
      
      Reason: it caused buildbot failures.
      llvm-svn: 313352
      d23faa84
    • Sjoerd Meijer's avatar
      [AArch64] allow v8f16 types when FullFP16 is supported · 0c5ba21c
      Sjoerd Meijer authored
      This adds support for allowing v8f16 vector types, thus avoiding conversions
      from/to single precision for these types. This is a follow up patch of
      commits r311154 and r312104, which added support for scalars and v4f16
      types, respectively.
      
      Differential Revision: https://reviews.llvm.org/D37802
      
      llvm-svn: 313351
      0c5ba21c
    • Jonas Paulsson's avatar
      Recommit "[RegAlloc] Make sure live-ranges reflect the state of the IR when · 6188f326
      Jonas Paulsson authored
               removing them"
      
      This was temporarily reverted, but now that the fix has been commited (r313197)
      it should be put back in place.
      
      https://bugs.llvm.org/show_bug.cgi?id=34502
      
      This reverts commit 9ef93d9dc4c51568e858cf8203cd2c5ce8dca796.
      
      llvm-svn: 313349
      6188f326
    • Dinar Temirbulatov's avatar
      [SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in integer binary ops. · e2358b53
      Dinar Temirbulatov authored
      Patch tries to improve vectorization of the following code:
      
      void add1(int * __restrict dst, const int * __restrict src) {
        *dst++ = *src++;
        *dst++ = *src++ + 1;
        *dst++ = *src++ + 2;
        *dst++ = *src++ + 3;
      }
      Allows to vectorize even if the very first operation is not a binary add, but just a load.
      
      Reviewers: spatel, mzolotukhin, mkuper, hfinkel, RKSimon, filcab, ABataev, davide
      
      Subscribers: llvm-commits, RKSimon
      
      Differential Revision: https://reviews.llvm.org/D28907
      
      llvm-svn: 313348
      e2358b53
    • Lang Hames's avatar
      [ORC] Fix a typo. · d4d6a1aa
      Lang Hames authored
      llvm-svn: 313346
      d4d6a1aa
    • Jatin Bhateja's avatar
      [X86] PR32755 : Improvement in CodeGen instruction selection for LEAs. · 908c8b37
      Jatin Bhateja authored
      Summary:
         1/  Operand folding during complex pattern matching for LEAs has been
             extended, such that it promotes Scale to accommodate similar operand
             appearing in the DAG.
             e.g.
                T1 = A + B
                T2 = T1 + 10
                T3 = T2 + A
             For above DAG rooted at T3, X86AddressMode will no look like
                Base = B , Index = A , Scale = 2 , Disp = 10
      
         2/  During OptimizeLEAPass down the pipeline factorization is now performed over LEAs
             so that if there is an opportunity then complex LEAs (having 3 operands)
             could be factored out.
             e.g.
                leal 1(%rax,%rcx,1), %rdx
                leal 1(%rax,%rcx,2), %rcx
             will be factored as following
                leal 1(%rax,%rcx,1), %rdx
                leal (%rdx,%rcx)   , %edx
      
         3/ Aggressive operand folding for AM based selection for LEAs is sensitive to loops,
            thus avoiding creation of any complex LEAs within a loop.
      
      Reviewers: lsaba, RKSimon, craig.topper, qcolombet
      
      Reviewed By: lsaba
      
      Subscribers: spatel, igorb, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35014
      
      llvm-svn: 313343
      908c8b37
    • Dinar Temirbulatov's avatar
Loading