1. Feb 22, 2021
    • Nikita Popov's avatar
      [Loads] Add optimized FindAvailableLoadedValue() overload (NFCI) · e0615bcd
      Nikita Popov authored
      FindAvailableLoadedValue() accepts an iterator by reference. If no
      available value is found, then the iterator will either be left
      at a clobbering instruction or the beginning of the basic block.
      This allows using FindAvailableLoadedValue() across multiple blocks.
      
      If this functionality is not needed, as is the case in InstCombine,
      then we can use a much more efficient implementation: First try
      to find an available value, and only perform clobber checks if
      we actually found one. As this function only looks at a very small
      number of instructions (6 by default) and usually doesn't find an
      available value, this saves many expensive alias analysis queries.
      e0615bcd
    • Sanjay Patel's avatar
      [IR] restrict vector reduction intrinsic types · 215bb157
      Sanjay Patel authored
      The arguments in all cases should be vectors of exactly one of integer or FP.
      
      All of the tests currently pass the verifier because we check for any vector
      type regardless of the type of reduction.
      This obviously can't work if we mix up integer and FP, and based on current
      LangRef text it was not intended to work for pointers either.
      
      The pointer case from https://llvm.org/PR49215 is what led me here. That
      example was avoided with 5b250a27.
      
      Differential Revision: https://reviews.llvm.org/D96904
      215bb157
    • António Afonso's avatar
      Make sure the interpreter module was loaded before making checks against it · a83a825e
      António Afonso authored
      This issue was introduced in https://reviews.llvm.org/D92187.
      The guard I'm changing were is supposed to act when linux is loading the linker for the second time (due to differences in paths like symlinks).
      This is done by checking `module_sp != m_interpreter_module.lock()` however this will be true when `m_interpreter_module` wasn't initialized, making linux unload the linker module (the most visible result here is that lldb will stop getting notified about new modules loaded by the process, because it can't set the rendezvous breakpoint again after the stepping over it once).
      The `m_interpreter_module` is not getting initialize when it goes through this path: https://github.com/llvm/llvm-project/blob/dbfdb139f75470a9abc78e7c9faf743fdd963c2d/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp#L332, which happens when lldb was able to read the address from the dynamic section of the executable.
      
      What I'm not sure about though, is if when we go through this path if we still load the linker twice on linux. If that's the case then it means we need to somehow set the m_interpreter_module instead of the fix I provide here. I've only tested this on Android.
      
      Differential Revision: https://reviews.llvm.org/D96637
      a83a825e
    • Nikita Popov's avatar
      [Loads] Extract helper frunction for available load/store (NFC) · 7c706aa0
      Nikita Popov authored
      This contains the logic for extracting an available load/store
      from a given instruction, to be reused in a following patch.
      7c706aa0
    • Kristina Bessonova's avatar
      [ThinLTO] Fix import of multiply defined global variables · e97aab8d
      Kristina Bessonova authored
      Currently, if there is a module that contains a strong definition of
      a global variable and a module that has both a weak definition for
      the same global and a reference to it, it may result in an undefined symbol error
      while linking with ThinLTO.
      
      It happens because:
      * the strong definition become internal because it is read-only and can be imported;
      * the weak definition gets replaced by a declaration because it's non-prevailing;
      * the strong definition failed to be imported because the destination module
        already contains another definition of the global yet this def is non-prevailing.
      
      The patch adds a check to computeImportForReferencedGlobals() that allows
      considering a global variable for being imported even if the module contains
      a definition of it in the case this def has an interposable linkage type.
      
      Note that currently the check is based only on the linkage type
      (and this seems to be enough at the moment), but it might be worth to account
      the information whether the def is prevailing or not.
      
      Reviewed By: tejohnson
      
      Differential Revision: https://reviews.llvm.org/D95943
      e97aab8d
  2. Feb 21, 2021