From: Philip Reames Date: Wed, 3 Jun 2020 22:21:11 +0000 (-0700) Subject: [Statepoints][CGP] Minor parameter type cleanup X-Git-Tag: llvmorg-12-init~4210 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=382b3023cbbcffc07c7de73441d6b86f02486099;p=platform%2Fupstream%2Fllvm.git [Statepoints][CGP] Minor parameter type cleanup --- diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index d28da4e..345b3d7 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -413,7 +413,7 @@ class TypePromotionTransaction; bool HasPromoted, TypePromotionTransaction &TPT, SmallVectorImpl &SpeculativelyMovedExts); bool splitBranchCondition(Function &F, bool &ModifiedDT); - bool simplifyOffsetableRelocate(Instruction &I); + bool simplifyOffsetableRelocate(GCStatepointInst &I); bool tryToSinkFreeOperands(Instruction *I); bool replaceMathCmpWithIntrinsic(BinaryOperator *BO, Value *Arg0, @@ -573,11 +573,11 @@ bool CodeGenPrepare::runOnFunction(Function &F) { } if (!DisableGCOpts) { - SmallVector Statepoints; + SmallVector Statepoints; for (BasicBlock &BB : F) for (Instruction &I : BB) - if (isa(I)) - Statepoints.push_back(&I); + if (auto *SP = dyn_cast(&I)) + Statepoints.push_back(SP); for (auto &I : Statepoints) EverMadeChange |= simplifyOffsetableRelocate(*I); } @@ -1087,10 +1087,9 @@ simplifyRelocatesOffABase(GCRelocateInst *RelocatedBase, // %base' = gc.relocate(%tok, i32 4, i32 4) // %ptr' = gep %base' + 15 // %val = load %ptr' -bool CodeGenPrepare::simplifyOffsetableRelocate(Instruction &I) { +bool CodeGenPrepare::simplifyOffsetableRelocate(GCStatepointInst &I) { bool MadeChange = false; SmallVector AllRelocateCalls; - for (auto *U : I.users()) if (GCRelocateInst *Relocate = dyn_cast(U)) // Collect all the relocate calls associated with a statepoint