[all-commits] [llvm/llvm-project] 9fb002: [DebugInfo] Upgrade DISubragne::count to accept DI...

Alok Kumar Sharma via All-commits all-commits at lists.llvm.org
Mon Mar 29 21:30:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fb0025f7084db14d16fe5cbe1d799f4ee0020af
      https://github.com/llvm/llvm-project/commit/9fb0025f7084db14d16fe5cbe1d799f4ee0020af
  Author: Alok Kumar Sharma <AlokKumar.Sharma at amd.com>
  Date:   2021-03-30 (Tue, 30 Mar 2021)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/DebugInfoMetadata.cpp
    M llvm/lib/IR/Verifier.cpp
    A llvm/test/DebugInfo/fortranSubrangeCountExpr.ll
    M llvm/test/Verifier/invalid-disubrange-count-node.ll

  Log Message:
  -----------
  [DebugInfo] Upgrade DISubragne::count to accept DIExpression also

This is needed for Fortran assumed shape arrays whose dimensions are
defined as,
  - 'count' is taken from array descriptor passed as parameter by
    caller, access from descriptor is defined by type DIExpression.
  - 'lowerBound' is defined by callee.
The current alternate way represents using upperBound in place of
count, where upperBound is calculated in callee in a temp variable
using lowerBound and count

Representation with count (DIExpression) is not only clearer as
compared to upperBound (DIVariable) but it has another advantage that
variable count is accessed by being parameter has better chance of
survival at higher optimization level than upperBound being local
variable.

Reviewed By: aprantl

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




More information about the All-commits mailing list