Files
clang-p2996/llvm/lib/IR/DIExpressionOptimizer.cpp
Shubham Sandeep Rastogi b12f81b53a 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
2024-05-29 16:09:59 -07:00

12 KiB