summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2018-04-20 07:57:24 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2018-04-20 07:57:24 +0000
commitbc843211fde1a1c6937b6d9bf3af670f0d10fd22 (patch)
tree73a91f8ba6305dc13b6c68809005397eba9769b3 /llvm/lib/Transforms
parent79cb54b2d9b81c71667580b7e7835052796276fa (diff)
downloadbcm5719-llvm-bc843211fde1a1c6937b6d9bf3af670f0d10fd22.tar.gz
bcm5719-llvm-bc843211fde1a1c6937b6d9bf3af670f0d10fd22.zip
[SSAUpdaterBulk] Use PredCache in ComputeLiveInBlocks.
llvm-svn: 330399
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp b/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
index 5321b4374cd..6ab4a159fe0 100644
--- a/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
+++ b/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
@@ -90,7 +90,8 @@ Value *SSAUpdaterBulk::computeValueAt(BasicBlock *BB, RewriteInfo &R,
static void
ComputeLiveInBlocks(const SmallPtrSetImpl<BasicBlock *> &UsingBlocks,
const SmallPtrSetImpl<BasicBlock *> &DefBlocks,
- SmallPtrSetImpl<BasicBlock *> &LiveInBlocks) {
+ SmallPtrSetImpl<BasicBlock *> &LiveInBlocks,
+ PredIteratorCache &PredCache) {
// To determine liveness, we must iterate through the predecessors of blocks
// where the def is live. Blocks are added to the worklist if we need to
// check their predecessors. Start with all the using blocks.
@@ -110,7 +111,7 @@ ComputeLiveInBlocks(const SmallPtrSetImpl<BasicBlock *> &UsingBlocks,
// Since the value is live into BB, it is either defined in a predecessor or
// live into it to. Add the preds to the worklist unless they are a
// defining block.
- for (BasicBlock *P : predecessors(BB)) {
+ for (BasicBlock *P : PredCache.get(BB)) {
// The value is not live into a predecessor if it defines the value.
if (DefBlocks.count(P))
continue;
@@ -147,7 +148,7 @@ void SSAUpdaterBulk::RewriteAllUses(DominatorTree *DT,
SmallVector<BasicBlock *, 32> IDFBlocks;
SmallPtrSet<BasicBlock *, 32> LiveInBlocks;
- ComputeLiveInBlocks(UsingBlocks, DefBlocks, LiveInBlocks);
+ ComputeLiveInBlocks(UsingBlocks, DefBlocks, LiveInBlocks, PredCache);
IDF.resetLiveInBlocks();
IDF.setLiveInBlocks(LiveInBlocks);
IDF.calculate(IDFBlocks);
OpenPOWER on IntegriCloud