[llvm] r276894 - [DSE] Fix bug in updating MadeChange flag
Jun Bum Lim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 27 10:25:21 PDT 2016
Author: junbuml
Date: Wed Jul 27 12:25:20 2016
New Revision: 276894
URL: http://llvm.org/viewvc/llvm-project?rev=276894&view=rev
Log:
[DSE] Fix bug in updating MadeChange flag
Summary: The MadeChange flag should be ORed to keep the previous result.
Reviewers: mcrosier
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D22873
Modified:
llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=276894&r1=276893&r2=276894&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jul 27 12:25:20 2016
@@ -933,7 +933,7 @@ static bool removePartiallyOverlappedSto
int64_t EarlierSize = int64_t(Loc.Size);
GetPointerBaseWithConstantOffset(Ptr, EarlierStart, DL);
OverlapIntervalsTy &IntervalMap = OI.second;
- Changed =
+ Changed |=
tryToShortenEnd(EarlierWrite, IntervalMap, EarlierStart, EarlierSize);
if (IntervalMap.empty())
continue;
@@ -1079,7 +1079,7 @@ static bool eliminateDeadStores(BasicBlo
int64_t EarlierSize = DepLoc.Size;
int64_t LaterSize = Loc.Size;
bool IsOverwriteEnd = (OR == OverwriteEnd);
- MadeChange = tryToShorten(DepWrite, DepWriteOffset, EarlierSize,
+ MadeChange |= tryToShorten(DepWrite, DepWriteOffset, EarlierSize,
InstWriteOffset, LaterSize, IsOverwriteEnd);
}
}
More information about the llvm-commits
mailing list