1. Jan 07, 2020
    • LLVM GN Syncbot's avatar
      [gn build] Port c69ae835 · cf4b9164
      LLVM GN Syncbot authored
      cf4b9164
    • Sam McCall's avatar
      [clangd] Add path mappings functionality · c69ae835
      Sam McCall authored
      Summary: Add path mappings to clangd which translate file URIs on inbound and outbound LSP messages. This mapping allows clangd to run in a remote environment (e.g. docker), where the source files and dependencies may be at different locations than the host. See http://lists.llvm.org/pipermail/clangd-dev/2019-January/000231.htm for more.
      
      Patch by William Wagner!
      
      Reviewers: sammccall, ilya-biryukov
      
      Reviewed By: sammccall
      
      Subscribers: usaxena95, ormris, mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D64305
      c69ae835
    • Luís Marques's avatar
      [RISCV][Docs] Add RISC-V asm template argument modifiers · 27e6b171
      Luís Marques authored
      Adds the RISC-V asm template argument modifiers currently supported by LLVM.
      Additional ones supported by GCC will be added to the documentation when we
      start supporting them.
      27e6b171
    • Simon Pilgrim's avatar
      Fix Wdocumentation warnings. NFCI. · c758e469
      Simon Pilgrim authored
      c758e469
    • Simon Pilgrim's avatar
    • Simon Pilgrim's avatar
    • James Henderson's avatar
      [DebugInfo] Fix infinite loop caused by reading past debug_line end · 216796f2
      James Henderson authored
      If the claimed unit length of a debug line program is such that the line
      table would finish past the end of the .debug_line section, an infinite
      loop occurs because the data extractor will continue to "read" zeroes
      without changing the offset. This previously didn't hit an error because
      the line table program handles a series of zeroes as a bad extended
      opcode.
      
      This patch fixes the inifinite loop and adds a warning if the program
      doesn't fit in the available data.
      
      Reviewed by: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D72279
      216796f2
    • Peter Smith's avatar
      [LLD][ELF][AArch64] Do not use thunk for undefined weak symbol. · 051c4d5b
      Peter Smith authored
      In AArch64 a branch to an undefined weak symbol that does not have a PLT
      entry should resolve to the next instruction. The thunk generation code
      can prevent this from happening as a range extension thunk can be generated
      if the branch is sufficiently far away from 0, the value of an undefined
      weak symbol.
      
      The fix is taken from the Arm implementation of needsThunk(), we prevent a
      thunk from being generated to an undefined weak symbol.
      
      fixes pr44451
      
      Differential Revision: https://reviews.llvm.org/D72267
      051c4d5b
    • Raphael Isemann's avatar
      [lldb][NFC] Take a llvm::Triple in ClangASTContext constructor · d3648153
      Raphael Isemann authored
      This constructor is supposed to take a string representing an llvm::Triple.
      We might as well take a llvm::Triple here which saves us all the string
      conversions in the call sites and we make this more type safe.
      d3648153
    • Jim Lin's avatar
      [NFC] Use isX86() instead of getArch() · ab1bcda8
      Jim Lin authored
      Summary: This is a clean up for https://reviews.llvm.org/D72247.
      
      Reviewers: MaskRay, craig.topper, jhenderson
      
      Reviewed By: MaskRay
      
      Subscribers: hiraditya, rupprecht, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D72320
      ab1bcda8
    • Ulrich Weigand's avatar
      [SystemZ] Fix python failure in test case · 4814b68b
      Ulrich Weigand authored
      With recent Python the Large/spill-02.py test failed with an error:
      TypeError: can't multiply sequence by non-int of type 'float'
      4814b68b
    • Ehud Katz's avatar
    • serge-sans-paille's avatar
      Fix compiler extension example cmake integration · 5a9c24b5
      serge-sans-paille authored
      - Do not add it to the Export file
      - Update install target
      
      Differential Revision: https://reviews.llvm.org/D72255
      5a9c24b5
    • Raphael Isemann's avatar
      [lldb] Fix LLDB build after API change to printInst (D72172) · 9890cc2e
      Raphael Isemann authored
      It seems in D72172 we always pass a 0 as the new default argument so let's
      do the same in LLDB to get the build bot running.
      9890cc2e
    • Ehud Katz's avatar
      [APFloat] Fix fusedMultiplyAdd when `this` equals to `Addend` · 08de551f
      Ehud Katz authored
      Up until now, the arguments to `fusedMultiplyAdd` are passed by
      reference. We must save the `Addend` value on the beginning of the
      function, before we modify `this`, as they may be the same reference.
      
      To fix this, we now pass the `addend` parameter of `multiplySignificand`
      by value (instead of by-ref), and have a default value of zero.
      
      Fix PR44051.
      
      Differential Revision: https://reviews.llvm.org/D70422
      08de551f
    • Siva Chandra Reddy's avatar
      [libc] Move implementations of strcat and strcpy to the string directory. · 188f72ab
      Siva Chandra Reddy authored
      Summary:
      Now that tests live in separate top-level directory, keeping the
      implementations of individual functions in a directory of their own is
      not meaningful. Hence, this change moves them into the higher level
      string directory.
      
      NFC intended.
      
      Reviewers: MaskRay
      
      Subscribers: mgorny, tschuett, libc-commits
      
      Tags: #libc-project
      
      Differential Revision: https://reviews.llvm.org/D72295
      188f72ab
    • Kazuaki Ishizaki's avatar
      [OpenMP] NFC: Fix trivial typos in comments · 4c6a098a
      Kazuaki Ishizaki authored
      Reviewers: jdoerfert, Jim
      
      Reviewed By: Jim
      
      Subscribers: Jim, mgorny, guansong, jfb, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D72285
      4c6a098a
    • Siva Chandra Reddy's avatar
      [libc] Add __attribute__((always_inline)) to x86_64 syscall functions. · 6598af4a
      Siva Chandra Reddy authored
      Summary:
      Some syscalls like SYS_clone do not tolerate a return instruction after
      the syscall instruction. Marking the syscall functions with the
      `always_inline` attribute accommodates such syscalls as inlining
      eliminates the return instruction.
      
      Reviewers: abrachet, phosek
      
      Subscribers: MaskRay, tschuett, libc-commits
      
      Tags: #libc-project
      
      Differential Revision: https://reviews.llvm.org/D72102
      6598af4a
    • Juneyoung Lee's avatar
      Let PassBuilder Expose PassInstrumentationCallbacks · ff554a91
      Juneyoung Lee authored
      Summary:
      This is an effort to allowing external libraries register their own pass instrumentation during their llvmGetPassPluginInfo() calls.
      
      By exposing this through the added getPIC(), now a pass writer can do something like this:
      
      ```
      extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
      llvmGetPassPluginInfo() {
        return {
          ..,
          [](llvm::PassBuilder &PB) {
            PB.getPIC()->registerAfterPassCallback(move(f));
          }
        };
      }
      ```
      
      Reviewers: chandlerc, philip.pfaffe, fedor.sergeev
      
      Reviewed By: fedor.sergeev
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71086
      ff554a91
    • Fangrui Song's avatar
      [MC] Add parameter `Address` to MCInstrPrinter::printInstruction · 3d87d0b9
      Fangrui Song authored
      Follow-up of D72172.
      
      Reviewed By: jhenderson, rnk
      
      Differential Revision: https://reviews.llvm.org/D72180
      3d87d0b9
    • Fangrui Song's avatar
      [MC] Add parameter `Address` to MCInstPrinter::printInst · aa708763
      Fangrui Song authored
      printInst prints a branch/call instruction as `b offset` (there are many
      variants on various targets) instead of `b address`.
      
      It is a convention to use address instead of offset in most external
      symbolizers/disassemblers. This difference makes `llvm-objdump -d`
      output unsatisfactory.
      
      Add `uint64_t Address` to printInst(), so that it can pass the argument to
      printInstruction(). `raw_ostream &OS` is moved to the last to be
      consistent with other print* methods.
      
      The next step is to pass `Address` to printInstruction() (generated by
      tablegen from the instruction set description). We can gradually migrate
      targets to print addresses instead of offsets.
      
      In any case, downstream projects which don't know `Address` can pass 0 as
      the argument.
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D72172
      aa708763
    • Matt Arsenault's avatar
    • Nicolas Vasilache's avatar
      [mlir][Linalg] Add a linalg.reshape op · e3750caf
      Nicolas Vasilache authored
      Summary:
      This diff adds a new operation to linalg to allow reshaping of an
      existing view into a new view in the same buffer at the same offset.
      
      More specifically:
      The `linalg.reshape` op produces a new view whose sizes are a reassociation
      of the original `view`. Depending on whether or not the reassociated
      MemRefType is contiguous, the resulting memref may require explicit alloc
      and copies.
      
      A reassociation is defined as a continous grouping of dimensions and is
      represented with a affine map array attribute. In the future, non-continous
      groupings may be allowed (i.e. permutations, reindexings etc).
      
      For now, it is assumed that either:
        1. a reassociation produces and consumes contiguous MemRefType or,
        2. the reshape op will be folded into its consumers (by changing the shape
           of the computations).
      All other cases are undefined behavior and a reshape op may not lower to
      LLVM if it cannot be proven statically that it does not require alloc+copy.
      
      A reshape may either collapse or expand dimensions, depending on the
      relationship between source and target memref ranks. The verification rule
      is that the reassociation maps are applied to the memref with the larger
      rank to obtain the memref with the smaller rank. In the case of a dimension
      expansion, the reassociation maps can be interpreted as inverse maps.
      
      Examples:
      
      ```mlir
         // Dimension collapse (i, j) -> i' and k -> k'
         %1 = linalg.reshape %0 [(i, j, k) -> (i, j),
                                 (i, j, k) -> (k)] :
           memref<?x?x?xf32, stride_spec> into memref<?x?xf32, stride_spec_2>
      ```
      
      ```mlir
         // Dimension expansion i -> (i', j') and (k) -> (k')
         %1 = linalg.reshape %0 [(i, j, k) -> (i, j),
                                 (i, j, k) -> (k)] :
           memref<?x?xf32, stride_spec> into memref<?x?x?xf32, stride_spec_2>
      ```
      
      The relevant invalid and roundtripping tests are added.
      
      Reviewers: AlexEichenberger, ftynse, rriddle, asaadaldien, yangjunpro
      
      Subscribers: kiszk, merge_guards_bot, mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72168
      e3750caf
    • QingShan Zhang's avatar
      d877229b
    • Matt Arsenault's avatar
      AMDGPU: Add run line to int_to_fp tests · e8d9d202
      Matt Arsenault authored
      This wasn't catching a regression on targets with legal i16 triggered
      in a future commit.
      e8d9d202
    • Matt Arsenault's avatar
      AMDGPU: Select llvm.amdgcn.interp.p2.f16 directly · 452f6243
      Matt Arsenault authored
      This will enable automatic GlobalISel support in a future commit.
      452f6243
    • Richard Smith's avatar
      Always deduce the lengths of contained parameter packs when deducing a · 907cefe7
      Richard Smith authored
      pack expansion.
      
      Previously, if all parameter / argument pairs for a pack expansion
      deduction were non-deduced contexts, we would not deduce the arity of
      the pack, and could end up deducing a different arity (leading to
      failures during substitution) or defaulting to an arity of 0 (leading to
      bad diagnostics about passing the wrong number of arguments to a
      variadic function). Instead, we now always deduce the arity for all
      involved packs any time we deduce a pack expansion.
      
      This will result in less substitution happening in some cases, which
      could avoid non-SFINAEable errors, and should generally improve the
      quality of diagnostics when passing initializer lists to variadic
      functions.
      907cefe7
    • Matt Arsenault's avatar
      AMDGPU: Use default operands for clamp/omod · e93b1ffc
      Matt Arsenault authored
      We have a lot of complex pattern variants that just set the source
      modifiers that are really handled, and then set the output modifiers
      to 0. We're unlikely to ever match output modifiers from the use
      instruction side, and we already match clamp/omod in a separate pass.
      e93b1ffc
    • Heejin Ahn's avatar
      [WebAssembly] Fix landingpad-only case in Emscripten EH · 21f7b362
      Heejin Ahn authored
      Summary:
      Previously we didn't set `Changed` to true when there are only landing
      pads but not invokes. This fixes it and we set `Changed` to true
      whenever we have landing pads. (There can't be invokes without landing
      pads, so that case is covered too)
      
      The test case for this has to be a separate file because this pass is a
      `ModulePass` and `Changed` is computed based on the whole module.
      
      Reviewers: tlively
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72308
      21f7b362
    • Matt Arsenault's avatar
      52afc93c
    • Akira Hatanaka's avatar
      [CodeGen][ObjC] Push the properties of a protocol before pushing the · 20f005d2
      Akira Hatanaka authored
      properties of the protocol it inherits
      
      This fixes a bug where the type string for a @dynamic property of an
      @implementation didn't have 'D' in it when the protocol it conforms to
      redeclares the property declared in the base protocol.
      
      rdar://problem/45503561
      20f005d2
    • Evgenii Stepanov's avatar
      7ba4595c
    • Mark de Wever's avatar
      [NFC] Fixes -Wrange-loop-analysis warnings · 5e0e0e3f
      Mark de Wever authored
      This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
      5e0e0e3f
    • Fangrui Song's avatar
      Add Triple::isX86() · 6904cd94
      Fangrui Song authored
      Reviewed By: craig.topper, skan
      
      Differential Revision: https://reviews.llvm.org/D72247
      6904cd94
    • Akira Hatanaka's avatar
      Use FileCheck instead of grep · c6fd16af
      Akira Hatanaka authored
      c6fd16af
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select G_UADDE/G_USUBE · d4c9e133
      Matt Arsenault authored
      d4c9e133
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Replace handling of boolean values · 4e85ca95
      Matt Arsenault authored
      This solves selection failures with generated selection patterns,
      which would fail due to inferring the SGPR reg bank for virtual
      registers with a set register class instead of VCC bank. Use
      instruction selection would constrain the virtual register to a
      specific class, so when the def was selected later the bank no longer
      was set to VCC.
      
      Remove the SCC reg bank. SCC isn't directly addressable, so it
      requires copying from SCC to an allocatable 32-bit register during
      selection, so these might as well be treated as 32-bit SGPR values.
      
      Now any scalar boolean value that will produce an outupt in SCC should
      be widened during RegBankSelect to s32. Any s1 value should be a
      vector boolean during selection. This makes the vcc register bank
      unambiguous with a normal SGPR during selection.
      
      Summary of how this should now work:
      
      - G_TRUNC is always a no-op, and never should use a vcc bank result.
      
      - SALU boolean operations should be promoted to s32 in RegBankSelect
        apply mapping
      
      - An s1 value means vcc bank at selection. The exception is for
        legalization artifacts that use s1, which are never VCC. All other
        contexts should infer the VCC register classes for s1 typed
        registers. The LLT for the register is now needed to infer the
        correct register class. Extensions with vcc sources should be
        legalized to a select of constants during RegBankSelect.
      
      - Copy from non-vcc to vcc ensures high bits of the input value are
        cleared during selection.
      
      - SALU boolean inputs should ensure the inputs are 0/1. This includes
        select, conditional branches, and carry-ins.
      
      There are a few somewhat dirty details. One is that G_TRUNC/G_*EXT
      selection ignores the usual register-bank from register class
      functions, and can't handle truncates with VCC result banks. I think
      this is OK, since the artifacts are specially treated anyway. This
      does require some care to avoid producing cases with vcc. There will
      also be no 100% reliable way to verify this rule is followed in
      selection in case of register classes, and violations manifests
      themselves as invalid copy instructions much later.
      
      Standard phi handling also only considers the bank of the result
      register, and doesn't insert copies to make the source banks
      match. This doesn't work for vcc, so we have to manually correct phi
      inputs in this case. We should add a verifier check to make sure there
      are no phis with mixed vcc and non-vcc register bank inputs.
      
      There's also some duplication with the LegalizerHelper, and some code
      which should live in the helper. I don't see a good way to share
      special knowledge about what types to use for intermediate operations
      depending on the bank for example. Using the helper to replace
      extensions with selects also seems somewhat awkward to me.
      
      Another issue is there are some contexts calling
      getRegBankFromRegClass that apparently don't have the LLT type for the
      register, but I haven't yet run into a real issue from this.
      
      This also introduces new unnecessary instructions in most cases, since
      we don't yet try to optimize out the zext when the source is known to
      come from a compare.
      4e85ca95
    • Matt Arsenault's avatar
      TableGen/GlobalISel: Handle default operands that are used · 26f714ff
      Matt Arsenault authored
      Copy the logic from the existing handling in the DAG matcher emittter.
      
      This will enable some AMDGPU pattern cleanups without breaking
      GlobalISel tests, and eventually handle importing more patterns.
      
      The test is a bit annoying since the sections seem to randomly sort
      themselves if anything else is added in the future.
      26f714ff
    • Matt Arsenault's avatar
      GlobalISel: Implement lower for G_INTRINSIC_ROUND · f3de8ab5
      Matt Arsenault authored
      Mostly copied from AMDGPU lowering implementation, except used
      G_SITOFP instead of directly creating a select on -1.0, 0.0.
      f3de8ab5
    • Jason Molenda's avatar
      Change the patterns to include the prefix '= ' so we don't pass errantly. · 450073c6
      Jason Molenda authored
      Looking at a sometimes-passing test case on a platform
      where random values were being returned - sometimes
      the expected digit ('1' or '2') would be included in the
      random returned value.  Add a prefix to reduce the likelihood of
      this a bit.
      450073c6