diff options
author | Aditya Kumar <hiraditya@msn.com> | 2016-11-29 14:36:27 +0000 |
---|---|---|
committer | Aditya Kumar <hiraditya@msn.com> | 2016-11-29 14:36:27 +0000 |
commit | 314ebe05ac9a4d1e039b00da853514f4f7e16abe (patch) | |
tree | 764c3d4390b70f704cd450fb2d97ccf7d1ceb7e9 /llvm/lib/Transforms/Scalar/GVNHoist.cpp | |
parent | 07cb3048262b8219ee59f876f1470014bc8aa41f (diff) | |
download | bcm5719-llvm-314ebe05ac9a4d1e039b00da853514f4f7e16abe.tar.gz bcm5719-llvm-314ebe05ac9a4d1e039b00da853514f4f7e16abe.zip |
[GVNHoist] Rename variables.
Differential Revision: https://reviews.llvm.org/D27110
llvm-svn: 288142
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVNHoist.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVNHoist.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index 5b2f1b6277f..230558b4aa9 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -396,6 +396,10 @@ private: continue; } + // Stop walk once the limit is reached. + if (NBBsOnAllPaths == 0) + return true; + // Impossible to hoist with exceptions on the path. if (hasEH(*I)) return true; @@ -404,10 +408,6 @@ private: if (hasMemoryUse(NewPt, Def, *I)) return true; - // Stop walk once the limit is reached. - if (NBBsOnAllPaths == 0) - return true; - // -1 is unlimited number of blocks on all paths. if (NBBsOnAllPaths != -1) --NBBsOnAllPaths; @@ -438,14 +438,14 @@ private: continue; } - // Impossible to hoist with exceptions on the path. - if (hasEH(*I)) - return true; - // Stop walk once the limit is reached. if (NBBsOnAllPaths == 0) return true; + // Impossible to hoist with exceptions on the path. + if (hasEH(*I)) + return true; + // -1 is unlimited number of blocks on all paths. if (NBBsOnAllPaths != -1) --NBBsOnAllPaths; @@ -538,7 +538,7 @@ private: std::sort(InstructionsToHoist.begin(), InstructionsToHoist.end(), Pred); } - int NBBsOnAllPaths = MaxNumberOfBBSInPath; + int NumBBsOnAllPaths = MaxNumberOfBBSInPath; SmallVecImplInsn::iterator II = InstructionsToHoist.begin(); SmallVecImplInsn::iterator Start = II; @@ -554,10 +554,12 @@ private: BasicBlock *NewHoistBB; Instruction *NewHoistPt; - if (BB == HoistBB) { + if (BB == HoistBB) { // Both are in the same Basic Block. NewHoistBB = HoistBB; NewHoistPt = firstInBB(Insn, HoistPt) ? Insn : HoistPt; } else { + // If the hoisting point contains one of the instructions, + // then hoist there, otherwise hoist before the terminator. NewHoistBB = DT->findNearestCommonDominator(HoistBB, BB); if (NewHoistBB == BB) NewHoistPt = Insn; @@ -572,7 +574,7 @@ private: WL.insert(BB); if (K == InsKind::Scalar) { - if (safeToHoistScalar(NewHoistBB, WL, NBBsOnAllPaths)) { + if (safeToHoistScalar(NewHoistBB, WL, NumBBsOnAllPaths)) { // Extend HoistPt to NewHoistPt. HoistPt = NewHoistPt; HoistBB = NewHoistBB; @@ -589,9 +591,9 @@ private: hoistingFromAllPaths(NewHoistBB, WL)) && // Also check that it is safe to move the load or store from HoistPt // to NewHoistPt, and from Insn to NewHoistPt. - safeToHoistLdSt(NewHoistPt, HoistPt, UD, K, NBBsOnAllPaths) && + safeToHoistLdSt(NewHoistPt, HoistPt, UD, K, NumBBsOnAllPaths) && safeToHoistLdSt(NewHoistPt, Insn, MSSA->getMemoryAccess(Insn), - K, NBBsOnAllPaths)) { + K, NumBBsOnAllPaths)) { // Extend HoistPt to NewHoistPt. HoistPt = NewHoistPt; HoistBB = NewHoistBB; @@ -610,7 +612,7 @@ private: UD = MSSA->getMemoryAccess(*Start); HoistPt = Insn; HoistBB = BB; - NBBsOnAllPaths = MaxNumberOfBBSInPath; + NumBBsOnAllPaths = MaxNumberOfBBSInPath; } // Save the last partition. |