From e48134093df8db0c0bf41079d19f8fa785ed4f05 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 20 Aug 2015 17:22:29 +0000 Subject: [LVer] Fix FIXME: hide addPHINodes, NFC Since Ashutosh made findDefsUsedOutsideOfLoop public, we can clean this up. Now clients that don't compute DefsUsedOutsideOfLoop can just call versionLoop() and computing DefsUsedOutsideOfLoop will happen implicitly. With that there is no reason to expose addPHINodes anymore. Ashutosh, you can now drop the calls to findDefsUsedOutsideOfLoop and addPHINodes in LVerLICM and things should just work. llvm-svn: 245579 --- llvm/lib/Transforms/Utils/LoopVersioning.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Utils') diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp index 11f11adbc5e..bfc877e9836 100644 --- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp +++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp @@ -40,7 +40,8 @@ LoopVersioning::LoopVersioning(const LoopAccessInfo &LAInfo, Loop *L, assert(L->getLoopPreheader() && "No preheader"); } -void LoopVersioning::versionLoop() { +void LoopVersioning::versionLoop( + const SmallVectorImpl &DefsUsedOutside) { Instruction *FirstCheckInst; Instruction *MemRuntimeCheck; // Add the memcheck in the original preheader (this is empty initially). @@ -77,6 +78,10 @@ void LoopVersioning::versionLoop() { // The loops merge in the original exit block. This is now dominated by the // memchecking block. DT->changeImmediateDominator(VersionedLoop->getExitBlock(), MemCheckBB); + + // Adds the necessary PHI nodes for the versioned loops based on the + // loop-defined values used outside of the loop. + addPHINodes(DefsUsedOutside); } void LoopVersioning::addPHINodes( -- cgit v1.2.3