1. Jun 08, 2018
  2. Jun 07, 2018
    • Alex Bradbury's avatar
      [RISCV] AsmParser support for the li pseudo instruction · 6a4b5441
      Alex Bradbury authored
      The implementation follows the MIPS backend and expands the pseudo instruction 
      directly during asm parsing. As the result, only real MC instructions are 
      emitted to the MCStreamer. The actual expansion to real instructions is 
      similar to the expansion performed by the GNU Assembler.
      
      This patch supersedes D41949.
      
      Differential Revision: https://reviews.llvm.org/D46118
      Patch by Mario Werner.
      
      llvm-svn: 334203
      6a4b5441
    • Alex Bradbury's avatar
      [AVR] Fix build after r334078 · 6cfb31c7
      Alex Bradbury authored
      r334078 added MCSubtargetInfo to fixupNeedsRelaxation and applyFixup. This 
      patch makes the necessary adjustment for the AVR target.
      
      llvm-svn: 334202
      6cfb31c7
    • Simon Pilgrim's avatar
      [X86][SSE] Simplify combineVectorTruncationWithPACKUS. NFCI. · 51ff15f4
      Simon Pilgrim authored
      Move code only used by combineVectorTruncationWithPACKUS out of combineVectorTruncation.
      
      llvm-svn: 334201
      51ff15f4
    • Roman Lebedev's avatar
      [NFC][InstSimplify] Add tests for shl nuw C, %x -> C fold. · 84793892
      Roman Lebedev authored
      %r = shl nuw i8 C, %x
      
      As per langref: If the nuw keyword is present, then the shift produces
                      a poison value if it shifts out any non-zero bits.
      Thus, if the sign bit is set on C, then %x can only be 0,
      which means that %r can only be C.
      
      https://rise4fun.com/Alive/WMk
      Was mentioned in D47428 review.
      
      llvm-svn: 334200
      84793892
    • Sanjay Patel's avatar
      898fbd7c
    • Pavel Labath's avatar
      DIERef: move trivial constructors into the header · d44638eb
      Pavel Labath authored
      This enables more inlining/optimization opportunities for a fairly
      critical class.
      
      NFCI
      
      llvm-svn: 334198
      d44638eb
    • Guillaume Chatelet's avatar
      [llvm-exegesis] Make BenchmarkRunner handle multiple configurations. · b4f1582a
      Guillaume Chatelet authored
      Summary: BenchmarkRunner subclasses can now create many configurations - although this patch still generates one.
      
      Reviewers: courbet
      
      Subscribers: tschuett, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D47877
      
      llvm-svn: 334197
      b4f1582a
    • Paul Semel's avatar
      [llvm-objdump] Add -R option · cb0f043c
      Paul Semel authored
      This option prints dynamic relocation entries of the given file
      
      Differential Revision: https://reviews.llvm.org/D47493
      
      llvm-svn: 334196
      cb0f043c
    • Hiroshi Inoue's avatar
      [PowerPC] avoid unprofitable Repl32 flag in BitPermutationSelector · 01ef4c2c
      Hiroshi Inoue authored
      BitPermutationSelector sets Repl32 flag for bit groups which can be (potentially) benefit from 32-bit rotate-and-mask instructions with bit replication, i.e. rlwinm/rlwimi copies lower 32 bits into upper 32 bits on 64-bit PowerPC before rotation.
      However, enforcing 32-bit instruction sometimes results in redundant generated code.
      For example, the following simple code is compiled into rotldi + rlwimi while it can be compiled into only rldimi instruction if Repl32 flag is not set on the bit group for (a & 0xFFFFFFFF).
      
      uint64_t func(uint64_t a, uint64_t b) {
      	return (a & 0xFFFFFFFF) | (b << 32) ;
      }
      
      To avoid such problem, this patch checks the potential benefit of Repl32 flag before setting it. If a bit group does not require rotation (i.e. RLAmt == 0) and won't be merged into another group, we do not benefit from Repl32 flag on this group.
      
      Differential Revision: https://reviews.llvm.org/D47867
      
      llvm-svn: 334195
      01ef4c2c
    • Petar Jovanovic's avatar
      [Mips] Silencing warnings in instruction info (NFC) · 241f286b
      Petar Jovanovic authored
      isORCopyInst and isReadOrWriteToDSPReg functions were producing warning
      that some statements my fall through.
      
      Patch by Nikola Prica.
      
      Differential Revision: https://reviews.llvm.org/D47876
      
      llvm-svn: 334194
      241f286b
    • Simon Pilgrim's avatar
      [X86][SSE] Simplify combineVectorTruncationWithPACKSS to reduce code duplication · 09953d84
      Simon Pilgrim authored
      Simplify combineVectorTruncationWithPACKSS to just a SIGN_EXTEND_INREG followed by using the existing truncateVectorWithPACK instead of duplicating code.
      
      llvm-svn: 334193
      09953d84
    • Sam McCall's avatar
      [clangd] Code completion: drop explicit injected names/operators, ignore Sema priority · 4caa8512
      Sam McCall authored
      Summary:
      Now we have most of Sema's code completion signals incorporated in Quality,
      which will allow us to give consistent ranking to sema/index results.
      
      Therefore we can/should stop using Sema priority as an explicit signal.
      This fixes some issues like namespaces always having a terrible score.
      
      The most important missing signals are:
       - Really dumb/rarely useful completions like:
          SomeStruct().^SomeStruct
          SomeStruct().^operator=
          SomeStruct().~SomeStruct()
         We already filter out destructors, this patch adds injected names and
         operators to that list.
       - type matching the expression context.
         Ilya has a plan to add this in a way that's compatible with indexes
         (design doc should be shared real soon now!)
      
      Reviewers: ioeric
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D47871
      
      llvm-svn: 334192
      4caa8512
    • Hiroshi Inoue's avatar
      [PowerPC] fix trivial typos in comment, NFC · b5578460
      Hiroshi Inoue authored
      llvm-svn: 334191
      b5578460
    • Pavel Labath's avatar
      DebugNamesDWARFIndex: Add type lookup suport · 69389692
      Pavel Labath authored
      This implements just one of the GetTypes overloads. The other is not
      testable from lldb-test so I'm leaving it unimplemented until I figure
      out what to do with testing.
      
      llvm-svn: 334190
      69389692
    • Matt Arsenault's avatar
      AMDGPU: Fix not including v2f64 in SReg_128 · f1c868ef
      Matt Arsenault authored
      Fixes assertion with calls returning v2f64.
      
      llvm-svn: 334189
      f1c868ef
    • Simon Pilgrim's avatar
      [X86][SSE] Add extra trunc(shl) test cases · 0e29d8d8
      Simon Pilgrim authored
      The existing trunc_shl_17_v8i16_v8i32 test case should (but doesn't) fold to zero, I've added 2 new test cases:
       - trunc_shl_16_v8i16_v8i32 which folds to zero (this is actually testing the target faux shuffle combine)
       - trunc_shl_15_v8i16_v8i32 which should perform the full shl + truncate
      
      llvm-svn: 334188
      0e29d8d8
    • Florian Hahn's avatar
      [Mem2Reg] Avoid replacing load with itself in promoteSingleBlockAlloca. · 0d6b0176
      Florian Hahn authored
      We do the same thing in rewriteSingleStoreAlloca.
      
      Fixes PR37632.
      
      Reviewers: chandlerc, davide, efriedma
      
      Reviewed By: davide
      
      Differential Revision: https://reviews.llvm.org/D47825
      
      llvm-svn: 334187
      0d6b0176
    • Pavel Labath's avatar
      DebugNamesDWARFIndex: add namespace lookup support · 6675e652
      Pavel Labath authored
      llvm-svn: 334186
      6675e652
    • Pavel Labath's avatar
      DebugNamesDWARFIndex: Add support for partial indexes · 452bd87c
      Pavel Labath authored
      Summary:
      It possible that a single module has indexed and non-indexed compile
      units. In this case, we can use the fast indexed lookup for the first
      ones and fall back to the manual index for the others.
      
      This patch implements this functionality by adding a units_to_avoid
      argument to the ManualDWARFIndex constructor. Any units present in that
      list will be ignored for the purposes of manual index. Individual
      DebugNamesDWARFIndex then always consult both the manual fallback index
      as well as the index in the .debug_names section.
      
      Reviewers: JDevlieghere, clayborg
      
      Subscribers: aprantl, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D47832
      
      llvm-svn: 334185
      452bd87c
    • Matt Arsenault's avatar
      AMDGPU: Use scalar operations for f16 fabs/fneg patterns · 697300bd
      Matt Arsenault authored
      Fixes unnecessary differences between subtargets.
      
      llvm-svn: 334184
      697300bd
    • Simon Pilgrim's avatar
      [X86] Regenerate rotate tests · cc92897b
      Simon Pilgrim authored
      Add 32-bit tests to show missed SHLD/SHRD cases
      
      llvm-svn: 334183
      cc92897b
    • Paul Semel's avatar
      [llvm-strip] Expose --strip-unneeded option · e57bc783
      Paul Semel authored
      Differential Revision: https://reviews.llvm.org/D47818
      
      llvm-svn: 334182
      e57bc783
    • Pavel Labath's avatar
      DebugNamesDWARFIndex: Add ability to lookup variables · e1d18758
      Pavel Labath authored
      Summary:
      This patch adds the ability to lookup variables to the DWARF v5 index
      class.
      
      During review we discovered an inconsistency between how the existing
      two indexes handle looking up qualified names of the variables:
      - manual index would return a value if the input string exactly matched
        the demangled name of some variable.
      - apple index ignored the context and returned any variable with the
        same base name.
      
      So, this patch also rectifies that situation:
      - it removes all context handling from the index classes. The
        GetGlobalVariables functions now just take a base name. For manual
        index, this meant we can stop putting demangled names into the
        variable index (this matches the behavior for functions).
      - context extraction is put into SymbolFileDWARF, so that it is common
        to all indexes.
      - additional filtering based on the context is also done in
        SymbolFileDWARF. This is done via a simple substring search, which is
        not ideal, but it matches what we are doing for functions (cf.
        Module::LookupInfo::Prune).
      
      Reviewers: clayborg, JDevlieghere
      
      Subscribers: aprantl, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D47781
      
      llvm-svn: 334181
      e1d18758
    • Matt Arsenault's avatar
      AMDGPU: Try a lot harder to emit scalar loads · 90083d30
      Matt Arsenault authored
      This has two main components. First, widen
      widen short constant loads in DAG when they have
      the correct alignment. This is already done a bit in
      AMDGPUCodeGenPrepare, since that has access to
      DivergenceAnalysis. This can't help kernarg loads
      created in the DAG. Start to use DAG divergence analysis
      to help this case.
      
      The second part is to avoid kernel argument lowering
      breaking the alignment of short vector elements because
      calling convention lowering wants to split everything
      into legal register types.
      
      When loading a split type, load the nearest 4-byte aligned
      segment and shift to get the desired bits. This extra
      load of the earlier argument piece ends up merging,
      and the bit extract hopefully folds out.
      
      There are a number of improvements and regressions with
      this, but I think as-is this is a better compromise between
      several of the worst parts of SelectionDAG.
      
      Particularly when i16 is legal, this produces worse code
      for i8 and i16 element vector kernel arguments. This is
      partially due to the very weak load merging the DAG does.
      It only looks for fairly specific combines between pairs
      of loads which no longer appear. In particular this
      causes v4i16 loads to be split into 2 components when
      previously the two halves were merged.
      
      Worse, because of the newly introduced shifts, there
      is a lot more unnecessary vector packing and unpacking code
      emitted. At least some of this is due to reporting
      false for isTypeDesirableForOp for i16 as a workaround for
      the lack of divergence information in the DAG. The cases
      where this happens it doesn't actually matter, but the
      relevant code in SimplifyDemandedBits doens't have the context
      to know to ignore this.
      
      The use of the  scalar cache is probably more important
      than the mess of mostly scalar instructions doing this packing
      and unpacking. Future work can fix this, possibly by making better
      use of the new DAG divergence information for controlling promotion
      decisions, or adding another version of shift + trunc + shift
      combines that doesn't only know about the used types.
      
      llvm-svn: 334180
      90083d30
    • Krasimir Georgiev's avatar
      [clang-format] Consider tok::hashhash in python-style comments · 45dde418
      Krasimir Georgiev authored
      Summary: We were missing the case when python-style comments in text protos start with `##`.
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D47870
      
      llvm-svn: 334179
      45dde418
    • Clement Courbet's avatar
      [X86][NFC] Fix harmless typo in BtVer2 model. · 4281b1d3
      Clement Courbet authored
      See D46356 for context.
      
      llvm-svn: 334178
      4281b1d3
    • David Carlier's avatar
      [LLDB] Unit tests / typo fix · 58d05a4d
      David Carlier authored
      removing unnecessary comma.
      
      llvm-svn: 334177
      58d05a4d
    • Haojian Wu's avatar
      [clangd] Fix using the incorrect Index for go-to-definition. · 6138b786
      Haojian Wu authored
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D47869
      
      llvm-svn: 334176
      6138b786
    • Tomasz Krupa's avatar
      [X86] Block UndefRegUpdate · f8c76370
      Tomasz Krupa authored
      Summary: Prevent folding of operations with memory loads when one of the sources has undefined register update.
      
      Reviewers: craig.topper
      
      Subscribers: llvm-commits, mike.dvoretsky, ashlykov
      
      Differential Revision: https://reviews.llvm.org/D47621
      
      llvm-svn: 334175
      f8c76370
    • Gabor Buella's avatar
      [CodeGen] Improve diagnostics related to target attributes · 1a83d067
      Gabor Buella authored
      Summary:
      When requirement imposed by __target__ attributes on functions
      are not satisfied, prefer printing those requirements, which
      are explicitly mentioned in the attributes.
      
      This makes such messages more useful, e.g. printing avx512f instead of avx2
      in the following scenario:
      
      ```
      $ cat foo.c
      static inline void __attribute__((__always_inline__, __target__("avx512f")))
      x(void)
      {
      }
      
      int main(void)
      {
                  x();
      }
      $ clang foo.c
      foo.c:7:2: error: always_inline function 'x' requires target feature 'avx2', but would be inlined into function 'main' that is compiled without support for 'avx2'
              x();
          ^
      1 error generated.
      ```
      
      bugzilla: https://bugs.llvm.org/show_bug.cgi?id=37338
      
      Reviewers: craig.topper, echristo, dblaikie
      
      Reviewed By: craig.topper, echristo
      
      Differential Revision: https://reviews.llvm.org/D46541
      
      llvm-svn: 334174
      1a83d067
    • Max Kazantsev's avatar
      [NFC] Use variable instead of accessing pair many times · b4b2ccea
      Max Kazantsev authored
      llvm-svn: 334173
      b4b2ccea