mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Preserve ProfileInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include "llvm/Analysis/LoopInfo.h"
|
||||
#include "llvm/Analysis/ProfileInfo.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/Type.h"
|
||||
@ -44,6 +45,7 @@ namespace {
|
||||
AU.addPreserved<DominatorTree>();
|
||||
AU.addPreserved<DominanceFrontier>();
|
||||
AU.addPreserved<LoopInfo>();
|
||||
AU.addPreserved<ProfileInfo>();
|
||||
|
||||
// No loop canonicalization guarantees are broken by this pass.
|
||||
AU.addPreservedID(LoopSimplifyID);
|
||||
@ -338,5 +340,10 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
|
||||
}
|
||||
}
|
||||
|
||||
// Update ProfileInfo if it is around.
|
||||
if (ProfileInfo *PI = P->getAnalysisIfAvailable<ProfileInfo>()) {
|
||||
PI->splitEdge(TIBB,DestBB,NewBB,MergeIdenticalEdges);
|
||||
}
|
||||
|
||||
return NewBB;
|
||||
}
|
||||
|
Reference in New Issue
Block a user