Date: Tue, 23 Jun 2009 14:50:01 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r194710 - in vendor/llvm/dist: include/llvm include/llvm/Analysis include/llvm/CodeGen include/llvm/Support include/llvm/Target lib/Analysis lib/CodeGen lib/CodeGen/SelectionDAG lib/Exe... Message-ID: <200906231450.n5NEo1X3079360@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Tue Jun 23 14:50:01 2009 New Revision: 194710 URL: http://svn.freebsd.org/changeset/base/194710 Log: Import LLVM r73954. Added: vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/test/Analysis/ScalarEvolution/pointer-sign-bits.ll vendor/llvm/dist/test/Analysis/ScalarEvolution/trip-count7.ll vendor/llvm/dist/test/CodeGen/ARM/2008-09-14-CoalescerBug.ll vendor/llvm/dist/test/CodeGen/ARM/2009-06-02-ISelCrash.ll vendor/llvm/dist/test/CodeGen/ARM/2009-06-22-CoalescerBug.ll vendor/llvm/dist/test/CodeGen/ARM/arm-frameaddr.ll vendor/llvm/dist/test/CodeGen/ARM/neon_arith1.ll vendor/llvm/dist/test/CodeGen/ARM/neon_ld1.ll vendor/llvm/dist/test/CodeGen/ARM/neon_ld2.ll vendor/llvm/dist/test/CodeGen/ARM/vaba.ll vendor/llvm/dist/test/CodeGen/ARM/vabal.ll vendor/llvm/dist/test/CodeGen/ARM/vabd.ll vendor/llvm/dist/test/CodeGen/ARM/vabdl.ll vendor/llvm/dist/test/CodeGen/ARM/vabs.ll vendor/llvm/dist/test/CodeGen/ARM/vacge.ll vendor/llvm/dist/test/CodeGen/ARM/vacgt.ll vendor/llvm/dist/test/CodeGen/ARM/vadd.ll vendor/llvm/dist/test/CodeGen/ARM/vaddhn.ll vendor/llvm/dist/test/CodeGen/ARM/vaddl.ll vendor/llvm/dist/test/CodeGen/ARM/vaddw.ll vendor/llvm/dist/test/CodeGen/ARM/vand.ll vendor/llvm/dist/test/CodeGen/ARM/vbic.ll vendor/llvm/dist/test/CodeGen/ARM/vbsl.ll vendor/llvm/dist/test/CodeGen/ARM/vceq.ll vendor/llvm/dist/test/CodeGen/ARM/vcge.ll vendor/llvm/dist/test/CodeGen/ARM/vcgt.ll vendor/llvm/dist/test/CodeGen/ARM/vcls.ll vendor/llvm/dist/test/CodeGen/ARM/vclz.ll vendor/llvm/dist/test/CodeGen/ARM/vcnt.ll vendor/llvm/dist/test/CodeGen/ARM/vcvt.ll vendor/llvm/dist/test/CodeGen/ARM/vcvt_n.ll vendor/llvm/dist/test/CodeGen/ARM/vdup.ll vendor/llvm/dist/test/CodeGen/ARM/vdup_lane.ll vendor/llvm/dist/test/CodeGen/ARM/veor.ll vendor/llvm/dist/test/CodeGen/ARM/vfcmp.ll vendor/llvm/dist/test/CodeGen/ARM/vget_lane.ll vendor/llvm/dist/test/CodeGen/ARM/vhadd.ll vendor/llvm/dist/test/CodeGen/ARM/vhsub.ll vendor/llvm/dist/test/CodeGen/ARM/vicmp.ll vendor/llvm/dist/test/CodeGen/ARM/vmax.ll vendor/llvm/dist/test/CodeGen/ARM/vmin.ll vendor/llvm/dist/test/CodeGen/ARM/vmla.ll vendor/llvm/dist/test/CodeGen/ARM/vmlal.ll vendor/llvm/dist/test/CodeGen/ARM/vmls.ll vendor/llvm/dist/test/CodeGen/ARM/vmlsl.ll vendor/llvm/dist/test/CodeGen/ARM/vmov.ll vendor/llvm/dist/test/CodeGen/ARM/vmovl.ll vendor/llvm/dist/test/CodeGen/ARM/vmovn.ll vendor/llvm/dist/test/CodeGen/ARM/vmul.ll vendor/llvm/dist/test/CodeGen/ARM/vmull.ll vendor/llvm/dist/test/CodeGen/ARM/vmvn.ll vendor/llvm/dist/test/CodeGen/ARM/vneg.ll vendor/llvm/dist/test/CodeGen/ARM/vorn.ll vendor/llvm/dist/test/CodeGen/ARM/vorr.ll vendor/llvm/dist/test/CodeGen/ARM/vpadal.ll vendor/llvm/dist/test/CodeGen/ARM/vpadd.ll vendor/llvm/dist/test/CodeGen/ARM/vpaddl.ll vendor/llvm/dist/test/CodeGen/ARM/vpmax.ll vendor/llvm/dist/test/CodeGen/ARM/vpmin.ll vendor/llvm/dist/test/CodeGen/ARM/vqabs.ll vendor/llvm/dist/test/CodeGen/ARM/vqadd.ll vendor/llvm/dist/test/CodeGen/ARM/vqdmlal.ll vendor/llvm/dist/test/CodeGen/ARM/vqdmlsl.ll vendor/llvm/dist/test/CodeGen/ARM/vqdmulh.ll vendor/llvm/dist/test/CodeGen/ARM/vqdmull.ll vendor/llvm/dist/test/CodeGen/ARM/vqmovn.ll vendor/llvm/dist/test/CodeGen/ARM/vqneg.ll vendor/llvm/dist/test/CodeGen/ARM/vqrshl.ll vendor/llvm/dist/test/CodeGen/ARM/vqrshrn.ll vendor/llvm/dist/test/CodeGen/ARM/vqshl.ll vendor/llvm/dist/test/CodeGen/ARM/vqshrn.ll vendor/llvm/dist/test/CodeGen/ARM/vqsub.ll vendor/llvm/dist/test/CodeGen/ARM/vraddhn.ll vendor/llvm/dist/test/CodeGen/ARM/vrecpe.ll vendor/llvm/dist/test/CodeGen/ARM/vrecps.ll vendor/llvm/dist/test/CodeGen/ARM/vrhadd.ll vendor/llvm/dist/test/CodeGen/ARM/vrshl.ll vendor/llvm/dist/test/CodeGen/ARM/vrshrn.ll vendor/llvm/dist/test/CodeGen/ARM/vrsqrte.ll vendor/llvm/dist/test/CodeGen/ARM/vrsqrts.ll vendor/llvm/dist/test/CodeGen/ARM/vrsubhn.ll vendor/llvm/dist/test/CodeGen/ARM/vset_lane.ll vendor/llvm/dist/test/CodeGen/ARM/vshift.ll vendor/llvm/dist/test/CodeGen/ARM/vshiftins.ll vendor/llvm/dist/test/CodeGen/ARM/vshl.ll vendor/llvm/dist/test/CodeGen/ARM/vshll.ll vendor/llvm/dist/test/CodeGen/ARM/vshrn.ll vendor/llvm/dist/test/CodeGen/ARM/vsra.ll vendor/llvm/dist/test/CodeGen/ARM/vsub.ll vendor/llvm/dist/test/CodeGen/ARM/vsubhn.ll vendor/llvm/dist/test/CodeGen/ARM/vsubl.ll vendor/llvm/dist/test/CodeGen/ARM/vsubw.ll vendor/llvm/dist/test/CodeGen/ARM/vtst.ll Deleted: vendor/llvm/dist/test/CodeGen/ARM/2008-09-14-CoaleserBug.ll Modified: vendor/llvm/dist/include/llvm/Analysis/IVUsers.h vendor/llvm/dist/include/llvm/Analysis/LoopVR.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpressions.h vendor/llvm/dist/include/llvm/CodeGen/BinaryObject.h vendor/llvm/dist/include/llvm/Intrinsics.td vendor/llvm/dist/include/llvm/IntrinsicsARM.td vendor/llvm/dist/include/llvm/Support/Timer.h vendor/llvm/dist/include/llvm/Target/TargetELFWriterInfo.h vendor/llvm/dist/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/IVUsers.cpp vendor/llvm/dist/lib/Analysis/LoopVR.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/CodeGen/ELF.h vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.cpp vendor/llvm/dist/lib/CodeGen/ELFWriter.cpp vendor/llvm/dist/lib/CodeGen/ELFWriter.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SimpleRegisterCoalescing.cpp vendor/llvm/dist/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp vendor/llvm/dist/lib/Support/Annotation.cpp vendor/llvm/dist/lib/Support/PluginLoader.cpp vendor/llvm/dist/lib/Support/Statistic.cpp vendor/llvm/dist/lib/Support/Timer.cpp vendor/llvm/dist/lib/Target/ARM/ARMCallingConv.td vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrFormats.td vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMRegisterInfo.td vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.cpp vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp vendor/llvm/dist/lib/Target/ARM/README.txt vendor/llvm/dist/lib/Target/PIC16/PIC16ISelLowering.cpp vendor/llvm/dist/lib/Target/TargetData.cpp vendor/llvm/dist/lib/Target/X86/X86ELFWriterInfo.cpp vendor/llvm/dist/lib/Target/X86/X86ELFWriterInfo.h vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopDeletion.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/test/CodeGen/ARM/2007-03-13-InstrSched.ll vendor/llvm/dist/tools/llvm-mc/AsmLexer.cpp vendor/llvm/dist/tools/llvm-mc/AsmLexer.h vendor/llvm/dist/tools/llvm-mc/AsmParser.cpp vendor/llvm/dist/tools/llvm-mc/AsmParser.h vendor/llvm/dist/tools/lto/LTOCodeGenerator.cpp Modified: vendor/llvm/dist/include/llvm/Analysis/IVUsers.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/IVUsers.h Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/Analysis/IVUsers.h Tue Jun 23 14:50:01 2009 (r194710) @@ -34,7 +34,7 @@ class IVUsersOfOneStride; class IVStrideUse : public CallbackVH, public ilist_node<IVStrideUse> { public: IVStrideUse(IVUsersOfOneStride *parent, - const SCEVHandle &offset, + const SCEV* offset, Instruction* U, Value *O) : CallbackVH(U), Parent(parent), Offset(offset), OperandValToReplace(O), @@ -58,10 +58,10 @@ public: /// getOffset - Return the offset to add to a theoeretical induction /// variable that starts at zero and counts up by the stride to compute /// the value for the use. This always has the same type as the stride. - SCEVHandle getOffset() const { return Offset; } + const SCEV* getOffset() const { return Offset; } /// setOffset - Assign a new offset to this use. - void setOffset(SCEVHandle Val) { + void setOffset(const SCEV* Val) { Offset = Val; } @@ -96,7 +96,7 @@ private: IVUsersOfOneStride *Parent; /// Offset - The offset to add to the base induction expression. - SCEVHandle Offset; + const SCEV* Offset; /// OperandValToReplace - The Value of the operand in the user instruction /// that this IVStrideUse is representing. @@ -158,7 +158,7 @@ public: /// initial value and the operand that uses the IV. ilist<IVStrideUse> Users; - void addUser(const SCEVHandle &Offset, Instruction *User, Value *Operand) { + void addUser(const SCEV* Offset, Instruction *User, Value *Operand) { Users.push_back(new IVStrideUse(this, Offset, User, Operand)); } }; @@ -178,12 +178,12 @@ public: /// IVUsesByStride - A mapping from the strides in StrideOrder to the /// uses in IVUses. - std::map<SCEVHandle, IVUsersOfOneStride*> IVUsesByStride; + std::map<const SCEV*, IVUsersOfOneStride*> IVUsesByStride; /// StrideOrder - An ordering of the keys in IVUsesByStride that is stable: /// We use this to iterate over the IVUsesByStride collection without being /// dependent on random ordering of pointers in the process. - SmallVector<SCEVHandle, 16> StrideOrder; + SmallVector<const SCEV*, 16> StrideOrder; private: virtual void getAnalysisUsage(AnalysisUsage &AU) const; @@ -203,7 +203,7 @@ public: /// getReplacementExpr - Return a SCEV expression which computes the /// value of the OperandValToReplace of the given IVStrideUse. - SCEVHandle getReplacementExpr(const IVStrideUse &U) const; + const SCEV* getReplacementExpr(const IVStrideUse &U) const; void print(raw_ostream &OS, const Module* = 0) const; virtual void print(std::ostream &OS, const Module* = 0) const; Modified: vendor/llvm/dist/include/llvm/Analysis/LoopVR.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopVR.h Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/Analysis/LoopVR.h Tue Jun 23 14:50:01 2009 (r194710) @@ -78,9 +78,9 @@ public: private: ConstantRange compute(Value *V); - ConstantRange getRange(SCEVHandle S, Loop *L, ScalarEvolution &SE); + ConstantRange getRange(const SCEV* S, Loop *L, ScalarEvolution &SE); - ConstantRange getRange(SCEVHandle S, SCEVHandle T, ScalarEvolution &SE); + ConstantRange getRange(const SCEV* S, const SCEV* T, ScalarEvolution &SE); std::map<Value *, ConstantRange *> Map; }; Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Tue Jun 23 14:50:01 2009 (r194710) @@ -32,10 +32,16 @@ namespace llvm { class APInt; class ConstantInt; class Type; - class SCEVHandle; class ScalarEvolution; class TargetData; - template<> struct DenseMapInfo<SCEVHandle>; + class SCEVConstant; + class SCEVTruncateExpr; + class SCEVZeroExtendExpr; + class SCEVCommutativeExpr; + class SCEVUDivExpr; + class SCEVSignExtendExpr; + class SCEVAddRecExpr; + class SCEVUnknown; /// SCEV - This class represents an analyzed expression in the program. These /// are reference-counted opaque objects that the client is not allowed to @@ -43,25 +49,14 @@ namespace llvm { /// class SCEV { const unsigned SCEVType; // The SCEV baseclass this node corresponds to - mutable unsigned RefCount; - - friend class SCEVHandle; - friend class DenseMapInfo<SCEVHandle>; - void addRef() const { ++RefCount; } - void dropRef() const { - if (--RefCount == 0) - delete this; - } - - const ScalarEvolution* parent; SCEV(const SCEV &); // DO NOT IMPLEMENT void operator=(const SCEV &); // DO NOT IMPLEMENT protected: virtual ~SCEV(); public: - explicit SCEV(unsigned SCEVTy, const ScalarEvolution* p) : - SCEVType(SCEVTy), RefCount(0), parent(p) {} + explicit SCEV(unsigned SCEVTy) : + SCEVType(SCEVTy) {} unsigned getSCEVType() const { return SCEVType; } @@ -92,9 +87,9 @@ namespace llvm { /// the same value, but which uses the concrete value Conc instead of the /// symbolic value. If this SCEV does not use the symbolic value, it /// returns itself. - virtual SCEVHandle - replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + virtual const SCEV* + replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const = 0; /// dominates - Return true if elements that makes up this SCEV dominates @@ -129,17 +124,16 @@ namespace llvm { /// None of the standard SCEV operations are valid on this class, it is just a /// marker. struct SCEVCouldNotCompute : public SCEV { - SCEVCouldNotCompute(const ScalarEvolution* p); - ~SCEVCouldNotCompute(); + SCEVCouldNotCompute(); // None of these methods are valid for this object. virtual bool isLoopInvariant(const Loop *L) const; virtual const Type *getType() const; virtual bool hasComputableLoopEvolution(const Loop *L) const; virtual void print(raw_ostream &OS) const; - virtual SCEVHandle - replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + virtual const SCEV* + replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const; virtual bool dominates(BasicBlock *BB, DominatorTree *DT) const { @@ -151,83 +145,6 @@ namespace llvm { static bool classof(const SCEV *S); }; - /// SCEVHandle - This class is used to maintain the SCEV object's refcounts, - /// freeing the objects when the last reference is dropped. - class SCEVHandle { - const SCEV *S; - SCEVHandle(); // DO NOT IMPLEMENT - public: - SCEVHandle(const SCEV *s) : S(s) { - assert(S && "Cannot create a handle to a null SCEV!"); - S->addRef(); - } - SCEVHandle(const SCEVHandle &RHS) : S(RHS.S) { - S->addRef(); - } - ~SCEVHandle() { S->dropRef(); } - - operator const SCEV*() const { return S; } - - const SCEV &operator*() const { return *S; } - const SCEV *operator->() const { return S; } - - bool operator==(const SCEV *RHS) const { return S == RHS; } - bool operator!=(const SCEV *RHS) const { return S != RHS; } - - const SCEVHandle &operator=(SCEV *RHS) { - if (S != RHS) { - S->dropRef(); - S = RHS; - S->addRef(); - } - return *this; - } - - const SCEVHandle &operator=(const SCEVHandle &RHS) { - if (S != RHS.S) { - S->dropRef(); - S = RHS.S; - S->addRef(); - } - return *this; - } - }; - - template<typename From> struct simplify_type; - template<> struct simplify_type<const SCEVHandle> { - typedef const SCEV* SimpleType; - static SimpleType getSimplifiedValue(const SCEVHandle &Node) { - return Node; - } - }; - template<> struct simplify_type<SCEVHandle> - : public simplify_type<const SCEVHandle> {}; - - // Specialize DenseMapInfo for SCEVHandle so that SCEVHandle may be used - // as a key in DenseMaps. - template<> - struct DenseMapInfo<SCEVHandle> { - static inline SCEVHandle getEmptyKey() { - static SCEVCouldNotCompute Empty(0); - if (Empty.RefCount == 0) - Empty.addRef(); - return &Empty; - } - static inline SCEVHandle getTombstoneKey() { - static SCEVCouldNotCompute Tombstone(0); - if (Tombstone.RefCount == 0) - Tombstone.addRef(); - return &Tombstone; - } - static unsigned getHashValue(const SCEVHandle &Val) { - return DenseMapInfo<const SCEV *>::getHashValue(Val); - } - static bool isEqual(const SCEVHandle &LHS, const SCEVHandle &RHS) { - return LHS == RHS; - } - static bool isPod() { return false; } - }; - /// ScalarEvolution - This class is the main scalar evolution driver. Because /// client code (intentionally) can't do much with the SCEV objects directly, /// they must ask this class for services. @@ -260,11 +177,11 @@ namespace llvm { /// CouldNotCompute - This SCEV is used to represent unknown trip /// counts and things. - SCEVHandle CouldNotCompute; + const SCEV* CouldNotCompute; /// Scalars - This is a cache of the scalars we have analyzed so far. /// - std::map<SCEVCallbackVH, SCEVHandle> Scalars; + std::map<SCEVCallbackVH, const SCEV*> Scalars; /// BackedgeTakenInfo - Information about the backedge-taken count /// of a loop. This currently inclues an exact count and a maximum count. @@ -272,19 +189,16 @@ namespace llvm { struct BackedgeTakenInfo { /// Exact - An expression indicating the exact backedge-taken count of /// the loop if it is known, or a SCEVCouldNotCompute otherwise. - SCEVHandle Exact; + const SCEV* Exact; /// Exact - An expression indicating the least maximum backedge-taken /// count of the loop that is known, or a SCEVCouldNotCompute. - SCEVHandle Max; + const SCEV* Max; - /*implicit*/ BackedgeTakenInfo(SCEVHandle exact) : + /*implicit*/ BackedgeTakenInfo(const SCEV* exact) : Exact(exact), Max(exact) {} - /*implicit*/ BackedgeTakenInfo(const SCEV *exact) : - Exact(exact), Max(exact) {} - - BackedgeTakenInfo(SCEVHandle exact, SCEVHandle max) : + BackedgeTakenInfo(const SCEV* exact, const SCEV* max) : Exact(exact), Max(max) {} /// hasAnyInfo - Test whether this BackedgeTakenInfo contains any @@ -314,30 +228,30 @@ namespace llvm { /// createSCEV - We know that there is no SCEV for the specified value. /// Analyze the expression. - SCEVHandle createSCEV(Value *V); + const SCEV* createSCEV(Value *V); /// createNodeForPHI - Provide the special handling we need to analyze PHI /// SCEVs. - SCEVHandle createNodeForPHI(PHINode *PN); + const SCEV* createNodeForPHI(PHINode *PN); /// createNodeForGEP - Provide the special handling we need to analyze GEP /// SCEVs. - SCEVHandle createNodeForGEP(User *GEP); + const SCEV* createNodeForGEP(User *GEP); /// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value /// for the specified instruction and replaces any references to the /// symbolic value SymName with the specified value. This is used during /// PHI resolution. void ReplaceSymbolicValueWithConcrete(Instruction *I, - const SCEVHandle &SymName, - const SCEVHandle &NewVal); + const SCEV* SymName, + const SCEV* NewVal); /// getBECount - Subtract the end and start values and divide by the step, /// rounding up, to get the number of times the backedge is executed. Return /// CouldNotCompute if an intermediate computation overflows. - SCEVHandle getBECount(const SCEVHandle &Start, - const SCEVHandle &End, - const SCEVHandle &Step); + const SCEV* getBECount(const SCEV* Start, + const SCEV* End, + const SCEV* Step); /// getBackedgeTakenInfo - Return the BackedgeTakenInfo for the given /// loop, lazily computing new values if the loop hasn't been analyzed @@ -375,7 +289,7 @@ namespace llvm { /// ComputeLoadConstantCompareBackedgeTakenCount - Given an exit condition /// of 'icmp op load X, cst', try to see if we can compute the trip count. - SCEVHandle + const SCEV* ComputeLoadConstantCompareBackedgeTakenCount(LoadInst *LI, Constant *RHS, const Loop *L, @@ -386,18 +300,18 @@ namespace llvm { /// try to evaluate a few iterations of the loop until we get the exit /// condition gets a value of ExitWhen (true or false). If we cannot /// evaluate the trip count of the loop, return CouldNotCompute. - SCEVHandle ComputeBackedgeTakenCountExhaustively(const Loop *L, Value *Cond, + const SCEV* ComputeBackedgeTakenCountExhaustively(const Loop *L, Value *Cond, bool ExitWhen); /// HowFarToZero - Return the number of times a backedge comparing the /// specified value to zero will execute. If not computable, return /// CouldNotCompute. - SCEVHandle HowFarToZero(const SCEV *V, const Loop *L); + const SCEV* HowFarToZero(const SCEV *V, const Loop *L); /// HowFarToNonZero - Return the number of times a backedge checking the /// specified value for nonzero will execute. If not computable, return /// CouldNotCompute. - SCEVHandle HowFarToNonZero(const SCEV *V, const Loop *L); + const SCEV* HowFarToNonZero(const SCEV *V, const Loop *L); /// HowManyLessThans - Return the number of times a backedge containing the /// specified less-than comparison will execute. If not computable, return @@ -449,109 +363,115 @@ namespace llvm { /// getSCEV - Return a SCEV expression handle for the full generality of the /// specified expression. - SCEVHandle getSCEV(Value *V); + const SCEV* getSCEV(Value *V); - SCEVHandle getConstant(ConstantInt *V); - SCEVHandle getConstant(const APInt& Val); - SCEVHandle getConstant(const Type *Ty, uint64_t V, bool isSigned = false); - SCEVHandle getTruncateExpr(const SCEVHandle &Op, const Type *Ty); - SCEVHandle getZeroExtendExpr(const SCEVHandle &Op, const Type *Ty); - SCEVHandle getSignExtendExpr(const SCEVHandle &Op, const Type *Ty); - SCEVHandle getAnyExtendExpr(const SCEVHandle &Op, const Type *Ty); - SCEVHandle getAddExpr(SmallVectorImpl<SCEVHandle> &Ops); - SCEVHandle getAddExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) { - SmallVector<SCEVHandle, 2> Ops; + const SCEV* getConstant(ConstantInt *V); + const SCEV* getConstant(const APInt& Val); + const SCEV* getConstant(const Type *Ty, uint64_t V, bool isSigned = false); + const SCEV* getTruncateExpr(const SCEV* Op, const Type *Ty); + const SCEV* getZeroExtendExpr(const SCEV* Op, const Type *Ty); + const SCEV* getSignExtendExpr(const SCEV* Op, const Type *Ty); + const SCEV* getAnyExtendExpr(const SCEV* Op, const Type *Ty); + const SCEV* getAddExpr(SmallVectorImpl<const SCEV*> &Ops); + const SCEV* getAddExpr(const SCEV* LHS, const SCEV* RHS) { + SmallVector<const SCEV*, 2> Ops; Ops.push_back(LHS); Ops.push_back(RHS); return getAddExpr(Ops); } - SCEVHandle getAddExpr(const SCEVHandle &Op0, const SCEVHandle &Op1, - const SCEVHandle &Op2) { - SmallVector<SCEVHandle, 3> Ops; + const SCEV* getAddExpr(const SCEV* Op0, const SCEV* Op1, + const SCEV* Op2) { + SmallVector<const SCEV*, 3> Ops; Ops.push_back(Op0); Ops.push_back(Op1); Ops.push_back(Op2); return getAddExpr(Ops); } - SCEVHandle getMulExpr(SmallVectorImpl<SCEVHandle> &Ops); - SCEVHandle getMulExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) { - SmallVector<SCEVHandle, 2> Ops; + const SCEV* getMulExpr(SmallVectorImpl<const SCEV*> &Ops); + const SCEV* getMulExpr(const SCEV* LHS, const SCEV* RHS) { + SmallVector<const SCEV*, 2> Ops; Ops.push_back(LHS); Ops.push_back(RHS); return getMulExpr(Ops); } - SCEVHandle getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); - SCEVHandle getAddRecExpr(const SCEVHandle &Start, const SCEVHandle &Step, + const SCEV* getUDivExpr(const SCEV* LHS, const SCEV* RHS); + const SCEV* getAddRecExpr(const SCEV* Start, const SCEV* Step, const Loop *L); - SCEVHandle getAddRecExpr(SmallVectorImpl<SCEVHandle> &Operands, + const SCEV* getAddRecExpr(SmallVectorImpl<const SCEV*> &Operands, const Loop *L); - SCEVHandle getAddRecExpr(const SmallVectorImpl<SCEVHandle> &Operands, + const SCEV* getAddRecExpr(const SmallVectorImpl<const SCEV*> &Operands, const Loop *L) { - SmallVector<SCEVHandle, 4> NewOp(Operands.begin(), Operands.end()); + SmallVector<const SCEV*, 4> NewOp(Operands.begin(), Operands.end()); return getAddRecExpr(NewOp, L); } - SCEVHandle getSMaxExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); - SCEVHandle getSMaxExpr(SmallVectorImpl<SCEVHandle> &Operands); - SCEVHandle getUMaxExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); - SCEVHandle getUMaxExpr(SmallVectorImpl<SCEVHandle> &Operands); - SCEVHandle getSMinExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); - SCEVHandle getUMinExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); - SCEVHandle getUnknown(Value *V); - SCEVHandle getCouldNotCompute(); + const SCEV* getSMaxExpr(const SCEV* LHS, const SCEV* RHS); + const SCEV* getSMaxExpr(SmallVectorImpl<const SCEV*> &Operands); + const SCEV* getUMaxExpr(const SCEV* LHS, const SCEV* RHS); + const SCEV* getUMaxExpr(SmallVectorImpl<const SCEV*> &Operands); + const SCEV* getSMinExpr(const SCEV* LHS, const SCEV* RHS); + const SCEV* getUMinExpr(const SCEV* LHS, const SCEV* RHS); + const SCEV* getUnknown(Value *V); + const SCEV* getCouldNotCompute(); /// getNegativeSCEV - Return the SCEV object corresponding to -V. /// - SCEVHandle getNegativeSCEV(const SCEVHandle &V); + const SCEV* getNegativeSCEV(const SCEV* V); /// getNotSCEV - Return the SCEV object corresponding to ~V. /// - SCEVHandle getNotSCEV(const SCEVHandle &V); + const SCEV* getNotSCEV(const SCEV* V); /// getMinusSCEV - Return LHS-RHS. /// - SCEVHandle getMinusSCEV(const SCEVHandle &LHS, - const SCEVHandle &RHS); + const SCEV* getMinusSCEV(const SCEV* LHS, + const SCEV* RHS); /// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion /// of the input value to the specified type. If the type must be /// extended, it is zero extended. - SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty); + const SCEV* getTruncateOrZeroExtend(const SCEV* V, const Type *Ty); /// getTruncateOrSignExtend - Return a SCEV corresponding to a conversion /// of the input value to the specified type. If the type must be /// extended, it is sign extended. - SCEVHandle getTruncateOrSignExtend(const SCEVHandle &V, const Type *Ty); + const SCEV* getTruncateOrSignExtend(const SCEV* V, const Type *Ty); /// getNoopOrZeroExtend - Return a SCEV corresponding to a conversion of /// the input value to the specified type. If the type must be extended, /// it is zero extended. The conversion must not be narrowing. - SCEVHandle getNoopOrZeroExtend(const SCEVHandle &V, const Type *Ty); + const SCEV* getNoopOrZeroExtend(const SCEV* V, const Type *Ty); /// getNoopOrSignExtend - Return a SCEV corresponding to a conversion of /// the input value to the specified type. If the type must be extended, /// it is sign extended. The conversion must not be narrowing. - SCEVHandle getNoopOrSignExtend(const SCEVHandle &V, const Type *Ty); + const SCEV* getNoopOrSignExtend(const SCEV* V, const Type *Ty); /// getNoopOrAnyExtend - Return a SCEV corresponding to a conversion of /// the input value to the specified type. If the type must be extended, /// it is extended with unspecified bits. The conversion must not be /// narrowing. - SCEVHandle getNoopOrAnyExtend(const SCEVHandle &V, const Type *Ty); + const SCEV* getNoopOrAnyExtend(const SCEV* V, const Type *Ty); /// getTruncateOrNoop - Return a SCEV corresponding to a conversion of the /// input value to the specified type. The conversion must not be /// widening. - SCEVHandle getTruncateOrNoop(const SCEVHandle &V, const Type *Ty); + const SCEV* getTruncateOrNoop(const SCEV* V, const Type *Ty); /// getIntegerSCEV - Given an integer or FP type, create a constant for the /// specified signed integer value and return a SCEV for the constant. - SCEVHandle getIntegerSCEV(int Val, const Type *Ty); + const SCEV* getIntegerSCEV(int Val, const Type *Ty); /// getUMaxFromMismatchedTypes - Promote the operands to the wider of /// the types using zero-extension, and then perform a umax operation /// with them. - SCEVHandle getUMaxFromMismatchedTypes(const SCEVHandle &LHS, - const SCEVHandle &RHS); + const SCEV* getUMaxFromMismatchedTypes(const SCEV* LHS, + const SCEV* RHS); + + /// getUMinFromMismatchedTypes - Promote the operands to the wider of + /// the types using zero-extension, and then perform a umin operation + /// with them. + const SCEV* getUMinFromMismatchedTypes(const SCEV* LHS, + const SCEV* RHS); /// hasSCEV - Return true if the SCEV for this value has already been /// computed. @@ -559,7 +479,7 @@ namespace llvm { /// setSCEV - Insert the specified SCEV into the map of current SCEVs for /// the specified value. - void setSCEV(Value *V, const SCEVHandle &H); + void setSCEV(Value *V, const SCEV* H); /// getSCEVAtScope - Return a SCEV expression handle for the specified value /// at the specified scope in the program. The L value specifies a loop @@ -571,11 +491,11 @@ namespace llvm { /// /// In the case that a relevant loop exit value cannot be computed, the /// original value V is returned. - SCEVHandle getSCEVAtScope(const SCEV *S, const Loop *L); + const SCEV* getSCEVAtScope(const SCEV *S, const Loop *L); /// getSCEVAtScope - This is a convenience function which does /// getSCEVAtScope(getSCEV(V), L). - SCEVHandle getSCEVAtScope(Value *V, const Loop *L); + const SCEV* getSCEVAtScope(Value *V, const Loop *L); /// isLoopGuardedByCond - Test whether entry to the loop is protected by /// a conditional between LHS and RHS. This is used to help avoid max @@ -594,12 +514,12 @@ namespace llvm { /// loop-invariant backedge-taken count (see /// hasLoopInvariantBackedgeTakenCount). /// - SCEVHandle getBackedgeTakenCount(const Loop *L); + const SCEV* getBackedgeTakenCount(const Loop *L); /// getMaxBackedgeTakenCount - Similar to getBackedgeTakenCount, except /// return the least SCEV value that is known never to be less than the /// actual backedge taken count. - SCEVHandle getMaxBackedgeTakenCount(const Loop *L); + const SCEV* getMaxBackedgeTakenCount(const Loop *L); /// hasLoopInvariantBackedgeTakenCount - Return true if the specified loop /// has an analyzable loop-invariant backedge-taken count. @@ -615,15 +535,15 @@ namespace llvm { /// guaranteed to end in (at every loop iteration). It is, at the same time, /// the minimum number of times S is divisible by 2. For example, given {4,+,8} /// it returns 2. If S is guaranteed to be 0, it returns the bitwidth of S. - uint32_t GetMinTrailingZeros(const SCEVHandle &S); + uint32_t GetMinTrailingZeros(const SCEV* S); /// GetMinLeadingZeros - Determine the minimum number of zero bits that S is /// guaranteed to begin with (at every loop iteration). - uint32_t GetMinLeadingZeros(const SCEVHandle &S); + uint32_t GetMinLeadingZeros(const SCEV* S); /// GetMinSignBits - Determine the minimum number of sign bits that S is /// guaranteed to begin with. - uint32_t GetMinSignBits(const SCEVHandle &S); + uint32_t GetMinSignBits(const SCEV* S); virtual bool runOnFunction(Function &F); virtual void releaseMemory(); @@ -633,6 +553,23 @@ namespace llvm { void print(std::ostream *OS, const Module* M = 0) const { if (OS) print(*OS, M); } + + private: + // Uniquing tables. + std::map<ConstantInt*, SCEVConstant*> SCEVConstants; + std::map<std::pair<const SCEV*, const Type*>, + SCEVTruncateExpr*> SCEVTruncates; + std::map<std::pair<const SCEV*, const Type*>, + SCEVZeroExtendExpr*> SCEVZeroExtends; + std::map<std::pair<unsigned, std::vector<const SCEV*> >, + SCEVCommutativeExpr*> SCEVCommExprs; + std::map<std::pair<const SCEV*, const SCEV*>, + SCEVUDivExpr*> SCEVUDivs; + std::map<std::pair<const SCEV*, const Type*>, + SCEVSignExtendExpr*> SCEVSignExtends; + std::map<std::pair<const Loop *, std::vector<const SCEV*> >, + SCEVAddRecExpr*> SCEVAddRecExprs; + std::map<Value*, SCEVUnknown*> SCEVUnknowns; }; } Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h Tue Jun 23 14:50:01 2009 (r194710) @@ -28,7 +28,7 @@ namespace llvm { /// memory. struct SCEVExpander : public SCEVVisitor<SCEVExpander, Value*> { ScalarEvolution &SE; - std::map<SCEVHandle, AssertingVH<Value> > InsertedExpressions; + std::map<const SCEV*, AssertingVH<Value> > InsertedExpressions; std::set<Value*> InsertedValues; BasicBlock::iterator InsertPt; @@ -77,12 +77,12 @@ namespace llvm { /// expression into the program. The inserted code is inserted into the /// SCEVExpander's current insertion point. If a type is specified, the /// result will be expanded to have that type, with a cast if necessary. - Value *expandCodeFor(SCEVHandle SH, const Type *Ty = 0); + Value *expandCodeFor(const SCEV* SH, const Type *Ty = 0); /// expandCodeFor - Insert code to directly compute the specified SCEV /// expression into the program. The inserted code is inserted into the /// specified block. - Value *expandCodeFor(SCEVHandle SH, const Type *Ty, + Value *expandCodeFor(const SCEV* SH, const Type *Ty, BasicBlock::iterator IP) { setInsertionPoint(IP); return expandCodeFor(SH, Ty); @@ -105,7 +105,8 @@ namespace llvm { private: /// expandAddToGEP - Expand a SCEVAddExpr with a pointer type into a GEP /// instead of using ptrtoint+arithmetic+inttoptr. - Value *expandAddToGEP(const SCEVHandle *op_begin, const SCEVHandle *op_end, + Value *expandAddToGEP(const SCEV* const *op_begin, + const SCEV* const *op_end, const PointerType *PTy, const Type *Ty, Value *V); Value *expand(const SCEV *S); Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpressions.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpressions.h Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpressions.h Tue Jun 23 14:50:01 2009 (r194710) @@ -36,10 +36,8 @@ namespace llvm { friend class ScalarEvolution; ConstantInt *V; - explicit SCEVConstant(ConstantInt *v, const ScalarEvolution* p) : - SCEV(scConstant, p), V(v) {} - - virtual ~SCEVConstant(); + explicit SCEVConstant(ConstantInt *v) : + SCEV(scConstant), V(v) {} public: ConstantInt *getValue() const { return V; } @@ -53,8 +51,8 @@ namespace llvm { virtual const Type *getType() const; - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const { return this; } @@ -77,15 +75,13 @@ namespace llvm { /// class SCEVCastExpr : public SCEV { protected: - SCEVHandle Op; + const SCEV* Op; const Type *Ty; - SCEVCastExpr(unsigned SCEVTy, const SCEVHandle &op, const Type *ty, - const ScalarEvolution* p); - virtual ~SCEVCastExpr(); + SCEVCastExpr(unsigned SCEVTy, const SCEV* op, const Type *ty); public: - const SCEVHandle &getOperand() const { return Op; } + const SCEV* getOperand() const { return Op; } virtual const Type *getType() const { return Ty; } virtual bool isLoopInvariant(const Loop *L) const { @@ -114,15 +110,13 @@ namespace llvm { class SCEVTruncateExpr : public SCEVCastExpr { friend class ScalarEvolution; - SCEVTruncateExpr(const SCEVHandle &op, const Type *ty, - const ScalarEvolution* p); - virtual ~SCEVTruncateExpr(); + SCEVTruncateExpr(const SCEV* op, const Type *ty); public: - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const { - SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); + const SCEV* H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); if (H == Op) return this; return SE.getTruncateExpr(H, Ty); @@ -144,15 +138,13 @@ namespace llvm { class SCEVZeroExtendExpr : public SCEVCastExpr { friend class ScalarEvolution; - SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty, - const ScalarEvolution* p); - virtual ~SCEVZeroExtendExpr(); + SCEVZeroExtendExpr(const SCEV* op, const Type *ty); public: - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const { - SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); + const SCEV* H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); if (H == Op) return this; return SE.getZeroExtendExpr(H, Ty); @@ -174,15 +166,13 @@ namespace llvm { class SCEVSignExtendExpr : public SCEVCastExpr { friend class ScalarEvolution; - SCEVSignExtendExpr(const SCEVHandle &op, const Type *ty, - const ScalarEvolution* p); - virtual ~SCEVSignExtendExpr(); + SCEVSignExtendExpr(const SCEV* op, const Type *ty); public: - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const { - SCEVHandle H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); + const SCEV* H = Op->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); if (H == Op) return this; return SE.getSignExtendExpr(H, Ty); @@ -204,22 +194,20 @@ namespace llvm { /// class SCEVNAryExpr : public SCEV { protected: - SmallVector<SCEVHandle, 8> Operands; + SmallVector<const SCEV*, 8> Operands; - SCEVNAryExpr(enum SCEVTypes T, const SmallVectorImpl<SCEVHandle> &ops, - const ScalarEvolution* p) - : SCEV(T, p), Operands(ops.begin(), ops.end()) {} - virtual ~SCEVNAryExpr() {} + SCEVNAryExpr(enum SCEVTypes T, const SmallVectorImpl<const SCEV*> &ops) + : SCEV(T), Operands(ops.begin(), ops.end()) {} public: unsigned getNumOperands() const { return (unsigned)Operands.size(); } - const SCEVHandle &getOperand(unsigned i) const { + const SCEV* getOperand(unsigned i) const { assert(i < Operands.size() && "Operand index out of range!"); return Operands[i]; } - const SmallVectorImpl<SCEVHandle> &getOperands() const { return Operands; } - typedef SmallVectorImpl<SCEVHandle>::const_iterator op_iterator; + const SmallVectorImpl<const SCEV*> &getOperands() const { return Operands; } + typedef SmallVectorImpl<const SCEV*>::const_iterator op_iterator; op_iterator op_begin() const { return Operands.begin(); } op_iterator op_end() const { return Operands.end(); } @@ -266,14 +254,12 @@ namespace llvm { class SCEVCommutativeExpr : public SCEVNAryExpr { protected: SCEVCommutativeExpr(enum SCEVTypes T, - const SmallVectorImpl<SCEVHandle> &ops, - const ScalarEvolution* p) - : SCEVNAryExpr(T, ops, p) {} - ~SCEVCommutativeExpr(); + const SmallVectorImpl<const SCEV*> &ops) + : SCEVNAryExpr(T, ops) {} public: - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const; virtual const char *getOperationStr() const = 0; @@ -297,9 +283,8 @@ namespace llvm { class SCEVAddExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; - explicit SCEVAddExpr(const SmallVectorImpl<SCEVHandle> &ops, - const ScalarEvolution* p) - : SCEVCommutativeExpr(scAddExpr, ops, p) { + explicit SCEVAddExpr(const SmallVectorImpl<const SCEV*> &ops) + : SCEVCommutativeExpr(scAddExpr, ops) { } public: @@ -318,9 +303,8 @@ namespace llvm { class SCEVMulExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; - explicit SCEVMulExpr(const SmallVectorImpl<SCEVHandle> &ops, - const ScalarEvolution* p) - : SCEVCommutativeExpr(scMulExpr, ops, p) { + explicit SCEVMulExpr(const SmallVectorImpl<const SCEV*> &ops) + : SCEVCommutativeExpr(scMulExpr, ops) { } public: @@ -340,15 +324,14 @@ namespace llvm { class SCEVUDivExpr : public SCEV { friend class ScalarEvolution; - SCEVHandle LHS, RHS; - SCEVUDivExpr(const SCEVHandle &lhs, const SCEVHandle &rhs, - const ScalarEvolution* p) - : SCEV(scUDivExpr, p), LHS(lhs), RHS(rhs) {} + const SCEV* LHS; + const SCEV* RHS; + SCEVUDivExpr(const SCEV* lhs, const SCEV* rhs) + : SCEV(scUDivExpr), LHS(lhs), RHS(rhs) {} - virtual ~SCEVUDivExpr(); public: - const SCEVHandle &getLHS() const { return LHS; } - const SCEVHandle &getRHS() const { return RHS; } + const SCEV* getLHS() const { return LHS; } + const SCEV* getRHS() const { return RHS; } virtual bool isLoopInvariant(const Loop *L) const { return LHS->isLoopInvariant(L) && RHS->isLoopInvariant(L); @@ -359,11 +342,11 @@ namespace llvm { RHS->hasComputableLoopEvolution(L); } - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const { - SCEVHandle L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); - SCEVHandle R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); + const SCEV* L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); + const SCEV* R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); if (L == LHS && R == RHS) return this; else @@ -398,25 +381,23 @@ namespace llvm { const Loop *L; - SCEVAddRecExpr(const SmallVectorImpl<SCEVHandle> &ops, const Loop *l, - const ScalarEvolution* p) - : SCEVNAryExpr(scAddRecExpr, ops, p), L(l) { + SCEVAddRecExpr(const SmallVectorImpl<const SCEV*> &ops, const Loop *l) + : SCEVNAryExpr(scAddRecExpr, ops), L(l) { for (size_t i = 0, e = Operands.size(); i != e; ++i) assert(Operands[i]->isLoopInvariant(l) && "Operands of AddRec must be loop-invariant!"); } - ~SCEVAddRecExpr(); public: - const SCEVHandle &getStart() const { return Operands[0]; } + const SCEV* getStart() const { return Operands[0]; } const Loop *getLoop() const { return L; } /// getStepRecurrence - This method constructs and returns the recurrence /// indicating how much this expression steps by. If this is a polynomial /// of degree N, it returns a chrec of degree N-1. - SCEVHandle getStepRecurrence(ScalarEvolution &SE) const { + const SCEV* getStepRecurrence(ScalarEvolution &SE) const { if (isAffine()) return getOperand(1); - return SE.getAddRecExpr(SmallVector<SCEVHandle, 3>(op_begin()+1,op_end()), + return SE.getAddRecExpr(SmallVector<const SCEV*, 3>(op_begin()+1,op_end()), getLoop()); } @@ -444,7 +425,7 @@ namespace llvm { /// evaluateAtIteration - Return the value of this chain of recurrences at /// the specified iteration number. - SCEVHandle evaluateAtIteration(SCEVHandle It, ScalarEvolution &SE) const; + const SCEV* evaluateAtIteration(const SCEV* It, ScalarEvolution &SE) const; /// getNumIterationsInRange - Return the number of iterations of this loop /// that produce values in the specified constant range. Another way of @@ -452,11 +433,11 @@ namespace llvm { /// value is not in the condition, thus computing the exit count. If the /// iteration count can't be computed, an instance of SCEVCouldNotCompute is /// returned. - SCEVHandle getNumIterationsInRange(ConstantRange Range, + const SCEV* getNumIterationsInRange(ConstantRange Range, ScalarEvolution &SE) const; - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const; virtual void print(raw_ostream &OS) const; @@ -475,9 +456,8 @@ namespace llvm { class SCEVSMaxExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; - explicit SCEVSMaxExpr(const SmallVectorImpl<SCEVHandle> &ops, - const ScalarEvolution* p) - : SCEVCommutativeExpr(scSMaxExpr, ops, p) { + explicit SCEVSMaxExpr(const SmallVectorImpl<const SCEV*> &ops) + : SCEVCommutativeExpr(scSMaxExpr, ops) { } public: @@ -497,9 +477,8 @@ namespace llvm { class SCEVUMaxExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; - explicit SCEVUMaxExpr(const SmallVectorImpl<SCEVHandle> &ops, - const ScalarEvolution* p) - : SCEVCommutativeExpr(scUMaxExpr, ops, p) { + explicit SCEVUMaxExpr(const SmallVectorImpl<const SCEV*> &ops) + : SCEVCommutativeExpr(scUMaxExpr, ops) { } public: @@ -522,11 +501,9 @@ namespace llvm { friend class ScalarEvolution; Value *V; - explicit SCEVUnknown(Value *v, const ScalarEvolution* p) : - SCEV(scUnknown, p), V(v) {} - - protected: - ~SCEVUnknown(); + explicit SCEVUnknown(Value *v) : + SCEV(scUnknown), V(v) {} + public: Value *getValue() const { return V; } @@ -535,8 +512,8 @@ namespace llvm { return false; // not computable } - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, + const SCEV* replaceSymbolicValuesWithConcrete(const SCEV* Sym, + const SCEV* Conc, ScalarEvolution &SE) const { if (&*Sym == this) return Conc; return this; Modified: vendor/llvm/dist/include/llvm/CodeGen/BinaryObject.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BinaryObject.h Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/CodeGen/BinaryObject.h Tue Jun 23 14:50:01 2009 (r194710) @@ -61,6 +61,11 @@ public: return Relocations; } + /// hasRelocations - Return true if 'Relocations' is not empty + bool hasRelocations() const { + return !Relocations.empty(); + } + /// emitByte - This callback is invoked when a byte needs to be /// written to the data stream. inline void emitByte(uint8_t B) { @@ -317,6 +322,7 @@ public: void addRelocation(const MachineRelocation& relocation) { Relocations.push_back(relocation); } + }; } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/Intrinsics.td ============================================================================== --- vendor/llvm/dist/include/llvm/Intrinsics.td Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/Intrinsics.td Tue Jun 23 14:50:01 2009 (r194710) @@ -116,6 +116,7 @@ def llvm_v2i64_ty : LLVMType<v2i64> def llvm_v2i32_ty : LLVMType<v2i32>; // 2 x i32 def llvm_v1i64_ty : LLVMType<v1i64>; // 1 x i64 def llvm_v4i32_ty : LLVMType<v4i32>; // 4 x i32 +def llvm_v2f32_ty : LLVMType<v2f32>; // 2 x float def llvm_v4f32_ty : LLVMType<v4f32>; // 4 x float def llvm_v2f64_ty : LLVMType<v2f64>; // 2 x double Modified: vendor/llvm/dist/include/llvm/IntrinsicsARM.td ============================================================================== --- vendor/llvm/dist/include/llvm/IntrinsicsARM.td Tue Jun 23 14:40:08 2009 (r194709) +++ vendor/llvm/dist/include/llvm/IntrinsicsARM.td Tue Jun 23 14:50:01 2009 (r194710) @@ -19,3 +19,298 @@ let TargetPrefix = "arm" in { // All in def int_arm_thread_pointer : GCCBuiltin<"__builtin_thread_pointer">, Intrinsic<[llvm_ptr_ty], [], [IntrNoMem]>; } + +//===----------------------------------------------------------------------===// +// Advanced SIMD (NEON) + +let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.". + + // The following classes do not correspond directly to GCC builtins. + class Neon_1Arg_Intrinsic + : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>], [IntrNoMem]>; + class Neon_1Arg_Float_Intrinsic *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906231450.n5NEo1X3079360>