diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2015-05-25 01:43:23 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2015-05-25 01:43:23 +0000 |
commit | fb3bd7127a768a7ce39ade409e80896a96e1d340 (patch) | |
tree | 64bc2500bd080912507008af8d224f6c67495fd0 /llvm/lib/Transforms | |
parent | 04cc665cef4393222a6e7cd828342f9e6283164c (diff) | |
download | bcm5719-llvm-fb3bd7127a768a7ce39ade409e80896a96e1d340.tar.gz bcm5719-llvm-fb3bd7127a768a7ce39ade409e80896a96e1d340.zip |
Prune CRLFs.
llvm-svn: 238125
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 28 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 18 |
2 files changed, 23 insertions, 23 deletions
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp index 9e7a4d8febc..bebd98a6b06 100644 --- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -16,7 +16,7 @@ // return PC of the call. A runtime can determine where values listed in the // deopt arguments and (after RewriteStatepointsForGC) gc arguments are located // on the stack when the code is suspended inside such a call. Every parse -// point is represented by a call wrapped in an gc.statepoint intrinsic. +// point is represented by a call wrapped in an gc.statepoint intrinsic. // - A "poll" is an explicit check in the generated code to determine if the // runtime needs the generated code to cooperate by calling a helper routine // and thus suspending its execution at a known state. The call to the helper @@ -127,7 +127,7 @@ struct PlaceBackedgeSafepointsImpl : public FunctionPass { ScalarEvolution *SE = nullptr; DominatorTree *DT = nullptr; LoopInfo *LI = nullptr; - + PlaceBackedgeSafepointsImpl(bool CallSafepoints = false) : FunctionPass(ID), CallSafepointsEnabled(CallSafepoints) { initializePlaceBackedgeSafepointsImplPass(*PassRegistry::getPassRegistry()); @@ -150,7 +150,7 @@ struct PlaceBackedgeSafepointsImpl : public FunctionPass { } return false; } - + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired<DominatorTreeWrapperPass>(); AU.addRequired<ScalarEvolution>(); @@ -186,7 +186,7 @@ struct PlaceSafepoints : public FunctionPass { // Insert a safepoint poll immediately before the given instruction. Does // not handle the parsability of state at the runtime call, that's the // callers job. -static void +static void InsertSafepointPoll(Instruction *after, std::vector<CallSite> &ParsePointsNeeded /*rval*/); @@ -329,7 +329,7 @@ static void scanInlinedCode(Instruction *start, Instruction *end, bool PlaceBackedgeSafepointsImpl::runOnLoop(Loop *L) { // Loop through all loop latches (branches controlling backedges). We need - // to place a safepoint on every backedge (potentially). + // to place a safepoint on every backedge (potentially). // Note: In common usage, there will be only one edge due to LoopSimplify // having run sometime earlier in the pipeline, but this code must be correct // w.r.t. loops with multiple backedges. @@ -383,7 +383,7 @@ bool PlaceBackedgeSafepointsImpl::runOnLoop(Loop *L) { } /// Returns true if an entry safepoint is not required before this callsite in -/// the caller function. +/// the caller function. static bool doesNotRequireEntrySafepointBefore(const CallSite &CS) { Instruction *Inst = CS.getInstruction(); if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) { @@ -520,14 +520,14 @@ static bool isGCSafepointPoll(Function &F) { /// Returns true if this function should be rewritten to include safepoint /// polls and parseable call sites. The main point of this function is to be -/// an extension point for custom logic. +/// an extension point for custom logic. static bool shouldRewriteFunction(Function &F) { // TODO: This should check the GCStrategy if (F.hasGC()) { - const char *FunctionGCName = F.getGC();
- const StringRef StatepointExampleName("statepoint-example");
- const StringRef CoreCLRName("coreclr");
- return (StatepointExampleName == FunctionGCName) ||
+ const char *FunctionGCName = F.getGC(); + const StringRef StatepointExampleName("statepoint-example"); + const StringRef CoreCLRName("coreclr"); + return (StatepointExampleName == FunctionGCName) || (CoreCLRName == FunctionGCName); } else return false; @@ -567,7 +567,7 @@ bool PlaceSafepoints::runOnFunction(Function &F) { if (isGCSafepointPoll(F)) { // Given we're inlining this inside of safepoint poll insertion, this // doesn't make any sense. Note that we do make any contained calls - // parseable after we inline a poll. + // parseable after we inline a poll. return false; } @@ -629,7 +629,7 @@ bool PlaceSafepoints::runOnFunction(Function &F) { for (TerminatorInst *Term : PollLocations) { // We are inserting a poll, the function is modified modified = true; - + if (SplitBackedge) { // Split the backedge of the loop and insert the poll within that new // basic block. This creates a loop with two latches per original @@ -690,7 +690,7 @@ bool PlaceSafepoints::runOnFunction(Function &F) { // The dominator tree has been invalidated by the inlining performed in the // above loop. TODO: Teach the inliner how to update the dom tree? DT.recalculate(F); - + if (enableCallSafepoints(F)) { std::vector<CallSite> Calls; findCallSafepoints(F, Calls); diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 1f1e745439f..83bf415f31d 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -307,18 +307,18 @@ static Value *findBaseOfVector(Value *I, Value *Index) { // For an insert element, we might be able to look through it if we know // something about the indexes, but if the indices are arbitrary values, we - // can't without much more extensive scalarization. + // can't without much more extensive scalarization. if (InsertElementInst *IEI = dyn_cast<InsertElementInst>(I)) { Value *InsertIndex = IEI->getOperand(2); // This index is inserting the value, look for it's base if (InsertIndex == Index) return findBaseDefiningValue(IEI->getOperand(1)); // Both constant, and can't be equal per above. This insert is definitely - // not relevant, look back at the rest of the vector and keep trying. + // not relevant, look back at the rest of the vector and keep trying. if (isa<ConstantInt>(Index) && isa<ConstantInt>(InsertIndex)) return findBaseOfVector(IEI->getOperand(0), Index); } - + // Note: This code is currently rather incomplete. We are essentially only // handling cases where the vector element is trivially a base pointer. We // need to update the entire base pointer construction algorithm to know how @@ -1878,7 +1878,7 @@ static void rematerializeLiveValues(CallSite CS, PartiallyConstructedSafepointRecord &Info, TargetTransformInfo &TTI) { const unsigned int ChainLengthThreshold = 10; - + // Record values we are going to delete from this statepoint live set. // We can not di this in following loop due to iterator invalidation. SmallVector<Value *, 32> LiveValuesToBeDeleted; @@ -2133,7 +2133,7 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P, TargetTransformInfo &TTI = P->getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F); - for (size_t i = 0; i < records.size(); i++) { + for (size_t i = 0; i < records.size(); i++) { struct PartiallyConstructedSafepointRecord &info = records[i]; CallSite &CS = toUpdate[i]; @@ -2202,10 +2202,10 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P, static bool shouldRewriteStatepointsIn(Function &F) { // TODO: This should check the GCStrategy if (F.hasGC()) { - const char *FunctionGCName = F.getGC();
- const StringRef StatepointExampleName("statepoint-example");
- const StringRef CoreCLRName("coreclr");
- return (StatepointExampleName == FunctionGCName) ||
+ const char *FunctionGCName = F.getGC(); + const StringRef StatepointExampleName("statepoint-example"); + const StringRef CoreCLRName("coreclr"); + return (StatepointExampleName == FunctionGCName) || (CoreCLRName == FunctionGCName); } else |