mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 08:28:19 +00:00
Make LoopUnswitch preserve ScalarEvolution by just forgetting everything about
a loop when unswitching it. It only does this in the complex case, because everything should be fine already in the simple case. llvm-svn: 125369
This commit is contained in:
parent
a71a5e4f90
commit
ef11d9219e
@ -37,6 +37,7 @@
|
||||
#include "llvm/Analysis/LoopInfo.h"
|
||||
#include "llvm/Analysis/LoopPass.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/Transforms/Utils/Cloning.h"
|
||||
#include "llvm/Transforms/Utils/Local.h"
|
||||
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
||||
@ -110,6 +111,7 @@ namespace {
|
||||
AU.addRequiredID(LCSSAID);
|
||||
AU.addPreservedID(LCSSAID);
|
||||
AU.addPreserved<DominatorTree>();
|
||||
AU.addPreserved<ScalarEvolution>();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -574,6 +576,9 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
|
||||
<< " blocks] in Function " << F->getName()
|
||||
<< " when '" << *Val << "' == " << *LIC << "\n");
|
||||
|
||||
if (ScalarEvolution *SE = getAnalysisIfAvailable<ScalarEvolution>())
|
||||
SE->forgetLoop(L);
|
||||
|
||||
LoopBlocks.clear();
|
||||
NewBlocks.clear();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user