[all-commits] [llvm/llvm-project] b12f81: Introduce DIExpression::foldConstantMath() (#71718)

Shubham Sandeep Rastogi via All-commits all-commits at lists.llvm.org
Wed May 29 16:10:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b12f81b53ad6c3e1004f32eecbf4083d87731fbc
      https://github.com/llvm/llvm-project/commit/b12f81b53ad6c3e1004f32eecbf4083d87731fbc
  Author: Shubham Sandeep Rastogi <srastogi22 at apple.com>
  Date:   2024-05-29 (Wed, 29 May 2024)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/lib/IR/CMakeLists.txt
    A llvm/lib/IR/DIExpressionOptimizer.cpp
    M llvm/lib/IR/DebugInfoMetadata.cpp
    M llvm/unittests/IR/MetadataTest.cpp

  Log Message:
  -----------
  Introduce DIExpression::foldConstantMath() (#71718)

DIExpressions can get very long and have a lot of redundant operations.
This function uses simple pattern matching to fold constant math that
can be evaluated at compile time.

The hope is that other people can contribute other patterns as well.

I also couldn't see a good way of combining this with
`DIExpression::constantFold` so it stands alone.

This is part of a stack of patches and comes after
https://github.com/llvm/llvm-project/pull/69768
https://github.com/llvm/llvm-project/pull/71717



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list