[PATCH] D86031: NFC: [GVNHoist] Hoist loop invariant code and rename variables for readability
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 15 20:00:19 PDT 2020
hiraditya created this revision.
hiraditya added a reviewer: fhahn.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
hiraditya requested review of this revision.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86031
Files:
llvm/lib/Transforms/Scalar/GVNHoist.cpp
Index: llvm/lib/Transforms/Scalar/GVNHoist.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -792,13 +792,14 @@
}
// Insert empty CHI node for this VN. This is used to factor out
// basic blocks where the ANTIC can potentially change.
- for (auto IDFB : IDFBlocks) {
+ CHIArg EmptyChi = {VN, nullptr, nullptr};
+ for (auto IDFBB : IDFBlocks) {
for (unsigned i = 0; i < V.size(); ++i) {
- CHIArg C = {VN, nullptr, nullptr};
- // Ignore spurious PDFs.
- if (DT->properlyDominates(IDFB, V[i]->getParent())) {
- OutValue[IDFB].push_back(C);
- LLVM_DEBUG(dbgs() << "\nInsertion a CHI for BB: " << IDFB->getName()
+ // Ignore spurious PDFs.
+ if (DT->properlyDominates(IDFBB, V[i]->getParent())) {
+ OutValue[IDFBB].push_back(EmptyChi);
+ LLVM_DEBUG(dbgs() << "\nInserting a CHI for BB: "
+ << IDFBB->getName()
<< ", for Insn: " << *V[i]);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86031.285876.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200816/cc3f25a6/attachment.bin>
More information about the llvm-commits
mailing list