Skip to content

Commit 9e6b2e4

Browse files
Add additional final fold after all appends
1 parent 5f55a47 commit 9e6b2e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,8 @@ template <typename T> static void salvageDbgAssignAddress(T *Assign) {
22302230
assert(!SalvagedExpr->getFragmentInfo().has_value() &&
22312231
"address-expression shouldn't have fragment info");
22322232

2233+
SalvagedExpr = SalvagedExpr->foldConstantMath();
2234+
22332235
// Salvage succeeds if no additional values are required.
22342236
if (AdditionalValues.empty()) {
22352237
Assign->setAddress(NewV);
@@ -2285,6 +2287,7 @@ void llvm::salvageDebugInfoForDbgValues(
22852287
DIExpression::appendOpsToArg(SalvagedExpr, Ops, LocNo, StackValue);
22862288
LocItr = std::find(++LocItr, DIILocation.end(), &I);
22872289
}
2290+
SalvagedExpr = SalvagedExpr->foldConstantMath();
22882291
// salvageDebugInfoImpl should fail on examining the first element of
22892292
// DbgUsers, or none of them.
22902293
if (!Op0)
@@ -2346,6 +2349,7 @@ void llvm::salvageDebugInfoForDbgValues(
23462349
DIExpression::appendOpsToArg(SalvagedExpr, Ops, LocNo, StackValue);
23472350
LocItr = std::find(++LocItr, DVRLocation.end(), &I);
23482351
}
2352+
SalvagedExpr = SalvagedExpr->foldConstantMath();
23492353
// salvageDebugInfoImpl should fail on examining the first element of
23502354
// DbgUsers, or none of them.
23512355
if (!Op0)

0 commit comments

Comments
 (0)