Skip to content

Commit aef4ec9

Browse files
remove dead code
1 parent b5fff4e commit aef4ec9

File tree

3 files changed

+2
-60
lines changed

3 files changed

+2
-60
lines changed

llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ bool SPIRVInstrInfo::isSpecConstantInstr(const MachineInstr &MI) const {
5959
return false;
6060
}
6161
}
62+
6263
bool SPIRVInstrInfo::isInlineAsmDefInstr(const MachineInstr &MI) const {
6364
switch (MI.getOpcode()) {
6465
case SPIRV::OpAsmTargetINTEL:

llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -252,59 +252,6 @@ static InstrSignature instrToSignature(const MachineInstr &MI,
252252
return Signature;
253253
}
254254

255-
void SPIRVModuleAnalysis::collectGlobalEntities(
256-
const std::vector<SPIRV::DTSortableEntry *> &DepsGraph,
257-
SPIRV::ModuleSectionType MSType,
258-
std::function<bool(const SPIRV::DTSortableEntry *)> Pred,
259-
bool UsePreOrder = false) {
260-
DenseSet<const SPIRV::DTSortableEntry *> Visited;
261-
for (const auto *E : DepsGraph) {
262-
std::function<void(const SPIRV::DTSortableEntry *)> RecHoistUtil;
263-
// NOTE: here we prefer recursive approach over iterative because
264-
// we don't expect depchains long enough to cause SO.
265-
RecHoistUtil = [MSType, UsePreOrder, &Visited, &Pred,
266-
&RecHoistUtil](const SPIRV::DTSortableEntry *E) {
267-
if (Visited.count(E) || !Pred(E))
268-
return;
269-
Visited.insert(E);
270-
271-
// Traversing deps graph in post-order allows us to get rid of
272-
// register aliases preprocessing.
273-
// But pre-order is required for correct processing of function
274-
// declaration and arguments processing.
275-
if (!UsePreOrder)
276-
for (auto *S : E->getDeps())
277-
RecHoistUtil(S);
278-
279-
Register GlobalReg = Register::index2VirtReg(MAI.getNextID());
280-
bool IsFirst = true;
281-
for (auto &U : *E) {
282-
const MachineFunction *MF = U.first;
283-
const MachineRegisterInfo &MRI = MF->getRegInfo();
284-
Register Reg = U.second;
285-
MAI.setRegisterAlias(MF, Reg, GlobalReg);
286-
MachineInstr *DefMI = MRI.getUniqueVRegDef(Reg);
287-
// dbgs() << "----- ";
288-
// DefMI->print(dbgs());
289-
// dbgs() << " -----\n";
290-
if (!DefMI)
291-
continue;
292-
MAI.setSkipEmission(DefMI);
293-
if (IsFirst)
294-
MAI.MS[MSType].push_back(DefMI);
295-
IsFirst = false;
296-
if (E->getIsGV())
297-
MAI.GlobalVarList.push_back(DefMI);
298-
}
299-
300-
if (UsePreOrder)
301-
for (auto *S : E->getDeps())
302-
RecHoistUtil(S);
303-
};
304-
RecHoistUtil(E);
305-
}
306-
}
307-
308255
bool SPIRVModuleAnalysis::isDeclSection(const MachineRegisterInfo &MRI,
309256
const MachineInstr &MI) {
310257
unsigned Opcode = MI.getOpcode();
@@ -626,7 +573,7 @@ void SPIRVModuleAnalysis::processOtherInstrs(const Module &M) {
626573

627574
// Number registers in all functions globally from 0 onwards and store
628575
// the result in global register alias table. Some registers are already
629-
// numbered in collectGlobalEntities.
576+
// numbered.
630577
void SPIRVModuleAnalysis::numberRegistersGlobally(const Module &M) {
631578
for (auto F = M.begin(), E = M.end(); F != E; ++F) {
632579
if ((*F).isDeclaration())
@@ -1996,7 +1943,6 @@ bool SPIRVModuleAnalysis::runOnModule(Module &M) {
19961943

19971944
// Process type/const/global var/func decl instructions, number their
19981945
// destination registers from 0 to N, collect Extensions and Capabilities.
1999-
//processDefInstrs(M);
20001946
collectDeclarations(M);
20011947

20021948
// Number rest of registers from N+1 onwards.

llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ struct SPIRVModuleAnalysis : public ModulePass {
220220

221221
private:
222222
void setBaseInfo(const Module &M);
223-
void collectGlobalEntities(
224-
const std::vector<SPIRV::DTSortableEntry *> &DepsGraph,
225-
SPIRV::ModuleSectionType MSType,
226-
std::function<bool(const SPIRV::DTSortableEntry *)> Pred,
227-
bool UsePreOrder);
228223
void collectFuncNames(MachineInstr &MI, const Function *F);
229224
void processOtherInstrs(const Module &M);
230225
void numberRegistersGlobally(const Module &M);

0 commit comments

Comments
 (0)