[all-commits] [llvm/llvm-project] d6b688: Streamline the API of salvageDebugInfoImpl (NFC)

adrian-prantl via All-commits all-commits at lists.llvm.org
Tue Aug 10 15:21:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d6b6880172f295211dd9139a68ba2f42add53ba9
      https://github.com/llvm/llvm-project/commit/d6b6880172f295211dd9139a68ba2f42add53ba9
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    M llvm/lib/Transforms/Utils/Local.cpp

  Log Message:
  -----------
  Streamline the API of salvageDebugInfoImpl (NFC)

This patch refactors / simplifies salvageDebugInfoImpl(). The goal
here is to simplify the implementation of coro::salvageDebugInfo() in
a followup patch.

  1. Change the return value to I.getOperand(0). Currently users of
     salvageDebugInfoImpl() assume that the first operand is
     I.getOperand(0). This patch makes this information explicit. A
     nice side-effect of this change is that it allows us to salvage
     expressions such as add i8 1, %a in the future.

  2. Factor out the creation of a DIExpression and return an array of
     DIExpression operations instead. This change allows users that
     call salvageDebugInfoImpl() in a loop to avoid the costly
     creation of temporary DIExpressions and to defer the creation of
     a DIExpression until the end.

This patch does not change any functionality.

rdar://80227769

Differential Revision: https://reviews.llvm.org/D107383


  Commit: a353edb8d6d142c00404eb588944a231d8cd989d
      https://github.com/llvm/llvm-project/commit/a353edb8d6d142c00404eb588944a231d8cd989d
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    M llvm/test/Transforms/Coroutines/coro-debug.ll

  Log Message:
  -----------
  Simplify coro::salvageDebugInfo() (NFC-ish)

This patch removes the hand-rolled implementation of salvageDebugInfo
for cast and GEPs and replaces it with a call into
llvm::salvageDebugInfoImpl().

A side-effect of this is that additional redundant convert operations
are introduced, but those don't have any negative effect on the
resulting DWARF expression.

rdar://80227769

Differential Revision: https://reviews.llvm.org/D107384


Compare: https://github.com/llvm/llvm-project/compare/56175b2f5cd5...a353edb8d6d1


More information about the All-commits mailing list