From 3a0822f094b578157263e04114075ad7df81db41 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 21 Jun 2015 13:59:01 +0000 Subject: Vendor import of llvm trunk r240225: https://llvm.org/svn/llvm-project/llvm/trunk@240225 --- .../llvm/Transforms/Utils/ASanStackFrameLayout.h | 2 +- include/llvm/Transforms/Utils/BasicBlockUtils.h | 2 +- include/llvm/Transforms/Utils/BuildLibCalls.h | 2 +- include/llvm/Transforms/Utils/Cloning.h | 2 +- include/llvm/Transforms/Utils/CodeExtractor.h | 2 +- include/llvm/Transforms/Utils/CtorUtils.h | 2 +- include/llvm/Transforms/Utils/GlobalStatus.h | 2 +- include/llvm/Transforms/Utils/IntegerDivision.h | 2 +- include/llvm/Transforms/Utils/Local.h | 2 +- include/llvm/Transforms/Utils/LoopUtils.h | 154 +++++++++++---------- include/llvm/Transforms/Utils/ModuleUtils.h | 2 +- include/llvm/Transforms/Utils/PromoteMemToReg.h | 2 +- include/llvm/Transforms/Utils/SSAUpdater.h | 2 +- include/llvm/Transforms/Utils/SSAUpdaterImpl.h | 2 +- include/llvm/Transforms/Utils/SimplifyLibCalls.h | 2 +- include/llvm/Transforms/Utils/SymbolRewriter.h | 4 +- .../llvm/Transforms/Utils/UnifyFunctionExitNodes.h | 2 +- include/llvm/Transforms/Utils/UnrollLoop.h | 2 +- include/llvm/Transforms/Utils/ValueMapper.h | 2 +- include/llvm/Transforms/Utils/VectorUtils.h | 2 +- 20 files changed, 101 insertions(+), 93 deletions(-) (limited to 'include/llvm/Transforms/Utils') diff --git a/include/llvm/Transforms/Utils/ASanStackFrameLayout.h b/include/llvm/Transforms/Utils/ASanStackFrameLayout.h index 4e4f02c84ece..7f6a264b29de 100644 --- a/include/llvm/Transforms/Utils/ASanStackFrameLayout.h +++ b/include/llvm/Transforms/Utils/ASanStackFrameLayout.h @@ -59,6 +59,6 @@ void ComputeASanStackFrameLayout( // The result is put here. ASanStackFrameLayout *Layout); -} // llvm namespace +} // namespace llvm #endif // LLVM_TRANSFORMS_UTILS_ASANSTACKFRAMELAYOUT_H diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 710db03c45d6..3004f9eba5ae 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -308,6 +308,6 @@ void SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore, /// entered if the condition is false. Value *GetIfCondition(BasicBlock *BB, BasicBlock *&IfTrue, BasicBlock *&IfFalse); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/BuildLibCalls.h b/include/llvm/Transforms/Utils/BuildLibCalls.h index 879f295caf0c..508122949b6b 100644 --- a/include/llvm/Transforms/Utils/BuildLibCalls.h +++ b/include/llvm/Transforms/Utils/BuildLibCalls.h @@ -111,6 +111,6 @@ namespace llvm { /// a pointer, Size is an 'intptr_t', and File is a pointer to FILE. Value *EmitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI); -} +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/Cloning.h b/include/llvm/Transforms/Utils/Cloning.h index cb187ec103d0..9ba6bea499f6 100644 --- a/include/llvm/Transforms/Utils/Cloning.h +++ b/include/llvm/Transforms/Utils/Cloning.h @@ -233,6 +233,6 @@ bool InlineFunction(InvokeInst *II, InlineFunctionInfo &IFI, bool InlineFunction(CallSite CS, InlineFunctionInfo &IFI, bool InsertLifetime = true); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/CodeExtractor.h b/include/llvm/Transforms/Utils/CodeExtractor.h index 3a96d955cac2..c3c2f3e793ac 100644 --- a/include/llvm/Transforms/Utils/CodeExtractor.h +++ b/include/llvm/Transforms/Utils/CodeExtractor.h @@ -121,6 +121,6 @@ namespace llvm { ValueSet &inputs, ValueSet &outputs); }; -} +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/CtorUtils.h b/include/llvm/Transforms/Utils/CtorUtils.h index 63e564dcb87a..1213324af19f 100644 --- a/include/llvm/Transforms/Utils/CtorUtils.h +++ b/include/llvm/Transforms/Utils/CtorUtils.h @@ -27,6 +27,6 @@ class Module; bool optimizeGlobalCtorsList(Module &M, function_ref ShouldRemove); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/GlobalStatus.h b/include/llvm/Transforms/Utils/GlobalStatus.h index c36609508808..658449c9fab1 100644 --- a/include/llvm/Transforms/Utils/GlobalStatus.h +++ b/include/llvm/Transforms/Utils/GlobalStatus.h @@ -77,6 +77,6 @@ struct GlobalStatus { GlobalStatus(); }; -} +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/IntegerDivision.h b/include/llvm/Transforms/Utils/IntegerDivision.h index 0ec3321b9cf8..5ba6685fdc69 100644 --- a/include/llvm/Transforms/Utils/IntegerDivision.h +++ b/include/llvm/Transforms/Utils/IntegerDivision.h @@ -68,6 +68,6 @@ namespace llvm { /// @brief Replace Rem with generated code. bool expandDivisionUpTo64Bits(BinaryOperator *Div); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index a1bb367ac7b6..1063f5fa9f07 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -291,6 +291,6 @@ void combineMetadata(Instruction *K, const Instruction *J, ArrayRef Kn /// the given edge. Returns the number of replacements made. unsigned replaceDominatedUsesWith(Value *From, Value *To, DominatorTree &DT, const BasicBlockEdge &Edge); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/LoopUtils.h b/include/llvm/Transforms/Utils/LoopUtils.h index 28791f5f43a8..3aa40cfaa25a 100644 --- a/include/llvm/Transforms/Utils/LoopUtils.h +++ b/include/llvm/Transforms/Utils/LoopUtils.h @@ -43,12 +43,37 @@ struct LICMSafetyInfo { {} }; -/// This POD struct holds information about a potential reduction operation. -class ReductionInstDesc { +/// The RecurrenceDescriptor is used to identify recurrences variables in a +/// loop. Reduction is a special case of recurrence that has uses of the +/// recurrence variable outside the loop. The method isReductionPHI identifies +/// reductions that are basic recurrences. +/// +/// Basic recurrences are defined as the summation, product, OR, AND, XOR, min, +/// or max of a set of terms. For example: for(i=0; i &Builder, - ReductionInstDesc::MinMaxReductionKind RK, + /// Returns a Min/Max operation corresponding to MinMaxRecurrenceKind. + static Value *createMinMaxOp(IRBuilder<> &Builder, MinMaxRecurrenceKind RK, Value *Left, Value *Right); /// Returns true if Phi is a reduction of type Kind and adds it to the - /// ReductionDescriptor. - static bool AddReductionVar(PHINode *Phi, ReductionKind Kind, Loop *TheLoop, + /// RecurrenceDescriptor. + static bool AddReductionVar(PHINode *Phi, RecurrenceKind Kind, Loop *TheLoop, bool HasFunNoNaNAttr, - ReductionDescriptor &RedDes); + RecurrenceDescriptor &RedDes); - /// Returns true if Phi is a reduction in TheLoop. The ReductionDescriptor is + /// Returns true if Phi is a reduction in TheLoop. The RecurrenceDescriptor is /// returned in RedDes. static bool isReductionPHI(PHINode *Phi, Loop *TheLoop, - ReductionDescriptor &RedDes); + RecurrenceDescriptor &RedDes); - ReductionKind getReductionKind() { return Kind; } + RecurrenceKind getRecurrenceKind() { return Kind; } - ReductionInstDesc::MinMaxReductionKind getMinMaxReductionKind() { - return MinMaxKind; - } + MinMaxRecurrenceKind getMinMaxRecurrenceKind() { return MinMaxKind; } - TrackingVH getReductionStartValue() { return StartValue; } + TrackingVH getRecurrenceStartValue() { return StartValue; } Instruction *getLoopExitInstr() { return LoopExitInstr; } private: - // The starting value of the reduction. + // The starting value of the recurrence. // It does not have to be zero! TrackingVH StartValue; // The instruction who's value is used outside the loop. Instruction *LoopExitInstr; - // The kind of the reduction. - ReductionKind Kind; - // If this a min/max reduction the kind of reduction. - ReductionInstDesc::MinMaxReductionKind MinMaxKind; + // The kind of the recurrence. + RecurrenceKind Kind; + // If this a min/max recurrence the kind of recurrence. + MinMaxRecurrenceKind MinMaxKind; }; BasicBlock *InsertPreheaderForLoop(Loop *L, Pass *P); @@ -255,6 +263,6 @@ void computeLICMSafetyInfo(LICMSafetyInfo *, Loop *); /// variable. Returns true if this is an induction PHI along with the step /// value. bool isInductionPHI(PHINode *, ScalarEvolution *, ConstantInt *&); -} +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/ModuleUtils.h b/include/llvm/Transforms/Utils/ModuleUtils.h index 622265bae143..120d14ab87bb 100644 --- a/include/llvm/Transforms/Utils/ModuleUtils.h +++ b/include/llvm/Transforms/Utils/ModuleUtils.h @@ -57,6 +57,6 @@ Function *checkSanitizerInterfaceFunction(Constant *FuncOrBitcast); std::pair createSanitizerCtorAndInitFunctions( Module &M, StringRef CtorName, StringRef InitName, ArrayRef InitArgTypes, ArrayRef InitArgs); -} // End llvm namespace +} // namespace llvm #endif // LLVM_TRANSFORMS_UTILS_MODULEUTILS_H diff --git a/include/llvm/Transforms/Utils/PromoteMemToReg.h b/include/llvm/Transforms/Utils/PromoteMemToReg.h index d0602bf47c92..6c3d2ea9b439 100644 --- a/include/llvm/Transforms/Utils/PromoteMemToReg.h +++ b/include/llvm/Transforms/Utils/PromoteMemToReg.h @@ -45,6 +45,6 @@ void PromoteMemToReg(ArrayRef Allocas, DominatorTree &DT, AliasSetTracker *AST = nullptr, AssumptionCache *AC = nullptr); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/SSAUpdater.h b/include/llvm/Transforms/Utils/SSAUpdater.h index 1c7b2c587a36..5179d587176f 100644 --- a/include/llvm/Transforms/Utils/SSAUpdater.h +++ b/include/llvm/Transforms/Utils/SSAUpdater.h @@ -173,6 +173,6 @@ public: } }; -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/SSAUpdaterImpl.h b/include/llvm/Transforms/Utils/SSAUpdaterImpl.h index ed0841c46c27..1b9cb48a83c6 100644 --- a/include/llvm/Transforms/Utils/SSAUpdaterImpl.h +++ b/include/llvm/Transforms/Utils/SSAUpdaterImpl.h @@ -455,6 +455,6 @@ public: #undef DEBUG_TYPE // "ssaupdater" -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/SimplifyLibCalls.h b/include/llvm/Transforms/Utils/SimplifyLibCalls.h index 41159603aae5..d7c8338bafb5 100644 --- a/include/llvm/Transforms/Utils/SimplifyLibCalls.h +++ b/include/llvm/Transforms/Utils/SimplifyLibCalls.h @@ -166,6 +166,6 @@ private: /// function by checking for an existing function with name FuncName + f bool hasFloatVersion(StringRef FuncName); }; -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/SymbolRewriter.h b/include/llvm/Transforms/Utils/SymbolRewriter.h index 5ccee98f97e7..d79835857873 100644 --- a/include/llvm/Transforms/Utils/SymbolRewriter.h +++ b/include/llvm/Transforms/Utils/SymbolRewriter.h @@ -108,7 +108,7 @@ private: yaml::MappingNode *V, RewriteDescriptorList *DL); }; -} +} // namespace SymbolRewriter template <> struct ilist_traits @@ -147,6 +147,6 @@ public: ModulePass *createRewriteSymbolsPass(); ModulePass *createRewriteSymbolsPass(SymbolRewriter::RewriteDescriptorList &); -} +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h index 550292f6b7a3..b19c6fab70e5 100644 --- a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -47,6 +47,6 @@ public: Pass *createUnifyFunctionExitNodesPass(); -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/UnrollLoop.h b/include/llvm/Transforms/Utils/UnrollLoop.h index 7f2cf8d7f59e..ba5866876e7a 100644 --- a/include/llvm/Transforms/Utils/UnrollLoop.h +++ b/include/llvm/Transforms/Utils/UnrollLoop.h @@ -37,6 +37,6 @@ bool UnrollRuntimeLoopProlog(Loop *L, unsigned Count, LPPassManager *LPM); MDNode *GetUnrollMetadata(MDNode *LoopID, StringRef Name); -} +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/ValueMapper.h b/include/llvm/Transforms/Utils/ValueMapper.h index 047ab818711b..737ad4f7ed80 100644 --- a/include/llvm/Transforms/Utils/ValueMapper.h +++ b/include/llvm/Transforms/Utils/ValueMapper.h @@ -96,6 +96,6 @@ namespace llvm { Materializer)); } -} // End llvm namespace +} // namespace llvm #endif diff --git a/include/llvm/Transforms/Utils/VectorUtils.h b/include/llvm/Transforms/Utils/VectorUtils.h index 9f0fb19d667a..6a35247950d3 100644 --- a/include/llvm/Transforms/Utils/VectorUtils.h +++ b/include/llvm/Transforms/Utils/VectorUtils.h @@ -200,6 +200,6 @@ getIntrinsicIDForCall(CallInst *CI, const TargetLibraryInfo *TLI) { return Intrinsic::not_intrinsic; } -} // llvm namespace +} // namespace llvm #endif -- cgit v1.3