Skip to content
  1. Mar 03, 2022
    • Kristóf Umann's avatar
      [analyzer] Improve NoOwnershipChangeVisitor's understanding of deallocators · d8320789
      Kristóf Umann authored
      The problem with leak bug reports is that the most interesting event in the code
      is likely the one that did not happen -- lack of ownership change and lack of
      deallocation, which is often present within the same function that the analyzer
      inlined anyway, but not on the path of execution on which the bug occured. We
      struggle to understand that a function was responsible for freeing the memory,
      but failed.
      
      D105819 added a new visitor to improve memory leak bug reports. In addition to
      inspecting the ExplodedNodes of the bug pat, the visitor tries to guess whether
      the function was supposed to free memory, but failed to. Initially (in D108753),
      this was done by checking whether a CXXDeleteExpr is present in the function. If
      so, we assume that the function was at least party responsible, and prevent the
      analyzer from pruning bug report notes in it. This patch improves this heuristic
      by recognizing all deallocator functions that MallocChecker itself recognizes,
      by reusing MallocChecker::isFreeingCall.
      
      Differential Revision: https://reviews.llvm.org/D118880
      d8320789
    • Nikita Popov's avatar
      [InstCombine] Support opaque pointers in callee bitcast fold · c1b96671
      Nikita Popov authored
      To make this actually trigger, we also need to check whether the
      function types differ, which is a hidden cast under opaque pointers.
      The transform is somewhat less relevant there because it is
      primarily about pointer bitcasts, but it can also happen with other
      bit- or pointer-castable types.
      
      Byval handling is easier with opaque pointers because there is no
      need to adjust the byval type, we only need to make sure that it's
      still a pointer.
      c1b96671
    • David Spickett's avatar
      [lldb] Correct case in description of breakpoint --on-catch/throw · 6b3b3ef3
      David Spickett authored
      Somehow we ended up with catcH/throW.
      6b3b3ef3
    • Nikita Popov's avatar
      [InstCombine] Remove unnecessary byval check in callee cast fold · 6c8adc50
      Nikita Popov authored
      The logic for handling this was fixed in
      8d7f118a, but the check for byval
      on the callee was retained. This resulted in a weird situation
      where the transform would work depending on whether the byval
      was only on the call or on both the call and the function.
      6c8adc50
    • Nikita Popov's avatar
      [InstCombine] Add callee bitcast test with byval on callee (NFC) · 2555ed55
      Nikita Popov authored
      Same as the existing test, but the callee also has a byval
      attribute.
      2555ed55
    • Cullen Rhodes's avatar
      [AArch64] Allow copying of SVE registers in Streaming SVE · e4fa8291
      Cullen Rhodes authored
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D118562
      e4fa8291
    • Cullen Rhodes's avatar
      [AArch64] Add legal types for Streaming SVE · 61658679
      Cullen Rhodes authored
      The compiler currently crashes for scalable types when compiling with
      +sme, e.g.
      
        define <vscale x 4 x i32> @foo(<vscale x 4 x i32> %a) {
          ret <vscale x 4 x i32> %a
        }
      
      since it doesn't know how to legalize the types. SME implies a subset of
      SVE (+streaming-sve), the hasSVE predication in the backend needs
      extending to consider types/operations that are legal in Streaming SVE.
      
      This is the first patch adding legal types <-> register classes. Before
      making the change +sve(2) was temporarily replaced with +sme in all the
      intrinsics tests to see what failed, and again after making the change.
      For all the tests that passed after adding the legal types another RUN
      line has been added for +streaming-sve. More patches to follow.
      
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D118561
      61658679
    • Haojian Wu's avatar
      [AST] Use RecoveryExpr to model a DeclRefExpr which refers to an invalid Decl. · ba6c71b1
      Haojian Wu authored
      Previously, we didin't build a DeclRefExpr which refers to an invalid declaration.
      
      In this patch, we handle this case by building an empty RecoveryExpr,
      which will preserve more broken code (AST parent nodes that contain the
      RecoveryExpr is preserved in the AST).
      
      Differential Revision: https://reviews.llvm.org/D120812
      ba6c71b1
    • Nikita Popov's avatar
      [Scalarizer] Avoid pointer element type accesses · c262ba2a
      Nikita Popov authored
      Pass through the load/store type to the Scatterer instead.
      c262ba2a
    • serge-sans-paille's avatar
      Add missing include under -DEXPENSIVE_CHECKS · f90a66a5
      serge-sans-paille authored
      This is a follow-up to 59630917
      f90a66a5
    • Jean Perier's avatar
      [flang] Generate PDT runtime type info in the type definition scope · f88a9497
      Jean Perier authored
      This patches modifies PDT runtime type info generation so that it is
      easier to handle derived type descriptor in lowering. It changes three
      aspects:
      
      1. The symbol name suffix of runtime type info for PDT instantiation is
         changed from a serial number unrelated to the types to an encoding of
         the instantiated KIND parameters.
      2. New runtime type info is not created for each instantiation of PDT without
         KIND parameters (only length parameters). Instead, the runtime type
         info of the type definition is always used. It is updated to contain
         the component descriptions.
      3. Runtime type info of PDT instantiation is now always generated in the
         scope where the type is defined. If several PDT type instantiation
         are made in different scope with the same kind parameters, they will
         use the same runtime type info.
      
      Rational of the change:
      
      In lowering, derived type descriptors are not mapped when instantiating derived
      type objects. They are mapped later when symbol knowledge is not available anymore.
      This mapping is based on the FIR representation of derived types. For
      PDT, the FIR type information does not allow deducing the instantiation
      scope, it only allows retrieving the type name, the type _definition_
      scope, and the kind parameter values. Therefore, in order to be able to
      retrieve the derived type descriptor from a FIR type, the derived type
      descriptor must be generated in the definition scope and must reflect
      the kind parameters. This justifies the need for changes 1. and 3.
      above (suffix and scope change). Changes 2. comes from the fact that
      all runtime type info of type without kind parameters can be generated
      from the type definition, and that because of the suffix change, the
      symbol name for type definition and type instantiation are the same.
      
      Although this change is first motivated by how lowering handles derived
      types, I believe it is also an improvement from a functional point of
      view since this change will allow reducing the number of generated
      runtime type info for PDTs, since redundant information (different
      instantiations with same kind parameters) will only be generated once.
      
      Differential Revision: https://reviews.llvm.org/D120801
      f88a9497
    • Jean Perier's avatar
      [flang] Handle optional TARGET associate in ASSOCIATED runtime · 392cba86
      Jean Perier authored
      The TARGET argument of ASSOCIATED may be dynamically optional, in which
      case ASSOCIATED(POINTER, TARGET) is equal to ASSOCIATED(TARGET).
      
      Make the runtime argument a pointer so that it can detect and handle
      arguments that are dynamically optional.
      
      Also fix the runtime to check if TARGET base address is not null and if
      its element size is not null to match the requirement of ASSOCIATED
      regarding TARGET:
      - if TARGET is an object: true iff [..] TARGET is not a zerosized storage sequence
      - if TARGET is a POINTER: true iff [..] POINTER and TARGET are associated
      
      Not that ASSOCIATED will also returns false if TARGET is an unallocated allocatable.
      This is not described in the standard, but is a unanimous behaviour of
      existing compilers.
      
      Differential Revision: https://reviews.llvm.org/D120835
      392cba86
    • Jean Perier's avatar
      [flang] Support PDT type descriptors in codegen · 013160f6
      Jean Perier authored
      This change updates the mapping of derived types and type descriptor
      object names to support kind parametrized derived types (PDT).
      It moves the custom name mapping to the internal name utility.
      
      To improve robustness and error reporting, type descriptors are also now
      required to be generated in all compilation unit that manipulates
      derived types. The previous codegen relied on the fact that descriptors
      not defined in the current FIR module were available externally. Errors
      with missing type descriptors were only caught at link time.
      
      This patch makes derived type definition mandatory, except if the
      derived types are expected to not have derived type descriptors (builtin
      types), or if the newly added debug switch `--ignore-missing-type-desc`
      is set. In those cases, a null pointer is used as type descriptor
      pointer. The debug switch intends to help testing FIR to LLVM passes
      without having to bother providing type descriptor data structures that
      are normally built by the front-end.
      
      Differential Revision: https://reviews.llvm.org/D120804
      013160f6
    • Nikita Popov's avatar
      [llvm-stress] Support opaque pointers · 9404d442
      Nikita Popov authored
      With opaque pointers, generate the load/store type independently
      of the pointer type.
      9404d442
    • Nikita Popov's avatar
      [DSE] Drop redundant WalkerStepLimit adjustment · b214f550
      Nikita Popov authored
      There is a general WalkerStepLimit adjustment higher up in the
      loop, and I don't see any reason why this particular case would
      need additional adjustment. Furthermore, this could underflow.
      b214f550
    • jacquesguan's avatar
      [RISCV] Fold store of vmv.f.s to a vse with VL=1. · 44a43035
      jacquesguan authored
      This patch support the FP part of D109482.
      
      Differential Revision: https://reviews.llvm.org/D120235
      44a43035
    • Martin Storsjö's avatar
      [libcxx] [test] Fix the collate compare test for Glibc, Windows and FreeBSD · 77fd54d2
      Martin Storsjö authored
      The old expected behaviour was specific to Apple platforms,
      while Glibc, Windows and FreeBSD collate differently (ignoring
      case). Make the old tested behaviour a special case for Apple
      platforms, and make the default case the one used by the other
      three.
      
      In clang-cl/DLL configurations, the test is hit by
      https://llvm.org/PR41018 (making the test fail to link).
      
      Differential Revision: https://reviews.llvm.org/D120797
      77fd54d2
    • Martin Storsjö's avatar
      [LLD] [COFF] Order .debug_* sections at the end, to avoid leaving gaps if stripped · 4c3b74b7
      Martin Storsjö authored
      So far, we sort all discardable sections at the end, with only some
      extra logic to make sure that the .reloc section is at the start
      of that group of sections. But if there are other discardable
      sections, other than .reloc, they must also be ordered before
      .debug_* sections, to avoid leaving gaps if the executable is
      stripped.
      
      (Stripping executables doesn't remove all discardable sections,
      only the ones named .debug_*).
      
      Rust binaries seem to include a .rmeta section, which is marked
      discardable. This fixes stripping such binaries if built with
      dwarf debug info included.
      
      This fixes issues observed in MSYS2 in
      https://github.com/msys2/MINGW-packages/pull/10555.
      
      Differential Revision: https://reviews.llvm.org/D120805
      4c3b74b7
    • Peixin-Qiao's avatar
      [MLIR] Fix afterIP for dynamic worksharing-loop after collaping loops · a5605c9a
      Peixin-Qiao authored
      The loopInfos gets invalidated after collapsing nested loops. Use the
      saved afterIP since the returned afterIP by applyDynamicWorkshareLoop
      may be not valid.
      
      Reviewed By: shraiysh
      
      Differential Revision: https://reviews.llvm.org/D120294
      a5605c9a
    • serge-sans-paille's avatar
      Cleanup includes: Transform/Scalar · 59630917
      serge-sans-paille authored
      Estimated impact on preprocessor output line:
      before: 1062981579
      after:  1062494547
      
      Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
      Differential Revision: https://reviews.llvm.org/D120817
      59630917
    • serge-sans-paille's avatar
    • Jonas Devlieghere's avatar
      [lldb] Update the CI docs · ef0de5dc
      Jonas Devlieghere authored
      Remove the reproducer bot and the fedora bot.
      ef0de5dc
    • Jonas Devlieghere's avatar
      [lldb] Update TestBasicEntryValues.py for `image lookup` output · 03dae31a
      Jonas Devlieghere authored
      Update TestBasicEntryValues.py for 15983c28 which changes the output
      for `image lookup -v`. This should fix the debian and macos build bots.
      03dae31a
    • Danila Malyutin's avatar
      [Support][AArch64] Detect a few more host CPU features on AArch64 · ff33b6f9
      Danila Malyutin authored
      Add detecton for lse, sve and sve2 on linux
      
      Differential Revision: https://reviews.llvm.org/D119435
      ff33b6f9
    • Dominic Chen's avatar
      [lldb] Fix python errors in gdbremote.py · cd89f94a
      Dominic Chen authored
      Fix exceptions encountered while debugging gdb protocol
      
      Differential Revision: https://reviews.llvm.org/D120792
      cd89f94a
    • Kai Luo's avatar
    • David Blaikie's avatar
      More bazel fixes. · 831fa725
      David Blaikie authored
      831fa725
    • Jonas Devlieghere's avatar
      [lldb] Skip check for the lldb prompt in TestIOHandlerProcessSTDIO · 42db8bfa
      Jonas Devlieghere authored
      The check for the prompt isn't essential for this test. The check fail
      on the lldb-arm-ubuntu because of what appears to be a missing space
      after the prompt. Rather than disabling the test, let's see if we can
      get it to pass without it.
      42db8bfa
    • David Blaikie's avatar
      More attempts at bazel fix · f6bc0a48
      David Blaikie authored
      f6bc0a48
    • Peter Klausler's avatar
      [flang] Remove bogus messages for actual/dummy procedure argument compatibility · 3bfe9074
      Peter Klausler authored
      Add new IsCompatibleWith() member functions to many classes in evaluate::characteristics
      that apply more nuanced compatibility checking for function results, dummy
      arguments, and procedure interfaces than the previous tests for complete
      equivalence.  Use IsCompatibleWith() in semantics for call checking.
      
      Differential Revision: https://reviews.llvm.org/D120844
      3bfe9074
    • Jonas Devlieghere's avatar
      [lldb] Update error messages in TestMemoryHistory.py · 77bfdeb0
      Jonas Devlieghere authored
      Update TestMemoryHistory.py for daba8236
      which changes the CommandObject & Disassemble error messages .
      77bfdeb0
    • Jonas Devlieghere's avatar
      [lldb] Devirtualize IOHandler::{IsActive,SetIsDone,GetIsDone} (NFC) · 37eb15ad
      Jonas Devlieghere authored
      There are no implementations overriding these methods.
      
      Differential revision: https://reviews.llvm.org/D120766
      37eb15ad
    • Jonas Devlieghere's avatar
      [lldb] Avoid data race in IOHandlerProcessSTDIO · 10222764
      Jonas Devlieghere authored
      This patch fixes a data race in IOHandlerProcessSTDIO. The race is
      happens between the main thread and the event handling thread. The main
      thread is running the IOHandler (IOHandlerProcessSTDIO::Run()) when an
      event comes in that makes us pop the process IO handler which involves
      cancelling the IOHandler (IOHandlerProcessSTDIO::Cancel). The latter
      calls SetIsDone(true) which modifies m_is_done. At the same time, we
      have the main thread reading the variable through GetIsDone().
      
      This patch avoids the race by using a mutex to synchronize the two
      threads. On the event thread, in IOHandlerProcessSTDIO ::Cancel method,
      we obtain the lock before changing the value of m_is_done. On the main
      thread, in IOHandlerProcessSTDIO::Run(), we obtain the lock before
      reading the value of m_is_done. Additionally, we delay calling SetIsDone
      until after the loop exists, to avoid a potential race between the two
      writes.
      
        Write of size 1 at 0x00010b66bb68 by thread T7 (mutexes: write M2862, write M718324145051843688):
          #0 lldb_private::IOHandler::SetIsDone(bool) IOHandler.h:90 (liblldb.15.0.0git.dylib:arm64+0x971d84)
          #1 IOHandlerProcessSTDIO::Cancel() Process.cpp:4382 (liblldb.15.0.0git.dylib:arm64+0x5ddfec)
          #2 lldb_private::Debugger::PopIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1156 (liblldb.15.0.0git.dylib:arm64+0x3cb2a8)
          #3 lldb_private::Debugger::RemoveIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1063 (liblldb.15.0.0git.dylib:arm64+0x3cbd2c)
          #4 lldb_private::Process::PopProcessIOHandler() Process.cpp:4487 (liblldb.15.0.0git.dylib:arm64+0x5c583c)
          #5 lldb_private::Debugger::HandleProcessEvent(std::__1::shared_ptr<lldb_private::Event> const&) Debugger.cpp:1549 (liblldb.15.0.0git.dylib:arm64+0x3ceabc)
          #6 lldb_private::Debugger::DefaultEventHandler() Debugger.cpp:1622 (liblldb.15.0.0git.dylib:arm64+0x3cf2c0)
          #7 std::__1::__function::__func<lldb_private::Debugger::StartEventHandlerThread()::$_2, std::__1::allocator<lldb_private::Debugger::StartEventHandlerThread()::$_2>, void* ()>::operator()() function.h:352 (liblldb.15.0.0git.dylib:arm64+0x3d1bd8)
          #8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) HostNativeThreadBase.cpp:62 (liblldb.15.0.0git.dylib:arm64+0x4c71ac)
          #9 lldb_private::HostThreadMacOSX::ThreadCreateTrampoline(void*) HostThreadMacOSX.mm:18 (liblldb.15.0.0git.dylib:arm64+0x29ef544)
      
        Previous read of size 1 at 0x00010b66bb68 by main thread:
          #0 lldb_private::IOHandler::GetIsDone() IOHandler.h:92 (liblldb.15.0.0git.dylib:arm64+0x971db8)
          #1 IOHandlerProcessSTDIO::Run() Process.cpp:4339 (liblldb.15.0.0git.dylib:arm64+0x5ddc7c)
          #2 lldb_private::Debugger::RunIOHandlers() Debugger.cpp:982 (liblldb.15.0.0git.dylib:arm64+0x3cb48c)
          #3 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) CommandInterpreter.cpp:3298 (liblldb.15.0.0git.dylib:arm64+0x506478)
          #4 lldb::SBDebugger::RunCommandInterpreter(bool, bool) SBDebugger.cpp:1166 (liblldb.15.0.0git.dylib:arm64+0x53604)
          #5 Driver::MainLoop() Driver.cpp:634 (lldb:arm64+0x100006294)
          #6 main Driver.cpp:853 (lldb:arm64+0x100007344)
      
      Differential revision: https://reviews.llvm.org/D120762
      10222764
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Removed XFAIL from hsa-gfx940-v3.s. NFC. · b05918f2
      Stanislav Mekhanoshin authored
      Handling of big endian was fixed in D88858.
      b05918f2
    • Aakanksha's avatar
      [AMDGPU] Add gfx1036 target · 84069581
      Aakanksha authored
      Differential Revision: https://reviews.llvm.org/D120846
      84069581
    • Peter Klausler's avatar
      [flang] Extend ProvenanceRange::Suffix() to handle crash case · 93f42491
      Peter Klausler authored
      Suffix() can be called from AllSources::IntersectionWithSourceFiles()
      when a contiguous range of source provenance overlaps a macro expansion.
      It skips over the macro expansion and recurses on the remainder of
      the range, which might end with a bit that does overlap with a
      source file.  However, in the case where the original range is
      entirely within the expanded macro, Suffix() crashes when called
      with a skip offset greater than the size of the range.
      
      Rather than add logic around this and other calls to Suffix() to
      avoid passing an out-of-range skip, it's better to accommodate it
      in Suffix() and return an empty result.
      
      Differential Revision: https://reviews.llvm.org/D120843
      93f42491
    • Peter Klausler's avatar
      [flang] Avoid bogus warning from MSVC build · 79f8e909
      Peter Klausler authored
      And expand common::BitSet from 64 to 128 maximum elements.
      
      Differential Revision: https://reviews.llvm.org/D120848
      79f8e909
  2. Mar 02, 2022
Loading