1. Dec 15, 2018
    • Florian Hahn's avatar
      [SILoadStoreOptimizer] Use std::abs to avoid truncation. · abe32c91
      Florian Hahn authored
      Using regular abs() causes the following warning
      
      error: absolute value function 'abs' given an argument of type 'int64_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
              (uint32_t)abs(Dist) > MaxDist) {
                        ^
      lib/Target/AMDGPU/SILoadStoreOptimizer.cpp:1369:19: note: use function 'std::abs' instead
      
      which causes a bot to fail:
      http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/18284/steps/bootstrap%20clang/logs/stdio
      
      llvm-svn: 349224
      abe32c91
    • Craig Topper's avatar
      [X86] Rename hasNoSignedComparisonUses to hasNoSignFlagUses. Add the... · 1fc257d9
      Craig Topper authored
      [X86] Rename hasNoSignedComparisonUses to hasNoSignFlagUses. Add the instruction that only modify the O flag to the waiver list.
      
      The only caller of this turns CMP with 0 into TEST. CMP with 0 and TEST both set OF to 0 so we should have no issues with instructions that only use OF.
      
      Though I don't think there's any reason we would read just OF after a compare with 0 anyway. So this probably isn't an observable change.
      
      llvm-svn: 349223
      1fc257d9
    • Craig Topper's avatar
      [X86] Make hasNoCarryFlagUses/hasNoSignedComparisonUses take an SDValue that... · 5c304eac
      Craig Topper authored
      [X86] Make hasNoCarryFlagUses/hasNoSignedComparisonUses take an SDValue that indicates which result is the flag result. NFCI
      
      hasNoCarryFlagUses hardcoded that the flag result is 1 and used that to filter which uses were of interest. hasNoSignedComparisonUses just assumes the only result is flags and checks whether any user of the node is a CopyToReg instruction.
      
      After this patch we now do a result number check in both and rely on the caller to provide the result number.
      
      This shouldn't change behavior it was just an odd difference between the two functions that I noticed.
      
      llvm-svn: 349222
      5c304eac
    • Heejin Ahn's avatar
      [WebAssembly] Check if the section order is correct · feef720b
      Heejin Ahn authored
      Summary:
      This patch checks if the section order is correct when reading a wasm
      object file in `WasmObjectFile` and converting YAML to wasm object in
      yaml2wasm. (It is not possible to check when reading YAML because it is
      handled exclusively by the YAML reader.)
      
      This checks the ordering of all known sections (core sections + known
      custom sections). This also adds section ID DataCount section that will
      be scheduled to be added in near future.
      
      Reviewers: sbc100
      
      Subscribers: dschuff, mgorny, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54924
      
      llvm-svn: 349221
      feef720b
    • Florian Hahn's avatar
      [NewGVN] Update use counts for SSA copies when replacing them by their operands. · c214bc2b
      Florian Hahn authored
      The current code relies on LeaderUseCount to determine if we can remove
      an SSA copy, but in that the LeaderUseCount does not refer to the SSA
      copy. If a SSA copy is a dominating leader, we use the operand as dominating
      leader instead. This means we removed a user of a ssa copy and we should
      decrement its use count, so we can remove the ssa copy once it becomes dead.
      
      Fixes PR38804.
      
      Reviewers: efriedma, davide
      
      Reviewed By: davide
      
      Differential Revision: https://reviews.llvm.org/D51595
      
      llvm-svn: 349217
      c214bc2b
    • Peter Collingbourne's avatar
      ELF: Handle R_ARM_V4BX correctly in PIC output files. · ae15e723
      Peter Collingbourne authored
      Previously we considered R_ARM_V4BX to be an absolute relocation,
      which meant that we rejected it in read-only sections in PIC output
      files. Instead, treat it as a hint relocation so that relocation
      processing ignores it entirely.
      
      Also fix a problem with the test case where it was never being run
      because it has a .yaml extension and we don't run tests with that
      extension.
      
      Differential Revision: https://reviews.llvm.org/D55728
      
      llvm-svn: 349216
      ae15e723
    • Jonas Devlieghere's avatar
      Simplify Boolean expressions · a6682a41
      Jonas Devlieghere authored
      This patch simplifies boolean expressions acorss LLDB. It was generated
      using clang-tidy with the following command:
      
      run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD
      
      Differential revision: https://reviews.llvm.org/D55584
      
      llvm-svn: 349215
      a6682a41
    • Vedant Kumar's avatar
      [Util] Refer to [s|z]exts of args when converting dbg.declares (fix PR35400) · 9d182733
      Vedant Kumar authored
      When converting dbg.declares, if the described value is a [s|z]ext,
      refer to the ext directly instead of referring to its operand.
      
      This fixes a narrowing bug (the debugger got the sign of a variable
      wrong, see llvm.org/PR35400).
      
      The main reason to refer to the ext's operand was that an optimization
      may remove the ext itself, leading to a dropped variable. Now that
      InstCombine has been taught to use replaceAllDbgUsesWith (r336451), this
      is less of a concern. Other passes can/should adopt this API as needed
      to fix dropped variable bugs.
      
      Differential Revision: https://reviews.llvm.org/D51813
      
      llvm-svn: 349214
      9d182733
    • Artem Belevich's avatar
      [NVPTX] Lower instructions that expand into libcalls. · 6d74bd63
      Artem Belevich authored
      The change is an effort to split and refactor abandoned
      D34708 into smaller parts.
      
      Here the behaviour of unsupported instructions is changed
      to match the behaviour of explicit intrinsics calls.
      Currently LLVM crashes with:
      > Assertion getInstruction() && "Not a call or invoke instruction!" failed.
      
      With this patch LLVM produces a more sensible error message:
      > Cannot select: ... i32 = ExternalSymbol'__foobar'
      
      Author: Denys Zariaiev <denys.zariaiev@gmail.com>
      
      Differential Revision: https://reviews.llvm.org/D55145
      
      llvm-svn: 349213
      6d74bd63
    • Reid Kleckner's avatar
      Mangle calling conventions into function pointer types where GCC does · f5f62908
      Reid Kleckner authored
      Summary:
      GCC 5.1 began mangling these Windows calling conventions into function
      types, since they can be used for overloading. They've always been
      mangled in the MS ABI, but they are new to the Itanium mangler. Note
      that the calling convention doesn't appear as part of the main
      declaration, it only appears on function parameter types and other
      types.
      
      Fixes PR39860
      
      Reviewers: rjmccall, efriedma
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55672
      
      llvm-svn: 349212
      f5f62908
    • Jim Ingham's avatar
      Fix the unittests for the move of Listener & Broadcaster · d81b96ec
      Jim Ingham authored
      from Core to Utility.
      
      llvm-svn: 349211
      d81b96ec
    • Kostya Serebryany's avatar
      [libFuzzer] make len_control less aggressive · 1879e8d3
      Kostya Serebryany authored
      llvm-svn: 349210
      1879e8d3
    • Erich Keane's avatar
      Add AddressSpace mangling to MS mode · 24a0f04f
      Erich Keane authored
      All of the symbols demangle on llvm-undname and demangler.com. This
      address space qualifier is useful for when we want to use opencl C++ in
      Windows mode. Additionally, C++ address-space using functions will now
      be usable on windows.
      
      Differential Revision: https://reviews.llvm.org/D55715
      
      Change-Id: Ife4506613c3cce778a783456d62117fbf7d83c26
      llvm-svn: 349209
      24a0f04f
    • Tatyana Krasnukha's avatar
    • David Blaikie's avatar
      DebugInfo: Avoid using split DWARF when the split unit would be empty. · 560ff355
      David Blaikie authored
      In ThinLTO many split CUs may be effectively empty because of the lack
      of support for cross-unit references in split DWARF.
      
      Using a split unit in those cases is just a waste/overhead - and turned
      out to be one contributor to a significant symbolizer performance issue
      when global variable debug info was being imported (see r348416 for the
      primary fix) due to symbolizers seeing CUs with no ranges, assuming
      there might still be addresses covered and walking into the split CU to
      see if there are any ranges (when that split CU was in a DWP file, that
      meant loading the DWP and its index, the index was extra large because
      of all these fractured/empty CUs... and so was very expensive to load).
      
      (the 3rd fix which will follow, is to assume that a CU with no ranges is
      empty rather than merely missing its CU level range data - and to not
      walk into its DIEs (split or otherwise) in search of address information
      that is generally not present)
      
      llvm-svn: 349207
      560ff355
    • Erich Keane's avatar
      Revert "Add extension to always default-initialize nullptr_t." · 1b9c7460
      Erich Keane authored
      This reverts commit 46efdf2ccc2a80aefebf8433dbf9c7c959f6e629.
      
      Richard Smith commented just after I submitted this that this is the
      wrong solution.  Reverting so that I can fix differently.
      
      llvm-svn: 349206
      1b9c7460
    • Reid Kleckner's avatar
      [codeview] Add begin/endSymbolRecord helpers, NFC · 5bf71d11
      Reid Kleckner authored
      Previously beginning a symbol record was excessively verbose. Now it's a
      bit simpler. This follows the same pattern as begin/endCVSubsection.
      
      llvm-svn: 349205
      5bf71d11
    • Michal Gorny's avatar
      [test] Capture stderr from 'tar --version' call as well · fbed4e1d
      Michal Gorny authored
      Capture the stderr from 'tar --version' call as otherwise error messages
      spill onto user's terminal unnecessarily (e.g. on NetBSD where tar does
      not support long options).  While at it, refactor the code to use
      communicate() instead of reinventing the wheel.
      
      Differential Revision: https://reviews.llvm.org/D55443
      
      llvm-svn: 349204
      fbed4e1d
    • David Blaikie's avatar
      DebugInfo: Move addAddrBase from DwarfUnit to DwarfCompileUnit · 61c127c1
      David Blaikie authored
      Only CUs need an address table reference.
      
      llvm-svn: 349203
      61c127c1
    • Krzysztof Parzyszek's avatar
      [Hexagon] Add patterns for shifts of v2i16 · 26d994f5
      Krzysztof Parzyszek authored
      This fixes https://llvm.org/PR39983.
      
      llvm-svn: 349202
      26d994f5
    • Erich Keane's avatar
      Add extension to always default-initialize nullptr_t. · 07325c80
      Erich Keane authored
      Core issue 1013 suggests that having an uninitialied std::nullptr_t be
      UB is a bit foolish, since there is only a single valid value. This DR
      reports that DR616 fixes it, which does so by making lvalue-to-rvalue
      conversions from nullptr_t be equal to nullptr.
      
      However, just implementing that results in warnings/etc in many places.
      In order to fix all situations where nullptr_t would seem uninitialized,
      this patch instead (as an otherwise transparent extension) default
      initializes uninitialized VarDecls of nullptr_t.
      
      Differential Revision: https://reviews.llvm.org/D53713
      
      Change-Id: I84d72a9290054fa55341e8cbdac43c8e7f25b885
      llvm-svn: 349201
      07325c80
    • Volkan Keles's avatar
      [GlobalISel] LegalizerHelper: Implement fewerElementsVector for G_LOAD/G_STORE · 574d737e
      Volkan Keles authored
      Reviewers: aemerson, dsanders, bogner, paquette, aditya_nandakumar
      
      Reviewed By: dsanders
      
      Subscribers: rovka, kristof.beyls, javed.absar, tschuett, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53728
      
      llvm-svn: 349200
      574d737e
    • Krzysztof Parzyszek's avatar
      c0fc0a97
    • Rui Ueyama's avatar
      Add --plugin-opt=emit-llvm option. · 9f499909
      Rui Ueyama authored
      `--plugin-opt=emit-llvm` is an option for LTO. It makes the linker to
      combine all bitcode files and write the result to an output file without
      doing codegen. Gold LTO plugin has this option.
      
      This option is being used for some post-link code analysis tools that
      have to see a whole program but don't need to see them in the native
      machine code.
      
      Differential Revision: https://reviews.llvm.org/D55717
      
      llvm-svn: 349198
      9f499909
    • Aaron Ballman's avatar
      Using llvm::find_if() instead of a range-based for loop; NFC. · 847e73d6
      Aaron Ballman authored
      This addresses post-commit review feedback from r349188.
      
      llvm-svn: 349197
      847e73d6
    • Farhana Aleen's avatar
      [AMDGPU] Promote constant offset to the immediate by finding a new base with... · ce095c56
      Farhana Aleen authored
      [AMDGPU] Promote constant offset to the immediate by finding a new base with 13bit constant offset from the nearby instructions.
      
      Summary: Promote constant offset to immediate by recomputing the relative 13bit offset from nearby instructions.
       E.g.
        s_movk_i32 s0, 0x1800
        v_add_co_u32_e32 v0, vcc, s0, v2
        v_addc_co_u32_e32 v1, vcc, 0, v6, vcc
      
        s_movk_i32 s0, 0x1000
        v_add_co_u32_e32 v5, vcc, s0, v2
        v_addc_co_u32_e32 v6, vcc, 0, v6, vcc
        global_load_dwordx2 v[5:6], v[5:6], off
        global_load_dwordx2 v[0:1], v[0:1], off
        =>
        s_movk_i32 s0, 0x1000
        v_add_co_u32_e32 v5, vcc, s0, v2
        v_addc_co_u32_e32 v6, vcc, 0, v6, vcc
        global_load_dwordx2 v[5:6], v[5:6], off
        global_load_dwordx2 v[0:1], v[5:6], off offset:2048
      
      Author: FarhanaAleen
      
      Reviewed By: arsenm, rampitec
      
      Subscribers: llvm-commits, AMDGPU
      
      Differential Revision: https://reviews.llvm.org/D55539
      
      llvm-svn: 349196
      ce095c56
    • Eric Fiselier's avatar
      [Clang] Add __builtin_launder · 26187505
      Eric Fiselier authored
      Summary:
      This patch adds `__builtin_launder`, which is required to implement `std::launder`. Additionally GCC provides `__builtin_launder`, so thing brings Clang in-line with GCC.
      
      I'm not exactly sure what magic `__builtin_launder` requires, but  based on previous discussions this patch applies a `@llvm.invariant.group.barrier`. As noted in previous discussions, this may not be enough to correctly handle vtables.
      
      Reviewers: rnk, majnemer, rsmith
      
      Reviewed By: rsmith
      
      Subscribers: kristina, Romain-Geissler-1A, erichkeane, amharc, jroelofs, cfe-commits, Prazek
      
      Differential Revision: https://reviews.llvm.org/D40218
      
      llvm-svn: 349195
      26187505
    • Adrian Prantl's avatar
      Remove the Disassembly benchmarks. · 8f06d102
      Adrian Prantl authored
      While I was out hunting for remaining pexpect-based tests, I came
      across these tests that can't possibly work an any modern system, as
      they rely on having gdb available in /Developer.
      
      This patch simply removes the test without replacement.
      
      Differential Revision: https://reviews.llvm.org/D55559
      
      llvm-svn: 349194
      8f06d102
    • Eric Fiselier's avatar
      Add missing includes and forward decls to unbreak build · 0cabf819
      Eric Fiselier authored
      llvm-svn: 349193
      0cabf819
    • Alexey Bataev's avatar
      [OPENMP][NVPTX]Improved interwarp copy function. · ae51b96f
      Alexey Bataev authored
      Inlined runtime with the current implementation of the interwarp copy
      function leads to the undefined behavior because of the not quite
      correct implementation of the barriers. Start using generic
      __kmpc_barier function instead of the custom made barriers.
      
      llvm-svn: 349192
      ae51b96f
    • Artem Dergachev's avatar
      [analyzer] MoveChecker Pt.6: Suppress the warning for the move-safe STL classes. · 11cadc3e
      Artem Dergachev authored
      Some C++ standard library classes provide additional guarantees about their
      state after move. Suppress warnings on such classes until a more precise
      behavior is implemented. Warnings for locals are not suppressed anyway
      because it's still most likely a bug.
      
      Differential Revision: https://reviews.llvm.org/D55307
      
      llvm-svn: 349191
      11cadc3e
    • Artem Dergachev's avatar
      [analyzer] MoveChecker: Improve invalidation policies. · 12f7c2ba
      Artem Dergachev authored
      If a moved-from object is passed into a conservatively evaluated function
      by pointer or by reference, we assume that the function may reset its state.
      
      Make sure it doesn't apply to const pointers and const references. Add a test
      that demonstrates that it does apply to rvalue references.
      
      Additionally, make sure that the object is invalidated when its contents change
      for reasons other than invalidation caused by evaluating a call conservatively.
      In particular, when the object's fields are manipulated directly, we should
      assume that some sort of reset may be happening.
      
      Differential Revision: https://reviews.llvm.org/D55289
      
      llvm-svn: 349190
      12f7c2ba
    • Eric Fiselier's avatar
      Tolerate Clangs new static_assert messages · 3e5d847f
      Eric Fiselier authored
      llvm-svn: 349189
      3e5d847f
    • Aaron Ballman's avatar
      Update our SARIF support from 10-10 to 11-28. · 3ccec59e
      Aaron Ballman authored
      Functional changes include:
      
      * The run.files property is now an array instead of a mapping.
      * fileLocation objects now have a fileIndex property specifying the array index into run.files.
      * The resource.rules property is now an array instead of a mapping.
      * The result object was given a ruleIndex property that is an index into the resource.rules array.
      * rule objects now have their "id" field filled out in addition to the name field.
      * Updated the schema and spec version numbers to 11-28.
      
      llvm-svn: 349188
      3ccec59e
    • Louis Dionne's avatar
      [libcxx] Mark some tests as still failing on macosx10.14 · a5e2b081
      Louis Dionne authored
      llvm-svn: 349187
      a5e2b081
    • Krzysztof Parzyszek's avatar
      6b01d354
    • Evandro Menezes's avatar
      [AArch64] Simplify the scheduling predicates (NFC) · ea9d9008
      Evandro Menezes authored
      The instruction encodings make it unnecessary to distinguish extended W-form
      from X-form instructions.
      
      llvm-svn: 349185
      ea9d9008
    • Michael Kruse's avatar
      [TransformWarning] Do not warn missed transformations in optnone functions. · ea9ef345
      Michael Kruse authored
      Optimization transformations are intentionally disabled by the 'optnone'
      function attribute. Therefore do not warn if transformation metadata is
      still present.
      
      Using the legacy pass manager structure, the `skipFunction` method takes
      care for the optnone attribute (already called before this patch). For
      the new pass manager, there is no equivalent, so we check for the
      'optnone' attribute manually.
      
      Differential Revision: https://reviews.llvm.org/D55690
      
      llvm-svn: 349184
      ea9ef345
    • Greg Clayton's avatar
      Add missing .dmp files to test inputs. · baaf2cc7
      Greg Clayton authored
      llvm-svn: 349183
      baaf2cc7
    • Greg Clayton's avatar
      Cache memory regions in ProcessMinidump and use the linux maps as the source... · 026e1bf5
      Greg Clayton authored
      Cache memory regions in ProcessMinidump and use the linux maps as the source of the information if available
      
      Breakpad creates minidump files that sometimes have:
      - linux maps textual content
      - no MemoryInfoList
      
      Right now unless the file has a MemoryInfoList we get no region information.
      
      This patch:
      
      - reads and caches the memory region info one time and sorts it for easy subsequent access
      - get the region info from the best source in this order:
        - linux maps info (if available)
        - MemoryInfoList (if available)
        - MemoryList or Memory64List
      - returns memory region info for the gaps between regions (before the first and after the last)
      
      Differential Revision: https://reviews.llvm.org/D55522
      
      llvm-svn: 349182
      026e1bf5