1. Jan 24, 2021
  2. Jan 23, 2021
    • Ben Shi's avatar
      [AVR] Optimize 8-bit logic left/right shifts · 25531a1d
      Ben Shi authored
      Reviewed By: dylanmckay
      
      Differential Revision: https://reviews.llvm.org/D89047
      25531a1d
    • Pedro Tammela's avatar
      [lldb/Lua] add 'Lua' before naming versions · 2bbc762b
      Pedro Tammela authored
      NFC
      2bbc762b
    • Pedro Tammela's avatar
      [lldb/Lua] add initial Lua typemaps · 5997e898
      Pedro Tammela authored
      This patch adds the integer handling typemaps and the typemap for
      string returning functions.
      
      The integer handling typemaps overrides SWIG's own typemaps to distinct
      the handling of integers from floating point.
      
      The typemap for string returning functions is a port of Python's
      typemap.
      
      Differential Revision: https://reviews.llvm.org/D94937
      5997e898
    • LLVM GN Syncbot's avatar
      [gn build] Port 0057cc5a · d5c4de40
      LLVM GN Syncbot authored
      d5c4de40
    • Ayke van Laethem's avatar
    • Roman Lebedev's avatar
      [SimplifyCFG] Change 'LoopHeaders' to be ArrayRef<WeakVH>, not a naked set,... · 022da61f
      Roman Lebedev authored
      [SimplifyCFG] Change 'LoopHeaders' to be ArrayRef<WeakVH>, not a naked set, thus avoiding dangling pointers
      
      If i change it to AssertingVH instead, a number of existing tests fail,
      which means we don't consistently remove from the set when deleting blocks,
      which means newly-created blocks may happen to appear in that set
      if they happen to occupy the same memory chunk as did some block
      that was in the set originally.
      
      There are many places where we delete blocks,
      and while we could probably consistently delete from LoopHeaders
      when deleting a block in transforms located in SimplifyCFG.cpp itself,
      transforms located elsewhere (Local.cpp/BasicBlockUtils.cpp) also may
      delete blocks, and it doesn't seem good to teach them to deal with it.
      
      Since we at most only ever delete from LoopHeaders,
      let's just delegate to WeakVH to do that automatically.
      
      But to be honest, personally, i'm not sure that the idea
      behind LoopHeaders is sound.
      022da61f
    • LLVM GN Syncbot's avatar
      [gn build] Port 2325157c · dbf87da7
      LLVM GN Syncbot authored
      dbf87da7
    • Ayke van Laethem's avatar
      [Clang] Move assembler into a separate file · 2325157c
      Ayke van Laethem authored
      This change adds an AssemblerInvocation class, similar to the
      CompilerInvocation class. It can be used to invoke cc1as directly.
      
      The project I'm working on wants to compile Clang and use it as a static
      library. For that to work, there must be a way to invoke the assembler
      programmatically, using the same arguments as you would otherwise pass
      to cc1as.
      
      Differential Revision: https://reviews.llvm.org/D63852
      2325157c
    • Nikita Popov's avatar
      [LSR] Add test for PR46943 (NFC) · a49a3a3e
      Nikita Popov authored
      LSR should be dropping nowrap flags when adding new postinc users.
      a49a3a3e
    • Florian Hahn's avatar
      [LTO] Store target attributes as vector of strings (NFC). · 08dbcc14
      Florian Hahn authored
      The target features are obtained as a list of features/attributes.
      Instead of storing them in a single string, store the vector. This
      matches lto::Config's behavior and simplifies the transition to
      lto::backend().
      
      Reviewed By: tejohnson
      
      Differential Revision: https://reviews.llvm.org/D95224
      08dbcc14
    • Jeroen Dobbelaere's avatar
      [InlineFunction] Use llvm.experimental.noalias.scope.decl for noalias arguments. · 2b9a834c
      Jeroen Dobbelaere authored
      Insert a llvm.experimental.noalias.scope.decl intrinsic that identifies where a noalias argument was inlined.
      
      This patch includes some refactorings from D90104.
      
      Reviewed By: nikic
      
      Differential Revision: https://reviews.llvm.org/D93040
      2b9a834c
    • Simon Pilgrim's avatar
      [Support] TrigramIndex::insert - pass std::String argument by const reference. NFCI. · 344afa85
      Simon Pilgrim authored
      Avoid string copies and fix clang-tidy warning.
      344afa85
    • Roger Ferrer Ibanez's avatar
      [RISCV][PrologEpilogInserter] "Float" emergency spill slots to avoid making... · d4ce0623
      Roger Ferrer Ibanez authored
      [RISCV][PrologEpilogInserter] "Float" emergency spill slots to avoid making them immediately unreachable from the stack pointer
      
      In RISC-V there is a single addressing mode of the form imm(reg) where
      imm is a signed integer of 12-bit with a range of [-2048..2047] bytes
      from reg.
      
      The test MultiSource/UnitTests/C++11/frame_layout of the LLVM test-suite
      exercises several scenarios with the stack, including function calls
      where the stack will need to be realigned to to a local variable having
      a large alignment of 4096 bytes.
      
      In situations of large stacks, the RISC-V backend (in
      RISCVFrameLowering) reserves an extra emergency spill slot which can be
      used (if no free register is found) by the register scavenger after the
      frame indexes have been eliminated. PrologEpilogInserter already takes
      care of keeping the emergency spill slots as close as possible to the
      stack pointer or frame pointer (depending on what the function will
      use). However there is a final alignment step to honour the maximum
      alignment of the stack that, when using the stack pointer to access the
      emergency spill slots, has the side effect of setting them farther from
      the stack pointer.
      
      In the case of the frame_layout testcase, the net result is that we do
      have an emergency spill slot but it is so far from the stack pointer
      (more than 2048 bytes due to the extra alignment of a variable to 4096
      bytes) that it becomes unreachable via any immediate offset.
      
      During elimination of the frame index, many (regular) offsets of the
      stack may be immediately unreachable already. Their address needs to be
      computed using a register. A virtual register is created and later
      RegisterScavenger should be able to find an unused (physical) register.
      However if no register is available, RegisterScavenger will pick a
      physical register and spill it onto an emergency stack slot, while we
      compute the offset (restoring the chosen register after all this). This
      assumes that the emergency stack slot is easily reachable (this is,
      without requiring another register!).
      
      This is the assumption we seem to break when we perform the extra
      alignment in PrologEpilogInserter.
      
      We can "float" the emergency spill slots by increasing (in absolute
      value) their offsets from the incoming stack pointer. This way the
      emergency spill slots will remain close to the stack pointer (once the
      function has allocated storage for the stack, including the needed
      realignment). The new size computed in PrologEpilogInserter is padding
      so it should be OK to move the emergency spill slots there. Also because
      we're increasing the alignment, the new location should stay aligned for
      the purpose of the emergency spill slots.
      
      Note that this change also impacts other backends as shown by the tests.
      Changes are minor adjustments to the emergency stack slot offset.
      
      Differential Revision: https://reviews.llvm.org/D89239
      d4ce0623
    • Sergey Dmitriev's avatar
      [llvm-link] Fix for an assertion when linking global with appending linkage · 267a57a6
      Sergey Dmitriev authored
      This patch fixes llvm-link assertion when linking external variable
      declaration with a definition with appending linkage.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D95126
      267a57a6
    • Dan Liew's avatar
      [ASan] Stop blocking child thread progress from parent thread in `pthread_create` interceptor. · 596d534a
      Dan Liew authored
      Previously in ASan's `pthread_create` interceptor we would block in the
      `pthread_create` interceptor waiting for the child thread to start.
      
      Unfortunately this has bad performance characteristics because the OS
      scheduler doesn't know the relationship between the parent and child
      thread (i.e. the parent thread cannot make progress until the child
      thread makes progress) and may make the wrong scheduling decision which
      stalls progress.
      
      It turns out that ASan didn't use to block in this interceptor but was
      changed to do so to try to address
      http://llvm.org/bugs/show_bug.cgi?id=21621/.
      
      In that bug the problem being addressed was a LeakSanitizer false
      positive. That bug concerns a heap object being passed
      as `arg` to `pthread_create`. If:
      
      * The calling thread loses a live reference to the object (e.g.
        `pthread_create` finishes and the thread no longer has a live
        reference to the object).
      * Leak checking is triggered.
      * The child thread has not yet started (once it starts it will have a
        live reference).
      
      then the heap object will incorrectly appear to be leaked.
      
      This bug is covered by the `lsan/TestCases/leak_check_before_thread_started.cpp` test case.
      
      In b029c510 ASan was changed to block
      in `pthread_create()` until the child thread starts so that `arg` is
      kept alive for the purposes of leaking check.
      
      While this change "works" its problematic due to the performance
      problems it causes. The change is also completely unnecessary if leak
      checking is disabled (via detect_leaks runtime option or
      CAN_SANITIZE_LEAKS compile time config).
      
      This patch does two things:
      
      1. Takes a different approach to solving the leak false positive by
         making LSan's leak checking mechanism treat the `arg` pointer of
         created but not started threads as reachable.  This is done by
         implementing the `ForEachRegisteredThreadContextCb` callback for
         ASan.
      
      2. Removes the blocking behaviour in the ASan `pthread_create`
         interceptor.
      
      rdar://problem/63537240
      
      Differential Revision: https://reviews.llvm.org/D95184
      596d534a
    • Kazu Hirata's avatar
      [llvm] Use static_assert instead of assert (NFC) · 49231c1f
      Kazu Hirata authored
      Identified with misc-static-assert.
      49231c1f
    • Kazu Hirata's avatar
      [llvm] Use isAlpha/isAlnum (NFC) · 5f843b2d
      Kazu Hirata authored
      5f843b2d
    • Kazu Hirata's avatar
      [Analysis] Use llvm::append_range (NFC) · a3254904
      Kazu Hirata authored
      a3254904