1. May 01, 2018
  2. Apr 30, 2018
    • Andrea Di Biagio's avatar
      [llvm-mca] Correctly handle zero-latency stores that consume pipeline resources. · e047d352
      Andrea Di Biagio authored
      This fixes PR37293.
      
      We can have scheduling classes with no write latency entries, that still consume
      processor resources. We don't want to treat those instructions as zero-latency
      instructions; they still have to be issued to the underlying pipelines, so they
      still consume resource cycles.
      
      This is likely to be a regression which I have accidentally introduced at
      revision 330807. Now, if an instruction has a non-empty set of write processor
      resources, we conservatively treat it as a normal (i.e. non zero-latency)
      instruction.
      
      llvm-svn: 331193
      e047d352
    • Ulrich Weigand's avatar
      [SystemZ] Refactor some VT casts in DAG match patterns · 79e5cd2f
      Ulrich Weigand authored
      In patterns where we need to specify a result VT, prefer
      
        [(set (tr.vt tr.op:$V1), (operator ...))]
      
      over
      
        [(set tr.op:$V1, (tr.vt (operator ...)))]
      
      This is NFC now, but simplifies some future changes.
      
      llvm-svn: 331192
      79e5cd2f
    • Ulrich Weigand's avatar
      [SystemZ] Improve handling of Select pseudo-instructions · fb56686c
      Ulrich Weigand authored
      If we have LOCR instructions, select them directly from SelectionDAG
      instead of first going through a pseudo instruction and then using
      the custom inserter to emit the LOCR.
      
      Provide Select pseudo-instructions for VR32/VR64 if we have vector
      instructions, to avoid having to go through the first 16 FPRs
      unnecessarily.
      
      If we do not have LOCFHR, prefer using LOCR followed by a move
      over a conditional branch.
      
      llvm-svn: 331191
      fb56686c
    • Nico Weber's avatar
      IWYU for llvm-config.h, removals. Also see r331184. · da750079
      Nico Weber authored
      llvm-svn: 331190
      da750079
    • Haojian Wu's avatar
      [clangd] Using index for GoToDefinition. · 88cfb66c
      Haojian Wu authored
      Summary:
      This patch adds index support for GoToDefinition -- when we don't get the
      definition from local AST, we query our index (Static&Dynamic) index to
      get it.
      
      Since we currently collect top-level symbol in the index, it doesn't support all
      cases (e.g. class members), we will extend the index to include more symbols in
      the future.
      
      Reviewers: sammccall
      
      Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, MaskRay, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D45717
      
      llvm-svn: 331189
      88cfb66c
    • Simon Pilgrim's avatar
      [X86] Drop unnecessary VPORrm InstrRW override in SkylakeServer. · 0a732da2
      Simon Pilgrim authored
      llvm-svn: 331188
      0a732da2
    • Simon Pilgrim's avatar
      b521ec75
    • Tom Stellard's avatar
      AMDGPU/GlobalISel: Don't try to lower geometry shaders · 6c81418a
      Tom Stellard authored
      Summary: The AMDGPU_GS calling convention is not supported yet.
      
      Reviewers: arsenm, nhaehnle
      
      Reviewed By: nhaehnle
      
      Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46041
      
      llvm-svn: 331186
      6c81418a
    • Nico Weber's avatar
      IWYU for llvm-config.h in llvm, additions. · 432a3883
      Nico Weber authored
      See r331124 for how I made a list of files missing the include.
      I then ran this Python script:
      
          for f in open('filelist.txt'):
              f = f.strip()
              fl = open(f).readlines()
      
              found = False
              for i in xrange(len(fl)):
                  p = '#include "llvm/'
                  if not fl[i].startswith(p):
                      continue
                  if fl[i][len(p):] > 'Config':
                      fl.insert(i, '#include "llvm/Config/llvm-config.h"\n')
                      found = True
                      break
              if not found:
                  print 'not found', f
              else:
                  open(f, 'w').write(''.join(fl))
      
      and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p`
      and tried to fix include ordering and whatnot.
      
      No intended behavior change.
      
      llvm-svn: 331184
      432a3883
    • Bjorn Pettersson's avatar
      [BranchFolding] Salvage DBG_VALUE instructions from empty blocks · 9a8483a4
      Bjorn Pettersson authored
      Summary:
      This patch will introduce copying of DBG_VALUE instructions
      from an otherwise empty basic block to predecessor/successor
      blocks in case the empty block is eliminated/bypassed. It
      is currently only done in one identified situation in the
      BranchFolding pass, before optimizing on empty block.
      It can be seen as a light variant of the propagation done
      by the LiveDebugValues pass, which unfortunately is executed
      after the BranchFolding pass.
      
      We only propagate (copy) DBG_VALUE instructions in a limited
      number of situations:
       a) If the empty BB is the only predecessor of a successor
          we can copy the DBG_VALUE instruction to the beginning of
          the successor (because the DBG_VALUE instruction is always
          part of the flow between the blocks).
       b) If the empty BB is the only successor of a predecessor
          we can copy the DBG_VALUE instruction to the end of the
          predecessor (because the DBG_VALUE instruction is always
          part of the flow between the blocks). In this case we add
          the DBG_VALUE just before the first terminator (assuming
          that the terminators do not impact the DBG_VALUE).
      
      A future solution, to handle more situations, could perhaps
      be to run the LiveDebugValues pass before branch folding?
      
      This fix is related to PR37234. It is expected to resolve
      the problem seen, when applied together with the fix in
      SelectionDAG from here: https://reviews.llvm.org/D46129
      
      Reviewers: #debug-info, aprantl, rnk
      
      Reviewed By: #debug-info, aprantl
      
      Subscribers: ormris, gbedwell, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46184
      
      llvm-svn: 331183
      9a8483a4
    • Bjorn Pettersson's avatar
      [SelectionDAG] Improve selection of DBG_VALUE using a PHI node result · abafca61
      Bjorn Pettersson authored
      Summary:
      When building the selection DAG at ISel all PHI nodes are
      selected and lowered to Machine Instruction PHI nodes before
      we start to create any SDNodes. So there are no SDNodes for
      values produced by the PHI nodes.
      
      In the past when selecting a dbg.value intrinsic that uses
      the value produced by a PHI node we have been handling such
      dbg.value intrinsics as "dangling debug info". I.e. we have
      not created a SDDbgValue node directly, because there is
      no existing SDNode for the PHI result, instead we deferred
      the creationg of a SDDbgValue until we found the first use
      of the PHI result.
      
      The old solution had a couple of flaws. The position of the
      selected DBG_VALUE instruction would end up quite late in a
      basic block, and for example not directly after the PHI node
      as in the LLVM IR input. And in case there were no use at all
      in the basic block the dbg.value could be dropped completely.
      
      This patch introduces a new VREG kind of SDDbgValue nodes.
      It is similar to a SDNODE kind of node, but it refers directly
      to a virtual register and not a SDNode. When we do selection
      for a dbg.value that is using the result of a PHI node we
      can do a lookup of the virtual register directly (as it already
      is determined for the PHI node) and create a SDDbgValue node
      immediately instead of delaying the selection until we find a
      use.
      
      This should fix a problem with losing debug info at ISel
      as seen in PR37234 (https://bugs.llvm.org/show_bug.cgi?id=37234).
      It does not resolve PR37234 completely, because the debug info
      is dropped later on in the BranchFolder (see D46184).
      
      Reviewers: #debug-info, aprantl
      
      Reviewed By: #debug-info, aprantl
      
      Subscribers: rnk, gbedwell, aprantl, JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46129
      
      llvm-svn: 331182
      abafca61
    • Zaara Syeda's avatar
      Fix warning: result of 32-bit shift implicitly converted to 64 bits - NFC · 116c0424
      Zaara Syeda authored
      Fix warning caused by rL331046.
      
      Differential Revision: https://reviews.llvm.org/D45729
      
      llvm-svn: 331181
      116c0424
    • Pavel Labath's avatar
      llgs tests: Use noack-mode for communication to avoid pr37294 · d2f36c86
      Pavel Labath authored
      llvm-svn: 331180
      d2f36c86
    • Gabor Buella's avatar
      NFC, Avoid a warning on pointer casting in PassPlugin.cpp · ad9a0429
      Gabor Buella authored
      llvm-svn: 331179
      ad9a0429
    • Simon Dardis's avatar
      Revert "[mips] Fix the predicates of jump and branch and link instructions" · 5a512d63
      Simon Dardis authored
      That commit broke one of the LLD builders, reverting while I investigate.
      
      This patch reverts r331175.
      
      llvm-svn: 331178
      5a512d63
    • Nico Weber's avatar
      IWYU for llvm-config.h in clang. See r331124 for details. · d637c059
      Nico Weber authored
      llvm-svn: 331177
      d637c059
    • Nico Weber's avatar
      Remove unnecessary indirection. No behavior change. · cf512ab5
      Nico Weber authored
      llvm-svn: 331176
      cf512ab5
    • Simon Dardis's avatar
      [mips] Fix the predicates of jump and branch and link instructions · cc95a9c5
      Simon Dardis authored
      Reviewers: smaksimovic, atanasyan, abeserminji
      
      Differential Revision: https://reviews.llvm.org/D46114
      
      llvm-svn: 331175
      cc95a9c5
    • Florian Hahn's avatar
      [LV] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC). · deb01ea1
      Florian Hahn authored
      This patch updates some code responsible the skip debug info to use
      BasicBlock::instructionsWithoutDebug. I think this makes things
      slightly simpler and more direct.
      
      Reviewers: mkuper, rengolin, dcaballe, aprantl, vsk
      
      Reviewed By: rengolin
      
      Differential Revision: https://reviews.llvm.org/D46254
      
      llvm-svn: 331174
      deb01ea1
    • Pavel Labath's avatar
      ObjectFileELF: Add support for arbitrarily named code sections · edb01276
      Pavel Labath authored
      ObjectFileELF assumes that code section has ".text" name. There is an
      exception for kalimba toolchain that can use arbitrary names, but other
      toolchains also could use arbitrary names for code sections. For
      example, corert uses separate section for compiled managed code. As lldb
      doesn't recognize such section it leads to problem with breakpoints on
      arm, because debugger cannot determine instruction set (arm/thumb) and
      uses incorrect breakpoint opcode that breaks program execution.
      
      This change allows debugger to correctly handle such code sections. We
      assume that section is a code section if it has SHF_EXECINSTR flag set
      and has SHT_PROGBITS type.
      
      Patch by Konstantin Baladurin <k.baladurin@partner.samsung.com>.
      Differential Revision: https://reviews.llvm.org/D44998
      
      llvm-svn: 331173
      edb01276
    • Pavel Labath's avatar
      Fixup r331049 (FileSpec auto-normalization) · 410c5acf
      Pavel Labath authored
      A typo in the patch (using syntax instead of m_syntax) resulted in the
      normalization not working properly for windows filespecs when the syntax
      was passed as host-native. This did not affect the unit tests, as all of
      those pass an explicity syntax, but failed gloriously when running the
      full test suite.
      
      I also fix an expectation in an lldb-mi test, which was now failing
      because it was expecting a path to be echoed verbatim, but we were now
      normalizing it.
      
      As a drive-by, this also fixes the default-in-fully-covered-switch
      warning and removes an unused argument from the NeedsNormalization
      function.
      
      llvm-svn: 331172
      410c5acf
    • Benjamin Kramer's avatar
      [bindings] Fix dibuilder go bindings after r331114. · 4aace8a3
      Benjamin Kramer authored
      llvm-svn: 331171
      4aace8a3
    • Andrea Di Biagio's avatar
      [llvm-mca] Regenerate test Atom/resources-sse3.s. NFC · 77bd1c74
      Andrea Di Biagio authored
      Before this change, it wrongly specified -mcpu=slm instead of -mcpu=atom.
      
      llvm-svn: 331170
      77bd1c74
    • Andrea Di Biagio's avatar
      [llvm-mca] Support for in-order CPU for -instruction-tables testing. · e9384eb1
      Andrea Di Biagio authored
      Added Intel Atom tests to verify that the tool correctly generates instruction
      tables even if the CPU is in-order.
      
      Fixes PR37282.
      
      llvm-svn: 331169
      e9384eb1
    • Haojian Wu's avatar
      [clangd] Also use UTF-16 in index position. · c5340015
      Haojian Wu authored
      Reviewers: sammccall
      
      Subscribers: klimek, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46258
      
      llvm-svn: 331168
      c5340015
    • Simon Pilgrim's avatar
      [X86] Fix typo in skylake-avx512 model for PMAXSD/PMINSD instructions · 318f816f
      Simon Pilgrim authored
      The PMAXSD/PMINSD instregexs had been written as PMAX(C?)SD - looks like this was a search+replace error when matching float MAXSD/MINSD commutative instructions.
      
      llvm-svn: 331167
      318f816f
    • Gabor Buella's avatar
      NFC - Typo fixes lib/VMCore -> lib/IR · 61ff2864
      Gabor Buella authored
      llvm-svn: 331166
      61ff2864
    • Simon Dardis's avatar
      [mips] Fix microMIPS loads and stores. · 57c2095d
      Simon Dardis authored
      Previously these instructions were unselectable and instead were generated
      through the instruction mapping tables.
      
      Reviewers: atanasyan, smaksimovic, abeserminji
      
      Differential Revision: https://reviews.llvm.org/D46055
      
      llvm-svn: 331165
      57c2095d
    • Mikhail Maltsev's avatar
      [Targets] Implement getConstraintRegister for ARM and AArch64 · 89f7b46b
      Mikhail Maltsev authored
      Summary:
      The getConstraintRegister method is used by semantic checking of
      inline assembly statements in order to diagnose conflicts between
      clobber list and input/output lists. Currently ARM and AArch64 don't
      override getConstraintRegister, so conflicts between registers
      assigned to variables in asm labels and clobber lists are not
      diagnosed. Such conflicts can cause assertion failures in the back end
      and even miscompilations.
      
      This patch implements getConstraintRegister for ARM and AArch64
      targets. Since these targets don't have single-register constraints,
      the implementation is trivial and just returns the register specified
      in an asm label (if any).
      
      Reviewers: eli.friedman, javed.absar, thopre
      
      Reviewed By: thopre
      
      Subscribers: rengolin, eraman, rogfer01, myatsina, kristof.beyls, cfe-commits, chrib
      
      Differential Revision: https://reviews.llvm.org/D45965
      
      llvm-svn: 331164
      89f7b46b
    • Dmitry Vyukov's avatar
      tsan: disable trace switching after multithreaded fork · 6c33998c
      Dmitry Vyukov authored
      The problem is reported in:
      https://github.com/google/sanitizers/issues/945
      
      We already disable as much as possible after multithreaded fork,
      trace switching is last place that can hang due to basic
      operations (memory accesses, function calls).
      Disable it too.
      
      llvm-svn: 331163
      6c33998c
    • Sander de Smalen's avatar
      [AArch64][SVE] Asm: Improve diagnostics for gather loads. · 5861c263
      Sander de Smalen authored
      This patch extends the 'isSVEVectorRegWithShiftExtend' function to 
      improve diagnostics for SVE's gather load (scalar + vector) addressing 
      modes. Instead of always suggesting the 'unscaled' addressing mode, 
      the use of DiagnosticPredicate enables a more specific error message
      in the context where the scaling is incorrect. For example:
      
        ld1h z0.d, p0/z, [x0, z0.d, lsl #2]
                                         ^ 
                 shift amount should be '1'
      
      Instead of suggesting the packed, unscaled addressing mode:
        expected 'z[0..31].d, (uxtw|sxtw)'
      
      the assembler now suggests using the proper scaling:
        expected 'z[0..31].d, (lsl|uxtw|sxtw) #1'
      
      Reviewers: fhahn, rengolin, samparker, SjoerdMeijer, javed.absar
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D46124
      
      llvm-svn: 331162
      5861c263
    • Craig Topper's avatar
      [X86] Add a Requires<[In64BitMode]> to FARJMP64 · 5a4c8800
      Craig Topper authored
      Otherwise we can try to assemble it in 32-bit mode and throw an assert in the encoder.
      
      llvm-svn: 331161
      5a4c8800
    • Craig Topper's avatar
    • Craig Topper's avatar
    • Craig Topper's avatar
      [X86] Remove some instructions from the Intel assembly matcher table as there... · 429ae3d7
      Craig Topper authored
      [X86] Remove some instructions from the Intel assembly matcher table as there are equivalent mode aware InstAliases that conflict.
      
      The instructions have predicates of Not64BitMode, but there are identical strings in InstAliases that have Mode32Bit and Mode16Bit. But the ordering is uncontrolled and the less specific Not64BitMode was ordered first.
      
      This patch hides the Not64BitMode from the table so there is no conflict anymore.
      
      llvm-svn: 331158
      429ae3d7
    • Craig Topper's avatar
      [X86] Use a MnemonicAlias instead of an InstAlias. · ebc7de07
      Craig Topper authored
      llvm-svn: 331157
      ebc7de07
    • Richard Smith's avatar
      Fix up after clang r331155. · 4bb15ab8
      Richard Smith authored
      llvm-svn: 331156
      4bb15ab8