Skip to content

Commit 299ebdb

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 009c253: Internal performance refinements
Improvements to internal analysis and data handling to reduce overhead.
1 parent 78fcf82 commit 299ebdb

File tree

2 files changed

+10
-29
lines changed

2 files changed

+10
-29
lines changed

IGC/AdaptorCommon/LivenessUtils/AllocationLivenessAnalyzer.cpp

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using namespace llvm;
3333
using namespace IGC;
3434

3535
AllocationLivenessAnalyzer::LivenessData
36-
AllocationLivenessAnalyzer::ProcessInstruction(Instruction *I, DominatorTree &DT, LoopInfo &LI, bool includeOrigin) {
36+
AllocationLivenessAnalyzer::ProcessInstruction(Instruction *I, DominatorTree &DT, LoopInfo &LI) {
3737
// static allocas are usually going to be in the entry block
3838
// that's a practice, but we only care about the last block that dominates all uses
3939
BasicBlock *commonDominator = nullptr;
@@ -93,9 +93,14 @@ AllocationLivenessAnalyzer::ProcessInstruction(Instruction *I, DominatorTree &DT
9393
}
9494
}
9595
} break;
96-
case Instruction::Call:
97-
implementCallSpecificBehavior(cast<CallInst>(II), use, worklist, allUsers, lifetimeLeakingUsers);
98-
break;
96+
case Instruction::Call: {
97+
auto *callI = cast<CallInst>(II);
98+
if (!callI->doesNotCapture(use->getOperandNo()))
99+
lifetimeLeakingUsers.insert(II);
100+
101+
if (II->getType()->isPointerTy())
102+
addUsesFn(II->uses());
103+
} break;
99104
case Instruction::Load:
100105
if (II->getType()->isPointerTy())
101106
addUsesFn(II->uses());
@@ -106,9 +111,6 @@ AllocationLivenessAnalyzer::ProcessInstruction(Instruction *I, DominatorTree &DT
106111
}
107112
}
108113

109-
if (includeOrigin)
110-
allUsers.insert(I);
111-
112114
return LivenessData(I, std::move(allUsers), LI, DT, commonDominator, std::move(lifetimeLeakingUsers));
113115
}
114116

@@ -118,20 +120,6 @@ void AllocationLivenessAnalyzer::getAnalysisUsage(llvm::AnalysisUsage &AU) const
118120
getAdditionalAnalysisUsage(AU);
119121
}
120122

121-
void AllocationLivenessAnalyzer::implementCallSpecificBehavior(CallInst *callI, Use* use, SmallVector<Use *> &worklist,
122-
SetVector<Instruction *> &allUsers,
123-
SetVector<Instruction *> &lifetimeLeakingUsers) {
124-
125-
if (!callI->doesNotCapture(use->getOperandNo()))
126-
lifetimeLeakingUsers.insert(callI);
127-
128-
if (callI->getType()->isPointerTy()) {
129-
130-
for (auto &use : callI->uses())
131-
worklist.push_back(&use);
132-
}
133-
}
134-
135123
template <typename range>
136124
static inline void doWorkLoop(SmallVector<BasicBlock *> &worklist, DenseSet<BasicBlock *> &bbSet1,
137125
DenseSet<BasicBlock *> &bbSet2, std::function<range(BasicBlock *)> iterate,

IGC/AdaptorCommon/LivenessUtils/AllocationLivenessAnalyzer.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ SPDX-License-Identifier: MIT
1515

1616
namespace llvm {
1717
class BasicBlock;
18-
class CallInst;
1918
class DominatorTree;
2019
class Instruction;
2120
class LoopInfo;
22-
class Use;
2321
} // namespace llvm
2422

2523
namespace IGC {
@@ -51,15 +49,10 @@ class AllocationLivenessAnalyzer : public llvm::FunctionPass {
5149
AllocationLivenessAnalyzer(char &pid) : llvm::FunctionPass(pid) {}
5250

5351
protected:
54-
LivenessData ProcessInstruction(llvm::Instruction *I, llvm::DominatorTree &DT, llvm::LoopInfo &LI,
55-
bool includeOrigin = false);
52+
LivenessData ProcessInstruction(llvm::Instruction *I, llvm::DominatorTree &DT, llvm::LoopInfo &LI);
5653

5754
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override;
5855
virtual void getAdditionalAnalysisUsage(llvm::AnalysisUsage &AU) const = 0;
59-
virtual void implementCallSpecificBehavior(llvm::CallInst *I, llvm::Use *use,
60-
llvm::SmallVector<llvm::Use *> &worklist,
61-
llvm::SetVector<llvm::Instruction *> &allUsers,
62-
llvm::SetVector<llvm::Instruction *> &lifetimeLeakingUsers);
6356
};
6457

6558
namespace Provenance {

0 commit comments

Comments
 (0)