1. Jun 13, 2019
    • James Henderson's avatar
      [docs][llvm-symbolizer] Fix formatting issue with --functions · e6820dac
      James Henderson authored
      Reviewed by: rupprecht
      
      Differential Revision: https://reviews.llvm.org/D63195
      
      llvm-svn: 363266
      e6820dac
    • Diogo N. Sampaio's avatar
      [FIX] Forces shrink wrapping to consider any memory access as aliasing with the stack · 0be2d25e
      Diogo N. Sampaio authored
      Summary:
      Relate bug: https://bugs.llvm.org/show_bug.cgi?id=37472
      
      The shrink wrapping pass prematurally restores the stack, at a point where the stack might still be accessed.
      Taking an exception can cause the stack to be corrupted.
      
      As a first approach, this patch is overly conservative, assuming that any instruction that may load or store could access
      the stack.
      
      Reviewers: dmgreen, qcolombet
      
      Reviewed By: qcolombet
      
      Subscribers: simpal01, efriedma, eli.friedman, javed.absar, llvm-commits, eugenis, chill, carwil, thegameg
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63152
      
      llvm-svn: 363265
      0be2d25e
    • James Henderson's avatar
      [docs][llvm-dwarfdump] Add missing options and behaviour to documentation · 86b510aa
      James Henderson authored
      This fixes https://bugs.llvm.org/show_bug.cgi?id=42185.
      
      llvm-dwarfdump's documentation was missing a number of options and other
      behaviours. This change tries to fix up the documentation by adding
      these missing items.
      
      Reviewed by: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D63217
      
      llvm-svn: 363264
      86b510aa
    • Dmitri Gribenko's avatar
      [clang-tidy] Fixed abseil-duration-unnecessary-conversion tests for c++17 · ab240c5e
      Dmitri Gribenko authored
      Summary: Fixed abseil-duration-unnecessary-conversion tests for c++17
      
      Reviewers: hokein, gribozavr
      
      Reviewed By: gribozavr
      
      Subscribers: xazax.hun, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D63263
      
      Patch by Johan Vikström.
      
      llvm-svn: 363263
      ab240c5e
    • Dmitri Gribenko's avatar
      Added AST matcher for ignoring elidable constructors · 31d68804
      Dmitri Gribenko authored
      Summary: Added AST matcher for ignoring elidable move constructors
      
      Reviewers: hokein, gribozavr
      
      Reviewed By: hokein, gribozavr
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D63149
      
      Patch by Johan Vikström.
      
      llvm-svn: 363262
      31d68804
    • Eugene Leviant's avatar
      [lld][ELF] Add tests for bad subsection length in .ARM.attributes · 0eb763c5
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D63191
      
      llvm-svn: 363261
      0eb763c5
    • Eugene Leviant's avatar
      Extra error checking to ARMAttributeParser · 407c8f1f
      Eugene Leviant authored
      The patch checks for subsection length as discussed in D63191
      
      llvm-svn: 363260
      407c8f1f
    • Jeremy Morse's avatar
      [NFC] Sink a function call into LiveDebugValues::process · d2cd9c23
      Jeremy Morse authored
      This was requested in D62904, which I successfully missed. This is just
      a refactor and shouldn't change any behaviour.
      
      llvm-svn: 363259
      d2cd9c23
    • Simon Tatham's avatar
      [ARM] Set up infrastructure for MVE vector instructions. · 286e1d2c
      Simon Tatham authored
      This commit prepares the way to start adding the main collection of
      MVE instructions, which operate on the 128-bit vector registers.
      
      The most obvious thing that's needed, and the simplest, is to add the
      MQPR register class, which is like the existing QPR except that it has
      fewer registers in it.
      
      The more complicated part: MVE defines a system of vector predication,
      in which instructions operating on 128-bit vector registers can be
      constrained to operate on only a subset of the lanes, using a system
      of prefix instructions similar to the existing Thumb IT, in that you
      have one prefix instruction which designates up to 4 following
      instructions as subject to predication, and within that sequence, the
      predicate can be inverted by means of T/E suffixes ('Then' / 'Else').
      
      To support instructions of this type, we've added two new Tablegen
      classes `vpred_n` and `vpred_r` for standard clusters of MC operands
      to add to a predicated instruction. Both include a flag indicating how
      the instruction is predicated at all (options are T, E and 'not
      predicated'), and an input register field for the register controlling
      the set of active lanes. They differ from each other in that `vpred_r`
      also includes an input operand for the previous value of the output
      register, for instructions that leave inactive lanes unchanged.
      `vpred_n` lacks that extra operand; it will be used for instructions
      that don't preserve inactive lanes in their output register (either
      because inactive lanes are zeroed, as the MVE load instructions do, or
      because the output register isn't a vector at all).
      
      This commit also adds the family of prefix instructions themselves
      (VPT / VPST), and all the machinery needed to work with them in
      assembly and disassembly (e.g. generating the 't' and 'e' mnemonic
      suffixes on disassembled instructions within a predicated block)
      
      I've added a couple of demo instructions that derive from the new
      Tablegen base classes and use those two operand clusters. The bulk of
      the vector instructions will come in followup commits small enough to
      be manageable. (One exception is that I've added the full version of
      `isMnemonicVPTPredicable` in the AsmParser, because it seemed
      pointless to carefully split it up.)
      
      Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover
      
      Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D62669
      
      llvm-svn: 363258
      286e1d2c
    • Simon Pilgrim's avatar
      [CodeGen] Add getMachineMemOperand + MachineMemOperand::Flags allocator helper wrapper. NFCI. · 6b56ad16
      Simon Pilgrim authored
      Pre-commit for D62726 on behalf of @luke (Luke Lau)
      
      llvm-svn: 363257
      6b56ad16
    • Jeremy Morse's avatar
      [DebugInfo] Honour variable fragments in LiveDebugValues · bf2b2f08
      Jeremy Morse authored
      This patch makes the LiveDebugValues pass consider fragments when propagating
      DBG_VALUE insts between blocks, fixing PR41979. Fragment info for a variable
      location is added to the open-ranges key, which allows distinct fragments to be
      tracked separately. To handle overlapping fragments things become slightly
      funkier. To avoid excessive searching for overlaps in the data-flow part of
      LiveDebugValues, this patch:
       * Pre-computes pairings of fragments that overlap, for each DILocalVariable
       * During data-flow, whenever something happens that causes an open range to
         be terminated (via erase), any fragments pre-determined to overlap are
         also terminated.
      
      The effect of which is that when encountering a DBG_VALUE fragment that
      overlaps others, the overlapped fragments do not get propagated to other
      blocks. We still rely on later location-list building to correctly handle
      overlapping fragments within blocks.
      
      It's unclear whether a mixture of DBG_VALUEs with and without fragmented
      expressions are legitimate. To avoid suprises, this patch interprets a
      DBG_VALUE with no fragment as overlapping any DBG_VALUE _with_ a fragment.
      
      Differential Revision: https://reviews.llvm.org/D62904
      
      llvm-svn: 363256
      bf2b2f08
    • Dmitry Preobrazhensky's avatar
      [AMDGPU][MC] Enabled constant expressions as operands of s_getreg/s_setreg · 1fca3b19
      Dmitry Preobrazhensky authored
      See bug 40820: https://bugs.llvm.org/show_bug.cgi?id=40820
      
      Reviewers: artem.tamazov, arsenm
      
      Differential Revision: https://reviews.llvm.org/D61125
      
      llvm-svn: 363255
      1fca3b19
    • Eugene Leviant's avatar
      [ThinLTO][Bitcode] Add 'entrycount' to FS_COMBINED_PROFILE. NFC · b00dbcbb
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D63078
      
      llvm-svn: 363254
      b00dbcbb
    • Kadir Cetinkaya's avatar
      [Clangd] Fixed clangd diagnostics priority · 88e636df
      Kadir Cetinkaya authored
      Summary:
      - Fixed diagnostics where zero width inserted ranges were being used instead of the whole token
      - Added unit tests
      
      Patch by @SureYeaah !
      
      Reviewers: sammccall, kadircet
      
      Reviewed By: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
      
      Tags: #clang-tools-extra, #clang
      
      Differential Revision: https://reviews.llvm.org/D63222
      
      llvm-svn: 363253
      88e636df
    • Simon Pilgrim's avatar
      [X86][AVX] Add broadcast(v4f64 hadd) test · a284f4fa
      Simon Pilgrim authored
      llvm-svn: 363252
      a284f4fa
    • Simon Pilgrim's avatar
      [X86][SSE] Avoid assert for broadcast(horiz-op()) cases for non-f64 cases. · 0baf136a
      Simon Pilgrim authored
      Based on fuzz test from @craig.topper
      
      llvm-svn: 363251
      0baf136a
    • Pavel Labath's avatar
      DWARF: Don't create lldb CompileUnits for DWARF type units · ad17e289
      Pavel Labath authored
      Summary:
      Type units don't represent actual compilations and a lot of the
      operations that we do with lldb compile units (getting their line
      tables, variables, etc.) don't make sense for them. There is also a lot
      more of them (sometimes over 100x), so making them more lightweight pays
      off.
      
      The main change in this patch is that we stop creating lldb CompileUnits
      for DWARF type units. The trickiest part here is that the SymbolFile
      interface requires that we assign consecutive sequence IDs to the
      compile units we create. As DWARF type and compile units can come in any
      order (in v5), this means we can no longer use 1-1 mapping between DWARF
      and lldb compile units. Instead I build a translation table between the
      two indices. To avoid pessimizing the case where there are no type
      units, I build the translation table only in case we have at least one
      type unit.
      
      Additionaly, I also tried to strenghted type safete by replacing
      DWARFUnit with DWARFCompileUnit where applicable. Though that was not
      stricly necessary, I found it a good way to ensure that the
      transformations I am doing here make sense. In the places where I was
      changing the function signatures, and where it was obvious that the
      objects being handled were not null, I also replaced pointers with
      references.
      
      There shouldn't be any major functional change with this patch. The only
      change I observed is that now the types in the type units will not be
      parsed when one calls Module::ParseAllDebugSymbols, unless they are
      referenced from other compile units. This makes sense, given how
      ParseAllDebugSymbols is implemented (it iterates over all compile
      units), and it only matters for one hand-writted test where I did not
      bother to reference the types from the compile units (which I now do).
      
      Reviewers: clayborg, JDevlieghere, aprantl
      
      Subscribers: jdoerfert, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D63005
      
      llvm-svn: 363250
      ad17e289
    • Simon Pilgrim's avatar
      [X86][SSE] Add tests for underaligned nt stores · a6b87aa7
      Simon Pilgrim authored
      Test both 'unaligned' (which we should scalarize) and 'subvector aligned' (which we should split)
      
      llvm-svn: 363249
      a6b87aa7
    • Chris Jackson's avatar
      [llvm-nm] Additional lit tests for command line options · 7b395133
      Chris Jackson authored
          Differential Revision: https://reviews.llvm.org/D62955
      
      llvm-svn: 363248
      7b395133
    • Simon Pilgrim's avatar
      [X86][SSE] Add SSE4A nt store tests on X86 as well as X64 · e1aea858
      Simon Pilgrim authored
      We should be able to use MOVNTSD (f64) instead of MOVNTI (i32) to reduce the number of ops 32-bit targets
      
      Pulled out of D63246
      
      llvm-svn: 363247
      e1aea858
    • Nikola Prica's avatar
      [DebugInfo] Move Value struct out of DebugLocEntry as DbgValueLoc (NFC) · 076ae0d2
      Nikola Prica authored
      Since the DebugLocEntry::Value is used as part of DwarfDebug and
      DebugLocEntry make it as the separate class.
      
      Reviewers: aprantl, dstenb
      
      Reviewed By: aprantl
      
      Differential Revision: https://reviews.llvm.org/D63213
      
      llvm-svn: 363246
      076ae0d2
    • Jeremy Morse's avatar
      [DebugInfo] Use FrameDestroy to extend stack locations to end-of-function · 181bf0ce
      Jeremy Morse authored
      We aim to ignore changes in variable locations during the prologue and
      epilogue of functions, to avoid using space documenting location changes
      that aren't visible. However in D61940 / r362951 this got ripped out as
      the previous implementation was unsound.
      
      Instead, use the FrameDestroy flag to identify when we're in the epilogue
      of a function, and ignore variable location changes accordingly. This fits
      in with existing code that examines the FrameSetup flag.
      
      Some variable locations get shuffled in modified tests as they now cover
      greater ranges, which is what would be expected. Some additional
      single-location variables are generated too. Two tests are un-xfailed,
      they were only xfailed due to r362951 deleting functionality they depended
      on.
      
      Apparently some out-of-tree backends don't accurately maintain FrameDestroy
      flags -- if you're an out-of-tree maintainer and see changes in variable
      locations disappear due to a faulty FrameDestroy flag, it's safe to back
      this change out. The impact is just slightly more debug info than necessary.
      
      Differential Revision: https://reviews.llvm.org/D62314
      
      llvm-svn: 363245
      181bf0ce
    • Simon Tatham's avatar
      [ARM] Refactor handling of IT mask operands. · 848d3d0d
      Simon Tatham authored
      During assembly, the mask operand to an IT instruction (storing the
      sequence of T/E for 'Then' and 'Else') is parsed out of the mnemonic
      into a representation that encodes 'Then' and 'Else' in the same way
      regardless of the condition code. At some point during encoding it has
      to be converted into the instruction encoding used in the
      architecture, in which the mask encodes a sequence of replacement
      low-order bits for the condition code, so that which bit value means
      'then' and which 'else' depends on whether the original condition code
      had its low bit set.
      
      Previously, that transformation was done by processInstruction(), half
      way through assembly. So an MCOperand storing an IT mask would
      sometimes store it in one format, and sometimes in the other,
      depending on where in the assembly pipeline you were. You can see this
      in diagnostics from `llvm-mc -debug -triple=thumbv8a -show-inst`, for
      example: if you give it an instruction such as `itete eq`, you'd see
      an `<MCOperand Imm:5>` in a diagnostic become `<MCOperand Imm:11>` in
      the final output.
      
      Having the same data structure store values with time-dependent
      semantics is confusing already, and it will get more confusing when we
      introduce the MVE VPT instruction which reuses the Then/Else bitmask
      idea in a different context. So I'm refactoring: now, all `ARMOperand`
      and `MCOperand` representations of an IT mask work exactly the same
      way, namely, 0 means 'Then' and 1 means 'Else', regardless of what
      original predicate is being referred to. The architectural encoding of
      IT that depends on the original condition is now constructed at the
      point when we turn the `MCOperand` into the final instruction bit
      pattern, and decoded similarly in the disassembler.
      
      The previous condition-independent parse-time format used 0 for Else
      and 1 for Then. I've taken the opportunity to flip the sense of it
      while I'm changing all of this anyway, because it seems to me more
      natural to use 0 for 'leave the starting condition unchanged' and 1
      for 'invert it', as if those bits were an XOR mask.
      
      Reviewers: ostannard
      
      Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63219
      
      llvm-svn: 363244
      848d3d0d
    • Eugene Leviant's avatar
      [llvm-objcopy] Implement IHEX reader · 86b7f865
      Eugene Leviant authored
      This is the final part of IHEX format support in llvm-objcopy
      Differential revision: https://reviews.llvm.org/D62583
      
      llvm-svn: 363243
      86b7f865
    • Sven van Haastregt's avatar
      [OpenCL] Move OpenCLBuiltins.td and remove unused include · 95a9ee5e
      Sven van Haastregt authored
      Patch by Pierre Gondois.
      
      Differential revision: https://reviews.llvm.org/D62849
      
      llvm-svn: 363242
      95a9ee5e
    • Sam Clegg's avatar
      [WebAssembly] Modernize include path handling · 818dd866
      Sam Clegg authored
      Move include path construction from
      InitHeaderSearch::AddDefaultIncludePaths in the Driver which appears
      to be the more modern/correct way of doing things.
      
      Differential Revision: https://reviews.llvm.org/D63030
      
      llvm-svn: 363241
      818dd866
    • Sander de Smalen's avatar
      Improve reduction intrinsics by overloading result value. · 51c2fa0e
      Sander de Smalen authored
      This patch uses the mechanism from D62995 to strengthen the
      definitions of the reduction intrinsics by letting the scalar
      result/accumulator type be overloaded from the vector element type.
      
      For example:
      
        ; The LLVM LangRef specifies that the scalar result must equal the
        ; vector element type, but this is not checked/enforced by LLVM.
        declare i32 @llvm.experimental.vector.reduce.or.i32.v4i32(<4 x i32> %a)
      
      This patch changes that into:
      
        declare i32 @llvm.experimental.vector.reduce.or.v4i32(<4 x i32> %a)
      
      Which has the type-constraint more explicit and causes LLVM to check
      the result type with the vector element type.
      
      Reviewers: RKSimon, arsenm, rnk, greened, aemerson
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D62996
      
      llvm-svn: 363240
      51c2fa0e
    • Owen Reynolds's avatar
      Revert [llvm-ar][test] Add to MRI test coverage · 8d59f537
      Owen Reynolds authored
      This reverts 363232 due to mru-utf8.test buildbot test failure
      
      Differential Revision: https://reviews.llvm.org/D63197
      
      llvm-svn: 363239
      8d59f537
    • Sam Clegg's avatar
      [clang-scan-deps] Fix -DBUILD_SHARED_LIBS=ON build · f9ad6e57
      Sam Clegg authored
      The -DBUILD_SHARED_LIBS=ON build was broken in rL363204
      
      Differential Revision: https://reviews.llvm.org/D63245
      
      llvm-svn: 363238
      f9ad6e57
    • Kadir Cetinkaya's avatar
      [clangd] Treat lambdas as functions when preparing hover response · 49779275
      Kadir Cetinkaya authored
      Reviewers: sammccall, ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D62814
      
      llvm-svn: 363237
      49779275
    • Fangrui Song's avatar
      [ELF] Loosen the condition that changes absolute relocation types to relative... · a78e0255
      Fangrui Song authored
      [ELF] Loosen the condition that changes absolute relocation types to relative relocations for ARM and PPC64
      
      Try fixing build bots after D63121
      
      llvm-svn: 363236
      a78e0255
    • Sam Parker's avatar
      [NFC] Simplify Call query · 179e0fa8
      Sam Parker authored
      Use getIntrinsicID() directly from IntrinsicInst.
      
      llvm-svn: 363235
      179e0fa8
    • Sam Parker's avatar
      [ARM][TTI] Scan for existing loop intrinsics · 9d28473a
      Sam Parker authored
      TTI should report that it's not profitable to generate a hardware loop
      if it, or one of its child loops, has already been converted.
      
      Differential Revision: https://reviews.llvm.org/D63212
      
      llvm-svn: 363234
      9d28473a
    • Sander de Smalen's avatar
      [IntrinsicEmitter] Extend argument overloading with forward references. · 7957fc65
      Sander de Smalen authored
      Extend the mechanism to overload intrinsic arguments by using either
      backward or forward references to the overloadable arguments.
      
      In for example:
      
        def int_something : Intrinsic<[LLVMPointerToElt<0>],
                                      [llvm_anyvector_ty], []>;
      
      LLVMPointerToElt<0> is a forward reference to the overloadable operand
      of type 'llvm_anyvector_ty' and would allow intrinsics such as:
      
        declare i32* @llvm.something.v4i32(<4 x i32>);
        declare i64* @llvm.something.v2i64(<2 x i64>);
      
      where the result pointer type is deduced from the element type of the
      first argument.
      
      If the returned pointer is not a pointer to the element type, LLVM will
      give an error:
      
        Intrinsic has incorrect return type!
        i64* (<4 x i32>)* @llvm.something.v4i32
      
      Reviewers: RKSimon, arsenm, rnk, greened
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D62995
      
      llvm-svn: 363233
      7957fc65
    • Owen Reynolds's avatar
      [llvm-ar][test] Add to MRI test coverage · 02eac87b
      Owen Reynolds authored
      This change adds tests to cover existing MRI script functionality.
      
      Differential Revision: https://reviews.llvm.org/D63197
      
      llvm-svn: 363232
      02eac87b
    • Craig Topper's avatar
      [X86] Correct instruction operands in evex-to-vex-compress.mir to be closer to real instructions. · b1daec0e
      Craig Topper authored
      $noreg was being used way more than it should have. We also had
      xmm registers in addressing modes.
      
      Mostly found by hacking the machine verifier to do some stricter
      checking that happened to work for this test, but not sure if
      generally applicable for other tests or other targets.
      
      llvm-svn: 363231
      b1daec0e
    • Hans Wennborg's avatar
      clang-format extension: Widen the supported versions range · 1f053207
      Hans Wennborg authored
      So that it covers also the latest VS 2019 version.
      
      By Antonio Maiorano!
      
      llvm-svn: 363230
      1f053207
    • Shawn Landden's avatar
      [SimplifyCFG] reverting preliminary Switch patches again · 8b142bcc
      Shawn Landden authored
      This reverts 363226 and 363227, both NFC intended
      
      I swear I fixed the test case that is failing, and ran
      the tests, but I will look into it again.
      
      llvm-svn: 363229
      8b142bcc
    • Jonas Devlieghere's avatar
      [Reproducers] Remove call to lldb_private::GetVersion() · 2bf25681
      Jonas Devlieghere authored
      Utility doesn't link against lldbBase so we cannot call GetVersion in
      keep. I already added a string member m_version to deal with that, but
      the call was still there.
      
      llvm-svn: 363228
      2bf25681
    • Shawn Landden's avatar
      [SimpligyCFG] NFC intended, remove GCD that was only used for powers of two · 636220e8
      Shawn Landden authored
      and replace with an equilivent countTrailingZeros.
      
      GCD is much more expensive than this, with repeated division.
      
      This depends on D60823
      
      Differential Revision: https://reviews.llvm.org/D61151
      
      llvm-svn: 363227
      636220e8