From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/CodeGen/GCRootLowering.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'llvm/lib/CodeGen/GCRootLowering.cpp') diff --git a/llvm/lib/CodeGen/GCRootLowering.cpp b/llvm/lib/CodeGen/GCRootLowering.cpp index 90e5f32f53b3a..c6730aa6b00d8 100644 --- a/llvm/lib/CodeGen/GCRootLowering.cpp +++ b/llvm/lib/CodeGen/GCRootLowering.cpp @@ -57,7 +57,6 @@ public: /// GCMetadata record for each function. class GCMachineCodeAnalysis : public MachineFunctionPass { GCFunctionInfo *FI; - MachineModuleInfo *MMI; const TargetInstrInfo *TII; void FindSafePoints(MachineFunction &MF); @@ -160,10 +159,9 @@ static bool InsertRootInitializers(Function &F, ArrayRef Roots) { for (AllocaInst *Root : Roots) if (!InitedRoots.count(Root)) { - StoreInst *SI = new StoreInst( + new StoreInst( ConstantPointerNull::get(cast(Root->getAllocatedType())), - Root); - SI->insertAfter(Root); + Root, Root->getNextNode()); MadeChange = true; } @@ -189,12 +187,12 @@ bool LowerIntrinsics::runOnFunction(Function &F) { /// need to be able to ensure each root has been initialized by the point the /// first safepoint is reached. This really should have been done by the /// frontend, but the old API made this non-obvious, so we do a potentially -/// redundant store just in case. +/// redundant store just in case. bool LowerIntrinsics::DoLowering(Function &F, GCStrategy &S) { SmallVector Roots; bool MadeChange = false; - for (BasicBlock &BB : F) + for (BasicBlock &BB : F) for (BasicBlock::iterator II = BB.begin(), E = BB.end(); II != E;) { IntrinsicInst *CI = dyn_cast(II++); if (!CI) @@ -250,7 +248,6 @@ GCMachineCodeAnalysis::GCMachineCodeAnalysis() : MachineFunctionPass(ID) {} void GCMachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { MachineFunctionPass::getAnalysisUsage(AU); AU.setPreservesAll(); - AU.addRequired(); AU.addRequired(); } @@ -297,7 +294,7 @@ void GCMachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) { if (MF.getFrameInfo().isDeadObjectIndex(RI->Num)) { RI = FI->removeStackRoot(RI); } else { - unsigned FrameReg; // FIXME: surely GCRoot ought to store the + Register FrameReg; // FIXME: surely GCRoot ought to store the // register that the offset is from? RI->StackOffset = TFI->getFrameIndexReference(MF, RI->Num, FrameReg); ++RI; @@ -311,7 +308,6 @@ bool GCMachineCodeAnalysis::runOnMachineFunction(MachineFunction &MF) { return false; FI = &getAnalysis().getFunctionInfo(MF.getFunction()); - MMI = &getAnalysis().getMMI(); TII = MF.getSubtarget().getInstrInfo(); // Find the size of the stack frame. There may be no correct static frame -- cgit v1.2.3