Lines Matching +full:ri +full:- +full:override
1 //===-- GCRootLowering.cpp - Garbage collection infrastructure ------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
35 /// frontend, but the old API made this non-obvious, so we do a potentially
41 /// LowerIntrinsics - This pass rewrites calls to the llvm.gcread or
50 StringRef getPassName() const override;
51 void getAnalysisUsage(AnalysisUsage &AU) const override;
53 bool doInitialization(Module &M) override;
54 bool runOnFunction(Function &F) override;
57 /// GCMachineCodeAnalysis - This is a target-independent pass over the machine
76 void getAnalysisUsage(AnalysisUsage &AU) const override;
78 bool runOnMachineFunction(MachineFunction &MF) override;
98 // -----------------------------------------------------------------------------
100 INITIALIZE_PASS_BEGIN(LowerIntrinsics, "gc-lowering", "GC Lowering", false,
103 INITIALIZE_PASS_END(LowerIntrinsics, "gc-lowering", "GC Lowering", false, false) in INITIALIZE_PASS_DEPENDENCY()
124 /// doInitialization - If this module uses the GC intrinsics, find them now.
130 MI->getFunctionInfo(F); // Instantiate the GC strategy. in doInitialization()
135 /// CouldBecomeSafePoint - Predicate to conservatively determine whether the
141 // - call, invoke (AfterCall, BeforeCall) in CouldBecomeSafePoint()
142 // - phis (Loops) in CouldBecomeSafePoint()
143 // - invoke, ret, unwind (Exit) in CouldBecomeSafePoint()
146 // libcalls upon lowering (e.g., div i64 on a 32-bit platform), so instead in CouldBecomeSafePoint()
155 if (Function *F = CI->getCalledFunction()) in CouldBecomeSafePoint()
156 if (Intrinsic::ID IID = F->getIntrinsicID()) in CouldBecomeSafePoint()
174 dyn_cast<AllocaInst>(SI->getOperand(1)->stripPointerCasts())) in InsertRootInitializers()
183 ConstantPointerNull::get(cast<PointerType>(Root->getAllocatedType())), in InsertRootInitializers()
184 Root, std::next(Root->getIterator())); in InsertRootInitializers()
191 /// runOnFunction - Replace gcread/gcwrite intrinsics with loads and stores.
214 Function *F = CI->getCalledFunction(); in DoLowering()
215 switch (F->getIntrinsicID()) { in DoLowering()
219 Value *St = new StoreInst(CI->getArgOperand(0), CI->getArgOperand(2), in DoLowering()
220 CI->getIterator()); in DoLowering()
221 CI->replaceAllUsesWith(St); in DoLowering()
222 CI->eraseFromParent(); in DoLowering()
228 Value *Ld = new LoadInst(CI->getType(), CI->getArgOperand(1), "", in DoLowering()
229 CI->getIterator()); in DoLowering()
230 Ld->takeName(CI); in DoLowering()
231 CI->replaceAllUsesWith(Ld); in DoLowering()
232 CI->eraseFromParent(); in DoLowering()
240 cast<AllocaInst>(CI->getArgOperand(0)->stripPointerCasts())); in DoLowering()
252 // -----------------------------------------------------------------------------
257 INITIALIZE_PASS(GCMachineCodeAnalysis, "gc-analysis",
271 MCSymbol *Label = MBB.getParent()->getContext().createTempSymbol(); in InsertLabel()
272 BuildMI(MBB, MI, DL, TII->get(TargetOpcode::GC_LABEL)).addSym(Label); in InsertLabel()
282 MCSymbol *Label = InsertLabel(*CI->getParent(), RAI, CI->getDebugLoc()); in VisitCallPoint()
283 FI->addSafePoint(Label, CI->getDebugLoc()); in VisitCallPoint()
304 for (GCFunctionInfo::roots_iterator RI = FI->roots_begin(); in FindStackOffsets() local
305 RI != FI->roots_end();) { in FindStackOffsets()
307 if (MF.getFrameInfo().isDeadObjectIndex(RI->Num)) { in FindStackOffsets()
308 RI = FI->removeStackRoot(RI); in FindStackOffsets()
312 auto FrameOffset = TFI->getFrameIndexReference(MF, RI->Num, FrameReg); in FindStackOffsets()
315 RI->StackOffset = FrameOffset.getFixed(); in FindStackOffsets()
316 ++RI; in FindStackOffsets()
334 MFI.hasVarSizedObjects() || RegInfo->hasStackRealignment(MF); in runOnMachineFunction()
335 FI->setFrameSize(DynamicFrameSize ? UINT64_MAX : MFI.getStackSize()); in runOnMachineFunction()
338 if (FI->getStrategy().needsSafePoints()) in runOnMachineFunction()