diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp index 4553b23532f2..a110f7d5c241 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -243,7 +243,7 @@ static bool mustBeFiniteCountedLoop(Loop *L, ScalarEvolution *SE, BasicBlock *Pred) { // A conservative bound on the loop as a whole. const SCEV *MaxTrips = SE->getConstantMaxBackedgeTakenCount(L); - if (MaxTrips != SE->getCouldNotCompute() && + if (!isa<SCEVCouldNotCompute>(MaxTrips) && SE->getUnsignedRange(MaxTrips).getUnsignedMax().isIntN( CountedLoopTripWidth)) return true; @@ -255,7 +255,7 @@ static bool mustBeFiniteCountedLoop(Loop *L, ScalarEvolution *SE, // This returns an exact expression only. TODO: We really only need an // upper bound here, but SE doesn't expose that. const SCEV *MaxExec = SE->getExitCount(L, Pred); - if (MaxExec != SE->getCouldNotCompute() && + if (!isa<SCEVCouldNotCompute>(MaxExec) && SE->getUnsignedRange(MaxExec).getUnsignedMax().isIntN( CountedLoopTripWidth)) return true; @@ -435,7 +435,7 @@ static Instruction *findLocationForEntrySafepoint(Function &F, return Cursor; } -static const char *const GCSafepointPollName = "gc.safepoint_poll"; +const char GCSafepointPollName[] = "gc.safepoint_poll"; static bool isGCSafepointPoll(Function &F) { return F.getName().equals(GCSafepointPollName); @@ -589,8 +589,7 @@ bool PlaceSafepoints::runOnFunction(Function &F) { for (Instruction *PollLocation : PollsNeeded) { std::vector<CallBase *> RuntimeCalls; InsertSafepointPoll(PollLocation, RuntimeCalls, TLI); - ParsePointNeeded.insert(ParsePointNeeded.end(), RuntimeCalls.begin(), - RuntimeCalls.end()); + llvm::append_range(ParsePointNeeded, RuntimeCalls); } return Modified; |