[PATCH] D153014: Deduplication of cyclic PHI nodes
Marek Sedláček via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 16 08:37:59 PDT 2023
mark-sed updated this revision to Diff 532170.
mark-sed added a comment.
Fixed formatting errors to match clang-format.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153014/new/
https://reviews.llvm.org/D153014
Files:
llvm/lib/Transforms/Utils/Local.cpp
llvm/unittests/Transforms/Utils/LocalTest.cpp
Index: llvm/unittests/Transforms/Utils/LocalTest.cpp
===================================================================
--- llvm/unittests/Transforms/Utils/LocalTest.cpp
+++ llvm/unittests/Transforms/Utils/LocalTest.cpp
@@ -183,7 +183,6 @@
}
}
}
-
}
TEST(Local, ReplaceDbgDeclare) {
Index: llvm/lib/Transforms/Utils/Local.cpp
===================================================================
--- llvm/lib/Transforms/Utils/Local.cpp
+++ llvm/lib/Transforms/Utils/Local.cpp
@@ -108,9 +108,8 @@
"When the basic block contains not more than this number of PHI nodes, "
"perform a (faster!) exhaustive search instead of set-driven one."));
-static cl::opt<unsigned>
-DeduplicatePhisMaxDepth("deduplicate-phi-max-depth", cl::Hidden,
- cl::init(8));
+static cl::opt<unsigned> DeduplicatePhisMaxDepth("deduplicate-phi-max-depth",
+ cl::Hidden, cl::init(8));
// Max recursion depth for collectBitParts used when detecting bswap and
// bitreverse idioms.
@@ -1305,7 +1304,7 @@
for (auto J = I; PHINode *DuplicatePN = dyn_cast<PHINode>(J); ++J) {
SmallSet<std::pair<PHINode *, PHINode *>, 8> MatchingPhis;
if (!DuplicatePN->isIdenticalToWhenDefined(PN) &&
- !matchPhiStructures(PN, DuplicatePN, MatchingPhis))
+ !matchPhiStructures(PN, DuplicatePN, MatchingPhis))
continue;
// A duplicate. Replace this PHI with the base PHI.
++NumPHICSEs;
@@ -1372,7 +1371,7 @@
// These comparisons are nontrivial, so assert that equality implies
// hash equality (DenseMap demands this as an invariant).
if (LHS == getEmptyKey() || LHS == getTombstoneKey() ||
- RHS == getEmptyKey() || RHS == getTombstoneKey())
+ RHS == getEmptyKey() || RHS == getTombstoneKey())
return LHS == RHS;
SmallSet<std::pair<PHINode *, PHINode *>, 8> MatchingPhis;
bool Result = matchPhiStructures(LHS, RHS, MatchingPhis);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153014.532170.patch
Type: text/x-patch
Size: 2017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230616/f72c978f/attachment.bin>
More information about the llvm-commits
mailing list