[llvm] 86d817d - [DSE,MemorySSA] Skip defs without analyzable write locations.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 30 13:57:01 PDT 2020
Author: Florian Hahn
Date: 2020-08-30T21:56:25+01:00
New Revision: 86d817d7cf29750dfed1892d51110f44fc499c94
URL: https://github.com/llvm/llvm-project/commit/86d817d7cf29750dfed1892d51110f44fc499c94
DIFF: https://github.com/llvm/llvm-project/commit/86d817d7cf29750dfed1892d51110f44fc499c94.diff
LOG: [DSE,MemorySSA] Skip defs without analyzable write locations.
Similar to other checks above, if there is no write location for a def,
it cannot be considered for elimination and can be skipped.
Added:
Modified:
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index b2613697bfa5..7e4ef1ed9cd8 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -1896,9 +1896,13 @@ struct DSEState {
continue;
}
+ // If Current does not have an analyzable write location, skip it
auto CurrentLoc = getLocForWriteEx(CurrentI);
- if (!CurrentLoc)
- break;
+ if (!CurrentLoc) {
+ StepAgain = true;
+ Current = CurrentDef->getDefiningAccess();
+ continue;
+ }
if (IsMemTerm) {
// If the killing def is a memory terminator (e.g. lifetime.end), check
More information about the llvm-commits
mailing list