1. Jun 25, 2021
    • Alexander Yermolovich's avatar
      [LLD][LLVM] CG Graph profile using relocations · a224c519
      Alexander Yermolovich authored
      Currently when .llvm.call-graph-profile is created by llvm it explicitly encodes the symbol indices. This section is basically a black box for post processing tools. For example, if we run strip -s on the object files the symbol table changes, but indices in that section do not. In non-visible behavior indices point to wrong symbols. The visible behavior indices point outside of Symbol table: "invalid symbol index".
      
      This patch changes the format by using R_*_NONE relocations to indicate the from/to symbols. The Frequency (Weight) will still be in the .llvm.call-graph-profile, but symbol information will be in relocation section. In LLD information from both sections is used to reconstruct call graph profile. Relocations themselves will never be applied.
      
      With this approach post processing tools that handle relocations correctly work for this section also. Tools can add/remove symbols and as long as they handle relocation sections with this approach informati...
      a224c519
    • William S. Moses's avatar
      [MLIR][LLVM] Expose type translator from LLVM to MLIR Type · 929189a4
      William S. Moses authored
      This commit moves the type translator from LLVM to MLIR to a public header for use by external projects or other code.
      
      Unlike a previous attempt (https://reviews.llvm.org/D104726), this patch moves the type conversion into separate files which remedies the linker error which was only caught by CI.
      
      Differential Revision: https://reviews.llvm.org/D104834
      929189a4
    • David Spickett's avatar
      [lldb][AArch64] Add memory tag reading to lldb-server · da2e614f
      David Spickett authored
      This adds memory tag reading using the new "qMemTags"
      packet and ptrace on AArch64 Linux.
      
      This new packet is following the one used by GDB.
      (https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html)
      
      On AArch64 Linux we use ptrace's PEEKMTETAGS to read
      tags and we assume that lldb has already checked that the
      memory region actually has tagging enabled.
      
      We do not assume that lldb has expanded the requested range
      to granules and expand it again to be sure.
      (although lldb will be sending aligned ranges because it happens
      to need them client side anyway)
      Also we don't assume untagged addresses. So for AArch64 we'll
      remove the top byte before using them. (the top byte includes
      MTE and other non address data)
      
      To do the ptrace read NativeProcessLinux will ask the native
      register context for a memory tag manager based on the
      type in the packet. This also gives you the ptrace numbers you need.
      (it's called a register context but it also has non register data,
      so it saves adding another per platform sub class)
      
      The only supported platform for this is AArch64 Linux and the only
      supported tag type is MTE allocation tags. Anything else will
      error.
      
      Ptrace can return a partial result but for lldb-server we will
      be treating that as an error. To succeed we need to get all the tags
      we expect.
      
      (Note that the protocol leaves room for logical tags to be
      read via qMemTags but this is not going to be implemented for lldb
      at this time.)
      
      Reviewed By: omjavaid
      
      Differential Revision: https://reviews.llvm.org/D95601
      da2e614f
  2. Jun 24, 2021