mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Preserve ScalarEvolution in the loop unroller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109412 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3d0c7231fd
commit
572365ec88
@ -24,6 +24,7 @@
|
|||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/Analysis/ConstantFolding.h"
|
#include "llvm/Analysis/ConstantFolding.h"
|
||||||
#include "llvm/Analysis/LoopPass.h"
|
#include "llvm/Analysis/LoopPass.h"
|
||||||
|
#include "llvm/Analysis/ScalarEvolution.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
||||||
@ -127,6 +128,11 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, LoopInfo* LI, LPPassManager* LPM)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify ScalarEvolution that the loop will be substantially changed,
|
||||||
|
// if not outright eliminated.
|
||||||
|
if (ScalarEvolution *SE = LPM->getAnalysisIfAvailable<ScalarEvolution>())
|
||||||
|
SE->forgetLoop(L);
|
||||||
|
|
||||||
// Find trip count
|
// Find trip count
|
||||||
unsigned TripCount = L->getSmallConstantTripCount();
|
unsigned TripCount = L->getSmallConstantTripCount();
|
||||||
// Find trip multiple if count is not available
|
// Find trip multiple if count is not available
|
||||||
|
Loading…
x
Reference in New Issue
Block a user