1. Apr 23, 2019
    • Bjorn Pettersson's avatar
      [DAGCombiner] Combine OR as ADD when no common bits are set · f97b29be
      Bjorn Pettersson authored
      Summary:
      The DAGCombiner is rewriting (canonicalizing) an ISD::ADD
      with no common bits set in the operands as an ISD::OR node.
      
      This could sometimes result in "missing out" on some
      combines that normally are performed for ADD. To be more
      specific this could happen if we already have rewritten an
      ADD into OR, and later (after legalizations or combines)
      we expose patterns that could have been optimized if we
      had seen the OR as an ADD (e.g. reassociations based on ADD).
      
      To make the DAG combiner less sensitive to if ADD or OR is
      used for these "no common bits set" ADD/OR operations we
      now apply most of the ADD combines also to an OR operation,
      when value tracking indicates that the operands have no
      common bits set.
      
      Reviewers: spatel, RKSimon, craig.topper, kparzysz
      
      Reviewed By: spatel
      
      Subscribers: arsenm, rampitec, lebedev.ri, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59758
      
      llvm-svn: 358965
      f97b29be
    • Pavel Labath's avatar
      FuncUnwinders: remove "current_offset" from function arguments · 23594291
      Pavel Labath authored
      Summary:
      This argument was added back in 2010 (r118882) to support the ability to unwind
      from functions whose eh_frame entry does not cover the entire range of
      the function.
      
      However, due to the caching happening in FuncUnwinders, this solution is
      very fragile. FuncUnwinders will cache the plan it got from eh_frame
      regardless of the value of the current_offset, so our ability to unwind
      from a given function depended what was the value of "current_offset" the
      first time that this function was called.
      
      Furthermore, since the "image show-unwind" command did not know what's
      the right offset to pass, this created an unfortunate situation where
      "image show-unwind" would show no valid plans for a function, even
      though they were available and being used.
      
      In this patch I implement the feature slightly differently. Instead of
      giving just a base address to the eh_frame unwinder, I give it the
      entire range we are interested in. Then, I change the unwinder to return
      the first plan that covers (even partially) that range. This way even a
      partial plan will be returned, regardless of the address in the function
      where we are stopped at.
      
      This solution is still not 100% correct, as it will not handle a
      function which is covered by two independent fde entries. However, I
      don't expect anybody will write this kind of functions, and this wasn't
      handled by the previous implementation either. If this is ever needed in
      the future. The eh_frame unwinder can be extended to return "composite"
      unwind plans created by merging sevelar fde entries.
      
      I also create a test which triggers this scenario. As doing this is
      virtually impossible without hand-written assembly, the test only works
      on x86 linux.
      
      Reviewers: jasonmolenda, clayborg
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D60829
      
      llvm-svn: 358964
      23594291
    • Javed Absar's avatar
      [AArch64] Add support for MTE intrinsics · 1cdc3dbc
      Javed Absar authored
      This patch provides intrinsics support for Memory Tagging Extension (MTE),
      which was introduced with the Armv8.5-a architecture.
      The intrinsics are described in detail in the latest
      ACLE Q1 2019 documentation: https://developer.arm.com/docs/101028/latest
      Reviewed by: David Spickett
      Differential Revision: https://reviews.llvm.org/D60486
      
      llvm-svn: 358963
      1cdc3dbc
    • Diogo N. Sampaio's avatar
      [ARM][FIX] Add missing f16.lane.vldN/vstN lowering · 2619f399
      Diogo N. Sampaio authored
      Summary:
      Add missing D and Q lane VLDSTLane lowering
      for fp16 elements.
      
      Reviewers: efriedma, kosarev, SjoerdMeijer, ostannard
      
      Reviewed By: efriedma
      
      Subscribers: javed.absar, kristof.beyls, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60874
      
      llvm-svn: 358962
      2619f399
    • George Rimar's avatar
      [LLD][ELF] - Update test case after llvm-mc change. · 545f621a
      George Rimar authored
      rL358960 "[llvm-mc] - Properly set the the address align field of the compressed sections."
      changed the sh_addralign field of the "zlib" compressed debug sections.
      
      llvm-svn: 358961
      545f621a
    • George Rimar's avatar
      [llvm-mc] - Properly set the the address align field of the compressed sections. · b9ed9cb5
      George Rimar authored
      About the compressed sections spec says:
      (https://docs.oracle.com/cd/E37838_01/html/E36783/section_compression.html)
      sh_addralign fields of the section header for a compressed section
      reflect the requirements of the compressed section.
      
      Currently, llvm-mc always puts uncompressed section alignment to sh_addralign.
      It is not correct. zlib styled section contains an Elfxx_Chdr header,
      so we should either use 4 or 8 values depending on the target
      (Uncompressed section alignment is stored in ch_addralign field of the compression header).
      
      GNU assembler version 2.31.1 also has this issue,
      but in 2.32.51 it was already fixed. This is how it was found
      during debugging of the https://bugs.llvm.org/show_bug.cgi?id=40482
      actually.
      
      Differential revision: https://reviews.llvm.org/D60965
      
      llvm-svn: 358960
      b9ed9cb5
    • Pavel Labath's avatar
      UnwindPlan: pretty-print dwarf expressions · 7a784203
      Pavel Labath authored
      Summary:
      Previously we were printing the dwarf expressions in unwind rules simply
      as "dwarf-expr". This patch uses the existing dwarf-printing
      capabilities in lldb to enhance this dump output, and print the full
      decoded dwarf expression.
      
      Reviewers: jasonmolenda, clayborg
      
      Subscribers: aprantl, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D60949
      
      llvm-svn: 358959
      7a784203
    • David Green's avatar
      [LSR] Limit the recursion for setup cost · 63a2aa71
      David Green authored
      In some circumstances we can end up with setup costs that are very complex to
      compute, even though the scevs are not very complex to create. This can also
      lead to setupcosts that are calculated to be exactly -1, which LSR treats as an
      invalid cost. This patch puts a limit on the recursion depth for setup cost to
      prevent them taking too long.
      
      Thanks to @reames for the report and test case.
      
      Differential Revision: https://reviews.llvm.org/D60944
      
      llvm-svn: 358958
      63a2aa71
    • Pavel Labath's avatar
      yamlify TestMiniDumpUUID binaries · ed4f48d2
      Pavel Labath authored
      Summary:
      Instead of checking in raw minidump binaries, check in their yaml form,
      and call yaml2obj in the test.
      
      Reviewers: clayborg
      
      Subscribers: javed.absar, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D60948
      
      llvm-svn: 358957
      ed4f48d2
    • Adam Balogh's avatar
      [Analyzer] Fix for previous commit · 8f882701
      Adam Balogh authored
      A compilation warning was in my previous commit which broke the buildbot
      because it is using `-Werror` for compilation. This patch fixes this
      issue.
      
      llvm-svn: 358955
      8f882701
    • Fangrui Song's avatar
      [PowerPC] Fix test with -fno-discard-value-names after rC358949 · fb2783f6
      Fangrui Song authored
      For the clang driver, -DLLVM_ENABLE_ASSERTIONS=off builds default to discard value names.
      
      llvm-svn: 358953
      fb2783f6
    • Adam Balogh's avatar
      [Analyzer] Instead of recording comparisons in interator checkers do an eager state split · 54976e76
      Adam Balogh authored
      Currently iterator checkers record comparison of iterator positions
      and process them for keeping track the distance between them (e.g.
      whether a position is the same as the end position). However this
      makes some processing unnecessarily complex and it is not needed at
      all: we only need to keep track between the abstract symbols stored
      in these iterator positions. This patch changes this and opens the
      path to comparisons to the begin() and end() symbols between the
      container (e.g. size, emptiness) which are stored as symbols, not
      iterator positions. The functionality of the checker is unchanged.
      
      Differential Revision: https://reviews.llvm.org/D53701
      
      llvm-svn: 358951
      54976e76
    • Fangrui Song's avatar
      [PPC64] Allow R_PPC64_DTPREL* to preemptable local-dynamic symbols · d986e41f
      Fangrui Song authored
      Similar to D60945.
      
      Differential Revision: https://reviews.llvm.org/D60994
      
      llvm-svn: 358950
      d986e41f
    • Qiu Chaofan's avatar
      [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power · 19828e39
      Qiu Chaofan authored
      Port mmintrin.h which include x86 MMX intrinsics implementation to PowerPC platform (using Altivec).
      
      To make the include process correct, PowerPC's toolchain class is overrided to insert new headers directory (named ppc_wrappers) into the path. Basic test cases for several intrinsic functions are added.
      
      The header is mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu.
      
      Reviewed By: Jinsong Ji
      
      Differential Revision: https://reviews.llvm.org/D59924
      
      llvm-svn: 358949
      19828e39
    • Sam Clegg's avatar
      [WebAssembly] Bail out of fastisel earlier when computing PIC addresses · 9da81421
      Sam Clegg authored
      This change partially reverts https://reviews.llvm.org/D54647 in favor
      of bailing out during computeAddress instead.
      
      This catches the condition earlier and handles more cases.
      
      Differential Revision: https://reviews.llvm.org/D60986
      
      llvm-svn: 358948
      9da81421
    • Artem Dergachev's avatar
      [analyzer] Unbreak body farms in presence of multiple declarations. · 727d6ca3
      Artem Dergachev authored
      When growing a body on a body farm, it's essential to use the same redeclaration
      of the function that's going to be used during analysis. Otherwise our
      ParmVarDecls won't match the ones that are used to identify argument regions.
      
      This boils down to trusting the reasoning in AnalysisDeclContext. We shouldn't
      canonicalize the declaration before farming the body because it makes us not
      obey the sophisticated decision-making process of AnalysisDeclContext.
      
      Differential Revision: https://reviews.llvm.org/D60899
      
      llvm-svn: 358946
      727d6ca3
    • Artem Dergachev's avatar
      [analyzer] PR41335: Fix crash when no-store event is in a body-farmed function. · e2a8e431
      Artem Dergachev authored
      Stuffing invalid source locations (such as those in functions produced by
      body farms) into path diagnostics causes crashes.
      
      Fix a typo in a nearby function name.
      
      Differential Revision: https://reviews.llvm.org/D60808
      
      llvm-svn: 358945
      e2a8e431
    • Artem Dergachev's avatar
      [analyzer] PR41269: Add a bit of C++ smart pointer modeling. · 8c6119a4
      Artem Dergachev authored
      Implement cplusplus.SmartPtrModeling, a new checker that doesn't
      emit any warnings but models methods of smart pointers more precisely.
      
      For now the only thing it does is make `(bool) P` return false when `P`
      is a freshly moved pointer. This addresses a false positive in the
      use-after-move-checker.
      
      Differential Revision: https://reviews.llvm.org/D60796
      
      llvm-svn: 358944
      8c6119a4
    • Fangrui Song's avatar
      Use llvm::stable_sort · 32c0ebe6
      Fangrui Song authored
      Make some small adjustment while touching the code: make parameters
      const, use less_first(), etc.
      
      Differential Revision: https://reviews.llvm.org/D60989
      
      llvm-svn: 358943
      32c0ebe6
    • Qiu Chaofan's avatar
      add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt · ab66e34c
      Qiu Chaofan authored
      llvm-svn: 358942
      ab66e34c
    • Chandler Carruth's avatar
      Revert "Use const DebugLoc&" · bbddf21f
      Chandler Carruth authored
      This reverts r358910 (git commit 2b744665)
      
      While this patch *seems* trivial and safe and correct, it is not. The
      copies are actually load bearing copies. You can observe this with MSan
      or other ways of checking for use-after-destroy, but otherwise this may
      result in ... difficult to debug inexplicable behavior.
      
      I suspect the issue is that the debug location is used after the
      original reference to it is removed. The metadata backing it gets
      destroyed as its last references goes away, and then we reference it
      later through these const references.
      
      llvm-svn: 358940
      bbddf21f
    • Jason Molenda's avatar
      One small tweak to LocateExecutableScriptingResources - I · 759805fd
      Jason Molenda authored
      was still stat'ing the possibly-dSYM FileSpec before I
      (more cheaply) checked the filepath for telltale dSYM
      components.
      <rdar://problem/50086007> 
      
      llvm-svn: 358939
      759805fd
    • Jason Molenda's avatar
      Add a small check to PlatformDarwin::LoadScriptingResourceForModule · 9270a201
      Jason Molenda authored
      which reads the python files in a dSYM bundle, to check that the
      SymbolFile is actually a dSYM bundle filepath; delay any fetching
      of the ScriptInterpreter until after we've done that check.
      
      When debugging a binary without a dSYM on darwin systems, the
      SymbolFile we fetch is actually the ObjectFile -- so we would do
      an unnecessary trip into Python land and stat around the filesystem
      looking for a python file to read in.  There's no reason to do any
      of this unless the SymbolFile's file path includes the .dSYM bundle
      telltale path components.
      
      <rdar://problem/50065315> 
      
      llvm-svn: 358938
      9270a201
    • Louis Dionne's avatar
      [libc++abi] Don't use a .sh.cpp test for uncaught_exception · c86011f5
      Louis Dionne authored
      Otherwise, we don't seem to get the DYLD_LIBRARY_PATH set up correctly
      and the tests are run against the system libc++abi dylib.
      
      llvm-svn: 358937
      c86011f5
    • Petr Hosek's avatar
      [CMake] Replace the sanitizer support in runtimes build with multilib · fbcce9fe
      Petr Hosek authored
      This is a more generic solution; while the sanitizer support can be used
      only for sanitizer instrumented builds, the multilib support can be used
      to build other variants such as noexcept which is what we would like to use
      in Fuchsia.
      
      The name CMake target name uses the target name, same as for the regular
      runtimes build and the name of the multilib, concatenated with '+'. The
      libraries are installed in a subdirectory named after the multilib.
      
      Differential Revision: https://reviews.llvm.org/D60926
      
      llvm-svn: 358935
      fbcce9fe
    • Adrian Prantl's avatar
      Fully qualify llvm::Optional, some compilers complain otherwise. · 05aad156
      Adrian Prantl authored
      llvm-svn: 358933
      05aad156
    • Richard Smith's avatar
      [c++2a] Implement semantic restrictions for 'export' declarations. · e181de7f
      Richard Smith authored
      llvm-svn: 358932
      e181de7f
    • David Blaikie's avatar
      DebugInfo: Emit only one kind of accelerated access/name table · 68602ab2
      David Blaikie authored
      Currently to opt in to debug_names in DWARFv5, the IR must contain
      'nameTableKind: Default' which also enables debug_pubnames.
      
      Instead, only allow one of {debug_names, apple_names, debug_pubnames,
      debug_gnu_pubnames}.
      
      nameTableKind: Default gives debug_names in DWARFv5 and greater,
      debug_pubnames in v4 and earlier - and apple_names when tuning for lldb
      on MachO.
      nameTableKind: GNU always gives gnu_pubnames
      
      llvm-svn: 358931
      68602ab2
    • Sanjay Patel's avatar
      [SelectionDAG] move splat util functions up from x86 lowering · bf8aacb7
      Sanjay Patel authored
      This was supposed to be NFC, but the change in SDLoc
      definitions causes instruction scheduling changes.
      
      There's nothing x86-specific in this code, and it can
      likely be used from DAGCombiner's simplifyVBinOp().
      
      llvm-svn: 358930
      bf8aacb7
    • Jason Molenda's avatar
      Fix a bug in my change to ModulesDidLoad in r357955. · a38b8c8a
      Jason Molenda authored
      In the process of hoisting the LoadScriptingResourceForModule
      out of Target::ModuleAdded and into Target::ModulesDidLoad,
      I had ModulesDidLoad fetching the Target's entire image list
      and look for scripting resources in those -- instead of only
      looking for scripting resources in the modules that had
      been added to the target's image list.
      
      <rdar://problem/50065315> 
      
      llvm-svn: 358929
      a38b8c8a
    • Jonas Devlieghere's avatar
      [Docs] Move API docs to the front page · d44a7be1
      Jonas Devlieghere authored
      This moves the links to the C++ and Python API docs up to the main page.
      As of now the links are still broken [1], but at least this will prevent
      the additional frustration of searching for the links only to find out
      they're broken.
      
      [1] http://lists.llvm.org/pipermail/lldb-dev/2019-April/014992.html
      
      llvm-svn: 358928
      d44a7be1
    • Adrian Prantl's avatar
      Try to work around compile errors with older versions of GCC. · e495ec23
      Adrian Prantl authored
      llvm-svn: 358927
      e495ec23
    • Douglas Yung's avatar
      Relax test to check for a valid number instead of a specific number. · 16df7e08
      Douglas Yung authored
      llvm-svn: 358926
      16df7e08
    • Adrian Prantl's avatar
      a6314ea6
    • Michael Liao's avatar
      [AMDGPU] Fix an issue in `op_sel_hi` skipping. · 389d5a34
      Michael Liao authored
      Summary:
      - Only apply packed literal `op_sel_hi` skipping on operands requiring
        packed literals. Even an instruction is `packed`, it may have operand
        requiring non-packed literal, such as `v_dot2_f32_f16`.
      
      Reviewers: rampitec, arsenm, kzhuravl
      
      Subscribers: jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60978
      
      llvm-svn: 358922
      389d5a34
    • Adrian Prantl's avatar
      [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle. · 0d809aa2
      Adrian Prantl authored
      When a Swift module built with debug info imports a library without
      debug info from a textual interface, the textual interface is
      necessary to reconstruct types defined in the library's interface. By
      recording the Swift interface files in DWARF dsymutil can collect them
      and LLDB can find them.
      
      This patch teaches dsymutil to look for DW_TAG_imported_modules and
      records all references to parseable Swift ingterfrace files and copies
      them to
      
        a.out.dSYM/Contents/Resources/<Arch>/<ModuleName>.swiftinterface
      
      <rdar://problem/49751748>
      
      llvm-svn: 358921
      0d809aa2
    • Philip Reames's avatar
      [InstCombine] Eliminate stores to constant memory · d748689c
      Philip Reames authored
      If we have a store to a piece of memory which is known constant, then we know the store must be storing back the same value. As a result, the store (or memset, or memmove) must either be down a dead path, or a noop. In either case, it is valid to simply remove the store.
      
      The motivating case for this involves a memmove to a buffer which is constant down a path which is dynamically dead.
      
      Note that I'm choosing to implement the less aggressive of two possible semantics here. We could simply say that the store *is undefined*, and prune the path. Consensus in the review was that the more aggressive form might be a good follow on change at a later date.
      
      Differential Revision: https://reviews.llvm.org/D60659
      
      llvm-svn: 358919
      d748689c
    • Davide Italiano's avatar
      [EditLineTest] Not always TERM is available, e.g. on some bots. · 2a27af82
      Davide Italiano authored
      llvm-svn: 358918
      2a27af82
    • Joel E. Denny's avatar
      [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen · 906b2642
      Joel E. Denny authored
      Previously, it was only documented by `-cc1 -help`, so people weren't
      aware of it, as discussed in D60732.
      
      Reviewed By: Charusso, NoQ
      
      Differential Revision: https://reviews.llvm.org/D60845
      
      llvm-svn: 358917
      906b2642
    • Jonas Devlieghere's avatar
      [Reproducers] Fix lifetime issue · 32176bae
      Jonas Devlieghere authored
      Deallocating the data recorder in during the ::Keep() operation causes
      problems down the line when exiting the debugger. The command
      interpreter still holds a pointer to the now deallocated object and has
      no way to know it no longer exists. This is exactly what the m_record
      flag was meant for, although it wasn't hooked up properly either.
      
      llvm-svn: 358916
      32176bae