diff options
author | Eli Bendersky <eliben@chromium.org> | 2013-07-15 16:09:15 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2013-07-15 16:09:15 -0700 |
commit | c6cf05cb5108f356dde97c01ee4188b0671d4542 (patch) | |
tree | 436fdc2a55296d3c202e7ef11f31be3be53efb5f /include/llvm/Analysis | |
parent | c75199c649c739aade160289d93f257edc798cde (diff) | |
parent | 7dfcb84fc16b3bf6b2379713b53090757f0a45f9 (diff) |
Merge commit '7dfcb84fc16b3bf6b2379713b53090757f0a45f9'
Conflicts:
docs/LangRef.rst
include/llvm/CodeGen/CallingConvLower.h
include/llvm/IRReader/IRReader.h
include/llvm/Target/TargetMachine.h
lib/CodeGen/CallingConvLower.cpp
lib/IRReader/IRReader.cpp
lib/IRReader/LLVMBuild.txt
lib/IRReader/Makefile
lib/LLVMBuild.txt
lib/Makefile
lib/Support/MemoryBuffer.cpp
lib/Support/Unix/PathV2.inc
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/Mips/CMakeLists.txt
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrControl.td
lib/Target/X86/X86InstrFormats.td
lib/Transforms/IPO/ExtractGV.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/CodeGen/X86/fast-isel-divrem.ll
test/MC/ARM/data-in-code.ll
tools/Makefile
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/CMakeLists.txt
tools/opt/CMakeLists.txt
tools/opt/LLVMBuild.txt
tools/opt/Makefile
tools/opt/opt.cpp
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/AliasSetTracker.h | 1 | ||||
-rw-r--r-- | include/llvm/Analysis/BlockFrequencyImpl.h | 2 | ||||
-rw-r--r-- | include/llvm/Analysis/CaptureTracking.h | 9 | ||||
-rw-r--r-- | include/llvm/Analysis/DependenceAnalysis.h | 4 | ||||
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 15 | ||||
-rw-r--r-- | include/llvm/Analysis/IVUsers.h | 1 | ||||
-rw-r--r-- | include/llvm/Analysis/IntervalIterator.h | 2 | ||||
-rw-r--r-- | include/llvm/Analysis/LoopInfo.h | 12 | ||||
-rw-r--r-- | include/llvm/Analysis/MemoryBuiltins.h | 4 | ||||
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 7 | ||||
-rw-r--r-- | include/llvm/Analysis/Passes.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/RegionInfo.h | 18 | ||||
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 16 | ||||
-rw-r--r-- | include/llvm/Analysis/TargetTransformInfo.h | 27 |
14 files changed, 77 insertions, 44 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 163331c262..da007072e5 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -20,7 +20,6 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/ilist.h" #include "llvm/ADT/ilist_node.h" -#include "llvm/Support/CallSite.h" #include "llvm/Support/ValueHandle.h" #include <vector> diff --git a/include/llvm/Analysis/BlockFrequencyImpl.h b/include/llvm/Analysis/BlockFrequencyImpl.h index f220c58244..b3e2d18eb2 100644 --- a/include/llvm/Analysis/BlockFrequencyImpl.h +++ b/include/llvm/Analysis/BlockFrequencyImpl.h @@ -271,7 +271,7 @@ class BlockFrequencyImpl { BlockT *EntryBlock = fn->begin(); - copy(po_begin(EntryBlock), po_end(EntryBlock), back_inserter(POT)); + std::copy(po_begin(EntryBlock), po_end(EntryBlock), std::back_inserter(POT)); unsigned RPOidx = 0; for (rpot_iterator I = rpot_begin(), E = rpot_end(); I != E; ++I) { diff --git a/include/llvm/Analysis/CaptureTracking.h b/include/llvm/Analysis/CaptureTracking.h index 5e2a5ecd9f..8edabfe860 100644 --- a/include/llvm/Analysis/CaptureTracking.h +++ b/include/llvm/Analysis/CaptureTracking.h @@ -14,12 +14,11 @@ #ifndef LLVM_ANALYSIS_CAPTURETRACKING_H #define LLVM_ANALYSIS_CAPTURETRACKING_H -#include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/IR/Constants.h" -#include "llvm/IR/Instructions.h" -#include "llvm/Support/CallSite.h" - namespace llvm { + + class Value; + class Use; + /// PointerMayBeCaptured - Return true if this pointer value may be captured /// by the enclosing function (which is required to exist). This routine can /// be expensive, so consider caching the results. The boolean ReturnCaptures diff --git a/include/llvm/Analysis/DependenceAnalysis.h b/include/llvm/Analysis/DependenceAnalysis.h index d0ead39694..a78ac5919a 100644 --- a/include/llvm/Analysis/DependenceAnalysis.h +++ b/include/llvm/Analysis/DependenceAnalysis.h @@ -175,7 +175,7 @@ namespace llvm { /// FullDependence - This class represents a dependence between two memory /// references in a function. It contains detailed information about the - /// dependence (direction vectors, etc) and is used when the compiler is + /// dependence (direction vectors, etc.) and is used when the compiler is /// able to accurately analyze the interaction of the references; that is, /// it is not a confused dependence (see Dependence). In most cases /// (for output, flow, and anti dependences), the dependence implies an @@ -257,7 +257,7 @@ namespace llvm { Instruction *Dst, bool PossiblyLoopIndependent); - /// getSplitIteration - Give a dependence that's splitable at some + /// getSplitIteration - Give a dependence that's splittable at some /// particular level, return the iteration that should be used to split /// the loop. /// diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index d62a3ac670..81c04bb6b0 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -101,18 +101,18 @@ public: Children.clear(); } - bool compare(DomTreeNodeBase<NodeT> *Other) { + bool compare(const DomTreeNodeBase<NodeT> *Other) const { if (getNumChildren() != Other->getNumChildren()) return true; - SmallPtrSet<NodeT *, 4> OtherChildren; - for (iterator I = Other->begin(), E = Other->end(); I != E; ++I) { - NodeT *Nd = (*I)->getBlock(); + SmallPtrSet<const NodeT *, 4> OtherChildren; + for (const_iterator I = Other->begin(), E = Other->end(); I != E; ++I) { + const NodeT *Nd = (*I)->getBlock(); OtherChildren.insert(Nd); } - for (iterator I = begin(), E = end(); I != E; ++I) { - NodeT *N = (*I)->getBlock(); + for (const_iterator I = begin(), E = end(); I != E; ++I) { + const NodeT *N = (*I)->getBlock(); if (OtherChildren.count(N) == 0) return true; } @@ -663,8 +663,7 @@ public: // Initialize the roots list for (typename TraitsTy::nodes_iterator I = TraitsTy::nodes_begin(&F), E = TraitsTy::nodes_end(&F); I != E; ++I) { - if (std::distance(TraitsTy::child_begin(I), - TraitsTy::child_end(I)) == 0) + if (TraitsTy::child_begin(I) == TraitsTy::child_end(I)) addRoot(I); // Prepopulate maps so that we don't get iterator invalidation issues later. diff --git a/include/llvm/Analysis/IVUsers.h b/include/llvm/Analysis/IVUsers.h index 9b98013a16..c9828015be 100644 --- a/include/llvm/Analysis/IVUsers.h +++ b/include/llvm/Analysis/IVUsers.h @@ -24,7 +24,6 @@ namespace llvm { class DominatorTree; class Instruction; class Value; -class IVUsers; class ScalarEvolution; class SCEV; class IVUsers; diff --git a/include/llvm/Analysis/IntervalIterator.h b/include/llvm/Analysis/IntervalIterator.h index 333f289ee1..22067c4f3c 100644 --- a/include/llvm/Analysis/IntervalIterator.h +++ b/include/llvm/Analysis/IntervalIterator.h @@ -157,7 +157,7 @@ public: private: // ProcessInterval - This method is used during the construction of the // interval graph. It walks through the source graph, recursively creating - // an interval per invokation until the entire graph is covered. This uses + // an interval per invocation until the entire graph is covered. This uses // the ProcessNode method to add all of the nodes to the interval. // // This method is templated because it may operate on two different source diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index a20e065785..783e347522 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -36,7 +36,6 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Pass.h" -#include "llvm/Support/raw_ostream.h" #include <algorithm> namespace llvm { @@ -52,6 +51,7 @@ class DominatorTree; class LoopInfo; class Loop; class PHINode; +class raw_ostream; template<class N, class M> class LoopInfoBase; template<class N, class M> class LoopBase; @@ -147,10 +147,10 @@ public: /// block that is outside of the current loop. /// bool isLoopExiting(const BlockT *BB) const { - typedef GraphTraits<BlockT*> BlockTraits; + typedef GraphTraits<const BlockT*> BlockTraits; for (typename BlockTraits::ChildIteratorType SI = - BlockTraits::child_begin(const_cast<BlockT*>(BB)), - SE = BlockTraits::child_end(const_cast<BlockT*>(BB)); SI != SE; ++SI) { + BlockTraits::child_begin(BB), + SE = BlockTraits::child_end(BB); SI != SE; ++SI) { if (!contains(*SI)) return true; } @@ -165,8 +165,8 @@ public: typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; for (typename InvBlockTraits::ChildIteratorType I = - InvBlockTraits::child_begin(const_cast<BlockT*>(H)), - E = InvBlockTraits::child_end(const_cast<BlockT*>(H)); I != E; ++I) + InvBlockTraits::child_begin(H), + E = InvBlockTraits::child_end(H); I != E; ++I) if (contains(*I)) ++NumBackEdges; diff --git a/include/llvm/Analysis/MemoryBuiltins.h b/include/llvm/Analysis/MemoryBuiltins.h index f07658fbc6..488338302a 100644 --- a/include/llvm/Analysis/MemoryBuiltins.h +++ b/include/llvm/Analysis/MemoryBuiltins.h @@ -138,7 +138,9 @@ static inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) { // /// \brief Compute the size of the object pointed by Ptr. Returns true and the -/// object size in Size if successful, and false otherwise. +/// object size in Size if successful, and false otherwise. In this context, by +/// object we mean the region of memory starting at Ptr to the end of the +/// underlying object pointed to by Ptr. /// If RoundToAlign is true, then Size is rounded up to the aligment of allocas, /// byval arguments, and global variables. bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD, diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index b87f886c00..47afd1b77b 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -391,14 +391,17 @@ namespace llvm { /// getPointerDependencyFrom - Return the instruction on which a memory /// location depends. If isLoad is true, this routine ignores may-aliases /// with read-only operations. If isLoad is false, this routine ignores - /// may-aliases with reads from read-only locations. + /// may-aliases with reads from read-only locations. If possible, pass + /// the query instruction as well; this function may take advantage of + /// the metadata annotated to the query instruction to refine the result. /// /// Note that this is an uncached query, and thus may be inefficient. /// MemDepResult getPointerDependencyFrom(const AliasAnalysis::Location &Loc, bool isLoad, BasicBlock::iterator ScanIt, - BasicBlock *BB); + BasicBlock *BB, + Instruction *QueryInst = 0); /// getLoadLoadClobberFullWidthSize - This is a little bit of analysis that diff --git a/include/llvm/Analysis/Passes.h b/include/llvm/Analysis/Passes.h index 27726f49bc..ae117135db 100644 --- a/include/llvm/Analysis/Passes.h +++ b/include/llvm/Analysis/Passes.h @@ -198,9 +198,6 @@ namespace llvm { // analyze. FunctionPass *createInstCountPass(); - // print debug info intrinsics in human readable form - FunctionPass *createDbgInfoPrinterPass(); - //===--------------------------------------------------------------------===// // // createRegionInfoPass - This pass finds all single entry single exit regions diff --git a/include/llvm/Analysis/RegionInfo.h b/include/llvm/Analysis/RegionInfo.h index 69cc293811..e87319516c 100644 --- a/include/llvm/Analysis/RegionInfo.h +++ b/include/llvm/Analysis/RegionInfo.h @@ -266,6 +266,24 @@ public: /// @param BB The new exit basic block of the region. void replaceExit(BasicBlock *BB); + /// @brief Recursively replace the entry basic block of the region. + /// + /// This function replaces the entry basic block with a new basic block. It + /// also updates all child regions that have the same entry basic block as + /// this region. + /// + /// @param NewEntry The new entry basic block. + void replaceEntryRecursive(BasicBlock *NewEntry); + + /// @brief Recursively replace the exit basic block of the region. + /// + /// This function replaces the exit basic block with a new basic block. It + /// also updates all child regions that have the same exit basic block as + /// this region. + /// + /// @param NewExit The new exit basic block. + void replaceExitRecursive(BasicBlock *NewExit); + /// @brief Get the exit BasicBlock of the Region. /// @return The exit BasicBlock of the Region, NULL if this is the TopLevel /// Region. diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index f8f261fa19..349447fbbb 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -338,6 +338,10 @@ namespace llvm { /// getMax - Get the max backedge taken count for the loop. const SCEV *getMax(ScalarEvolution *SE) const; + /// Return true if any backedge taken count expressions refer to the given + /// subexpression. + bool hasOperand(const SCEV *S, ScalarEvolution *SE) const; + /// clear - Invalidate this result and free associated memory. void clear(); }; @@ -449,7 +453,8 @@ namespace llvm { ExitLimit ComputeExitLimitFromCond(const Loop *L, Value *ExitCond, BasicBlock *TBB, - BasicBlock *FBB); + BasicBlock *FBB, + bool IsSubExpr); /// ComputeExitLimitFromICmp - Compute the number of times the backedge of /// the specified loop will execute if its exit condition were a conditional @@ -457,7 +462,8 @@ namespace llvm { ExitLimit ComputeExitLimitFromICmp(const Loop *L, ICmpInst *ExitCond, BasicBlock *TBB, - BasicBlock *FBB); + BasicBlock *FBB, + bool IsSubExpr); /// ComputeLoadConstantCompareExitLimit - Given an exit condition /// of 'icmp op load X, cst', try to see if we can compute the @@ -479,7 +485,7 @@ namespace llvm { /// HowFarToZero - Return the number of times an exit condition comparing /// the specified value to zero will execute. If not computable, return /// CouldNotCompute. - ExitLimit HowFarToZero(const SCEV *V, const Loop *L); + ExitLimit HowFarToZero(const SCEV *V, const Loop *L, bool IsSubExpr); /// HowFarToNonZero - Return the number of times an exit condition checking /// the specified value for nonzero will execute. If not computable, return @@ -491,7 +497,7 @@ namespace llvm { /// computable, return CouldNotCompute. isSigned specifies whether the /// less-than is signed. ExitLimit HowManyLessThans(const SCEV *LHS, const SCEV *RHS, - const Loop *L, bool isSigned); + const Loop *L, bool isSigned, bool IsSubExpr); /// getPredecessorWithUniqueSuccessorForBB - Return a predecessor of BB /// (which may not be an immediate predecessor) which has exactly one @@ -831,7 +837,7 @@ namespace llvm { /// SimplifyICmpOperands - Simplify LHS and RHS in a comparison with /// predicate Pred. Return true iff any changes were made. If the - /// operands are provably equal or inequal, LHS and RHS are set to + /// operands are provably equal or unequal, LHS and RHS are set to /// the same value and Pred is set to either ICMP_EQ or ICMP_NE. /// bool SimplifyICmpOperands(ICmpInst::Predicate &Pred, diff --git a/include/llvm/Analysis/TargetTransformInfo.h b/include/llvm/Analysis/TargetTransformInfo.h index e1331a16b3..a9d6725d86 100644 --- a/include/llvm/Analysis/TargetTransformInfo.h +++ b/include/llvm/Analysis/TargetTransformInfo.h @@ -22,15 +22,17 @@ #ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFO_H #define LLVM_ANALYSIS_TARGETTRANSFORMINFO_H -#include "llvm/CodeGen/ValueTypes.h" -#include "llvm/IR/GlobalValue.h" #include "llvm/IR/Intrinsics.h" -#include "llvm/IR/Type.h" #include "llvm/Pass.h" #include "llvm/Support/DataTypes.h" namespace llvm { +class GlobalValue; +class Type; +class User; +class Value; + /// TargetTransformInfo - This pass provides access to the codegen /// interfaces that are needed for IR-level transformations. class TargetTransformInfo { @@ -77,7 +79,7 @@ public: /// fundamental values that should be used to interpret (and produce) those /// costs. The costs are returned as an unsigned rather than a member of this /// enumeration because it is expected that the cost of one IR instruction - /// may have a multiplicative factor to it or otherwise won't fit dircetly + /// may have a multiplicative factor to it or otherwise won't fit directly /// into the enum. Moreover, it is common to sum or average costs which works /// better as simple integral values. Thus this enum only provides constants. /// @@ -194,7 +196,7 @@ public: /// significantly boost the performance when the population is dense, and it /// may or may not degrade performance if the population is sparse. A HW /// support is considered as "Fast" if it can outperform, or is on a par - /// with, SW implementaion when the population is sparse; otherwise, it is + /// with, SW implementation when the population is sparse; otherwise, it is /// considered as "Slow". enum PopcntSupportKind { PSK_Software, @@ -261,6 +263,13 @@ public: SK_ExtractSubvector ///< ExtractSubvector Index indicates start offset. }; + /// \brief Additonal information about an operand's possible values. + enum OperandValueKind { + OK_AnyValue, // Operand can have any value. + OK_UniformValue, // Operand is uniform (splat of a value). + OK_UniformConstantValue // Operand is uniform constant. + }; + /// \return The number of scalar or vector registers that the target has. /// If 'Vectors' is true, it returns the number of vector registers. If it is /// set to false, it returns the number of scalar registers. @@ -275,7 +284,9 @@ public: virtual unsigned getMaximumUnrollFactor() const; /// \return The expected cost of arithmetic ops, such as mul, xor, fsub, etc. - virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const; + virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, + OperandValueKind Opd1Info = OK_AnyValue, + OperandValueKind Opd2Info = OK_AnyValue) const; /// \return The cost of a shuffle instruction of kind Kind and of type Tp. /// The index and subtype parameters are used by the subvector insertion and @@ -288,7 +299,7 @@ public: virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) const; - /// \return The expected cost of control-flow related instrutctions such as + /// \return The expected cost of control-flow related instructions such as /// Phi, Ret, Br. virtual unsigned getCFInstrCost(unsigned Opcode) const; @@ -328,7 +339,7 @@ public: /// \brief Create the base case instance of a pass in the TTI analysis group. /// -/// This class provides the base case for the stack of TTI analyses. It doesn't +/// This class provides the base case for the stack of TTI analyzes. It doesn't /// delegate to anything and uses the STTI and VTTI objects passed in to /// satisfy the queries. ImmutablePass *createNoTargetTransformInfoPass(); |