Lines Matching refs:Fn
58 bool runOnFunction(Function &Fn) override;
88 bool TLSVariableHoistLegacyPass::runOnFunction(Function &Fn) {
89 if (skipFunction(Fn))
93 LLVM_DEBUG(dbgs() << "********** Function: " << Fn.getName() << '\n');
96 Impl.runImpl(Fn, getAnalysis<DominatorTreeWrapperPass>().getDomTree(),
101 << Fn.getName() << '\n');
102 LLVM_DEBUG(dbgs() << Fn);
125 void TLSVariableHoistPass::collectTLSCandidates(Function &Fn) {
127 Module *M = Fn.getParent();
139 for (BasicBlock &BB : Fn) {
192 BasicBlock::iterator TLSVariableHoistPass::findInsertPos(Function &Fn,
218 Instruction *TLSVariableHoistPass::genBitCastInst(Function &Fn,
220 BasicBlock *PosBB = &Fn.getEntryBlock();
221 BasicBlock::iterator Iter = findInsertPos(Fn, GV, PosBB);
228 bool TLSVariableHoistPass::tryReplaceTLSCandidate(Function &Fn,
238 auto *CastInst = genBitCastInst(Fn, GV);
247 bool TLSVariableHoistPass::tryReplaceTLSCandidates(Function &Fn) {
254 Replaced |= tryReplaceTLSCandidate(Fn, GV);
261 bool TLSVariableHoistPass::runImpl(Function &Fn, DominatorTree &DT,
263 if (Fn.hasOptNone())
266 if (!TLSLoadHoist && !Fn.getAttributes().hasFnAttr("tls-load-hoist"))
274 collectTLSCandidates(Fn);
276 bool MadeChange = tryReplaceTLSCandidates(Fn);