mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-19 10:15:00 +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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125369 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fae0abe8eb
commit
71132af89a
@ -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…
x
Reference in New Issue
Block a user