Lines Matching refs:BC

44   BinaryContext &BC = Function.getBinaryContext();  in checkOpportunities()  local
64 BC.MIB->matchIndJmp(BC.MIB->matchAnyOperand(), in checkOpportunities()
65 BC.MIB->matchImm(Scale), BC.MIB->matchReg(), in checkOpportunities()
66 BC.MIB->matchAnyOperand()); in checkOpportunities()
68 IndJmpMatcher->match(*BC.MRI, *BC.MIB, in checkOpportunities()
91 BC.MIB->matchIndJmp(BC.MIB->matchAdd( in checkOpportunities()
92 BC.MIB->matchReg(BaseReg1), in checkOpportunities()
93 BC.MIB->matchLoad(BC.MIB->matchReg(BaseReg2), in checkOpportunities()
94 BC.MIB->matchImm(Scale), BC.MIB->matchReg(), in checkOpportunities()
95 BC.MIB->matchImm(Offset)))); in checkOpportunities()
97 BC.MIB->matchIndJmp( in checkOpportunities()
98 BC.MIB->matchAdd(BC.MIB->matchLoadAddr(BC.MIB->matchSymbol()), in checkOpportunities()
99 BC.MIB->matchAnyOperand())); in checkOpportunities()
101 *BC.MRI, *BC.MIB, in checkOpportunities()
105 *BC.MRI, *BC.MIB, in checkOpportunities()
131 BinaryContext &BC, BinaryBasicBlock &BB, BinaryBasicBlock::iterator Inst, in tryOptimizeNonPIC() argument
141 BC.MIB->matchIndJmp(BC.MIB->matchAnyOperand(Base), in tryOptimizeNonPIC()
142 BC.MIB->matchImm(Scale), BC.MIB->matchReg(Index), in tryOptimizeNonPIC()
143 BC.MIB->matchAnyOperand(Offset)); in tryOptimizeNonPIC()
144 if (!IndJmpMatcher->match(*BC.MRI, *BC.MIB, in tryOptimizeNonPIC()
152 IndJmpMatcher->annotate(*BC.MIB, "DeleteMe"); in tryOptimizeNonPIC()
160 BC.MIB->createIJmp32Frag(NewFrag, Base, MCOperand::createImm(Scale), in tryOptimizeNonPIC()
162 BC.MIB->setJumpTable(NewFrag.back(), JTAddr, Index); in tryOptimizeNonPIC()
170 bool JTFootprintReduction::tryOptimizePIC(BinaryContext &BC, in tryOptimizePIC() argument
181 BC.MIB->matchIndJmp(BC.MIB->matchAdd( in tryOptimizePIC()
182 BC.MIB->matchLoadAddr(BC.MIB->matchAnyOperand(JumpTableRef)), in tryOptimizePIC()
183 BC.MIB->matchLoad(BC.MIB->matchReg(BaseReg), BC.MIB->matchImm(Scale), in tryOptimizePIC()
184 BC.MIB->matchReg(Index), in tryOptimizePIC()
185 BC.MIB->matchAnyOperand()))); in tryOptimizePIC()
187 *BC.MRI, *BC.MIB, MutableArrayRef<MCInst>(&*BB.begin(), &*Inst + 1), in tryOptimizePIC()
193 PICIndJmpMatcher->annotate(*BC.MIB, "DeleteMe"); in tryOptimizePIC()
198 BC.MIB->createIJmp32Frag(NewFrag, MCOperand::createReg(0), in tryOptimizePIC()
201 BC.MIB->setJumpTable(NewFrag.back(), JTAddr, Index); in tryOptimizePIC()
213 BinaryContext &BC = Function.getBinaryContext(); in optimizeFunction() local
220 const uint64_t JTAddr = BC.MIB->getJumpTable(*IndJmp); in optimizeFunction()
229 if (tryOptimizeNonPIC(BC, BB, IndJmp, JTAddr, JumpTable, Info) || in optimizeFunction()
230 tryOptimizePIC(BC, BB, IndJmp, JTAddr, JumpTable, Info)) { in optimizeFunction()
243 if (BC.MIB->hasAnnotation(*I, "DeleteMe")) in optimizeFunction()
249 void JTFootprintReduction::runOnFunctions(BinaryContext &BC) { in runOnFunctions() argument
250 if (opts::JumpTables == JTS_BASIC && BC.HasRelocations) in runOnFunctions()
256 CG.reset(new BinaryFunctionCallGraph(buildCallGraph(BC))); in runOnFunctions()
257 RA.reset(new RegAnalysis(BC, &BC.getBinaryFunctions(), &*CG)); in runOnFunctions()
259 for (auto &BFIt : BC.getBinaryFunctions()) { in runOnFunctions()