diff options
author | Adam Nemet <anemet@apple.com> | 2016-04-29 07:10:39 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2016-04-29 07:10:39 +0000 |
commit | 4338d6769e8c47b66ba6224caab7463a6faa5be5 (patch) | |
tree | 57021d52f65dbc819cd5667af8157d7e43998069 /llvm/lib/Transforms | |
parent | 13d552639228baa5a068c9212838cd83af87c122 (diff) | |
download | bcm5719-llvm-4338d6769e8c47b66ba6224caab7463a6faa5be5.tar.gz bcm5719-llvm-4338d6769e8c47b66ba6224caab7463a6faa5be5.zip |
[LoopDist] Pass 'Function' to main class. NFC
Next patch will add another use for 'Function' inside the class.
llvm-svn: 268005
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopDistribute.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp index 3b484f31acc..50df14de866 100644 --- a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp @@ -588,9 +588,10 @@ private: /// \brief The actual class performing the per-loop work. class LoopDistributeForLoop { public: - LoopDistributeForLoop(Loop *L, LoopInfo *LI, const LoopAccessInfo &LAI, - DominatorTree *DT, ScalarEvolution *SE) - : L(L), LI(LI), LAI(LAI), DT(DT), SE(SE) { + LoopDistributeForLoop(Loop *L, Function *F, LoopInfo *LI, + const LoopAccessInfo &LAI, DominatorTree *DT, + ScalarEvolution *SE) + : L(L), F(F), LI(LI), LAI(LAI), DT(DT), SE(SE) { setForced(); } @@ -746,7 +747,6 @@ public: /// \brief Provide diagnostics then \return with false. bool fail(llvm::StringRef Message) { - Function *F = L->getHeader()->getParent(); LLVMContext &Ctx = F->getContext(); bool Forced = isForced().getValueOr(false); @@ -834,8 +834,10 @@ private: IsForced = mdconst::extract<ConstantInt>(*Op)->getZExtValue(); } - // Analyses used. Loop *L; + Function *F; + + // Analyses used. LoopInfo *LI; const LoopAccessInfo &LAI; DominatorTree *DT; @@ -886,7 +888,7 @@ public: bool Changed = false; for (Loop *L : Worklist) { const LoopAccessInfo &LAI = LAA->getInfo(L, ValueToValueMap()); - LoopDistributeForLoop LDL(L, LI, LAI, DT, SE); + LoopDistributeForLoop LDL(L, &F, LI, LAI, DT, SE); // If distribution was forced for the specific loop to be // enabled/disabled, follow that. Otherwise use the global flag. |