diff options
author | Shubham Sandeep Rastogi <srastogi22@apple.com> | 2024-05-29 16:09:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-29 16:09:59 -0700 |
commit | b12f81b53ad6c3e1004f32eecbf4083d87731fbc (patch) | |
tree | 271f8788ebe4b5f91dbc7ed549f790e232e5ca74 /llvm/lib/IR/DebugInfoMetadata.cpp | |
parent | e06e680a97d28dc95d31952a0b200add75941496 (diff) | |
download | llvm-b12f81b53ad6c3e1004f32eecbf4083d87731fbc.zip llvm-b12f81b53ad6c3e1004f32eecbf4083d87731fbc.tar.gz llvm-b12f81b53ad6c3e1004f32eecbf4083d87731fbc.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 5705155..229ee2b 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -1880,7 +1880,6 @@ DIExpression *DIExpression::append(const DIExpression *Expr, } Op.appendToVector(NewOps); } - NewOps.append(Ops.begin(), Ops.end()); auto *result = DIExpression::get(Expr->getContext(), NewOps); assert(result->isValid() && "concatenated expression is not valid"); |