[llvm] 382b302 - [Statepoints][CGP] Minor parameter type cleanup
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 3 16:00:50 PDT 2020
Author: Philip Reames
Date: 2020-06-03T16:00:38-07:00
New Revision: 382b3023cbbcffc07c7de73441d6b86f02486099
URL: https://github.com/llvm/llvm-project/commit/382b3023cbbcffc07c7de73441d6b86f02486099
DIFF: https://github.com/llvm/llvm-project/commit/382b3023cbbcffc07c7de73441d6b86f02486099.diff
LOG: [Statepoints][CGP] Minor parameter type cleanup
Added:
Modified:
llvm/lib/CodeGen/CodeGenPrepare.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index d28da4e326d6..345b3d77d53d 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -413,7 +413,7 @@ class TypePromotionTransaction;
bool HasPromoted, TypePromotionTransaction &TPT,
SmallVectorImpl<Instruction *> &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<Instruction *, 2> Statepoints;
+ SmallVector<GCStatepointInst *, 2> Statepoints;
for (BasicBlock &BB : F)
for (Instruction &I : BB)
- if (isa<GCStatepointInst>(I))
- Statepoints.push_back(&I);
+ if (auto *SP = dyn_cast<GCStatepointInst>(&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<GCRelocateInst *, 2> AllRelocateCalls;
-
for (auto *U : I.users())
if (GCRelocateInst *Relocate = dyn_cast<GCRelocateInst>(U))
// Collect all the relocate calls associated with a statepoint
More information about the llvm-commits
mailing list