From grosser at fim.uni-passau.de Mon Aug 16 01:16:07 2010 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Mon, 16 Aug 2010 08:16:07 +0200 Subject: [llvm-commits] [PATCH] Disable instruction hoisting In-Reply-To: <15261_1281787364_4C6685E4_15261_4495_1_4C668577.9010302@fim.uni-passau.de> References: <15261_1281787364_4C6685E4_15261_4495_1_4C668577.9010302@fim.uni-passau.de> Message-ID: <4C68D7A7.6030609@fim.uni-passau.de> On 08/14/2010 02:00 PM, Tobias Grosser wrote: > Hi, > > I would like to contribute a patch that allows to disable instruction > hoisting in the SCEVExpander. It does not change the current behaviour > of any code, but will allow polly to use it to generate so called > independent blocks. No need to worry about this any more. ether implemented a solution, that does not depend on the SCEVExpander, but copies the parameter tree of the relevant statements. This works out nicely Cheers Tobi From gohman at apple.com Mon Aug 16 09:39:20 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 14:39:20 -0000 Subject: [llvm-commits] [llvm] r111121 - in /llvm/trunk: lib/Analysis/Lint.cpp test/Other/lint.ll Message-ID: <20100816143920.23D482A6C12C@llvm.org> Author: djg Date: Mon Aug 16 09:39:19 2010 New Revision: 111121 URL: http://llvm.org/viewvc/llvm-project?rev=111121&view=rev Log: Revert r111058, the lint check for indirectbr successors that aren't address-taken. This can occur normally, if the code which took the address got DCEd. Modified: llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/test/Other/lint.ll Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=111121&r1=111120&r2=111121&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Mon Aug 16 09:39:19 2010 @@ -521,12 +521,6 @@ Assert1(I.getNumDestinations() != 0, "Undefined behavior: indirectbr with no destinations", &I); - - for (unsigned i = 0, e = I.getNumDestinations(); i != e; ++i) - Assert1(I.getDestination(i)->hasAddressTaken(), - "Unusual: indirectbr destination has not " - "had its address taken", - &I); } void Lint::visitExtractElementInst(ExtractElementInst &I) { Modified: llvm/trunk/test/Other/lint.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/lint.ll?rev=111121&r1=111120&r2=111121&view=diff ============================================================================== --- llvm/trunk/test/Other/lint.ll (original) +++ llvm/trunk/test/Other/lint.ll Mon Aug 16 09:39:19 2010 @@ -102,7 +102,6 @@ } ; CHECK: Undefined behavior: Branch to non-blockaddress -; CHECK: Unusual: indirectbr destination has not had its address taken define void @use_indbr() { indirectbr i8* bitcast (i32()* @foo to i8*), [label %block] block: From gohman at apple.com Mon Aug 16 09:41:14 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 14:41:14 -0000 Subject: [llvm-commits] [llvm] r111122 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/indirectbr.ll Message-ID: <20100816144114.DF31A2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 09:41:14 2010 New Revision: 111122 URL: http://llvm.org/viewvc/llvm-project?rev=111122&view=rev Log: Instead, teach SimplifyCFG to trim non-address-taken blocks from indirectbr destination lists. Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp llvm/trunk/test/Transforms/SimplifyCFG/indirectbr.ll Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=111122&r1=111121&r2=111122&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Mon Aug 16 09:41:14 2010 @@ -2057,12 +2057,13 @@ return true; } } - } else if (IndirectBrInst *IBI = dyn_cast(BB->getTerminator())) { + } else if (IndirectBrInst *IBI = + dyn_cast(BB->getTerminator())) { // Eliminate redundant destinations. SmallPtrSet Succs; for (unsigned i = 0, e = IBI->getNumDestinations(); i != e; ++i) { BasicBlock *Dest = IBI->getDestination(i); - if (!Succs.insert(Dest)) { + if (!Dest->hasAddressTaken() || !Succs.insert(Dest)) { Dest->removePredecessor(BB); IBI->removeDestination(i); --i; --e; Modified: llvm/trunk/test/Transforms/SimplifyCFG/indirectbr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/indirectbr.ll?rev=111122&r1=111121&r2=111122&view=diff ============================================================================== --- llvm/trunk/test/Transforms/SimplifyCFG/indirectbr.ll (original) +++ llvm/trunk/test/Transforms/SimplifyCFG/indirectbr.ll Mon Aug 16 09:41:14 2010 @@ -49,3 +49,16 @@ ret void } +; SimplifyCFG should notice that BB0 does not have its address taken and +; remove it from entry's successor list. + +; CHECK: indbrtest2 +; CHECK: entry: +; CHECK-NEXT: unreachable + +define void @indbrtest2(i8* %t) { +entry: + indirectbr i8* %t, [label %BB0, label %BB0] +BB0: + ret void +} From criswell at uiuc.edu Mon Aug 16 09:43:25 2010 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Aug 2010 14:43:25 -0000 Subject: [llvm-commits] [poolalloc] r111123 - /poolalloc/trunk/lib/DSA/Local.cpp Message-ID: <20100816144325.3FFBB2A6C12C@llvm.org> Author: criswell Date: Mon Aug 16 09:43:25 2010 New Revision: 111123 URL: http://llvm.org/viewvc/llvm-project?rev=111123&view=rev Log: Fixed PR#7914. When increasing the DSNode size for vararg arguments, make sure that we're only trying to make the DSNode larger and not smaller. Otherwise, we hit an assertion about trying to shrink the size of the DSNode. Modified: poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=111123&r1=111122&r2=111123&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Mon Aug 16 09:43:25 2010 @@ -686,7 +686,8 @@ case Triple::x86: // On x86, we have: // va_list as a pointer to an array of pointers to the variable arguments - N->growSize(1); + if (N->getSize() < 1) + N->growSize(1); N->setLink(0, VAArray); break; case Triple::x86_64: @@ -694,7 +695,8 @@ // The first i8* is where arguments generally go, but the second i8* can be used // also to pass arguments by register. // We model this by having both the i8*'s point to an array of pointers to the arguments. - N->growSize(24); //sizeof the va_list struct mentioned above + if (N->getSize() < 1) + N->growSize(24); //sizeof the va_list struct mentioned above N->setLink(8,VAArray); //first i8* N->setLink(16,VAArray); //second i8* break; From gohman at apple.com Mon Aug 16 09:44:03 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 14:44:03 -0000 Subject: [llvm-commits] [llvm] r111124 - /llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <20100816144404.076C52A6C12E@llvm.org> Author: djg Date: Mon Aug 16 09:44:03 2010 New Revision: 111124 URL: http://llvm.org/viewvc/llvm-project?rev=111124&view=rev Log: Avoid #include in LoopSimplify.cpp, which doesn't actually use ScalarEvolution. Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=111124&r1=111123&r2=111124&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Mon Aug 16 09:44:03 2010 @@ -48,7 +48,6 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopPass.h" -#include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CFG.h" @@ -84,7 +83,7 @@ AU.addPreserved(); AU.addPreserved(); - AU.addPreserved(); + AU.addPreserved("scalar-evolution"); AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added. AU.addPreserved(); AU.addPreservedID(LCSSAID); From gohman at apple.com Mon Aug 16 09:45:36 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 14:45:36 -0000 Subject: [llvm-commits] [llvm] r111125 - /llvm/trunk/include/llvm/ADT/FoldingSet.h Message-ID: <20100816144536.C80052A6C12C@llvm.org> Author: djg Date: Mon Aug 16 09:45:36 2010 New Revision: 111125 URL: http://llvm.org/viewvc/llvm-project?rev=111125&view=rev Log: Fix indentation in example code in a comment. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111125&r1=111124&r2=111125&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 09:45:36 2010 @@ -54,9 +54,9 @@ /// void Profile(FoldingSetNodeID &ID) const { /// ID.AddString(Name); /// ID.AddInteger(Value); -/// } -/// ... -/// }; +/// } +/// ... +/// }; /// /// To define the folding set itself use the FoldingSet template; /// From criswell at uiuc.edu Mon Aug 16 09:49:09 2010 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Aug 2010 14:49:09 -0000 Subject: [llvm-commits] [poolalloc] r111126 - /poolalloc/trunk/lib/DSA/Local.cpp Message-ID: <20100816144909.EBC0C2A6C12C@llvm.org> Author: criswell Date: Mon Aug 16 09:49:09 2010 New Revision: 111126 URL: http://llvm.org/viewvc/llvm-project?rev=111126&view=rev Log: Wrapped some comments to 80 characters per line. No functionality changes. Modified: poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=111126&r1=111125&r2=111126&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Mon Aug 16 09:49:09 2010 @@ -692,9 +692,10 @@ break; case Triple::x86_64: // On x86_64, we have va_list as a struct {i32, i32, i8*, i8* } - // The first i8* is where arguments generally go, but the second i8* can be used - // also to pass arguments by register. - // We model this by having both the i8*'s point to an array of pointers to the arguments. + // The first i8* is where arguments generally go, but the second i8* can + // be used also to pass arguments by register. + // We model this by having both the i8*'s point to an array of pointers + // to the arguments. if (N->getSize() < 1) N->growSize(24); //sizeof the va_list struct mentioned above N->setLink(8,VAArray); //first i8* @@ -711,8 +712,9 @@ N->setIncompleteMarker()->setUnknownMarker()->foldNodeCompletely(); } - //XXX: We used to set the alloca marker for the DSNode passed to va_start. - //Seems to me that you could allocate the va_list on the heap, so ignoring for now. + // XXX: We used to set the alloca marker for the DSNode passed to va_start. + // Seems to me that you could allocate the va_list on the heap, so ignoring + // for now. N->setModifiedMarker()->setVAStartMarker(); } From gohman at apple.com Mon Aug 16 09:53:42 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 14:53:42 -0000 Subject: [llvm-commits] [llvm] r111127 - in /llvm/trunk: include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp Message-ID: <20100816145342.793582A6C12C@llvm.org> Author: djg Date: Mon Aug 16 09:53:42 2010 New Revision: 111127 URL: http://llvm.org/viewvc/llvm-project?rev=111127&view=rev Log: Reverse the order of GetNodeProfile's arguments, for consistency with FoldingSetTrait::Profile. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h llvm/trunk/lib/Support/FoldingSet.cpp Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111127&r1=111126&r2=111127&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 09:53:42 2010 @@ -190,7 +190,7 @@ /// GetNodeProfile - Instantiations of the FoldingSet template implement /// this function to gather data bits for the given node. - virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const = 0; + virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const = 0; }; //===----------------------------------------------------------------------===// @@ -290,7 +290,7 @@ private: /// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a /// way to convert nodes into a unique specifier. - virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const { + virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const { T *TN = static_cast(N); FoldingSetTrait::Profile(*TN,ID); } @@ -354,8 +354,8 @@ /// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a /// way to convert nodes into a unique specifier. - virtual void GetNodeProfile(FoldingSetNodeID &ID, - FoldingSetImpl::Node *N) const { + virtual void GetNodeProfile(FoldingSetImpl::Node *N, + FoldingSetNodeID &ID) const { T *TN = static_cast(N); // We must use explicit template arguments in case Ctx is a Modified: llvm/trunk/lib/Support/FoldingSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=111127&r1=111126&r2=111127&view=diff ============================================================================== --- llvm/trunk/lib/Support/FoldingSet.cpp (original) +++ llvm/trunk/lib/Support/FoldingSet.cpp Mon Aug 16 09:53:42 2010 @@ -229,7 +229,7 @@ NodeInBucket->SetNextInBucket(0); // Insert the node into the new bucket, after recomputing the hash. - GetNodeProfile(ID, NodeInBucket); + GetNodeProfile(NodeInBucket, ID); InsertNode(NodeInBucket, GetBucketFor(ID, Buckets, NumBuckets)); ID.clear(); } @@ -252,7 +252,7 @@ FoldingSetNodeID OtherID; while (Node *NodeInBucket = GetNextPtr(Probe)) { - GetNodeProfile(OtherID, NodeInBucket); + GetNodeProfile(NodeInBucket, OtherID); if (OtherID == ID) return NodeInBucket; @@ -274,7 +274,7 @@ if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); FoldingSetNodeID ID; - GetNodeProfile(ID, N); + GetNodeProfile(N, ID); InsertPos = GetBucketFor(ID, Buckets, NumBuckets); } @@ -341,7 +341,7 @@ /// instead. FoldingSetImpl::Node *FoldingSetImpl::GetOrInsertNode(FoldingSetImpl::Node *N) { FoldingSetNodeID ID; - GetNodeProfile(ID, N); + GetNodeProfile(N, ID); void *IP; if (Node *E = FindNodeOrInsertPos(ID, IP)) return E; From gohman at apple.com Mon Aug 16 10:03:24 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:03:24 -0000 Subject: [llvm-commits] [llvm] r111128 - /llvm/trunk/include/llvm/ADT/FoldingSet.h Message-ID: <20100816150324.CFC062A6C12C@llvm.org> Author: djg Date: Mon Aug 16 10:03:24 2010 New Revision: 111128 URL: http://llvm.org/viewvc/llvm-project?rev=111128&view=rev Log: Constify FoldingSetNodeIDRef's Data. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111128&r1=111127&r2=111128&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 10:03:24 2010 @@ -217,13 +217,13 @@ /// is often much larger than necessary, and the possibility of heap /// allocation means it requires a non-trivial destructor call. class FoldingSetNodeIDRef { - unsigned* Data; + const unsigned* Data; size_t Size; public: FoldingSetNodeIDRef() : Data(0), Size(0) {} - FoldingSetNodeIDRef(unsigned *D, size_t S) : Data(D), Size(S) {} + FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {} - unsigned *getData() const { return Data; } + const unsigned *getData() const { return Data; } size_t getSize() const { return Size; } }; From gohman at apple.com Mon Aug 16 10:04:39 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:04:39 -0000 Subject: [llvm-commits] [llvm] r111129 - /llvm/trunk/include/llvm/ADT/FoldingSet.h Message-ID: <20100816150439.B2D152A6C12C@llvm.org> Author: djg Date: Mon Aug 16 10:04:39 2010 New Revision: 111129 URL: http://llvm.org/viewvc/llvm-project?rev=111129&view=rev Log: Tidy up whitespace in comments. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111129&r1=111128&r2=111129&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 10:04:39 2010 @@ -195,11 +195,11 @@ //===----------------------------------------------------------------------===// /// FoldingSetTrait - This trait class is used to define behavior of how -/// to "profile" (in the FoldingSet parlance) an object of a given type. -/// The default behavior is to invoke a 'Profile' method on an object, but -/// through template specialization the behavior can be tailored for specific -/// types. Combined with the FoldingSetNodeWrapper class, one can add objects -/// to FoldingSets that were not originally designed to have that behavior. +/// to "profile" (in the FoldingSet parlance) an object of a given type. +/// The default behavior is to invoke a 'Profile' method on an object, but +/// through template specialization the behavior can be tailored for specific +/// types. Combined with the FoldingSetNodeWrapper class, one can add objects +/// to FoldingSets that were not originally designed to have that behavior. /// template struct FoldingSetTrait { static inline void Profile(const T& X, FoldingSetNodeID& ID) { X.Profile(ID);} @@ -259,11 +259,11 @@ inline void Add(const T& x) { FoldingSetTrait::Profile(x, *this); } /// clear - Clear the accumulated profile, allowing this FoldingSetNodeID - /// object to be used to compute a new profile. + /// object to be used to compute a new profile. inline void clear() { Bits.clear(); } /// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used - /// to lookup the node in the FoldingSetImpl. + /// to lookup the node in the FoldingSetImpl. unsigned ComputeHash() const; /// operator== - Used to compare two nodes to each other. @@ -447,8 +447,8 @@ //===----------------------------------------------------------------------===// /// FoldingSetBucketIteratorImpl - This is the common bucket iterator support -/// shared by all folding sets, which knows how to walk a particular bucket -/// of a folding set hash table. +/// shared by all folding sets, which knows how to walk a particular bucket +/// of a folding set hash table. class FoldingSetBucketIteratorImpl { protected: From gohman at apple.com Mon Aug 16 10:30:39 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:30:39 -0000 Subject: [llvm-commits] [llvm] r111130 - in /llvm/trunk: include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp Message-ID: <20100816153039.535322A6C12C@llvm.org> Author: djg Date: Mon Aug 16 10:30:39 2010 New Revision: 111130 URL: http://llvm.org/viewvc/llvm-project?rev=111130&view=rev Log: Add hooks to FoldingSetTrait to allow specializations to provide implementations of equality comparison and hash computation. This can be used to optimize node lookup by avoiding creating lots of temporary ID values just for hashing and comparison purposes. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h llvm/trunk/lib/Support/FoldingSet.cpp Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111130&r1=111129&r2=111130&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 10:30:39 2010 @@ -191,25 +191,75 @@ /// GetNodeProfile - Instantiations of the FoldingSet template implement /// this function to gather data bits for the given node. virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const = 0; + /// NodeEquals - Instantiations of the FoldingSet template implement + /// this function to compare the given node with the given ID. + virtual bool NodeEquals(Node *N, const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID) const=0; + /// NodeEquals - Instantiations of the FoldingSet template implement + /// this function to compute a hash value for the given node. + virtual unsigned ComputeNodeHash(Node *N, + FoldingSetNodeID &TempID) const = 0; }; //===----------------------------------------------------------------------===// + +template struct FoldingSetTrait; + +/// DefaultFoldingSetTrait - This class provides default implementations +/// for FoldingSetTrait implementations. +/// +template struct DefaultFoldingSetTrait { + static void Profile(const T& X, FoldingSetNodeID& ID) { + X.Profile(ID); + } + static void Profile(T& X, FoldingSetNodeID& ID) { + X.Profile(ID); + } + + // Equals - Test if the profile for X would match ID, using TempID + // to compute a temporary ID if necessary. The default implementation + // just calls Profile and does a regular comparison. Implementations + // can override this to provide more efficient implementations. + static inline bool Equals(T &X, const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID); + + // ComputeHash - Compute a hash value for X, using TempID to + // compute a temporary ID if necessary. The default implementation + // just calls Profile and does a regular hash computation. + // Implementations can override this to provide more efficient + // implementations. + static inline unsigned ComputeHash(T &X, FoldingSetNodeID &TempID); +}; + /// FoldingSetTrait - This trait class is used to define behavior of how /// to "profile" (in the FoldingSet parlance) an object of a given type. /// The default behavior is to invoke a 'Profile' method on an object, but /// through template specialization the behavior can be tailored for specific /// types. Combined with the FoldingSetNodeWrapper class, one can add objects /// to FoldingSets that were not originally designed to have that behavior. -/// -template struct FoldingSetTrait { - static inline void Profile(const T& X, FoldingSetNodeID& ID) { X.Profile(ID);} - static inline void Profile(T& X, FoldingSetNodeID& ID) { X.Profile(ID); } - template - static inline void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) { +template struct FoldingSetTrait + : public DefaultFoldingSetTrait {}; + +template struct ContextualFoldingSetTrait; + +/// DefaultContextualFoldingSetTrait - Like DefaultFoldingSetTrait, but +/// for ContextualFoldingSets. +template +struct DefaultContextualFoldingSetTrait { + static void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) { X.Profile(ID, Context); } + static inline bool Equals(T &X, const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID, Ctx Context); + static inline unsigned ComputeHash(T &X, FoldingSetNodeID &TempID, + Ctx Context); }; +/// ContextualFoldingSetTrait - Like FoldingSetTrait, but for +/// ContextualFoldingSets. +template struct ContextualFoldingSetTrait + : public DefaultContextualFoldingSetTrait {}; + //===--------------------------------------------------------------------===// /// FoldingSetNodeIDRef - This class describes a reference to an interned /// FoldingSetNodeID, which can be a useful to store node id data rather @@ -223,6 +273,12 @@ FoldingSetNodeIDRef() : Data(0), Size(0) {} FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {} + /// ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef, + /// used to lookup the node in the FoldingSetImpl. + unsigned ComputeHash() const; + + bool operator==(FoldingSetNodeIDRef) const; + const unsigned *getData() const { return Data; } size_t getSize() const { return Size; } }; @@ -269,6 +325,7 @@ /// operator== - Used to compare two nodes to each other. /// bool operator==(const FoldingSetNodeID &RHS) const; + bool operator==(const FoldingSetNodeIDRef RHS) const; /// Intern - Copy this node's data to a memory region allocated from the /// given allocator and return a FoldingSetNodeIDRef describing the @@ -281,6 +338,39 @@ template class FoldingSetIterator; template class FoldingSetBucketIterator; +// Definitions of FoldingSetTrait and ContextualFoldingSetTrait functions, which +// require the definition of FoldingSetNodeID. +template +inline bool +DefaultFoldingSetTrait::Equals(T &X, const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID) { + FoldingSetTrait::Profile(X, TempID); + return TempID == ID; +} +template +inline unsigned +DefaultFoldingSetTrait::ComputeHash(T &X, FoldingSetNodeID &TempID) { + FoldingSetTrait::Profile(X, TempID); + return TempID.ComputeHash(); +} +template +inline bool +DefaultContextualFoldingSetTrait::Equals(T &X, + const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID, + Ctx Context) { + ContextualFoldingSetTrait::Profile(X, TempID, Context); + return TempID == ID; +} +template +inline unsigned +DefaultContextualFoldingSetTrait::ComputeHash(T &X, + FoldingSetNodeID &TempID, + Ctx Context) { + ContextualFoldingSetTrait::Profile(X, TempID, Context); + return TempID.ComputeHash(); +} + //===----------------------------------------------------------------------===// /// FoldingSet - This template class is used to instantiate a specialized /// implementation of the folding set to the node class T. T must be a @@ -292,7 +382,21 @@ /// way to convert nodes into a unique specifier. virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const { T *TN = static_cast(N); - FoldingSetTrait::Profile(*TN,ID); + FoldingSetTrait::Profile(*TN, ID); + } + /// NodeEquals - Instantiations may optionally provide a way to compare a + /// node with a specified ID. + virtual bool NodeEquals(Node *N, const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID) const { + T *TN = static_cast(N); + return FoldingSetTrait::Equals(*TN, ID, TempID); + } + /// NodeEquals - Instantiations may optionally provide a way to compute a + /// hash value directly from a node. + virtual unsigned ComputeNodeHash(Node *N, + FoldingSetNodeID &TempID) const { + T *TN = static_cast(N); + return FoldingSetTrait::ComputeHash(*TN, TempID); } public: @@ -357,10 +461,18 @@ virtual void GetNodeProfile(FoldingSetImpl::Node *N, FoldingSetNodeID &ID) const { T *TN = static_cast(N); - - // We must use explicit template arguments in case Ctx is a - // reference type. - FoldingSetTrait::template Profile(*TN, ID, Context); + ContextualFoldingSetTrait::Profile(*TN, ID, Context); + } + virtual bool NodeEquals(FoldingSetImpl::Node *N, + const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID) const { + T *TN = static_cast(N); + return ContextualFoldingSetTrait::Equals(*TN, ID, TempID, Context); + } + virtual unsigned ComputeNodeHash(FoldingSetImpl::Node *N, + FoldingSetNodeID &TempID) const { + T *TN = static_cast(N); + return ContextualFoldingSetTrait::ComputeHash(*TN, TempID, Context); } public: @@ -549,7 +661,7 @@ protected: explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {} public: - void Profile(FoldingSetNodeID& ID) { ID = FastID; } + void Profile(FoldingSetNodeID& ID) const { ID = FastID; } }; //===----------------------------------------------------------------------===// @@ -559,9 +671,6 @@ static inline void Profile(const T* X, FoldingSetNodeID& ID) { ID.AddPointer(X); } - static inline void Profile(T* X, FoldingSetNodeID& ID) { - ID.AddPointer(X); - } }; template struct FoldingSetTrait { Modified: llvm/trunk/lib/Support/FoldingSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=111130&r1=111129&r2=111130&view=diff ============================================================================== --- llvm/trunk/lib/Support/FoldingSet.cpp (original) +++ llvm/trunk/lib/Support/FoldingSet.cpp Mon Aug 16 10:30:39 2010 @@ -23,6 +23,37 @@ using namespace llvm; //===----------------------------------------------------------------------===// +// FoldingSetNodeIDRef Implementation + +/// ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef, +/// used to lookup the node in the FoldingSetImpl. +unsigned FoldingSetNodeIDRef::ComputeHash() const { + // This is adapted from SuperFastHash by Paul Hsieh. + unsigned Hash = static_cast(Size); + for (const unsigned *BP = Data, *E = BP+Size; BP != E; ++BP) { + unsigned Data = *BP; + Hash += Data & 0xFFFF; + unsigned Tmp = ((Data >> 16) << 11) ^ Hash; + Hash = (Hash << 16) ^ Tmp; + Hash += Hash >> 11; + } + + // Force "avalanching" of final 127 bits. + Hash ^= Hash << 3; + Hash += Hash >> 5; + Hash ^= Hash << 4; + Hash += Hash >> 17; + Hash ^= Hash << 25; + Hash += Hash >> 6; + return Hash; +} + +bool FoldingSetNodeIDRef::operator==(FoldingSetNodeIDRef RHS) const { + if (Size != RHS.Size) return false; + return memcmp(Data, RHS.Data, Size*sizeof(*Data)) == 0; +} + +//===----------------------------------------------------------------------===// // FoldingSetNodeID Implementation /// Add* - Add various data types to Bit data. @@ -104,31 +135,19 @@ /// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used to /// lookup the node in the FoldingSetImpl. unsigned FoldingSetNodeID::ComputeHash() const { - // This is adapted from SuperFastHash by Paul Hsieh. - unsigned Hash = static_cast(Bits.size()); - for (const unsigned *BP = &Bits[0], *E = BP+Bits.size(); BP != E; ++BP) { - unsigned Data = *BP; - Hash += Data & 0xFFFF; - unsigned Tmp = ((Data >> 16) << 11) ^ Hash; - Hash = (Hash << 16) ^ Tmp; - Hash += Hash >> 11; - } - - // Force "avalanching" of final 127 bits. - Hash ^= Hash << 3; - Hash += Hash >> 5; - Hash ^= Hash << 4; - Hash += Hash >> 17; - Hash ^= Hash << 25; - Hash += Hash >> 6; - return Hash; + return FoldingSetNodeIDRef(&Bits[0], Bits.size()).ComputeHash(); } /// operator== - Used to compare two nodes to each other. /// bool FoldingSetNodeID::operator==(const FoldingSetNodeID &RHS)const{ - if (Bits.size() != RHS.Bits.size()) return false; - return memcmp(&Bits[0], &RHS.Bits[0], Bits.size()*sizeof(Bits[0])) == 0; + return *this == FoldingSetNodeIDRef(&RHS.Bits[0], RHS.Bits.size()); +} + +/// operator== - Used to compare two nodes to each other. +/// +bool FoldingSetNodeID::operator==(FoldingSetNodeIDRef RHS) const { + return FoldingSetNodeIDRef(&Bits[0], Bits.size()) == RHS; } /// Intern - Copy this node's data to a memory region allocated from the @@ -168,10 +187,9 @@ /// GetBucketFor - Hash the specified node ID and return the hash bucket for /// the specified ID. -static void **GetBucketFor(const FoldingSetNodeID &ID, - void **Buckets, unsigned NumBuckets) { +static void **GetBucketFor(unsigned Hash, void **Buckets, unsigned NumBuckets) { // NumBuckets is always a power of 2. - unsigned BucketNum = ID.ComputeHash() & (NumBuckets-1); + unsigned BucketNum = Hash & (NumBuckets-1); return Buckets + BucketNum; } @@ -219,7 +237,7 @@ NumNodes = 0; // Walk the old buckets, rehashing nodes into their new place. - FoldingSetNodeID ID; + FoldingSetNodeID TempID; for (unsigned i = 0; i != OldNumBuckets; ++i) { void *Probe = OldBuckets[i]; if (!Probe) continue; @@ -229,9 +247,10 @@ NodeInBucket->SetNextInBucket(0); // Insert the node into the new bucket, after recomputing the hash. - GetNodeProfile(NodeInBucket, ID); - InsertNode(NodeInBucket, GetBucketFor(ID, Buckets, NumBuckets)); - ID.clear(); + InsertNode(NodeInBucket, + GetBucketFor(ComputeNodeHash(NodeInBucket, TempID), + Buckets, NumBuckets)); + TempID.clear(); } } @@ -245,19 +264,18 @@ *FoldingSetImpl::FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos) { - void **Bucket = GetBucketFor(ID, Buckets, NumBuckets); + void **Bucket = GetBucketFor(ID.ComputeHash(), Buckets, NumBuckets); void *Probe = *Bucket; InsertPos = 0; - FoldingSetNodeID OtherID; + FoldingSetNodeID TempID; while (Node *NodeInBucket = GetNextPtr(Probe)) { - GetNodeProfile(NodeInBucket, OtherID); - if (OtherID == ID) + if (NodeEquals(NodeInBucket, ID, TempID)) return NodeInBucket; + TempID.clear(); Probe = NodeInBucket->getNextInBucket(); - OtherID.clear(); } // Didn't find the node, return null with the bucket as the InsertPos. @@ -273,9 +291,8 @@ // Do we need to grow the hashtable? if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); - FoldingSetNodeID ID; - GetNodeProfile(N, ID); - InsertPos = GetBucketFor(ID, Buckets, NumBuckets); + FoldingSetNodeID TempID; + InsertPos = GetBucketFor(ComputeNodeHash(N, TempID), Buckets, NumBuckets); } ++NumNodes; From gohman at apple.com Mon Aug 16 10:31:45 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:31:45 -0000 Subject: [llvm-commits] [llvm] r111131 - /llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Message-ID: <20100816153145.728442A6C12C@llvm.org> Author: djg Date: Mon Aug 16 10:31:45 2010 New Revision: 111131 URL: http://llvm.org/viewvc/llvm-project?rev=111131&view=rev Log: Specialize FoldingSetTrait, providing implementations of node comparison and hash computation which don't require constructing temporary ID values. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=111131&r1=111130&r2=111131&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Aug 16 10:31:45 2010 @@ -45,12 +45,16 @@ class LoopInfo; class Operator; class SCEVUnknown; + class SCEV; + template<> class FoldingSetTrait; /// SCEV - This class represents an analyzed expression in the program. These /// are opaque objects that the client is not allowed to do much with /// directly. /// class SCEV : public FoldingSetNode { + friend class FoldingSetTrait; + /// FastID - A reference to an Interned FoldingSetNodeID for this node. /// The ScalarEvolution's BumpPtrAllocator holds the data. FoldingSetNodeIDRef FastID; @@ -74,9 +78,6 @@ unsigned getSCEVType() const { return SCEVType; } - /// Profile - FoldingSet support. - void Profile(FoldingSetNodeID& ID) { ID = FastID; } - /// isLoopInvariant - Return true if the value of this SCEV is unchanging in /// the specified loop. virtual bool isLoopInvariant(const Loop *L) const = 0; @@ -126,6 +127,21 @@ void dump() const; }; + // Specialize FoldingSetTrait for SCEV to avoid needing to compute + // temporary FoldingSetNodeID values. + template<> struct FoldingSetTrait : DefaultFoldingSetTrait { + static void Profile(const SCEV &X, FoldingSetNodeID& ID) { + ID = X.FastID; + } + static bool Equals(const SCEV &X, const FoldingSetNodeID &ID, + FoldingSetNodeID &TempID) { + return ID == X.FastID; + } + static unsigned ComputeHash(const SCEV &X, FoldingSetNodeID &TempID) { + return X.FastID.ComputeHash(); + } + }; + inline raw_ostream &operator<<(raw_ostream &OS, const SCEV &S) { S.print(OS); return OS; From gohman at apple.com Mon Aug 16 10:39:28 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:39:28 -0000 Subject: [llvm-commits] [llvm] r111132 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <20100816153928.1953F2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 10:39:27 2010 New Revision: 111132 URL: http://llvm.org/viewvc/llvm-project?rev=111132&view=rev Log: Put add operands in ScalarEvolution-canonical order, when convenient. This isn't necessary, because ScalarEvolution sorts them anyway, but it's tidier this way. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=111132&r1=111131&r2=111132&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Aug 16 10:39:27 2010 @@ -1601,7 +1601,7 @@ const SCEV *One = SE.getConstant(BackedgeTakenCount->getType(), 1); // Add one to the backedge-taken count to get the trip count. - const SCEV *IterationCount = SE.getAddExpr(BackedgeTakenCount, One); + const SCEV *IterationCount = SE.getAddExpr(One, BackedgeTakenCount); if (IterationCount != SE.getSCEV(Sel)) return Cond; // Check for a max calculation that matches the pattern. There's no check @@ -2400,7 +2400,7 @@ if (isLegalUse(F.AM, LU.MinOffset - *I, LU.MaxOffset - *I, LU.Kind, LU.AccessTy, TLI)) { // Add the offset to the base register. - const SCEV *NewG = SE.getAddExpr(G, SE.getConstant(G->getType(), *I)); + const SCEV *NewG = SE.getAddExpr(SE.getConstant(G->getType(), *I), G); // If it cancelled out, drop the base register, otherwise update it. if (NewG->isZero()) { std::swap(F.BaseRegs[i], F.BaseRegs.back()); From gohman at apple.com Mon Aug 16 10:50:00 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:50:00 -0000 Subject: [llvm-commits] [llvm] r111133 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <20100816155001.015D32A6C130@llvm.org> Author: djg Date: Mon Aug 16 10:50:00 2010 New Revision: 111133 URL: http://llvm.org/viewvc/llvm-project?rev=111133&view=rev Log: Instead of having CollectSubexpr's categorize operands as interesting or uninteresting, just put all the operands on one list and make GenerateReassociations make the decision about what's interesting. This is simpler, and it avoids an extra ScalarEvolution::getAddExpr call. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=111133&r1=111132&r2=111133&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Aug 16 10:50:00 2010 @@ -2230,14 +2230,13 @@ /// separate registers. If C is non-null, multiply each subexpression by C. static void CollectSubexprs(const SCEV *S, const SCEVConstant *C, SmallVectorImpl &Ops, - SmallVectorImpl &UninterestingOps, const Loop *L, ScalarEvolution &SE) { if (const SCEVAddExpr *Add = dyn_cast(S)) { // Break out add operands. for (SCEVAddExpr::op_iterator I = Add->op_begin(), E = Add->op_end(); I != E; ++I) - CollectSubexprs(*I, C, Ops, UninterestingOps, L, SE); + CollectSubexprs(*I, C, Ops, L, SE); return; } else if (const SCEVAddRecExpr *AR = dyn_cast(S)) { // Split a non-zero base out of an addrec. @@ -2245,8 +2244,8 @@ CollectSubexprs(SE.getAddRecExpr(SE.getConstant(AR->getType(), 0), AR->getStepRecurrence(SE), AR->getLoop()), - C, Ops, UninterestingOps, L, SE); - CollectSubexprs(AR->getStart(), C, Ops, UninterestingOps, L, SE); + C, Ops, L, SE); + CollectSubexprs(AR->getStart(), C, Ops, L, SE); return; } } else if (const SCEVMulExpr *Mul = dyn_cast(S)) { @@ -2256,17 +2255,13 @@ dyn_cast(Mul->getOperand(0))) { CollectSubexprs(Mul->getOperand(1), C ? cast(SE.getMulExpr(C, Op0)) : Op0, - Ops, UninterestingOps, L, SE); + Ops, L, SE); return; } } - // Otherwise use the value itself. Loop-variant "unknown" values are - // uninteresting; we won't be able to do anything meaningful with them. - if (!C && isa(S) && !S->isLoopInvariant(L)) - UninterestingOps.push_back(S); - else - Ops.push_back(C ? SE.getMulExpr(C, S) : S); + // Otherwise use the value itself, optionally with a scale applied. + Ops.push_back(C ? SE.getMulExpr(C, S) : S); } /// GenerateReassociations - Split out subexpressions from adds and the bases of @@ -2280,19 +2275,19 @@ for (size_t i = 0, e = Base.BaseRegs.size(); i != e; ++i) { const SCEV *BaseReg = Base.BaseRegs[i]; - SmallVector AddOps, UninterestingAddOps; - CollectSubexprs(BaseReg, 0, AddOps, UninterestingAddOps, L, SE); - - // Add any uninteresting values as one register, as we won't be able to - // form any interesting reassociation opportunities with them. They'll - // just have to be added inside the loop no matter what we do. - if (!UninterestingAddOps.empty()) - AddOps.push_back(SE.getAddExpr(UninterestingAddOps)); + SmallVector AddOps; + CollectSubexprs(BaseReg, 0, AddOps, L, SE); if (AddOps.size() == 1) continue; for (SmallVectorImpl::const_iterator J = AddOps.begin(), JE = AddOps.end(); J != JE; ++J) { + + // Loop-variant "unknown" values are uninteresting; we won't be able to + // do anything meaningful with them. + if (isa(*J) && !(*J)->isLoopInvariant(L)) + continue; + // Don't pull a constant into a register if the constant could be folded // into an immediate field. if (isAlwaysFoldable(*J, LU.MinOffset, LU.MaxOffset, From gohman at apple.com Mon Aug 16 10:57:14 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 15:57:14 -0000 Subject: [llvm-commits] [llvm] r111135 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816155714.DE7652A6C12C@llvm.org> Author: djg Date: Mon Aug 16 10:57:14 2010 New Revision: 111135 URL: http://llvm.org/viewvc/llvm-project?rev=111135&view=rev Log: Delete an unused function. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111135&r1=111134&r2=111135&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 10:57:14 2010 @@ -483,41 +483,6 @@ // SCEV Utilities //===----------------------------------------------------------------------===// -static bool CompareTypes(const Type *A, const Type *B) { - if (A->getTypeID() != B->getTypeID()) - return A->getTypeID() < B->getTypeID(); - if (const IntegerType *AI = dyn_cast(A)) { - const IntegerType *BI = cast(B); - return AI->getBitWidth() < BI->getBitWidth(); - } - if (const PointerType *AI = dyn_cast(A)) { - const PointerType *BI = cast(B); - return CompareTypes(AI->getElementType(), BI->getElementType()); - } - if (const ArrayType *AI = dyn_cast(A)) { - const ArrayType *BI = cast(B); - if (AI->getNumElements() != BI->getNumElements()) - return AI->getNumElements() < BI->getNumElements(); - return CompareTypes(AI->getElementType(), BI->getElementType()); - } - if (const VectorType *AI = dyn_cast(A)) { - const VectorType *BI = cast(B); - if (AI->getNumElements() != BI->getNumElements()) - return AI->getNumElements() < BI->getNumElements(); - return CompareTypes(AI->getElementType(), BI->getElementType()); - } - if (const StructType *AI = dyn_cast(A)) { - const StructType *BI = cast(B); - if (AI->getNumElements() != BI->getNumElements()) - return AI->getNumElements() < BI->getNumElements(); - for (unsigned i = 0, e = AI->getNumElements(); i != e; ++i) - if (CompareTypes(AI->getElementType(i), BI->getElementType(i)) || - CompareTypes(BI->getElementType(i), AI->getElementType(i))) - return CompareTypes(AI->getElementType(i), BI->getElementType(i)); - } - return false; -} - namespace { /// SCEVComplexityCompare - Return true if the complexity of the LHS is less /// than the complexity of the RHS. This comparator is used to canonicalize From gohman at apple.com Mon Aug 16 11:03:49 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:03:49 -0000 Subject: [llvm-commits] [llvm] r111136 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816160349.ABA582A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:03:49 2010 New Revision: 111136 URL: http://llvm.org/viewvc/llvm-project?rev=111136&view=rev Log: Make one getAddExpr call when analyzing a+b+c+d+e+... instead of one for each add instruction. Ditto for Mul. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111136&r1=111135&r2=111136&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:03:49 2010 @@ -3244,12 +3244,37 @@ Operator *U = cast(V); switch (Opcode) { - case Instruction::Add: - return getAddExpr(getSCEV(U->getOperand(0)), - getSCEV(U->getOperand(1))); - case Instruction::Mul: - return getMulExpr(getSCEV(U->getOperand(0)), - getSCEV(U->getOperand(1))); + case Instruction::Add: { + // The simple thing to do would be to just call getSCEV on both operands + // and call getAddExpr with the result. However if we're looking at a + // bunch of things all added together, this can be quite inefficient, + // because it leads to N-1 getAddExpr calls for N ultimate operands. + // Instead, gather up all the operands and make a single getAddExpr call. + // LLVM IR canonical form means we need only traverse the left operands. + SmallVector AddOps; + AddOps.push_back(getSCEV(U->getOperand(1))); + for (Value *Op = U->getOperand(0); + Op->getValueID() == Instruction::Add + Value::InstructionVal; + Op = U->getOperand(0)) { + U = cast(Op); + AddOps.push_back(getSCEV(U->getOperand(1))); + } + AddOps.push_back(getSCEV(U->getOperand(0))); + return getAddExpr(AddOps); + } + case Instruction::Mul: { + // See the Add code above. + SmallVector MulOps; + MulOps.push_back(getSCEV(U->getOperand(1))); + for (Value *Op = U->getOperand(0); + Op->getValueID() == Instruction::Mul + Value::InstructionVal; + Op = U->getOperand(0)) { + U = cast(Op); + MulOps.push_back(getSCEV(U->getOperand(1))); + } + MulOps.push_back(getSCEV(U->getOperand(0))); + return getMulExpr(MulOps); + } case Instruction::UDiv: return getUDivExpr(getSCEV(U->getOperand(0)), getSCEV(U->getOperand(1))); From gohman at apple.com Mon Aug 16 11:13:55 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:13:55 -0000 Subject: [llvm-commits] [llvm] r111137 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816161355.29A9D2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:13:54 2010 New Revision: 111137 URL: http://llvm.org/viewvc/llvm-project?rev=111137&view=rev Log: Avoid gratuitous inefficiency in ifndef NDEBUG code. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111137&r1=111136&r2=111137&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:13:54 2010 @@ -1667,9 +1667,9 @@ assert(!Ops.empty() && "Cannot get empty mul!"); if (Ops.size() == 1) return Ops[0]; #ifndef NDEBUG + const Type *ETy = getEffectiveSCEVType(Ops[0]->getType()); for (unsigned i = 1, e = Ops.size(); i != e; ++i) - assert(getEffectiveSCEVType(Ops[i]->getType()) == - getEffectiveSCEVType(Ops[0]->getType()) && + assert(getEffectiveSCEVType(Ops[i]->getType()) == ETy && "SCEVMulExpr operand types don't match!"); #endif @@ -1989,9 +1989,9 @@ bool HasNUW, bool HasNSW) { if (Operands.size() == 1) return Operands[0]; #ifndef NDEBUG + const Type *ETy = getEffectiveSCEVType(Operands[0]->getType()); for (unsigned i = 1, e = Operands.size(); i != e; ++i) - assert(getEffectiveSCEVType(Operands[i]->getType()) == - getEffectiveSCEVType(Operands[0]->getType()) && + assert(getEffectiveSCEVType(Operands[i]->getType()) == ETy && "SCEVAddRecExpr operand types don't match!"); #endif @@ -2089,9 +2089,9 @@ assert(!Ops.empty() && "Cannot get empty smax!"); if (Ops.size() == 1) return Ops[0]; #ifndef NDEBUG + const Type *ETy = getEffectiveSCEVType(Ops[0]->getType()); for (unsigned i = 1, e = Ops.size(); i != e; ++i) - assert(getEffectiveSCEVType(Ops[i]->getType()) == - getEffectiveSCEVType(Ops[0]->getType()) && + assert(getEffectiveSCEVType(Ops[i]->getType()) == ETy && "SCEVSMaxExpr operand types don't match!"); #endif @@ -2194,9 +2194,9 @@ assert(!Ops.empty() && "Cannot get empty umax!"); if (Ops.size() == 1) return Ops[0]; #ifndef NDEBUG + const Type *ETy = getEffectiveSCEVType(Ops[0]->getType()); for (unsigned i = 1, e = Ops.size(); i != e; ++i) - assert(getEffectiveSCEVType(Ops[i]->getType()) == - getEffectiveSCEVType(Ops[0]->getType()) && + assert(getEffectiveSCEVType(Ops[i]->getType()) == ETy && "SCEVUMaxExpr operand types don't match!"); #endif From gohman at apple.com Mon Aug 16 11:16:11 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:16:11 -0000 Subject: [llvm-commits] [llvm] r111138 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816161611.656E42A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:16:11 2010 New Revision: 111138 URL: http://llvm.org/viewvc/llvm-project?rev=111138&view=rev Log: Use iterators instead of indices in simple cases. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111138&r1=111137&r2=111138&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:16:11 2010 @@ -258,18 +258,16 @@ } bool SCEVNAryExpr::dominates(BasicBlock *BB, DominatorTree *DT) const { - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { - if (!getOperand(i)->dominates(BB, DT)) + for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) + if (!(*I)->dominates(BB, DT)) return false; - } return true; } bool SCEVNAryExpr::properlyDominates(BasicBlock *BB, DominatorTree *DT) const { - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { - if (!getOperand(i)->properlyDominates(BB, DT)) + for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) + if (!(*I)->properlyDominates(BB, DT)) return false; - } return true; } From gohman at apple.com Mon Aug 16 11:21:28 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:21:28 -0000 Subject: [llvm-commits] [llvm] r111140 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolutionExpressions.h lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816162128.2D0502A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:21:27 2010 New Revision: 111140 URL: http://llvm.org/viewvc/llvm-project?rev=111140&view=rev Log: Move SCEVNAryExpr's virtual member functions out of line, and convert them to iterators. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=111140&r1=111139&r2=111140&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Mon Aug 16 11:21:27 2010 @@ -208,33 +208,14 @@ op_iterator op_begin() const { return Operands; } op_iterator op_end() const { return Operands + NumOperands; } - virtual bool isLoopInvariant(const Loop *L) const { - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - if (!getOperand(i)->isLoopInvariant(L)) return false; - return true; - } + virtual bool isLoopInvariant(const Loop *L) const; // hasComputableLoopEvolution - N-ary expressions have computable loop // evolutions iff they have at least one operand that varies with the loop, // but that all varying operands are computable. - virtual bool hasComputableLoopEvolution(const Loop *L) const { - bool HasVarying = false; - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - if (!getOperand(i)->isLoopInvariant(L)) { - if (getOperand(i)->hasComputableLoopEvolution(L)) - HasVarying = true; - else - return false; - } - return HasVarying; - } + virtual bool hasComputableLoopEvolution(const Loop *L) const; - virtual bool hasOperand(const SCEV *O) const { - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - if (O == getOperand(i) || getOperand(i)->hasOperand(O)) - return true; - return false; - } + virtual bool hasOperand(const SCEV *O) const; bool dominates(BasicBlock *BB, DominatorTree *DT) const; Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111140&r1=111139&r2=111140&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:21:27 2010 @@ -271,6 +271,39 @@ return true; } +bool SCEVNAryExpr::isLoopInvariant(const Loop *L) const { + for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) + if (!(*I)->isLoopInvariant(L)) + return false; + return true; +} + +// hasComputableLoopEvolution - N-ary expressions have computable loop +// evolutions iff they have at least one operand that varies with the loop, +// but that all varying operands are computable. +bool SCEVNAryExpr::hasComputableLoopEvolution(const Loop *L) const { + bool HasVarying = false; + for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) { + const SCEV *S = *I; + if (!S->isLoopInvariant(L)) { + if (S->hasComputableLoopEvolution(L)) + HasVarying = true; + else + return false; + } + } + return HasVarying; +} + +bool SCEVNAryExpr::hasOperand(const SCEV *O) const { + for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) { + const SCEV *S = *I; + if (O == S || S->hasOperand(O)) + return true; + } + return false; +} + bool SCEVUDivExpr::dominates(BasicBlock *BB, DominatorTree *DT) const { return LHS->dominates(BB, DT) && RHS->dominates(BB, DT); } From gohman at apple.com Mon Aug 16 11:25:36 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:25:36 -0000 Subject: [llvm-commits] [llvm] r111142 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816162536.3E3B32A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:25:35 2010 New Revision: 111142 URL: http://llvm.org/viewvc/llvm-project?rev=111142&view=rev Log: Micro-optimize SCEVConstant comparison. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111142&r1=111141&r2=111142&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:25:35 2010 @@ -590,12 +590,12 @@ // Compare constant values. if (const SCEVConstant *LC = dyn_cast(LHS)) { const SCEVConstant *RC = cast(RHS); - const ConstantInt *LCC = LC->getValue(); - const ConstantInt *RCC = RC->getValue(); - unsigned LBitWidth = LCC->getBitWidth(), RBitWidth = RCC->getBitWidth(); + const APInt &LA = LC->getValue()->getValue(); + const APInt &RA = RC->getValue()->getValue(); + unsigned LBitWidth = LA.getBitWidth(), RBitWidth = RA.getBitWidth(); if (LBitWidth != RBitWidth) return LBitWidth < RBitWidth; - return LCC->getValue().ult(RCC->getValue()); + return LA.ult(RA); } // Compare addrec loop depths. From gohman at apple.com Mon Aug 16 11:27:53 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:27:53 -0000 Subject: [llvm-commits] [llvm] r111143 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816162753.A634D2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:27:53 2010 New Revision: 111143 URL: http://llvm.org/viewvc/llvm-project?rev=111143&view=rev Log: Use iterators instead of indices in a few more places. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111143&r1=111142&r2=111143&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:27:53 2010 @@ -1343,8 +1343,9 @@ // If HasNSW is true and all the operands are non-negative, infer HasNUW. if (!HasNUW && HasNSW) { bool All = true; - for (unsigned i = 0, e = Ops.size(); i != e; ++i) - if (!isKnownNonNegative(Ops[i])) { + for (SmallVectorImpl::const_iterator I = Ops.begin(), + E = Ops.end(); I != E; ++I) + if (!isKnownNonNegative(*I)) { All = false; break; } @@ -1707,8 +1708,9 @@ // If HasNSW is true and all the operands are non-negative, infer HasNUW. if (!HasNUW && HasNSW) { bool All = true; - for (unsigned i = 0, e = Ops.size(); i != e; ++i) - if (!isKnownNonNegative(Ops[i])) { + for (SmallVectorImpl::const_iterator I = Ops.begin(), + E = Ops.end(); I != E; ++I) + if (!isKnownNonNegative(*I)) { All = false; break; } @@ -2040,8 +2042,9 @@ // If HasNSW is true and all the operands are non-negative, infer HasNUW. if (!HasNUW && HasNSW) { bool All = true; - for (unsigned i = 0, e = Operands.size(); i != e; ++i) - if (!isKnownNonNegative(Operands[i])) { + for (SmallVectorImpl::const_iterator I = Operands.begin(), + E = Operands.end(); I != E; ++I) + if (!isKnownNonNegative(*I)) { All = false; break; } From gohman at apple.com Mon Aug 16 11:30:01 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:30:01 -0000 Subject: [llvm-commits] [llvm] r111144 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816163001.C48972A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:30:01 2010 New Revision: 111144 URL: http://llvm.org/viewvc/llvm-project?rev=111144&view=rev Log: Use const_iterator in a few places. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111144&r1=111143&r2=111144&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:30:01 2010 @@ -1494,7 +1494,7 @@ // re-generate the operands list. Group the operands by constant scale, // to avoid multiplying by the same constant scale multiple times. std::map, APIntCompare> MulOpLists; - for (SmallVector::iterator I = NewOps.begin(), + for (SmallVector::const_iterator I = NewOps.begin(), E = NewOps.end(); I != E; ++I) MulOpLists[M.find(*I)->second].push_back(*I); // Re-generate the operands list. @@ -2465,7 +2465,7 @@ const SCEV *ScalarEvolution::getSCEV(Value *V) { assert(isSCEVable(V->getType()) && "Value is not SCEVable!"); - std::map::iterator I = Scalars.find(V); + std::map::const_iterator I = Scalars.find(V); if (I != Scalars.end()) return I->second; const SCEV *S = createSCEV(V); Scalars.insert(std::make_pair(SCEVCallbackVH(V, this), S)); @@ -4284,7 +4284,7 @@ ScalarEvolution::getConstantEvolutionLoopExitValue(PHINode *PN, const APInt &BEs, const Loop *L) { - std::map::iterator I = + std::map::const_iterator I = ConstantEvolutionLoopExitValue.find(PN); if (I != ConstantEvolutionLoopExitValue.end()) return I->second; From gohman at apple.com Mon Aug 16 11:31:39 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:31:39 -0000 Subject: [llvm-commits] [llvm] r111145 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816163139.A61BF2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:31:39 2010 New Revision: 111145 URL: http://llvm.org/viewvc/llvm-project?rev=111145&view=rev Log: Add a comment. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111145&r1=111144&r2=111145&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:31:39 2010 @@ -2468,6 +2468,11 @@ std::map::const_iterator I = Scalars.find(V); if (I != Scalars.end()) return I->second; const SCEV *S = createSCEV(V); + + // The process of creating a SCEV for V may have caused other SCEVs + // to have been created, so it's necessary to insert the new entry + // from scratch, rather than trying to remember the insert position + // above. Scalars.insert(std::make_pair(SCEVCallbackVH(V, this), S)); return S; } From gohman at apple.com Mon Aug 16 11:34:09 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:34:09 -0000 Subject: [llvm-commits] [llvm] r111147 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816163409.496782A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:34:09 2010 New Revision: 111147 URL: http://llvm.org/viewvc/llvm-project?rev=111147&view=rev Log: Tidy whitespace. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111147&r1=111146&r2=111147&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:34:09 2010 @@ -1851,15 +1851,14 @@ if (AddRec->getLoop() == OtherAddRec->getLoop()) { // F * G --> {A,+,B} * {C,+,D} --> {A*C,+,F*D + G*B + B*D} const SCEVAddRecExpr *F = AddRec, *G = OtherAddRec; - const SCEV *NewStart = getMulExpr(F->getStart(), - G->getStart()); + const SCEV *NewStart = getMulExpr(F->getStart(), G->getStart()); const SCEV *B = F->getStepRecurrence(*this); const SCEV *D = G->getStepRecurrence(*this); const SCEV *NewStep = getAddExpr(getMulExpr(F, D), - getMulExpr(G, B), - getMulExpr(B, D)); + getMulExpr(G, B), + getMulExpr(B, D)); const SCEV *NewAddRec = getAddRecExpr(NewStart, NewStep, - F->getLoop()); + F->getLoop()); if (Ops.size() == 2) return NewAddRec; Ops.erase(Ops.begin()+Idx); From sabre at nondot.org Mon Aug 16 11:35:20 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 16 Aug 2010 16:35:20 -0000 Subject: [llvm-commits] [llvm] r111148 - /llvm/trunk/lib/MC/MachObjectWriter.cpp Message-ID: <20100816163520.8EBE82A6C12C@llvm.org> Author: lattner Date: Mon Aug 16 11:35:20 2010 New Revision: 111148 URL: http://llvm.org/viewvc/llvm-project?rev=111148&view=rev Log: silence a vc2010 warning: " result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)", pointed out by 'nobled' on llvmdev Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=111148&r1=111147&r2=111148&view=diff ============================================================================== --- llvm/trunk/lib/MC/MachObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/MachObjectWriter.cpp Mon Aug 16 11:35:20 2010 @@ -769,7 +769,7 @@ IsPCRel = 1; FixedValue = (FixupAddress - Layout.getSymbolAddress(SD_B) + Target.getConstant()); - FixedValue += 1 << Log2Size; + FixedValue += 1ULL << Log2Size; } else { FixedValue = 0; } From bob.wilson at apple.com Mon Aug 16 11:39:59 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 16:39:59 -0000 Subject: [llvm-commits] [llvm] r111149 - /llvm/trunk/utils/buildit/GNUmakefile Message-ID: <20100816163959.AD6FF2A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 11:39:59 2010 New Revision: 111149 URL: http://llvm.org/viewvc/llvm-project?rev=111149&view=rev Log: Install Embedded builds into usr/local. Radar 8313723. Modified: llvm/trunk/utils/buildit/GNUmakefile Modified: llvm/trunk/utils/buildit/GNUmakefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/GNUmakefile?rev=111149&r1=111148&r2=111149&view=diff ============================================================================== --- llvm/trunk/utils/buildit/GNUmakefile (original) +++ llvm/trunk/utils/buildit/GNUmakefile Mon Aug 16 11:39:59 2010 @@ -71,14 +71,14 @@ $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) EmbeddedHosted: - $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr install + $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr/local install # When building for the iOS simulator, MACOSX_DEPLOYMENT_TARGET is not set # by default, but it needs to be set when building tools that run on the host # (e.g., tblgen), so set it here. EmbeddedSim: export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`; \ - $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr install + $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr/local install # installhdrs does nothing, because the headers aren't useful until # the compiler is installed. From gohman at apple.com Mon Aug 16 11:57:24 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 16:57:24 -0000 Subject: [llvm-commits] [llvm] r111151 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100816165724.B0FFC2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 11:57:24 2010 New Revision: 111151 URL: http://llvm.org/viewvc/llvm-project?rev=111151&view=rev Log: To create a copy of a SmallVector with an element removed from the middle, copy the elements in two groups, rather than copying all the elements and then doing an erase on the middle of the result. These are SmallVectors, so we shouldn't expect to hit dynamic allocation in the common case. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=111151&r1=111150&r2=111151&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 16 11:57:24 2010 @@ -1530,8 +1530,9 @@ if (Mul->getNumOperands() != 2) { // If the multiply has more than two operands, we must get the // Y*Z term. - SmallVector MulOps(Mul->op_begin(), Mul->op_end()); - MulOps.erase(MulOps.begin()+MulOp); + SmallVector MulOps(Mul->op_begin(), + Mul->op_begin()+MulOp); + MulOps.append(Mul->op_begin()+MulOp+1, Mul->op_end()); InnerMul = getMulExpr(MulOps); } const SCEV *One = getConstant(Ty, 1); @@ -1564,15 +1565,15 @@ const SCEV *InnerMul1 = Mul->getOperand(MulOp == 0); if (Mul->getNumOperands() != 2) { SmallVector MulOps(Mul->op_begin(), - Mul->op_end()); - MulOps.erase(MulOps.begin()+MulOp); + Mul->op_begin()+MulOp); + MulOps.append(Mul->op_begin()+MulOp+1, Mul->op_end()); InnerMul1 = getMulExpr(MulOps); } const SCEV *InnerMul2 = OtherMul->getOperand(OMulOp == 0); if (OtherMul->getNumOperands() != 2) { SmallVector MulOps(OtherMul->op_begin(), - OtherMul->op_end()); - MulOps.erase(MulOps.begin()+OMulOp); + OtherMul->op_begin()+OMulOp); + MulOps.append(OtherMul->op_begin()+OMulOp+1, OtherMul->op_end()); InnerMul2 = getMulExpr(MulOps); } const SCEV *InnerMulSum = getAddExpr(InnerMul1,InnerMul2); From gohman at apple.com Mon Aug 16 12:01:55 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 17:01:55 -0000 Subject: [llvm-commits] [llvm] r111152 - /llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Message-ID: <20100816170155.47D132A6C12C@llvm.org> Author: djg Date: Mon Aug 16 12:01:55 2010 New Revision: 111152 URL: http://llvm.org/viewvc/llvm-project?rev=111152&view=rev Log: Placate overzealous compiler warnings. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=111152&r1=111151&r2=111152&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Aug 16 12:01:55 2010 @@ -46,14 +46,14 @@ class Operator; class SCEVUnknown; class SCEV; - template<> class FoldingSetTrait; + template<> struct FoldingSetTrait; /// SCEV - This class represents an analyzed expression in the program. These /// are opaque objects that the client is not allowed to do much with /// directly. /// class SCEV : public FoldingSetNode { - friend class FoldingSetTrait; + friend struct FoldingSetTrait; /// FastID - A reference to an Interned FoldingSetNodeID for this node. /// The ScalarEvolution's BumpPtrAllocator holds the data. From bob.wilson at apple.com Mon Aug 16 12:05:27 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 17:05:27 -0000 Subject: [llvm-commits] [llvm] r111153 - /llvm/trunk/test/CodeGen/ARM/pack.ll Message-ID: <20100816170527.B4BD52A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 12:05:27 2010 New Revision: 111153 URL: http://llvm.org/viewvc/llvm-project?rev=111153&view=rev Log: Convert a test to use FileCheck. Modified: llvm/trunk/test/CodeGen/ARM/pack.ll Modified: llvm/trunk/test/CodeGen/ARM/pack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/pack.ll?rev=111153&r1=111152&r2=111153&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/pack.ll (original) +++ llvm/trunk/test/CodeGen/ARM/pack.ll Mon Aug 16 12:05:27 2010 @@ -1,8 +1,7 @@ -; RUN: llc < %s -march=arm -mattr=+v6 | \ -; RUN: grep pkhbt | count 5 -; RUN: llc < %s -march=arm -mattr=+v6 | \ -; RUN: grep pkhtb | count 4 +; RUN: llc < %s -march=arm -mattr=+v6 | FileCheck %s +; CHECK: test1 +; CHECK: pkhbt r0, r0, r1, lsl #16 define i32 @test1(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp4 = shl i32 %Y, 16 ; [#uses=1] @@ -10,6 +9,8 @@ ret i32 %tmp5 } +; CHECK: test1a +; CHECK: pkhbt r0, r0, r1, lsl #16 define i32 @test1a(i32 %X, i32 %Y) { %tmp19 = and i32 %X, 65535 ; [#uses=1] %tmp37 = shl i32 %Y, 16 ; [#uses=1] @@ -17,6 +18,8 @@ ret i32 %tmp5 } +; CHECK: test2 +; CHECK: pkhbt r0, r0, r1, lsl #12 define i32 @test2(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = shl i32 %Y, 12 ; [#uses=1] @@ -25,6 +28,8 @@ ret i32 %tmp57 } +; CHECK: test3 +; CHECK: pkhbt r0, r0, r1, lsl #18 define i32 @test3(i32 %X, i32 %Y) { %tmp19 = and i32 %X, 65535 ; [#uses=1] %tmp37 = shl i32 %Y, 18 ; [#uses=1] @@ -32,6 +37,8 @@ ret i32 %tmp5 } +; CHECK: test4 +; CHECK: pkhbt r0, r0, r1 define i32 @test4(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = and i32 %Y, -65536 ; [#uses=1] @@ -39,6 +46,8 @@ ret i32 %tmp46 } +; CHECK: test5 +; CHECK: pkhtb r0, r0, r1, asr #16 define i32 @test5(i32 %X, i32 %Y) { %tmp17 = and i32 %X, -65536 ; [#uses=1] %tmp2 = bitcast i32 %Y to i32 ; [#uses=1] @@ -47,6 +56,8 @@ ret i32 %tmp5 } +; CHECK: test5a +; CHECK: pkhtb r0, r0, r1, asr #16 define i32 @test5a(i32 %X, i32 %Y) { %tmp110 = and i32 %X, -65536 ; [#uses=1] %tmp37 = lshr i32 %Y, 16 ; [#uses=1] @@ -55,6 +66,8 @@ ret i32 %tmp5 } +; CHECK: test6 +; CHECK: pkhtb r0, r0, r1, asr #12 define i32 @test6(i32 %X, i32 %Y) { %tmp1 = and i32 %X, -65536 ; [#uses=1] %tmp37 = lshr i32 %Y, 12 ; [#uses=1] @@ -64,6 +77,8 @@ ret i32 %tmp59 } +; CHECK: test7 +; CHECK: pkhtb r0, r0, r1, asr #18 define i32 @test7(i32 %X, i32 %Y) { %tmp1 = and i32 %X, -65536 ; [#uses=1] %tmp3 = ashr i32 %Y, 18 ; [#uses=1] From bob.wilson at apple.com Mon Aug 16 12:06:03 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 17:06:03 -0000 Subject: [llvm-commits] [llvm] r111154 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Message-ID: <20100816170603.F41842A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 12:06:03 2010 New Revision: 111154 URL: http://llvm.org/viewvc/llvm-project?rev=111154&view=rev Log: Remove unused code. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=111154&r1=111153&r2=111154&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Aug 16 12:06:03 2010 @@ -234,11 +234,6 @@ } /// Split a 32-bit immediate into two 16 bit parts. -def lo16 : SDNodeXFormgetTargetConstant((uint32_t)N->getZExtValue() & 0xffff, - MVT::i32); -}]>; - def hi16 : SDNodeXFormgetTargetConstant((uint32_t)N->getZExtValue() >> 16, MVT::i32); }]>; From stoklund at 2pi.dk Mon Aug 16 12:18:18 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 16 Aug 2010 17:18:18 -0000 Subject: [llvm-commits] [llvm] r111155 - /llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Message-ID: <20100816171818.374F52A6C12C@llvm.org> Author: stoklund Date: Mon Aug 16 12:18:18 2010 New Revision: 111155 URL: http://llvm.org/viewvc/llvm-project?rev=111155&view=rev Log: Remove unused functions. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=111155&r1=111154&r2=111155&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Mon Aug 16 12:18:18 2010 @@ -144,11 +144,6 @@ dbgs() << "\n"; } - /// isStackEmpty - Return true if the FP stack is empty. - bool isStackEmpty() const { - return StackTop == 0; - } - /// getSlot - Return the stack slot number a particular register number is /// in. unsigned getSlot(unsigned RegNo) const { @@ -577,9 +572,6 @@ friend bool operator<(const TableEntry &TE, unsigned V) { return TE.from < V; } - friend bool operator<(unsigned V, const TableEntry &TE) { - return V < TE.from; - } }; } From stoklund at 2pi.dk Mon Aug 16 12:18:20 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 16 Aug 2010 17:18:20 -0000 Subject: [llvm-commits] [llvm] r111156 - in /llvm/trunk/lib/CodeGen: LiveVariables.cpp LowerSubregs.cpp Message-ID: <20100816171820.BEA0D2A6C12D@llvm.org> Author: stoklund Date: Mon Aug 16 12:18:20 2010 New Revision: 111156 URL: http://llvm.org/viewvc/llvm-project?rev=111156&view=rev Log: Remove unused functions. Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=111156&r1=111155&r2=111156&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Mon Aug 16 12:18:20 2010 @@ -483,21 +483,6 @@ } } -namespace { - struct RegSorter { - const TargetRegisterInfo *TRI; - - RegSorter(const TargetRegisterInfo *tri) : TRI(tri) { } - bool operator()(unsigned A, unsigned B) { - if (TRI->isSubRegister(A, B)) - return true; - else if (TRI->isSubRegister(B, A)) - return false; - return A < B; - } - }; -} - bool LiveVariables::runOnMachineFunction(MachineFunction &mf) { MF = &mf; MRI = &mf.getRegInfo(); Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=111156&r1=111155&r2=111156&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Mon Aug 16 12:18:20 2010 @@ -58,9 +58,6 @@ void TransferDeadFlag(MachineInstr *MI, unsigned DstReg, const TargetRegisterInfo *TRI); - void TransferKillFlag(MachineInstr *MI, unsigned SrcReg, - const TargetRegisterInfo *TRI, - bool AddIfNotFound = false); void TransferImplicitDefs(MachineInstr *MI); }; @@ -87,23 +84,6 @@ } } -/// TransferKillFlag - MI is a pseudo-instruction with SrcReg killed, -/// and the lowered replacement instructions immediately precede it. -/// Mark the replacement instructions with the kill flag. -void -LowerSubregsInstructionPass::TransferKillFlag(MachineInstr *MI, - unsigned SrcReg, - const TargetRegisterInfo *TRI, - bool AddIfNotFound) { - for (MachineBasicBlock::iterator MII = - prior(MachineBasicBlock::iterator(MI)); ; --MII) { - if (MII->addRegisterKilled(SrcReg, TRI, AddIfNotFound)) - break; - assert(MII != MI->getParent()->begin() && - "copyPhysReg output doesn't reference source register!"); - } -} - /// TransferImplicitDefs - MI is a pseudo-instruction, and the lowered /// replacement instructions immediately precede it. Copy any implicit-def /// operands from MI to the replacement instruction. From gohman at apple.com Mon Aug 16 12:34:25 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 17:34:25 -0000 Subject: [llvm-commits] [llvm] r111160 - /llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Message-ID: <20100816173425.A33012A6C12C@llvm.org> Author: djg Date: Mon Aug 16 12:34:25 2010 New Revision: 111160 URL: http://llvm.org/viewvc/llvm-project?rev=111160&view=rev Log: Revert r111031. The way LLVM defines loop invariance, the property of an expression being loop invariant is not equivalent to the property of properly dominating the loop header. Other optimizations have also made this optimization less important. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=111160&r1=111159&r2=111160&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Mon Aug 16 12:34:25 2010 @@ -126,12 +126,6 @@ public: virtual void print(raw_ostream &OS) const; - virtual bool hasComputableLoopEvolution(const Loop *QL) const { - // Not computable. A truncate of an addrec is always folded into - // the addrec. - return false; - } - /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEVTruncateExpr *S) { return true; } static inline bool classof(const SCEV *S) { @@ -281,12 +275,6 @@ } public: - virtual bool hasComputableLoopEvolution(const Loop *QL) const { - // Not computable. An add of an addrec is always folded into the addrec - // if the other operands are loop-variant or loop-computable. - return false; - } - virtual const char *getOperationStr() const { return " + "; } virtual const Type *getType() const { @@ -315,12 +303,6 @@ } public: - virtual bool hasComputableLoopEvolution(const Loop *QL) const { - // Not computable. A mul of an addrec is always folded into the addrec - // if the other operands are loop-variant or loop-computable. - return false; - } - virtual const char *getOperationStr() const { return " * "; } /// Methods for support type inquiry through isa, cast, and dyn_cast: From grosbach at apple.com Mon Aug 16 13:06:15 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 16 Aug 2010 18:06:15 -0000 Subject: [llvm-commits] [llvm] r111164 - in /llvm/trunk: include/llvm/CodeGen/MachineFrameInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp Message-ID: <20100816180615.60BDD2A6C12D@llvm.org> Author: grosbach Date: Mon Aug 16 13:06:15 2010 New Revision: 111164 URL: http://llvm.org/viewvc/llvm-project?rev=111164&view=rev Log: track local frame size in MFI, not local to the pass, since PEI needs it. Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h?rev=111164&r1=111163&r2=111164&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h Mon Aug 16 13:06:15 2010 @@ -296,6 +296,9 @@ /// blob. int64_t getLocalFrameBaseOffset() const { return LocalFrameBaseOffset; } + /// setLocalFrameSize - Set the size of the local object blob. + void setLocalFrameSize(int64_t sz) { LocalFrameSize = sz; } + /// getLocalFrameSize - Get the size of the local object blob. int64_t getLocalFrameSize() const { return LocalFrameSize; } Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111164&r1=111163&r2=111164&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Mon Aug 16 13:06:15 2010 @@ -40,8 +40,6 @@ namespace { class LocalStackSlotPass: public MachineFunctionPass { - int64_t LocalStackSize; - void calculateFrameObjectOffsets(MachineFunction &Fn); public: static char ID; // Pass identification, replacement for typeid @@ -68,7 +66,6 @@ bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) { calculateFrameObjectOffsets(MF); - DEBUG(dbgs() << LocalStackSize << " bytes of local storage pre-allocated\n"); return true; } @@ -165,5 +162,5 @@ } // Remember how big this blob of stack space is - LocalStackSize = Offset; + MFI->setLocalFrameSize(Offset); } From stoklund at 2pi.dk Mon Aug 16 13:24:54 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 16 Aug 2010 18:24:54 -0000 Subject: [llvm-commits] [llvm] r111167 - /llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Message-ID: <20100816182454.F33632A6C12C@llvm.org> Author: stoklund Date: Mon Aug 16 13:24:54 2010 New Revision: 111167 URL: http://llvm.org/viewvc/llvm-project?rev=111167&view=rev Log: Partially revert r111155. It looks like MSVC is calling an operator<() that clang says is unused. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=111167&r1=111166&r2=111167&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Mon Aug 16 13:24:54 2010 @@ -572,6 +572,9 @@ friend bool operator<(const TableEntry &TE, unsigned V) { return TE.from < V; } + friend bool operator<(unsigned V, const TableEntry &TE) { + return V < TE.from; + } }; } From bob.wilson at apple.com Mon Aug 16 13:27:34 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 18:27:34 -0000 Subject: [llvm-commits] [llvm] r111168 - in /llvm/trunk: lib/Target/ARM/ARMAsmPrinter.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMInstrThumb2.td lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp lib/Target/ARM/AsmPrinter/ARMInstPrinter.h utils/TableGen/EDEmitter.cpp Message-ID: <20100816182735.112922A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 13:27:34 2010 New Revision: 111168 URL: http://llvm.org/viewvc/llvm-project?rev=111168&view=rev Log: Rename sat_shift operand to shift_imm, in preparation for using it for other instructions besides saturate instructions. No functional changes. Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h llvm/trunk/utils/TableGen/EDEmitter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=111168&r1=111167&r2=111168&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Mon Aug 16 13:27:34 2010 @@ -124,7 +124,7 @@ raw_ostream &O); void printMemBOption(const MachineInstr *MI, int OpNum, raw_ostream &O); - void printSatShiftOperand(const MachineInstr *MI, int OpNum, + void printShiftImmOperand(const MachineInstr *MI, int OpNum, raw_ostream &O); void printThumbS4ImmOperand(const MachineInstr *MI, int OpNum, @@ -680,7 +680,7 @@ O << ARM_MB::MemBOptToString(val); } -void ARMAsmPrinter::printSatShiftOperand(const MachineInstr *MI, int OpNum, +void ARMAsmPrinter::printShiftImmOperand(const MachineInstr *MI, int OpNum, raw_ostream &O) { unsigned ShiftOp = MI->getOperand(OpNum).getImm(); ARM_AM::ShiftOpc Opc = ARM_AM::getSORegShOp(ShiftOp); @@ -694,7 +694,7 @@ O << ", asr #"; break; default: - assert(0 && "unexpected shift opcode for saturate shift operand"); + assert(0 && "unexpected shift opcode for shift immediate operand"); } O << ARM_AM::getSORegOffset(ShiftOp); } Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=111168&r1=111167&r2=111168&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Aug 16 13:27:34 2010 @@ -296,6 +296,13 @@ let PrintMethod = "printPCLabel"; } +// shift_imm: An integer that encodes a shift amount and the type of shift +// (currently either asr or lsl) using the same encoding used for the +// immediates in so_reg operands. +def shift_imm : Operand { + let PrintMethod = "printShiftImmOperand"; +} + // shifter_operand operands: so_reg and so_imm. def so_reg : Operand, // reg reg imm ComplexPattern { - let PrintMethod = "printSatShiftOperand"; -} - -def SSAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, sat_shift:$sh), +def SSAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, shift_imm:$sh), SatFrm, NoItinerary, "ssat", "\t$dst, $bit_pos, $a$sh", [/* For disassembly only; pattern left blank */]> { let Inst{27-21} = 0b0110101; @@ -1823,7 +1826,7 @@ let Inst{7-4} = 0b0011; } -def USAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, sat_shift:$sh), +def USAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, shift_imm:$sh), SatFrm, NoItinerary, "usat", "\t$dst, $bit_pos, $a$sh", [/* For disassembly only; pattern left blank */]> { let Inst{27-21} = 0b0110111; Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=111168&r1=111167&r2=111168&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Mon Aug 16 13:27:34 2010 @@ -1523,7 +1523,7 @@ // Signed/Unsigned saturate -- for disassembly only -def t2SSAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, sat_shift:$sh), +def t2SSAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, shift_imm:$sh), NoItinerary, "ssat", "\t$dst, $bit_pos, $a$sh", [/* For disassembly only; pattern left blank */]> { let Inst{31-27} = 0b11110; @@ -1544,7 +1544,7 @@ let Inst{7-6} = 0b00; // imm2 = '00' } -def t2USAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, sat_shift:$sh), +def t2USAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, shift_imm:$sh), NoItinerary, "usat", "\t$dst, $bit_pos, $a$sh", [/* For disassembly only; pattern left blank */]> { let Inst{31-27} = 0b11110; Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp?rev=111168&r1=111167&r2=111168&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp Mon Aug 16 13:27:34 2010 @@ -478,7 +478,7 @@ O << ARM_MB::MemBOptToString(val); } -void ARMInstPrinter::printSatShiftOperand(const MCInst *MI, unsigned OpNum, +void ARMInstPrinter::printShiftImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O) { unsigned ShiftOp = MI->getOperand(OpNum).getImm(); ARM_AM::ShiftOpc Opc = ARM_AM::getSORegShOp(ShiftOp); @@ -492,7 +492,7 @@ O << ", asr #"; break; default: - assert(0 && "unexpected shift opcode for saturate shift operand"); + assert(0 && "unexpected shift opcode for shift immediate operand"); } O << ARM_AM::getSORegOffset(ShiftOp); } Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h?rev=111168&r1=111167&r2=111168&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h Mon Aug 16 13:27:34 2010 @@ -58,7 +58,7 @@ void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); void printMemBOption(const MCInst *MI, unsigned OpNum, raw_ostream &O); - void printSatShiftOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); + void printShiftImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O); void printThumbITMask(const MCInst *MI, unsigned OpNum, raw_ostream &O); Modified: llvm/trunk/utils/TableGen/EDEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/EDEmitter.cpp?rev=111168&r1=111167&r2=111168&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/EDEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/EDEmitter.cpp Mon Aug 16 13:27:34 2010 @@ -608,7 +608,7 @@ IMM("jt2block_operand"); IMM("t_imm_s4"); IMM("pclabel"); - IMM("sat_shift"); + IMM("shift_imm"); MISC("brtarget", "kOperandTypeARMBranchTarget"); // ? MISC("so_reg", "kOperandTypeARMSoReg"); // R, R, I From matt at console-pimps.org Mon Aug 16 13:33:46 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 18:33:46 -0000 Subject: [llvm-commits] [llvm] r111169 - in /llvm/trunk/include/llvm/MC: MCContext.h MCSectionELF.h Message-ID: <20100816183346.A4F602A6C12C@llvm.org> Author: mfleming Date: Mon Aug 16 13:33:46 2010 New Revision: 111169 URL: http://llvm.org/viewvc/llvm-project?rev=111169&view=rev Log: ELF entry size support. Some ELF sections contain fixed-sized entries. Provide a way to record the entry size of a section. Modified: llvm/trunk/include/llvm/MC/MCContext.h llvm/trunk/include/llvm/MC/MCSectionELF.h Modified: llvm/trunk/include/llvm/MC/MCContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=111169&r1=111168&r2=111169&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCContext.h (original) +++ llvm/trunk/include/llvm/MC/MCContext.h Mon Aug 16 13:33:46 2010 @@ -129,7 +129,8 @@ const MCSection *getELFSection(StringRef Section, unsigned Type, unsigned Flags, SectionKind Kind, - bool IsExplicit = false); + bool IsExplicit = false, + unsigned EntrySize = 0); const MCSection *getCOFFSection(StringRef Section, unsigned Characteristics, int Selection, SectionKind Kind); Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=111169&r1=111168&r2=111169&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCSectionELF.h (original) +++ llvm/trunk/include/llvm/MC/MCSectionELF.h Mon Aug 16 13:33:46 2010 @@ -35,6 +35,11 @@ /// IsExplicit - Indicates that this section comes from globals with an /// explicit section specified. bool IsExplicit; + + /// EntrySize - The size of each entry in this section. This size only + /// makes sense for sections that contain fixed-sized entries. If a + /// section does not contain fixed-sized entries 'EntrySize' will be 0. + unsigned EntrySize; private: friend class MCContext; From matt at console-pimps.org Mon Aug 16 13:34:31 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 18:34:31 -0000 Subject: [llvm-commits] [llvm] r111170 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp Message-ID: <20100816183431.602222A6C12C@llvm.org> Author: mfleming Date: Mon Aug 16 13:34:31 2010 New Revision: 111170 URL: http://llvm.org/viewvc/llvm-project?rev=111170&view=rev Log: Record a symbol's size which is needed for ELF symbol tables. Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/lib/MC/MCAssembler.cpp Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=111170&r1=111169&r2=111170&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Mon Aug 16 13:34:31 2010 @@ -24,6 +24,7 @@ class raw_ostream; class MCAsmLayout; class MCAssembler; +class MCBinaryExpr; class MCContext; class MCCodeEmitter; class MCExpr; @@ -453,6 +454,10 @@ // common symbol can never get a definition. uint64_t CommonSize; + /// SymbolSize - An expression describing how to calculate the size of + /// a symbol. If a symbol has no size this field will be NULL. + const MCExpr *SymbolSize; + /// CommonAlign - The alignment of the symbol, if it is 'common'. // // FIXME: Pack this in with other fields? @@ -510,6 +515,15 @@ return CommonSize; } + void setSize(const MCExpr *SS) { + SymbolSize = SS; + } + + const MCExpr *getSize() const { + return SymbolSize; + } + + /// getCommonAlignment - Return the alignment of a 'common' symbol. unsigned getCommonAlignment() const { assert(isCommon() && "Not a 'common' symbol!"); Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=111170&r1=111169&r2=111170&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Mon Aug 16 13:34:31 2010 @@ -211,7 +211,8 @@ uint64_t _Offset, MCAssembler *A) : Symbol(&_Symbol), Fragment(_Fragment), Offset(_Offset), IsExternal(false), IsPrivateExtern(false), - CommonSize(0), CommonAlign(0), Flags(0), Index(0) + CommonSize(0), SymbolSize(0), CommonAlign(0), + Flags(0), Index(0) { if (A) A->getSymbolList().push_back(this); From matt at console-pimps.org Mon Aug 16 13:35:06 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 18:35:06 -0000 Subject: [llvm-commits] [llvm] r111171 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp Message-ID: <20100816183506.5A9522A6C12C@llvm.org> Author: mfleming Date: Mon Aug 16 13:35:06 2010 New Revision: 111171 URL: http://llvm.org/viewvc/llvm-project?rev=111171&view=rev Log: Layout helper function. Introduce a helper method to add a section to the end of a layout. This will be used by the ELF ObjectWriter code to add the metadata sections (symbol table, etc) to the end of an object file. Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/lib/MC/MCAssembler.cpp Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=111171&r1=111170&r2=111171&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Mon Aug 16 13:35:06 2010 @@ -664,6 +664,8 @@ void WriteSectionData(const MCSectionData *Section, const MCAsmLayout &Layout, MCObjectWriter *OW) const; + void AddSectionToTheEnd(MCSectionData &SD, MCAsmLayout &Layout); + public: /// Construct a new assembler instance. /// Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=111171&r1=111170&r2=111171&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Mon Aug 16 13:35:06 2010 @@ -652,6 +652,40 @@ assert(OW->getStream().tell() - Start == Layout.getSectionFileSize(SD)); } +void MCAssembler::AddSectionToTheEnd(MCSectionData &SD, MCAsmLayout &Layout) { + // Create dummy fragments and assign section ordinals. + unsigned SectionIndex = 0; + for (MCAssembler::iterator it = begin(), ie = end(); it != ie; ++it) + SectionIndex++; + + SD.setOrdinal(SectionIndex); + + // Assign layout order indices to sections and fragments. + unsigned FragmentIndex = 0; + unsigned i = 0; + for (unsigned e = Layout.getSectionOrder().size(); i != e; ++i) { + MCSectionData *SD = Layout.getSectionOrder()[i]; + + for (MCSectionData::iterator it2 = SD->begin(), + ie2 = SD->end(); it2 != ie2; ++it2) + FragmentIndex++; + } + + SD.setLayoutOrder(i); + for (MCSectionData::iterator it2 = SD.begin(), + ie2 = SD.end(); it2 != ie2; ++it2) { + it2->setLayoutOrder(FragmentIndex++); + } + Layout.getSectionOrder().push_back(&SD); + + Layout.LayoutSection(&SD); + + // Layout until everything fits. + while (LayoutOnce(Layout)) + continue; + +} + void MCAssembler::Finish(MCObjectWriter *Writer) { DEBUG_WITH_TYPE("mc-dump", { llvm::errs() << "assembler backend - pre-layout\n--\n"; From matt at console-pimps.org Mon Aug 16 13:35:43 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 18:35:43 -0000 Subject: [llvm-commits] [llvm] r111172 - in /llvm/trunk: include/llvm/MC/MCSectionELF.h include/llvm/MC/MCStreamer.h include/llvm/Support/ELF.h lib/MC/CMakeLists.txt lib/MC/MCContext.cpp Message-ID: <20100816183543.5889A2A6C12C@llvm.org> Author: mfleming Date: Mon Aug 16 13:35:43 2010 New Revision: 111172 URL: http://llvm.org/viewvc/llvm-project?rev=111172&view=rev Log: Add ELF ObjectWriter and Streamer support. Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h llvm/trunk/include/llvm/MC/MCStreamer.h llvm/trunk/include/llvm/Support/ELF.h llvm/trunk/lib/MC/CMakeLists.txt llvm/trunk/lib/MC/MCContext.cpp Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=111172&r1=111171&r2=111172&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCSectionELF.h (original) +++ llvm/trunk/include/llvm/MC/MCSectionELF.h Mon Aug 16 13:35:43 2010 @@ -44,9 +44,9 @@ private: friend class MCContext; MCSectionELF(StringRef Section, unsigned type, unsigned flags, - SectionKind K, bool isExplicit) + SectionKind K, bool isExplicit, unsigned entrySize) : MCSection(SV_ELF, K), SectionName(Section), Type(type), Flags(flags), - IsExplicit(isExplicit) {} + IsExplicit(isExplicit), EntrySize(entrySize) {} ~MCSectionELF(); public: @@ -174,6 +174,7 @@ StringRef getSectionName() const { return SectionName; } unsigned getType() const { return Type; } unsigned getFlags() const { return Flags; } + unsigned getEntrySize() const { return EntrySize; } void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS) const; Modified: llvm/trunk/include/llvm/MC/MCStreamer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=111172&r1=111171&r2=111172&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCStreamer.h (original) +++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Aug 16 13:35:43 2010 @@ -359,6 +359,12 @@ MCCodeEmitter &CE, raw_ostream &OS, bool RelaxAll = false); + /// createELFStreamer - Create a machine code streamer which will generate + /// ELF format object files. + MCStreamer *createELFStreamer(MCContext &Ctx, TargetAsmBackend &TAB, + raw_ostream &OS, MCCodeEmitter *CE, + bool RelaxAll = false); + /// createLoggingStreamer - Create a machine code streamer which just logs the /// API calls and then dispatches to another streamer. /// Modified: llvm/trunk/include/llvm/Support/ELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ELF.h?rev=111172&r1=111171&r2=111172&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ELF.h (original) +++ llvm/trunk/include/llvm/Support/ELF.h Mon Aug 16 13:35:43 2010 @@ -330,6 +330,12 @@ } }; +// The size (in bytes) of symbol table entries. +enum { + SYMENTRY_SIZE32 = 16, // 32-bit symbol entry size + SYMENTRY_SIZE64 = 24 // 64-bit symbol entry size. +}; + // Symbol bindings. enum { STB_LOCAL = 0, // Local symbol, not visible outside obj file containing def Modified: llvm/trunk/lib/MC/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/CMakeLists.txt?rev=111172&r1=111171&r2=111172&view=diff ============================================================================== --- llvm/trunk/lib/MC/CMakeLists.txt (original) +++ llvm/trunk/lib/MC/CMakeLists.txt Mon Aug 16 13:35:43 2010 @@ -1,4 +1,5 @@ add_llvm_library(LLVMMC + ELFObjectWriter.cpp MCAsmInfo.cpp MCAsmInfoCOFF.cpp MCAsmInfoDarwin.cpp @@ -7,6 +8,7 @@ MCCodeEmitter.cpp MCContext.cpp MCDisassembler.cpp + MCELFStreamer.cpp MCExpr.cpp MCInst.cpp MCInstPrinter.cpp Modified: llvm/trunk/lib/MC/MCContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=111172&r1=111171&r2=111172&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCContext.cpp (original) +++ llvm/trunk/lib/MC/MCContext.cpp Mon Aug 16 13:35:43 2010 @@ -148,7 +148,7 @@ const MCSection *MCContext:: getELFSection(StringRef Section, unsigned Type, unsigned Flags, - SectionKind Kind, bool IsExplicit) { + SectionKind Kind, bool IsExplicit, unsigned EntrySize) { if (ELFUniquingMap == 0) ELFUniquingMap = new ELFUniqueMapTy(); ELFUniqueMapTy &Map = *(ELFUniqueMapTy*)ELFUniquingMap; @@ -158,7 +158,7 @@ if (Entry.getValue()) return Entry.getValue(); MCSectionELF *Result = new (*this) MCSectionELF(Entry.getKey(), Type, Flags, - Kind, IsExplicit); + Kind, IsExplicit, EntrySize); Entry.setValue(Result); return Result; } From matt at console-pimps.org Mon Aug 16 13:36:14 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 18:36:14 -0000 Subject: [llvm-commits] [llvm] r111173 - in /llvm/trunk/lib/Target/X86: X86AsmBackend.cpp X86TargetMachine.cpp Message-ID: <20100816183614.360B22A6C12C@llvm.org> Author: mfleming Date: Mon Aug 16 13:36:14 2010 New Revision: 111173 URL: http://llvm.org/viewvc/llvm-project?rev=111173&view=rev Log: Hookup ELF support for X86. Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=111173&r1=111172&r2=111173&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Mon Aug 16 13:36:14 2010 @@ -11,6 +11,7 @@ #include "X86.h" #include "X86FixupKinds.h" #include "llvm/ADT/Twine.h" +#include "llvm/MC/ELFObjectWriter.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCObjectWriter.h" @@ -191,10 +192,6 @@ HasScatteredSymbols = true; } - MCObjectWriter *createObjectWriter(raw_ostream &OS) const { - return 0; - } - bool isVirtualSection(const MCSection &Section) const { const MCSectionELF &SE = static_cast(Section); return SE.getType() == MCSectionELF::SHT_NOBITS;; @@ -205,12 +202,24 @@ public: ELFX86_32AsmBackend(const Target &T) : ELFX86AsmBackend(T) {} + + MCObjectWriter *createObjectWriter(raw_ostream &OS) const { + return new ELFObjectWriter(OS, /*Is64Bit=*/false, + /*IsLittleEndian=*/true, + /*HasRelocationAddend=*/false); + } }; class ELFX86_64AsmBackend : public ELFX86AsmBackend { public: ELFX86_64AsmBackend(const Target &T) : ELFX86AsmBackend(T) {} + + MCObjectWriter *createObjectWriter(raw_ostream &OS) const { + return new ELFObjectWriter(OS, /*Is64Bit=*/true, + /*IsLittleEndian=*/true, + /*HasRelocationAddend=*/true); + } }; class WindowsX86AsmBackend : public X86AsmBackend { Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=111173&r1=111172&r2=111173&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon Aug 16 13:36:14 2010 @@ -54,8 +54,7 @@ case Triple::Win32: return createWinCOFFStreamer(Ctx, TAB, *_Emitter, _OS, RelaxAll); default: - // FIXME: default to ELF. - report_fatal_error("object emission not implemented for this target."); + return createELFStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll); } } From eli.friedman at gmail.com Mon Aug 16 13:56:23 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 16 Aug 2010 11:56:23 -0700 Subject: [llvm-commits] [llvm] r111172 - in /llvm/trunk: include/llvm/MC/MCSectionELF.h include/llvm/MC/MCStreamer.h include/llvm/Support/ELF.h lib/MC/CMakeLists.txt lib/MC/MCContext.cpp In-Reply-To: <20100816183543.5889A2A6C12C@llvm.org> References: <20100816183543.5889A2A6C12C@llvm.org> Message-ID: Incomplete commit? -Eli On Mon, Aug 16, 2010 at 11:35 AM, Matt Fleming wrote: > Author: mfleming > Date: Mon Aug 16 13:35:43 2010 > New Revision: 111172 > > URL: http://llvm.org/viewvc/llvm-project?rev=111172&view=rev > Log: > Add ELF ObjectWriter and Streamer support. > > Modified: > ? ?llvm/trunk/include/llvm/MC/MCSectionELF.h > ? ?llvm/trunk/include/llvm/MC/MCStreamer.h > ? ?llvm/trunk/include/llvm/Support/ELF.h > ? ?llvm/trunk/lib/MC/CMakeLists.txt > ? ?llvm/trunk/lib/MC/MCContext.cpp > > Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=111172&r1=111171&r2=111172&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/MC/MCSectionELF.h (original) > +++ llvm/trunk/include/llvm/MC/MCSectionELF.h Mon Aug 16 13:35:43 2010 > @@ -44,9 +44,9 @@ > ?private: > ? friend class MCContext; > ? MCSectionELF(StringRef Section, unsigned type, unsigned flags, > - ? ? ? ? ? ? ? SectionKind K, bool isExplicit) > + ? ? ? ? ? ? ? SectionKind K, bool isExplicit, unsigned entrySize) > ? ? : MCSection(SV_ELF, K), SectionName(Section), Type(type), Flags(flags), > - ? ? ?IsExplicit(isExplicit) {} > + ? ? ?IsExplicit(isExplicit), EntrySize(entrySize) {} > ? ~MCSectionELF(); > ?public: > > @@ -174,6 +174,7 @@ > ? StringRef getSectionName() const { return SectionName; } > ? unsigned getType() const { return Type; } > ? unsigned getFlags() const { return Flags; } > + ?unsigned getEntrySize() const { return EntrySize; } > > ? void PrintSwitchToSection(const MCAsmInfo &MAI, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? raw_ostream &OS) const; > > Modified: llvm/trunk/include/llvm/MC/MCStreamer.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=111172&r1=111171&r2=111172&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/MC/MCStreamer.h (original) > +++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Aug 16 13:35:43 2010 > @@ -359,6 +359,12 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? MCCodeEmitter &CE, raw_ostream &OS, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bool RelaxAll = false); > > + ?/// createELFStreamer - Create a machine code streamer which will generate > + ?/// ELF format object files. > + ?MCStreamer *createELFStreamer(MCContext &Ctx, TargetAsmBackend &TAB, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? raw_ostream &OS, MCCodeEmitter *CE, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bool RelaxAll = false); > + > ? /// createLoggingStreamer - Create a machine code streamer which just logs the > ? /// API calls and then dispatches to another streamer. > ? /// > > Modified: llvm/trunk/include/llvm/Support/ELF.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ELF.h?rev=111172&r1=111171&r2=111172&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/ELF.h (original) > +++ llvm/trunk/include/llvm/Support/ELF.h Mon Aug 16 13:35:43 2010 > @@ -330,6 +330,12 @@ > ? } > ?}; > > +// The size (in bytes) of symbol table entries. > +enum { > + ?SYMENTRY_SIZE32 = 16, // 32-bit symbol entry size > + ?SYMENTRY_SIZE64 = 24 ?// 64-bit symbol entry size. > +}; > + > ?// Symbol bindings. > ?enum { > ? STB_LOCAL = 0, ? // Local symbol, not visible outside obj file containing def > > Modified: llvm/trunk/lib/MC/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/CMakeLists.txt?rev=111172&r1=111171&r2=111172&view=diff > ============================================================================== > --- llvm/trunk/lib/MC/CMakeLists.txt (original) > +++ llvm/trunk/lib/MC/CMakeLists.txt Mon Aug 16 13:35:43 2010 > @@ -1,4 +1,5 @@ > ?add_llvm_library(LLVMMC > + ?ELFObjectWriter.cpp > ? MCAsmInfo.cpp > ? MCAsmInfoCOFF.cpp > ? MCAsmInfoDarwin.cpp > @@ -7,6 +8,7 @@ > ? MCCodeEmitter.cpp > ? MCContext.cpp > ? MCDisassembler.cpp > + ?MCELFStreamer.cpp > ? MCExpr.cpp > ? MCInst.cpp > ? MCInstPrinter.cpp > > Modified: llvm/trunk/lib/MC/MCContext.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=111172&r1=111171&r2=111172&view=diff > ============================================================================== > --- llvm/trunk/lib/MC/MCContext.cpp (original) > +++ llvm/trunk/lib/MC/MCContext.cpp Mon Aug 16 13:35:43 2010 > @@ -148,7 +148,7 @@ > > ?const MCSection *MCContext:: > ?getELFSection(StringRef Section, unsigned Type, unsigned Flags, > - ? ? ? ? ? ? ?SectionKind Kind, bool IsExplicit) { > + ? ? ? ? ? ? ?SectionKind Kind, bool IsExplicit, unsigned EntrySize) { > ? if (ELFUniquingMap == 0) > ? ? ELFUniquingMap = new ELFUniqueMapTy(); > ? ELFUniqueMapTy &Map = *(ELFUniqueMapTy*)ELFUniquingMap; > @@ -158,7 +158,7 @@ > ? if (Entry.getValue()) return Entry.getValue(); > > ? MCSectionELF *Result = new (*this) MCSectionELF(Entry.getKey(), Type, Flags, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Kind, IsExplicit); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Kind, IsExplicit, EntrySize); > ? Entry.setValue(Result); > ? return Result; > ?} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From matt at console-pimps.org Mon Aug 16 13:57:57 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 18:57:57 -0000 Subject: [llvm-commits] [llvm] r111174 - in /llvm/trunk: include/llvm/MC/ELFObjectWriter.h include/llvm/MC/MCELFSymbolFlags.h lib/MC/ELFObjectWriter.cpp lib/MC/MCELFStreamer.cpp Message-ID: <20100816185757.5C1222A6C12C@llvm.org> Author: mfleming Date: Mon Aug 16 13:57:57 2010 New Revision: 111174 URL: http://llvm.org/viewvc/llvm-project?rev=111174&view=rev Log: Add ELF ObjectWriter and Streamer support. I forgot to add these files in commit 111172. Added: llvm/trunk/include/llvm/MC/ELFObjectWriter.h llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/lib/MC/MCELFStreamer.cpp Added: llvm/trunk/include/llvm/MC/ELFObjectWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/ELFObjectWriter.h?rev=111174&view=auto ============================================================================== --- llvm/trunk/include/llvm/MC/ELFObjectWriter.h (added) +++ llvm/trunk/include/llvm/MC/ELFObjectWriter.h Mon Aug 16 13:57:57 2010 @@ -0,0 +1,46 @@ +//===-- llvm/MC/ELFObjectWriter.h - ELF File Writer ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_ELFOBJECTWRITER_H +#define LLVM_MC_ELFOBJECTWRITER_H + +#include "llvm/MC/MCObjectWriter.h" +#include "llvm/Support/raw_ostream.h" +#include + +namespace llvm { +class MCAsmFixup; +class MCAssembler; +class MCFragment; +class MCValue; +class raw_ostream; + +class ELFObjectWriter : public MCObjectWriter { + void *Impl; + +public: + ELFObjectWriter(raw_ostream &OS, bool Is64Bit, bool IsLittleEndian = true, + bool HasRelocationAddend = true); + + virtual ~ELFObjectWriter(); + + virtual void ExecutePostLayoutBinding(MCAssembler &Asm); + + virtual void RecordRelocation(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const MCFragment *Fragment, + const MCFixup &Fixup, MCValue Target, + uint64_t &FixedValue); + + virtual void WriteObject(const MCAssembler &Asm, const MCAsmLayout &Layout); +}; + +} // End llvm namespace + +#endif Added: llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h?rev=111174&view=auto ============================================================================== --- llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h (added) +++ llvm/trunk/include/llvm/MC/MCELFSymbolFlags.h Mon Aug 16 13:57:57 2010 @@ -0,0 +1,54 @@ +//===- MCELFSymbolFlags.h - ELF Symbol Flags ----------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the SymbolFlags used for the ELF target. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCELFSYMBOLFLAGS_H +#define LLVM_MC_MCELFSYMBOLFLAGS_H + +#include "llvm/Support/ELF.h" + +// Because all the symbol flags need to be stored in the MCSymbolData +// 'flags' variable we need to provide shift constants per flag type. + +namespace llvm { + enum { + ELF_STT_Shift = 0, // Shift value for STT_* flags. + ELF_STB_Shift = 4, // Shift value for STB_* flags. + ELF_STV_Shift = 8 // Shift value ofr STV_* flags. + }; + + enum SymbolFlags { + ELF_STB_Local = (ELF::STB_LOCAL << ELF_STB_Shift), + ELF_STB_Global = (ELF::STB_GLOBAL << ELF_STB_Shift), + ELF_STB_Weak = (ELF::STB_WEAK << ELF_STB_Shift), + ELF_STB_Loproc = (ELF::STB_LOPROC << ELF_STB_Shift), + ELF_STB_Hiproc = (ELF::STB_HIPROC << ELF_STB_Shift), + + ELF_STT_Notype = (ELF::STT_NOTYPE << ELF_STT_Shift), + ELF_STT_Object = (ELF::STT_OBJECT << ELF_STT_Shift), + ELF_STT_Func = (ELF::STT_FUNC << ELF_STT_Shift), + ELF_STT_Section = (ELF::STT_SECTION << ELF_STT_Shift), + ELF_STT_File = (ELF::STT_FILE << ELF_STT_Shift), + ELF_STT_Common = (ELF::STT_COMMON << ELF_STT_Shift), + ELF_STT_Tls = (ELF::STT_TLS << ELF_STT_Shift), + ELF_STT_Loproc = (ELF::STT_LOPROC << ELF_STT_Shift), + ELF_STT_Hiproc = (ELF::STT_HIPROC << ELF_STT_Shift), + + ELF_STV_Default = (ELF::STV_DEFAULT << ELF_STV_Shift), + ELF_STV_Internal = (ELF::STV_INTERNAL << ELF_STV_Shift), + ELF_STV_Hidden = (ELF::STV_HIDDEN << ELF_STV_Shift), + ELF_STV_Protected = (ELF::STV_PROTECTED << ELF_STV_Shift) + }; + +} // end namespace llvm + +#endif Added: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111174&view=auto ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (added) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 13:57:57 2010 @@ -0,0 +1,1032 @@ +//===- lib/MC/ELFObjectWriter.cpp - ELF File Writer -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements ELF object file writer information. +// +//===----------------------------------------------------------------------===// + +#include "llvm/MC/ELFObjectWriter.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/Twine.h" +#include "llvm/MC/MCAssembler.h" +#include "llvm/MC/MCAsmLayout.h" +#include "llvm/MC/MCContext.h" +#include "llvm/MC/MCELFSymbolFlags.h" +#include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCObjectWriter.h" +#include "llvm/MC/MCSectionELF.h" +#include "llvm/MC/MCSymbol.h" +#include "llvm/MC/MCValue.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/ELF.h" +#include "llvm/Target/TargetAsmBackend.h" + +#include "../Target/X86/X86FixupKinds.h" + +#include +using namespace llvm; + +namespace { + + class ELFObjectWriterImpl { + static bool isFixupKindX86PCRel(unsigned Kind) { + switch (Kind) { + default: + return false; + case X86::reloc_pcrel_1byte: + case X86::reloc_pcrel_4byte: + case X86::reloc_riprel_4byte: + case X86::reloc_riprel_4byte_movq_load: + return true; + } + } + + static bool isFixupKindX86RIPRel(unsigned Kind) { + return Kind == X86::reloc_riprel_4byte || + Kind == X86::reloc_riprel_4byte_movq_load; + } + + + /// ELFSymbolData - Helper struct for containing some precomputed information + /// on symbols. + struct ELFSymbolData { + MCSymbolData *SymbolData; + uint64_t StringIndex; + uint32_t SectionIndex; + + // Support lexicographic sorting. + bool operator<(const ELFSymbolData &RHS) const { + const std::string &Name = SymbolData->getSymbol().getName(); + return Name < RHS.SymbolData->getSymbol().getName(); + } + }; + + /// @name Relocation Data + /// @{ + + struct ELFRelocationEntry { + // Make these big enough for both 32-bit and 64-bit + uint64_t r_offset; + uint64_t r_info; + uint64_t r_addend; + + // Support lexicographic sorting. + bool operator<(const ELFRelocationEntry &RE) const { + return RE.r_offset < r_offset; + } + }; + + llvm::DenseMap > Relocations; + DenseMap SectionStringTableIndex; + + /// @} + /// @name Symbol Table Data + /// @{ + + SmallString<256> StringTable; + std::vector LocalSymbolData; + std::vector ExternalSymbolData; + std::vector UndefinedSymbolData; + + /// @} + + ELFObjectWriter *Writer; + + raw_ostream &OS; + + // This holds the current offset into the object file. + size_t FileOff; + + unsigned Is64Bit : 1; + + bool HasRelocationAddend; + + // This holds the symbol table index of the last local symbol. + unsigned LastLocalSymbolIndex; + // This holds the .strtab section index. + unsigned StringTableIndex; + + unsigned ShstrtabIndex; + + public: + ELFObjectWriterImpl(ELFObjectWriter *_Writer, bool _Is64Bit, + bool _HasRelAddend) + : Writer(_Writer), OS(Writer->getStream()), FileOff(0), + Is64Bit(_Is64Bit), HasRelocationAddend(_HasRelAddend) { + } + + void Write8(uint8_t Value) { Writer->Write8(Value); } + void Write16(uint16_t Value) { Writer->Write16(Value); } + void Write32(uint32_t Value) { Writer->Write32(Value); } + void Write64(uint64_t Value) { Writer->Write64(Value); } + void WriteZeros(unsigned N) { Writer->WriteZeros(N); } + void WriteBytes(StringRef Str, unsigned ZeroFillSize = 0) { + Writer->WriteBytes(Str, ZeroFillSize); + } + + void WriteWord(uint64_t W) { + if (Is64Bit) { + Writer->Write64(W); + } else { + Writer->Write32(W); + } + } + + void String8(char *buf, uint8_t Value) { + buf[0] = Value; + } + + void StringLE16(char *buf, uint16_t Value) { + buf[0] = char(Value >> 0); + buf[1] = char(Value >> 8); + } + + void StringLE32(char *buf, uint32_t Value) { + buf[0] = char(Value >> 0); + buf[1] = char(Value >> 8); + buf[2] = char(Value >> 16); + buf[3] = char(Value >> 24); + } + + void StringLE64(char *buf, uint64_t Value) { + buf[0] = char(Value >> 0); + buf[1] = char(Value >> 8); + buf[2] = char(Value >> 16); + buf[3] = char(Value >> 24); + buf[4] = char(Value >> 32); + buf[5] = char(Value >> 40); + buf[6] = char(Value >> 48); + buf[7] = char(Value >> 56); + } + + void StringBE16(char *buf ,uint16_t Value) { + buf[0] = char(Value >> 8); + buf[1] = char(Value >> 0); + } + + void StringBE32(char *buf, uint32_t Value) { + buf[0] = char(Value >> 24); + buf[1] = char(Value >> 16); + buf[2] = char(Value >> 8); + buf[3] = char(Value >> 0); + } + + void StringBE64(char *buf, uint64_t Value) { + buf[0] = char(Value >> 56); + buf[1] = char(Value >> 48); + buf[2] = char(Value >> 40); + buf[3] = char(Value >> 32); + buf[4] = char(Value >> 24); + buf[5] = char(Value >> 16); + buf[6] = char(Value >> 8); + buf[7] = char(Value >> 0); + } + + void String16(char *buf, uint16_t Value) { + if (Writer->isLittleEndian()) + StringLE16(buf, Value); + else + StringBE16(buf, Value); + } + + void String32(char *buf, uint32_t Value) { + if (Writer->isLittleEndian()) + StringLE32(buf, Value); + else + StringBE32(buf, Value); + } + + void String64(char *buf, uint64_t Value) { + if (Writer->isLittleEndian()) + StringLE64(buf, Value); + else + StringBE64(buf, Value); + } + + void WriteHeader(uint64_t SectionDataSize, unsigned NumberOfSections); + + void WriteSymbolEntry(MCDataFragment *F, uint64_t name, uint8_t info, + uint64_t value, uint64_t size, + uint8_t other, uint16_t shndx); + + void WriteSymbol(MCDataFragment *F, ELFSymbolData &MSD, + const MCAsmLayout &Layout); + + void WriteSymbolTable(MCDataFragment *F, const MCAssembler &Asm, + const MCAsmLayout &Layout); + + void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, + const MCFragment *Fragment, const MCFixup &Fixup, + MCValue Target, uint64_t &FixedValue); + + // XXX-PERF: this should be cached + uint64_t getNumOfLocalSymbols(const MCAssembler &Asm) { + std::vector Local; + + uint64_t Index = 0; + for (MCAssembler::const_symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) { + const MCSymbol &Symbol = it->getSymbol(); + + // Ignore non-linker visible symbols. + if (!Asm.isSymbolLinkerVisible(Symbol)) + continue; + + if (it->isExternal() || Symbol.isUndefined()) + continue; + + Index++; + } + + return Index; + } + + uint64_t getSymbolIndexInSymbolTable(MCAssembler &Asm, const MCSymbol *S); + + /// ComputeSymbolTable - Compute the symbol table data + /// + /// \param StringTable [out] - The string table data. + /// \param StringIndexMap [out] - Map from symbol names to offsets in the + /// string table. + void ComputeSymbolTable(MCAssembler &Asm); + + void WriteRelocation(MCAssembler &Asm, MCAsmLayout &Layout, + const MCSectionData &SD); + + void WriteRelocations(MCAssembler &Asm, MCAsmLayout &Layout) { + for (MCAssembler::const_iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it) { + WriteRelocation(Asm, Layout, *it); + } + } + + void CreateMetadataSections(MCAssembler &Asm, MCAsmLayout &Layout); + + void ExecutePostLayoutBinding(MCAssembler &Asm) {} + + void WriteSecHdrEntry(uint32_t Name, uint32_t Type, uint64_t Flags, + uint64_t Address, uint64_t Offset, + uint64_t Size, uint32_t Link, uint32_t Info, + uint64_t Alignment, uint64_t EntrySize); + + void WriteRelocationsFragment(const MCAssembler &Asm, MCDataFragment *F, + const MCSectionData *SD); + + void WriteObject(const MCAssembler &Asm, const MCAsmLayout &Layout); + }; + +} + +// Emit the ELF header. +void ELFObjectWriterImpl::WriteHeader(uint64_t SectionDataSize, + unsigned NumberOfSections) { + // ELF Header + // ---------- + // + // Note + // ---- + // emitWord method behaves differently for ELF32 and ELF64, writing + // 4 bytes in the former and 8 in the latter. + + Write8(0x7f); // e_ident[EI_MAG0] + Write8('E'); // e_ident[EI_MAG1] + Write8('L'); // e_ident[EI_MAG2] + Write8('F'); // e_ident[EI_MAG3] + + Write8(Is64Bit ? ELF::ELFCLASS64 : ELF::ELFCLASS32); // e_ident[EI_CLASS] + + // e_ident[EI_DATA] + Write8(Writer->isLittleEndian() ? ELF::ELFDATA2LSB : ELF::ELFDATA2MSB); + + Write8(ELF::EV_CURRENT); // e_ident[EI_VERSION] + Write8(ELF::ELFOSABI_LINUX); // e_ident[EI_OSABI] + Write8(0); // e_ident[EI_ABIVERSION] + + WriteZeros(ELF::EI_NIDENT - ELF::EI_PAD); + + Write16(ELF::ET_REL); // e_type + + // FIXME: Make this configurable + Write16(ELF::EM_X86_64); // e_machine = target + + Write32(ELF::EV_CURRENT); // e_version + WriteWord(0); // e_entry, no entry point in .o file + WriteWord(0); // e_phoff, no program header for .o + WriteWord(SectionDataSize + 64); // e_shoff = sec hdr table off in bytes + + // FIXME: Make this configurable. + Write32(0); // e_flags = whatever the target wants + + // e_ehsize = ELF header size + Write16(Is64Bit ? sizeof(ELF::Elf64_Ehdr) : sizeof(ELF::Elf32_Ehdr)); + + Write16(0); // e_phentsize = prog header entry size + Write16(0); // e_phnum = # prog header entries = 0 + + // e_shentsize = Section header entry size + Write16(Is64Bit ? sizeof(ELF::Elf64_Shdr) : sizeof(ELF::Elf32_Shdr)); + + // e_shnum = # of section header ents + Write16(NumberOfSections); + + // e_shstrndx = Section # of '.shstrtab' + Write16(ShstrtabIndex); +} + +void ELFObjectWriterImpl::WriteSymbolEntry(MCDataFragment *F, uint64_t name, + uint8_t info, uint64_t value, + uint64_t size, uint8_t other, + uint16_t shndx) { + if (Is64Bit) { + char buf[8]; + + String32(buf, name); + F->getContents() += StringRef(buf, 4); // st_name + + String8(buf, info); + F->getContents() += StringRef(buf, 1); // st_info + String8(buf, other); + F->getContents() += StringRef(buf, 1); // st_other + + String16(buf, shndx); + F->getContents() += StringRef(buf, 2); // st_shndx + + String64(buf, value); + F->getContents() += StringRef(buf, 8); // st_value + + String64(buf, size); + F->getContents() += StringRef(buf, 8); // st_size + } else { + char buf[4]; + + String32(buf, name); + F->getContents() += StringRef(buf, 4); // st_name + + String32(buf, value); + F->getContents() += StringRef(buf, 4); // st_value + + String32(buf, size); + F->getContents() += StringRef(buf, 4); // st_size + + String8(buf, info); + F->getContents() += StringRef(buf, 1); // st_info + + String8(buf, other); + F->getContents() += StringRef(buf, 1); // st_other + + String16(buf, shndx); + F->getContents() += StringRef(buf, 2); // st_shndx + } +} + +void ELFObjectWriterImpl::WriteSymbol(MCDataFragment *F, ELFSymbolData &MSD, + const MCAsmLayout &Layout) { + MCSymbolData &Data = *MSD.SymbolData; + const MCSymbol &Symbol = Data.getSymbol(); + uint8_t Info = (Data.getFlags() & 0xff); + uint8_t Other = ((Data.getFlags() & 0xf00) >> ELF_STV_Shift); + uint64_t Value = 0; + uint64_t Size = 0; + const MCExpr *ESize; + + if (Data.isCommon() && Data.isExternal()) + Value = Data.getCommonAlignment(); + + ESize = Data.getSize(); + if (Data.getSize()) { + MCValue Res; + if (ESize->getKind() == MCExpr::Binary) { + const MCBinaryExpr *BE = static_cast(ESize); + + if (BE->EvaluateAsRelocatable(Res, &Layout)) { + MCSymbolData &A = + Layout.getAssembler().getSymbolData(Res.getSymA()->getSymbol()); + MCSymbolData &B = + Layout.getAssembler().getSymbolData(Res.getSymB()->getSymbol()); + + Size = Layout.getSymbolAddress(&A) - Layout.getSymbolAddress(&B); + Value = Layout.getSymbolAddress(&Data); + } + } else if (ESize->getKind() == MCExpr::Constant) { + const MCConstantExpr *CE; + CE = static_cast(ESize); + Size = CE->getValue(); + } else { + assert(0 && "Unsupported size expression"); + } + } + + // Write out the symbol table entry + WriteSymbolEntry(F, MSD.StringIndex, Info, Value, + Size, Other, MSD.SectionIndex); +} + +void ELFObjectWriterImpl::WriteSymbolTable(MCDataFragment *F, + const MCAssembler &Asm, + const MCAsmLayout &Layout) { + // The string table must be emitted first because we need the index + // into the string table for all the symbol names. + assert(StringTable.size() && "Missing string table"); + + // FIXME: Make sure the start of the symbol table is aligned. + + // The first entry is the undefined symbol entry. + unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; + for (unsigned i = 0; i < EntrySize; ++i) + F->getContents() += '\x00'; + + // Write the symbol table entries. + LastLocalSymbolIndex = LocalSymbolData.size() + 1; + for (unsigned i = 0, e = LocalSymbolData.size(); i != e; ++i) { + ELFSymbolData &MSD = LocalSymbolData[i]; + WriteSymbol(F, MSD, Layout); + } + + // Write out a symbol table entry for each section. + for (unsigned Index = 1; Index < Asm.size(); ++Index) + WriteSymbolEntry(F, 0, ELF::STT_SECTION, 0, 0, ELF::STV_DEFAULT, Index); + LastLocalSymbolIndex += Asm.size() - 1; + + for (unsigned i = 0, e = ExternalSymbolData.size(); i != e; ++i) { + ELFSymbolData &MSD = ExternalSymbolData[i]; + MCSymbolData &Data = *MSD.SymbolData; + assert((Data.getFlags() & ELF_STB_Global) && + "External symbol requires STB_GLOBAL flag"); + WriteSymbol(F, MSD, Layout); + if (Data.getFlags() & ELF_STB_Local) + LastLocalSymbolIndex++; + } + + for (unsigned i = 0, e = UndefinedSymbolData.size(); i != e; ++i) { + ELFSymbolData &MSD = UndefinedSymbolData[i]; + MCSymbolData &Data = *MSD.SymbolData; + Data.setFlags(Data.getFlags() | ELF_STB_Global); + WriteSymbol(F, MSD, Layout); + if (Data.getFlags() & ELF_STB_Local) + LastLocalSymbolIndex++; + } +} + +// FIXME: this is currently X86_64 only +void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const MCFragment *Fragment, + const MCFixup &Fixup, + MCValue Target, + uint64_t &FixedValue) { + unsigned IsPCRel = isFixupKindX86PCRel(Fixup.getKind()); + ELFRelocationEntry ERE; + struct ELF::Elf64_Rela ERE64; + + uint64_t FixupOffset = + Layout.getFragmentOffset(Fragment) + Fixup.getOffset(); + int64_t Value; + int64_t Addend = 0; + unsigned Index = 0; + unsigned Type; + + Value = Target.getConstant(); + + if (Target.isAbsolute()) { + Type = ELF::R_X86_64_NONE; + Index = 0; + } else { + const MCSymbol *Symbol = &Target.getSymA()->getSymbol(); + MCSymbolData &SD = Asm.getSymbolData(*Symbol); + const MCSymbolData *Base = Asm.getAtom(Layout, &SD); + + if (Base) { + Index = getSymbolIndexInSymbolTable(const_cast(Asm), &Base->getSymbol()); + if (Base != &SD) + Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base); + Addend = Value; + Value = 0; + } else { + MCFragment *F = SD.getFragment(); + if (F) { + // Index of the section in .symtab against this symbol + // is being relocated + 2 (empty section + abs. symbols). + Index = SD.getFragment()->getParent()->getOrdinal() + + getNumOfLocalSymbols(Asm) + 1; + + MCSectionData *FSD = F->getParent(); + // Offset of the symbol in the section + Addend = Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD); + } else { + FixedValue = Value; + return; + } + } + } + + // determine the type of the relocation + if (IsPCRel) { + Type = ELF::R_X86_64_PC32; + } else { + switch (Fixup.getKind()) { + case FK_Data_8: Type = ELF::R_X86_64_64; break; + case X86::reloc_pcrel_4byte: + case FK_Data_4: + long Offset; + Offset = Target.getConstant(); + // check that the offset fits within a signed long + if (!(((long) -1 << 31) & Offset) || (((long) -1 << 31) & Offset) == ((long) -1 << 31)) + Type = ELF::R_X86_64_32S; + else + Type = ELF::R_X86_64_32; + break; + case FK_Data_2: Type = ELF::R_X86_64_16; break; + case X86::reloc_pcrel_1byte: + case FK_Data_1: + Type = ELF::R_X86_64_8; + break; + } + } + + FixedValue = Value; + + ERE64.setSymbolAndType(Index, Type); + + ERE.r_offset = FixupOffset; + ERE.r_info = ERE64.r_info; + if (HasRelocationAddend) + ERE.r_addend = Addend; + + Relocations[Fragment->getParent()].push_back(ERE); +} + +// XXX-PERF: this should be cached +uint64_t ELFObjectWriterImpl::getSymbolIndexInSymbolTable(MCAssembler &Asm, + const MCSymbol *S) { + std::vector Local; + std::vector External; + std::vector Undefined; + + for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) { + const MCSymbol &Symbol = it->getSymbol(); + + // Ignore non-linker visible symbols. + if (!Asm.isSymbolLinkerVisible(Symbol)) + continue; + + if (it->isExternal() || Symbol.isUndefined()) + continue; + + ELFSymbolData MSD; + MSD.SymbolData = it; + + Local.push_back(MSD); + } + for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) { + const MCSymbol &Symbol = it->getSymbol(); + + // Ignore non-linker visible symbols. + if (!Asm.isSymbolLinkerVisible(Symbol)) + continue; + + if (!it->isExternal() && !Symbol.isUndefined()) + continue; + + ELFSymbolData MSD; + MSD.SymbolData = it; + + if (Symbol.isUndefined()) { + Undefined.push_back(MSD); + } else if (Symbol.isAbsolute()) { + External.push_back(MSD); + } else if (it->isCommon()) { + External.push_back(MSD); + } else { + External.push_back(MSD); + } + } + + array_pod_sort(Local.begin(), Local.end()); + array_pod_sort(External.begin(), External.end()); + array_pod_sort(Undefined.begin(), Undefined.end()); + + for (unsigned i = 0, e = Local.size(); i != e; ++i) + if (&Local[i].SymbolData->getSymbol() == S) + return i + /* empty symbol */ 1; + for (unsigned i = 0, e = External.size(); i != e; ++i) + if (&External[i].SymbolData->getSymbol() == S) + return i + Local.size() + Asm.size() + /* empty symbol */ 1 + + /* .rela.text + .rela.eh_frame */ + 2; + for (unsigned i = 0, e = Undefined.size(); i != e; ++i) + if (&Undefined[i].SymbolData->getSymbol() == S) + return i + Local.size() + External.size() + Asm.size() + /* empty symbol */ 1 + + /* .rela.text + .rela.eh_frame */ + 2; +} + +void ELFObjectWriterImpl::ComputeSymbolTable(MCAssembler &Asm) { + // Build section lookup table. + DenseMap SectionIndexMap; + unsigned Index = 1; + for (MCAssembler::iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it, ++Index) + SectionIndexMap[&it->getSection()] = Index; + + // Index 0 is always the empty string. + StringMap StringIndexMap; + StringTable += '\x00'; + + // Add the data for local symbols. + for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) { + const MCSymbol &Symbol = it->getSymbol(); + + // Ignore non-linker visible symbols. + if (!Asm.isSymbolLinkerVisible(Symbol)) + continue; + + if (it->isExternal() || Symbol.isUndefined()) + continue; + + uint64_t &Entry = StringIndexMap[Symbol.getName()]; + if (!Entry) { + Entry = StringTable.size(); + StringTable += Symbol.getName(); + StringTable += '\x00'; + } + + ELFSymbolData MSD; + MSD.SymbolData = it; + MSD.StringIndex = Entry; + + if (Symbol.isAbsolute()) { + MSD.SectionIndex = ELF::SHN_ABS; + LocalSymbolData.push_back(MSD); + } else { + MSD.SectionIndex = SectionIndexMap.lookup(&Symbol.getSection()); + assert(MSD.SectionIndex && "Invalid section index!"); + LocalSymbolData.push_back(MSD); + } + } + + // Now add non-local symbols. + for (MCAssembler::symbol_iterator it = Asm.symbol_begin(), + ie = Asm.symbol_end(); it != ie; ++it) { + const MCSymbol &Symbol = it->getSymbol(); + + // Ignore non-linker visible symbols. + if (!Asm.isSymbolLinkerVisible(Symbol)) + continue; + + if (!it->isExternal() && !Symbol.isUndefined()) + continue; + + uint64_t &Entry = StringIndexMap[Symbol.getName()]; + if (!Entry) { + Entry = StringTable.size(); + StringTable += Symbol.getName(); + StringTable += '\x00'; + } + + ELFSymbolData MSD; + MSD.SymbolData = it; + MSD.StringIndex = Entry; + + if (Symbol.isUndefined()) { + MSD.SectionIndex = ELF::SHN_UNDEF; + // XXX: for some reason we dont Emit* this + it->setFlags(it->getFlags() | ELF_STB_Global); + UndefinedSymbolData.push_back(MSD); + } else if (Symbol.isAbsolute()) { + MSD.SectionIndex = ELF::SHN_ABS; + ExternalSymbolData.push_back(MSD); + } else if (it->isCommon()) { + MSD.SectionIndex = ELF::SHN_COMMON; + ExternalSymbolData.push_back(MSD); + } else { + MSD.SectionIndex = SectionIndexMap.lookup(&Symbol.getSection()); + assert(MSD.SectionIndex && "Invalid section index!"); + ExternalSymbolData.push_back(MSD); + } + } + + // Symbols are required to be in lexicographic order. + array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end()); + array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end()); + array_pod_sort(UndefinedSymbolData.begin(), UndefinedSymbolData.end()); + + // Set the symbol indices. Local symbols must come before all other + // symbols with non-local bindings. + Index = 0; + for (unsigned i = 0, e = LocalSymbolData.size(); i != e; ++i) + LocalSymbolData[i].SymbolData->setIndex(Index++); + for (unsigned i = 0, e = ExternalSymbolData.size(); i != e; ++i) + ExternalSymbolData[i].SymbolData->setIndex(Index++); + for (unsigned i = 0, e = UndefinedSymbolData.size(); i != e; ++i) + UndefinedSymbolData[i].SymbolData->setIndex(Index++); +} + +void ELFObjectWriterImpl::WriteRelocation(MCAssembler &Asm, MCAsmLayout &Layout, + const MCSectionData &SD) { + if (!Relocations[&SD].empty()) { + MCContext &Ctx = Asm.getContext(); + const MCSection *RelaSection; + const MCSectionELF &Section = + static_cast(SD.getSection()); + + const StringRef SectionName = Section.getSectionName(); + std::string RelaSectionName = ".rela"; + + RelaSectionName += SectionName; + unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; + + RelaSection = Ctx.getELFSection(RelaSectionName, ELF::SHT_RELA, 0, + SectionKind::getReadOnly(), + false, EntrySize); + + MCSectionData &RelaSD = Asm.getOrCreateSectionData(*RelaSection); + RelaSD.setAlignment(1); + + MCDataFragment *F = new MCDataFragment(&RelaSD); + + WriteRelocationsFragment(Asm, F, &SD); + + Asm.AddSectionToTheEnd(RelaSD, Layout); + } +} + +void ELFObjectWriterImpl::WriteSecHdrEntry(uint32_t Name, uint32_t Type, + uint64_t Flags, uint64_t Address, + uint64_t Offset, uint64_t Size, + uint32_t Link, uint32_t Info, + uint64_t Alignment, + uint64_t EntrySize) { + Write32(Name); // sh_name: index into string table + Write32(Type); // sh_type + WriteWord(Flags); // sh_flags + WriteWord(Address); // sh_addr + WriteWord(Offset); // sh_offset + WriteWord(Size); // sh_size + Write32(Link); // sh_link + Write32(Info); // sh_info + WriteWord(Alignment); // sh_addralign + WriteWord(EntrySize); // sh_entsize +} + +void ELFObjectWriterImpl::WriteRelocationsFragment(const MCAssembler &Asm, + MCDataFragment *F, + const MCSectionData *SD) { + std::vector &Relocs = Relocations[SD]; + // sort by the r_offset just like gnu as does + array_pod_sort(Relocs.begin(), Relocs.end()); + + for (unsigned i = 0, e = Relocs.size(); i != e; ++i) { + ELFRelocationEntry entry = Relocs[e - i - 1]; + + if (Is64Bit) { + F->getContents() += StringRef((const char *)&entry.r_offset, 8); + F->getContents() += StringRef((const char *)&entry.r_info, 8); + + if (HasRelocationAddend) + F->getContents() += StringRef((const char *)&entry.r_addend, 8); + } else { + F->getContents() += StringRef((const char *)&entry.r_offset, 4); + F->getContents() += StringRef((const char *)&entry.r_info, 4); + + if (HasRelocationAddend) + F->getContents() += StringRef((const char *)&entry.r_addend, 4); + } + } +} + +void ELFObjectWriterImpl::CreateMetadataSections(MCAssembler &Asm, + MCAsmLayout &Layout) { + MCContext &Ctx = Asm.getContext(); + MCDataFragment *F; + + WriteRelocations(Asm, Layout); + + const MCSection *SymtabSection; + unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; + + SymtabSection = Ctx.getELFSection(".symtab", ELF::SHT_SYMTAB, 0, + SectionKind::getReadOnly(), + false, EntrySize); + + MCSectionData &SymtabSD = Asm.getOrCreateSectionData(*SymtabSection); + + SymtabSD.setAlignment(Is64Bit ? 8 : 4); + + F = new MCDataFragment(&SymtabSD); + + // Symbol table + WriteSymbolTable(F, Asm, Layout); + Asm.AddSectionToTheEnd(SymtabSD, Layout); + + const MCSection *StrtabSection; + StrtabSection = Ctx.getELFSection(".strtab", ELF::SHT_STRTAB, 0, + SectionKind::getReadOnly(), false); + + MCSectionData &StrtabSD = Asm.getOrCreateSectionData(*StrtabSection); + StrtabSD.setAlignment(1); + + // FIXME: This isn't right. If the sections get rearranged this will + // be wrong. We need a proper lookup. + StringTableIndex = Asm.size(); + + F = new MCDataFragment(&StrtabSD); + F->getContents().append(StringTable.begin(), StringTable.end()); + Asm.AddSectionToTheEnd(StrtabSD, Layout); + + const MCSection *ShstrtabSection; + ShstrtabSection = Ctx.getELFSection(".shstrtab", ELF::SHT_STRTAB, 0, + SectionKind::getReadOnly(), false); + + MCSectionData &ShstrtabSD = Asm.getOrCreateSectionData(*ShstrtabSection); + ShstrtabSD.setAlignment(1); + + F = new MCDataFragment(&ShstrtabSD); + + // FIXME: This isn't right. If the sections get rearranged this will + // be wrong. We need a proper lookup. + ShstrtabIndex = Asm.size(); + + // Section header string table. + // + // The first entry of a string table holds a null character so skip + // section 0. + uint64_t Index = 1; + F->getContents() += '\x00'; + + for (MCAssembler::const_iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it) { + const MCSectionData &SD = *it; + const MCSectionELF &Section = + static_cast(SD.getSection()); + + + // Remember the index into the string table so we can write it + // into the sh_name field of the section header table. + SectionStringTableIndex[&it->getSection()] = Index; + + Index += Section.getSectionName().size() + 1; + F->getContents() += Section.getSectionName(); + F->getContents() += '\x00'; + } + + Asm.AddSectionToTheEnd(ShstrtabSD, Layout); +} + +void ELFObjectWriterImpl::WriteObject(const MCAssembler &Asm, + const MCAsmLayout &Layout) { + // Compute symbol table information. + ComputeSymbolTable(const_cast(Asm)); + + CreateMetadataSections(const_cast(Asm), + const_cast(Layout)); + + // Add 1 for the null section. + unsigned NumSections = Asm.size() + 1; + + uint64_t SectionDataSize = 0; + + for (MCAssembler::const_iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it) { + const MCSectionData &SD = *it; + const MCSectionELF &Section = + static_cast(SD.getSection()); + + // Get the size of the section in the output file (including padding). + uint64_t Size = Layout.getSectionFileSize(&SD); + SectionDataSize += Size; + } + + // Write out the ELF header ... + WriteHeader(SectionDataSize, NumSections); + FileOff = Is64Bit ? sizeof(ELF::Elf64_Ehdr) : sizeof(ELF::Elf32_Ehdr); + + // ... then all of the sections ... + DenseMap SectionOffsetMap; + + for (MCAssembler::const_iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it) { + // Remember the offset into the file for this section. + SectionOffsetMap[&it->getSection()] = FileOff; + + const MCSectionData &SD = *it; + FileOff += Layout.getSectionFileSize(&SD); + + Asm.WriteSectionData(it, Layout, Writer); + } + + // ... and then the section header table. + // Should we align the section header table? + // + // Null section first. + WriteSecHdrEntry(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + for (MCAssembler::const_iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it) { + const MCSectionData &SD = *it; + const MCSectionELF &Section = + static_cast(SD.getSection()); + + uint64_t sh_link = 0; + uint64_t sh_info = 0; + + switch(Section.getType()) { + case ELF::SHT_DYNAMIC: + sh_link = SectionStringTableIndex[&it->getSection()]; + sh_info = 0; + break; + + case ELF::SHT_REL: + case ELF::SHT_RELA: + const MCSection *SymtabSection; + const MCSection *InfoSection; + const StringRef *SectionName; + const MCSectionData *SymtabSD; + const MCSectionData *InfoSD; + + SymtabSection = Asm.getContext().getELFSection(".symtab", ELF::SHT_SYMTAB, 0, + SectionKind::getReadOnly(), + false); + SymtabSD = &Asm.getSectionData(*SymtabSection); + // we have to count the empty section in too + sh_link = SymtabSD->getLayoutOrder() + 1; + + SectionName = &Section.getSectionName(); + SectionName = &SectionName->slice(5, SectionName->size()); + InfoSection = Asm.getContext().getELFSection(*SectionName, + ELF::SHT_PROGBITS, 0, + SectionKind::getReadOnly(), + false); + InfoSD = &Asm.getSectionData(*InfoSection); + sh_info = InfoSD->getLayoutOrder() + 1; + break; + + case ELF::SHT_SYMTAB: + case ELF::SHT_DYNSYM: + sh_link = StringTableIndex; + sh_info = LastLocalSymbolIndex; + break; + + case ELF::SHT_PROGBITS: + case ELF::SHT_STRTAB: + case ELF::SHT_NOBITS: + // Nothing to do. + break; + + case ELF::SHT_HASH: + case ELF::SHT_GROUP: + case ELF::SHT_SYMTAB_SHNDX: + default: + assert(0 && "FIXME: sh_type value not supported!"); + break; + } + + WriteSecHdrEntry(SectionStringTableIndex[&it->getSection()], + Section.getType(), Section.getFlags(), + Layout.getSectionAddress(&SD), + SectionOffsetMap.lookup(&SD.getSection()), + Layout.getSectionSize(&SD), sh_link, + sh_info, SD.getAlignment(), + Section.getEntrySize()); + } +} + +ELFObjectWriter::ELFObjectWriter(raw_ostream &OS, + bool Is64Bit, + bool IsLittleEndian, + bool HasRelocationAddend) + : MCObjectWriter(OS, IsLittleEndian) +{ + Impl = new ELFObjectWriterImpl(this, Is64Bit, HasRelocationAddend); +} + +ELFObjectWriter::~ELFObjectWriter() { + delete (ELFObjectWriterImpl*) Impl; +} + +void ELFObjectWriter::ExecutePostLayoutBinding(MCAssembler &Asm) { + ((ELFObjectWriterImpl*) Impl)->ExecutePostLayoutBinding(Asm); +} + +void ELFObjectWriter::RecordRelocation(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const MCFragment *Fragment, + const MCFixup &Fixup, MCValue Target, + uint64_t &FixedValue) { + ((ELFObjectWriterImpl*) Impl)->RecordRelocation(Asm, Layout, Fragment, Fixup, + Target, FixedValue); +} + +void ELFObjectWriter::WriteObject(const MCAssembler &Asm, + const MCAsmLayout &Layout) { + ((ELFObjectWriterImpl*) Impl)->WriteObject(Asm, Layout); +} Added: llvm/trunk/lib/MC/MCELFStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=111174&view=auto ============================================================================== --- llvm/trunk/lib/MC/MCELFStreamer.cpp (added) +++ llvm/trunk/lib/MC/MCELFStreamer.cpp Mon Aug 16 13:57:57 2010 @@ -0,0 +1,401 @@ +//===- lib/MC/MCELFStreamer.cpp - ELF Object Output ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file assembles .s files and emits ELF .o object files. +// +//===----------------------------------------------------------------------===// + +#include "llvm/MC/MCStreamer.h" + +#include "llvm/MC/MCAssembler.h" +#include "llvm/MC/MCContext.h" +#include "llvm/MC/MCCodeEmitter.h" +#include "llvm/MC/MCELFSymbolFlags.h" +#include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCInst.h" +#include "llvm/MC/MCObjectStreamer.h" +#include "llvm/MC/MCSection.h" +#include "llvm/MC/MCSectionELF.h" +#include "llvm/MC/MCSymbol.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/ELF.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Target/TargetAsmBackend.h" + +using namespace llvm; + +namespace { + +class MCELFStreamer : public MCObjectStreamer { +public: + MCELFStreamer(MCContext &Context, TargetAsmBackend &TAB, + raw_ostream &OS, MCCodeEmitter *Emitter) + : MCObjectStreamer(Context, TAB, OS, Emitter) {} + + ~MCELFStreamer() {} + + /// @name MCStreamer Interface + /// @{ + + virtual void EmitLabel(MCSymbol *Symbol); + virtual void EmitAssemblerFlag(MCAssemblerFlag Flag); + virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value); + virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute); + virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { + assert(0 && "ELF doesn't support this directive"); + } + virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, + unsigned ByteAlignment); + virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) { + assert(0 && "ELF doesn't support this directive"); + } + + virtual void EmitCOFFSymbolStorageClass(int StorageClass) { + assert(0 && "ELF doesn't support this directive"); + } + + virtual void EmitCOFFSymbolType(int Type) { + assert(0 && "ELF doesn't support this directive"); + } + + virtual void EndCOFFSymbolDef() { + assert(0 && "ELF doesn't support this directive"); + } + + virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) { + MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + SD.setSize(Value); + } + + virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) { + assert(0 && "ELF doesn't support this directive"); + } + virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0, + unsigned Size = 0, unsigned ByteAlignment = 0) { + assert(0 && "ELF doesn't support this directive"); + } + virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol, + uint64_t Size, unsigned ByteAlignment = 0) { + assert(0 && "ELF doesn't support this directive"); + } + virtual void EmitBytes(StringRef Data, unsigned AddrSpace); + virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace); + virtual void EmitGPRel32Value(const MCExpr *Value) { + assert(0 && "ELF doesn't support this directive"); + } + virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0, + unsigned ValueSize = 1, + unsigned MaxBytesToEmit = 0); + virtual void EmitCodeAlignment(unsigned ByteAlignment, + unsigned MaxBytesToEmit = 0); + virtual void EmitValueToOffset(const MCExpr *Offset, + unsigned char Value = 0); + + virtual void EmitFileDirective(StringRef Filename); + virtual void EmitDwarfFileDirective(unsigned FileNo, StringRef Filename) { + DEBUG(dbgs() << "FIXME: MCELFStreamer:EmitDwarfFileDirective not implemented\n"); + } + + virtual void EmitInstruction(const MCInst &Inst); + virtual void Finish(); + + /// @} +}; + +} // end anonymous namespace. + +void MCELFStreamer::EmitLabel(MCSymbol *Symbol) { + assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); + + // FIXME: This is wasteful, we don't necessarily need to create a data + // fragment. Instead, we should mark the symbol as pointing into the data + // fragment if it exists, otherwise we should just queue the label and set its + // fragment pointer when we emit the next fragment. + MCDataFragment *F = getOrCreateDataFragment(); + MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + assert(!SD.getFragment() && "Unexpected fragment on symbol data!"); + SD.setFragment(F); + SD.setOffset(F->getContents().size()); + + Symbol->setSection(*CurSection); +} + +void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { + switch (Flag) { + case MCAF_SubsectionsViaSymbols: + getAssembler().setSubsectionsViaSymbols(true); + return; + } + + assert(0 && "invalid assembler flag!"); +} + +void MCELFStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { + // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into + // MCObjectStreamer. + // FIXME: Lift context changes into super class. + getAssembler().getOrCreateSymbolData(*Symbol); + Symbol->setVariableValue(AddValueSymbols(Value)); +} + +void MCELFStreamer::EmitSymbolAttribute(MCSymbol *Symbol, + MCSymbolAttr Attribute) { + // Indirect symbols are handled differently, to match how 'as' handles + // them. This makes writing matching .o files easier. + if (Attribute == MCSA_IndirectSymbol) { + // Note that we intentionally cannot use the symbol data here; this is + // important for matching the string table that 'as' generates. + IndirectSymbolData ISD; + ISD.Symbol = Symbol; + ISD.SectionData = getCurrentSectionData(); + getAssembler().getIndirectSymbols().push_back(ISD); + return; + } + + // Adding a symbol attribute always introduces the symbol, note that an + // important side effect of calling getOrCreateSymbolData here is to register + // the symbol with the assembler. + MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + + // The implementation of symbol attributes is designed to match 'as', but it + // leaves much to desired. It doesn't really make sense to arbitrarily add and + // remove flags, but 'as' allows this (in particular, see .desc). + // + // In the future it might be worth trying to make these operations more well + // defined. + switch (Attribute) { + case MCSA_LazyReference: + case MCSA_Reference: + case MCSA_NoDeadStrip: + case MCSA_PrivateExtern: + case MCSA_WeakReference: + case MCSA_WeakDefinition: + case MCSA_Invalid: + case MCSA_ELF_TypeIndFunction: + case MCSA_IndirectSymbol: + assert(0 && "Invalid symbol attribute for ELF!"); + break; + + case MCSA_Global: + SD.setFlags(SD.getFlags() | ELF_STB_Global); + SD.setExternal(true); + break; + + case MCSA_Weak: + SD.setFlags(SD.getFlags() | ELF_STB_Weak); + break; + + case MCSA_Local: + SD.setFlags(SD.getFlags() | ELF_STB_Local); + break; + + case MCSA_ELF_TypeFunction: + SD.setFlags(SD.getFlags() | ELF_STT_Func); + break; + + case MCSA_ELF_TypeObject: + SD.setFlags(SD.getFlags() | ELF_STT_Object); + break; + + case MCSA_ELF_TypeTLS: + SD.setFlags(SD.getFlags() | ELF_STT_Tls); + break; + + case MCSA_ELF_TypeCommon: + SD.setFlags(SD.getFlags() | ELF_STT_Common); + break; + + case MCSA_ELF_TypeNoType: + SD.setFlags(SD.getFlags() | ELF_STT_Notype); + break; + + case MCSA_Protected: + SD.setFlags(SD.getFlags() | ELF_STV_Protected); + break; + + case MCSA_Hidden: + SD.setFlags(SD.getFlags() | ELF_STV_Hidden); + break; + + case MCSA_Internal: + SD.setFlags(SD.getFlags() | ELF_STV_Internal); + break; + } +} + +void MCELFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, + unsigned ByteAlignment) { + MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + + if ((SD.getFlags() & (0xf << ELF_STB_Shift)) == ELF_STB_Local) { + const MCSection *Section = getAssembler().getContext().getELFSection(".bss", + MCSectionELF::SHT_NOBITS, + MCSectionELF::SHF_WRITE | + MCSectionELF::SHF_ALLOC, + SectionKind::getBSS()); + + MCSectionData &SectData = getAssembler().getOrCreateSectionData(*Section); + MCFragment *F = new MCFillFragment(0, 0, Size, &SectData); + SD.setFragment(F); + Symbol->setSection(*Section); + SD.setSize(MCConstantExpr::Create(Size, getContext())); + } else { + SD.setExternal(true); + } + + SD.setCommon(Size, ByteAlignment); +} + +void MCELFStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) { + // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into + // MCObjectStreamer. + getOrCreateDataFragment()->getContents().append(Data.begin(), Data.end()); +} + +void MCELFStreamer::EmitValue(const MCExpr *Value, unsigned Size, + unsigned AddrSpace) { + // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into + // MCObjectStreamer. + MCDataFragment *DF = getOrCreateDataFragment(); + + // Avoid fixups when possible. + int64_t AbsValue; + if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue)) { + // FIXME: Endianness assumption. + for (unsigned i = 0; i != Size; ++i) + DF->getContents().push_back(uint8_t(AbsValue >> (i * 8))); + } else { + DF->addFixup(MCFixup::Create(DF->getContents().size(), AddValueSymbols(Value), + MCFixup::getKindForSize(Size))); + DF->getContents().resize(DF->getContents().size() + Size, 0); + } +} + +void MCELFStreamer::EmitValueToAlignment(unsigned ByteAlignment, + int64_t Value, unsigned ValueSize, + unsigned MaxBytesToEmit) { + // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into + // MCObjectStreamer. + if (MaxBytesToEmit == 0) + MaxBytesToEmit = ByteAlignment; + new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit, + getCurrentSectionData()); + + // Update the maximum alignment on the current section if necessary. + if (ByteAlignment > getCurrentSectionData()->getAlignment()) + getCurrentSectionData()->setAlignment(ByteAlignment); +} + +void MCELFStreamer::EmitCodeAlignment(unsigned ByteAlignment, + unsigned MaxBytesToEmit) { + // TODO: This is exactly the same as WinCOFFStreamer. Consider merging into + // MCObjectStreamer. + if (MaxBytesToEmit == 0) + MaxBytesToEmit = ByteAlignment; + MCAlignFragment *F = new MCAlignFragment(ByteAlignment, 0, 1, MaxBytesToEmit, + getCurrentSectionData()); + F->setEmitNops(true); + + // Update the maximum alignment on the current section if necessary. + if (ByteAlignment > getCurrentSectionData()->getAlignment()) + getCurrentSectionData()->setAlignment(ByteAlignment); +} + +void MCELFStreamer::EmitValueToOffset(const MCExpr *Offset, + unsigned char Value) { + // TODO: This is exactly the same as MCMachOStreamer. Consider merging into + // MCObjectStreamer. + new MCOrgFragment(*Offset, Value, getCurrentSectionData()); +} + +// Add a symbol for the file name of this module. This is the second +// entry in the module's symbol table (the first being the null symbol). +void MCELFStreamer::EmitFileDirective(StringRef Filename) { + MCSymbol *Symbol = getAssembler().getContext().GetOrCreateSymbol(Filename); + Symbol->setSection(*CurSection); + Symbol->setAbsolute(); + + MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); + + SD.setFlags(ELF_STT_File | ELF_STB_Local | ELF_STV_Default); +} + +void MCELFStreamer::EmitInstruction(const MCInst &Inst) { + // Scan for values. + for (unsigned i = 0; i != Inst.getNumOperands(); ++i) + if (Inst.getOperand(i).isExpr()) + AddValueSymbols(Inst.getOperand(i).getExpr()); + + getCurrentSectionData()->setHasInstructions(true); + + // FIXME-PERF: Common case is that we don't need to relax, encode directly + // onto the data fragments buffers. + + SmallVector Fixups; + SmallString<256> Code; + raw_svector_ostream VecOS(Code); + getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, Fixups); + VecOS.flush(); + + // FIXME: Eliminate this copy. + SmallVector AsmFixups; + for (unsigned i = 0, e = Fixups.size(); i != e; ++i) { + MCFixup &F = Fixups[i]; + AsmFixups.push_back(MCFixup::Create(F.getOffset(), F.getValue(), + F.getKind())); + } + + // See if we might need to relax this instruction, if so it needs its own + // fragment. + // + // FIXME-PERF: Support target hook to do a fast path that avoids the encoder, + // when we can immediately tell that we will get something which might need + // relaxation (and compute its size). + // + // FIXME-PERF: We should also be smart about immediately relaxing instructions + // which we can already show will never possibly fit (we can also do a very + // good job of this before we do the first relaxation pass, because we have + // total knowledge about undefined symbols at that point). Even now, though, + // we can do a decent job, especially on Darwin where scattering means that we + // are going to often know that we can never fully resolve a fixup. + if (getAssembler().getBackend().MayNeedRelaxation(Inst)) { + MCInstFragment *IF = new MCInstFragment(Inst, getCurrentSectionData()); + + // Add the fixups and data. + // + // FIXME: Revisit this design decision when relaxation is done, we may be + // able to get away with not storing any extra data in the MCInst. + IF->getCode() = Code; + IF->getFixups() = AsmFixups; + + return; + } + + // Add the fixups and data. + MCDataFragment *DF = getOrCreateDataFragment(); + for (unsigned i = 0, e = AsmFixups.size(); i != e; ++i) { + AsmFixups[i].setOffset(AsmFixups[i].getOffset() + DF->getContents().size()); + DF->addFixup(AsmFixups[i]); + } + DF->getContents().append(Code.begin(), Code.end()); +} + +void MCELFStreamer::Finish() { + getAssembler().Finish(); +} + +MCStreamer *llvm::createELFStreamer(MCContext &Context, TargetAsmBackend &TAB, + raw_ostream &OS, MCCodeEmitter *CE, + bool RelaxAll) { + MCELFStreamer *S = new MCELFStreamer(Context, TAB, OS, CE); + if (RelaxAll) + S->getAssembler().setRelaxAll(true); + return S; +} From eli.friedman at gmail.com Mon Aug 16 14:15:06 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 16 Aug 2010 19:15:06 -0000 Subject: [llvm-commits] [llvm] r111175 - in /llvm/trunk/lib/MC: ELFObjectWriter.cpp MCELFStreamer.cpp Message-ID: <20100816191506.434212A6C12C@llvm.org> Author: efriedma Date: Mon Aug 16 14:15:06 2010 New Revision: 111175 URL: http://llvm.org/viewvc/llvm-project?rev=111175&view=rev Log: Fix a few warnings in and detabify MCELFStreamer and ELFObjectWriter. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/lib/MC/MCELFStreamer.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111175&r1=111174&r2=111175&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 14:15:06 2010 @@ -193,23 +193,23 @@ void String16(char *buf, uint16_t Value) { if (Writer->isLittleEndian()) - StringLE16(buf, Value); + StringLE16(buf, Value); else - StringBE16(buf, Value); + StringBE16(buf, Value); } void String32(char *buf, uint32_t Value) { if (Writer->isLittleEndian()) - StringLE32(buf, Value); + StringLE32(buf, Value); else - StringBE32(buf, Value); + StringBE32(buf, Value); } void String64(char *buf, uint64_t Value) { if (Writer->isLittleEndian()) - StringLE64(buf, Value); + StringLE64(buf, Value); else - StringBE64(buf, Value); + StringBE64(buf, Value); } void WriteHeader(uint64_t SectionDataSize, unsigned NumberOfSections); @@ -391,7 +391,6 @@ void ELFObjectWriterImpl::WriteSymbol(MCDataFragment *F, ELFSymbolData &MSD, const MCAsmLayout &Layout) { MCSymbolData &Data = *MSD.SymbolData; - const MCSymbol &Symbol = Data.getSymbol(); uint8_t Info = (Data.getFlags() & 0xff); uint8_t Other = ((Data.getFlags() & 0xf00) >> ELF_STV_Shift); uint64_t Value = 0; @@ -627,6 +626,8 @@ if (&Undefined[i].SymbolData->getSymbol() == S) return i + Local.size() + External.size() + Asm.size() + /* empty symbol */ 1 + /* .rela.text + .rela.eh_frame */ + 2; + + llvm_unreachable("Cannot find symbol which should exist!"); } void ELFObjectWriterImpl::ComputeSymbolTable(MCAssembler &Asm) { @@ -898,8 +899,6 @@ for (MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end(); it != ie; ++it) { const MCSectionData &SD = *it; - const MCSectionELF &Section = - static_cast(SD.getSection()); // Get the size of the section in the output file (including padding). uint64_t Size = Layout.getSectionFileSize(&SD); @@ -946,29 +945,30 @@ break; case ELF::SHT_REL: - case ELF::SHT_RELA: + case ELF::SHT_RELA: { const MCSection *SymtabSection; const MCSection *InfoSection; - const StringRef *SectionName; + StringRef SectionName; const MCSectionData *SymtabSD; const MCSectionData *InfoSD; SymtabSection = Asm.getContext().getELFSection(".symtab", ELF::SHT_SYMTAB, 0, SectionKind::getReadOnly(), - false); + false); SymtabSD = &Asm.getSectionData(*SymtabSection); // we have to count the empty section in too sh_link = SymtabSD->getLayoutOrder() + 1; - SectionName = &Section.getSectionName(); - SectionName = &SectionName->slice(5, SectionName->size()); - InfoSection = Asm.getContext().getELFSection(*SectionName, + SectionName = Section.getSectionName(); + SectionName = SectionName.slice(5, SectionName.size()); + InfoSection = Asm.getContext().getELFSection(SectionName, ELF::SHT_PROGBITS, 0, - SectionKind::getReadOnly(), - false); + SectionKind::getReadOnly(), + false); InfoSD = &Asm.getSectionData(*InfoSection); sh_info = InfoSD->getLayoutOrder() + 1; break; + } case ELF::SHT_SYMTAB: case ELF::SHT_DYNSYM: Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=111175&r1=111174&r2=111175&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCELFStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCELFStreamer.cpp Mon Aug 16 14:15:06 2010 @@ -177,6 +177,7 @@ case MCSA_PrivateExtern: case MCSA_WeakReference: case MCSA_WeakDefinition: + case MCSA_WeakDefAutoPrivate: case MCSA_Invalid: case MCSA_ELF_TypeIndFunction: case MCSA_IndirectSymbol: From matt at console-pimps.org Mon Aug 16 14:25:19 2010 From: matt at console-pimps.org (Matt Fleming) Date: Mon, 16 Aug 2010 20:25:19 +0100 Subject: [llvm-commits] [llvm] r111172 - in /llvm/trunk: include/llvm/MC/MCSectionELF.h include/llvm/MC/MCStreamer.h include/llvm/Support/ELF.h lib/MC/CMakeLists.txt lib/MC/MCContext.cpp In-Reply-To: References: <20100816183543.5889A2A6C12C@llvm.org> Message-ID: <20100816192519.GB6263@console-pimps.org> On Mon, Aug 16, 2010 at 11:56:23AM -0700, Eli Friedman wrote: > Incomplete commit? > > -Eli Yeah, should be sorted now. Thanks. From eli.friedman at gmail.com Mon Aug 16 15:08:40 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 16 Aug 2010 20:08:40 -0000 Subject: [llvm-commits] [llvm] r111177 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp Message-ID: <20100816200840.58F262A6C12C@llvm.org> Author: efriedma Date: Mon Aug 16 15:08:40 2010 New Revision: 111177 URL: http://llvm.org/viewvc/llvm-project?rev=111177&view=rev Log: Until uleb/sleb are MC-ized, add a hack to make them work with ELF object emission. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp?rev=111177&r1=111176&r2=111177&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp Mon Aug 16 15:08:40 2010 @@ -36,7 +36,7 @@ if (isVerbose() && Desc) OutStreamer.AddComment(Desc); - if (MAI->hasLEB128()) { + if (MAI->hasLEB128() && OutStreamer.hasRawTextSupport()) { // FIXME: MCize. OutStreamer.EmitRawText("\t.sleb128\t" + Twine(Value)); return; @@ -61,7 +61,7 @@ if (isVerbose() && Desc) OutStreamer.AddComment(Desc); - if (MAI->hasLEB128() && PadTo == 0) { + if (MAI->hasLEB128() && PadTo == 0 && OutStreamer.hasRawTextSupport()) { // FIXME: MCize. OutStreamer.EmitRawText("\t.uleb128\t" + Twine(Value)); return; From eli.friedman at gmail.com Mon Aug 16 16:03:32 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 16 Aug 2010 21:03:32 -0000 Subject: [llvm-commits] [llvm] r111182 - /llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Message-ID: <20100816210332.3260A2A6C12C@llvm.org> Author: efriedma Date: Mon Aug 16 16:03:32 2010 New Revision: 111182 URL: http://llvm.org/viewvc/llvm-project?rev=111182&view=rev Log: Don't attempt to SimplifyShortMoveForm in 64-bit mode. Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=111182&r1=111181&r2=111182&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Mon Aug 16 16:03:32 2010 @@ -252,7 +252,13 @@ } /// \brief Simplify things like MOV32rm to MOV32o32a. -static void SimplifyShortMoveForm(MCInst &Inst, unsigned Opcode) { +static void SimplifyShortMoveForm(X86AsmPrinter &Printer, MCInst &Inst, + unsigned Opcode) { + // Don't make these simplifications in 64-bit mode; other assemblers don't + // perform them because they make the code larger. + if (Printer.getSubtarget().is64Bit()) + return; + bool IsStore = Inst.getOperand(0).isReg() && Inst.getOperand(1).isReg(); unsigned AddrBase = IsStore; unsigned RegOp = IsStore ? 0 : 5; @@ -458,15 +464,13 @@ // MOV64ao8, MOV64o8a // XCHG16ar, XCHG32ar, XCHG64ar case X86::MOV8mr_NOREX: - case X86::MOV8mr: SimplifyShortMoveForm(OutMI, X86::MOV8ao8); break; + case X86::MOV8mr: SimplifyShortMoveForm(AsmPrinter, OutMI, X86::MOV8ao8); break; case X86::MOV8rm_NOREX: - case X86::MOV8rm: SimplifyShortMoveForm(OutMI, X86::MOV8o8a); break; - case X86::MOV16mr: SimplifyShortMoveForm(OutMI, X86::MOV16ao16); break; - case X86::MOV16rm: SimplifyShortMoveForm(OutMI, X86::MOV16o16a); break; - case X86::MOV32mr: SimplifyShortMoveForm(OutMI, X86::MOV32ao32); break; - case X86::MOV32rm: SimplifyShortMoveForm(OutMI, X86::MOV32o32a); break; - case X86::MOV64mr: SimplifyShortMoveForm(OutMI, X86::MOV64ao64); break; - case X86::MOV64rm: SimplifyShortMoveForm(OutMI, X86::MOV64o64a); break; + case X86::MOV8rm: SimplifyShortMoveForm(AsmPrinter, OutMI, X86::MOV8o8a); break; + case X86::MOV16mr: SimplifyShortMoveForm(AsmPrinter, OutMI, X86::MOV16ao16); break; + case X86::MOV16rm: SimplifyShortMoveForm(AsmPrinter, OutMI, X86::MOV16o16a); break; + case X86::MOV32mr: SimplifyShortMoveForm(AsmPrinter, OutMI, X86::MOV32ao32); break; + case X86::MOV32rm: SimplifyShortMoveForm(AsmPrinter, OutMI, X86::MOV32o32a); break; case X86::ADC8ri: SimplifyShortImmForm(OutMI, X86::ADC8i8); break; case X86::ADC16ri: SimplifyShortImmForm(OutMI, X86::ADC16i16); break; From eli.friedman at gmail.com Mon Aug 16 16:17:09 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 16 Aug 2010 21:17:09 -0000 Subject: [llvm-commits] [llvm] r111183 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100816211709.8BDC62A6C12C@llvm.org> Author: efriedma Date: Mon Aug 16 16:17:09 2010 New Revision: 111183 URL: http://llvm.org/viewvc/llvm-project?rev=111183&view=rev Log: Fixes for generation of ELF relocations. Patch by Roman Divacky. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111183&r1=111182&r2=111183&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 16:17:09 2010 @@ -451,9 +451,23 @@ } // Write out a symbol table entry for each section. - for (unsigned Index = 1; Index < Asm.size(); ++Index) + // leaving out the just added .symtab which is at + // the very end + unsigned Index = 1; + for (MCAssembler::const_iterator it = Asm.begin(), + ie = Asm.end(); it != ie; ++it, ++Index) { + const MCSectionData &SD = *it; + const MCSectionELF &Section = + static_cast(SD.getSection()); + // Leave out relocations so we don't have indexes within + // the relocations messed up + if (Section.getType() == ELF::SHT_RELA) + continue; + if (Index == Asm.size()) + continue; WriteSymbolEntry(F, 0, ELF::STT_SECTION, 0, 0, ELF::STV_DEFAULT, Index); - LastLocalSymbolIndex += Asm.size() - 1; + LastLocalSymbolIndex++; + } for (unsigned i = 0, e = ExternalSymbolData.size(); i != e; ++i) { ELFSymbolData &MSD = ExternalSymbolData[i]; @@ -620,12 +634,10 @@ return i + /* empty symbol */ 1; for (unsigned i = 0, e = External.size(); i != e; ++i) if (&External[i].SymbolData->getSymbol() == S) - return i + Local.size() + Asm.size() + /* empty symbol */ 1 + - /* .rela.text + .rela.eh_frame */ + 2; + return i + Local.size() + Asm.size() + /* empty symbol */ 1; for (unsigned i = 0, e = Undefined.size(); i != e; ++i) if (&Undefined[i].SymbolData->getSymbol() == S) - return i + Local.size() + External.size() + Asm.size() + /* empty symbol */ 1 + - /* .rela.text + .rela.eh_frame */ + 2; + return i + Local.size() + External.size() + Asm.size() + /* empty symbol */ 1; llvm_unreachable("Cannot find symbol which should exist!"); } From eli.friedman at gmail.com Mon Aug 16 16:18:52 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 16 Aug 2010 21:18:52 -0000 Subject: [llvm-commits] [llvm] r111185 - /llvm/trunk/lib/Target/X86/X86Instr64bit.td Message-ID: <20100816211852.0F4062A6C12C@llvm.org> Author: efriedma Date: Mon Aug 16 16:18:51 2010 New Revision: 111185 URL: http://llvm.org/viewvc/llvm-project?rev=111185&view=rev Log: Comment out some broken/unused/useless instructions which mess up disassembly. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=111185&r1=111184&r2=111185&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Aug 16 16:18:51 2010 @@ -392,6 +392,11 @@ []>; } +// FIXME: These definitions are utterly broken +// Just leave them commented out for now because they're useless outside +// of the large code model, and most compilers won't generate the instructions +// in question. +/* def MOV64o8a : RIi8<0xA0, RawFrm, (outs), (ins offset8:$src), "mov{q}\t{$src, %rax|%rax, $src}", []>; def MOV64o64a : RIi32<0xA1, RawFrm, (outs), (ins offset64:$src), @@ -400,6 +405,7 @@ "mov{q}\t{%rax, $dst|$dst, %rax}", []>; def MOV64ao64 : RIi32<0xA3, RawFrm, (outs offset64:$dst), (ins), "mov{q}\t{%rax, $dst|$dst, %rax}", []>; +*/ // Moves to and from segment registers def MOV64rs : RI<0x8C, MRMDestReg, (outs GR64:$dst), (ins SEGMENT_REG:$src), From criswell at uiuc.edu Mon Aug 16 16:24:39 2010 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Aug 2010 21:24:39 -0000 Subject: [llvm-commits] [poolalloc] r111187 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <20100816212439.588112A6C12C@llvm.org> Author: criswell Date: Mon Aug 16 16:24:39 2010 New Revision: 111187 URL: http://llvm.org/viewvc/llvm-project?rev=111187&view=rev Log: Modified GetNodesReachableFromGlobals() so that it always consults the globals graph when trying to find DSNodes that are reachable from globals (I believe the original version only found globals referenced in the local function). Also modified GetNodesReachableFromGlobals() so that it finds DSNodes both in the local graph and globals graph that are reachable from globals. Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=111187&r1=111186&r2=111187&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Aug 16 16:24:39 2010 @@ -434,14 +434,73 @@ // 'if (P) poolfree(P)' } +// +// Function: GetNodesReachableFromGlobals() +// +// Description: +// This function finds all DSNodes which are reachable from globals. It finds +// DSNodes both within the local DSGraph as well as in the Globals graph that +// are reachable from globals. +// +// Inputs: +// G - The DSGraph for which to find DSNodes which are reachable by globals. +// This DSGraph can either by a DSGraph associated with a function *or* +// it can be the globals graph itself. +// +// Outputs: +// NodesFromGlobals - A reference to a container object in which to record +// DSNodes reachable from globals. DSNodes are *added* to +// this container; it is not cleared by this function. +// DSNodes from both the local and globals graph are added. +static void +GetNodesReachableFromGlobals (DSGraph* G, + DenseSet &NodesFromGlobals) { + // + // Get the globals graph associated with this DSGraph. If the globals graph + // is NULL, then the graph that was passed in *is* the globals graph. + // + DSGraph * GlobalsGraph = G->getGlobalsGraph(); + if (!GlobalsGraph) + GlobalsGraph = G; + // + // Find all DSNodes which are reachable in the globals graph. + // + for (DSGraph::node_iterator NI = GlobalsGraph->node_begin(); + NI != GlobalsGraph->node_end(); + ++NI) { + NI->markReachableNodes(NodesFromGlobals); + } + // + // Now the fun part. Find DSNodes in the local graph that correspond to + // those nodes reachable in the globals graph. Add them to the set of + // reachable nodes, too. + // + if (G->getGlobalsGraph()) { + // + // Compute a mapping between local DSNodes and DSNodes in the globals + // graph. + // + DSGraph::NodeMapTy NodeMap; + G->computeGToGGMapping (NodeMap); -static void GetNodesReachableFromGlobals(DSGraph* G, - DenseSet &NodesFromGlobals) { - for (DSScalarMap::global_iterator I = G->getScalarMap().global_begin(), - E = G->getScalarMap().global_end(); I != E; ++I) - G->getNodeForValue(*I).getNode()->markReachableNodes(NodesFromGlobals); + // + // Scan through all DSNodes in the local graph. If a local DSNode has a + // corresponding DSNode in the globals graph that is reachable from a + // global, then add the local DSNode to the set of DSNodes reachable from a + // global. + // + // FIXME: A node's existance within the global DSGraph is probably + // sufficient evidence that it is reachable from a global. + // + DSGraph::node_iterator ni = G->node_begin(); + for (; ni != G->node_end(); ++ni) { + DSNode * N = ni; + if (NodesFromGlobals.count (NodeMap[N].getNode())) + NodesFromGlobals.insert (N); + } + } } // From gohman at apple.com Mon Aug 16 16:38:42 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 21:38:42 -0000 Subject: [llvm-commits] [llvm] r111189 - in /llvm/trunk: include/llvm/PassManagers.h lib/VMCore/PassManager.cpp Message-ID: <20100816213843.09DC32A6C12C@llvm.org> Author: djg Date: Mon Aug 16 16:38:42 2010 New Revision: 111189 URL: http://llvm.org/viewvc/llvm-project?rev=111189&view=rev Log: Eliminate the TopLevelManagerType enum; instead, just make PMTopLevelManager's constructor take a PMDataManager *, which already provides the needed abstraction support. Modified: llvm/trunk/include/llvm/PassManagers.h llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=111189&r1=111188&r2=111189&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Mon Aug 16 16:38:42 2010 @@ -98,13 +98,6 @@ class Timer; class PMDataManager; -/// FunctionPassManager and PassManager, two top level managers, serve -/// as the public interface of pass manager infrastructure. -enum TopLevelManagerType { - TLM_Function, // FunctionPassManager - TLM_Pass // PassManager -}; - // enums for debugging strings enum PassDebuggingString { EXECUTION_MSG, // "Executing Pass '" @@ -199,7 +192,7 @@ /// Find analysis usage information for the pass P. AnalysisUsage *findAnalysisUsage(Pass *P); - explicit PMTopLevelManager(enum TopLevelManagerType t); + explicit PMTopLevelManager(PMDataManager *PMDM); virtual ~PMTopLevelManager(); /// Add immutable pass and initialize it. Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=111189&r1=111188&r2=111189&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Aug 16 16:38:42 2010 @@ -226,7 +226,7 @@ static char ID; explicit FunctionPassManagerImpl(int Depth) : Pass(PT_PassManager, ID), PMDataManager(Depth), - PMTopLevelManager(TLM_Function), wasRun(false) { } + PMTopLevelManager(new FPPassManager(1)), wasRun(false) {} /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass @@ -386,7 +386,7 @@ static char ID; explicit PassManagerImpl(int Depth) : Pass(PT_PassManager, ID), PMDataManager(Depth), - PMTopLevelManager(TLM_Pass) { } + PMTopLevelManager(new MPPassManager(1)) {} /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass @@ -490,18 +490,10 @@ // PMTopLevelManager implementation /// Initialize top level manager. Create first pass manager. -PMTopLevelManager::PMTopLevelManager(enum TopLevelManagerType t) { - if (t == TLM_Pass) { - MPPassManager *MPP = new MPPassManager(1); - MPP->setTopLevelManager(this); - addPassManager(MPP); - activeStack.push(MPP); - } else if (t == TLM_Function) { - FPPassManager *FPP = new FPPassManager(1); - FPP->setTopLevelManager(this); - addPassManager(FPP); - activeStack.push(FPP); - } +PMTopLevelManager::PMTopLevelManager(PMDataManager *PMDM) { + PMDM->setTopLevelManager(this); + addPassManager(PMDM); + activeStack.push(PMDM); } /// Set pass P as the last user of the given analysis passes. From gohman at apple.com Mon Aug 16 16:57:30 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 21:57:30 -0000 Subject: [llvm-commits] [llvm] r111192 - in /llvm/trunk/lib/VMCore: PassManager.cpp PrintModulePass.cpp Message-ID: <20100816215730.545CB2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 16:57:30 2010 New Revision: 111192 URL: http://llvm.org/viewvc/llvm-project?rev=111192&view=rev Log: Remove redundant inline keywords. Modified: llvm/trunk/lib/VMCore/PassManager.cpp llvm/trunk/lib/VMCore/PrintModulePass.cpp Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=111192&r1=111191&r2=111192&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Aug 16 16:57:30 2010 @@ -266,7 +266,7 @@ Info.setPreservesAll(); } - inline void addTopLevelPass(Pass *P) { + void addTopLevelPass(Pass *P) { if (ImmutablePass *IP = P->getAsImmutablePass()) { // P is a immutable pass and it will be managed by this // top level manager. Set up analysis resolver to connect them. @@ -410,7 +410,7 @@ Info.setPreservesAll(); } - inline void addTopLevelPass(Pass *P) { + void addTopLevelPass(Pass *P) { if (ImmutablePass *IP = P->getAsImmutablePass()) { // P is a immutable pass and it will be managed by this // top level manager. Set up analysis resolver to connect them. Modified: llvm/trunk/lib/VMCore/PrintModulePass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PrintModulePass.cpp?rev=111192&r1=111191&r2=111192&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PrintModulePass.cpp (original) +++ llvm/trunk/lib/VMCore/PrintModulePass.cpp Mon Aug 16 16:57:30 2010 @@ -58,7 +58,7 @@ PrintFunctionPass(const std::string &B, raw_ostream *o, bool DS) : FunctionPass(ID), Banner(B), Out(o), DeleteStream(DS) {} - inline ~PrintFunctionPass() { + ~PrintFunctionPass() { if (DeleteStream) delete Out; } From gohman at apple.com Mon Aug 16 17:03:47 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 22:03:47 -0000 Subject: [llvm-commits] [llvm] r111193 - /llvm/trunk/include/llvm/PassManagers.h Message-ID: <20100816220347.378DD2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 17:03:47 2010 New Revision: 111193 URL: http://llvm.org/viewvc/llvm-project?rev=111193&view=rev Log: Make some of PMTopLevelManager's members non-public. In particular, make its constructor protected. Modified: llvm/trunk/include/llvm/PassManagers.h Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=111193&r1=111192&r2=111193&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Mon Aug 16 17:03:47 2010 @@ -163,21 +163,26 @@ /// PMTopLevelManager manages LastUser info and collects common APIs used by /// top level pass managers. class PMTopLevelManager { -public: +protected: + explicit PMTopLevelManager(PMDataManager *PMDM); virtual unsigned getNumContainedManagers() const { return (unsigned)PassManagers.size(); } - /// Schedule pass P for execution. Make sure that passes required by - /// P are run before P is run. Update analysis info maintained by - /// the manager. Remove dead passes. This is a recursive function. - void schedulePass(Pass *P); + void initializeAllAnalysisInfo(); +private: /// This is implemented by top level pass manager and used by /// schedulePass() to add analysis info passes that are not available. virtual void addTopLevelPass(Pass *P) = 0; +public: + /// Schedule pass P for execution. Make sure that passes required by + /// P are run before P is run. Update analysis info maintained by + /// the manager. Remove dead passes. This is a recursive function. + void schedulePass(Pass *P); + /// Set pass P as the last user of the given analysis passes. void setLastUser(SmallVector &AnalysisPasses, Pass *P); @@ -192,7 +197,6 @@ /// Find analysis usage information for the pass P. AnalysisUsage *findAnalysisUsage(Pass *P); - explicit PMTopLevelManager(PMDataManager *PMDM); virtual ~PMTopLevelManager(); /// Add immutable pass and initialize it. @@ -219,8 +223,6 @@ void dumpPasses() const; void dumpArguments() const; - void initializeAllAnalysisInfo(); - // Active Pass Managers PMStack activeStack; From dirty at apple.com Mon Aug 16 17:16:07 2010 From: dirty at apple.com (Cameron Esfahani) Date: Mon, 16 Aug 2010 15:16:07 -0700 Subject: [llvm-commits] Win64 pseudo instruction patch In-Reply-To: <2551EF63-6AD8-412F-976E-41AF7B7951ED@apple.com> References: <00C68A18-199E-429D-A0A5-2BBDCC219A03@apple.com> <65130661-7848-4A1E-AABE-10A450BFED22@apple.com> <2551EF63-6AD8-412F-976E-41AF7B7951ED@apple.com> Message-ID: <82C41EFA-E6BC-4179-A08E-14E139EDBF02@apple.com> Any new comments? On Aug 13, 2010, at 4:44 PM, Cameron Esfahani wrote: > New patch, based on svn 111057: > > > >> Hello, Cameron >> >> > Attached is a patch which fixes some more of the Win64 ABI code gen. Added support for the Windows 64 pseudo instructions like WINTAILJMPd64 and WINCALL64pcrel32. >> > >> > Also, updated a little bit of the coff-dump.py tool to dump the AMD64 relocations. Updated COFF.h to list the AMD64 relocations. >> > >> > Still a bit more to do before Win64 COFFs work... >> Please next time submit unrelated changes (e.g. MC changes vs tail >> call stuff changes) as separate patches for the sake of easier review. >> >> >+ bool AfterFPPop = Opc == X86::TAILJMPm64 || Opc == X86::TAILJMPm || >> >+ Opc == X86::WINTAILJMPm64; >> Is it possible to factor out the predicates of such sort into some >> external predicate function? Something like "IsTAILJUMPMemOpcode()" or >> whatever? >> > Done. I've created some helper routines to manage the different flavors of the TAILJUMP AND TCRETURN pseudo opcodes. > >> >- } else if (Subtarget->isTargetWin64()) { >> >- // We need to always allocate 32 bytes as register spill area. >> >- // FIXME: We might reuse these 32 bytes for leaf functions. >> >- StackSize += 32; >> >- MFI->setStackSize(StackSize); >> > } >> As I already mentioned, this part is invalid. Consider the following >> case: you have two functions A and B with A calling B. B does regs >> dump into register save area. Since you haven't allocated the space on >> stack for register save area then B will clobber 16 bytes on local >> frame of A. This is definitely not what you will want. >> > Ok, I've backed this out. There were some weird things I saw when generating Win64 code, which is why I took it out in the first place. I'll try and figure it out in the future. > >> >- RetOpcode == X86::TCRETURNmi64) { >> >- bool isMem = RetOpcode == X86::TCRETURNmi || RetOpcode == X86::TCRETURNmi64; >> >+ RetOpcode == X86::TCRETURNmi64 || >> >+ RetOpcode == X86::WINTCRETURNri64 || RetOpcode == X86::WINTCRETURNdi64 || >> >+ RetOpcode == X86::WINTCRETURNmi64) { >> >+ bool isMem = RetOpcode == X86::TCRETURNmi || RetOpcode == X86::TCRETURNmi64 || >> >+ RetOpcode == X86::WINTCRETURNmi64; >> Same as above. >> >> > + if (RetOpcode == X86::TCRETURNdi) >> > + Opcode = X86::TAILJMPd; >> > + else >> > + Opcode = (IsWin64 ? X86::WINTAILJMPd64 : X86::TAILJMPd64); >> Also deserves some helper for such mapping? E.g. "TailCallIMapImmOpcode" ? >> > This should be resolved with the new helper routines. > >> -- >> With best regards, Anton Korobeynikov >> Faculty of Mathematics and Mechanics, Saint Petersburg State University > On Aug 12, 2010, at 6:47 PM, Cameron Esfahani wrote: > >> New patch, based on SVN revision 110995: >> >> > > Cameron Esfahani > dirty at apple.com > > "All that is necessary for the triumph of evil is that good men do nothing." > > Edmund Burke > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits Cameron Esfahani dirty at apple.com "It is the spirit and not the form of law that keeps justice alive." Earl Warren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100816/59099861/attachment.html From bob.wilson at apple.com Mon Aug 16 17:21:13 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 22:21:13 -0000 Subject: [llvm-commits] [llvm] r111195 - /llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll Message-ID: <20100816222113.A28902A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 17:21:13 2010 New Revision: 111195 URL: http://llvm.org/viewvc/llvm-project?rev=111195&view=rev Log: Convert test to FileCheck. Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll?rev=111195&r1=111194&r2=111195&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll Mon Aug 16 17:21:13 2010 @@ -1,8 +1,7 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | \ -; RUN: grep pkhbt | count 5 -; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | \ -; RUN: grep pkhtb | count 4 +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s +; CHECK: test1 +; CHECK: pkhbt r0, r0, r1, lsl #16 define i32 @test1(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp4 = shl i32 %Y, 16 ; [#uses=1] @@ -10,6 +9,8 @@ ret i32 %tmp5 } +; CHECK: test1a +; CHECK: pkhbt r0, r0, r1, lsl #16 define i32 @test1a(i32 %X, i32 %Y) { %tmp19 = and i32 %X, 65535 ; [#uses=1] %tmp37 = shl i32 %Y, 16 ; [#uses=1] @@ -17,6 +18,8 @@ ret i32 %tmp5 } +; CHECK: test2 +; CHECK: pkhbt r0, r0, r1, lsl #12 define i32 @test2(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = shl i32 %Y, 12 ; [#uses=1] @@ -25,6 +28,8 @@ ret i32 %tmp57 } +; CHECK: test3 +; CHECK: pkhbt r0, r0, r1, lsl #18 define i32 @test3(i32 %X, i32 %Y) { %tmp19 = and i32 %X, 65535 ; [#uses=1] %tmp37 = shl i32 %Y, 18 ; [#uses=1] @@ -32,6 +37,8 @@ ret i32 %tmp5 } +; CHECK: test4 +; CHECK: pkhbt r0, r0, r1, lsl #0 define i32 @test4(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = and i32 %Y, -65536 ; [#uses=1] @@ -39,6 +46,8 @@ ret i32 %tmp46 } +; CHECK: test5 +; CHECK: pkhtb r0, r0, r1, asr #16 define i32 @test5(i32 %X, i32 %Y) { %tmp17 = and i32 %X, -65536 ; [#uses=1] %tmp2 = bitcast i32 %Y to i32 ; [#uses=1] @@ -47,6 +56,8 @@ ret i32 %tmp5 } +; CHECK: test5a +; CHECK: pkhtb r0, r0, r1, asr #16 define i32 @test5a(i32 %X, i32 %Y) { %tmp110 = and i32 %X, -65536 ; [#uses=1] %tmp37 = lshr i32 %Y, 16 ; [#uses=1] @@ -55,6 +66,8 @@ ret i32 %tmp5 } +; CHECK: test6 +; CHECK: pkhtb r0, r0, r1, asr #12 define i32 @test6(i32 %X, i32 %Y) { %tmp1 = and i32 %X, -65536 ; [#uses=1] %tmp37 = lshr i32 %Y, 12 ; [#uses=1] @@ -64,6 +77,8 @@ ret i32 %tmp59 } +; CHECK: test7 +; CHECK: pkhtb r0, r0, r1, asr #18 define i32 @test7(i32 %X, i32 %Y) { %tmp1 = and i32 %X, -65536 ; [#uses=1] %tmp3 = ashr i32 %Y, 18 ; [#uses=1] From bob.wilson at apple.com Mon Aug 16 17:26:55 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 22:26:55 -0000 Subject: [llvm-commits] [llvm] r111196 - in /llvm/trunk: lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMInstrThumb2.td test/CodeGen/ARM/pack.ll test/CodeGen/Thumb2/thumb2-pack.ll Message-ID: <20100816222655.4A6562A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 17:26:55 2010 New Revision: 111196 URL: http://llvm.org/viewvc/llvm-project?rev=111196&view=rev Log: Generalize a pattern for PKHTB: an SRL of 16-31 bits will guarantee that the high halfword is zero. The shift need not be exactly 16 bits. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td llvm/trunk/test/CodeGen/ARM/pack.ll llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=111196&r1=111195&r2=111196&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Aug 16 17:26:55 2010 @@ -2257,6 +2257,8 @@ (PKHBT GPR:$src1, GPR:$src2, imm16_31:$shamt)>; +// Note: Shifts of 1-15 bits will be transformed to srl instead of sra and +// will match the pattern below. def PKHTB : AMiscA1I<0b01101000, (outs GPR:$dst), (ins GPR:$src1, GPR:$src2, i32imm:$shamt), IIC_iALUsi, "pkhtb", "\t$dst, $src1, $src2, asr $shamt", @@ -2268,8 +2270,8 @@ // Alternate cases for PKHTB where identities eliminate some nodes. Note that // a shift amount of 0 is *not legal* here, it is PKHBT instead. -def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, (i32 16))), - (PKHTB GPR:$src1, GPR:$src2, 16)>; +def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, imm16_31:$sh)), + (PKHTB GPR:$src1, GPR:$src2, imm16_31:$sh)>; def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (and (srl GPR:$src2, imm1_15:$shamt), 0xFFFF)), (PKHTB GPR:$src1, GPR:$src2, imm1_15:$shamt)>; Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=111196&r1=111195&r2=111196&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Mon Aug 16 17:26:55 2010 @@ -2106,6 +2106,8 @@ (t2PKHBT rGPR:$src1, rGPR:$src2, imm16_31:$shamt)>, Requires<[HasT2ExtractPack]>; +// Note: Shifts of 1-15 bits will be transformed to srl instead of sra and +// will match the pattern below. def t2PKHTB : T2I<(outs rGPR:$dst), (ins rGPR:$src1, rGPR:$src2, i32imm:$shamt), IIC_iALUsi, "pkhtb", "\t$dst, $src1, $src2, asr $shamt", [(set rGPR:$dst, (or (and rGPR:$src1, 0xFFFF0000), @@ -2121,8 +2123,8 @@ // Alternate cases for PKHTB where identities eliminate some nodes. Note that // a shift amount of 0 is *not legal* here, it is PKHBT instead. -def : T2Pat<(or (and rGPR:$src1, 0xFFFF0000), (srl rGPR:$src2, (i32 16))), - (t2PKHTB rGPR:$src1, rGPR:$src2, 16)>, +def : T2Pat<(or (and rGPR:$src1, 0xFFFF0000), (srl rGPR:$src2, imm16_31:$sh)), + (t2PKHTB rGPR:$src1, rGPR:$src2, imm16_31:$sh)>, Requires<[HasT2ExtractPack]>; def : T2Pat<(or (and rGPR:$src1, 0xFFFF0000), (and (srl rGPR:$src2, imm1_15:$shamt), 0xFFFF)), Modified: llvm/trunk/test/CodeGen/ARM/pack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/pack.ll?rev=111196&r1=111195&r2=111196&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/pack.ll (original) +++ llvm/trunk/test/CodeGen/ARM/pack.ll Mon Aug 16 17:26:55 2010 @@ -38,7 +38,7 @@ } ; CHECK: test4 -; CHECK: pkhbt r0, r0, r1 +; CHECK: pkhbt r0, r0, r1, lsl #0 define i32 @test4(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = and i32 %Y, -65536 ; [#uses=1] @@ -86,3 +86,12 @@ %tmp57 = or i32 %tmp4, %tmp1 ; [#uses=1] ret i32 %tmp57 } + +; CHECK: test8 +; CHECK: pkhtb r0, r0, r1, asr #22 +define i32 @test8(i32 %X, i32 %Y) { + %tmp1 = and i32 %X, -65536 + %tmp3 = lshr i32 %Y, 22 + %tmp57 = or i32 %tmp3, %tmp1 + ret i32 %tmp57 +} Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll?rev=111196&r1=111195&r2=111196&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll Mon Aug 16 17:26:55 2010 @@ -86,3 +86,12 @@ %tmp57 = or i32 %tmp4, %tmp1 ; [#uses=1] ret i32 %tmp57 } + +; CHECK: test8 +; CHECK: pkhtb r0, r0, r1, asr #22 +define i32 @test8(i32 %X, i32 %Y) { + %tmp1 = and i32 %X, -65536 + %tmp3 = lshr i32 %Y, 22 + %tmp57 = or i32 %tmp3, %tmp1 + ret i32 %tmp57 +} From grosbach at apple.com Mon Aug 16 17:30:41 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 16 Aug 2010 22:30:41 -0000 Subject: [llvm-commits] [llvm] r111197 - in /llvm/trunk: include/llvm/CodeGen/MachineFrameInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <20100816223041.8031A2A6C12C@llvm.org> Author: grosbach Date: Mon Aug 16 17:30:41 2010 New Revision: 111197 URL: http://llvm.org/viewvc/llvm-project?rev=111197&view=rev Log: Better handle alignment requirements for local objects in pre-regalloc frame mapping. Have the local block track its alignment requirement, and then apply that when the block itself is allocated. Previously, offsets could get adjusted in PEI to be different, relative to one another, than the block allocation thought they would be, which defeats the point of doing the allocation this way. Continuing rdar://8277890 Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h?rev=111197&r1=111196&r2=111197&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h Mon Aug 16 17:30:41 2010 @@ -212,6 +212,10 @@ /// target in eliminateFrameIndex(). int64_t LocalFrameBaseOffset; + /// Required alignment of the local object blob, which is the strictest + /// alignment of any object in it. + unsigned LocalFrameMaxAlign; + public: explicit MachineFrameInfo(const TargetFrameInfo &tfi) : TFI(tfi) { StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0; @@ -225,6 +229,7 @@ CSIValid = false; LocalFrameSize = 0; LocalFrameBaseOffset = 0; + LocalFrameMaxAlign = 0; } /// hasStackObjects - Return true if there are any stack objects in this @@ -302,6 +307,15 @@ /// getLocalFrameSize - Get the size of the local object blob. int64_t getLocalFrameSize() const { return LocalFrameSize; } + /// setLocalFrameMaxAlign - Required alignment of the local object blob, + /// which is the strictest alignment of any object in it. + void setLocalFrameMaxAlign(unsigned Align) { LocalFrameMaxAlign = Align; } + + /// getLocalFrameMaxAlign - Return the required alignment of the local + /// object blob. + unsigned getLocalFrameMaxAlign() { return LocalFrameMaxAlign; } + + /// isObjectPreAllocated - Return true if the object was pre-allocated into /// the local block. bool isObjectPreAllocated(int ObjectIdx) const { Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111197&r1=111196&r2=111197&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Mon Aug 16 17:30:41 2010 @@ -99,7 +99,7 @@ // Loop over all of the stack objects, assigning sequential addresses... MachineFrameInfo *MFI = Fn.getFrameInfo(); int64_t Offset = 0; - unsigned MaxAlign = MFI->getMaxAlignment(); + unsigned MaxAlign = 0; // Make sure that the stack protector comes before the local variables on the // stack. @@ -134,33 +134,7 @@ AdjustStackOffset(MFI, i, Offset, MaxAlign); } - const TargetRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo(); - if (!RegInfo->targetHandlesStackFrameRounding()) { - // If we have reserved argument space for call sites in the function - // immediately on entry to the current function, count it as part of the - // overall stack size. - if (MFI->adjustsStack() && RegInfo->hasReservedCallFrame(Fn)) - Offset += MFI->getMaxCallFrameSize(); - - // Round up the size to a multiple of the alignment. If the function has - // any calls or alloca's, align to the target's StackAlignment value to - // ensure that the callee's frame or the alloca data is suitably aligned; - // otherwise, for leaf functions, align to the TransientStackAlignment - // value. - unsigned StackAlign; - if (MFI->adjustsStack() || MFI->hasVarSizedObjects() || - (RegInfo->needsStackRealignment(Fn) && MFI->getObjectIndexEnd() != 0)) - StackAlign = TFI.getStackAlignment(); - else - StackAlign = TFI.getTransientStackAlignment(); - - // If the frame pointer is eliminated, all frame offsets will be relative to - // SP not FP. Align to MaxAlign so this works. - StackAlign = std::max(StackAlign, MaxAlign); - unsigned AlignMask = StackAlign - 1; - Offset = (Offset + AlignMask) & ~uint64_t(AlignMask); - } - // Remember how big this blob of stack space is MFI->setLocalFrameSize(Offset); + MFI->setLocalFrameMaxAlign(MaxAlign); } Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=111197&r1=111196&r2=111197&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Mon Aug 16 17:30:41 2010 @@ -556,10 +556,20 @@ AdjustStackOffset(MFI, SFI, StackGrowsDown, Offset, MaxAlign); } - // Store the offset of the start of the local allocation block. This - // will be used later when resolving frame base virtual register pseudos. - MFI->setLocalFrameBaseOffset(Offset); + // FIXME: Once this is working, then enable flag will change to a target + // check for whether the frame is large enough to want to use virtual + // frame index registers. Functions which don't want/need this optimization + // will continue to use the existing code path. if (EnableLocalStackAlloc) { + unsigned Align = MFI->getLocalFrameMaxAlign(); + + // Adjust to alignment boundary. + Offset = (Offset + Align - 1) / Align * Align; + + // Store the offset of the start of the local allocation block. This + // will be used later when resolving frame base virtual register pseudos. + MFI->setLocalFrameBaseOffset(Offset); + // Allocate the local block Offset += MFI->getLocalFrameSize(); @@ -571,10 +581,6 @@ AdjustStackOffset(MFI, Entry.first, StackGrowsDown, FIOffset, MaxAlign); } } - // FIXME: Allocate locals. Once the block allocation pass is turned on, - // this simplifies to just the second loop, since all of the large objects - // will have already been handled. The second loop can also simplify a - // bit, as the conditionals inside aren't all necessary. // Make sure that the stack protector comes before the local variables on the // stack. From gohman at apple.com Mon Aug 16 17:45:12 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 22:45:12 -0000 Subject: [llvm-commits] [llvm] r111199 - in /llvm/trunk: include/llvm/Pass.h include/llvm/PassManagers.h lib/Analysis/IPA/CallGraphSCCPass.cpp lib/Analysis/LoopPass.cpp lib/VMCore/Pass.cpp lib/VMCore/PassManager.cpp Message-ID: <20100816224512.4B48E2A6C12C@llvm.org> Author: djg Date: Mon Aug 16 17:45:12 2010 New Revision: 111199 URL: http://llvm.org/viewvc/llvm-project?rev=111199&view=rev Log: Make dumpPassStructure be a PMDataManager abstraction, rather than a Pass abstraction, since that's the level it's actually used at. Rename Pass' dumpPassStructure to dumpPass. This eliminates an awkward use of getAsPass() to convert a PMDataManager* into a Pass* just to permit a dumpPassStructure call. Modified: llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/Analysis/LoopPass.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=111199&r1=111198&r2=111199&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Mon Aug 16 17:45:12 2010 @@ -163,7 +163,7 @@ virtual void verifyAnalysis() const; // dumpPassStructure - Implement the -debug-passes=PassStructure option - virtual void dumpPassStructure(unsigned Offset = 0); + void dumpPass(unsigned Offset = 0); // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=111199&r1=111198&r2=111199&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Mon Aug 16 17:45:12 2010 @@ -362,6 +362,9 @@ InheritedAnalysis[Index++] = (*I)->getAvailableAnalysis(); } + /// dumpPassStructure - Implement the -debug-passes=PassStructure option. + virtual void dumpPassStructure(unsigned Offset) = 0; + protected: // Top level manager. Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=111199&r1=111198&r2=111199&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Mon Aug 16 17:45:12 2010 @@ -73,7 +73,7 @@ errs().indent(Offset*2) << "Call Graph SCC Pass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); - P->dumpPassStructure(Offset + 1); + P->dumpPass(Offset + 1); dumpLastUses(P, Offset+1); } } Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=111199&r1=111198&r2=111199&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Mon Aug 16 17:45:12 2010 @@ -332,7 +332,7 @@ errs().indent(Offset*2) << "Loop Pass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); - P->dumpPassStructure(Offset + 1); + P->dumpPass(Offset + 1); dumpLastUses(P, Offset+1); } } Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=111199&r1=111198&r2=111199&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Mon Aug 16 17:45:12 2010 @@ -48,8 +48,8 @@ return Resolver->getAnalysisIfAvailable(&AID, true) != 0; } -// dumpPassStructure - Implement the -debug-passes=Structure option -void Pass::dumpPassStructure(unsigned Offset) { +// dumpPass - Implement the -debug-passes=Structure option +void Pass::dumpPass(unsigned Offset) { dbgs().indent(Offset*2) << getPassName() << "\n"; } Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=111199&r1=111198&r2=111199&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Aug 16 17:45:12 2010 @@ -192,7 +192,7 @@ llvm::dbgs() << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { BasicBlockPass *BP = getContainedPass(Index); - BP->dumpPassStructure(Offset + 1); + BP->dumpPass(Offset + 1); dumpLastUses(BP, Offset+1); } } @@ -286,6 +286,11 @@ FPPassManager *FP = static_cast(PassManagers[N]); return FP; } + + /// dumpPassStructure - Implement the -debug-passes=PassStructure option. + void dumpPassStructure(unsigned) { + llvm_unreachable("dumpPassStructure called on FunctionPassManagerImpl"); + } }; char FunctionPassManagerImpl::ID = 0; @@ -348,7 +353,7 @@ llvm::dbgs() << std::string(Offset*2, ' ') << "ModulePass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { ModulePass *MP = getContainedPass(Index); - MP->dumpPassStructure(Offset + 1); + MP->dumpPass(Offset + 1); std::map::const_iterator I = OnTheFlyManagers.find(MP); if (I != OnTheFlyManagers.end()) @@ -432,6 +437,11 @@ MPPassManager *MP = static_cast(PassManagers[N]); return MP; } + + /// dumpPassStructure - Implement the -debug-passes=PassStructure option. + void dumpPassStructure(unsigned) { + llvm_unreachable("dumpPassStructure called on PassManagerImpl"); + } }; char PassManagerImpl::ID = 0; @@ -657,16 +667,14 @@ // Print out the immutable passes for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) { - ImmutablePasses[i]->dumpPassStructure(0); + ImmutablePasses[i]->dumpPass(); } - // Every class that derives from PMDataManager also derives from Pass - // (sometimes indirectly), but there's no inheritance relationship - // between PMDataManager and Pass, so we have to getAsPass to get - // from a PMDataManager* to a Pass*. + // Print out the normal passes. We add an extra layer of indentation here + // to help distinguish them visually from the immutable passes. for (SmallVector::const_iterator I = PassManagers.begin(), E = PassManagers.end(); I != E; ++I) - (*I)->getAsPass()->dumpPassStructure(1); + (*I)->dumpPassStructure(1); } void PMTopLevelManager::dumpArguments() const { @@ -1041,7 +1049,7 @@ for (SmallVector::iterator I = LUses.begin(), E = LUses.end(); I != E; ++I) { llvm::dbgs() << "--" << std::string(Offset*2, ' '); - (*I)->dumpPassStructure(0); + (*I)->dumpPass(0); } } @@ -1409,7 +1417,7 @@ llvm::dbgs() << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index); - FP->dumpPassStructure(Offset + 1); + FP->dumpPass(Offset + 1); dumpLastUses(FP, Offset+1); } } From gohman at apple.com Mon Aug 16 17:57:28 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 16 Aug 2010 22:57:28 -0000 Subject: [llvm-commits] [llvm] r111200 - /llvm/trunk/lib/VMCore/PassManager.cpp Message-ID: <20100816225728.EDF902A6C12C@llvm.org> Author: djg Date: Mon Aug 16 17:57:28 2010 New Revision: 111200 URL: http://llvm.org/viewvc/llvm-project?rev=111200&view=rev Log: The plural of analysis is analyses. Modified: llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=111200&r1=111199&r2=111200&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Aug 16 17:57:28 2010 @@ -601,7 +601,7 @@ AnalysisPass->getPotentialPassManagerType()) { // Schedule analysis pass that is managed by a new manager. schedulePass(AnalysisPass); - // Recheck analysis passes to ensure that required analysises that + // Recheck analysis passes to ensure that required analyses that // are already checked are still available. checkAnalysis = true; } @@ -951,7 +951,7 @@ TransferLastUses.clear(); } - // Now, take care of required analysises that are not available. + // Now, take care of required analyses that are not available. for (SmallVector::iterator I = ReqAnalysisNotAvailable.begin(), E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { From benny.kra at googlemail.com Mon Aug 16 18:00:12 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Mon, 16 Aug 2010 23:00:12 -0000 Subject: [llvm-commits] [llvm] r111201 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100816230012.6C7E92A6C12C@llvm.org> Author: d0k Date: Mon Aug 16 18:00:12 2010 New Revision: 111201 URL: http://llvm.org/viewvc/llvm-project?rev=111201&view=rev Log: Silence warnings and simplify code. Eliminate a 32/64 bit portability issue. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111201&r1=111200&r2=111201&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 18:00:12 2010 @@ -545,14 +545,13 @@ if (IsPCRel) { Type = ELF::R_X86_64_PC32; } else { - switch (Fixup.getKind()) { + switch ((unsigned)Fixup.getKind()) { + default: llvm_unreachable("invalid fixup kind!"); case FK_Data_8: Type = ELF::R_X86_64_64; break; case X86::reloc_pcrel_4byte: case FK_Data_4: - long Offset; - Offset = Target.getConstant(); // check that the offset fits within a signed long - if (!(((long) -1 << 31) & Offset) || (((long) -1 << 31) & Offset) == ((long) -1 << 31)) + if (isInt<32>(Target.getConstant())) Type = ELF::R_X86_64_32S; else Type = ELF::R_X86_64_32; From grosbach at apple.com Mon Aug 16 18:26:09 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 16 Aug 2010 23:26:09 -0000 Subject: [llvm-commits] [llvm] r111206 - in /llvm/trunk/lib/CodeGen: LocalStackSlotAllocation.cpp PrologEpilogInserter.cpp Message-ID: <20100816232609.3916A2A6C12C@llvm.org> Author: grosbach Date: Mon Aug 16 18:26:09 2010 New Revision: 111206 URL: http://llvm.org/viewvc/llvm-project?rev=111206&view=rev Log: tidy up. remove unused local. Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111206&r1=111205&r2=111206&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Mon Aug 16 18:26:09 2010 @@ -94,8 +94,6 @@ /// abstract stack objects. /// void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) { - const TargetFrameInfo &TFI = *Fn.getTarget().getFrameInfo(); - // Loop over all of the stack objects, assigning sequential addresses... MachineFrameInfo *MFI = Fn.getFrameInfo(); int64_t Offset = 0; Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=111206&r1=111205&r2=111206&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Mon Aug 16 18:26:09 2010 @@ -570,6 +570,8 @@ // will be used later when resolving frame base virtual register pseudos. MFI->setLocalFrameBaseOffset(Offset); + DEBUG(dbgs() << "Local frame base offset: " << Offset << "\n"); + // Allocate the local block Offset += MFI->getLocalFrameSize(); From bob.wilson at apple.com Mon Aug 16 18:37:17 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 23:37:17 -0000 Subject: [llvm-commits] [llvm] r111208 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20100816233717.625C72A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 18:37:17 2010 New Revision: 111208 URL: http://llvm.org/viewvc/llvm-project?rev=111208&view=rev Log: Ignore undef shuffle indices when checking for a VTRN shuffle. Radar 8290937. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=111208&r1=111207&r2=111208&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Aug 16 18:37:17 2010 @@ -3229,6 +3229,7 @@ unsigned NumElts = VT.getVectorNumElements(); WhichResult = (M[0] == 0 ? 0 : 1); for (unsigned i = 0; i < NumElts; i += 2) { + if (M[i] < 0) continue; if ((unsigned) M[i] != i + WhichResult || (unsigned) M[i+1] != i + WhichResult) return false; From resistor at mac.com Mon Aug 16 18:42:33 2010 From: resistor at mac.com (Owen Anderson) Date: Mon, 16 Aug 2010 23:42:33 -0000 Subject: [llvm-commits] [llvm] r111210 - /llvm/trunk/lib/Analysis/LazyValueInfo.cpp Message-ID: <20100816234233.A49C62A6C12C@llvm.org> Author: resistor Date: Mon Aug 16 18:42:33 2010 New Revision: 111210 URL: http://llvm.org/viewvc/llvm-project?rev=111210&view=rev Log: Fix another iterator invalidation that caused a *really* nasty miscompilation in 403.gcc. Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=111210&r1=111209&r2=111210&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Mon Aug 16 18:42:33 2010 @@ -379,7 +379,7 @@ LVILatticeVal getEdgeValue(BasicBlock *FromBB, BasicBlock *ToBB); private: - LVILatticeVal &getCachedEntryForBlock(BasicBlock *BB); + LVILatticeVal getCachedEntryForBlock(BasicBlock *BB); }; } // end anonymous namespace @@ -402,14 +402,14 @@ /// getCachedEntryForBlock - See if we already have a value for this block. If /// so, return it, otherwise create a new entry in the Cache map to use. -LVILatticeVal &LVIQuery::getCachedEntryForBlock(BasicBlock *BB) { +LVILatticeVal LVIQuery::getCachedEntryForBlock(BasicBlock *BB) { NewBlockInfo.insert(BB); return Cache[BB]; } LVILatticeVal LVIQuery::getBlockValue(BasicBlock *BB) { // See if we already have a value for this block. - LVILatticeVal &BBLV = getCachedEntryForBlock(BB); + LVILatticeVal BBLV = getCachedEntryForBlock(BB); // If we've already computed this block's value, return it. if (!BBLV.isUndefined()) { @@ -421,6 +421,7 @@ // lattice value to overdefined, so that cycles will terminate and be // conservatively correct. BBLV.markOverdefined(); + Cache[BB] = BBLV; // If V is live into BB, see if our predecessors know anything about it. Instruction *BBI = dyn_cast(Val); @@ -453,7 +454,7 @@ // Return the merged value, which is more precise than 'overdefined'. assert(!Result.isOverdefined()); - return getCachedEntryForBlock(BB) = Result; + return Cache[BB] = Result; } // If this value is defined by an instruction in this block, we have to @@ -478,7 +479,7 @@ // Return the merged value, which is more precise than 'overdefined'. assert(!Result.isOverdefined()); - return getCachedEntryForBlock(BB) = Result; + Cache[BB] = Result; } else { @@ -489,7 +490,7 @@ LVILatticeVal Result; Result.markOverdefined(); - return getCachedEntryForBlock(BB) = Result; + return Result; } From bob.wilson at apple.com Mon Aug 16 18:44:29 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 16 Aug 2010 23:44:29 -0000 Subject: [llvm-commits] [llvm] r111212 - /llvm/trunk/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll Message-ID: <20100816234429.6750F2A6C12C@llvm.org> Author: bwilson Date: Mon Aug 16 18:44:29 2010 New Revision: 111212 URL: http://llvm.org/viewvc/llvm-project?rev=111212&view=rev Log: Add a testcase for svn 111208. Modified: llvm/trunk/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll Modified: llvm/trunk/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll?rev=111212&r1=111211&r2=111212&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll (original) +++ llvm/trunk/test/CodeGen/ARM/2009-12-02-vtrn-undef.ll Mon Aug 16 18:44:29 2010 @@ -17,3 +17,17 @@ store <8 x i16> %1, <8 x i16>* %agg.result12.1.0, align 16 ret void } + +; Radar 8290937: Ignore undef shuffle indices. +; CHECK: t2 +; CHECK: vtrn.16 +define void @t2(%struct.int16x8x2_t* nocapture %ptr, <4 x i16> %a.0, <4 x i16> %b.0) nounwind { +entry: + %0 = shufflevector <4 x i16> %a.0, <4 x i16> undef, <8 x i32> + %1 = shufflevector <4 x i16> %a.0, <4 x i16> undef, <8 x i32> + %ptr26.0 = getelementptr inbounds %struct.int16x8x2_t* %ptr, i32 0, i32 0, i32 0, i32 0 + store <8 x i16> %0, <8 x i16>* %ptr26.0, align 16 + %ptr20.1.0 = getelementptr inbounds %struct.int16x8x2_t* %ptr, i32 0, i32 0, i32 1, i32 0 + store <8 x i16> %1, <8 x i16>* %ptr20.1.0, align 16 + ret void +} From benny.kra at googlemail.com Mon Aug 16 19:00:46 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 00:00:46 -0000 Subject: [llvm-commits] [llvm] r111213 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100817000046.3AC212A6C12C@llvm.org> Author: d0k Date: Mon Aug 16 19:00:46 2010 New Revision: 111213 URL: http://llvm.org/viewvc/llvm-project?rev=111213&view=rev Log: A round of minor cleanups for ELFObjectWriter. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111213&r1=111212&r2=111213&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 19:00:46 2010 @@ -354,6 +354,7 @@ String8(buf, info); F->getContents() += StringRef(buf, 1); // st_info + String8(buf, other); F->getContents() += StringRef(buf, 1); // st_other @@ -416,9 +417,7 @@ Value = Layout.getSymbolAddress(&Data); } } else if (ESize->getKind() == MCExpr::Constant) { - const MCConstantExpr *CE; - CE = static_cast(ESize); - Size = CE->getValue(); + Size = static_cast(ESize)->getValue(); } else { assert(0 && "Unsupported size expression"); } @@ -440,8 +439,7 @@ // The first entry is the undefined symbol entry. unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; - for (unsigned i = 0; i < EntrySize; ++i) - F->getContents() += '\x00'; + F->getContents().append(EntrySize, '\x00'); // Write the symbol table entries. LastLocalSymbolIndex = LocalSymbolData.size() + 1; @@ -456,9 +454,8 @@ unsigned Index = 1; for (MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end(); it != ie; ++it, ++Index) { - const MCSectionData &SD = *it; const MCSectionELF &Section = - static_cast(SD.getSection()); + static_cast(it->getSection()); // Leave out relocations so we don't have indexes within // the relocations messed up if (Section.getType() == ELF::SHT_RELA) @@ -613,15 +610,10 @@ ELFSymbolData MSD; MSD.SymbolData = it; - if (Symbol.isUndefined()) { + if (Symbol.isUndefined()) Undefined.push_back(MSD); - } else if (Symbol.isAbsolute()) { - External.push_back(MSD); - } else if (it->isCommon()) { + else External.push_back(MSD); - } else { - External.push_back(MSD); - } } array_pod_sort(Local.begin(), Local.end()); @@ -800,19 +792,12 @@ for (unsigned i = 0, e = Relocs.size(); i != e; ++i) { ELFRelocationEntry entry = Relocs[e - i - 1]; - if (Is64Bit) { - F->getContents() += StringRef((const char *)&entry.r_offset, 8); - F->getContents() += StringRef((const char *)&entry.r_info, 8); - - if (HasRelocationAddend) - F->getContents() += StringRef((const char *)&entry.r_addend, 8); - } else { - F->getContents() += StringRef((const char *)&entry.r_offset, 4); - F->getContents() += StringRef((const char *)&entry.r_info, 4); + unsigned WordSize = Is64Bit ? 8 : 4; + F->getContents() += StringRef((const char *)&entry.r_offset, WordSize); + F->getContents() += StringRef((const char *)&entry.r_info, WordSize); - if (HasRelocationAddend) - F->getContents() += StringRef((const char *)&entry.r_addend, 4); - } + if (HasRelocationAddend) + F->getContents() += StringRef((const char *)&entry.r_addend, WordSize); } } @@ -877,10 +862,8 @@ for (MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end(); it != ie; ++it) { - const MCSectionData &SD = *it; const MCSectionELF &Section = - static_cast(SD.getSection()); - + static_cast(it->getSection()); // Remember the index into the string table so we can write it // into the sh_name field of the section header table. From benny.kra at googlemail.com Mon Aug 16 19:33:24 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 00:33:24 -0000 Subject: [llvm-commits] [llvm] r111214 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100817003324.BD3AE2A6C12C@llvm.org> Author: d0k Date: Mon Aug 16 19:33:24 2010 New Revision: 111214 URL: http://llvm.org/viewvc/llvm-project?rev=111214&view=rev Log: Try to silence a overeager GCC warning. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111214&r1=111213&r2=111214&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 16 19:33:24 2010 @@ -569,6 +569,8 @@ ERE.r_info = ERE64.r_info; if (HasRelocationAddend) ERE.r_addend = Addend; + else + ERE.r_addend = 0; // Silence compiler warning. Relocations[Fragment->getParent()].push_back(ERE); } From echristo at apple.com Mon Aug 16 19:46:57 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 17 Aug 2010 00:46:57 -0000 Subject: [llvm-commits] [llvm] r111219 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20100817004657.8A0F92A6C12C@llvm.org> Author: echristo Date: Mon Aug 16 19:46:57 2010 New Revision: 111219 URL: http://llvm.org/viewvc/llvm-project?rev=111219&view=rev Log: Make arm fast-isel possible to enable via command line. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111219&r1=111218&r2=111219&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Aug 16 19:46:57 2010 @@ -29,11 +29,17 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Support/CallSite.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Target/TargetOptions.h" using namespace llvm; +static cl::opt +EnableARMFastISel("arm-fast-isel", + cl::desc("Turn on experimental ARM fast-isel support"), + cl::init(false), cl::Hidden); + namespace { class ARMFastISel : public FastISel { @@ -66,7 +72,7 @@ namespace llvm { llvm::FastISel *ARM::createFastISel(FunctionLoweringInfo &funcInfo) { - // Turn it off for now. It's not quite ready. + if (EnableARMFastISel) return new ARMFastISel(funcInfo); return 0; } } From echristo at apple.com Mon Aug 16 20:18:37 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 17 Aug 2010 01:18:37 -0000 Subject: [llvm-commits] [llvm] r111220 - /llvm/trunk/utils/TableGen/FastISelEmitter.cpp Message-ID: <20100817011837.605A32A6C12C@llvm.org> Author: echristo Date: Mon Aug 16 20:18:37 2010 New Revision: 111220 URL: http://llvm.org/viewvc/llvm-project?rev=111220&view=rev Log: Remove predicate workaround, we're going to require that predicate and optional def operands are handled in the backend support. Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=111220&r1=111219&r2=111220&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Mon Aug 16 20:18:37 2010 @@ -264,15 +264,6 @@ CodeGenInstruction &II = CGP.getTargetInfo().getInstruction(Op); if (II.OperandList.empty()) continue; - - // For now ignore instructions that have predicate operands. - bool HasPredicate = false; - for (unsigned i = 0, e = II.OperandList.size(); i != e; ++i) { - if(II.OperandList[i].Rec->isSubClassOf("PredicateOperand")) - HasPredicate = true; - } - if (HasPredicate) - continue; // For now, ignore multi-instruction patterns. bool MultiInsts = false; From evan.cheng at apple.com Mon Aug 16 20:20:37 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 01:20:37 -0000 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll Message-ID: <20100817012037.343492A6C12C@llvm.org> Author: evancheng Date: Mon Aug 16 20:20:36 2010 New Revision: 111221 URL: http://llvm.org/viewvc/llvm-project?rev=111221&view=rev Log: PHI elimination should not break back edge. It can cause some significant code placement issues. rdar://8263994 good: LBB0_2: mov r2, r0 . . . mov r1, r2 bne LBB0_2 bad: LBB0_2: mov r2, r0 . . . @ BB#3: mov r1, r2 b LBB0_2 Added: llvm/trunk/test/CodeGen/ARM/code-placement.ll Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/test/CodeGen/X86/lsr-reuse.ll Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=111221&r1=111220&r2=111221&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Aug 16 20:20:36 2010 @@ -439,6 +439,14 @@ if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) return NULL; + // Avoid splitting backedges of loops. It would introduce small out-of-line + // blocks into the loop which is very bad for code placement. + if (this == Succ) + return NULL; + MachineLoopInfo *MLI = P->getAnalysisIfAvailable(); + if (MLI->isLoopHeader(Succ)) + return NULL; + MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock(); MF->insert(llvm::next(MachineFunction::iterator(this)), NMBB); DEBUG(dbgs() << "PHIElimination splitting critical edge:" @@ -471,8 +479,7 @@ P->getAnalysisIfAvailable()) MDT->addNewBlock(NMBB, this); - if (MachineLoopInfo *MLI = - P->getAnalysisIfAvailable()) + if (MLI) if (MachineLoop *TIL = MLI->getLoopFor(this)) { // If one or the other blocks were not in a loop, the new block is not // either, and thus LI doesn't need to be updated. Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=111221&r1=111220&r2=111221&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Mon Aug 16 20:20:36 2010 @@ -20,6 +20,7 @@ #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Function.h" @@ -44,9 +45,9 @@ void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); + AU.addRequired(); AU.addPreserved(); - // rdar://7401784 This would be nice: - // AU.addPreservedID(MachineLoopInfoID); + AU.addPreservedID(MachineLoopInfoID); MachineFunctionPass::getAnalysisUsage(AU); } @@ -382,6 +383,7 @@ if (MBB.empty() || !MBB.front().isPHI() || MBB.isLandingPad()) return false; // Quick exit for basic blocks without PHIs. + bool Changed = false; for (MachineBasicBlock::const_iterator BBI = MBB.begin(), BBE = MBB.end(); BBI != BBE && BBI->isPHI(); ++BBI) { for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2) { @@ -391,7 +393,7 @@ // (not considering PHI nodes). If the register is live in to this block // anyway, we would gain nothing from splitting. if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) - PreMBB->SplitCriticalEdge(&MBB, this); + Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; } } return true; Added: llvm/trunk/test/CodeGen/ARM/code-placement.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/code-placement.ll?rev=111221&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/code-placement.ll (added) +++ llvm/trunk/test/CodeGen/ARM/code-placement.ll Mon Aug 16 20:20:36 2010 @@ -0,0 +1,29 @@ +; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s +; PHI elimination shouldn't break backedge. +; rdar://8263994 + +%struct.list_data_s = type { i16, i16 } +%struct.list_head = type { %struct.list_head*, %struct.list_data_s* } + +define arm_apcscc %struct.list_head* @t(%struct.list_head* %list) nounwind { +entry: + %0 = icmp eq %struct.list_head* %list, null + br i1 %0, label %bb2, label %bb + +bb: +; CHECK: LBB0_2: +; CHECK: bne LBB0_2 +; CHECK-NOT: b LBB0_2 +; CHECK: bx lr + %list_addr.05 = phi %struct.list_head* [ %2, %bb ], [ %list, %entry ] + %next.04 = phi %struct.list_head* [ %list_addr.05, %bb ], [ null, %entry ] + %1 = getelementptr inbounds %struct.list_head* %list_addr.05, i32 0, i32 0 + %2 = load %struct.list_head** %1, align 4 + store %struct.list_head* %next.04, %struct.list_head** %1, align 4 + %3 = icmp eq %struct.list_head* %2, null + br i1 %3, label %bb2, label %bb + +bb2: + %next.0.lcssa = phi %struct.list_head* [ null, %entry ], [ %list_addr.05, %bb ] + ret %struct.list_head* %next.0.lcssa +} Modified: llvm/trunk/test/CodeGen/X86/lsr-reuse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/lsr-reuse.ll?rev=111221&r1=111220&r2=111221&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/lsr-reuse.ll (original) +++ llvm/trunk/test/CodeGen/X86/lsr-reuse.ll Mon Aug 16 20:20:36 2010 @@ -464,7 +464,7 @@ ; And the one at %bb68, where we want to be sure to use superhero mode: -; CHECK: BB10_10: +; CHECK: BB10_9: ; CHECK-NEXT: movaps 48(%r{{[^,]*}}), %xmm{{.*}} ; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}} ; CHECK-NEXT: movaps 32(%r{{[^,]*}}), %xmm{{.*}} @@ -484,7 +484,7 @@ ; CHECK-NEXT: addq $64, %r{{.*}} ; CHECK-NEXT: addq $64, %r{{.*}} ; CHECK-NEXT: addq $-16, %r{{.*}} -; CHECK-NEXT: BB10_11: +; CHECK-NEXT: BB10_10: ; CHECK-NEXT: cmpq $15, %r{{.*}} ; CHECK-NEXT: jg From echristo at apple.com Mon Aug 16 20:25:29 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 17 Aug 2010 01:25:29 -0000 Subject: [llvm-commits] [llvm] r111222 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20100817012529.A3C5F2A6C12C@llvm.org> Author: echristo Date: Mon Aug 16 20:25:29 2010 New Revision: 111222 URL: http://llvm.org/viewvc/llvm-project?rev=111222&view=rev Log: Copy over some overridden MI wrappers for ARM fast-isel. This is where we're adding predicates and optional defs to the MachineInstrs. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111222&r1=111221&r2=111222&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Aug 16 20:25:29 2010 @@ -25,6 +25,8 @@ #include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/FunctionLoweringInfo.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -32,6 +34,10 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/GetElementPtrTypeIterator.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetLowering.h" +#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" using namespace llvm; @@ -47,12 +53,47 @@ /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can /// make the right decision when generating code for different targets. const ARMSubtarget *Subtarget; + const TargetMachine &TM; + const TargetInstrInfo &TII; + const TargetLowering &TLI; public: - explicit ARMFastISel(FunctionLoweringInfo &funcInfo) : FastISel(funcInfo) { + explicit ARMFastISel(FunctionLoweringInfo &funcInfo) + : FastISel(funcInfo), + TM(funcInfo.MF->getTarget()), + TII(*TM.getInstrInfo()), + TLI(*TM.getTargetLowering()) { Subtarget = &TM.getSubtarget(); } + virtual unsigned FastEmitInst_(unsigned MachineInstOpcode, + const TargetRegisterClass *RC); + virtual unsigned FastEmitInst_r(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill); + virtual unsigned FastEmitInst_rr(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + unsigned Op1, bool Op1IsKill); + virtual unsigned FastEmitInst_ri(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + uint64_t Imm); + virtual unsigned FastEmitInst_rf(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + const ConstantFP *FPImm); + virtual unsigned FastEmitInst_i(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + uint64_t Imm); + virtual unsigned FastEmitInst_rri(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + unsigned Op1, bool Op1IsKill, + uint64_t Imm); + virtual unsigned FastEmitInst_extractsubreg(MVT RetVT, + unsigned Op0, bool Op0IsKill, + uint32_t Idx); virtual bool TargetSelectInstruction(const Instruction *I); #include "ARMGenFastISel.inc" @@ -63,6 +104,156 @@ // #include "ARMGenCallingConv.inc" +unsigned ARMFastISel::FastEmitInst_(unsigned MachineInstOpcode, + const TargetRegisterClass* RC) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg)); + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_r(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + if (II.getNumDefs() >= 1) + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addReg(Op0, Op0IsKill * RegState::Kill)); + else { + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Op0, Op0IsKill * RegState::Kill)); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::COPY), ResultReg) + .addReg(II.ImplicitDefs[0])); + } + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_rr(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + unsigned Op1, bool Op1IsKill) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + if (II.getNumDefs() >= 1) + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addReg(Op1, Op1IsKill * RegState::Kill)); + else { + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addReg(Op1, Op1IsKill * RegState::Kill)); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::COPY), ResultReg) + .addReg(II.ImplicitDefs[0])); + } + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_ri(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + uint64_t Imm) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + if (II.getNumDefs() >= 1) + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addImm(Imm)); + else { + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addImm(Imm)); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::COPY), ResultReg) + .addReg(II.ImplicitDefs[0])); + } + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_rf(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + const ConstantFP *FPImm) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + if (II.getNumDefs() >= 1) + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addFPImm(FPImm)); + else { + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addFPImm(FPImm)); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::COPY), ResultReg) + .addReg(II.ImplicitDefs[0])); + } + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_rri(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + unsigned Op1, bool Op1IsKill, + uint64_t Imm) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + if (II.getNumDefs() >= 1) + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addReg(Op1, Op1IsKill * RegState::Kill) + .addImm(Imm)); + else { + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Op0, Op0IsKill * RegState::Kill) + .addReg(Op1, Op1IsKill * RegState::Kill) + .addImm(Imm)); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::COPY), ResultReg) + .addReg(II.ImplicitDefs[0])); + } + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_i(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + uint64_t Imm) { + unsigned ResultReg = createResultReg(RC); + const TargetInstrDesc &II = TII.get(MachineInstOpcode); + + if (II.getNumDefs() >= 1) + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addImm(Imm)); + else { + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addImm(Imm)); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::COPY), ResultReg) + .addReg(II.ImplicitDefs[0])); + } + return ResultReg; +} + +unsigned ARMFastISel::FastEmitInst_extractsubreg(MVT RetVT, + unsigned Op0, bool Op0IsKill, + uint32_t Idx) { + unsigned ResultReg = createResultReg(TLI.getRegClassFor(RetVT)); + assert(TargetRegisterInfo::isVirtualRegister(Op0) && + "Cannot yet extract from physregs"); + AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, + DL, TII.get(TargetOpcode::COPY), ResultReg) + .addReg(Op0, getKillRegState(Op0IsKill), Idx)); + return ResultReg; +} + bool ARMFastISel::TargetSelectInstruction(const Instruction *I) { switch (I->getOpcode()) { default: break; From echristo at apple.com Mon Aug 16 20:30:33 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 17 Aug 2010 01:30:33 -0000 Subject: [llvm-commits] [llvm] r111223 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <20100817013033.3B7582A6C12C@llvm.org> Author: echristo Date: Mon Aug 16 20:30:33 2010 New Revision: 111223 URL: http://llvm.org/viewvc/llvm-project?rev=111223&view=rev Log: Fix typo. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=111223&r1=111222&r2=111223&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Aug 16 20:30:33 2010 @@ -146,7 +146,7 @@ return Reg; } -/// materializeRegForValue - Helper for getRegForVale. This function is +/// materializeRegForValue - Helper for getRegForValue. This function is /// called when the value isn't already available in a register and must /// be materialized with new instructions. unsigned FastISel::materializeRegForValue(const Value *V, MVT VT) { From evan.cheng at apple.com Mon Aug 16 20:34:49 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 01:34:49 -0000 Subject: [llvm-commits] [llvm] r111224 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <20100817013449.58F042A6C12C@llvm.org> Author: evancheng Date: Mon Aug 16 20:34:49 2010 New Revision: 111224 URL: http://llvm.org/viewvc/llvm-project?rev=111224&view=rev Log: Add an option to disable codegen prepare critical edge splitting. In theory, PHI elimination is already doing all (most?) of the splitting needed. But machine-licm and machine-sink seem to miss some important optimizations when splitting is disabled. Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=111224&r1=111223&r2=111224&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon Aug 16 20:34:49 2010 @@ -33,6 +33,7 @@ #include "llvm/ADT/SmallSet.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CallSite.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/PatternMatch.h" @@ -41,6 +42,11 @@ using namespace llvm; using namespace llvm::PatternMatch; +static cl::opt +CriticalEdgeSplit("cgp-critical-edge-splitting", + cl::desc("Split critical edges during codegen prepare"), + cl::init(true), cl::Hidden); + namespace { class CodeGenPrepare : public FunctionPass { /// TLI - Keep a pointer of a TargetLowering to consult for determining @@ -891,12 +897,14 @@ bool MadeChange = false; // Split all critical edges where the dest block has a PHI. - TerminatorInst *BBTI = BB.getTerminator(); - if (BBTI->getNumSuccessors() > 1 && !isa(BBTI)) { - for (unsigned i = 0, e = BBTI->getNumSuccessors(); i != e; ++i) { - BasicBlock *SuccBB = BBTI->getSuccessor(i); - if (isa(SuccBB->begin()) && isCriticalEdge(BBTI, i, true)) - SplitEdgeNicely(BBTI, i, BackEdges, this); + if (CriticalEdgeSplit) { + TerminatorInst *BBTI = BB.getTerminator(); + if (BBTI->getNumSuccessors() > 1 && !isa(BBTI)) { + for (unsigned i = 0, e = BBTI->getNumSuccessors(); i != e; ++i) { + BasicBlock *SuccBB = BBTI->getSuccessor(i); + if (isa(SuccBB->begin()) && isCriticalEdge(BBTI, i, true)) + SplitEdgeNicely(BBTI, i, BackEdges, this); + } } } From geek4civic at gmail.com Mon Aug 16 22:44:50 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 17 Aug 2010 12:44:50 +0900 Subject: [llvm-commits] [Patch Proposal] Cygwin's dlsym(3) could not find preloaded symbols Message-ID: Good afternoon, Cygwin's dlsym(3) searches symbols only in the main module when the handle dlopen(NULL, RTLD_GLOBAL) is given. It causes failure of ENABLE_SHARED=1 unittests/ExecutionEngine/JIT/MultiJITTest.cpp. Feel free to rewrite my comment in this patch. ...Takumi -------------- next part -------------- diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp index 6f6890c..660db49 100644 --- a/lib/System/DynamicLibrary.cpp +++ b/lib/System/DynamicLibrary.cpp @@ -70,6 +70,12 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename, if (ErrMsg) *ErrMsg = dlerror(); return true; } +#ifdef __CYGWIN__ + // Cygwin searches symbols only in the main + // with the handle of dlopen(NULL, RTLD_GLOBAL). + if (Filename == NULL) + H = RTLD_DEFAULT; +#endif if (OpenedHandles == 0) OpenedHandles = new std::vector(); OpenedHandles->push_back(H); From lgerbarg at gmail.com Mon Aug 16 20:12:36 2010 From: lgerbarg at gmail.com (Louis Gerbarg) Date: Mon, 16 Aug 2010 21:12:36 -0400 Subject: [llvm-commits] [PATCH] Compatibility with GCC 4.6 #pragma GCC diagnostics Message-ID: GCC 4.6 has apparently added support for #pragma push/pop (see this thread for more details ), using the exact same identifier and semantics as the existing implementation in clang. This patch removes the special clang mode in the diagnostic handler, which lets the GCC pragmas fall through to the existing code. Overall it is a simplification of the existing code. This patch also includes modified test cases to handle altered semantics of the GCC mode behaviour. Passed tests with TOT under Darwin 10.6.3 x86-64. I think this should be good, but let me know if any fixes are needed. Louis --- include/clang/Basic/DiagnosticLexKinds.td | 10 ++---- lib/Lex/Pragma.cpp | 45 +++++++++-------------------- test/Preprocessor/pragma_diagnostic.c | 3 +- test/Preprocessor/pushable-diagnostics.c | 2 +- 4 files changed, 19 insertions(+), 41 deletions(-) diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 9b06fa8..76c211e 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -244,15 +244,11 @@ def ext_stdc_pragma_syntax_eom : def warn_stdc_fenv_access_not_supported : Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">, InGroup; -def warn_pragma_diagnostic_gcc_invalid : - ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', or" - " 'fatal'">, - InGroup; -def warn_pragma_diagnostic_clang_invalid : - ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal'" +def warn_pragma_diagnostic_invalid : + ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal'," " 'push', or 'pop'">, InGroup; -def warn_pragma_diagnostic_clang_cannot_ppp : +def warn_pragma_diagnostic_cannot_pop : ExtWarn<"pragma diagnostic pop could not pop, no matching push">, InGroup; def warn_pragma_diagnostic_invalid_option : diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 783900d..a74ff33 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -588,7 +588,7 @@ struct PragmaDebugHandler : public PragmaHandler { Token Tok; PP.LexUnexpandedToken(Tok); if (Tok.isNot(tok::identifier)) { - PP.Diag(Tok, diag::warn_pragma_diagnostic_clang_invalid); + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); return; } IdentifierInfo *II = Tok.getIdentifierInfo(); @@ -610,23 +610,14 @@ struct PragmaDebugHandler : public PragmaHandler { }; /// PragmaDiagnosticHandler - e.g. '#pragma GCC diagnostic ignored "-Wformat"' -/// Since clang's diagnostic supports extended functionality beyond GCC's -/// the constructor takes a clangMode flag to tell it whether or not to allow -/// clang's extended functionality, or whether to reject it. struct PragmaDiagnosticHandler : public PragmaHandler { -private: - const bool ClangMode; public: - explicit PragmaDiagnosticHandler(const bool clangMode) - : PragmaHandler("diagnostic"), ClangMode(clangMode) {} - + explicit PragmaDiagnosticHandler() : PragmaHandler("diagnostic") {} virtual void HandlePragma(Preprocessor &PP, Token &DiagToken) { Token Tok; PP.LexUnexpandedToken(Tok); if (Tok.isNot(tok::identifier)) { - unsigned Diag = ClangMode ? diag::warn_pragma_diagnostic_clang_invalid - : diag::warn_pragma_diagnostic_gcc_invalid; - PP.Diag(Tok, Diag); + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); return; } IdentifierInfo *II = Tok.getIdentifierInfo(); @@ -640,22 +631,16 @@ public: Map = diag::MAP_IGNORE; else if (II->isStr("fatal")) Map = diag::MAP_FATAL; - else if (ClangMode) { - if (II->isStr("pop")) { - if (!PP.getDiagnostics().popMappings()) - PP.Diag(Tok, diag::warn_pragma_diagnostic_clang_cannot_ppp); - return; - } - - if (II->isStr("push")) { - PP.getDiagnostics().pushMappings(); - return; - } - - PP.Diag(Tok, diag::warn_pragma_diagnostic_clang_invalid); + else if (II->isStr("pop")) { + if (!PP.getDiagnostics().popMappings()) + PP.Diag(Tok, diag::warn_pragma_diagnostic_cannot_pop); + + return; + } else if (II->isStr("push")) { + PP.getDiagnostics().pushMappings(); return; } else { - PP.Diag(Tok, diag::warn_pragma_diagnostic_gcc_invalid); + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); return; } @@ -687,9 +672,7 @@ public: if (Literal.hadError) return; if (Literal.Pascal) { - unsigned Diag = ClangMode ? diag::warn_pragma_diagnostic_clang_invalid - : diag::warn_pragma_diagnostic_gcc_invalid; - PP.Diag(Tok, Diag); + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); return; } @@ -812,13 +795,13 @@ void Preprocessor::RegisterBuiltinPragmas() { AddPragmaHandler("GCC", new PragmaPoisonHandler()); AddPragmaHandler("GCC", new PragmaSystemHeaderHandler()); AddPragmaHandler("GCC", new PragmaDependencyHandler()); - AddPragmaHandler("GCC", new PragmaDiagnosticHandler(false)); + AddPragmaHandler("GCC", new PragmaDiagnosticHandler()); // #pragma clang ... AddPragmaHandler("clang", new PragmaPoisonHandler()); AddPragmaHandler("clang", new PragmaSystemHeaderHandler()); AddPragmaHandler("clang", new PragmaDebugHandler()); AddPragmaHandler("clang", new PragmaDependencyHandler()); - AddPragmaHandler("clang", new PragmaDiagnosticHandler(true)); + AddPragmaHandler("clang", new PragmaDiagnosticHandler()); AddPragmaHandler("STDC", new PragmaSTDC_FP_CONTRACTHandler()); AddPragmaHandler("STDC", new PragmaSTDC_FENV_ACCESSHandler()); diff --git a/test/Preprocessor/pragma_diagnostic.c b/test/Preprocessor/pragma_diagnostic.c index d157406..818f02f 100644 --- a/test/Preprocessor/pragma_diagnostic.c +++ b/test/Preprocessor/pragma_diagnostic.c @@ -20,9 +20,8 @@ #endif - #define foo error -#pragma GCC diagnostic foo "-Wundef" // expected-warning {{pragma diagnostic expected 'error', 'warning', 'ignored', or 'fatal'}} +#pragma GCC diagnostic foo "-Wundef" // expected-warning {{pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'}} #pragma GCC diagnostic error 42 // expected-warning {{unexpected token in pragma diagnostic}} diff --git a/test/Preprocessor/pushable-diagnostics.c b/test/Preprocessor/pushable-diagnostics.c index 6c861a1..567a866 100644 --- a/test/Preprocessor/pushable-diagnostics.c +++ b/test/Preprocessor/pushable-diagnostics.c @@ -2,7 +2,7 @@ #pragma clang diagnostic pop // expected-warning{{pragma diagnostic pop could not pop, no matching push}} -#pragma clang diagnostic puhs // expected-warning{{pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal' 'push', or 'pop'}} +#pragma clang diagnostic puhs // expected-warning {{pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'}} char a = 'df'; // expected-warning{{multi-character character constant}} -- 1.7.0 From echristo at apple.com Mon Aug 16 23:57:09 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 17 Aug 2010 04:57:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111225 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <20100817045709.D58A72A6C12C@llvm.org> Author: echristo Date: Mon Aug 16 23:57:09 2010 New Revision: 111225 URL: http://llvm.org/viewvc/llvm-project?rev=111225&view=rev Log: Add support for -mllvm -mattr= command line options. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=111225&r1=111224&r2=111225&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Aug 16 23:57:09 2010 @@ -99,6 +99,12 @@ /// optimizations off. static cl::opt DisableLLVMOptimizations("disable-llvm-optzns"); +static cl::list +MAttrs("mattr", + cl::CommaSeparated, + cl::desc("Target specific attributes (-mattr=help for details)"), + cl::value_desc("a1,+a2,-a3,...")); + std::vector > StaticCtors, StaticDtors; SmallSetVector AttributeUsedGlobals; SmallSetVector AttributeCompilerUsedGlobals; @@ -512,13 +518,18 @@ // Figure out the subtarget feature string we pass to the target. std::string FeatureStr; + SubtargetFeatures Features; // The target can set LLVM_SET_SUBTARGET_FEATURES to configure the LLVM // backend. #ifdef LLVM_SET_SUBTARGET_FEATURES - SubtargetFeatures Features; LLVM_SET_SUBTARGET_FEATURES(Features); - FeatureStr = Features.getString(); #endif + + // Handle -mattr options passed into llvm + for (unsigned i = 0; i != MAttrs.size(); ++i) + Features.AddFeature(MAttrs[i]); + FeatureStr = Features.getString(); + TheTarget = TME->createTargetMachine(TargetTriple, FeatureStr); assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN); From bob.wilson at apple.com Tue Aug 17 00:54:34 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 17 Aug 2010 05:54:34 -0000 Subject: [llvm-commits] [llvm] r111226 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/vext.ll test/CodeGen/ARM/vrev.ll test/CodeGen/ARM/vtrn.ll test/CodeGen/ARM/vuzp.ll test/CodeGen/ARM/vzip.ll Message-ID: <20100817055434.9980A2A6C12C@llvm.org> Author: bwilson Date: Tue Aug 17 00:54:34 2010 New Revision: 111226 URL: http://llvm.org/viewvc/llvm-project?rev=111226&view=rev Log: Allow more cases of undef shuffle indices and add tests for them. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/test/CodeGen/ARM/vext.ll llvm/trunk/test/CodeGen/ARM/vrev.ll llvm/trunk/test/CodeGen/ARM/vtrn.ll llvm/trunk/test/CodeGen/ARM/vuzp.ll llvm/trunk/test/CodeGen/ARM/vzip.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=111226&r1=111225&r2=111226&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Aug 17 00:54:34 2010 @@ -3148,6 +3148,11 @@ bool &ReverseVEXT, unsigned &Imm) { unsigned NumElts = VT.getVectorNumElements(); ReverseVEXT = false; + + // Assume that the first shuffle index is not UNDEF. Fail if it is. + if (M[0] < 0) + return false; + Imm = M[0]; // If this is a VEXT shuffle, the immediate value is the index of the first @@ -3163,6 +3168,7 @@ ReverseVEXT = true; } + if (M[i] < 0) continue; // ignore UNDEF indices if (ExpectedElt != static_cast(M[i])) return false; } @@ -3188,13 +3194,16 @@ unsigned NumElts = VT.getVectorNumElements(); unsigned BlockElts = M[0] + 1; + // If the first shuffle index is UNDEF, be optimistic. + if (M[0] < 0) + BlockElts = BlockSize / EltSz; if (BlockSize <= EltSz || BlockSize != BlockElts * EltSz) return false; for (unsigned i = 0; i < NumElts; ++i) { - if ((unsigned) M[i] != - (i - i%BlockElts) + (BlockElts - 1 - i%BlockElts)) + if (M[i] < 0) continue; // ignore UNDEF indices + if ((unsigned) M[i] != (i - i%BlockElts) + (BlockElts - 1 - i%BlockElts)) return false; } @@ -3210,8 +3219,8 @@ unsigned NumElts = VT.getVectorNumElements(); WhichResult = (M[0] == 0 ? 0 : 1); for (unsigned i = 0; i < NumElts; i += 2) { - if ((unsigned) M[i] != i + WhichResult || - (unsigned) M[i+1] != i + NumElts + WhichResult) + if ((M[i] >= 0 && (unsigned) M[i] != i + WhichResult) || + (M[i+1] >= 0 && (unsigned) M[i+1] != i + NumElts + WhichResult)) return false; } return true; @@ -3229,9 +3238,8 @@ unsigned NumElts = VT.getVectorNumElements(); WhichResult = (M[0] == 0 ? 0 : 1); for (unsigned i = 0; i < NumElts; i += 2) { - if (M[i] < 0) continue; - if ((unsigned) M[i] != i + WhichResult || - (unsigned) M[i+1] != i + WhichResult) + if ((M[i] >= 0 && (unsigned) M[i] != i + WhichResult) || + (M[i+1] >= 0 && (unsigned) M[i+1] != i + WhichResult)) return false; } return true; @@ -3246,6 +3254,7 @@ unsigned NumElts = VT.getVectorNumElements(); WhichResult = (M[0] == 0 ? 0 : 1); for (unsigned i = 0; i != NumElts; ++i) { + if (M[i] < 0) continue; // ignore UNDEF indices if ((unsigned) M[i] != 2 * i + WhichResult) return false; } @@ -3271,7 +3280,8 @@ for (unsigned j = 0; j != 2; ++j) { unsigned Idx = WhichResult; for (unsigned i = 0; i != Half; ++i) { - if ((unsigned) M[i + j * Half] != Idx) + int MIdx = M[i + j * Half]; + if (MIdx >= 0 && (unsigned) MIdx != Idx) return false; Idx += 2; } @@ -3294,8 +3304,8 @@ WhichResult = (M[0] == 0 ? 0 : 1); unsigned Idx = WhichResult * NumElts / 2; for (unsigned i = 0; i != NumElts; i += 2) { - if ((unsigned) M[i] != Idx || - (unsigned) M[i+1] != Idx + NumElts) + if ((M[i] >= 0 && (unsigned) M[i] != Idx) || + (M[i+1] >= 0 && (unsigned) M[i+1] != Idx + NumElts)) return false; Idx += 1; } @@ -3320,8 +3330,8 @@ WhichResult = (M[0] == 0 ? 0 : 1); unsigned Idx = WhichResult * NumElts / 2; for (unsigned i = 0; i != NumElts; i += 2) { - if ((unsigned) M[i] != Idx || - (unsigned) M[i+1] != Idx) + if ((M[i] >= 0 && (unsigned) M[i] != Idx) || + (M[i+1] >= 0 && (unsigned) M[i+1] != Idx)) return false; Idx += 1; } Modified: llvm/trunk/test/CodeGen/ARM/vext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vext.ll?rev=111226&r1=111225&r2=111226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vext.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vext.ll Tue Aug 17 00:54:34 2010 @@ -54,3 +54,23 @@ ret <4 x i32> %tmp3 } +; Undef shuffle indices should not prevent matching to VEXT: + +define <8 x i8> @test_vextd_undef(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: test_vextd_undef: +;CHECK: vext + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + ret <8 x i8> %tmp3 +} + +define <16 x i8> @test_vextRq_undef(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: test_vextRq_undef: +;CHECK: vext + %tmp1 = load <16 x i8>* %A + %tmp2 = load <16 x i8>* %B + %tmp3 = shufflevector <16 x i8> %tmp1, <16 x i8> %tmp2, <16 x i32> + ret <16 x i8> %tmp3 +} + Modified: llvm/trunk/test/CodeGen/ARM/vrev.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vrev.ll?rev=111226&r1=111225&r2=111226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vrev.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vrev.ll Tue Aug 17 00:54:34 2010 @@ -111,3 +111,21 @@ %tmp2 = shufflevector <16 x i8> %tmp1, <16 x i8> undef, <16 x i32> ret <16 x i8> %tmp2 } + +; Undef shuffle indices should not prevent matching to VREV: + +define <8 x i8> @test_vrev64D8_undef(<8 x i8>* %A) nounwind { +;CHECK: test_vrev64D8_undef: +;CHECK: vrev64.8 + %tmp1 = load <8 x i8>* %A + %tmp2 = shufflevector <8 x i8> %tmp1, <8 x i8> undef, <8 x i32> + ret <8 x i8> %tmp2 +} + +define <8 x i16> @test_vrev32Q16_undef(<8 x i16>* %A) nounwind { +;CHECK: test_vrev32Q16_undef: +;CHECK: vrev32.16 + %tmp1 = load <8 x i16>* %A + %tmp2 = shufflevector <8 x i16> %tmp1, <8 x i16> undef, <8 x i32> + ret <8 x i16> %tmp2 +} Modified: llvm/trunk/test/CodeGen/ARM/vtrn.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vtrn.ll?rev=111226&r1=111225&r2=111226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vtrn.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vtrn.ll Tue Aug 17 00:54:34 2010 @@ -95,3 +95,30 @@ %tmp5 = fadd <4 x float> %tmp3, %tmp4 ret <4 x float> %tmp5 } + +; Undef shuffle indices should not prevent matching to VTRN: + +define <8 x i8> @vtrni8_undef(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vtrni8_undef: +;CHECK: vtrn.8 +;CHECK-NEXT: vadd.i8 + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + %tmp4 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + %tmp5 = add <8 x i8> %tmp3, %tmp4 + ret <8 x i8> %tmp5 +} + +define <8 x i16> @vtrnQi16_undef(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: vtrnQi16_undef: +;CHECK: vtrn.16 +;CHECK-NEXT: vadd.i16 + %tmp1 = load <8 x i16>* %A + %tmp2 = load <8 x i16>* %B + %tmp3 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <8 x i32> + %tmp4 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <8 x i32> + %tmp5 = add <8 x i16> %tmp3, %tmp4 + ret <8 x i16> %tmp5 +} + Modified: llvm/trunk/test/CodeGen/ARM/vuzp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vuzp.ll?rev=111226&r1=111225&r2=111226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vuzp.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vuzp.ll Tue Aug 17 00:54:34 2010 @@ -73,3 +73,30 @@ %tmp5 = fadd <4 x float> %tmp3, %tmp4 ret <4 x float> %tmp5 } + +; Undef shuffle indices should not prevent matching to VUZP: + +define <8 x i8> @vuzpi8_undef(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vuzpi8_undef: +;CHECK: vuzp.8 +;CHECK-NEXT: vadd.i8 + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + %tmp4 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + %tmp5 = add <8 x i8> %tmp3, %tmp4 + ret <8 x i8> %tmp5 +} + +define <8 x i16> @vuzpQi16_undef(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: vuzpQi16_undef: +;CHECK: vuzp.16 +;CHECK-NEXT: vadd.i16 + %tmp1 = load <8 x i16>* %A + %tmp2 = load <8 x i16>* %B + %tmp3 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <8 x i32> + %tmp4 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <8 x i32> + %tmp5 = add <8 x i16> %tmp3, %tmp4 + ret <8 x i16> %tmp5 +} + Modified: llvm/trunk/test/CodeGen/ARM/vzip.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vzip.ll?rev=111226&r1=111225&r2=111226&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vzip.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vzip.ll Tue Aug 17 00:54:34 2010 @@ -73,3 +73,30 @@ %tmp5 = fadd <4 x float> %tmp3, %tmp4 ret <4 x float> %tmp5 } + +; Undef shuffle indices should not prevent matching to VZIP: + +define <8 x i8> @vzipi8_undef(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vzipi8_undef: +;CHECK: vzip.8 +;CHECK-NEXT: vadd.i8 + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + %tmp4 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + %tmp5 = add <8 x i8> %tmp3, %tmp4 + ret <8 x i8> %tmp5 +} + +define <16 x i8> @vzipQi8_undef(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: vzipQi8_undef: +;CHECK: vzip.8 +;CHECK-NEXT: vadd.i8 + %tmp1 = load <16 x i8>* %A + %tmp2 = load <16 x i8>* %B + %tmp3 = shufflevector <16 x i8> %tmp1, <16 x i8> %tmp2, <16 x i32> + %tmp4 = shufflevector <16 x i8> %tmp1, <16 x i8> %tmp2, <16 x i32> + %tmp5 = add <16 x i8> %tmp3, %tmp4 + ret <16 x i8> %tmp5 +} + From stoklund at 2pi.dk Tue Aug 17 02:11:04 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 00:11:04 -0700 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll In-Reply-To: <20100817012037.343492A6C12C@llvm.org> References: <20100817012037.343492A6C12C@llvm.org> Message-ID: <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> On Aug 16, 2010, at 6:20 PM, Evan Cheng wrote: > Author: evancheng > Date: Mon Aug 16 20:20:36 2010 > New Revision: 111221 > > URL: http://llvm.org/viewvc/llvm-project?rev=111221&view=rev > Log: > PHI elimination should not break back edge. It can cause some significant code placement issues. rdar://8263994 > Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=111221&r1=111220&r2=111221&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Aug 16 20:20:36 2010 > @@ -439,6 +439,14 @@ > if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) > return NULL; > > + // Avoid splitting backedges of loops. It would introduce small out-of-line > + // blocks into the loop which is very bad for code placement. > + if (this == Succ) > + return NULL; > + MachineLoopInfo *MLI = P->getAnalysisIfAvailable(); > + if (MLI->isLoopHeader(Succ)) > + return NULL; > + Careful you don't dereference a NULL pointer. You can't count on MLI being available here. Also, I think the decision to not split a back edge should go in PHIElimination as a policy decision. Other callers of SplitCriticalEdge may have really good reasons for splitting a back edge. That should be allowed. /jakob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1929 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/7f807197/attachment.bin From benny.kra at googlemail.com Tue Aug 17 06:45:38 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 11:45:38 -0000 Subject: [llvm-commits] [llvm] r111228 - /llvm/trunk/include/llvm/Support/MathExtras.h Message-ID: <20100817114538.990C62A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 06:45:38 2010 New Revision: 111228 URL: http://llvm.org/viewvc/llvm-project?rev=111228&view=rev Log: There is this new "LLVM" compiler that supports __builtin_bswap but thinks it's gcc 4.2. Modified: llvm/trunk/include/llvm/Support/MathExtras.h Modified: llvm/trunk/include/llvm/Support/MathExtras.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=111228&r1=111227&r2=111228&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/MathExtras.h (original) +++ llvm/trunk/include/llvm/Support/MathExtras.h Tue Aug 17 06:45:38 2010 @@ -126,7 +126,8 @@ /// ByteSwap_32 - This function returns a byte-swapped representation of the /// 32-bit argument, Value. inline uint32_t ByteSwap_32(uint32_t Value) { -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) +#if defined(__llvm__) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) return __builtin_bswap32(Value); #elif defined(_MSC_VER) && !defined(_DEBUG) return _byteswap_ulong(Value); @@ -142,7 +143,8 @@ /// ByteSwap_64 - This function returns a byte-swapped representation of the /// 64-bit argument, Value. inline uint64_t ByteSwap_64(uint64_t Value) { -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) +#if defined(__llvm__) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) return __builtin_bswap64(Value); #elif defined(_MSC_VER) && !defined(_DEBUG) return _byteswap_uint64(Value); From peter at pcc.me.uk Tue Aug 17 08:26:23 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Tue, 17 Aug 2010 14:26:23 +0100 Subject: [llvm-commits] [PATCH] Fix CMake build In-Reply-To: <87wrs78u92.fsf@telefonica.net> References: <20100724203037.GA13960@pcc.me.uk> <20100803125442.GA19274@pcc.me.uk> <87wrs78u92.fsf@telefonica.net> Message-ID: <20100817132622.GA32236@pcc.me.uk> On Tue, Aug 03, 2010 at 07:46:01PM +0200, ?scar Fuentes wrote: > Peter Collingbourne > writes: > > >> These patches fix certain aspects of the CMake build for me, but I > >> wasn't 100% certain they are the right thing to do. In particular I > >> am not sure how the significant changes to LLVMLibDeps.cmake relate > >> to the changes I made. > >> > >> OK to commit? > > > > I also updated the patches (and the changes to LLVMLibDeps.cmake do > > not seem so significant now). The name changes to the PIC16 and XCore > > libraries do not seem to be needed now (I was unable to reproduce the > > error I got before) but it might still be worthwhile to make that > > change for the sake of consistency with the Makefile build and the > > other CodeGen libraries. > > I just updated the PIC16 and XCore library names and associated > dependencies. > > For the other patch, I see nothing objectionable on the CMake > changes. Others have to comment on the C++ part. Ping... I also attached an updated version of the patch. Thanks, -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Fix-CMake-shared-library-build.patch Type: text/x-diff Size: 12034 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/dbfc5505/attachment.bin From benny.kra at googlemail.com Tue Aug 17 08:55:45 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 13:55:45 -0000 Subject: [llvm-commits] [llvm] r111230 - /llvm/trunk/include/llvm/MC/MCObjectWriter.h Message-ID: <20100817135545.58C412A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 08:55:45 2010 New Revision: 111230 URL: http://llvm.org/viewvc/llvm-project?rev=111230&view=rev Log: Micro-optimize MCObjectWriter to do a byteswap if necessary and then write the whole integer to the stream instead of doing byte-sized writes. Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectWriter.h?rev=111230&r1=111229&r2=111230&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCObjectWriter.h (original) +++ llvm/trunk/include/llvm/MC/MCObjectWriter.h Tue Aug 17 08:55:45 2010 @@ -10,8 +10,10 @@ #ifndef LLVM_MC_MCOBJECTWRITER_H #define LLVM_MC_MCOBJECTWRITER_H +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/DataTypes.h" +#include "llvm/System/Host.h" #include namespace llvm { @@ -92,54 +94,57 @@ } void WriteLE16(uint16_t Value) { - Write8(uint8_t(Value >> 0)); - Write8(uint8_t(Value >> 8)); + if (sys::isBigEndianHost()) + Value = ByteSwap_16(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void WriteLE32(uint32_t Value) { - WriteLE16(uint16_t(Value >> 0)); - WriteLE16(uint16_t(Value >> 16)); + if (sys::isBigEndianHost()) + Value = ByteSwap_32(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void WriteLE64(uint64_t Value) { - WriteLE32(uint32_t(Value >> 0)); - WriteLE32(uint32_t(Value >> 32)); + if (sys::isBigEndianHost()) + Value = ByteSwap_64(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void WriteBE16(uint16_t Value) { - Write8(uint8_t(Value >> 8)); - Write8(uint8_t(Value >> 0)); + if (sys::isLittleEndianHost()) + Value = ByteSwap_16(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void WriteBE32(uint32_t Value) { - WriteBE16(uint16_t(Value >> 16)); - WriteBE16(uint16_t(Value >> 0)); + if (sys::isLittleEndianHost()) + Value = ByteSwap_32(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void WriteBE64(uint64_t Value) { - WriteBE32(uint32_t(Value >> 32)); - WriteBE32(uint32_t(Value >> 0)); + if (sys::isLittleEndianHost()) + Value = ByteSwap_64(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void Write16(uint16_t Value) { - if (IsLittleEndian) - WriteLE16(Value); - else - WriteBE16(Value); + if (IsLittleEndian != sys::isLittleEndianHost()) + Value = ByteSwap_16(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void Write32(uint32_t Value) { - if (IsLittleEndian) - WriteLE32(Value); - else - WriteBE32(Value); + if (IsLittleEndian != sys::isLittleEndianHost()) + Value = ByteSwap_32(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void Write64(uint64_t Value) { - if (IsLittleEndian) - WriteLE64(Value); - else - WriteBE64(Value); + if (IsLittleEndian != sys::isLittleEndianHost()) + Value = ByteSwap_64(Value); + OS << StringRef((const char*)&Value, sizeof(Value)); } void WriteZeros(unsigned N) { From daniel at zuster.org Tue Aug 17 10:16:26 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 17 Aug 2010 08:16:26 -0700 Subject: [llvm-commits] [llvm] r111230 - /llvm/trunk/include/llvm/MC/MCObjectWriter.h In-Reply-To: <20100817135545.58C412A6C12C@llvm.org> References: <20100817135545.58C412A6C12C@llvm.org> Message-ID: Hi Benjamin, On Tue, Aug 17, 2010 at 6:55 AM, Benjamin Kramer wrote: > Author: d0k > Date: Tue Aug 17 08:55:45 2010 > New Revision: 111230 > > URL: http://llvm.org/viewvc/llvm-project?rev=111230&view=rev > Log: > Micro-optimize MCObjectWriter to do a byteswap if necessary and then write the > whole integer to the stream instead of doing byte-sized writes. Gross, IMHO. Adding Host dependencies to portable code, which isn't performance sensitive, seems like a bad trade to me. - Daniel > Modified: > ? ?llvm/trunk/include/llvm/MC/MCObjectWriter.h > > Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectWriter.h?rev=111230&r1=111229&r2=111230&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/MC/MCObjectWriter.h (original) > +++ llvm/trunk/include/llvm/MC/MCObjectWriter.h Tue Aug 17 08:55:45 2010 > @@ -10,8 +10,10 @@ > ?#ifndef LLVM_MC_MCOBJECTWRITER_H > ?#define LLVM_MC_MCOBJECTWRITER_H > > +#include "llvm/Support/MathExtras.h" > ?#include "llvm/Support/raw_ostream.h" > ?#include "llvm/System/DataTypes.h" > +#include "llvm/System/Host.h" > ?#include > > ?namespace llvm { > @@ -92,54 +94,57 @@ > ? } > > ? void WriteLE16(uint16_t Value) { > - ? ?Write8(uint8_t(Value >> 0)); > - ? ?Write8(uint8_t(Value >> 8)); > + ? ?if (sys::isBigEndianHost()) > + ? ? ?Value = ByteSwap_16(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void WriteLE32(uint32_t Value) { > - ? ?WriteLE16(uint16_t(Value >> 0)); > - ? ?WriteLE16(uint16_t(Value >> 16)); > + ? ?if (sys::isBigEndianHost()) > + ? ? ?Value = ByteSwap_32(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void WriteLE64(uint64_t Value) { > - ? ?WriteLE32(uint32_t(Value >> 0)); > - ? ?WriteLE32(uint32_t(Value >> 32)); > + ? ?if (sys::isBigEndianHost()) > + ? ? ?Value = ByteSwap_64(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void WriteBE16(uint16_t Value) { > - ? ?Write8(uint8_t(Value >> 8)); > - ? ?Write8(uint8_t(Value >> 0)); > + ? ?if (sys::isLittleEndianHost()) > + ? ? ?Value = ByteSwap_16(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void WriteBE32(uint32_t Value) { > - ? ?WriteBE16(uint16_t(Value >> 16)); > - ? ?WriteBE16(uint16_t(Value >> 0)); > + ? ?if (sys::isLittleEndianHost()) > + ? ? ?Value = ByteSwap_32(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void WriteBE64(uint64_t Value) { > - ? ?WriteBE32(uint32_t(Value >> 32)); > - ? ?WriteBE32(uint32_t(Value >> 0)); > + ? ?if (sys::isLittleEndianHost()) > + ? ? ?Value = ByteSwap_64(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void Write16(uint16_t Value) { > - ? ?if (IsLittleEndian) > - ? ? ?WriteLE16(Value); > - ? ?else > - ? ? ?WriteBE16(Value); > + ? ?if (IsLittleEndian != sys::isLittleEndianHost()) > + ? ? ?Value = ByteSwap_16(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void Write32(uint32_t Value) { > - ? ?if (IsLittleEndian) > - ? ? ?WriteLE32(Value); > - ? ?else > - ? ? ?WriteBE32(Value); > + ? ?if (IsLittleEndian != sys::isLittleEndianHost()) > + ? ? ?Value = ByteSwap_32(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void Write64(uint64_t Value) { > - ? ?if (IsLittleEndian) > - ? ? ?WriteLE64(Value); > - ? ?else > - ? ? ?WriteBE64(Value); > + ? ?if (IsLittleEndian != sys::isLittleEndianHost()) > + ? ? ?Value = ByteSwap_64(Value); > + ? ?OS << StringRef((const char*)&Value, sizeof(Value)); > ? } > > ? void WriteZeros(unsigned N) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From benny.kra at googlemail.com Tue Aug 17 10:28:56 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 17:28:56 +0200 Subject: [llvm-commits] [llvm] r111230 - /llvm/trunk/include/llvm/MC/MCObjectWriter.h In-Reply-To: References: <20100817135545.58C412A6C12C@llvm.org> Message-ID: On 17.08.2010, at 17:16, Daniel Dunbar wrote: > Hi Benjamin, > > On Tue, Aug 17, 2010 at 6:55 AM, Benjamin Kramer > wrote: >> Author: d0k >> Date: Tue Aug 17 08:55:45 2010 >> New Revision: 111230 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111230&view=rev >> Log: >> Micro-optimize MCObjectWriter to do a byteswap if necessary and then write the >> whole integer to the stream instead of doing byte-sized writes. > > Gross, IMHO. Adding Host dependencies to portable code, which isn't > performance sensitive, seems like a bad trade to me. When rummaging in ELFObjectWriter I saw the gross code this generates and made a workaround. I will revert if it's not perf sensitive and less grossness makes you sleep better at night :) It would be nice if we put all the endian conversion stuff in a common place and make it really fast, but MCObjectWriter doesn't seem to be the right place for that. From clattner at apple.com Tue Aug 17 10:38:57 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Aug 2010 08:38:57 -0700 Subject: [llvm-commits] [llvm] r111230 - /llvm/trunk/include/llvm/MC/MCObjectWriter.h In-Reply-To: References: <20100817135545.58C412A6C12C@llvm.org> Message-ID: <64A87AF4-9128-4A3B-8BE0-902AFD88F945@apple.com> On Aug 17, 2010, at 8:28 AM, Benjamin Kramer wrote: >> >> Gross, IMHO. Adding Host dependencies to portable code, which isn't >> performance sensitive, seems like a bad trade to me. > > When rummaging in ELFObjectWriter I saw the gross code this generates and made a workaround. > I will revert if it's not perf sensitive and less grossness makes you sleep better at night :) > > It would be nice if we put all the endian conversion stuff in a common place and make it really fast, > but MCObjectWriter doesn't seem to be the right place for that. I agree, it seems that we really want some routines in libsupport like: uint32_t Convert32BitToLE(uint32_t x); uint32_t Convert32BitToBE(uint32_t x); uint32_t Convert32BitToAny(uint32_t x, Endianness_t); That way, the routines could be used for "push_back" as well as "write to memory" types of API. For "reading", we'd also want Convert...From -Chris From sabre at nondot.org Tue Aug 17 10:42:43 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 15:42:43 -0000 Subject: [llvm-commits] [llvm] r111231 - /llvm/trunk/lib/System/DynamicLibrary.cpp Message-ID: <20100817154243.32C512A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 10:42:43 2010 New Revision: 111231 URL: http://llvm.org/viewvc/llvm-project?rev=111231&view=rev Log: Fix failure of unittests/ExecutionEngine/JIT/MultiJITTest.cpp on cygwin when built with ENABLE_SHARED=1. Patch by NAKAMURA Takumi! Modified: llvm/trunk/lib/System/DynamicLibrary.cpp Modified: llvm/trunk/lib/System/DynamicLibrary.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/DynamicLibrary.cpp?rev=111231&r1=111230&r2=111231&view=diff ============================================================================== --- llvm/trunk/lib/System/DynamicLibrary.cpp (original) +++ llvm/trunk/lib/System/DynamicLibrary.cpp Tue Aug 17 10:42:43 2010 @@ -70,6 +70,12 @@ if (ErrMsg) *ErrMsg = dlerror(); return true; } +#ifdef __CYGWIN__ + // Cygwin searches symbols only in the main + // with the handle of dlopen(NULL, RTLD_GLOBAL). + if (Filename == NULL) + H = RTLD_DEFAULT; +#endif if (OpenedHandles == 0) OpenedHandles = new std::vector(); OpenedHandles->push_back(H); From clattner at apple.com Tue Aug 17 10:43:18 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Aug 2010 08:43:18 -0700 Subject: [llvm-commits] [Patch Proposal] Cygwin's dlsym(3) could not find preloaded symbols In-Reply-To: References: Message-ID: Applied in r111231, thanks! On Aug 16, 2010, at 8:44 PM, NAKAMURA Takumi wrote: > Good afternoon, > > Cygwin's dlsym(3) searches symbols only in the main module > when the handle dlopen(NULL, RTLD_GLOBAL) is given. > > It causes failure of ENABLE_SHARED=1 > unittests/ExecutionEngine/JIT/MultiJITTest.cpp. > > Feel free to rewrite my comment in this patch. > > > ...Takumi > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Tue Aug 17 10:43:54 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Aug 2010 08:43:54 -0700 Subject: [llvm-commits] [PATCH] Compatibility with GCC 4.6 #pragma GCC diagnostics In-Reply-To: References: Message-ID: Hi Louis! Thanks for the patch, please send it to the cfe-commits mailing list, since it is clang related. Thanks! -Chris On Aug 16, 2010, at 6:12 PM, Louis Gerbarg wrote: > GCC 4.6 has apparently added support for #pragma push/pop (see this > thread for more details > ), using the > exact same identifier and semantics as the existing implementation in > clang. This patch removes the special clang mode in the diagnostic > handler, which lets the GCC pragmas fall through to the existing code. > Overall it is a simplification of the existing code. This patch also > includes modified test cases to handle altered semantics of the GCC > mode behaviour. > > Passed tests with TOT under Darwin 10.6.3 x86-64. I think this should > be good, but let me know if any fixes are needed. > > Louis > > --- > include/clang/Basic/DiagnosticLexKinds.td | 10 ++---- > lib/Lex/Pragma.cpp | 45 +++++++++-------------------- > test/Preprocessor/pragma_diagnostic.c | 3 +- > test/Preprocessor/pushable-diagnostics.c | 2 +- > 4 files changed, 19 insertions(+), 41 deletions(-) > > diff --git a/include/clang/Basic/DiagnosticLexKinds.td > b/include/clang/Basic/DiagnosticLexKinds.td > index 9b06fa8..76c211e 100644 > --- a/include/clang/Basic/DiagnosticLexKinds.td > +++ b/include/clang/Basic/DiagnosticLexKinds.td > @@ -244,15 +244,11 @@ def ext_stdc_pragma_syntax_eom : > def warn_stdc_fenv_access_not_supported : > Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">, > InGroup; > -def warn_pragma_diagnostic_gcc_invalid : > - ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', or" > - " 'fatal'">, > - InGroup; > -def warn_pragma_diagnostic_clang_invalid : > - ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal'" > +def warn_pragma_diagnostic_invalid : > + ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal'," > " 'push', or 'pop'">, > InGroup; > -def warn_pragma_diagnostic_clang_cannot_ppp : > +def warn_pragma_diagnostic_cannot_pop : > ExtWarn<"pragma diagnostic pop could not pop, no matching push">, > InGroup; > def warn_pragma_diagnostic_invalid_option : > diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp > index 783900d..a74ff33 100644 > --- a/lib/Lex/Pragma.cpp > +++ b/lib/Lex/Pragma.cpp > @@ -588,7 +588,7 @@ struct PragmaDebugHandler : public PragmaHandler { > Token Tok; > PP.LexUnexpandedToken(Tok); > if (Tok.isNot(tok::identifier)) { > - PP.Diag(Tok, diag::warn_pragma_diagnostic_clang_invalid); > + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); > return; > } > IdentifierInfo *II = Tok.getIdentifierInfo(); > @@ -610,23 +610,14 @@ struct PragmaDebugHandler : public PragmaHandler { > }; > > /// PragmaDiagnosticHandler - e.g. '#pragma GCC diagnostic ignored "-Wformat"' > -/// Since clang's diagnostic supports extended functionality beyond GCC's > -/// the constructor takes a clangMode flag to tell it whether or not to allow > -/// clang's extended functionality, or whether to reject it. > struct PragmaDiagnosticHandler : public PragmaHandler { > -private: > - const bool ClangMode; > public: > - explicit PragmaDiagnosticHandler(const bool clangMode) > - : PragmaHandler("diagnostic"), ClangMode(clangMode) {} > - > + explicit PragmaDiagnosticHandler() : PragmaHandler("diagnostic") {} > virtual void HandlePragma(Preprocessor &PP, Token &DiagToken) { > Token Tok; > PP.LexUnexpandedToken(Tok); > if (Tok.isNot(tok::identifier)) { > - unsigned Diag = ClangMode ? diag::warn_pragma_diagnostic_clang_invalid > - : diag::warn_pragma_diagnostic_gcc_invalid; > - PP.Diag(Tok, Diag); > + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); > return; > } > IdentifierInfo *II = Tok.getIdentifierInfo(); > @@ -640,22 +631,16 @@ public: > Map = diag::MAP_IGNORE; > else if (II->isStr("fatal")) > Map = diag::MAP_FATAL; > - else if (ClangMode) { > - if (II->isStr("pop")) { > - if (!PP.getDiagnostics().popMappings()) > - PP.Diag(Tok, diag::warn_pragma_diagnostic_clang_cannot_ppp); > - return; > - } > - > - if (II->isStr("push")) { > - PP.getDiagnostics().pushMappings(); > - return; > - } > - > - PP.Diag(Tok, diag::warn_pragma_diagnostic_clang_invalid); > + else if (II->isStr("pop")) { > + if (!PP.getDiagnostics().popMappings()) > + PP.Diag(Tok, diag::warn_pragma_diagnostic_cannot_pop); > + > + return; > + } else if (II->isStr("push")) { > + PP.getDiagnostics().pushMappings(); > return; > } else { > - PP.Diag(Tok, diag::warn_pragma_diagnostic_gcc_invalid); > + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); > return; > } > > @@ -687,9 +672,7 @@ public: > if (Literal.hadError) > return; > if (Literal.Pascal) { > - unsigned Diag = ClangMode ? diag::warn_pragma_diagnostic_clang_invalid > - : diag::warn_pragma_diagnostic_gcc_invalid; > - PP.Diag(Tok, Diag); > + PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid); > return; > } > > @@ -812,13 +795,13 @@ void Preprocessor::RegisterBuiltinPragmas() { > AddPragmaHandler("GCC", new PragmaPoisonHandler()); > AddPragmaHandler("GCC", new PragmaSystemHeaderHandler()); > AddPragmaHandler("GCC", new PragmaDependencyHandler()); > - AddPragmaHandler("GCC", new PragmaDiagnosticHandler(false)); > + AddPragmaHandler("GCC", new PragmaDiagnosticHandler()); > // #pragma clang ... > AddPragmaHandler("clang", new PragmaPoisonHandler()); > AddPragmaHandler("clang", new PragmaSystemHeaderHandler()); > AddPragmaHandler("clang", new PragmaDebugHandler()); > AddPragmaHandler("clang", new PragmaDependencyHandler()); > - AddPragmaHandler("clang", new PragmaDiagnosticHandler(true)); > + AddPragmaHandler("clang", new PragmaDiagnosticHandler()); > > AddPragmaHandler("STDC", new PragmaSTDC_FP_CONTRACTHandler()); > AddPragmaHandler("STDC", new PragmaSTDC_FENV_ACCESSHandler()); > diff --git a/test/Preprocessor/pragma_diagnostic.c > b/test/Preprocessor/pragma_diagnostic.c > index d157406..818f02f 100644 > --- a/test/Preprocessor/pragma_diagnostic.c > +++ b/test/Preprocessor/pragma_diagnostic.c > @@ -20,9 +20,8 @@ > #endif > > > - > #define foo error > -#pragma GCC diagnostic foo "-Wundef" // expected-warning {{pragma > diagnostic expected 'error', 'warning', 'ignored', or 'fatal'}} > +#pragma GCC diagnostic foo "-Wundef" // expected-warning {{pragma > diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or > 'pop'}} > > #pragma GCC diagnostic error 42 // expected-warning {{unexpected > token in pragma diagnostic}} > > diff --git a/test/Preprocessor/pushable-diagnostics.c > b/test/Preprocessor/pushable-diagnostics.c > index 6c861a1..567a866 100644 > --- a/test/Preprocessor/pushable-diagnostics.c > +++ b/test/Preprocessor/pushable-diagnostics.c > @@ -2,7 +2,7 @@ > > #pragma clang diagnostic pop // expected-warning{{pragma diagnostic > pop could not pop, no matching push}} > > -#pragma clang diagnostic puhs // expected-warning{{pragma diagnostic > expected 'error', 'warning', 'ignored', 'fatal' 'push', or 'pop'}} > +#pragma clang diagnostic puhs // expected-warning {{pragma diagnostic > expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'}} > > char a = 'df'; // expected-warning{{multi-character character constant}} > > -- > 1.7.0 > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From benny.kra at googlemail.com Tue Aug 17 10:50:23 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 15:50:23 -0000 Subject: [llvm-commits] [llvm] r111232 - /llvm/trunk/include/llvm/MC/MCObjectWriter.h Message-ID: <20100817155023.46C342A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 10:50:23 2010 New Revision: 111232 URL: http://llvm.org/viewvc/llvm-project?rev=111232&view=rev Log: Revert r111230, we have to find a better place for the host-specific code. Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectWriter.h?rev=111232&r1=111231&r2=111232&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCObjectWriter.h (original) +++ llvm/trunk/include/llvm/MC/MCObjectWriter.h Tue Aug 17 10:50:23 2010 @@ -10,10 +10,8 @@ #ifndef LLVM_MC_MCOBJECTWRITER_H #define LLVM_MC_MCOBJECTWRITER_H -#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/DataTypes.h" -#include "llvm/System/Host.h" #include namespace llvm { @@ -94,57 +92,54 @@ } void WriteLE16(uint16_t Value) { - if (sys::isBigEndianHost()) - Value = ByteSwap_16(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + Write8(uint8_t(Value >> 0)); + Write8(uint8_t(Value >> 8)); } void WriteLE32(uint32_t Value) { - if (sys::isBigEndianHost()) - Value = ByteSwap_32(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + WriteLE16(uint16_t(Value >> 0)); + WriteLE16(uint16_t(Value >> 16)); } void WriteLE64(uint64_t Value) { - if (sys::isBigEndianHost()) - Value = ByteSwap_64(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + WriteLE32(uint32_t(Value >> 0)); + WriteLE32(uint32_t(Value >> 32)); } void WriteBE16(uint16_t Value) { - if (sys::isLittleEndianHost()) - Value = ByteSwap_16(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + Write8(uint8_t(Value >> 8)); + Write8(uint8_t(Value >> 0)); } void WriteBE32(uint32_t Value) { - if (sys::isLittleEndianHost()) - Value = ByteSwap_32(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + WriteBE16(uint16_t(Value >> 16)); + WriteBE16(uint16_t(Value >> 0)); } void WriteBE64(uint64_t Value) { - if (sys::isLittleEndianHost()) - Value = ByteSwap_64(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + WriteBE32(uint32_t(Value >> 32)); + WriteBE32(uint32_t(Value >> 0)); } void Write16(uint16_t Value) { - if (IsLittleEndian != sys::isLittleEndianHost()) - Value = ByteSwap_16(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + if (IsLittleEndian) + WriteLE16(Value); + else + WriteBE16(Value); } void Write32(uint32_t Value) { - if (IsLittleEndian != sys::isLittleEndianHost()) - Value = ByteSwap_32(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + if (IsLittleEndian) + WriteLE32(Value); + else + WriteBE32(Value); } void Write64(uint64_t Value) { - if (IsLittleEndian != sys::isLittleEndianHost()) - Value = ByteSwap_64(Value); - OS << StringRef((const char*)&Value, sizeof(Value)); + if (IsLittleEndian) + WriteLE64(Value); + else + WriteBE64(Value); } void WriteZeros(unsigned N) { From gohman at apple.com Tue Aug 17 11:00:02 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 17 Aug 2010 09:00:02 -0700 Subject: [llvm-commits] [llvm] r111224 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp In-Reply-To: <20100817013449.58F042A6C12C@llvm.org> References: <20100817013449.58F042A6C12C@llvm.org> Message-ID: <63798F59-C42E-4B49-BC69-F39711EB3280@apple.com> On Aug 16, 2010, at 6:34 PM, Evan Cheng wrote: > Author: evancheng > Date: Mon Aug 16 20:34:49 2010 > New Revision: 111224 > > URL: http://llvm.org/viewvc/llvm-project?rev=111224&view=rev > Log: > Add an option to disable codegen prepare critical edge splitting. In theory, PHI elimination is already doing all (most?) of the splitting needed. But machine-licm and machine-sink seem to miss some important optimizations when splitting is disabled. MachineLICM, at least, has code to split critical edges on demand. Is it missing cases? Also, CGP's SplitEdgeNicely has some logic for "nicely" reusing existing blocks to avoid creating new blocks, which PHI elimination's splitting doesn't have. Dan From Edmund.Grimley-Evans at arm.com Tue Aug 17 11:04:13 2010 From: Edmund.Grimley-Evans at arm.com (Edmund Grimley-Evans) Date: Tue, 17 Aug 2010 17:04:13 +0100 Subject: [llvm-commits] [PATCH] "C++" in .td files Message-ID: <680044E4997F5343A2C58032DDD0991607057D@ZIPPY.Emea.Arm.com> The "C++" indication in the first line of lib/Target/ARM/ARMCallingConv.td causes my Emacs to hang, which is rather aggravating. Could it be changed, please? I attach a mostly automatically generated patch for all the .td files. If you prefer to do it yourself it's: find -name '*.td' -exec perl -i -pe 's/-----\*- C\+\+ -\*/*- tablegen -*/;' {} \; But MBlazeCallingConv.td needs special treatment. Yeah, yeah, I know I should be using vi instead ... -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part -------------- A non-text attachment was scrubbed... Name: diff Type: application/octet-stream Size: 9713 bytes Desc: diff Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/4108a9f8/attachment.obj From nicholas at mxc.ca Tue Aug 17 11:19:18 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 17 Aug 2010 16:19:18 -0000 Subject: [llvm-commits] [llvm] r111240 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Message-ID: <20100817161918.E17BD2A6C12C@llvm.org> Author: nicholas Date: Tue Aug 17 11:19:18 2010 New Revision: 111240 URL: http://llvm.org/viewvc/llvm-project?rev=111240&view=rev Log: When creating a JIT, try to load the program so that we can resolve symbols against it. This affects Windows. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=111240&r1=111239&r2=111240&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Tue Aug 17 11:19:18 2010 @@ -219,6 +219,9 @@ StringRef MArch, StringRef MCPU, const SmallVectorImpl& MAttrs) { + // Try to register the program as a source of symbols to resolve against. + sys::DynamicLibrary::LoadLibraryPermanently(0, NULL); + // Pick a target either via -march or by guessing the native arch. TargetMachine *TM = JIT::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr); if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0; From nicholas at mxc.ca Tue Aug 17 11:19:57 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 17 Aug 2010 09:19:57 -0700 Subject: [llvm-commits] [llvm] r110564 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp In-Reply-To: References: <20100809072020.4A8062A6C12C@llvm.org> Message-ID: <4C6AB6AD.4080405@mxc.ca> nicolas geoffray wrote: > I'm very much in favor of Will's suggestion. Nick can you fix it? Ah, I totally missed the side-effects this had on Windows. Sorry about that! Fixed in r111240. > Thanks, > Nicolas > > On Tue, Aug 10, 2010 at 12:19 AM, Will Dietz > wrote: > > On Mon, Aug 9, 2010 at 2:20 AM, Nick Lewycky > wrote: > > Author: nicholas > > Date: Mon Aug 9 02:20:20 2010 > > New Revision: 110564 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=110564&view=rev > > > Log: > > Stop the JIT from refusing to work just because the program it > was compiled into > > was built with -static. > > > > This change breaks looking up symbols defined in the program itself, > at least here it does. > > Perhaps the right fix is to make reinstate the call removed in this > commit, but don't abort/return if it fails? > > ~Will > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From sabre at nondot.org Tue Aug 17 11:20:04 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 16:20:04 -0000 Subject: [llvm-commits] [llvm] r111241 - in /llvm/trunk/lib/Target: ARM/ CellSPU/ MBlaze/ Mips/ PowerPC/ Sparc/ Message-ID: <20100817162005.277152A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 11:20:04 2010 New Revision: 111241 URL: http://llvm.org/viewvc/llvm-project?rev=111241&view=rev Log: fix emacs language spec's, patch by Edmund Grimley-Evans! Modified: llvm/trunk/lib/Target/ARM/ARM.td llvm/trunk/lib/Target/ARM/ARMCallingConv.td llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td llvm/trunk/lib/Target/MBlaze/MBlaze.td llvm/trunk/lib/Target/MBlaze/MBlazeCallingConv.td llvm/trunk/lib/Target/MBlaze/MBlazeInstrFPU.td llvm/trunk/lib/Target/MBlaze/MBlazeInstrFSL.td llvm/trunk/lib/Target/MBlaze/MBlazeInstrFormats.td llvm/trunk/lib/Target/MBlaze/MBlazeInstrInfo.td llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.td llvm/trunk/lib/Target/MBlaze/MBlazeSchedule.td llvm/trunk/lib/Target/Mips/Mips.td llvm/trunk/lib/Target/Mips/MipsCallingConv.td llvm/trunk/lib/Target/Mips/MipsInstrFPU.td llvm/trunk/lib/Target/Mips/MipsInstrFormats.td llvm/trunk/lib/Target/Mips/MipsInstrInfo.td llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td llvm/trunk/lib/Target/Mips/MipsSchedule.td llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td llvm/trunk/lib/Target/Sparc/Sparc.td Modified: llvm/trunk/lib/Target/ARM/ARM.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARM.td (original) +++ llvm/trunk/lib/Target/ARM/ARM.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- ARM.td - Describe the ARM Target Machine -----------------*- C++ -*-===// +//===- ARM.td - Describe the ARM Target Machine ------------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original) +++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- ARMCallingConv.td - Calling Conventions for ARM ----------*- C++ -*-===// +//===- ARMCallingConv.td - Calling Conventions for ARM -----*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- ARMRegisterInfo.td - ARM Register defs -------------------*- C++ -*-===// +//===- ARMRegisterInfo.td - ARM Register defs --------------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- SPUCallingConv.td - Calling Conventions for CellSPU ------*- C++ -*-===// +//===- SPUCallingConv.td - Calling Conventions for CellSPU -*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlaze.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlaze.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlaze.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlaze.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlaze.td - Describe the MBlaze Target Machine -----------*- C++ -*-===// +//===- MBlaze.td - Describe the MBlaze Target Machine ------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeCallingConv.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeCallingConv.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeCallingConv.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeCallingConv.td - Calling Conventions for MBlaze ----*- C++ -*-===// +//===- MBlazeCallingConv.td - Calling Conventions for MBlaze -*- tablegen -*-=// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeInstrFPU.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeInstrFPU.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeInstrFPU.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeInstrFPU.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeInstrFPU.td - MBlaze FPU Instruction defs ----------*- C++ -*-===// +//===- MBlazeInstrFPU.td - MBlaze FPU Instruction defs -----*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeInstrFSL.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeInstrFSL.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeInstrFSL.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeInstrFSL.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeInstrFSL.td - MBlaze FSL Instruction defs ----------*- C++ -*-===// +//===- MBlazeInstrFSL.td - MBlaze FSL Instruction defs -----*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeInstrFormats.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeInstrFormats.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeInstrFormats.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeInstrFormats.td - MB Instruction defs --------------*- C++ -*-===// +//===- MBlazeInstrFormats.td - MB Instruction defs ---------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeInstrInfo.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeInstrInfo.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeInstrInfo.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeInstrInfo.td - MBlaze Instruction defs -------------*- C++ -*-===// +//===- MBlazeInstrInfo.td - MBlaze Instruction defs --------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeRegisterInfo.td - MBlaze Register defs -------------*- C++ -*-===// +//===- MBlazeRegisterInfo.td - MBlaze Register defs --------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/MBlaze/MBlazeSchedule.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeSchedule.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeSchedule.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeSchedule.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MBlazeSchedule.td - MBlaze Scheduling Definitions --------*- C++ -*-===// +//===- MBlazeSchedule.td - MBlaze Scheduling Definitions ---*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/Mips.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/Mips.td (original) +++ llvm/trunk/lib/Target/Mips/Mips.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- Mips.td - Describe the Mips Target Machine ---------------*- C++ -*-===// +//===- Mips.td - Describe the Mips Target Machine ----------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/MipsCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsCallingConv.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsCallingConv.td (original) +++ llvm/trunk/lib/Target/Mips/MipsCallingConv.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MipsCallingConv.td - Calling Conventions for Mips --------*- C++ -*-===// +//===- MipsCallingConv.td - Calling Conventions for Mips ---*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/MipsInstrFPU.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrFPU.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrFPU.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrFPU.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MipsInstrFPU.td - Mips FPU Instruction Information -------*- C++ -*-===// +//===- MipsInstrFPU.td - Mips FPU Instruction Information --*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/MipsInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrFormats.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrFormats.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrFormats.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MipsRegisterInfo.td - Mips Register defs -----------------*- C++ -*-===// +//===- MipsRegisterInfo.td - Mips Register defs ------------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MipsInstrInfo.td - Mips Register defs --------------------*- C++ -*-===// +//===- MipsInstrInfo.td - Mips Register defs ---------------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MipsRegisterInfo.td - Mips Register defs -----------------*- C++ -*-===// +//===- MipsRegisterInfo.td - Mips Register defs ------------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Mips/MipsSchedule.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSchedule.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsSchedule.td (original) +++ llvm/trunk/lib/Target/Mips/MipsSchedule.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- MipsSchedule.td - Mips Scheduling Definitions ------------*- C++ -*-===// +//===- MipsSchedule.td - Mips Scheduling Definitions -------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td (original) +++ llvm/trunk/lib/Target/PowerPC/PPCCallingConv.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- PPCCallingConv.td - Calling Conventions for PowerPC ------*- C++ -*-===// +//===- PPCCallingConv.td - Calling Conventions for PowerPC -*- tablegen -*-===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/Target/Sparc/Sparc.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/Sparc.td?rev=111241&r1=111240&r2=111241&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/Sparc.td (original) +++ llvm/trunk/lib/Target/Sparc/Sparc.td Tue Aug 17 11:20:04 2010 @@ -1,4 +1,4 @@ -//===- Sparc.td - Describe the Sparc Target Machine -------------*- C++ -*-===// +//===- Sparc.td - Describe the Sparc Target Machine --------*- tablegen -*-===// // // The LLVM Compiler Infrastructure // From clattner at apple.com Tue Aug 17 11:20:45 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Aug 2010 09:20:45 -0700 Subject: [llvm-commits] [PATCH] "C++" in .td files In-Reply-To: <680044E4997F5343A2C58032DDD0991607057D@ZIPPY.Emea.Arm.com> References: <680044E4997F5343A2C58032DDD0991607057D@ZIPPY.Emea.Arm.com> Message-ID: <8DE342D5-269E-4236-B3EA-D8B09F7D0E74@apple.com> On Aug 17, 2010, at 9:04 AM, Edmund Grimley-Evans wrote: > The "C++" indication in the first line of lib/Target/ARM/ARMCallingConv.td causes my Emacs to hang, which is rather aggravating. Could it be changed, please? I attach a mostly automatically generated patch for all the .td files. If you prefer to do it yourself it's: > > find -name '*.td' -exec perl -i -pe 's/-----\*- C\+\+ -\*/*- tablegen -*/;' {} \; > > But MBlazeCallingConv.td needs special treatment. > > Yeah, yeah, I know I should be using vi instead ... Applied in r111241, thanks! -Chris From benny.kra at googlemail.com Tue Aug 17 12:02:29 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 17:02:29 -0000 Subject: [llvm-commits] [llvm] r111247 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100817170229.E924F2A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 12:02:29 2010 New Revision: 111247 URL: http://llvm.org/viewvc/llvm-project?rev=111247&view=rev Log: One baby step towards i386 ELF, from Roman Divacky. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111247&r1=111246&r2=111247&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 12:02:29 2010 @@ -316,12 +316,13 @@ Write16(ELF::ET_REL); // e_type // FIXME: Make this configurable - Write16(ELF::EM_X86_64); // e_machine = target + Write16(Is64Bit ? ELF::EM_X86_64 : ELF::EM_386); // e_machine = target Write32(ELF::EV_CURRENT); // e_version WriteWord(0); // e_entry, no entry point in .o file WriteWord(0); // e_phoff, no program header for .o - WriteWord(SectionDataSize + 64); // e_shoff = sec hdr table off in bytes + WriteWord(SectionDataSize + (Is64Bit ? sizeof(ELF::Elf64_Ehdr) : + sizeof(ELF::Elf32_Ehdr))); // e_shoff = sec hdr table off in bytes // FIXME: Make this configurable. Write32(0); // e_flags = whatever the target wants From gohman at apple.com Tue Aug 17 12:07:02 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 17 Aug 2010 17:07:02 -0000 Subject: [llvm-commits] [llvm] r111248 - /llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Message-ID: <20100817170702.E8BBC2A6C12C@llvm.org> Author: djg Date: Tue Aug 17 12:07:02 2010 New Revision: 111248 URL: http://llvm.org/viewvc/llvm-project?rev=111248&view=rev Log: Use the getUniquePredecessor() utility function, instead of doing what it does manually. Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=111248&r1=111247&r2=111248&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Tue Aug 17 12:07:02 2010 @@ -97,23 +97,13 @@ /// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor, /// if possible. The return value indicates success or failure. bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) { - pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); - // Can't merge the entry block. Don't merge away blocks who have their - // address taken: this is a bug if the predecessor block is the entry node - // (because we'd end up taking the address of the entry) and undesirable in - // any case. - if (pred_begin(BB) == pred_end(BB) || - BB->hasAddressTaken()) return false; - - BasicBlock *PredBB = *PI++; - for (; PI != PE; ++PI) // Search all predecessors, see if they are all same - if (*PI != PredBB) { - PredBB = 0; // There are multiple different predecessors... - break; - } + // Don't merge away blocks who have their address taken. + if (BB->hasAddressTaken()) return false; - // Can't merge if there are multiple predecessors. + // Can't merge if there are multiple predecessors, or no predecessors. + BasicBlock *PredBB = BB->getUniquePredecessor(); if (!PredBB) return false; + // Don't break self-loops. if (PredBB == BB) return false; // Don't break invokes. From sabre at nondot.org Tue Aug 17 12:13:43 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 17:13:43 -0000 Subject: [llvm-commits] [llvm] r111249 - /llvm/trunk/docs/LangRef.html Message-ID: <20100817171343.643D12A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 12:13:42 2010 New Revision: 111249 URL: http://llvm.org/viewvc/llvm-project?rev=111249&view=rev Log: add some  's to a pre to avoid newlines being eaten and the formatting being thrown off. I admit to not knowing what is going on here. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=111249&r1=111248&r2=111249&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Aug 17 12:13:42 2010 @@ -491,20 +491,21 @@ the "hello world" module:

-; Declare the string constant as a global constant.
-@.LC0 = internal constant [13 x i8] c"hello world\0A\00"    ; [13 x i8]*
+; Declare the string constant as a global constant. 
+@.LC0 = internal constant [13 x i8] c"hello world\0A\00"      ; [13 x i8]* 
 
-; External declaration of the puts function
-declare i32 @puts(i8*)                                     ; i32 (i8*)* 
+; External declaration of the puts function 
+declare i32 @puts(i8*)                                      ; i32 (i8*)*  
 
 ; Definition of main function
-define i32 @main() {                                        ; i32()* 
-  ; Convert [13 x i8]* to i8  *...
-  %cast210 = getelementptr [13 x i8]* @.LC0, i64 0, i64 0   ; i8*
-
-  ; Call puts function to write out the string to stdout.
-  call i32 @puts(i8* %cast210)                             ; i32
-  ret i32 0
} +define i32 @main() { ; i32()*   + ; Convert [13 x i8]* to i8 *...  + %cast210 = getelementptr [13 x i8]* @.LC0, i64 0, i64 0 ; i8*  + + ; Call puts function to write out the string to stdout.  + call i32 @puts(i8* %cast210) ; i32  + ret i32 0  +} ; Named metadata !1 = metadata !{i32 41} From evan.cheng at apple.com Tue Aug 17 12:15:14 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 17:15:14 -0000 Subject: [llvm-commits] [llvm] r111250 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Message-ID: <20100817171514.8BB052A6C12C@llvm.org> Author: evancheng Date: Tue Aug 17 12:15:14 2010 New Revision: 111250 URL: http://llvm.org/viewvc/llvm-project?rev=111250&view=rev Log: Fix debug message. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=111250&r1=111249&r2=111250&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Tue Aug 17 12:15:14 2010 @@ -449,7 +449,7 @@ MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock(); MF->insert(llvm::next(MachineFunction::iterator(this)), NMBB); - DEBUG(dbgs() << "PHIElimination splitting critical edge:" + DEBUG(dbgs() << "Splitting critical edge:" " BB#" << getNumber() << " -- BB#" << NMBB->getNumber() << " -- BB#" << Succ->getNumber() << '\n'); From bob.wilson at apple.com Tue Aug 17 12:23:19 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 17 Aug 2010 17:23:19 -0000 Subject: [llvm-commits] [llvm] r111251 - in /llvm/trunk: lib/Target/ARM/ARMCodeEmitter.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMInstrThumb2.td lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h test/CodeGen/ARM/pack.ll test/CodeGen/Thumb2/thumb2-pack.ll test/MC/Disassembler/arm-tests.txt test/MC/Disassembler/thumb-tests.txt Message-ID: <20100817172320.0610C2A6C12C@llvm.org> Author: bwilson Date: Tue Aug 17 12:23:19 2010 New Revision: 111251 URL: http://llvm.org/viewvc/llvm-project?rev=111251&view=rev Log: Change ARM PKHTB and PKHBT instructions to use a shift_imm operand to avoid printing "lsl #0". This fixes the remaining parts of pr7792. Make corresponding changes for encoding/decoding these instructions. Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h llvm/trunk/test/CodeGen/ARM/pack.ll llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll llvm/trunk/test/MC/Disassembler/arm-tests.txt llvm/trunk/test/MC/Disassembler/thumb-tests.txt Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Aug 17 12:23:19 2010 @@ -1227,6 +1227,11 @@ // Encode shift_imm. unsigned ShiftAmt = MI.getOperand(OpIdx).getImm(); + if (TID.Opcode == ARM::PKHTB) { + assert(ShiftAmt != 0 && "PKHTB shift_imm is 0!"); + if (ShiftAmt == 32) + ShiftAmt = 0; + } assert(ShiftAmt < 32 && "shift_imm range is 0 to 31!"); Binary |= ShiftAmt << ARMII::ShiftShift; Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Aug 17 12:23:19 2010 @@ -2240,11 +2240,20 @@ let Inst{19-16} = 0b1111; } +def lsl_shift_imm : SDNodeXFormgetZExtValue()); + return CurDAG->getTargetConstant(Sh, MVT::i32); +}]>; + +def lsl_amt : PatLeaf<(i32 imm), [{ + return (N->getZExtValue() < 32); +}], lsl_shift_imm>; + def PKHBT : AMiscA1I<0b01101000, (outs GPR:$dst), - (ins GPR:$src1, GPR:$src2, i32imm:$shamt), - IIC_iALUsi, "pkhbt", "\t$dst, $src1, $src2, lsl $shamt", + (ins GPR:$src1, GPR:$src2, shift_imm:$sh), + IIC_iALUsi, "pkhbt", "\t$dst, $src1, $src2$sh", [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF), - (and (shl GPR:$src2, (i32 imm:$shamt)), + (and (shl GPR:$src2, lsl_amt:$sh), 0xFFFF0000)))]>, Requires<[IsARM, HasV6]> { let Inst{6-4} = 0b001; @@ -2253,28 +2262,37 @@ // Alternate cases for PKHBT where identities eliminate some nodes. def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (and GPR:$src2, 0xFFFF0000)), (PKHBT GPR:$src1, GPR:$src2, 0)>; -def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (shl GPR:$src2, imm16_31:$shamt)), - (PKHBT GPR:$src1, GPR:$src2, imm16_31:$shamt)>; +def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF), (shl GPR:$src2, imm16_31:$sh)), + (PKHBT GPR:$src1, GPR:$src2, (lsl_shift_imm imm16_31:$sh))>; +def asr_shift_imm : SDNodeXFormgetZExtValue()); + return CurDAG->getTargetConstant(Sh, MVT::i32); +}]>; + +def asr_amt : PatLeaf<(i32 imm), [{ + return (N->getZExtValue() <= 32); +}], asr_shift_imm>; // Note: Shifts of 1-15 bits will be transformed to srl instead of sra and // will match the pattern below. def PKHTB : AMiscA1I<0b01101000, (outs GPR:$dst), - (ins GPR:$src1, GPR:$src2, i32imm:$shamt), - IIC_iALUsi, "pkhtb", "\t$dst, $src1, $src2, asr $shamt", + (ins GPR:$src1, GPR:$src2, shift_imm:$sh), + IIC_iALUsi, "pkhtb", "\t$dst, $src1, $src2$sh", [(set GPR:$dst, (or (and GPR:$src1, 0xFFFF0000), - (and (sra GPR:$src2, imm16_31:$shamt), - 0xFFFF)))]>, Requires<[IsARM, HasV6]> { + (and (sra GPR:$src2, asr_amt:$sh), + 0xFFFF)))]>, + Requires<[IsARM, HasV6]> { let Inst{6-4} = 0b101; } // Alternate cases for PKHTB where identities eliminate some nodes. Note that // a shift amount of 0 is *not legal* here, it is PKHBT instead. def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, imm16_31:$sh)), - (PKHTB GPR:$src1, GPR:$src2, imm16_31:$sh)>; + (PKHTB GPR:$src1, GPR:$src2, (asr_shift_imm imm16_31:$sh))>; def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), - (and (srl GPR:$src2, imm1_15:$shamt), 0xFFFF)), - (PKHTB GPR:$src1, GPR:$src2, imm1_15:$shamt)>; + (and (srl GPR:$src2, imm1_15:$sh), 0xFFFF)), + (PKHTB GPR:$src1, GPR:$src2, (asr_shift_imm imm1_15:$sh))>; //===----------------------------------------------------------------------===// // Comparison Instructions... Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Tue Aug 17 12:23:19 2010 @@ -2085,10 +2085,10 @@ (or (srl (and rGPR:$src, 0xFF00), (i32 8)), (shl rGPR:$src, (i32 8))), i16))]>; -def t2PKHBT : T2I<(outs rGPR:$dst), (ins rGPR:$src1, rGPR:$src2, i32imm:$shamt), - IIC_iALUsi, "pkhbt", "\t$dst, $src1, $src2, lsl $shamt", +def t2PKHBT : T2I<(outs rGPR:$dst), (ins rGPR:$src1, rGPR:$src2, shift_imm:$sh), + IIC_iALUsi, "pkhbt", "\t$dst, $src1, $src2$sh", [(set rGPR:$dst, (or (and rGPR:$src1, 0xFFFF), - (and (shl rGPR:$src2, (i32 imm:$shamt)), + (and (shl rGPR:$src2, lsl_amt:$sh), 0xFFFF0000)))]>, Requires<[HasT2ExtractPack]> { let Inst{31-27} = 0b11101; @@ -2102,17 +2102,17 @@ def : T2Pat<(or (and rGPR:$src1, 0xFFFF), (and rGPR:$src2, 0xFFFF0000)), (t2PKHBT rGPR:$src1, rGPR:$src2, 0)>, Requires<[HasT2ExtractPack]>; -def : T2Pat<(or (and rGPR:$src1, 0xFFFF), (shl rGPR:$src2, imm16_31:$shamt)), - (t2PKHBT rGPR:$src1, rGPR:$src2, imm16_31:$shamt)>, +def : T2Pat<(or (and rGPR:$src1, 0xFFFF), (shl rGPR:$src2, imm16_31:$sh)), + (t2PKHBT rGPR:$src1, rGPR:$src2, (lsl_shift_imm imm16_31:$sh))>, Requires<[HasT2ExtractPack]>; // Note: Shifts of 1-15 bits will be transformed to srl instead of sra and // will match the pattern below. -def t2PKHTB : T2I<(outs rGPR:$dst), (ins rGPR:$src1, rGPR:$src2, i32imm:$shamt), - IIC_iALUsi, "pkhtb", "\t$dst, $src1, $src2, asr $shamt", +def t2PKHTB : T2I<(outs rGPR:$dst), (ins rGPR:$src1, rGPR:$src2, shift_imm:$sh), + IIC_iALUsi, "pkhtb", "\t$dst, $src1, $src2$sh", [(set rGPR:$dst, (or (and rGPR:$src1, 0xFFFF0000), - (and (sra rGPR:$src2, imm16_31:$shamt), - 0xFFFF)))]>, + (and (sra rGPR:$src2, asr_amt:$sh), + 0xFFFF)))]>, Requires<[HasT2ExtractPack]> { let Inst{31-27} = 0b11101; let Inst{26-25} = 0b01; @@ -2124,11 +2124,11 @@ // Alternate cases for PKHTB where identities eliminate some nodes. Note that // a shift amount of 0 is *not legal* here, it is PKHBT instead. def : T2Pat<(or (and rGPR:$src1, 0xFFFF0000), (srl rGPR:$src2, imm16_31:$sh)), - (t2PKHTB rGPR:$src1, rGPR:$src2, imm16_31:$sh)>, + (t2PKHTB rGPR:$src1, rGPR:$src2, (asr_shift_imm imm16_31:$sh))>, Requires<[HasT2ExtractPack]>; def : T2Pat<(or (and rGPR:$src1, 0xFFFF0000), - (and (srl rGPR:$src2, imm1_15:$shamt), 0xFFFF)), - (t2PKHTB rGPR:$src1, rGPR:$src2, imm1_15:$shamt)>, + (and (srl rGPR:$src2, imm1_15:$sh), 0xFFFF)), + (t2PKHTB rGPR:$src1, rGPR:$src2, (asr_shift_imm imm1_15:$sh))>, Requires<[HasT2ExtractPack]>; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original) +++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Tue Aug 17 12:23:19 2010 @@ -456,12 +456,20 @@ // // A8-11: DecodeImmShift() static inline void getImmShiftSE(ARM_AM::ShiftOpc &ShOp, unsigned &ShImm) { - // If type == 0b11 and imm5 == 0, we have an rrx, instead. - if (ShOp == ARM_AM::ror && ShImm == 0) - ShOp = ARM_AM::rrx; - // If (lsr or asr) and imm5 == 0, shift amount is 32. - if ((ShOp == ARM_AM::lsr || ShOp == ARM_AM::asr) && ShImm == 0) + if (ShImm != 0) + return; + switch (ShOp) { + case ARM_AM::lsl: + ShOp = ARM_AM::no_shift; + break; + case ARM_AM::lsr: + case ARM_AM::asr: ShImm = 32; + break; + case ARM_AM::ror: + ShOp = ARM_AM::rrx; + break; + } } // getAMSubModeForBits - getAMSubModeForBits translates from the ARM encoding @@ -1445,7 +1453,13 @@ && !OpInfo[OpIdx].isPredicate() && !OpInfo[OpIdx].isOptionalDef()) { // Extract the 5-bit immediate field Inst{11-7}. unsigned ShiftAmt = (insn >> ARMII::ShiftShift) & 0x1F; - MI.addOperand(MCOperand::CreateImm(ShiftAmt)); + ARM_AM::ShiftOpc Opc = ARM_AM::no_shift; + if (Opcode == ARM::PKHBT) + Opc = ARM_AM::lsl; + else if (Opcode == ARM::PKHBT) + Opc = ARM_AM::asr; + getImmShiftSE(Opc, ShiftAmt); + MI.addOperand(MCOperand::CreateImm(ARM_AM::getSORegOpc(Opc, ShiftAmt))); ++OpIdx; } Modified: llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h (original) +++ llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h Tue Aug 17 12:23:19 2010 @@ -220,7 +220,7 @@ switch (bits2) { default: assert(0 && "No such value"); case 0: - ShOp = ARM_AM::lsl; + ShOp = (imm5 == 0 ? ARM_AM::no_shift : ARM_AM::lsl); return imm5; case 1: ShOp = ARM_AM::lsr; @@ -1389,14 +1389,7 @@ unsigned imm5 = getShiftAmtBits(insn); ARM_AM::ShiftOpc ShOp = ARM_AM::no_shift; unsigned ShAmt = decodeImmShift(bits2, imm5, ShOp); - - // PKHBT/PKHTB are special in that we need the decodeImmShift() call to - // decode the shift amount from raw imm5 and bits2, but we DO NOT need - // to encode the ShOp, as it's in the asm string already. - if (Opcode == ARM::t2PKHBT || Opcode == ARM::t2PKHTB) - MI.addOperand(MCOperand::CreateImm(ShAmt)); - else - MI.addOperand(MCOperand::CreateImm(ARM_AM::getSORegOpc(ShOp, ShAmt))); + MI.addOperand(MCOperand::CreateImm(ARM_AM::getSORegOpc(ShOp, ShAmt))); } ++OpIdx; } Modified: llvm/trunk/test/CodeGen/ARM/pack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/pack.ll?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/pack.ll (original) +++ llvm/trunk/test/CodeGen/ARM/pack.ll Tue Aug 17 12:23:19 2010 @@ -38,7 +38,7 @@ } ; CHECK: test4 -; CHECK: pkhbt r0, r0, r1, lsl #0 +; CHECK: pkhbt r0, r0, r1 define i32 @test4(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = and i32 %Y, -65536 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-pack.ll Tue Aug 17 12:23:19 2010 @@ -38,7 +38,7 @@ } ; CHECK: test4 -; CHECK: pkhbt r0, r0, r1, lsl #0 +; CHECK: pkhbt r0, r0, r1 define i32 @test4(i32 %X, i32 %Y) { %tmp1 = and i32 %X, 65535 ; [#uses=1] %tmp3 = and i32 %Y, -65536 ; [#uses=1] Modified: llvm/trunk/test/MC/Disassembler/arm-tests.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/arm-tests.txt?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/arm-tests.txt (original) +++ llvm/trunk/test/MC/Disassembler/arm-tests.txt Tue Aug 17 12:23:19 2010 @@ -61,6 +61,10 @@ # CHECK: pkhbt r8, r9, r10, lsl #4 0x1a 0x82 0x89 0xe6 +# CHECK-NOT: pkhbtls pc, r11, r11, lsl #0 +# CHECK: pkhbtls pc, r11, r11 +0x1b 0xf0 0x8b 0x96 + # CHECK: pop {r0, r2, r4, r6, r8, r10} 0x55 0x05 0xbd 0xe8 Modified: llvm/trunk/test/MC/Disassembler/thumb-tests.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/thumb-tests.txt?rev=111251&r1=111250&r2=111251&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/thumb-tests.txt (original) +++ llvm/trunk/test/MC/Disassembler/thumb-tests.txt Tue Aug 17 12:23:19 2010 @@ -42,6 +42,10 @@ # CHECK: pkhtb r2, r4, r6, asr #16 0xc4 0xea 0x26 0x42 +# CHECK-NOT: pkhbt r2, r4, r6, lsl #0 +# CHECK: pkhbt r2, r4, r6 +0xc4 0xea 0x06 0x02 + # CHECK: pop {r2, r4, r6, r8, r10, r12} 0xbd 0xe8 0x54 0x15 From benny.kra at googlemail.com Tue Aug 17 12:30:07 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 17:30:07 -0000 Subject: [llvm-commits] [llvm] r111252 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100817173007.E3E732A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 12:30:07 2010 New Revision: 111252 URL: http://llvm.org/viewvc/llvm-project?rev=111252&view=rev Log: Differentiate between RELA and REL relocations, from Roman Divacky. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111252&r1=111251&r2=111252&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 12:30:07 2010 @@ -459,7 +459,7 @@ static_cast(it->getSection()); // Leave out relocations so we don't have indexes within // the relocations messed up - if (Section.getType() == ELF::SHT_RELA) + if (Section.getType() == ELF::SHT_RELA || Section.getType() == ELF::SHT_REL) continue; if (Index == Asm.size()) continue; @@ -747,12 +747,13 @@ static_cast(SD.getSection()); const StringRef SectionName = Section.getSectionName(); - std::string RelaSectionName = ".rela"; + std::string RelaSectionName = HasRelocationAddend ? ".rela" : ".rel"; RelaSectionName += SectionName; unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; - RelaSection = Ctx.getELFSection(RelaSectionName, ELF::SHT_RELA, 0, + RelaSection = Ctx.getELFSection(RelaSectionName, HasRelocationAddend ? + ELF::SHT_RELA : ELF::SHT_REL, 0, SectionKind::getReadOnly(), false, EntrySize); @@ -945,7 +946,6 @@ case ELF::SHT_RELA: { const MCSection *SymtabSection; const MCSection *InfoSection; - StringRef SectionName; const MCSectionData *SymtabSD; const MCSectionData *InfoSD; @@ -956,8 +956,10 @@ // we have to count the empty section in too sh_link = SymtabSD->getLayoutOrder() + 1; - SectionName = Section.getSectionName(); - SectionName = SectionName.slice(5, SectionName.size()); + // Remove ".rel" and ".rela" prefixes. + unsigned SecNameLen = (Section.getType() == ELF::SHT_REL) ? 4 : 5; + StringRef SectionName = Section.getSectionName().substr(SecNameLen); + InfoSection = Asm.getContext().getELFSection(SectionName, ELF::SHT_PROGBITS, 0, SectionKind::getReadOnly(), From evan.cheng at apple.com Tue Aug 17 12:30:54 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 10:30:54 -0700 Subject: [llvm-commits] [llvm] r111224 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp In-Reply-To: <63798F59-C42E-4B49-BC69-F39711EB3280@apple.com> References: <20100817013449.58F042A6C12C@llvm.org> <63798F59-C42E-4B49-BC69-F39711EB3280@apple.com> Message-ID: On Aug 17, 2010, at 9:00 AM, Dan Gohman wrote: > > On Aug 16, 2010, at 6:34 PM, Evan Cheng wrote: > >> Author: evancheng >> Date: Mon Aug 16 20:34:49 2010 >> New Revision: 111224 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111224&view=rev >> Log: >> Add an option to disable codegen prepare critical edge splitting. In theory, PHI elimination is already doing all (most?) of the splitting needed. But machine-licm and machine-sink seem to miss some important optimizations when splitting is disabled. > > MachineLICM, at least, has code to split critical edges on demand. Is > it missing cases? > > Also, CGP's SplitEdgeNicely has some logic for "nicely" reusing existing > blocks to avoid creating new blocks, which PHI elimination's splitting > doesn't have. Codegen doesn't normalize loops. Without CGP's splitting lots of loops end up missing preheaders. The right fix is for machine licm to insert preheaders on demand. I'm looking into it. Evan > > Dan > From grosbach at apple.com Tue Aug 17 12:37:22 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 17:37:22 -0000 Subject: [llvm-commits] [llvm] r111254 - /llvm/trunk/lib/Support/Statistic.cpp Message-ID: <20100817173722.3E6002A6C12C@llvm.org> Author: grosbach Date: Tue Aug 17 12:37:22 2010 New Revision: 111254 URL: http://llvm.org/viewvc/llvm-project?rev=111254&view=rev Log: remove trailing whitespace Modified: llvm/trunk/lib/Support/Statistic.cpp Modified: llvm/trunk/lib/Support/Statistic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Statistic.cpp?rev=111254&r1=111253&r2=111254&view=diff ============================================================================== --- llvm/trunk/lib/Support/Statistic.cpp (original) +++ llvm/trunk/lib/Support/Statistic.cpp Tue Aug 17 12:37:22 2010 @@ -44,7 +44,7 @@ namespace { /// StatisticInfo - This class is used in a ManagedStatic so that it is created -/// on demand (when the first statistic is bumped) and destroyed only when +/// on demand (when the first statistic is bumped) and destroyed only when /// llvm_shutdown is called. We print statistics from the destructor. class StatisticInfo { std::vector Stats; @@ -52,7 +52,7 @@ friend void llvm::PrintStatistics(raw_ostream &OS); public: ~StatisticInfo(); - + void addStatistic(const Statistic *S) { Stats.push_back(S); } @@ -71,7 +71,7 @@ if (!Initialized) { if (Enabled) StatInfo->addStatistic(this); - + sys::MemoryFence(); // Remember we have been registered. Initialized = true; @@ -84,7 +84,7 @@ bool operator()(const Statistic *LHS, const Statistic *RHS) const { int Cmp = std::strcmp(LHS->getName(), RHS->getName()); if (Cmp != 0) return Cmp < 0; - + // Secondary key is the description. return std::strcmp(LHS->getDesc(), RHS->getDesc()) < 0; } @@ -112,7 +112,7 @@ MaxNameLen = std::max(MaxNameLen, (unsigned)std::strlen(Stats.Stats[i]->getName())); } - + // Sort the fields by name. std::stable_sort(Stats.Stats.begin(), Stats.Stats.end(), NameCompare()); @@ -120,7 +120,7 @@ OS << "===" << std::string(73, '-') << "===\n" << " ... Statistics Collected ...\n" << "===" << std::string(73, '-') << "===\n\n"; - + // Print all of the statistics. for (size_t i = 0, e = Stats.Stats.size(); i != e; ++i) { std::string CountStr = utostr(Stats.Stats[i]->getValue()); @@ -129,7 +129,7 @@ << std::string(MaxNameLen-std::strlen(Stats.Stats[i]->getName()), ' ') << " - " << Stats.Stats[i]->getDesc() << "\n"; } - + OS << '\n'; // Flush the output stream. OS.flush(); From gohman at apple.com Tue Aug 17 12:39:21 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 17 Aug 2010 17:39:21 -0000 Subject: [llvm-commits] [llvm] r111255 - in /llvm/trunk: lib/Transforms/Scalar/LoopRotation.cpp test/Transforms/LoopRotate/phi-duplicate.ll Message-ID: <20100817173921.2F87D2A6C12C@llvm.org> Author: djg Date: Tue Aug 17 12:39:21 2010 New Revision: 111255 URL: http://llvm.org/viewvc/llvm-project?rev=111255&view=rev Log: When rotating loops, put the original header at the bottom of the loop, making the resulting loop significantly less ugly. Also, zap its trivial PHI nodes, since it's easy. Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/test/Transforms/LoopRotate/phi-duplicate.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=111255&r1=111254&r2=111255&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Tue Aug 17 12:39:21 2010 @@ -261,6 +261,26 @@ // NewHeader is now the header of the loop. L->moveToHeader(NewHeader); + // Move the original header to the bottom of the loop, where it now more + // naturally belongs. This isn't necessary for correctness, and CodeGen can + // usually reorder blocks on its own to fix things like this up, but it's + // still nice to keep the IR readable. + // + // The original header should have only one predecessor at this point, since + // we checked that the loop had a proper preheader and unique backedge before + // we started. + assert(OrigHeader->getSinglePredecessor() && + "Original loop header has too many predecessors after loop rotation!"); + OrigHeader->moveAfter(OrigHeader->getSinglePredecessor()); + + // Also, since this original header only has one predecessor, zap its + // PHI nodes, which are now trivial. + FoldSingleEntryPHINodes(OrigHeader); + + // TODO: We could just go ahead and merge OrigHeader into its predecessor + // at this point, if we don't mind updating dominator info. + + // Establish a new preheader, update dominators, etc. preserveCanonicalLoopForm(LPM); ++NumRotated; Modified: llvm/trunk/test/Transforms/LoopRotate/phi-duplicate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopRotate/phi-duplicate.ll?rev=111255&r1=111254&r2=111255&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LoopRotate/phi-duplicate.ll (original) +++ llvm/trunk/test/Transforms/LoopRotate/phi-duplicate.ll Tue Aug 17 12:39:21 2010 @@ -27,9 +27,21 @@ for.end: ; preds = %for.cond ret void } -; Should only end up with one phi. -; CHECK: for.body: -; CHECK-NEXT: %j.02 = phi i64 -; CHECK-NOT: phi -; CHECK: ret void +; Should only end up with one phi. Also, the original for.cond block should +; be moved to the end of the loop so that the new loop header pleasantly +; ends up at the top. + +; CHECK: define void @test +; CHECK-NEXT: entry: +; CHECK-NEXT: icmp slt i64 +; CHECK-NEXT: br i1 +; CHECK-NOT: : +; CHECK: bb.nph: +; CHECK-NEXT: br label %for.body +; CHECK-NOT: : +; CHECK: for.body: +; CHECK-NEXT: %j.02 = phi i64 +; CHECK-NOT: phi +; CHECK: ret void +; CHECK-NEXT: } From evan.cheng at apple.com Tue Aug 17 12:43:50 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 17:43:50 -0000 Subject: [llvm-commits] [llvm] r111256 - in /llvm/trunk/lib/CodeGen: MachineBasicBlock.cpp PHIElimination.cpp PHIElimination.h Message-ID: <20100817174351.04DE02A6C12C@llvm.org> Author: evancheng Date: Tue Aug 17 12:43:50 2010 New Revision: 111256 URL: http://llvm.org/viewvc/llvm-project?rev=111256&view=rev Log: Move the decision logic whether it's a good idea to split a critical edge to clients. Also fixed an erroneous check. An edge is only a back edge when the from and to blocks are in the same loop. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/PHIElimination.h Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=111256&r1=111255&r2=111256&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Tue Aug 17 12:43:50 2010 @@ -439,14 +439,6 @@ if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) return NULL; - // Avoid splitting backedges of loops. It would introduce small out-of-line - // blocks into the loop which is very bad for code placement. - if (this == Succ) - return NULL; - MachineLoopInfo *MLI = P->getAnalysisIfAvailable(); - if (MLI->isLoopHeader(Succ)) - return NULL; - MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock(); MF->insert(llvm::next(MachineFunction::iterator(this)), NMBB); DEBUG(dbgs() << "Splitting critical edge:" @@ -479,7 +471,7 @@ P->getAnalysisIfAvailable()) MDT->addNewBlock(NMBB, this); - if (MLI) + if (MachineLoopInfo *MLI = P->getAnalysisIfAvailable()) if (MachineLoop *TIL = MLI->getLoopFor(this)) { // If one or the other blocks were not in a loop, the new block is not // either, and thus LI doesn't need to be updated. Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=111256&r1=111255&r2=111256&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Tue Aug 17 12:43:50 2010 @@ -53,6 +53,7 @@ bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &MF) { MRI = &MF.getRegInfo(); + MLI = getAnalysisIfAvailable(); bool Changed = false; @@ -392,8 +393,14 @@ // We break edges when registers are live out from the predecessor block // (not considering PHI nodes). If the register is live in to this block // anyway, we would gain nothing from splitting. - if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) - Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; + // Avoid splitting backedges of loops. It would introduce small + // out-of-line blocks into the loop which is very bad for code placement. + if (PreMBB != &MBB && + !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) { + if (!(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && + MLI->isLoopHeader(&MBB))) + Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; + } } } return true; Modified: llvm/trunk/lib/CodeGen/PHIElimination.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.h?rev=111256&r1=111255&r2=111256&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.h (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.h Tue Aug 17 12:43:50 2010 @@ -13,15 +13,18 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" namespace llvm { class LiveVariables; + class MachineRegisterInfo; + class MachineLoopInfo; /// Lower PHI instructions to copies. class PHIElimination : public MachineFunctionPass { - MachineRegisterInfo *MRI; // Machine register information + MachineRegisterInfo *MRI; // Machine register information + MachineLoopInfo *MLI; public: static char ID; // Pass identification, replacement for typeid From evan.cheng at apple.com Tue Aug 17 12:49:06 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 10:49:06 -0700 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll In-Reply-To: <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> References: <20100817012037.343492A6C12C@llvm.org> <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> Message-ID: <912ECF79-D69C-4AD7-A69A-D2282AA2C6D7@apple.com> On Aug 17, 2010, at 12:11 AM, Jakob Stoklund Olesen wrote: > > On Aug 16, 2010, at 6:20 PM, Evan Cheng wrote: > >> Author: evancheng >> Date: Mon Aug 16 20:20:36 2010 >> New Revision: 111221 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111221&view=rev >> Log: >> PHI elimination should not break back edge. It can cause some significant code placement issues. rdar://8263994 > >> Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=111221&r1=111220&r2=111221&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) >> +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Aug 16 20:20:36 2010 >> @@ -439,6 +439,14 @@ >> if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) >> return NULL; >> >> + // Avoid splitting backedges of loops. It would introduce small out-of-line >> + // blocks into the loop which is very bad for code placement. >> + if (this == Succ) >> + return NULL; >> + MachineLoopInfo *MLI = P->getAnalysisIfAvailable(); >> + if (MLI->isLoopHeader(Succ)) >> + return NULL; >> + > > Careful you don't dereference a NULL pointer. You can't count on MLI being available here. Right. > > Also, I think the decision to not split a back edge should go in PHIElimination as a policy decision. Other callers of SplitCriticalEdge may have really good reasons for splitting a back edge. That should be allowed. I have mixed feeling about this. In theory code placement optimization passes should be able to fix this. That's why the check in codegenprep's critical edge splitting is called a hack. I thought it a good idea to put the hack in one place only. Anyway, I'm moving the check to phi elimination (and fixed it) and I'll keep an eye on other clients. Evan > > /jakob > From benny.kra at googlemail.com Tue Aug 17 12:56:13 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 17:56:13 -0000 Subject: [llvm-commits] [llvm] r111259 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100817175613.B49932A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 12:56:13 2010 New Revision: 111259 URL: http://llvm.org/viewvc/llvm-project?rev=111259&view=rev Log: Use the correct entry size for relocation entries, from Roman Divacky. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111259&r1=111258&r2=111259&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 12:56:13 2010 @@ -748,9 +748,13 @@ const StringRef SectionName = Section.getSectionName(); std::string RelaSectionName = HasRelocationAddend ? ".rela" : ".rel"; - RelaSectionName += SectionName; - unsigned EntrySize = Is64Bit ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; + + unsigned EntrySize; + if (HasRelocationAddend) + EntrySize = Is64Bit ? sizeof(ELF::Elf64_Rela) : sizeof(ELF::Elf32_Rela); + else + EntrySize = Is64Bit ? sizeof(ELF::Elf64_Rel) : sizeof(ELF::Elf32_Rel); RelaSection = Ctx.getELFSection(RelaSectionName, HasRelocationAddend ? ELF::SHT_RELA : ELF::SHT_REL, 0, From grosbach at apple.com Tue Aug 17 13:00:41 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 18:00:41 -0000 Subject: [llvm-commits] [llvm] r111260 - /llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Message-ID: <20100817180041.32D6E2A6C12C@llvm.org> Author: grosbach Date: Tue Aug 17 13:00:41 2010 New Revision: 111260 URL: http://llvm.org/viewvc/llvm-project?rev=111260&view=rev Log: explicitly handle no-op cases for clarity. Fixes clang warning. Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=111260&r1=111259&r2=111260&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original) +++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Tue Aug 17 13:00:41 2010 @@ -459,6 +459,9 @@ if (ShImm != 0) return; switch (ShOp) { + case ARM_AM::no_shift: + case ARM_AM::rrx: + break; case ARM_AM::lsl: ShOp = ARM_AM::no_shift; break; From stoklund at 2pi.dk Tue Aug 17 13:09:19 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 11:09:19 -0700 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll In-Reply-To: <912ECF79-D69C-4AD7-A69A-D2282AA2C6D7@apple.com> References: <20100817012037.343492A6C12C@llvm.org> <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> <912ECF79-D69C-4AD7-A69A-D2282AA2C6D7@apple.com> Message-ID: On Aug 17, 2010, at 10:49 AM, Evan Cheng wrote: > > On Aug 17, 2010, at 12:11 AM, Jakob Stoklund Olesen wrote: >> Careful you don't dereference a NULL pointer. You can't count on MLI being available here. > > Right. > >> >> Also, I think the decision to not split a back edge should go in PHIElimination as a policy decision. Other callers of SplitCriticalEdge may have really good reasons for splitting a back edge. That should be allowed. > > I have mixed feeling about this. In theory code placement optimization passes should be able to fix this. That's why the check in codegenprep's critical edge splitting is called a hack. I thought it a good idea to put the hack in one place only. Anyway, I'm moving the check to phi elimination (and fixed it) and I'll keep an eye on other clients. Thanks. I like the idea that SplitCriticalEdge only returns false when it would be impossible to split the edge. We could add a ShouldSplitCriticalEdge to indicate that it would be a really bad idea. If the new block is placed after its predecessor, you get a loop with a conditional branch in the middle and an unconditional branch at the bottom. That's not so bad, is it? @@ -392,8 +393,14 @@ // We break edges when registers are live out from the predecessor block // (not considering PHI nodes). If the register is live in to this block // anyway, we would gain nothing from splitting. - if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) - Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; + // Avoid splitting backedges of loops. It would introduce small + // out-of-line blocks into the loop which is very bad for code placement. + if (PreMBB != &MBB && + !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) { + if (!(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && + MLI->isLoopHeader(&MBB))) + Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; + } } } return true; You're doing it again ;-) You shouldn't expect MLI to be non-NULL here. /jakob From grosbach at apple.com Tue Aug 17 13:13:54 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 18:13:54 -0000 Subject: [llvm-commits] [llvm] r111262 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h Message-ID: <20100817181354.288932A6C12C@llvm.org> Author: grosbach Date: Tue Aug 17 13:13:53 2010 New Revision: 111262 URL: http://llvm.org/viewvc/llvm-project?rev=111262&view=rev Log: Add hook to examine an instruction referencing a frame index to determine whether to allocate a virtual frame base register to resolve the frame index reference in it. Implement a simple version for ARM to aid debugging. In LocalStackSlotAllocation, scan the function for frame index references to local frame indices and ask the target whether to allocate virtual frame base registers for any it encounters. Purely infrastructural for debug output. Next step is to actually allocate base registers, then add intelligent re-use of them. rdar://8277890 Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111262&r1=111261&r2=111262&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Tue Aug 17 13:13:53 2010 @@ -636,6 +636,14 @@ return false; } + /// needsFrameBaseReg - Returns true if the instruction's frame index + /// reference would be better served by a base register other than FP + /// or SP. Used by LocalStackFrameAllocation to determine which frame index + /// references it should create new base registers for. + virtual bool needsFrameBaseReg(MachineInstr *MI, unsigned operand) const { + return false; + } + /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the /// frame setup/destroy instructions if they exist (-1 otherwise). Some /// targets use pseudo instructions in order to abstract away the difference Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111262&r1=111261&r2=111262&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Tue Aug 17 13:13:53 2010 @@ -19,11 +19,11 @@ #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" -#include "llvm/ADT/Statistic.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" @@ -36,11 +36,15 @@ using namespace llvm; -STATISTIC(NumAllocations, "Number of frame indices processed"); +STATISTIC(NumAllocations, "Number of frame indices allocated into local block"); +STATISTIC(NumBaseRegisters, "Number of virtual frame base registers allocated"); +STATISTIC(NumReplacements, "Number of frame indices references replaced"); namespace { class LocalStackSlotPass: public MachineFunctionPass { void calculateFrameObjectOffsets(MachineFunction &Fn); + + void insertFrameReferenceRegisters(MachineFunction &Fn); public: static char ID; // Pass identification, replacement for typeid explicit LocalStackSlotPass() : MachineFunctionPass(ID) { } @@ -65,7 +69,11 @@ } bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) { + // Lay out the local blob. calculateFrameObjectOffsets(MF); + + // Insert virtual base registers to resolve frame index references. + insertFrameReferenceRegisters(MF); return true; } @@ -136,3 +144,45 @@ MFI->setLocalFrameSize(Offset); MFI->setLocalFrameMaxAlign(MaxAlign); } + +void LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) { + // Scan the function's instructions looking for frame index references. + // For each, ask the target if it wants a virtual base register for it + // based on what we can tell it about where the local will end up in the + // stack frame. If it wants one, re-use a suitable one we've previously + // allocated, or if there isn't one that fits the bill, allocate a new one + // and ask the target to create a defining instruction for it. + + MachineFrameInfo *MFI = Fn.getFrameInfo(); + const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); + + for (MachineFunction::iterator BB = Fn.begin(), + E = Fn.end(); BB != E; ++BB) { + for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { + MachineInstr *MI = I; + // For now, allocate the base register(s) within the basic block + // where they're used, and don't try to keep them around outside + // of that. It may be beneficial to try sharing them more broadly + // than that, but the increased register pressure makes that a + // tricky thing to balance. Investigate if re-materializing these + // becomes an issue. + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + // Consider replacing all frame index operands that reference + // an object allocated in the local block. + if (MI->getOperand(i).isFI() && + MFI->isObjectPreAllocated(MI->getOperand(i).getIndex())) { + DEBUG(dbgs() << "Considering: " << *MI); + if (TRI->needsFrameBaseReg(MI, i)) { + DEBUG(dbgs() << " Replacing FI in: " << *MI); + // FIXME: Make sure any new base reg is aligned reasonably. TBD + // what "reasonably" really means. Conservatively, can just + // use the alignment of the local block. + + ++NumReplacements; + } + + } + } + } + } +} Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=111262&r1=111261&r2=111262&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Tue Aug 17 13:13:53 2010 @@ -1367,6 +1367,47 @@ MBB.erase(I); } +/// needsFrameBaseReg - Returns true if the instruction's frame index +/// reference would be better served by a base register other than FP +/// or SP. Used by LocalStackFrameAllocation to determine which frame index +/// references it should create new base registers for. +bool ARMBaseRegisterInfo:: +needsFrameBaseReg(MachineInstr *MI, unsigned operand) const { + assert (MI->getOperand(operand).isFI() && + "needsFrameBaseReg() called on non Frame Index operand!"); + + // It's the load/store FI references that cause issues, as it can be difficult + // to materialize the offset if it won't fit in the literal field. Estimate + // based on the size of the local frame and some conservative assumptions + // about the rest of the stack frame (note, this is pre-regalloc, so + // we don't know everything for certain yet) whether this offset is likely + // to be out of range of the immediate. Return true if so. + + // FIXME: For testing, return true for all loads/stores and false for + // everything else. We want to create lots of base regs to shake out bugs. + // + // FIXME: This is Thumb2/ARM only for now to keep it simpler. + ARMFunctionInfo *AFI = + MI->getParent()->getParent()->getInfo(); + if (AFI->isThumb1OnlyFunction()) + return false; + + unsigned Opc = MI->getOpcode(); + + switch (Opc) { + case ARM::LDR: case ARM::LDRH: case ARM::LDRB: + case ARM::STR: case ARM::STRH: case ARM::STRB: + case ARM::t2LDRi12: case ARM::t2LDRi8: + case ARM::t2STRi12: case ARM::t2STRi8: + case ARM::VLDRS: case ARM::VLDRD: + case ARM::VSTRS: case ARM::VSTRD: + return true; + default: + return false; + } +} + + unsigned ARMBaseRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, FrameIndexValue *Value, Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=111262&r1=111261&r2=111262&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Tue Aug 17 13:13:53 2010 @@ -105,6 +105,7 @@ bool canRealignStack(const MachineFunction &MF) const; bool needsStackRealignment(const MachineFunction &MF) const; + bool needsFrameBaseReg(MachineInstr *MI, unsigned operand) const; bool cannotEliminateFrame(const MachineFunction &MF) const; From stoklund at 2pi.dk Tue Aug 17 13:17:12 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 18:17:12 -0000 Subject: [llvm-commits] [llvm] r111263 - in /llvm/trunk/lib/Target/Sparc: SparcISelDAGToDAG.cpp SparcInstrInfo.td Message-ID: <20100817181712.4F4C42A6C12C@llvm.org> Author: stoklund Date: Tue Aug 17 13:17:12 2010 New Revision: 111263 URL: http://llvm.org/viewvc/llvm-project?rev=111263&view=rev Log: Don't call Predicate_* methods directly from Sparc target. Modernize predicates a bit. The Predicate_* methods are not used by TableGen any longer. They are only emitted for the sake of legacy code. Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=111263&r1=111262&r2=111263&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Tue Aug 17 13:17:12 2010 @@ -84,7 +84,7 @@ if (Addr.getOpcode() == ISD::ADD) { if (ConstantSDNode *CN = dyn_cast(Addr.getOperand(1))) { - if (Predicate_simm13(CN)) { + if (isInt<13>(CN->getSExtValue())) { if (FrameIndexSDNode *FIN = dyn_cast(Addr.getOperand(0))) { // Constant offset from frame ref. @@ -120,9 +120,9 @@ return false; // direct calls. if (Addr.getOpcode() == ISD::ADD) { - if (isa(Addr.getOperand(1)) && - Predicate_simm13(Addr.getOperand(1).getNode())) - return false; // Let the reg+imm pattern catch this! + if (ConstantSDNode *CN = dyn_cast(Addr.getOperand(1))) + if (isInt<13>(CN->getSExtValue())) + return false; // Let the reg+imm pattern catch this! if (Addr.getOperand(0).getOpcode() == SPISD::Lo || Addr.getOperand(1).getOpcode() == SPISD::Lo) return false; // Let the reg+imm pattern catch this! Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=111263&r1=111262&r2=111263&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Tue Aug 17 13:17:12 2010 @@ -43,17 +43,9 @@ // Instruction Pattern Stuff //===----------------------------------------------------------------------===// -def simm11 : PatLeaf<(imm), [{ - // simm11 predicate - True if the imm fits in a 11-bit sign extended field. - return (((int)N->getZExtValue() << (32-11)) >> (32-11)) == - (int)N->getZExtValue(); -}]>; +def simm11 : PatLeaf<(imm), [{ return isInt<11>(N->getSExtValue()); }]>; -def simm13 : PatLeaf<(imm), [{ - // simm13 predicate - True if the imm fits in a 13-bit sign extended field. - return (((int)N->getZExtValue() << (32-13)) >> (32-13)) == - (int)N->getZExtValue(); -}]>; +def simm13 : PatLeaf<(imm), [{ return isInt<13>(N->getSExtValue()); }]>; def LO10 : SDNodeXFormgetTargetConstant((unsigned)N->getZExtValue() & 1023, From bob.wilson at apple.com Tue Aug 17 13:16:59 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 17 Aug 2010 11:16:59 -0700 Subject: [llvm-commits] [llvm] r111260 - /llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp In-Reply-To: <20100817180041.32D6E2A6C12C@llvm.org> References: <20100817180041.32D6E2A6C12C@llvm.org> Message-ID: <60059098-10E7-48AA-85FF-57C8C58AA82E@apple.com> Thanks, Jim! I hadn't noticed the warning. On Aug 17, 2010, at 11:00 AM, Jim Grosbach wrote: > Author: grosbach > Date: Tue Aug 17 13:00:41 2010 > New Revision: 111260 > > URL: http://llvm.org/viewvc/llvm-project?rev=111260&view=rev > Log: > explicitly handle no-op cases for clarity. Fixes clang warning. > > Modified: > llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp > > Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=111260&r1=111259&r2=111260&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original) > +++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Tue Aug 17 13:00:41 2010 > @@ -459,6 +459,9 @@ > if (ShImm != 0) > return; > switch (ShOp) { > + case ARM_AM::no_shift: > + case ARM_AM::rrx: > + break; > case ARM_AM::lsl: > ShOp = ARM_AM::no_shift; > break; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From benny.kra at googlemail.com Tue Aug 17 13:20:29 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 18:20:29 -0000 Subject: [llvm-commits] [llvm] r111264 - in /llvm/trunk: include/llvm/Support/ELF.h lib/MC/ELFObjectWriter.cpp Message-ID: <20100817182029.2568A2A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 13:20:28 2010 New Revision: 111264 URL: http://llvm.org/viewvc/llvm-project?rev=111264&view=rev Log: Sketch i386 relocations handling, from Roman Divacky. Hello world builds & runs now on i386/ELF with -integrated-as. Modified: llvm/trunk/include/llvm/Support/ELF.h llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/include/llvm/Support/ELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ELF.h?rev=111264&r1=111263&r2=111264&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ELF.h (original) +++ llvm/trunk/include/llvm/Support/ELF.h Tue Aug 17 13:20:28 2010 @@ -216,6 +216,27 @@ R_X86_64_TLSDESC = 36 }; +// i386 relocations. +// TODO: this is just a subset +enum { + R_386_NONE = 0, + R_386_32 = 1, + R_386_PC32 = 2, + R_386_GOT32 = 3, + R_386_PLT32 = 4, + R_386_COPY = 5, + R_386_GLOB_DAT = 6, + R_386_JUMP_SLOT = 7, + R_386_RELATIVE = 8, + R_386_GOTOFF = 9, + R_386_GOTPC = 10, + R_386_32PLT = 11, + R_386_16 = 20, + R_386_PC16 = 21, + R_386_8 = 22, + R_386_PC8 = 23 +}; + // Section header. struct Elf32_Shdr { Elf32_Word sh_name; // Section name (index into string table) Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111264&r1=111263&r2=111264&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 13:20:28 2010 @@ -487,7 +487,7 @@ } } -// FIXME: this is currently X86_64 only +// FIXME: this is currently X86/X86_64 only void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, @@ -495,8 +495,6 @@ MCValue Target, uint64_t &FixedValue) { unsigned IsPCRel = isFixupKindX86PCRel(Fixup.getKind()); - ELFRelocationEntry ERE; - struct ELF::Elf64_Rela ERE64; uint64_t FixupOffset = Layout.getFragmentOffset(Fragment) + Fixup.getOffset(); @@ -508,7 +506,7 @@ Value = Target.getConstant(); if (Target.isAbsolute()) { - Type = ELF::R_X86_64_NONE; + Type = Is64Bit ? ELF::R_X86_64_NONE : ELF::R_386_NONE; Index = 0; } else { const MCSymbol *Symbol = &Target.getSymA()->getSymbol(); @@ -540,34 +538,57 @@ } // determine the type of the relocation - if (IsPCRel) { - Type = ELF::R_X86_64_PC32; + if (Is64Bit) { + if (IsPCRel) { + Type = ELF::R_X86_64_PC32; + } else { + switch ((unsigned)Fixup.getKind()) { + default: llvm_unreachable("invalid fixup kind!"); + case FK_Data_8: Type = ELF::R_X86_64_64; break; + case X86::reloc_pcrel_4byte: + case FK_Data_4: + // check that the offset fits within a signed long + if (isInt<32>(Target.getConstant())) + Type = ELF::R_X86_64_32S; + else + Type = ELF::R_X86_64_32; + break; + case FK_Data_2: Type = ELF::R_X86_64_16; break; + case X86::reloc_pcrel_1byte: + case FK_Data_1: Type = ELF::R_X86_64_8; break; + } + } } else { - switch ((unsigned)Fixup.getKind()) { - default: llvm_unreachable("invalid fixup kind!"); - case FK_Data_8: Type = ELF::R_X86_64_64; break; - case X86::reloc_pcrel_4byte: - case FK_Data_4: - // check that the offset fits within a signed long - if (isInt<32>(Target.getConstant())) - Type = ELF::R_X86_64_32S; - else - Type = ELF::R_X86_64_32; - break; - case FK_Data_2: Type = ELF::R_X86_64_16; break; - case X86::reloc_pcrel_1byte: - case FK_Data_1: - Type = ELF::R_X86_64_8; - break; + if (IsPCRel) { + Type = ELF::R_386_PC32; + } else { + switch ((unsigned)Fixup.getKind()) { + default: llvm_unreachable("invalid fixup kind!"); + case X86::reloc_pcrel_4byte: + case FK_Data_4: Type = ELF::R_386_32; break; + case FK_Data_2: Type = ELF::R_386_16; break; + case X86::reloc_pcrel_1byte: + case FK_Data_1: Type = ELF::R_386_8; break; + } } } FixedValue = Value; - ERE64.setSymbolAndType(Index, Type); + ELFRelocationEntry ERE; + + if (Is64Bit) { + struct ELF::Elf64_Rela ERE64; + ERE64.setSymbolAndType(Index, Type); + ERE.r_info = ERE64.r_info; + } else { + struct ELF::Elf32_Rela ERE32; + ERE32.setSymbolAndType(Index, Type); + ERE.r_info = ERE32.r_info; + } ERE.r_offset = FixupOffset; - ERE.r_info = ERE64.r_info; + if (HasRelocationAddend) ERE.r_addend = Addend; else From grosbach at apple.com Tue Aug 17 13:39:16 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 18:39:16 -0000 Subject: [llvm-commits] [llvm] r111266 - in /llvm/trunk/lib/Target/ARM: ARM.td ARMInstrInfo.td ARMInstrThumb2.td Message-ID: <20100817183916.E3FB32A6C12C@llvm.org> Author: grosbach Date: Tue Aug 17 13:39:16 2010 New Revision: 111266 URL: http://llvm.org/viewvc/llvm-project?rev=111266&view=rev Log: 80 column cleanup. Modified: llvm/trunk/lib/Target/ARM/ARM.td llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Modified: llvm/trunk/lib/Target/ARM/ARM.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td?rev=111266&r1=111265&r2=111266&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARM.td (original) +++ llvm/trunk/lib/Target/ARM/ARM.td Tue Aug 17 13:39:16 2010 @@ -53,9 +53,9 @@ "Disable VFP MAC instructions">; // Some processors benefit from using NEON instructions for scalar // single-precision FP operations. -def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP", - "true", - "Use NEON for single precision FP">; +def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP", + "true", + "Use NEON for single precision FP">; // Disable 32-bit to 16-bit narrowing for experimentation. def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true", Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=111266&r1=111265&r2=111266&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Aug 17 13:39:16 2010 @@ -2326,8 +2326,8 @@ let usesCustomInserter = 1, isBranch = 1, isTerminator = 1, Defs = [CPSR] in { def BCCi64 : PseudoInst<(outs), - (ins i32imm:$cc, GPR:$lhs1, GPR:$lhs2, GPR:$rhs1, GPR:$rhs2, brtarget:$dst), - IIC_Br, + (ins i32imm:$cc, GPR:$lhs1, GPR:$lhs2, GPR:$rhs1, GPR:$rhs2, brtarget:$dst), + IIC_Br, "${:comment} B\t$dst GPR:$lhs1, GPR:$lhs2, GPR:$rhs1, GPR:$rhs2, imm:$cc", [(ARMBcci64 imm:$cc, GPR:$lhs1, GPR:$lhs2, GPR:$rhs1, GPR:$rhs2, bb:$dst)]>; Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=111266&r1=111265&r2=111266&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Tue Aug 17 13:39:16 2010 @@ -1731,7 +1731,8 @@ // Extra precision multiplies with low / high results let neverHasSideEffects = 1 in { let isCommutable = 1 in { -def t2SMULL : T2I<(outs rGPR:$ldst, rGPR:$hdst), (ins rGPR:$a, rGPR:$b), IIC_iMUL64, +def t2SMULL : T2I<(outs rGPR:$ldst, rGPR:$hdst), + (ins rGPR:$a, rGPR:$b), IIC_iMUL64, "smull", "\t$ldst, $hdst, $a, $b", []> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0111; @@ -1739,7 +1740,8 @@ let Inst{7-4} = 0b0000; } -def t2UMULL : T2I<(outs rGPR:$ldst, rGPR:$hdst), (ins rGPR:$a, rGPR:$b), IIC_iMUL64, +def t2UMULL : T2I<(outs rGPR:$ldst, rGPR:$hdst), + (ins rGPR:$a, rGPR:$b), IIC_iMUL64, "umull", "\t$ldst, $hdst, $a, $b", []> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0111; @@ -1749,7 +1751,8 @@ } // isCommutable // Multiply + accumulate -def t2SMLAL : T2I<(outs rGPR:$ldst, rGPR:$hdst), (ins rGPR:$a, rGPR:$b), IIC_iMAC64, +def t2SMLAL : T2I<(outs rGPR:$ldst, rGPR:$hdst), + (ins rGPR:$a, rGPR:$b), IIC_iMAC64, "smlal", "\t$ldst, $hdst, $a, $b", []>{ let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0111; @@ -1757,7 +1760,8 @@ let Inst{7-4} = 0b0000; } -def t2UMLAL : T2I<(outs rGPR:$ldst, rGPR:$hdst), (ins rGPR:$a, rGPR:$b), IIC_iMAC64, +def t2UMLAL : T2I<(outs rGPR:$ldst, rGPR:$hdst), + (ins rGPR:$a, rGPR:$b), IIC_iMAC64, "umlal", "\t$ldst, $hdst, $a, $b", []>{ let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0111; @@ -1765,7 +1769,8 @@ let Inst{7-4} = 0b0000; } -def t2UMAAL : T2I<(outs rGPR:$ldst, rGPR:$hdst), (ins rGPR:$a, rGPR:$b), IIC_iMAC64, +def t2UMAAL : T2I<(outs rGPR:$ldst, rGPR:$hdst), + (ins rGPR:$a, rGPR:$b), IIC_iMAC64, "umaal", "\t$ldst, $hdst, $a, $b", []>{ let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0111; @@ -1806,7 +1811,7 @@ let Inst{7-4} = 0b0000; // No Rounding (Inst{4} = 0) } -def t2SMMLAR : T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$c), IIC_iMAC32, +def t2SMMLAR: T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$c), IIC_iMAC32, "smmlar", "\t$dst, $a, $b, $c", []> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; @@ -1815,7 +1820,7 @@ let Inst{7-4} = 0b0001; // Rounding (Inst{4} = 1) } -def t2SMMLS : T2I <(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$c), IIC_iMAC32, +def t2SMMLS: T2I <(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$c), IIC_iMAC32, "smmls", "\t$dst, $a, $b, $c", [(set rGPR:$dst, (sub rGPR:$c, (mulhs rGPR:$a, rGPR:$b)))]> { let Inst{31-27} = 0b11111; @@ -1825,7 +1830,7 @@ let Inst{7-4} = 0b0000; // No Rounding (Inst{4} = 0) } -def t2SMMLSR : T2I <(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$c), IIC_iMAC32, +def t2SMMLSR:T2I <(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$c), IIC_iMAC32, "smmlsr", "\t$dst, $a, $b, $c", []> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; @@ -1926,7 +1931,7 @@ def BT : T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$acc), IIC_iMAC16, !strconcat(opc, "bt"), "\t$dst, $a, $b, $acc", [(set rGPR:$dst, (add rGPR:$acc, (opnode (sext_inreg rGPR:$a, i16), - (sra rGPR:$b, (i32 16)))))]> { + (sra rGPR:$b, (i32 16)))))]> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; let Inst{22-20} = 0b001; @@ -1938,7 +1943,7 @@ def TB : T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$acc), IIC_iMAC16, !strconcat(opc, "tb"), "\t$dst, $a, $b, $acc", [(set rGPR:$dst, (add rGPR:$acc, (opnode (sra rGPR:$a, (i32 16)), - (sext_inreg rGPR:$b, i16))))]> { + (sext_inreg rGPR:$b, i16))))]> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; let Inst{22-20} = 0b001; @@ -1950,7 +1955,7 @@ def TT : T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$acc), IIC_iMAC16, !strconcat(opc, "tt"), "\t$dst, $a, $b, $acc", [(set rGPR:$dst, (add rGPR:$acc, (opnode (sra rGPR:$a, (i32 16)), - (sra rGPR:$b, (i32 16)))))]> { + (sra rGPR:$b, (i32 16)))))]> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; let Inst{22-20} = 0b001; @@ -1962,7 +1967,7 @@ def WB : T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$acc), IIC_iMAC16, !strconcat(opc, "wb"), "\t$dst, $a, $b, $acc", [(set rGPR:$dst, (add rGPR:$acc, (sra (opnode rGPR:$a, - (sext_inreg rGPR:$b, i16)), (i32 16))))]> { + (sext_inreg rGPR:$b, i16)), (i32 16))))]> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; let Inst{22-20} = 0b011; @@ -1974,7 +1979,7 @@ def WT : T2I<(outs rGPR:$dst), (ins rGPR:$a, rGPR:$b, rGPR:$acc), IIC_iMAC16, !strconcat(opc, "wt"), "\t$dst, $a, $b, $acc", [(set rGPR:$dst, (add rGPR:$acc, (sra (opnode rGPR:$a, - (sra rGPR:$b, (i32 16))), (i32 16))))]> { + (sra rGPR:$b, (i32 16))), (i32 16))))]> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0110; let Inst{22-20} = 0b011; @@ -1989,35 +1994,35 @@ // Halfword multiple accumulate long: SMLAL -- for disassembly only def t2SMLALBB : T2I_mac<1, 0b100, 0b1000, (outs rGPR:$ldst,rGPR:$hdst), - (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlalbb", "\t$ldst, $hdst, $a, $b", + (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlalbb", "\t$ldst, $hdst, $a, $b", [/* For disassembly only; pattern left blank */]>; def t2SMLALBT : T2I_mac<1, 0b100, 0b1001, (outs rGPR:$ldst,rGPR:$hdst), - (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlalbt", "\t$ldst, $hdst, $a, $b", + (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlalbt", "\t$ldst, $hdst, $a, $b", [/* For disassembly only; pattern left blank */]>; def t2SMLALTB : T2I_mac<1, 0b100, 0b1010, (outs rGPR:$ldst,rGPR:$hdst), - (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlaltb", "\t$ldst, $hdst, $a, $b", + (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlaltb", "\t$ldst, $hdst, $a, $b", [/* For disassembly only; pattern left blank */]>; def t2SMLALTT : T2I_mac<1, 0b100, 0b1011, (outs rGPR:$ldst,rGPR:$hdst), - (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlaltt", "\t$ldst, $hdst, $a, $b", + (ins rGPR:$a,rGPR:$b), IIC_iMAC64, "smlaltt", "\t$ldst, $hdst, $a, $b", [/* For disassembly only; pattern left blank */]>; // Dual halfword multiple: SMUAD, SMUSD, SMLAD, SMLSD, SMLALD, SMLSLD // These are for disassembly only. -def t2SMUAD : T2I_mac<0, 0b010, 0b0000, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), - IIC_iMAC32, "smuad", "\t$dst, $a, $b", []> { +def t2SMUAD: T2I_mac<0, 0b010, 0b0000, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), + IIC_iMAC32, "smuad", "\t$dst, $a, $b", []> { let Inst{15-12} = 0b1111; } -def t2SMUADX : T2I_mac<0, 0b010, 0b0001, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), - IIC_iMAC32, "smuadx", "\t$dst, $a, $b", []> { +def t2SMUADX:T2I_mac<0, 0b010, 0b0001, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), + IIC_iMAC32, "smuadx", "\t$dst, $a, $b", []> { let Inst{15-12} = 0b1111; } -def t2SMUSD : T2I_mac<0, 0b100, 0b0000, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), - IIC_iMAC32, "smusd", "\t$dst, $a, $b", []> { +def t2SMUSD: T2I_mac<0, 0b100, 0b0000, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), + IIC_iMAC32, "smusd", "\t$dst, $a, $b", []> { let Inst{15-12} = 0b1111; } -def t2SMUSDX : T2I_mac<0, 0b100, 0b0001, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), - IIC_iMAC32, "smusdx", "\t$dst, $a, $b", []> { +def t2SMUSDX:T2I_mac<0, 0b100, 0b0001, (outs rGPR:$dst), (ins rGPR:$a, rGPR:$b), + IIC_iMAC32, "smusdx", "\t$dst, $a, $b", []> { let Inst{15-12} = 0b1111; } def t2SMLAD : T2I_mac<0, 0b010, 0b0000, (outs rGPR:$dst), @@ -2068,7 +2073,7 @@ [(set rGPR:$dst, (ARMrbit rGPR:$src))]>; def t2REV : T2I_misc<0b01, 0b00, (outs rGPR:$dst), (ins rGPR:$src), IIC_iUNAr, - "rev", ".w\t$dst, $src", [(set rGPR:$dst, (bswap rGPR:$src))]>; + "rev", ".w\t$dst, $src", [(set rGPR:$dst, (bswap rGPR:$src))]>; def t2REV16 : T2I_misc<0b01, 0b01, (outs rGPR:$dst), (ins rGPR:$src), IIC_iUNAr, "rev16", ".w\t$dst, $src", @@ -2076,7 +2081,7 @@ (or (and (srl rGPR:$src, (i32 8)), 0xFF), (or (and (shl rGPR:$src, (i32 8)), 0xFF00), (or (and (srl rGPR:$src, (i32 8)), 0xFF0000), - (and (shl rGPR:$src, (i32 8)), 0xFF000000)))))]>; + (and (shl rGPR:$src, (i32 8)), 0xFF000000)))))]>; def t2REVSH : T2I_misc<0b01, 0b11, (outs rGPR:$dst), (ins rGPR:$src), IIC_iUNAr, "revsh", ".w\t$dst, $src", From grosbach at apple.com Tue Aug 17 13:18:37 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 11:18:37 -0700 Subject: [llvm-commits] [llvm] r111260 - /llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp In-Reply-To: <60059098-10E7-48AA-85FF-57C8C58AA82E@apple.com> References: <20100817180041.32D6E2A6C12C@llvm.org> <60059098-10E7-48AA-85FF-57C8C58AA82E@apple.com> Message-ID: <949D2277-166A-4E57-9282-6E353C6CF12C@apple.com> Me either, 'til now. I was looking to make sure other new code I'm working on didn't have warnings and happened to notice this one. :) On Aug 17, 2010, at 11:16 AM, Bob Wilson wrote: > Thanks, Jim! I hadn't noticed the warning. > > On Aug 17, 2010, at 11:00 AM, Jim Grosbach wrote: > >> Author: grosbach >> Date: Tue Aug 17 13:00:41 2010 >> New Revision: 111260 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111260&view=rev >> Log: >> explicitly handle no-op cases for clarity. Fixes clang warning. >> >> Modified: >> llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp >> >> Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=111260&r1=111259&r2=111260&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Tue Aug 17 13:00:41 2010 >> @@ -459,6 +459,9 @@ >> if (ShImm != 0) >> return; >> switch (ShOp) { >> + case ARM_AM::no_shift: >> + case ARM_AM::rrx: >> + break; >> case ARM_AM::lsl: >> ShOp = ARM_AM::no_shift; >> break; >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From stoklund at 2pi.dk Tue Aug 17 13:42:16 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 11:42:16 -0700 Subject: [llvm-commits] [llvm] r111224 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp In-Reply-To: References: <20100817013449.58F042A6C12C@llvm.org> <63798F59-C42E-4B49-BC69-F39711EB3280@apple.com> Message-ID: <002193D5-CFC0-4A2D-90B6-7E1C974A4883@2pi.dk> On Aug 17, 2010, at 10:30 AM, Evan Cheng wrote: > > On Aug 17, 2010, at 9:00 AM, Dan Gohman wrote: > >> >> On Aug 16, 2010, at 6:34 PM, Evan Cheng wrote: >> >>> Author: evancheng >>> Date: Mon Aug 16 20:34:49 2010 >>> New Revision: 111224 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=111224&view=rev >>> Log: >>> Add an option to disable codegen prepare critical edge splitting. In theory, PHI elimination is already doing all (most?) of the splitting needed. But machine-licm and machine-sink seem to miss some important optimizations when splitting is disabled. >> >> MachineLICM, at least, has code to split critical edges on demand. Is >> it missing cases? >> >> Also, CGP's SplitEdgeNicely has some logic for "nicely" reusing existing >> blocks to avoid creating new blocks, which PHI elimination's splitting >> doesn't have. > > Codegen doesn't normalize loops. Without CGP's splitting lots of loops end up missing preheaders. The right fix is for machine licm to insert preheaders on demand. I'm looking into it. FWIW, live range splitting does not need preheaders, but it doesn't like critical edges exiting a loop. It is not implemented yet, but eventually I will split the loop exit edges on demand. /jakob From asl at math.spbu.ru Tue Aug 17 14:03:04 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Aug 2010 19:03:04 -0000 Subject: [llvm-commits] [llvm] r111268 - in /llvm/trunk: Makefile.rules tools/llvm-shlib/Makefile Message-ID: <20100817190304.179C02A6C12C@llvm.org> Author: asl Date: Tue Aug 17 14:03:03 2010 New Revision: 111268 URL: http://llvm.org/viewvc/llvm-project?rev=111268&view=rev Log: This patch enables ENABLE_SHARED=1 to build DLL based LLVM toolchain on MingW & Cygwin. Patch by Takumi Nakamura! Modified: llvm/trunk/Makefile.rules llvm/trunk/tools/llvm-shlib/Makefile Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=111268&r1=111267&r2=111268&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Aug 17 14:03:03 2010 @@ -411,6 +411,26 @@ LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples #-------------------------------------------------------------------- +# Locations of shared libraries +#-------------------------------------------------------------------- + +SharedPrefix := lib +SharedLibDir := $(LibDir) +LLVMSharedLibDir := $(LLVMLibDir) + +# Win32.DLL prefers to be located on the "PATH" of binaries. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + SharedLibDir := $(ToolDir) + LLVMSharedLibDir := $(LLVMToolDir) + + ifeq ($(HOST_OS),Cygwin) + SharedPrefix := cyg + else + SharedPrefix := + endif +endif + +#-------------------------------------------------------------------- # LLVM Capable Compiler #-------------------------------------------------------------------- @@ -483,12 +503,7 @@ SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION) endif else - ifeq ($(HOST_OS),Cygwin) - SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \ - -Wl,--enable-auto-import -Wl,--enable-auto-image-base - else - SharedLinkOptions=-shared - endif + SharedLinkOptions=-shared endif ifeq ($(TARGET_OS),Darwin) @@ -498,11 +513,13 @@ endif ifdef SHARED_LIBRARY +ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) ifneq ($(HOST_OS),Darwin) LD.Flags += $(RPATH) -Wl,'$$ORIGIN' else ifneq ($(DARWIN_MAJVERS),4) - LD.Flags += $(RPATH) -Wl,$(LibDir) + LD.Flags += $(RPATH) -Wl,$(SharedLibDir) +endif endif endif endif @@ -873,6 +890,13 @@ LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs)) endif +# Win32.DLL may refer to other components. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + ifdef LOADABLE_MODULE + LINK_COMPONENTS := all + endif +endif + ifndef IS_CLEANING_TARGET ifdef LINK_COMPONENTS @@ -885,8 +909,13 @@ $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG) ifeq ($(ENABLE_SHARED), 1) +# We can take the "auto-import" feature to get rid of using dllimport. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \ + -L $(SharedLibDir) +endif LLVMLibsOptions += -lLLVM-$(LLVMVersion) -LLVMLibsPaths += $(LibDir)/libLLVM-$(LLVMVersion)$(SHLIBEXT) +LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT) else LLVMLibsOptions += $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS)) LLVMLibsPaths += $(LLVM_CONFIG) \ @@ -931,6 +960,21 @@ LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile) endif +# GNU ld Win32 accepts .DEF files that contain "DATA" entries. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def)) + +# LLVMLibsOptions is invalidated at processing tools/llvm-shlib. +SharedLinkOptions += $(NativeExportsFile) + +$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir + $(Echo) Generating $(notdir $@) + $(Verb) $(ECHO) "EXPORTS" > $@ + $(Verb) $(CAT) $< >> $@ +clean-local:: + -$(Verb) $(RM) -f $(NativeExportsFile) +else + # gold, bfd ld, etc. ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile) @@ -938,6 +982,8 @@ endif +endif + ############################################################################### # Library Build Rules: Four ways to build a library ############################################################################### @@ -1010,10 +1056,10 @@ LIBRARYNAME := $(strip $(LIBRARYNAME)) ifdef LOADABLE_MODULE LibName.A := $(LibDir)/$(LIBRARYNAME).a -LibName.SO := $(LibDir)/$(LIBRARYNAME)$(SHLIBEXT) +LibName.SO := $(SharedLibDir)/$(LIBRARYNAME)$(SHLIBEXT) else LibName.A := $(LibDir)/lib$(LIBRARYNAME).a -LibName.SO := $(LibDir)/lib$(LIBRARYNAME)$(SHLIBEXT) +LibName.SO := $(SharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT) endif LibName.O := $(LibDir)/$(LIBRARYNAME).o LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca @@ -1038,13 +1084,13 @@ else SharedLibKindMessage := "Shared Library" endif -$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir +$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \ $(notdir $@) $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \ $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS) else -$(LibName.SO): $(ObjectsO) $(LibDir)/.dir +$(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir $(Echo) Linking $(BuildMode) Shared Library $(notdir $@) $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) endif @@ -1061,21 +1107,23 @@ $(Echo) Uninstall circumvented with NO_INSTALL else -ifdef LOADABLE_MODULE -DestSharedLib = $(DESTDIR)$(PROJ_libdir)/$(LIBRARYNAME)$(SHLIBEXT) +# Win32.DLL prefers to be located on the "PATH" of binaries. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +DestSharedLibDir := $(DESTDIR)$(PROJ_bindir) else -DestSharedLib = $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT) +DestSharedLibDir := $(DESTDIR)$(PROJ_libdir) endif +DestSharedLib := $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT) install-local:: $(DestSharedLib) -$(DestSharedLib): $(LibName.SO) $(DESTDIR)$(PROJ_libdir) +$(DestSharedLib): $(LibName.SO) $(DestSharedLibDir) $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib) $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib) uninstall-local:: $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib) - -$(Verb) $(RM) -f $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).* + -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).* endif endif Modified: llvm/trunk/tools/llvm-shlib/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-shlib/Makefile?rev=111268&r1=111267&r2=111268&view=diff ============================================================================== --- llvm/trunk/tools/llvm-shlib/Makefile (original) +++ llvm/trunk/tools/llvm-shlib/Makefile Tue Aug 17 14:03:03 2010 @@ -15,6 +15,17 @@ LINK_LIBS_IN_SHARED = 1 SHARED_LIBRARY = 1 +include $(LEVEL)/Makefile.config + +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + EXPORTED_SYMBOL_FILE = $(ObjDir)/$(LIBRARYNAME).exports + + # It is needed to force static-stdc++.a linked. + # FIXME: It should be omitted when configure detects system's stdc++.dll. + SHLIB_FRAG_NAMES += stdc++.a.o + +endif + include $(LEVEL)/Makefile.common # Include all archives in libLLVM.(so|dylib) except the ones that have @@ -57,3 +68,44 @@ # Don't allow unresolved symbols. LLVMLibsOptions += -Wl,--no-undefined endif + +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + +SHLIB_STUBS := $(addprefix $(ObjDir)/, $(SHLIB_FRAG_NAMES)) +SHLIB_FRAGS := $(patsubst %.a.o, $(ObjDir)/%.syms.txt, $(LIBRARYNAME).a.o $(SHLIB_FRAG_NAMES)) +LLVMLibsOptions := $(SHLIB_STUBS) $(LLVMLibsOptions) + +$(LibName.SO): $(SHLIB_STUBS) + +%.syms.txt: %.a.o + $(Echo) Collecting global symbols of $(notdir $*) + $(Verb) $(NM_PATH) -g $< > $@ + +$(ObjDir)/$(LIBRARYNAME).exports: $(SHLIB_FRAGS) $(ObjDir)/.dir + $(Echo) Generating exports for $(LIBRARYNAME) + $(Verb) ($(SED) -n \ + -e "s/^.* T _\([^.][^.]*\)$$/\1/p" \ + -e "s/^.* [BDR] _\([^.][^.]*\)$$/\1 DATA/p" \ + $(SHLIB_FRAGS) \ + | sort -u) > $@ + +$(ObjDir)/$(LIBRARYNAME).a.o: $(LLVMLibsPaths) $(ObjDir)/.dir + $(Echo) Linking all LLVMLibs together for $(LIBRARYNAME) + $(Verb) $(Link) -nostartfiles -Wl,-r -nodefaultlibs -o $@ \ + -Wl,--whole-archive $(LLVMLibsPaths) \ + -Wl,--no-whole-archive + +$(ObjDir)/stdc++.a.o: $(ObjDir)/.dir + $(Echo) Linking all libs together for static libstdc++.a + $(Verb) $(Link) -nostartfiles -Wl,-r -nodefaultlibs -o $@ \ + -Wl,--whole-archive -lstdc++ \ + -Wl,--no-whole-archive +# FIXME: workaround to invalidate -lstdc++ + $(Echo) Making dummy -lstdc++ to lib + $(Verb) $(AR) rc $(ToolDir)/libstdc++.dll.a +# FIXME: Is install-local needed? + +clean-local:: + $(Verb) $(RM) -f $(ToolDir)/libstdc++.dll.a + +endif From asl at math.spbu.ru Tue Aug 17 14:09:24 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Aug 2010 23:09:24 +0400 Subject: [llvm-commits] [llvm] r111262 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h In-Reply-To: <20100817181354.288932A6C12C@llvm.org> References: <20100817181354.288932A6C12C@llvm.org> Message-ID: Hi Jim On Tue, Aug 17, 2010 at 22:13, Jim Grosbach wrote: > Author: grosbach > Date: Tue Aug 17 13:13:53 2010 > New Revision: 111262 > > URL: http://llvm.org/viewvc/llvm-project?rev=111262&view=rev > Log: > Add hook to examine an instruction referencing a frame index to determine > whether to allocate a virtual frame base register to resolve the frame > index reference in it. Implement a simple version for ARM to aid debugging. This causes warning on buildbot: /Users/buildslave-osuosl/llvm/llvm-gcc-x86_64-darwin10-selfhost/llvm.src/lib/CodeGen/LocalStackSlotAllocation.cpp:40: warning: 'NumBaseRegisters' defined but not used -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From scanon at apple.com Tue Aug 17 14:13:45 2010 From: scanon at apple.com (Stephen Canon) Date: Tue, 17 Aug 2010 19:13:45 -0000 Subject: [llvm-commits] [compiler-rt] r111269 - in /compiler-rt/trunk/lib: floatsidf.c floatunsidf.c Message-ID: <20100817191345.7E0EC2A6C12C@llvm.org> Author: scanon Date: Tue Aug 17 14:13:45 2010 New Revision: 111269 URL: http://llvm.org/viewvc/llvm-project?rev=111269&view=rev Log: Adds an extra explicit cast to fix Bug 7931 and removes codepaths that were never used Modified: compiler-rt/trunk/lib/floatsidf.c compiler-rt/trunk/lib/floatunsidf.c Modified: compiler-rt/trunk/lib/floatsidf.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatsidf.c?rev=111269&r1=111268&r2=111269&view=diff ============================================================================== --- compiler-rt/trunk/lib/floatsidf.c (original) +++ compiler-rt/trunk/lib/floatsidf.c Tue Aug 17 14:13:45 2010 @@ -35,17 +35,11 @@ const int exponent = (aWidth - 1) - __builtin_clz(a); rep_t result; - // Shift a into the significand field, rounding if it is a right-shift - if (exponent <= significandBits) { - const int shift = significandBits - exponent; - result = (rep_t)a << shift ^ implicitBit; - } else { - const int shift = exponent - significandBits; - result = (rep_t)a >> shift ^ implicitBit; - rep_t round = (rep_t)a << (typeWidth - shift); - if (round > signBit) result++; - if (round == signBit) result += result & 1; - } + // Shift a into the significand field and clear the implicit bit. Extra + // cast to unsigned int is necessary to get the correct behavior for + // the input INT_MIN. + const int shift = significandBits - exponent; + result = (rep_t)(unsigned int)a << shift ^ implicitBit; // Insert the exponent result += (rep_t)(exponent + exponentBias) << significandBits; Modified: compiler-rt/trunk/lib/floatunsidf.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatunsidf.c?rev=111269&r1=111268&r2=111269&view=diff ============================================================================== --- compiler-rt/trunk/lib/floatunsidf.c (original) +++ compiler-rt/trunk/lib/floatunsidf.c Tue Aug 17 14:13:45 2010 @@ -27,17 +27,9 @@ const int exponent = (aWidth - 1) - __builtin_clz(a); rep_t result; - // Shift a into the significand field, rounding if it is a right-shift - if (exponent <= significandBits) { - const int shift = significandBits - exponent; - result = (rep_t)a << shift ^ implicitBit; - } else { - const int shift = exponent - significandBits; - result = (rep_t)a >> shift ^ implicitBit; - rep_t round = (rep_t)a << (typeWidth - shift); - if (round > signBit) result++; - if (round == signBit) result += result & 1; - } + // Shift a into the significand field and clear the implicit bit. + const int shift = significandBits - exponent; + result = (rep_t)a << shift ^ implicitBit; // Insert the exponent result += (rep_t)(exponent + exponentBias) << significandBits; From asl at math.spbu.ru Tue Aug 17 14:34:40 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Aug 2010 19:34:40 -0000 Subject: [llvm-commits] [llvm] r111270 - /llvm/trunk/unittests/Makefile.unittest Message-ID: <20100817193440.BDEC72A6C12C@llvm.org> Author: asl Date: Tue Aug 17 14:34:40 2010 New Revision: 111270 URL: http://llvm.org/viewvc/llvm-project?rev=111270&view=rev Log: This patch enables "make unittests" on enable-shared/mingw. Patch by Takumi Nakamura! Modified: llvm/trunk/unittests/Makefile.unittest Modified: llvm/trunk/unittests/Makefile.unittest URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Makefile.unittest?rev=111270&r1=111269&r2=111270&view=diff ============================================================================== --- llvm/trunk/unittests/Makefile.unittest (original) +++ llvm/trunk/unittests/Makefile.unittest Tue Aug 17 14:34:40 2010 @@ -37,10 +37,10 @@ ifeq ($(ENABLE_SHARED), 1) # Add the absolute path to the dynamic library. This is ok because # we'll never install unittests. - LD.Flags += $(RPATH) -Wl,$(LibDir) + LD.Flags += $(RPATH) -Wl,$(SharedLibDir) # Also set {DYLD,LD}_LIBRARY_PATH because OSX ignores the rpath most # of the time. - Run.Shared := $(SHLIBPATH_VAR)="$(LibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)" + Run.Shared := $(SHLIBPATH_VAR)="$(SharedLibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)" endif $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) From anton at korobeynikov.info Tue Aug 17 14:35:20 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 17 Aug 2010 23:35:20 +0400 Subject: [llvm-commits] [LLVMdev] [PATCH] Capability of Win32.DLL with ENABLE_SHARED In-Reply-To: References: Message-ID: > This additional patch enables "make unittests" on enable-shared/mingw. > (still unittests would fail in some points. see also my other patches) > It is intended to apply with previous r110016-shlib-dll-2.diff.txt. Applied, thanks! -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From benny.kra at googlemail.com Tue Aug 17 14:45:05 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 17 Aug 2010 19:45:05 -0000 Subject: [llvm-commits] [llvm] r111271 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100817194505.716C62A6C12C@llvm.org> Author: d0k Date: Tue Aug 17 14:45:05 2010 New Revision: 111271 URL: http://llvm.org/viewvc/llvm-project?rev=111271&view=rev Log: Remove dead code. Fixes a GCC warning. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111271&r1=111270&r2=111271&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Aug 17 14:45:05 2010 @@ -505,10 +505,7 @@ Value = Target.getConstant(); - if (Target.isAbsolute()) { - Type = Is64Bit ? ELF::R_X86_64_NONE : ELF::R_386_NONE; - Index = 0; - } else { + if (!Target.isAbsolute()) { const MCSymbol *Symbol = &Target.getSymA()->getSymbol(); MCSymbolData &SD = Asm.getSymbolData(*Symbol); const MCSymbolData *Base = Asm.getAtom(Layout, &SD); From evan.cheng at apple.com Tue Aug 17 14:50:50 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 12:50:50 -0700 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll In-Reply-To: References: <20100817012037.343492A6C12C@llvm.org> <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> <912ECF79-D69C-4AD7-A69A-D2282AA2C6D7@apple.com> Message-ID: On Aug 17, 2010, at 11:09 AM, Jakob Stoklund Olesen wrote: > > On Aug 17, 2010, at 10:49 AM, Evan Cheng wrote: > >> >> On Aug 17, 2010, at 12:11 AM, Jakob Stoklund Olesen wrote: > >>> Careful you don't dereference a NULL pointer. You can't count on MLI being available here. >> >> Right. >> >>> >>> Also, I think the decision to not split a back edge should go in PHIElimination as a policy decision. Other callers of SplitCriticalEdge may have really good reasons for splitting a back edge. That should be allowed. >> >> I have mixed feeling about this. In theory code placement optimization passes should be able to fix this. That's why the check in codegenprep's critical edge splitting is called a hack. I thought it a good idea to put the hack in one place only. Anyway, I'm moving the check to phi elimination (and fixed it) and I'll keep an eye on other clients. > > Thanks. > > I like the idea that SplitCriticalEdge only returns false when it would be impossible to split the edge. We could add a ShouldSplitCriticalEdge to indicate that it would be a really bad idea. > > If the new block is placed after its predecessor, you get a loop with a conditional branch in the middle and an unconditional branch at the bottom. That's not so bad, is it? That adds a second branch inside a loop. That can be plenty bad for small tight loops. > > > @@ -392,8 +393,14 @@ > // We break edges when registers are live out from the predecessor block > // (not considering PHI nodes). If the register is live in to this block > // anyway, we would gain nothing from splitting. > - if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) > - Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; > + // Avoid splitting backedges of loops. It would introduce small > + // out-of-line blocks into the loop which is very bad for code placement. > + if (PreMBB != &MBB && > + !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) { > + if (!(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && > + MLI->isLoopHeader(&MBB))) > + Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; > + } > } > } > return true; > > You're doing it again ;-) You shouldn't expect MLI to be non-NULL here. This is in PHI elimination which is explicitly asking for machineloopinfo. Can it ever be null? Evan > > /jakob > From stoklund at 2pi.dk Tue Aug 17 15:08:59 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 13:08:59 -0700 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll In-Reply-To: References: <20100817012037.343492A6C12C@llvm.org> <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> <912ECF79-D69C-4AD7-A69A-D2282AA2C6D7@apple.com> Message-ID: <345997D3-7F1B-4677-A51F-3C5CC6E5A94D@2pi.dk> On Aug 17, 2010, at 12:50 PM, Evan Cheng wrote: >> @@ -392,8 +393,14 @@ >> // We break edges when registers are live out from the predecessor block >> // (not considering PHI nodes). If the register is live in to this block >> // anyway, we would gain nothing from splitting. >> - if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) >> - Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; >> + // Avoid splitting backedges of loops. It would introduce small >> + // out-of-line blocks into the loop which is very bad for code placement. >> + if (PreMBB != &MBB && >> + !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) { >> + if (!(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && >> + MLI->isLoopHeader(&MBB))) >> + Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; >> + } >> } >> } >> return true; >> >> You're doing it again ;-) You shouldn't expect MLI to be non-NULL here. > > This is in PHI elimination which is explicitly asking for machineloopinfo. Can it ever be null? So it does. I was fooled by this line: MLI = getAnalysisIfAvailable(); But you probably don't want to require MachineLoopInfo for PHIElimination. I don't think we want to calculate that in a -O0 build. /jakob From criswell at uiuc.edu Tue Aug 17 15:17:21 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 17 Aug 2010 20:17:21 -0000 Subject: [llvm-commits] [poolalloc] r111272 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Message-ID: <20100817201721.35C802A6C12C@llvm.org> Author: criswell Date: Tue Aug 17 15:17:21 2010 New Revision: 111272 URL: http://llvm.org/viewvc/llvm-project?rev=111272&view=rev Log: Added comments. No functionality changes. Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=111272&r1=111271&r2=111272&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Tue Aug 17 15:17:21 2010 @@ -690,12 +690,23 @@ if (CS.isIndirectCall()) { eraseCS = false; if (CS.getCalleeNode()->isCompleteNode()) { + // + // Get the list of callees associated with the DSNode and remove those + // that are external functions (i.e., have no function body). + // std::vector NodeCallees; CS.getCalleeNode()->addFullFunctionList(NodeCallees); std::vector::iterator ErasePoint = std::remove_if(NodeCallees.begin(), NodeCallees.end(), std::mem_fun(&Function::isDeclaration)); NodeCallees.erase(ErasePoint, NodeCallees.end()); + + // + // Only erase this call site if there's nothing left to do for it. + // This means that all of the function targets recorded in the DSNode + // have already been incorporated into the call graph that we've been + // constructing. + // std::sort(CalledFuncs.begin(), CalledFuncs.end()); std::sort(NodeCallees.begin(), NodeCallees.end()); eraseCS = std::includes(CalledFuncs.begin(), CalledFuncs.end(), From evan.cheng at apple.com Tue Aug 17 15:18:54 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 13:18:54 -0700 Subject: [llvm-commits] [llvm] r111221 - in /llvm/trunk: lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/PHIElimination.cpp test/CodeGen/ARM/code-placement.ll test/CodeGen/X86/lsr-reuse.ll In-Reply-To: <345997D3-7F1B-4677-A51F-3C5CC6E5A94D@2pi.dk> References: <20100817012037.343492A6C12C@llvm.org> <586581D0-2D6F-434F-A745-D43115BBDF22@2pi.dk> <912ECF79-D69C-4AD7-A69A-D2282AA2C6D7@apple.com> <345997D3-7F1B-4677-A51F-3C5CC6E5A94D@2pi.dk> Message-ID: <74AAEDD9-C7A5-4DDE-85A8-43D27E5347CB@apple.com> On Aug 17, 2010, at 1:08 PM, Jakob Stoklund Olesen wrote: > > On Aug 17, 2010, at 12:50 PM, Evan Cheng wrote: >>> @@ -392,8 +393,14 @@ >>> // We break edges when registers are live out from the predecessor block >>> // (not considering PHI nodes). If the register is live in to this block >>> // anyway, we would gain nothing from splitting. >>> - if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) >>> - Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; >>> + // Avoid splitting backedges of loops. It would introduce small >>> + // out-of-line blocks into the loop which is very bad for code placement. >>> + if (PreMBB != &MBB && >>> + !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) { >>> + if (!(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && >>> + MLI->isLoopHeader(&MBB))) >>> + Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; >>> + } >>> } >>> } >>> return true; >>> >>> You're doing it again ;-) You shouldn't expect MLI to be non-NULL here. >> >> This is in PHI elimination which is explicitly asking for machineloopinfo. Can it ever be null? > > So it does. I was fooled by this line: > > MLI = getAnalysisIfAvailable(); > > But you probably don't want to require MachineLoopInfo for PHIElimination. I don't think we want to calculate that in a -O0 build. Ugh. That's right. I'll fix. Evan > > /jakob > From criswell at uiuc.edu Tue Aug 17 15:20:43 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 17 Aug 2010 20:20:43 -0000 Subject: [llvm-commits] [poolalloc] r111273 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100817202043.F06C52A6C12C@llvm.org> Author: criswell Date: Tue Aug 17 15:20:43 2010 New Revision: 111273 URL: http://llvm.org/viewvc/llvm-project?rev=111273&view=rev Log: Added code that filters out potential function targets if the byval'ness of the actual argument does not match the byval'ness of the formal argument. This code is off by default which is good because: 1) It causes infinite recursion when enabled (PR#7929); and 2) It is not clear whether filtering out indirect call sites will work correctly at all with the EQBU pass (which ensures that all targets of an indirect function call have the same DSGraph regardless of call site compatibility). Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=111273&r1=111272&r2=111273&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Tue Aug 17 15:20:43 2010 @@ -1376,7 +1376,16 @@ // call site. We allow the user to configure what we consider to be // uncallable at an indirect function call site. // -static bool functionIsCallable (CallSite CS, const Function* F) { +// Inputs: +// CS - The call site which calls the function. +// F - The function that is potentially called by CS. +// +// Return value: +// true - The function F can be called by the call site. +// false - The function F cannot be called by the call site. +// +static bool +functionIsCallable (CallSite CS, const Function* F) { //Which targets do we choose? //Conservative: all of them //Pretty Safe: same calling convention, otherwise undefined behavior @@ -1388,8 +1397,39 @@ const PointerType* PT = cast(CS.getCalledValue()->getType()); const FunctionType* FT = cast(PT->getElementType()); - if (!noDSACallConv && CS.getCallingConv() != F->getCallingConv()) return false; - if (!noDSACallVA && FT->isVarArg() != F->isVarArg()) return false; + // + // If the calling convention doesn't match, then the function cannot be + // called by this call site. + // + if (!noDSACallConv && CS.getCallingConv() != F->getCallingConv()) + return false; + + // + // We will consider the byval parameter attribute to be a part of the calling + // convention. If an actual argument is marked byval while the formal + // argument is not (or vice-versa), then the function is not a valid target. + // + if (!noDSACallConv) { + Function::const_arg_iterator farg = F->arg_begin(); + for (unsigned index = 1; index < (CS.arg_size() + 1); ++farg, ++index) { + if (CS.paramHasAttr (index, Attribute::ByVal) != farg->hasByValAttr()) { + return false; + } + } + } + + // + // If the caller and callee don't agree on whether the target is a vararg + // function, then the function is not a valid target. + // + if (!noDSACallVA && FT->isVarArg() != F->isVarArg()) + return false; + + // + // If calling this function from this call site would require an implicit + // integer to floating point cast (or vice-versa), then don't consider the + // function callable from this call site. + // if (!noDSACallFP) { FunctionType::param_iterator Pi = FT->param_begin(), Pe = FT->param_end(), Ai = F->getFunctionType()->param_begin(), @@ -1403,7 +1443,11 @@ ++Pi; } } - //F can be called from CS; + + // + // We've done all the checks we've cared to do. The function F can be called + // from this call site. + // return true; } From grosbach at apple.com Tue Aug 17 15:21:30 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 20:21:30 -0000 Subject: [llvm-commits] [llvm] r111274 - /llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Message-ID: <20100817202130.E65E22A6C12C@llvm.org> Author: grosbach Date: Tue Aug 17 15:21:30 2010 New Revision: 111274 URL: http://llvm.org/viewvc/llvm-project?rev=111274&view=rev Log: silence warning Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111274&r1=111273&r2=111274&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Tue Aug 17 15:21:30 2010 @@ -178,6 +178,11 @@ // what "reasonably" really means. Conservatively, can just // use the alignment of the local block. + // If we have a suitable base register available, use it; otherwise + // create a new one. + // FIXME: For the moment, just always create a new one. + + ++NumBaseRegisters; ++NumReplacements; } From grosbach at apple.com Tue Aug 17 15:22:25 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 13:22:25 -0700 Subject: [llvm-commits] [llvm] r111262 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h In-Reply-To: References: <20100817181354.288932A6C12C@llvm.org> Message-ID: <42900AA3-8713-4BCB-A271-98E2B99D6486@apple.com> Quite right. Fixed. -j On Aug 17, 2010, at 12:09 PM, Anton Korobeynikov wrote: > Hi Jim > > On Tue, Aug 17, 2010 at 22:13, Jim Grosbach wrote: >> Author: grosbach >> Date: Tue Aug 17 13:13:53 2010 >> New Revision: 111262 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111262&view=rev >> Log: >> Add hook to examine an instruction referencing a frame index to determine >> whether to allocate a virtual frame base register to resolve the frame >> index reference in it. Implement a simple version for ARM to aid debugging. > This causes warning on buildbot: > /Users/buildslave-osuosl/llvm/llvm-gcc-x86_64-darwin10-selfhost/llvm.src/lib/CodeGen/LocalStackSlotAllocation.cpp:40: > warning: 'NumBaseRegisters' defined but not used > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University From stoklund at 2pi.dk Tue Aug 17 15:39:04 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 20:39:04 -0000 Subject: [llvm-commits] [llvm] r111277 - in /llvm/trunk/lib/Target/ARM: ARMISelDAGToDAG.cpp ARMInstrInfo.td ARMInstrThumb2.td Message-ID: <20100817203905.0B2F02A6C12C@llvm.org> Author: stoklund Date: Tue Aug 17 15:39:04 2010 New Revision: 111277 URL: http://llvm.org/viewvc/llvm-project?rev=111277&view=rev Log: Don't call tablegen'ed Predicate_* functions in the ARM target. Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=111277&r1=111276&r2=111277&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Aug 17 15:39:04 2010 @@ -118,6 +118,16 @@ bool SelectT2AddrModeSoReg(SDNode *Op, SDValue N, SDValue &Base, SDValue &OffReg, SDValue &ShImm); + inline bool Pred_so_imm(SDNode *inN) const { + ConstantSDNode *N = cast(inN); + return ARM_AM::getSOImmVal(N->getZExtValue()) != -1; + } + + inline bool Pred_t2_so_imm(SDNode *inN) const { + ConstantSDNode *N = cast(inN); + return ARM_AM::getT2SOImmVal(N->getZExtValue()) != -1; + } + // Include the pieces autogenerated from the target description. #include "ARMGenDAGISel.inc" @@ -1686,7 +1696,7 @@ if (!T) return 0; - if (Predicate_t2_so_imm(TrueVal.getNode())) { + if (Pred_t2_so_imm(TrueVal.getNode())) { SDValue True = CurDAG->getTargetConstant(T->getZExtValue(), MVT::i32); SDValue CC = CurDAG->getTargetConstant(CCVal, MVT::i32); SDValue Ops[] = { FalseVal, True, CC, CCR, InFlag }; @@ -1703,7 +1713,7 @@ if (!T) return 0; - if (Predicate_so_imm(TrueVal.getNode())) { + if (Pred_so_imm(TrueVal.getNode())) { SDValue True = CurDAG->getTargetConstant(T->getZExtValue(), MVT::i32); SDValue CC = CurDAG->getTargetConstant(CCVal, MVT::i32); SDValue Ops[] = { FalseVal, True, CC, CCR, InFlag }; @@ -1751,7 +1761,7 @@ } // Pattern: (ARMcmov:i32 GPR:i32:$false, - // (imm:i32)<>:$true, + // (imm:i32)<>:$true, // (imm:i32):$cc) // Emits: (MOVCCi:i32 GPR:i32:$false, // (so_imm:i32 (imm:i32):$true), (imm:i32):$cc) Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=111277&r1=111276&r2=111277&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Aug 17 15:39:04 2010 @@ -316,10 +316,7 @@ // represented in the imm field in the same 12-bit form that they are encoded // into so_imm instructions: the 8-bit immediate is the least significant bits // [bits 0-7], the 4-bit shift amount is the next 4 bits [bits 8-11]. -def so_imm : Operand, - PatLeaf<(imm), [{ - return ARM_AM::getSOImmVal(N->getZExtValue()) != -1; - }]> { +def so_imm : Operand, PatLeaf<(imm), [{ return Pred_so_imm(N); }]> { let PrintMethod = "printSOImmOperand"; } Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=111277&r1=111276&r2=111277&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Tue Aug 17 15:39:04 2010 @@ -51,10 +51,7 @@ // represented in the imm field in the same 12-bit form that they are encoded // into t2_so_imm instructions: the 8-bit immediate is the least significant // bits [bits 0-7], the 4-bit shift/splat amount is the next 4 bits [bits 8-11]. -def t2_so_imm : Operand, - PatLeaf<(imm), [{ - return ARM_AM::getT2SOImmVal((uint32_t)N->getZExtValue()) != -1; -}]>; +def t2_so_imm : Operand, PatLeaf<(imm), [{ return Pred_t2_so_imm(N); }]>; // t2_so_imm_not - Match an immediate that is a complement // of a t2_so_imm. From criswell at uiuc.edu Tue Aug 17 15:47:10 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 17 Aug 2010 20:47:10 -0000 Subject: [llvm-commits] [poolalloc] r111280 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <20100817204710.A8C3E2A6C12C@llvm.org> Author: criswell Date: Tue Aug 17 15:47:10 2010 New Revision: 111280 URL: http://llvm.org/viewvc/llvm-project?rev=111280&view=rev Log: Assign pools to incoming pointer arguments even if they are byval arguments. This will help ensure that functions with different signatures get transformed identically when they are targets of the same indirect function call. Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=111280&r1=111279&r2=111280&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Tue Aug 17 15:47:10 2010 @@ -554,35 +554,24 @@ if (AI != G->getScalarMap().end()) { if (DSNode *N = AI->second.getNode()) { // - // If this is a byval argument, then simply add all DSNodes which are - // reachable from it, but don't add the byval argument's node. For - // all other parameters, add the DSNode for the parameter and all - // DSNodes reachable from it. + // Find all nodes reachable from this node. Include this node, even + // if it is a byval argument. + // + // Now, I hear what you're thinking: "Why pass pools for byval + // arguments?" Well, we want to pass pools for byval arguments + // because the function may be the target of an indirect function + // call, and the byval parameter could therefore alias with a + // non-byval argument from another function that is a target of the + // indirect function call. Passing pools for byval arguments helps + // ensure that all targets of an indirect function call get + // transformed identically. // - if (I->hasByValAttr()) { - DSNode::edge_iterator link = N->edge_begin(); - while (link != N->edge_end()) { - DSNodeHandle Child = link->second; - if (Child.getNode()) - Child.getNode()->markReachableNodes(MarkedNodes); - ++link; - } - } else { - // - // Add all nodes reachable from this parameter into our set of - // nodes needing pools. - // - N->markReachableNodes(MarkedNodes); - } // - // If this is a byval argument, then we don't want to add it to the - // list of nodes that need an outside pool. However, anything - // reachable from the byval argument should have its pool passed in. - // So, we'll just remove the DSNode of the argument if it is marked - // byval. + // Add all nodes reachable from this parameter into our set of + // nodes needing pools. // - if (I->hasByValAttr()) MarkedNodes.erase (N); + N->markReachableNodes(MarkedNodes); } } } From evan.cheng at apple.com Tue Aug 17 15:57:42 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 20:57:42 -0000 Subject: [llvm-commits] [llvm] r111281 - /llvm/trunk/lib/CodeGen/MachineCSE.cpp Message-ID: <20100817205742.CE4C62A6C12C@llvm.org> Author: evancheng Date: Tue Aug 17 15:57:42 2010 New Revision: 111281 URL: http://llvm.org/viewvc/llvm-project?rev=111281&view=rev Log: Machine CSE preserves CFG. Pass manager was freeing machineloopinfo after machine cse before. Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=111281&r1=111280&r2=111281&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Tue Aug 17 15:57:42 2010 @@ -49,6 +49,7 @@ AU.setPreservesCFG(); MachineFunctionPass::getAnalysisUsage(AU); AU.addRequired(); + AU.addPreservedID(MachineLoopInfoID); AU.addRequired(); AU.addPreserved(); } From evan.cheng at apple.com Tue Aug 17 16:00:37 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 21:00:37 -0000 Subject: [llvm-commits] [llvm] r111285 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp PHIElimination.cpp PHIElimination.h Message-ID: <20100817210037.CD97C2A6C12C@llvm.org> Author: evancheng Date: Tue Aug 17 16:00:37 2010 New Revision: 111285 URL: http://llvm.org/viewvc/llvm-project?rev=111285&view=rev Log: PHI elimination shouldn't require machineloopinfo since it's used at -O0. Move the requirement to LiveIntervalAnalysis instead. Note this does not change the number of times machineloopinfo is computed. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/PHIElimination.h Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=111285&r1=111284&r2=111285&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Aug 17 16:00:37 2010 @@ -62,9 +62,10 @@ AU.setPreservesCFG(); AU.addRequired(); AU.addPreserved(); - AU.addPreserved(); AU.addRequired(); - AU.addPreservedID(MachineLoopInfoID); + AU.addPreserved(); + AU.addRequired(); + AU.addPreserved(); AU.addPreservedID(MachineDominatorsID); if (!StrongPHIElim) { Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=111285&r1=111284&r2=111285&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Tue Aug 17 16:00:37 2010 @@ -45,22 +45,22 @@ void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); - AU.addRequired(); AU.addPreserved(); - AU.addPreservedID(MachineLoopInfoID); + AU.addPreserved(); MachineFunctionPass::getAnalysisUsage(AU); } bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &MF) { MRI = &MF.getRegInfo(); - MLI = getAnalysisIfAvailable(); bool Changed = false; // Split critical edges to help the coalescer - if (LiveVariables *LV = getAnalysisIfAvailable()) + if (LiveVariables *LV = getAnalysisIfAvailable()) { + MachineLoopInfo *MLI = getAnalysisIfAvailable(); for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) - Changed |= SplitPHIEdges(MF, *I, *LV); + Changed |= SplitPHIEdges(MF, *I, *LV, MLI); + } // Populate VRegPHIUseCount analyzePHINodes(MF); @@ -380,7 +380,8 @@ bool llvm::PHIElimination::SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB, - LiveVariables &LV) { + LiveVariables &LV, + MachineLoopInfo *MLI) { if (MBB.empty() || !MBB.front().isPHI() || MBB.isLandingPad()) return false; // Quick exit for basic blocks without PHIs. @@ -397,7 +398,8 @@ // out-of-line blocks into the loop which is very bad for code placement. if (PreMBB != &MBB && !LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) { - if (!(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && + if (!MLI || + !(MLI->getLoopFor(PreMBB) == MLI->getLoopFor(&MBB) && MLI->isLoopHeader(&MBB))) Changed |= PreMBB->SplitCriticalEdge(&MBB, this) != 0; } Modified: llvm/trunk/lib/CodeGen/PHIElimination.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.h?rev=111285&r1=111284&r2=111285&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.h (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.h Tue Aug 17 16:00:37 2010 @@ -24,7 +24,6 @@ /// Lower PHI instructions to copies. class PHIElimination : public MachineFunctionPass { MachineRegisterInfo *MRI; // Machine register information - MachineLoopInfo *MLI; public: static char ID; // Pass identification, replacement for typeid @@ -52,7 +51,7 @@ /// Split critical edges where necessary for good coalescer performance. bool SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB, - LiveVariables &LV); + LiveVariables &LV, MachineLoopInfo *MLI); /// SplitCriticalEdge - Split a critical edge from A to B by /// inserting a new MBB. Update branches in A and PHI instructions From wdietz2 at illinois.edu Tue Aug 17 16:05:53 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 17 Aug 2010 21:05:53 -0000 Subject: [llvm-commits] [poolalloc] r111286 - /poolalloc/trunk/lib/DSA/DSTest.cpp Message-ID: <20100817210553.19F1B2A6C12C@llvm.org> Author: wdietz2 Date: Tue Aug 17 16:05:52 2010 New Revision: 111286 URL: http://llvm.org/viewvc/llvm-project?rev=111286&view=rev Log: Added "check=not-same-node" option to DSTest. Modified: poolalloc/trunk/lib/DSA/DSTest.cpp Modified: poolalloc/trunk/lib/DSA/DSTest.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=111286&r1=111285&r2=111286&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSTest.cpp (original) +++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Aug 17 16:05:52 2010 @@ -14,6 +14,7 @@ // -print-only-values Only print the values pointed to by the given values // -print-only-types Only print the types for the given values // -check-same-node= Verify the given values' nodes were merged. +// -check-not-same-node= Verify the given values' nodes weren't merged. // -verify-flags= Verify the given values match the flag specifications. // // In general a 'value' query on the DSA results looks like this: @@ -52,6 +53,9 @@ // Test if all mentioned values are in the same node (merged) cl::list CheckNodesSame("check-same-node", cl::CommaSeparated, cl::ReallyHidden); + // Test if all mentioned values are in distinct nodes + cl::list CheckNodesNotSame("check-not-same-node", + cl::CommaSeparated, cl::ReallyHidden); // For each value, verify they have (or don't have) the specified flags cl::list VerifyFlags("verify-flags", cl::CommaSeparated, cl::ReallyHidden); @@ -398,6 +402,40 @@ return false; } +/// checkIfNodesAreNotSame -- Verify each node that the user indicated +/// shouldn't be merged, wasn't merged +/// Returns true iff the user specified any nodes for this option. +/// +static bool checkIfNodesAreNotSame(llvm::raw_ostream &O, const Module *M, const DataStructures *DS) { + + // Verify all nodes listed in "CheckNodesNotSame" belong to distinct nodes. + cl::list::iterator I = CheckNodesNotSame.begin(), + E = CheckNodesNotSame.end(); + + // If the user specified that a set of values should be in separate nodes... + if (I != E) { + // Lookup all the values + unsigned count = E - I; + NodeValue ** NV = new NodeValue*[count]; + for(unsigned i = 0; I != E; ++I, ++i) + NV[i] = new NodeValue(*I, M, DS); + + //Compare all pairs to make sure they're distinct + for(unsigned i = 0; i < count; ++i) + for(unsigned j = i+1; j < count; ++j) { + assert(NV[i]->getNodeH() != NV[j]->getNodeH() && "Nodes not distinct!"); + } + + for(unsigned i = 0; i < count; ++i) + delete NV[i]; + delete [] NV; + + return true; + } + + return false; +} + /// VerifyFlags -- Verify flag properties for the given nodes. /// This is a common enough testing process that this was added to make it simpler. /// Returns true iff the user specified anything for this option. @@ -470,6 +508,7 @@ tested |= printNodes(O,M,this); tested |= checkIfNodesAreSame(O,M,this); + tested |= checkIfNodesAreNotSame(O,M,this); tested |= verifyFlags(O,M,this); return tested; From asl at math.spbu.ru Tue Aug 17 16:05:54 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Aug 2010 21:05:54 -0000 Subject: [llvm-commits] [llvm] r111287 - in /llvm/trunk: include/llvm/MC/MCAssembler.h include/llvm/Support/COFF.h test/Scripts/coff-dump.py Message-ID: <20100817210554.730E62A6C12D@llvm.org> Author: asl Date: Tue Aug 17 16:05:54 2010 New Revision: 111287 URL: http://llvm.org/viewvc/llvm-project?rev=111287&view=rev Log: Add some win64 coff goodness. Patch by Cameron Esfahani! Modified: llvm/trunk/include/llvm/MC/MCAssembler.h llvm/trunk/include/llvm/Support/COFF.h llvm/trunk/test/Scripts/coff-dump.py Modified: llvm/trunk/include/llvm/MC/MCAssembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=111287&r1=111286&r2=111287&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAssembler.h (original) +++ llvm/trunk/include/llvm/MC/MCAssembler.h Tue Aug 17 16:05:54 2010 @@ -164,7 +164,7 @@ /// Inst - The instruction this is a fragment for. MCInst Inst; - /// InstSize - The size of the currently encoded instruction. + /// Code - Binary data for the currently encoded instruction. SmallString<8> Code; /// Fixups - The list of fixups in this fragment. Modified: llvm/trunk/include/llvm/Support/COFF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/COFF.h?rev=111287&r1=111286&r2=111287&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/COFF.h (original) +++ llvm/trunk/include/llvm/Support/COFF.h Tue Aug 17 16:05:54 2010 @@ -48,6 +48,11 @@ uint16_t Characteristics; }; + enum MachineTypes { + IMAGE_FILE_MACHINE_I386 = 0x14C, + IMAGINE_FILE_MACHINE_AMD64 = 0x8664 + }; + struct symbol { char Name[NameSize]; uint32_t Value; @@ -199,7 +204,25 @@ IMAGE_REL_I386_SECREL = 0x000B, IMAGE_REL_I386_TOKEN = 0x000C, IMAGE_REL_I386_SECREL7 = 0x000D, - IMAGE_REL_I386_REL32 = 0x0014 + IMAGE_REL_I386_REL32 = 0x0014, + + IMAGE_REL_AMD64_ABSOLUTE = 0x0000, + IMAGE_REL_AMD64_ADDR64 = 0x0001, + IMAGE_REL_AMD64_ADDR32 = 0x0002, + IMAGE_REL_AMD64_ADDR32NB = 0x0003, + IMAGE_REL_AMD64_REL32 = 0x0004, + IMAGE_REL_AMD64_REL32_1 = 0x0005, + IMAGE_REL_AMD64_REL32_2 = 0x0006, + IMAGE_REL_AMD64_REL32_3 = 0x0007, + IMAGE_REL_AMD64_REL32_4 = 0x0008, + IMAGE_REL_AMD64_REL32_5 = 0x0009, + IMAGE_REL_AMD64_SECTION = 0x000A, + IMAGE_REL_AMD64_SECREL = 0x000B, + IMAGE_REL_AMD64_SECREL7 = 0x000C, + IMAGE_REL_AMD64_TOKEN = 0x000D, + IMAGE_REL_AMD64_SREL32 = 0x000E, + IMAGE_REL_AMD64_PAIR = 0x000F, + IMAGE_REL_AMD64_SSPAN32 = 0x0010 }; enum COMDATType { Modified: llvm/trunk/test/Scripts/coff-dump.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/coff-dump.py?rev=111287&r1=111286&r2=111287&view=diff ============================================================================== --- llvm/trunk/test/Scripts/coff-dump.py (original) +++ llvm/trunk/test/Scripts/coff-dump.py Tue Aug 17 16:05:54 2010 @@ -32,7 +32,7 @@ ('MachineType', ('enum', ' Author: asl Date: Tue Aug 17 16:06:01 2010 New Revision: 111288 URL: http://llvm.org/viewvc/llvm-project?rev=111288&view=rev Log: Enable more win64 calls folding opportunities. Patch by Cameron Esfahani! Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=111288&r1=111287&r2=111288&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Aug 17 16:06:01 2010 @@ -235,6 +235,7 @@ { X86::BT64ri8, X86::BT64mi8, 1, 0 }, { X86::CALL32r, X86::CALL32m, 1, 0 }, { X86::CALL64r, X86::CALL64m, 1, 0 }, + { X86::WINCALL64r, X86::WINCALL64m, 1, 0 }, { X86::CMP16ri, X86::CMP16mi, 1, 0 }, { X86::CMP16ri8, X86::CMP16mi8, 1, 0 }, { X86::CMP16rr, X86::CMP16mr, 1, 0 }, @@ -304,6 +305,7 @@ { X86::SETSr, X86::SETSm, 0, 0 }, { X86::TAILJMPr, X86::TAILJMPm, 1, 0 }, { X86::TAILJMPr64, X86::TAILJMPm64, 1, 0 }, + { X86::WINTAILJMPr64,X86::WINTAILJMPm64, 1, 0 }, { X86::TEST16ri, X86::TEST16mi, 1, 0 }, { X86::TEST32ri, X86::TEST32mi, 1, 0 }, { X86::TEST64ri32, X86::TEST64mi32, 1, 0 }, From asl at math.spbu.ru Tue Aug 17 16:06:07 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Aug 2010 21:06:07 -0000 Subject: [llvm-commits] [llvm] r111289 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86ISelLowering.cpp X86MCInstLower.cpp Message-ID: <20100817210607.D00432A6C12D@llvm.org> Author: asl Date: Tue Aug 17 16:06:07 2010 New Revision: 111289 URL: http://llvm.org/viewvc/llvm-project?rev=111289&view=rev Log: More fixes for win64: - Do not clobber al during variadic calls, this is AMD64 ABI-only feature - Emit wincall64, where necessary Patch by Cameron Esfahani! Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=111289&r1=111288&r2=111289&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Tue Aug 17 16:06:07 2010 @@ -776,7 +776,8 @@ } assert(MO.isImm() && "Unknown RawFrm operand!"); - if (Opcode == X86::CALLpcrel32 || Opcode == X86::CALL64pcrel32) { + if (Opcode == X86::CALLpcrel32 || Opcode == X86::CALL64pcrel32 || + Opcode == X86::WINCALL64pcrel32) { // Fix up immediate operand for pc relative calls. intptr_t Imm = (intptr_t)MO.getImm(); Imm = Imm - MCE.getCurrentPCValue() - 4; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=111289&r1=111288&r2=111289&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Aug 17 16:06:07 2010 @@ -2230,8 +2230,8 @@ if (!isTailCall && Subtarget->isPICStyleGOT()) Ops.push_back(DAG.getRegister(X86::EBX, getPointerTy())); - // Add an implicit use of AL for x86 vararg functions. - if (Is64Bit && isVarArg) + // Add an implicit use of AL for non-Windows x86 64-bit vararg functions. + if (Is64Bit && isVarArg && !Subtarget->isTargetWin64()) Ops.push_back(DAG.getRegister(X86::AL, MVT::i8)); if (InFlag.getNode()) @@ -8832,6 +8832,7 @@ = static_cast(getTargetMachine().getInstrInfo()); DebugLoc DL = MI->getDebugLoc(); MachineFunction *F = BB->getParent(); + bool IsWin64 = Subtarget->isTargetWin64(); assert(MI->getOperand(3).isGlobal() && "This should be a global"); @@ -8843,7 +8844,7 @@ .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL64m)); + MIB = BuildMI(*BB, MI, DL, TII->get(IsWin64 ? X86::WINCALL64m : X86::CALL64m)); addDirectMem(MIB, X86::RDI); } else if (getTargetMachine().getRelocationModel() != Reloc::PIC_) { MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=111289&r1=111288&r2=111289&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Tue Aug 17 16:06:07 2010 @@ -401,12 +401,14 @@ LowerUnaryToTwoAddr(OutMI, X86::XOR32rr); // MOV32r0 -> XOR32rr break; - // TAILJMPr64, CALL64r, CALL64pcrel32 - These instructions have + // TAILJMPr64, [WIN]CALL64r, [WIN]CALL64pcrel32 - These instructions have // register inputs modeled as normal uses instead of implicit uses. As such, // truncate off all but the first operand (the callee). FIXME: Change isel. case X86::TAILJMPr64: case X86::CALL64r: - case X86::CALL64pcrel32: { + case X86::CALL64pcrel32: + case X86::WINCALL64r: + case X86::WINCALL64pcrel32: { unsigned Opcode = OutMI.getOpcode(); MCOperand Saved = OutMI.getOperand(0); OutMI = MCInst(); From wdietz2 at illinois.edu Tue Aug 17 16:06:20 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 17 Aug 2010 21:06:20 -0000 Subject: [llvm-commits] [poolalloc] r111290 - in /poolalloc/trunk/test/dsa/var_arg: context.c context_32.ll context_64.ll Message-ID: <20100817210620.C35282A6C12C@llvm.org> Author: wdietz2 Date: Tue Aug 17 16:06:20 2010 New Revision: 111290 URL: http://llvm.org/viewvc/llvm-project?rev=111290&view=rev Log: Added more direct ll versions of the context var_arg test. Added: poolalloc/trunk/test/dsa/var_arg/context_32.ll poolalloc/trunk/test/dsa/var_arg/context_64.ll Modified: poolalloc/trunk/test/dsa/var_arg/context.c Modified: poolalloc/trunk/test/dsa/var_arg/context.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/var_arg/context.c?rev=111290&r1=111289&r2=111290&view=diff ============================================================================== --- poolalloc/trunk/test/dsa/var_arg/context.c (original) +++ poolalloc/trunk/test/dsa/var_arg/context.c Tue Aug 17 16:06:20 2010 @@ -10,15 +10,6 @@ //RUN: dsaopt %t.bc -ds-aa -gvn -o - | lli > %t.out2 //RUN: diff %t.refout %t.out //RUN: diff %t.refout %t.out2 -//--check properties of this particular test -//RUN: dsaopt %t.bc -ds-aa -aa-eval -o /dev/null \ -// RUN: -print-all-alias-modref-info >& %t.aa - -//FIXME: Find a better way to get at this information... -//--get the registers loaded from ret1 and ret2 -//RUN: llvm-dis %t.bc -f -o %t.ll -//RUN: cat %t.ll | grep load | grep "ret1" | sed -e {s/ =.*$//} -e {s/^\[ \]*//} > %t.ret1 -//RUN: cat %t.ll | grep load | grep "ret2" | sed -e {s/ =.*$//} -e {s/^\[ \]*//} > %t.ret2 static int * get( int unused, ... ) @@ -39,8 +30,6 @@ int *p1 = &val1, *p2 = &val2; int *ret1, *ret2; - //ret1 and ret2 should explicitly /not/ alias - //RUN: cat %t.aa | grep -f %t.ret1 | grep -f %t.ret2 | grep NoAlias ret1 = get( 0, p1 ); ret2 = get( 0, p2 ); Added: poolalloc/trunk/test/dsa/var_arg/context_32.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/var_arg/context_32.ll?rev=111290&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/var_arg/context_32.ll (added) +++ poolalloc/trunk/test/dsa/var_arg/context_32.ll Tue Aug 17 16:06:20 2010 @@ -0,0 +1,92 @@ +; ModuleID = 'context.c' +;--Verify 'ret1' and 'ret2' don't point to the same node (they weren't merged!) +;RUN: dsaopt %s -dsa-local -analyze -check-not-same-node "main:ret1:0,main:ret2:0" +;RUN: dsaopt %s -dsa-bu -analyze -check-not-same-node "main:ret1:0,main:ret2:0" + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" +target triple = "i386-unknown-linux-gnu" + +define internal i32* @get(i32 %unused, ...) nounwind { +entry: + %unused_addr = alloca i32 ; [#uses=1] + %retval = alloca i32* ; [#uses=2] + %0 = alloca i32* ; [#uses=2] + %ap.0 = alloca i8* ; [#uses=3] + %ap = alloca i8* ; [#uses=4] + %ret = alloca i32* ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %unused, i32* %unused_addr + %ap1 = bitcast i8** %ap to i8* ; [#uses=1] + call void @llvm.va_start(i8* %ap1) + %1 = load i8** %ap, align 4 ; [#uses=1] + store i8* %1, i8** %ap.0, align 4 + %2 = load i8** %ap.0, align 4 ; [#uses=1] + %3 = getelementptr inbounds i8* %2, i64 4 ; [#uses=1] + store i8* %3, i8** %ap, align 4 + %4 = load i8** %ap.0, align 4 ; [#uses=1] + %5 = bitcast i8* %4 to i32** ; [#uses=1] + %6 = load i32** %5, align 4 ; [#uses=1] + store i32* %6, i32** %ret, align 4 + %ap2 = bitcast i8** %ap to i8* ; [#uses=1] + call void @llvm.va_end(i8* %ap2) + %7 = load i32** %ret, align 4 ; [#uses=1] + store i32* %7, i32** %0, align 4 + %8 = load i32** %0, align 4 ; [#uses=1] + store i32* %8, i32** %retval, align 4 + br label %return + +return: ; preds = %entry + %retval3 = load i32** %retval ; [#uses=1] + ret i32* %retval3 +} + +declare void @llvm.va_start(i8*) nounwind + +declare void @llvm.va_end(i8*) nounwind + +define i32 @main() nounwind { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=3] + %val1 = alloca i32 ; [#uses=2] + %val2 = alloca i32 ; [#uses=2] + %p1 = alloca i32* ; [#uses=2] + %p2 = alloca i32* ; [#uses=2] + %ret1 = alloca i32* ; [#uses=2] + %ret2 = alloca i32* ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 1, i32* %val1, align 4 + store i32 2, i32* %val2, align 4 + store i32* %val1, i32** %p1, align 4 + store i32* %val2, i32** %p2, align 4 + %1 = load i32** %p1, align 4 ; [#uses=1] + %2 = call i32* (i32, ...)* @get(i32 0, i32* %1) nounwind ; [#uses=1] + store i32* %2, i32** %ret1, align 4 + %3 = load i32** %p2, align 4 ; [#uses=1] + %4 = call i32* (i32, ...)* @get(i32 0, i32* %3) nounwind ; [#uses=1] + store i32* %4, i32** %ret2, align 4 + %5 = load i32** %ret1, align 4 ; [#uses=1] + %6 = load i32* %5, align 4 ; [#uses=1] + %7 = add nsw i32 %6, 1 ; [#uses=1] + %8 = load i32** %ret2, align 4 ; [#uses=1] + %9 = load i32* %8, align 4 ; [#uses=1] + %10 = icmp eq i32 %7, %9 ; [#uses=1] + br i1 %10, label %bb, label %bb1 + +bb: ; preds = %entry + store i32 0, i32* %0, align 4 + br label %bb2 + +bb1: ; preds = %entry + store i32 -1, i32* %0, align 4 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %11 = load i32* %0, align 4 ; [#uses=1] + store i32 %11, i32* %retval, align 4 + br label %return + +return: ; preds = %bb2 + %retval3 = load i32* %retval ; [#uses=1] + ret i32 %retval3 +} Added: poolalloc/trunk/test/dsa/var_arg/context_64.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/var_arg/context_64.ll?rev=111290&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/var_arg/context_64.ll (added) +++ poolalloc/trunk/test/dsa/var_arg/context_64.ll Tue Aug 17 16:06:20 2010 @@ -0,0 +1,130 @@ +; ModuleID = 'context.c' +;--Verify 'ret1' and 'ret2' don't point to the same node (they weren't merged!) +;RUN: dsaopt %s -dsa-local -analyze -check-not-same-node "main:ret1:0,main:ret2:0" +;RUN: dsaopt %s -dsa-bu -analyze -check-not-same-node "main:ret1:0,main:ret2:0" +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.__va_list_tag = type { i32, i32, i8*, i8* } + +define internal i32* @get(i32 %unused, ...) nounwind { +entry: + %unused_addr = alloca i32 ; [#uses=1] + %retval = alloca i32* ; [#uses=2] + %0 = alloca i32* ; [#uses=2] + %addr.0 = alloca i8* ; [#uses=3] + %ap = alloca [1 x %struct.__va_list_tag] ; <[1 x %struct.__va_list_tag]*> [#uses=9] + %ret = alloca i32* ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %unused, i32* %unused_addr + %ap1 = bitcast [1 x %struct.__va_list_tag]* %ap to %struct.__va_list_tag* ; <%struct.__va_list_tag*> [#uses=1] + %ap12 = bitcast %struct.__va_list_tag* %ap1 to i8* ; [#uses=1] + call void @llvm.va_start(i8* %ap12) + %1 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %2 = getelementptr inbounds %struct.__va_list_tag* %1, i32 0, i32 0 ; [#uses=1] + %3 = load i32* %2, align 8 ; [#uses=1] + %4 = icmp uge i32 %3, 48 ; [#uses=1] + br i1 %4, label %bb3, label %bb + +bb: ; preds = %entry + %5 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %6 = getelementptr inbounds %struct.__va_list_tag* %5, i32 0, i32 3 ; [#uses=1] + %7 = load i8** %6, align 8 ; [#uses=1] + %8 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %9 = getelementptr inbounds %struct.__va_list_tag* %8, i32 0, i32 0 ; [#uses=1] + %10 = load i32* %9, align 8 ; [#uses=1] + %11 = inttoptr i32 %10 to i8* ; [#uses=1] + %12 = ptrtoint i8* %7 to i64 ; [#uses=1] + %13 = ptrtoint i8* %11 to i64 ; [#uses=1] + %14 = add i64 %12, %13 ; [#uses=1] + %15 = inttoptr i64 %14 to i8* ; [#uses=1] + store i8* %15, i8** %addr.0, align 8 + %16 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %17 = getelementptr inbounds %struct.__va_list_tag* %16, i32 0, i32 0 ; [#uses=1] + %18 = load i32* %17, align 8 ; [#uses=1] + %19 = add i32 %18, 8 ; [#uses=1] + %20 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %21 = getelementptr inbounds %struct.__va_list_tag* %20, i32 0, i32 0 ; [#uses=1] + store i32 %19, i32* %21, align 8 + br label %bb4 + +bb3: ; preds = %entry + %22 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %23 = getelementptr inbounds %struct.__va_list_tag* %22, i32 0, i32 2 ; [#uses=1] + %24 = load i8** %23, align 8 ; [#uses=2] + store i8* %24, i8** %addr.0, align 8 + %25 = getelementptr inbounds i8* %24, i64 8 ; [#uses=1] + %26 = getelementptr inbounds [1 x %struct.__va_list_tag]* %ap, i64 0, i64 0 ; <%struct.__va_list_tag*> [#uses=1] + %27 = getelementptr inbounds %struct.__va_list_tag* %26, i32 0, i32 2 ; [#uses=1] + store i8* %25, i8** %27, align 8 + br label %bb4 + +bb4: ; preds = %bb3, %bb + %28 = load i8** %addr.0, align 8 ; [#uses=1] + %29 = bitcast i8* %28 to i32** ; [#uses=1] + %30 = load i32** %29, align 8 ; [#uses=1] + store i32* %30, i32** %ret, align 8 + %ap5 = bitcast [1 x %struct.__va_list_tag]* %ap to %struct.__va_list_tag* ; <%struct.__va_list_tag*> [#uses=1] + %ap56 = bitcast %struct.__va_list_tag* %ap5 to i8* ; [#uses=1] + call void @llvm.va_end(i8* %ap56) + %31 = load i32** %ret, align 8 ; [#uses=1] + store i32* %31, i32** %0, align 8 + %32 = load i32** %0, align 8 ; [#uses=1] + store i32* %32, i32** %retval, align 8 + br label %return + +return: ; preds = %bb4 + %retval7 = load i32** %retval ; [#uses=1] + ret i32* %retval7 +} + +declare void @llvm.va_start(i8*) nounwind + +declare void @llvm.va_end(i8*) nounwind + +define i32 @main() nounwind { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=3] + %val1 = alloca i32 ; [#uses=2] + %val2 = alloca i32 ; [#uses=2] + %p1 = alloca i32* ; [#uses=2] + %p2 = alloca i32* ; [#uses=2] + %ret1 = alloca i32* ; [#uses=2] + %ret2 = alloca i32* ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 1, i32* %val1, align 4 + store i32 2, i32* %val2, align 4 + store i32* %val1, i32** %p1, align 8 + store i32* %val2, i32** %p2, align 8 + %1 = load i32** %p1, align 8 ; [#uses=1] + %2 = call i32* (i32, ...)* @get(i32 0, i32* %1) nounwind ; [#uses=1] + store i32* %2, i32** %ret1, align 8 + %3 = load i32** %p2, align 8 ; [#uses=1] + %4 = call i32* (i32, ...)* @get(i32 0, i32* %3) nounwind ; [#uses=1] + store i32* %4, i32** %ret2, align 8 + %5 = load i32** %ret1, align 8 ; [#uses=1] + %6 = load i32* %5, align 4 ; [#uses=1] + %7 = add nsw i32 %6, 1 ; [#uses=1] + %8 = load i32** %ret2, align 8 ; [#uses=1] + %9 = load i32* %8, align 4 ; [#uses=1] + %10 = icmp eq i32 %7, %9 ; [#uses=1] + br i1 %10, label %bb, label %bb1 + +bb: ; preds = %entry + store i32 0, i32* %0, align 4 + br label %bb2 + +bb1: ; preds = %entry + store i32 -1, i32* %0, align 4 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %11 = load i32* %0, align 4 ; [#uses=1] + store i32 %11, i32* %retval, align 4 + br label %return + +return: ; preds = %bb2 + %retval3 = load i32* %retval ; [#uses=1] + ret i32 %retval3 +} From asl at math.spbu.ru Tue Aug 17 16:08:29 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 17 Aug 2010 21:08:29 -0000 Subject: [llvm-commits] [llvm] r111291 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <20100817210829.2F6DF2A6C12C@llvm.org> Author: asl Date: Tue Aug 17 16:08:28 2010 New Revision: 111291 URL: http://llvm.org/viewvc/llvm-project?rev=111291&view=rev Log: Revert part of one of the prev. patches - tailjmp will follow later. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=111291&r1=111290&r2=111291&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Aug 17 16:08:28 2010 @@ -305,7 +305,6 @@ { X86::SETSr, X86::SETSm, 0, 0 }, { X86::TAILJMPr, X86::TAILJMPm, 1, 0 }, { X86::TAILJMPr64, X86::TAILJMPm64, 1, 0 }, - { X86::WINTAILJMPr64,X86::WINTAILJMPm64, 1, 0 }, { X86::TEST16ri, X86::TEST16mi, 1, 0 }, { X86::TEST32ri, X86::TEST32mi, 1, 0 }, { X86::TEST64ri32, X86::TEST64mi32, 1, 0 }, From stoklund at 2pi.dk Tue Aug 17 16:11:35 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Aug 2010 14:11:35 -0700 Subject: [llvm-commits] [llvm] r111285 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp PHIElimination.cpp PHIElimination.h In-Reply-To: <20100817210037.CD97C2A6C12C@llvm.org> References: <20100817210037.CD97C2A6C12C@llvm.org> Message-ID: On Aug 17, 2010, at 2:00 PM, Evan Cheng wrote: > Author: evancheng > Date: Tue Aug 17 16:00:37 2010 > New Revision: 111285 > > URL: http://llvm.org/viewvc/llvm-project?rev=111285&view=rev > Log: > PHI elimination shouldn't require machineloopinfo since it's used at -O0. Move the requirement to LiveIntervalAnalysis instead. Note this does not change the number of times machineloopinfo is computed. Thanks! Note that both SimpleRegisterCoalescing and CalcSpillWeights require LoopInfo, so you may be able to get away with only AU.addPreserved() in LiveIntervalAnalysis. Does this mean that we are only calculating LoopInfo once now? That's awesome. From wdietz2 at illinois.edu Tue Aug 17 16:21:25 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 17 Aug 2010 21:21:25 -0000 Subject: [llvm-commits] [poolalloc] r111292 - /poolalloc/trunk/test/dsa/regression/2010-08-17-VarArgSize.ll Message-ID: <20100817212125.9BDF92A6C12C@llvm.org> Author: wdietz2 Date: Tue Aug 17 16:21:25 2010 New Revision: 111292 URL: http://llvm.org/viewvc/llvm-project?rev=111292&view=rev Log: Added regression test to verify changes made in r111123 that fix PR7914. Added: poolalloc/trunk/test/dsa/regression/2010-08-17-VarArgSize.ll Added: poolalloc/trunk/test/dsa/regression/2010-08-17-VarArgSize.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2010-08-17-VarArgSize.ll?rev=111292&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/regression/2010-08-17-VarArgSize.ll (added) +++ poolalloc/trunk/test/dsa/regression/2010-08-17-VarArgSize.ll Tue Aug 17 16:21:25 2010 @@ -0,0 +1,16 @@ +; ModuleID = '2010-08-17-VarArgSize.ll' +;RUN: dsaopt %s -dsa-bu +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" +target triple = "i386-pc-linux-gnu" + +declare void @llvm.va_start(i8*) nounwind + +define void @func(i32 %unused, i8* nocapture %fmt, ...) nounwind { +entry: + %ap = bitcast i8** undef to i8* + call void @llvm.va_start(i8* %ap) + call void @llvm.va_start(i8* %ap) + ret void + +} + From wdietz2 at illinois.edu Tue Aug 17 16:41:50 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 17 Aug 2010 21:41:50 -0000 Subject: [llvm-commits] [poolalloc] r111297 - /poolalloc/trunk/test/pa/regression/2010-08-17-InvalidIterator.ll Message-ID: <20100817214150.466EE2A6C12C@llvm.org> Author: wdietz2 Date: Tue Aug 17 16:41:50 2010 New Revision: 111297 URL: http://llvm.org/viewvc/llvm-project?rev=111297&view=rev Log: Added testcase from PR7629. Added: poolalloc/trunk/test/pa/regression/2010-08-17-InvalidIterator.ll Added: poolalloc/trunk/test/pa/regression/2010-08-17-InvalidIterator.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/pa/regression/2010-08-17-InvalidIterator.ll?rev=111297&view=auto ============================================================================== --- poolalloc/trunk/test/pa/regression/2010-08-17-InvalidIterator.ll (added) +++ poolalloc/trunk/test/pa/regression/2010-08-17-InvalidIterator.ll Tue Aug 17 16:41:50 2010 @@ -0,0 +1,52 @@ +; ModuleID = 'bugpoint-reduced-simplified.bc' +;RUN: paopt %s -poolalloc -disable-output >& /dev/null +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.TypHeader = type { i64, %struct.TypHeader**, [3 x i8], i8 } + +define fastcc void @InitEval() nounwind { +bb.nph49: + br label %bb + +bb: ; preds = %bb, %bb.nph49 + br i1 undef, label %bb5.preheader, label %bb + +bb4: ; preds = %bb5.preheader, %bb4 + br i1 undef, label %bb6, label %bb4 + +bb6: ; preds = %bb4 + br i1 undef, label %bb11.preheader, label %bb5.preheader + +bb5.preheader: ; preds = %bb6, %bb + br label %bb4 + +bb10: ; preds = %bb11.preheader, %bb10 + br i1 undef, label %bb14.loopexit, label %bb10 + +bb13: ; preds = %bb14.loopexit, %bb13 + br i1 undef, label %bb15, label %bb13 + +bb14.loopexit: ; preds = %bb10 + br i1 undef, label %bb13, label %bb15 + +bb15: ; preds = %bb14.loopexit, %bb13 + br i1 undef, label %bb17, label %bb11.preheader + +bb11.preheader: ; preds = %bb15, %bb6 + br label %bb10 + +bb17: ; preds = %bb15 + store %struct.TypHeader* bitcast (%struct.TypHeader* (%struct.TypHeader*)* @IntComm to %struct.TypHeader*), %struct.TypHeader** undef + unreachable +} + +define %struct.TypHeader* @IntComm(%struct.TypHeader* nocapture %hdCall) nounwind { +entry: + unreachable +} + +define i32 @main(i32 %argc, i8** nocapture %argv) noreturn nounwind { +entry: + unreachable +} From evan.cheng at apple.com Tue Aug 17 16:47:05 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 14:47:05 -0700 Subject: [llvm-commits] [llvm] r111285 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp PHIElimination.cpp PHIElimination.h In-Reply-To: References: <20100817210037.CD97C2A6C12C@llvm.org> Message-ID: On Aug 17, 2010, at 2:11 PM, Jakob Stoklund Olesen wrote: > > On Aug 17, 2010, at 2:00 PM, Evan Cheng wrote: > >> Author: evancheng >> Date: Tue Aug 17 16:00:37 2010 >> New Revision: 111285 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111285&view=rev >> Log: >> PHI elimination shouldn't require machineloopinfo since it's used at -O0. Move the requirement to LiveIntervalAnalysis instead. Note this does not change the number of times machineloopinfo is computed. > > Thanks! > > Note that both SimpleRegisterCoalescing and CalcSpillWeights require LoopInfo, so you may be able to get away with only AU.addPreserved() in LiveIntervalAnalysis. That's what I thought at first but it didn't work as expected. > > Does this mean that we are only calculating LoopInfo once now? That's awesome. No. Tail duplication and if-conversion are not preserving it. Evan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/072bbb2f/attachment.html From criswell at uiuc.edu Tue Aug 17 16:49:53 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 17 Aug 2010 21:49:53 -0000 Subject: [llvm-commits] [poolalloc] r111299 - in /poolalloc/trunk/lib/PoolAllocate: PoolAllocate.cpp TransformFunctionBody.cpp Message-ID: <20100817214953.56D052A6C12C@llvm.org> Author: criswell Date: Tue Aug 17 16:49:53 2010 New Revision: 111299 URL: http://llvm.org/viewvc/llvm-project?rev=111299&view=rev Log: PoolAllocate.cpp: Modified code so that we assign DSNodes to global pools more consistently. Also rewrote logic that determines whether we have already assigned a global pool for a value or whether a local pool needs to be created. Added comments. TransformFunctionBody.cpp: Added the verifyCallees() method to verify properties of targets of indirect function calls. Added code so that we attempt to look up indirect function call targets by mapping the call instruction back to its original, non-cloned instruction and then consulting the DSCallGraph. Modified code that consults DSNodes directly for call graph information to grab the first function target that has a DSGraph. Added comments. Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=111299&r1=111298&r2=111299&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Tue Aug 17 16:49:53 2010 @@ -184,18 +184,20 @@ ClonedFunctions.insert(Clone); } } - + // - // Now that all call targets are available, rewrite the function bodies of the - // clones or the original function (if the original has no clone). + // Now that all call targets are available, rewrite the function bodies of + // the clones or the original function (if the original has no clone). // // FIXME: Use utility methods to make this code more readable! - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) + // + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (!I->isDeclaration() && !ClonedFunctions.count(I) && Graphs->hasDSGraph(*I)) { std::map::iterator FI = FuncMap.find(I); ProcessFunctionBody(*I, FI != FuncMap.end() ? *FI->second : *I); } + } // // Replace any remaining uses of original functions with the transformed @@ -244,11 +246,12 @@ Constant* CEnew = ConstantExpr::getPointerCast(I->second, F->getType()); - // Must handle Constants specially, we cannot call replaceUsesOfWith on a - // constant because they are uniqued. + // + // We must handle Constants specially; we cannot call replaceUsesOfWith() + // on a constant because they are uniqued. + // if (Constant *C = dyn_cast(user)) { if (!isa(C)) { - // // Scan through all operands in the constant. If they are the // function that we want to replace, then add them to a worklist (we @@ -551,6 +554,11 @@ // All DSNodes reachable from arguments must be passed in. // DSGraph::ScalarMapTy::iterator AI = G->getScalarMap().find(I); + + // + // Assert that we either have a non-pointer parameter or that we have a + // an entry in the Scalar Map for this item. + // if (AI != G->getScalarMap().end()) { if (DSNode *N = AI->second.getNode()) { // @@ -678,7 +686,7 @@ // // Create the new function... // - Function *New = Function::Create(FuncTy, Function::InternalLinkage, F.getName()); + Function *New = Function::Create(FuncTy, Function::InternalLinkage, F.getNameStr() + "_clone"); F.getParent()->getFunctionList().insert(&F, New); CloneToOrigMap[New] = &F; // Remember original function. @@ -839,6 +847,13 @@ Node->isUnknownNode()) { GlobalHeapNodes.insert (Node); } + + // + // If a DSNode is used as an array and bounds checking is enabled, + // then also give it a global node. + // + if (BoundsChecksEnabled && (Node->isArrayNode())) + GlobalHeapNodes.insert (Node); } } @@ -1050,6 +1065,7 @@ // 3) Nodes which are mirrored in the globals graph and are heap nodes. // DSNode *N = I; +#if 0 if ((N->isHeapNode()) || (BoundsChecksEnabled && (N->isArrayNode())) || (GlobalsGraphNodeMapping.count(N) && GlobalsGraphNodeMapping[N].getNode()->isHeapNode())) { @@ -1065,6 +1081,23 @@ FI.NodesToPA.push_back(N); } } +#else + if ((N->isHeapNode()) || (BoundsChecksEnabled && (N->isArrayNode())) || + (GlobalsGraphNodeMapping.count(N) && + GlobalsGraphNodeMapping[N].getNode()->isHeapNode())) { + DSNode *GGN = GlobalsGraphNodeMapping[N].getNode(); + if (GlobalNodes[N]) { + FI.PoolDescriptors[N] = GlobalNodes[N]; + } else if (GlobalNodes[GGN]) { + FI.PoolDescriptors[N] = GlobalNodes[GGN]; + } else if (!MarkedNodes.count(N)) { + // Otherwise, if it was not passed in from outside the function, it must + // be a local pool! + assert(!N->isGlobalNode() && "Should be in global mapping!"); + FI.NodesToPA.push_back(N); + } + } +#endif } // @@ -1088,6 +1121,11 @@ if (!FI.NodesToPA.empty()) InitializeAndDestroyPools(NewF, FI.NodesToPA, FI.PoolDescriptors, PoolUses, PoolFrees); + + // + // Some heuristics want to do special transformation to the function. Let + // them do so here. + // CurHeuristic->HackFunctionBody(NewF, FI.PoolDescriptors); } Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=111299&r1=111298&r2=111299&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Tue Aug 17 16:49:53 2010 @@ -132,6 +132,8 @@ } Function* retCloneIfFunc(Value *V); + + void verifyCallees (const std::vector & Functions); }; } @@ -143,6 +145,58 @@ FuncTransform(*this, g, fi, poolUses, poolFrees).visit(F); } +// +// Method: verifyCallees() +// +// Description: +// This method performs various sanity checks on targets of indirect function +// calls. +// +void +FuncTransform::verifyCallees (const std::vector & Functions) { + // + // There's nothing to do if there's no function call targets at all. + // + if (Functions.size() == 0) + return; + + // + // Get the number of pool arguments for the first function. + // + unsigned numPoolArgs = PAInfo.getFuncInfo(*Functions[0])->ArgNodes.size(); + + // + // Get the DSGraph of the first function. + // + DataStructures& Graphs = PAInfo.getGraphs(); + DSGraph * firstGraph = Graphs.getDSGraph (*Functions[0]); + + // + // Scan through all other indirect function call targets. Ensure that these + // functions have the same number of pool arguments and the same DSGraph as + // the first function. + // + for (unsigned index = 1; index < Functions.size(); ++index) { + // + // Get the function information for the function. + // + const Function * F = Functions[index]; + FuncInfo *FI = PAInfo.getFuncInfo(*F); + + // + // Get the DSGraph. + // + DSGraph * G = Graphs.getDSGraph (*Functions[index]); + + // + // Assert that the graph and number of pool arguments are consistent. + // + assert (G == firstGraph); + assert (FI->ArgNodes.size() == numPoolArgs); + } + + return; +} // Returns the clone if V is a static function (not a pointer) and belongs // to an equivalence class i.e. is pool allocated @@ -743,6 +797,7 @@ } } + // // We need to figure out which local pool descriptors correspond to the pool // descriptor arguments passed into the function call. Calculate a mapping // from callee DSNodes to caller DSNodes. We construct a partial isomophism @@ -760,11 +815,24 @@ // merged. if (CF) { // Direct calls are nice and simple. DEBUG(errs() << " Handling direct call: " << *TheCall); + + // + // Do not try to add pool handles to the function if it: + // a) Already calls a cloned function; or + // b) Calls a function which was never cloned. + // + // For such a call, just replace any arguments that take original functions + // with their cloned function poiner values. + // FuncInfo *CFI = PAInfo.getFuncInfo(*CF); if (CFI == 0 || CFI->Clone == 0) { // Nothing to transform... visitInstruction(*TheCall); return; } + + // + // Oh, dear. We must add pool descriptors to this direct call. + // NewCallee = CFI->Clone; ArgNodes = CFI->ArgNodes; @@ -781,29 +849,45 @@ Instruction *OrigInst = cast(getOldValueIfAvailable(CS.getInstruction())); - DSCallGraph::callee_iterator I = Graphs.getCallGraph().callee_begin(CS); - if (I != Graphs.getCallGraph().callee_end(CS)) + // + // Attempt to get one of the function targets of this indirect call site by + // looking at the call graph constructed by the points-to analysis. Be + // sure to use the original call site from the original function; the + // points-to analysis has no information on the clones we've created. + // + const DSCallGraph & callGraph = Graphs.getCallGraph(); + DSCallGraph::callee_iterator I = callGraph.callee_begin(OrigInst); + if (I != callGraph.callee_end(OrigInst)) CF = *I; - + + // // If we didn't find the callee in the constructed call graph, try // checking in the DSNode itself. // This isn't ideal as it means that this call site didn't have inlining // happen. + // if (!CF) { DSGraph* dg = Graphs.getDSGraph(*OrigInst->getParent()->getParent()); DSNode* d = dg->getNodeForValue(OrigInst->getOperand(0)).getNode(); assert (d && "No DSNode!\n"); std::vector g; d->addFullFunctionList(g); - if (g.size()) { - EquivalenceClasses< const GlobalValue *> & EC = dg->getGlobalECs(); - for(std::vector::const_iterator ii = g.begin(), ee = g.end(); - !CF && ii != ee; ++ii) { - for (EquivalenceClasses::member_iterator MI = EC.findLeader(*ii); - MI != EC.member_end(); ++MI) // Loop over members in this set. - if ((CF = dyn_cast(*MI))) { - break; - } + + // + // Perform some consistency checks on the callees. + // + verifyCallees (g); + + // + // If we found any callees, grab the first one with a DSGraph and use it. + // Since we're using EQBU/EQTD, all potential targets should have the + // same DSGraph, so it doesn't matter which one we use as long as we use + // a function that *has* a DSGraph. + // + for (unsigned index = 0; index < g.size(); ++index) { + if (Graphs.hasDSGraph (*(g[index]))) { + CF = g[index]; + break; } } } @@ -834,10 +918,13 @@ #ifndef NDEBUG // Verify that all potential callees at call site have the same DS graph. DSCallGraph::callee_iterator E = Graphs.getCallGraph().callee_end(OrigInst); - for (; I != E; ++I) - if (!(*I)->isDeclaration()) + for (; I != E; ++I) { + const Function * F = *I; + assert (F); + if (!(F)->isDeclaration()) assert(CalleeGraph == Graphs.getDSGraph(**I) && "Callees at call site do not have a common graph!"); + } #endif // Find the DS nodes for the arguments that need to be added, if any. @@ -998,13 +1085,17 @@ UpdateNewToOldValueMap(TheCall, NewCall); } + // + // Copy over the calling convention and attributes of the original call + // instruction to the new call instruction. + // CallSite(NewCall).setCallingConv(CallSite(TheCall).getCallingConv()); TheCall->eraseFromParent(); visitInstruction(*NewCall); } - +// // visitInstruction - For all instructions in the transformed function bodies, // replace any references to the original calls with references to the // transformed calls. Many instructions can "take the address of" a function, @@ -1012,6 +1103,7 @@ // reference to the new, transformed, function. // FIXME: Don't rename uses of function names that escape // FIXME: Special-case when external user is pthread_create (or similar)? +// void FuncTransform::visitInstruction(Instruction &I) { for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) if (Function *clonedFunc = retCloneIfFunc(I.getOperand(i))) { From wdietz2 at illinois.edu Tue Aug 17 16:53:59 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 17 Aug 2010 21:53:59 -0000 Subject: [llvm-commits] [poolalloc] r111301 - in /poolalloc/trunk/test/dsa/local: arrays.c arrays.ll arrays1.c arrays1.ll arrays2.c arrays2.ll arrays3.c arrays3.ll ptr.c ptr.ll ptr1.c ptr1.ll ptr2.c ptr2.ll struct.c struct.ll struct1.c struct1.ll Message-ID: <20100817215359.C91BE2A6C12C@llvm.org> Author: wdietz2 Date: Tue Aug 17 16:53:59 2010 New Revision: 111301 URL: http://llvm.org/viewvc/llvm-project?rev=111301&view=rev Log: Added number of tests for dsa-local, committing on Arushi's behalf. Added: poolalloc/trunk/test/dsa/local/arrays.c poolalloc/trunk/test/dsa/local/arrays.ll poolalloc/trunk/test/dsa/local/arrays1.c poolalloc/trunk/test/dsa/local/arrays1.ll poolalloc/trunk/test/dsa/local/arrays2.c poolalloc/trunk/test/dsa/local/arrays2.ll poolalloc/trunk/test/dsa/local/arrays3.c poolalloc/trunk/test/dsa/local/arrays3.ll poolalloc/trunk/test/dsa/local/ptr.c poolalloc/trunk/test/dsa/local/ptr.ll poolalloc/trunk/test/dsa/local/ptr1.c poolalloc/trunk/test/dsa/local/ptr1.ll poolalloc/trunk/test/dsa/local/ptr2.c poolalloc/trunk/test/dsa/local/ptr2.ll poolalloc/trunk/test/dsa/local/struct.c poolalloc/trunk/test/dsa/local/struct.ll poolalloc/trunk/test/dsa/local/struct1.c poolalloc/trunk/test/dsa/local/struct1.ll Added: poolalloc/trunk/test/dsa/local/arrays.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays.c (added) +++ poolalloc/trunk/test/dsa/local/arrays.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,21 @@ + +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + +//H, S, G, R, M + +#include + +void func() { + + int *arr = (int*) malloc(sizeof(int)*10); + int i; + for(i=0;i<10;i++) + arr[i] = i; + + int *b = &arr[5]; + int **c = &arr; + int **d = &arr + 4; +} + Added: poolalloc/trunk/test/dsa/local/arrays.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays.ll (added) +++ poolalloc/trunk/test/dsa/local/arrays.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,53 @@ + +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:arr:0,func:b:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:arr,func:d:0,func:c:0 + +; ModuleID = 'arrays.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +define void @func() nounwind { +entry: + %arr = alloca i32* ; [#uses=5] + %i = alloca i32 ; [#uses=6] + %b = alloca i32* ; [#uses=1] + %c = alloca i32** ; [#uses=1] + %d = alloca i32** ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 40) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to i32* ; [#uses=1] + store i32* %1, i32** %arr, align 8 + store i32 0, i32* %i, align 4 + br label %bb1 + +bb: ; preds = %bb1 + %2 = load i32** %arr, align 8 ; [#uses=1] + %3 = load i32* %i, align 4 ; [#uses=1] + %4 = sext i32 %3 to i64 ; [#uses=1] + %5 = getelementptr inbounds i32* %2, i64 %4 ; [#uses=1] + %6 = load i32* %i, align 4 ; [#uses=1] + store i32 %6, i32* %5, align 1 + %7 = load i32* %i, align 4 ; [#uses=1] + %8 = add nsw i32 %7, 1 ; [#uses=1] + store i32 %8, i32* %i, align 4 + br label %bb1 + +bb1: ; preds = %bb, %entry + %9 = load i32* %i, align 4 ; [#uses=1] + %10 = icmp sle i32 %9, 9 ; [#uses=1] + br i1 %10, label %bb, label %bb2 + +bb2: ; preds = %bb1 + %11 = load i32** %arr, align 8 ; [#uses=1] + %12 = getelementptr inbounds i32* %11, i64 5 ; [#uses=1] + store i32* %12, i32** %b, align 8 + store i32** %arr, i32*** %c, align 8 + %13 = getelementptr inbounds i32** %arr, i64 4 ; [#uses=1] + store i32** %13, i32*** %d, align 8 + br label %return + +return: ; preds = %bb2 + ret void +} + +declare noalias i8* @malloc(i64) nounwind Added: poolalloc/trunk/test/dsa/local/arrays1.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays1.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays1.c (added) +++ poolalloc/trunk/test/dsa/local/arrays1.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,25 @@ +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + +#include + +struct StructType { + + int a; + int *b; +}; + +void func() { + + struct StructType *tmp = (struct StructType*) malloc(sizeof(struct StructType)*10); + int i; + for(i=0;i<10;i++) { + tmp[i].a = i; + tmp[i].b = &tmp[i].a; + } + + struct StructType s2 = tmp[0]; + int * c = s2.b; +} + Added: poolalloc/trunk/test/dsa/local/arrays1.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays1.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays1.ll (added) +++ poolalloc/trunk/test/dsa/local/arrays1.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,72 @@ +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:tmp:0:0,func:tmp:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:c:0,func:tmp:0,func:s2:8 + +; ModuleID = 'arrays1.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.StructType = type { i32, i32* } + +define void @func() nounwind { +entry: + %tmp = alloca %struct.StructType* ; <%struct.StructType**> [#uses=5] + %i = alloca i32 ; [#uses=8] + %s2 = alloca %struct.StructType ; <%struct.StructType*> [#uses=3] + %c = alloca i32* ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 160) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to %struct.StructType* ; <%struct.StructType*> [#uses=1] + store %struct.StructType* %1, %struct.StructType** %tmp, align 8 + store i32 0, i32* %i, align 4 + br label %bb1 + +bb: ; preds = %bb1 + %2 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %3 = load i32* %i, align 4 ; [#uses=1] + %4 = sext i32 %3 to i64 ; [#uses=1] + %5 = getelementptr inbounds %struct.StructType* %2, i64 %4 ; <%struct.StructType*> [#uses=1] + %6 = getelementptr inbounds %struct.StructType* %5, i32 0, i32 0 ; [#uses=1] + %7 = load i32* %i, align 4 ; [#uses=1] + store i32 %7, i32* %6, align 8 + %8 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %9 = load i32* %i, align 4 ; [#uses=1] + %10 = sext i32 %9 to i64 ; [#uses=1] + %11 = getelementptr inbounds %struct.StructType* %8, i64 %10 ; <%struct.StructType*> [#uses=1] + %12 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %13 = load i32* %i, align 4 ; [#uses=1] + %14 = sext i32 %13 to i64 ; [#uses=1] + %15 = getelementptr inbounds %struct.StructType* %12, i64 %14 ; <%struct.StructType*> [#uses=1] + %16 = getelementptr inbounds %struct.StructType* %15, i32 0, i32 0 ; [#uses=1] + %17 = getelementptr inbounds %struct.StructType* %11, i32 0, i32 1 ; [#uses=1] + store i32* %16, i32** %17, align 8 + %18 = load i32* %i, align 4 ; [#uses=1] + %19 = add nsw i32 %18, 1 ; [#uses=1] + store i32 %19, i32* %i, align 4 + br label %bb1 + +bb1: ; preds = %bb, %entry + %20 = load i32* %i, align 4 ; [#uses=1] + %21 = icmp sle i32 %20, 9 ; [#uses=1] + br i1 %21, label %bb, label %bb2 + +bb2: ; preds = %bb1 + %22 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %23 = getelementptr inbounds %struct.StructType* %22, i64 0 ; <%struct.StructType*> [#uses=2] + %24 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 0 ; [#uses=1] + %25 = getelementptr inbounds %struct.StructType* %23, i32 0, i32 0 ; [#uses=1] + %26 = load i32* %25, align 1 ; [#uses=1] + store i32 %26, i32* %24, align 1 + %27 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %28 = getelementptr inbounds %struct.StructType* %23, i32 0, i32 1 ; [#uses=1] + %29 = load i32** %28, align 1 ; [#uses=1] + store i32* %29, i32** %27, align 1 + %30 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %31 = load i32** %30, align 8 ; [#uses=1] + store i32* %31, i32** %c, align 8 + br label %return + +return: ; preds = %bb2 + ret void +} + +declare noalias i8* @malloc(i64) nounwind Added: poolalloc/trunk/test/dsa/local/arrays2.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays2.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays2.c (added) +++ poolalloc/trunk/test/dsa/local/arrays2.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,26 @@ +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + +//H, S, G, R, M + +#include + +struct StructType { + + int a; + int *b; +}; + +void func() { + + struct StructType *tmp = (struct StructType*) malloc(sizeof(struct StructType)*10); + int i; + for(i=0;i<10;i++) { + tmp[i].a = i; + } + + struct StructType s2 = tmp[0]; + int * c = s2.b; +} + Added: poolalloc/trunk/test/dsa/local/arrays2.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays2.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays2.ll (added) +++ poolalloc/trunk/test/dsa/local/arrays2.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,61 @@ + +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:s2:8,func:c:0,func:tmp:0:0 + +; ModuleID = 'arrays2.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.StructType = type { i32, i32* } + +define void @func() nounwind { +entry: + %tmp = alloca %struct.StructType* ; <%struct.StructType**> [#uses=3] + %i = alloca i32 ; [#uses=6] + %s2 = alloca %struct.StructType ; <%struct.StructType*> [#uses=3] + %c = alloca i32* ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 160) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to %struct.StructType* ; <%struct.StructType*> [#uses=1] + store %struct.StructType* %1, %struct.StructType** %tmp, align 8 + store i32 0, i32* %i, align 4 + br label %bb1 + +bb: ; preds = %bb1 + %2 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %3 = load i32* %i, align 4 ; [#uses=1] + %4 = sext i32 %3 to i64 ; [#uses=1] + %5 = getelementptr inbounds %struct.StructType* %2, i64 %4 ; <%struct.StructType*> [#uses=1] + %6 = getelementptr inbounds %struct.StructType* %5, i32 0, i32 0 ; [#uses=1] + %7 = load i32* %i, align 4 ; [#uses=1] + store i32 %7, i32* %6, align 8 + %8 = load i32* %i, align 4 ; [#uses=1] + %9 = add nsw i32 %8, 1 ; [#uses=1] + store i32 %9, i32* %i, align 4 + br label %bb1 + +bb1: ; preds = %bb, %entry + %10 = load i32* %i, align 4 ; [#uses=1] + %11 = icmp sle i32 %10, 9 ; [#uses=1] + br i1 %11, label %bb, label %bb2 + +bb2: ; preds = %bb1 + %12 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %13 = getelementptr inbounds %struct.StructType* %12, i64 0 ; <%struct.StructType*> [#uses=2] + %14 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 0 ; [#uses=1] + %15 = getelementptr inbounds %struct.StructType* %13, i32 0, i32 0 ; [#uses=1] + %16 = load i32* %15, align 1 ; [#uses=1] + store i32 %16, i32* %14, align 1 + %17 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %18 = getelementptr inbounds %struct.StructType* %13, i32 0, i32 1 ; [#uses=1] + %19 = load i32** %18, align 1 ; [#uses=1] + store i32* %19, i32** %17, align 1 + %20 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %21 = load i32** %20, align 8 ; [#uses=1] + store i32* %21, i32** %c, align 8 + br label %return + +return: ; preds = %bb2 + ret void +} + +declare noalias i8* @malloc(i64) nounwind Added: poolalloc/trunk/test/dsa/local/arrays3.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays3.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays3.c (added) +++ poolalloc/trunk/test/dsa/local/arrays3.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,29 @@ +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + + +#include + +struct StructType { + + int a; + int *b; +}; + +void func() { + + struct StructType *tmp = (struct StructType*) malloc(sizeof(struct StructType)*10); + int i; + for(i=0;i<10;i++) { + tmp[i].a = i; + tmp[i].b = (int*) malloc(sizeof(int)); + } + + struct StructType s2 = tmp[1]; + int * c = s2.b; + struct StructType *ptr = &s2; + struct StructType *ptr1 = ptr + 1; + +} + Added: poolalloc/trunk/test/dsa/local/arrays3.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/arrays3.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/arrays3.ll (added) +++ poolalloc/trunk/test/dsa/local/arrays3.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,75 @@ +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:s2:0,func:c:0,func:tmp:0:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:ptr:0,func:ptr1:0,func:s2 + +; ModuleID = 'arrays3.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.StructType = type { i32, i32* } + +define void @func() nounwind { +entry: + %tmp = alloca %struct.StructType* ; <%struct.StructType**> [#uses=4] + %i = alloca i32 ; [#uses=7] + %s2 = alloca %struct.StructType ; <%struct.StructType*> [#uses=4] + %c = alloca i32* ; [#uses=1] + %ptr = alloca %struct.StructType* ; <%struct.StructType**> [#uses=2] + %ptr1 = alloca %struct.StructType* ; <%struct.StructType**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 160) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to %struct.StructType* ; <%struct.StructType*> [#uses=1] + store %struct.StructType* %1, %struct.StructType** %tmp, align 8 + store i32 0, i32* %i, align 4 + br label %bb1 + +bb: ; preds = %bb1 + %2 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %3 = load i32* %i, align 4 ; [#uses=1] + %4 = sext i32 %3 to i64 ; [#uses=1] + %5 = getelementptr inbounds %struct.StructType* %2, i64 %4 ; <%struct.StructType*> [#uses=1] + %6 = getelementptr inbounds %struct.StructType* %5, i32 0, i32 0 ; [#uses=1] + %7 = load i32* %i, align 4 ; [#uses=1] + store i32 %7, i32* %6, align 8 + %8 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %9 = load i32* %i, align 4 ; [#uses=1] + %10 = sext i32 %9 to i64 ; [#uses=1] + %11 = getelementptr inbounds %struct.StructType* %8, i64 %10 ; <%struct.StructType*> [#uses=1] + %12 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %13 = bitcast i8* %12 to i32* ; [#uses=1] + %14 = getelementptr inbounds %struct.StructType* %11, i32 0, i32 1 ; [#uses=1] + store i32* %13, i32** %14, align 8 + %15 = load i32* %i, align 4 ; [#uses=1] + %16 = add nsw i32 %15, 1 ; [#uses=1] + store i32 %16, i32* %i, align 4 + br label %bb1 + +bb1: ; preds = %bb, %entry + %17 = load i32* %i, align 4 ; [#uses=1] + %18 = icmp sle i32 %17, 9 ; [#uses=1] + br i1 %18, label %bb, label %bb2 + +bb2: ; preds = %bb1 + %19 = load %struct.StructType** %tmp, align 8 ; <%struct.StructType*> [#uses=1] + %20 = getelementptr inbounds %struct.StructType* %19, i64 1 ; <%struct.StructType*> [#uses=2] + %21 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 0 ; [#uses=1] + %22 = getelementptr inbounds %struct.StructType* %20, i32 0, i32 0 ; [#uses=1] + %23 = load i32* %22, align 1 ; [#uses=1] + store i32 %23, i32* %21, align 1 + %24 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %25 = getelementptr inbounds %struct.StructType* %20, i32 0, i32 1 ; [#uses=1] + %26 = load i32** %25, align 1 ; [#uses=1] + store i32* %26, i32** %24, align 1 + %27 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %28 = load i32** %27, align 8 ; [#uses=1] + store i32* %28, i32** %c, align 8 + store %struct.StructType* %s2, %struct.StructType** %ptr, align 8 + %29 = load %struct.StructType** %ptr, align 8 ; <%struct.StructType*> [#uses=1] + %30 = getelementptr inbounds %struct.StructType* %29, i64 1 ; <%struct.StructType*> [#uses=1] + store %struct.StructType* %30, %struct.StructType** %ptr1, align 8 + br label %return + +return: ; preds = %bb2 + ret void +} + +declare noalias i8* @malloc(i64) nounwind Added: poolalloc/trunk/test/dsa/local/ptr.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/ptr.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/ptr.c (added) +++ poolalloc/trunk/test/dsa/local/ptr.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,14 @@ + +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output +#include + +void func() { + int a = 10; + int *b = &a; + int **c = &b; + int *d = *c; + int e = *d; +} + Added: poolalloc/trunk/test/dsa/local/ptr.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/ptr.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/ptr.ll (added) +++ poolalloc/trunk/test/dsa/local/ptr.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,31 @@ + +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:b:0,func:a,func:d:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:c:0,func:b + + +; ModuleID = 'ptr.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +define void @func() nounwind { +entry: + %a = alloca i32 ; [#uses=2] + %b = alloca i32* ; [#uses=2] + %c = alloca i32** ; [#uses=2] + %d = alloca i32* ; [#uses=2] + %e = alloca i32 ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 10, i32* %a, align 4 + store i32* %a, i32** %b, align 8 + store i32** %b, i32*** %c, align 8 + %0 = load i32*** %c, align 8 ; [#uses=1] + %1 = load i32** %0, align 8 ; [#uses=1] + store i32* %1, i32** %d, align 8 + %2 = load i32** %d, align 8 ; [#uses=1] + %3 = load i32* %2, align 4 ; [#uses=1] + store i32 %3, i32* %e, align 4 + br label %return + +return: ; preds = %entry + ret void +} Added: poolalloc/trunk/test/dsa/local/ptr1.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/ptr1.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/ptr1.c (added) +++ poolalloc/trunk/test/dsa/local/ptr1.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,21 @@ + +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output +#include + +void func() { + int a = 10; + int a1 = 20; + int *b = &a; + int *b1 = &a1; + int **c; + if( a > a1) { + c = &b1; + } else { + c = &b; + } + int *d = *c; + int e = *d; +} + Added: poolalloc/trunk/test/dsa/local/ptr1.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/ptr1.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/ptr1.ll (added) +++ poolalloc/trunk/test/dsa/local/ptr1.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,48 @@ + +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:a,func:a1 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:a,func:b:0,func:b1:0,func:d:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:b,func:b1,func:c:0 + +; ModuleID = 'ptr1.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +define void @func() nounwind { +entry: + %a = alloca i32 ; [#uses=3] + %a1 = alloca i32 ; [#uses=3] + %b = alloca i32* ; [#uses=2] + %b1 = alloca i32* ; [#uses=2] + %c = alloca i32** ; [#uses=3] + %d = alloca i32* ; [#uses=2] + %e = alloca i32 ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 10, i32* %a, align 4 + store i32 20, i32* %a1, align 4 + store i32* %a, i32** %b, align 8 + store i32* %a1, i32** %b1, align 8 + %0 = load i32* %a, align 4 ; [#uses=1] + %1 = load i32* %a1, align 4 ; [#uses=1] + %2 = icmp sgt i32 %0, %1 ; [#uses=1] + br i1 %2, label %bb, label %bb1 + +bb: ; preds = %entry + store i32** %b1, i32*** %c, align 8 + br label %bb2 + +bb1: ; preds = %entry + store i32** %b, i32*** %c, align 8 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %3 = load i32*** %c, align 8 ; [#uses=1] + %4 = load i32** %3, align 8 ; [#uses=1] + store i32* %4, i32** %d, align 8 + %5 = load i32** %d, align 8 ; [#uses=1] + %6 = load i32* %5, align 4 ; [#uses=1] + store i32 %6, i32* %e, align 4 + br label %return + +return: ; preds = %bb2 + ret void +} Added: poolalloc/trunk/test/dsa/local/ptr2.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/ptr2.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/ptr2.c (added) +++ poolalloc/trunk/test/dsa/local/ptr2.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,24 @@ +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + + +#include + +void func() { + int a = 10; + int a1 = 20; + int *b = &a; + int *b1 = &a1; + int **c; + if( a > a1) { + c = &b1; + } else { + c = &b; + } + int *d = *c; + int e = *d; + int * f = d ; + int ** g = c; +} + Added: poolalloc/trunk/test/dsa/local/ptr2.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/ptr2.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/ptr2.ll (added) +++ poolalloc/trunk/test/dsa/local/ptr2.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,56 @@ + +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:a,func:a1,func:d:0,func:f:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:a,func:b:0,func:b1:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:b,func:b1 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:c:0,func:b,func:b1,func:g:0 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:c:0,func:b,func:b1,func:g:0 + +; ModuleID = 'ptr2.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +define void @func() nounwind { +entry: + %a = alloca i32 ; [#uses=3] + %a1 = alloca i32 ; [#uses=3] + %b = alloca i32* ; [#uses=2] + %b1 = alloca i32* ; [#uses=2] + %c = alloca i32** ; [#uses=4] + %d = alloca i32* ; [#uses=3] + %e = alloca i32 ; [#uses=1] + %f = alloca i32* ; [#uses=1] + %g = alloca i32** ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 10, i32* %a, align 4 + store i32 20, i32* %a1, align 4 + store i32* %a, i32** %b, align 8 + store i32* %a1, i32** %b1, align 8 + %0 = load i32* %a, align 4 ; [#uses=1] + %1 = load i32* %a1, align 4 ; [#uses=1] + %2 = icmp sgt i32 %0, %1 ; [#uses=1] + br i1 %2, label %bb, label %bb1 + +bb: ; preds = %entry + store i32** %b1, i32*** %c, align 8 + br label %bb2 + +bb1: ; preds = %entry + store i32** %b, i32*** %c, align 8 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %3 = load i32*** %c, align 8 ; [#uses=1] + %4 = load i32** %3, align 8 ; [#uses=1] + store i32* %4, i32** %d, align 8 + %5 = load i32** %d, align 8 ; [#uses=1] + %6 = load i32* %5, align 4 ; [#uses=1] + store i32 %6, i32* %e, align 4 + %7 = load i32** %d, align 8 ; [#uses=1] + store i32* %7, i32** %f, align 8 + %8 = load i32*** %c, align 8 ; [#uses=1] + store i32** %8, i32*** %g, align 8 + br label %return + +return: ; preds = %bb2 + ret void +} Added: poolalloc/trunk/test/dsa/local/struct.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/struct.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/struct.c (added) +++ poolalloc/trunk/test/dsa/local/struct.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,25 @@ + +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + + +#include + +struct StructType { + + int a; + int *b; +}; + +void func() { + + int *tmp = (int*) malloc(sizeof(int)); + struct StructType s1; + s1.a = 10; + s1.b = tmp; + + int *c = &s1.a; + struct StructType s2 = s1; +} + Added: poolalloc/trunk/test/dsa/local/struct.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/struct.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/struct.ll (added) +++ poolalloc/trunk/test/dsa/local/struct.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,43 @@ + +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:tmp:0,func:s2:8,func:s1:8 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:c:0,func:s1 + + +; ModuleID = 'struct.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.StructType = type { i32, i32* } + +define void @func() nounwind { +entry: + %tmp = alloca i32* ; [#uses=2] + %s1 = alloca %struct.StructType ; <%struct.StructType*> [#uses=5] + %c = alloca i32* ; [#uses=1] + %s2 = alloca %struct.StructType ; <%struct.StructType*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to i32* ; [#uses=1] + store i32* %1, i32** %tmp, align 8 + %2 = getelementptr inbounds %struct.StructType* %s1, i32 0, i32 0 ; [#uses=1] + store i32 10, i32* %2, align 8 + %3 = getelementptr inbounds %struct.StructType* %s1, i32 0, i32 1 ; [#uses=1] + %4 = load i32** %tmp, align 8 ; [#uses=1] + store i32* %4, i32** %3, align 8 + %5 = getelementptr inbounds %struct.StructType* %s1, i32 0, i32 0 ; [#uses=1] + store i32* %5, i32** %c, align 8 + %6 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 0 ; [#uses=1] + %7 = getelementptr inbounds %struct.StructType* %s1, i32 0, i32 0 ; [#uses=1] + %8 = load i32* %7, align 8 ; [#uses=1] + store i32 %8, i32* %6, align 8 + %9 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %10 = getelementptr inbounds %struct.StructType* %s1, i32 0, i32 1 ; [#uses=1] + %11 = load i32** %10, align 8 ; [#uses=1] + store i32* %11, i32** %9, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +declare noalias i8* @malloc(i64) nounwind Added: poolalloc/trunk/test/dsa/local/struct1.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/struct1.c?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/struct1.c (added) +++ poolalloc/trunk/test/dsa/local/struct1.c Tue Aug 17 16:53:59 2010 @@ -0,0 +1,25 @@ + +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + + +#include + +struct StructType { + + int a; + int *b; +}; + +void func() { + + int *tmp = (int*) malloc(sizeof(int)); + struct StructType* s1 = (struct StructType*) malloc(sizeof(struct StructType)); + s1->a = 10; + s1->b = tmp; + + int *c = &(s1->a); + struct StructType s2 = *s1; +} + Added: poolalloc/trunk/test/dsa/local/struct1.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/struct1.ll?rev=111301&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/struct1.ll (added) +++ poolalloc/trunk/test/dsa/local/struct1.ll Tue Aug 17 16:53:59 2010 @@ -0,0 +1,48 @@ +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:tmp:0,func:s2:8,func:s1:0:8,func:c:0:8 +;RUN: dsaopt %s -dsa-local -analyze -check-same-node=func:c:0,func:s1:0 + +; ModuleID = 'struct1.bc' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.StructType = type { i32, i32* } + +define void @func() nounwind { +entry: + %tmp = alloca i32* ; [#uses=2] + %s1 = alloca %struct.StructType* ; <%struct.StructType**> [#uses=5] + %c = alloca i32* ; [#uses=1] + %s2 = alloca %struct.StructType ; <%struct.StructType*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to i32* ; [#uses=1] + store i32* %1, i32** %tmp, align 8 + %2 = call noalias i8* @malloc(i64 16) nounwind ; [#uses=1] + %3 = bitcast i8* %2 to %struct.StructType* ; <%struct.StructType*> [#uses=1] + store %struct.StructType* %3, %struct.StructType** %s1, align 8 + %4 = load %struct.StructType** %s1, align 8 ; <%struct.StructType*> [#uses=1] + %5 = getelementptr inbounds %struct.StructType* %4, i32 0, i32 0 ; [#uses=1] + store i32 10, i32* %5, align 8 + %6 = load %struct.StructType** %s1, align 8 ; <%struct.StructType*> [#uses=1] + %7 = getelementptr inbounds %struct.StructType* %6, i32 0, i32 1 ; [#uses=1] + %8 = load i32** %tmp, align 8 ; [#uses=1] + store i32* %8, i32** %7, align 8 + %9 = load %struct.StructType** %s1, align 8 ; <%struct.StructType*> [#uses=1] + %10 = getelementptr inbounds %struct.StructType* %9, i32 0, i32 0 ; [#uses=1] + store i32* %10, i32** %c, align 8 + %11 = load %struct.StructType** %s1, align 8 ; <%struct.StructType*> [#uses=2] + %12 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 0 ; [#uses=1] + %13 = getelementptr inbounds %struct.StructType* %11, i32 0, i32 0 ; [#uses=1] + %14 = load i32* %13, align 8 ; [#uses=1] + store i32 %14, i32* %12, align 8 + %15 = getelementptr inbounds %struct.StructType* %s2, i32 0, i32 1 ; [#uses=1] + %16 = getelementptr inbounds %struct.StructType* %11, i32 0, i32 1 ; [#uses=1] + %17 = load i32** %16, align 8 ; [#uses=1] + store i32* %17, i32** %15, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +declare noalias i8* @malloc(i64) nounwind From bob.wilson at apple.com Tue Aug 17 17:00:21 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 17 Aug 2010 22:00:21 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111303 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Message-ID: <20100817220021.9D4EC2A6C12C@llvm.org> Author: bwilson Date: Tue Aug 17 17:00:21 2010 New Revision: 111303 URL: http://llvm.org/viewvc/llvm-project?rev=111303&view=rev Log: Reapply svn r110619 with a fix to also check TARGET_HARD_FLOAT. Radar 8284120. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=111303&r1=111302&r2=111303&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Tue Aug 17 17:00:21 2010 @@ -3508,8 +3508,13 @@ } \ if (TARGET_VFP3) \ F.AddFeature("vfp3"); \ - else \ + else { \ F.AddFeature("vfp3", false); \ + if (TARGET_VFP && TARGET_HARD_FLOAT) \ + F.AddFeature("vfp2"); \ + else \ + F.AddFeature("vfp2", false); \ + } \ if (TARGET_NEON) \ F.AddFeature("neon"); \ else \ From steinke-dirk at web.de Tue Aug 17 17:11:49 2010 From: steinke-dirk at web.de (Dirk Steinke) Date: Wed, 18 Aug 2010 00:11:49 +0200 Subject: [llvm-commits] [PATCH] InstCombine: Generalized patch for (icmp eq (A&B), C) & (icmp eq (A&D), E) Message-ID: <4C6B0925.1080701@web.de> Hi, a few weeks ago I volunteered to provide a more generalized form for one of Owens InstCombine transforms. Well, here it is. Sorry, I didn't run all tests to make sure that it doesn't break anything. My machine is currently not set up for that. (Basically it's just Visual Studio.) But all transforms have been tested and should not fire inappropriately. If there are any issues with the patch, I'll fix them. To Owen: Sorry for ripping out your original transform. But at least it's still in 2.8. ;-) Bye Dirk -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: foldmaskedicmp.diff Url: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/e3be1cdb/attachment.pl From dalej at apple.com Tue Aug 17 17:17:24 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 17 Aug 2010 22:17:24 -0000 Subject: [llvm-commits] [llvm] r111306 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp test/CodeGen/X86/pr7882.ll Message-ID: <20100817221724.CB4872A6C12E@llvm.org> Author: johannes Date: Tue Aug 17 17:17:24 2010 New Revision: 111306 URL: http://llvm.org/viewvc/llvm-project?rev=111306&view=rev Log: Make fast scheduler handle asm clobbers correctly. PR 7882. Follows suggestion by Amaury Pouly, thanks. Added: llvm/trunk/test/CodeGen/X86/pr7882.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp?rev=111306&r1=111305&r2=111306&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp Tue Aug 17 17:17:24 2010 @@ -13,6 +13,7 @@ #define DEBUG_TYPE "pre-RA-sched" #include "ScheduleDAGSDNodes.h" +#include "llvm/InlineAsm.h" #include "llvm/CodeGen/SchedulerRegistry.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -432,6 +433,30 @@ return N->getValueType(NumRes); } +/// CheckForLiveRegDef - Return true and update live register vector if the +/// specified register def of the specified SUnit clobbers any "live" registers. +static bool CheckForLiveRegDef(SUnit *SU, unsigned Reg, + std::vector &LiveRegDefs, + SmallSet &RegAdded, + SmallVector &LRegs, + const TargetRegisterInfo *TRI) { + bool Added = false; + if (LiveRegDefs[Reg] && LiveRegDefs[Reg] != SU) { + if (RegAdded.insert(Reg)) { + LRegs.push_back(Reg); + Added = true; + } + } + for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias) + if (LiveRegDefs[*Alias] && LiveRegDefs[*Alias] != SU) { + if (RegAdded.insert(*Alias)) { + LRegs.push_back(*Alias); + Added = true; + } + } + return Added; +} + /// DelayForLiveRegsBottomUp - Returns true if it is necessary to delay /// scheduling of the given node to satisfy live physical register dependencies. /// If the specific node is the last one that's available to schedule, do @@ -446,37 +471,44 @@ for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); I != E; ++I) { if (I->isAssignedRegDep()) { - unsigned Reg = I->getReg(); - if (LiveRegDefs[Reg] && LiveRegDefs[Reg] != I->getSUnit()) { - if (RegAdded.insert(Reg)) - LRegs.push_back(Reg); - } - for (const unsigned *Alias = TRI->getAliasSet(Reg); - *Alias; ++Alias) - if (LiveRegDefs[*Alias] && LiveRegDefs[*Alias] != I->getSUnit()) { - if (RegAdded.insert(*Alias)) - LRegs.push_back(*Alias); - } + CheckForLiveRegDef(I->getSUnit(), I->getReg(), LiveRegDefs, + RegAdded, LRegs, TRI); } } for (SDNode *Node = SU->getNode(); Node; Node = Node->getFlaggedNode()) { + if (Node->getOpcode() == ISD::INLINEASM) { + // Inline asm can clobber physical defs. + unsigned NumOps = Node->getNumOperands(); + if (Node->getOperand(NumOps-1).getValueType() == MVT::Flag) + --NumOps; // Ignore the flag operand. + + for (unsigned i = InlineAsm::Op_FirstOperand; i != NumOps;) { + unsigned Flags = + cast(Node->getOperand(i))->getZExtValue(); + unsigned NumVals = InlineAsm::getNumOperandRegisters(Flags); + + ++i; // Skip the ID value. + if (InlineAsm::isRegDefKind(Flags) || + InlineAsm::isRegDefEarlyClobberKind(Flags)) { + // Check for def of register or earlyclobber register. + for (; NumVals; --NumVals, ++i) { + unsigned Reg = cast(Node->getOperand(i))->getReg(); + if (TargetRegisterInfo::isPhysicalRegister(Reg)) + CheckForLiveRegDef(SU, Reg, LiveRegDefs, RegAdded, LRegs, TRI); + } + } else + i += NumVals; + } + continue; + } if (!Node->isMachineOpcode()) continue; const TargetInstrDesc &TID = TII->get(Node->getMachineOpcode()); if (!TID.ImplicitDefs) continue; for (const unsigned *Reg = TID.ImplicitDefs; *Reg; ++Reg) { - if (LiveRegDefs[*Reg] && LiveRegDefs[*Reg] != SU) { - if (RegAdded.insert(*Reg)) - LRegs.push_back(*Reg); - } - for (const unsigned *Alias = TRI->getAliasSet(*Reg); - *Alias; ++Alias) - if (LiveRegDefs[*Alias] && LiveRegDefs[*Alias] != SU) { - if (RegAdded.insert(*Alias)) - LRegs.push_back(*Alias); - } + CheckForLiveRegDef(SU, *Reg, LiveRegDefs, RegAdded, LRegs, TRI); } } return !LRegs.empty(); Added: llvm/trunk/test/CodeGen/X86/pr7882.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr7882.ll?rev=111306&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/pr7882.ll (added) +++ llvm/trunk/test/CodeGen/X86/pr7882.ll Tue Aug 17 17:17:24 2010 @@ -0,0 +1,17 @@ +; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin -pre-RA-sched=fast \ +; RUN: | FileCheck %s +; make sure scheduler honors the flags clobber. PR 7882. + +define i32 @main(i32 %argc, i8** %argv) nounwind +{ +entry: +; CHECK: InlineAsm End +; CHECK: cmpl + %res = icmp slt i32 1, %argc + %tmp = call i32 asm sideeffect alignstack + "push $$0 + popf + mov $$13, $0", "=r,r,~{memory},~{flags}" (i1 %res) + %ret = select i1 %res, i32 %tmp, i32 42 + ret i32 %ret +} From daniel at zuster.org Tue Aug 17 17:32:34 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 17 Aug 2010 22:32:34 -0000 Subject: [llvm-commits] [llvm] r111307 - in /llvm/trunk: include/llvm/Support/CrashRecoveryContext.h lib/Support/CrashRecoveryContext.cpp Message-ID: <20100817223234.4D9992A6C12E@llvm.org> Author: ddunbar Date: Tue Aug 17 17:32:34 2010 New Revision: 111307 URL: http://llvm.org/viewvc/llvm-project?rev=111307&view=rev Log: CrashRecovery: Make CrashRecoveryContext static methods thread safe. Modified: llvm/trunk/include/llvm/Support/CrashRecoveryContext.h llvm/trunk/lib/Support/CrashRecoveryContext.cpp Modified: llvm/trunk/include/llvm/Support/CrashRecoveryContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CrashRecoveryContext.h?rev=111307&r1=111306&r2=111307&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CrashRecoveryContext.h (original) +++ llvm/trunk/include/llvm/Support/CrashRecoveryContext.h Tue Aug 17 17:32:34 2010 @@ -47,12 +47,10 @@ CrashRecoveryContext() : Impl(0) {} ~CrashRecoveryContext(); - /// \brief Enable crash recovery. This function is not thread safe, clients - /// should call it during startup or with a lock held. + /// \brief Enable crash recovery. static void Enable(); - /// \brief Disable crash recovery. This function is not thread safe, clients - /// should call it during startup or with a lock held. + /// \brief Disable crash recovery. static void Disable(); /// \brief Execute the provide callback function (with the given arguments) in Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CrashRecoveryContext.cpp?rev=111307&r1=111306&r2=111307&view=diff ============================================================================== --- llvm/trunk/lib/Support/CrashRecoveryContext.cpp (original) +++ llvm/trunk/lib/Support/CrashRecoveryContext.cpp Tue Aug 17 17:32:34 2010 @@ -10,6 +10,7 @@ #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/ADT/SmallString.h" #include "llvm/Config/config.h" +#include "llvm/System/Mutex.h" #include "llvm/System/ThreadLocal.h" #include #include @@ -47,6 +48,7 @@ } +static sys::Mutex gCrashRecoveryContexMutex; static bool gCrashRecoveryEnabled = false; CrashRecoveryContext::~CrashRecoveryContext() { @@ -59,6 +61,8 @@ // FIXME: No real Win32 implementation currently. void CrashRecoveryContext::Enable() { + sys::ScopedLock L(gCrashRecoveryContexMutex); + if (gCrashRecoveryEnabled) return; @@ -66,6 +70,8 @@ } void CrashRecoveryContext::Disable() { + sys::ScopedLock L(gCrashRecoveryContexMutex); + if (!gCrashRecoveryEnabled) return; @@ -121,6 +127,8 @@ } void CrashRecoveryContext::Enable() { + sys::ScopedLock L(gCrashRecoveryContexMutex); + if (gCrashRecoveryEnabled) return; @@ -138,6 +146,8 @@ } void CrashRecoveryContext::Disable() { + sys::ScopedLock L(gCrashRecoveryContexMutex); + if (!gCrashRecoveryEnabled) return; From daniel at zuster.org Tue Aug 17 17:32:37 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 17 Aug 2010 22:32:37 -0000 Subject: [llvm-commits] [llvm] r111308 - in /llvm/trunk: include/llvm/Support/CrashRecoveryContext.h lib/Support/CrashRecoveryContext.cpp Message-ID: <20100817223237.99F172A6C12F@llvm.org> Author: ddunbar Date: Tue Aug 17 17:32:37 2010 New Revision: 111308 URL: http://llvm.org/viewvc/llvm-project?rev=111308&view=rev Log: CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find the active context from anywhere. Modified: llvm/trunk/include/llvm/Support/CrashRecoveryContext.h llvm/trunk/lib/Support/CrashRecoveryContext.cpp Modified: llvm/trunk/include/llvm/Support/CrashRecoveryContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CrashRecoveryContext.h?rev=111308&r1=111307&r2=111308&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CrashRecoveryContext.h (original) +++ llvm/trunk/include/llvm/Support/CrashRecoveryContext.h Tue Aug 17 17:32:37 2010 @@ -53,6 +53,10 @@ /// \brief Disable crash recovery. static void Disable(); + /// \brief Return the active context, if the code is currently executing in a + /// thread which is in a protected context. + static CrashRecoveryContext *GetCurrent(); + /// \brief Execute the provide callback function (with the given arguments) in /// a protected context. /// Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CrashRecoveryContext.cpp?rev=111308&r1=111307&r2=111308&view=diff ============================================================================== --- llvm/trunk/lib/Support/CrashRecoveryContext.cpp (original) +++ llvm/trunk/lib/Support/CrashRecoveryContext.cpp Tue Aug 17 17:32:37 2010 @@ -23,12 +23,14 @@ static sys::ThreadLocal CurrentContext; struct CrashRecoveryContextImpl { + CrashRecoveryContext *CRC; std::string Backtrace; ::jmp_buf JumpBuffer; volatile unsigned Failed : 1; public: - CrashRecoveryContextImpl() : Failed(false) { + CrashRecoveryContextImpl(CrashRecoveryContext *CRC) : CRC(CRC), + Failed(false) { CurrentContext.set(this); } ~CrashRecoveryContextImpl() { @@ -56,6 +58,14 @@ delete CRCI; } +CrashRecoveryContext *CrashRecoveryContext::GetCurrent() { + const CrashRecoveryContextImpl *CRCI = CurrentContext.get(); + if (!CRCI) + return 0; + + return CRCI->CRC; +} + #ifdef LLVM_ON_WIN32 // FIXME: No real Win32 implementation currently. @@ -164,7 +174,7 @@ // If crash recovery is disabled, do nothing. if (gCrashRecoveryEnabled) { assert(!Impl && "Crash recovery context already initialized!"); - CrashRecoveryContextImpl *CRCI = new CrashRecoveryContextImpl; + CrashRecoveryContextImpl *CRCI = new CrashRecoveryContextImpl(this); Impl = CRCI; if (setjmp(CRCI->JumpBuffer) != 0) { From daniel at zuster.org Tue Aug 17 17:32:39 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 17 Aug 2010 22:32:39 -0000 Subject: [llvm-commits] [llvm] r111309 - /llvm/trunk/lib/Support/CrashRecoveryContext.cpp Message-ID: <20100817223239.F26AA2A6C130@llvm.org> Author: ddunbar Date: Tue Aug 17 17:32:39 2010 New Revision: 111309 URL: http://llvm.org/viewvc/llvm-project?rev=111309&view=rev Log: CrashRecovery: Clear the current context on the first crash, to avoid re-entering it if the cleanup code crashes. Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CrashRecoveryContext.cpp?rev=111309&r1=111308&r2=111309&view=diff ============================================================================== --- llvm/trunk/lib/Support/CrashRecoveryContext.cpp (original) +++ llvm/trunk/lib/Support/CrashRecoveryContext.cpp Tue Aug 17 17:32:39 2010 @@ -38,6 +38,10 @@ } void HandleCrash() { + // Eliminate the current context entry, to avoid re-entering in case the + // cleanup code crashes. + CurrentContext.erase(); + assert(!Failed && "Crash recovery context already failed!"); Failed = true; From evan.cheng at apple.com Tue Aug 17 17:35:20 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 17 Aug 2010 22:35:20 -0000 Subject: [llvm-commits] [llvm] r111312 - /llvm/trunk/test/CodeGen/X86/phi-immediate-factoring.ll Message-ID: <20100817223520.D7A5A2A6C12E@llvm.org> Author: evancheng Date: Tue Aug 17 17:35:20 2010 New Revision: 111312 URL: http://llvm.org/viewvc/llvm-project?rev=111312&view=rev Log: Add nounwind. Modified: llvm/trunk/test/CodeGen/X86/phi-immediate-factoring.ll Modified: llvm/trunk/test/CodeGen/X86/phi-immediate-factoring.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/phi-immediate-factoring.ll?rev=111312&r1=111311&r2=111312&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/phi-immediate-factoring.ll (original) +++ llvm/trunk/test/CodeGen/X86/phi-immediate-factoring.ll Tue Aug 17 17:35:20 2010 @@ -4,7 +4,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" target triple = "i686-apple-darwin8" -define i32 @foo(i32 %A, i32 %B, i32 %C) { +define i32 @foo(i32 %A, i32 %B, i32 %C) nounwind { entry: switch i32 %A, label %out [ i32 1, label %bb From grosbach at apple.com Tue Aug 17 17:41:55 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 17 Aug 2010 22:41:55 -0000 Subject: [llvm-commits] [llvm] r111315 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/CodeGen/PrologEpilogInserter.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h Message-ID: <20100817224155.5E2802A6C130@llvm.org> Author: grosbach Date: Tue Aug 17 17:41:55 2010 New Revision: 111315 URL: http://llvm.org/viewvc/llvm-project?rev=111315&view=rev Log: Add materialization of virtual base registers for frame indices allocated into the local block. Resolve references to those indices to a new base register. For simplification and testing purposes, a new virtual base register is allocated for each frame index being resolved. The result is truly horrible, but correct, code that's good for exercising the new code paths. Next up is adding thumb1 support, which should be very simple. Following that will be adding base register re-use and implementing a reasonable ARM heuristic for when a virtual base register should be generated at all. Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111315&r1=111314&r2=111315&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Tue Aug 17 17:41:55 2010 @@ -644,6 +644,22 @@ return false; } + /// materializeFrameBaseRegister - Insert defining instruction(s) for + /// BaseReg to be a pointer to FrameIdx before insertion point I. + virtual void materializeFrameBaseRegister(MachineBasicBlock::iterator I, + unsigned BaseReg, + int FrameIdx) const { + assert(0 && "materializeFrameBaseRegister does not exist on this target"); + } + + /// resolveFrameIndex - Resolve a frame index operand of an instruction + /// to reference the indicated base register plus offset instead. + virtual void resolveFrameIndex(MachineBasicBlock::iterator I, + unsigned BaseReg, int64_t Offset) const { + assert(0 && "resolveFrameIndex does not exist on this target"); + } + + /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the /// frame setup/destroy instructions if they exist (-1 otherwise). Some /// targets use pseudo instructions in order to abstract away the difference Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111315&r1=111314&r2=111315&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Tue Aug 17 17:41:55 2010 @@ -27,6 +27,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" @@ -160,6 +161,14 @@ E = Fn.end(); BB != E; ++BB) { for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { MachineInstr *MI = I; + // Debug value instructions can't be out of range, so they don't need + // any updates. + // FIXME: When we extend this stuff to handle functions with both + // VLAs and dynamic realignment, we should update the debug values + // to reference the new base pointer when possible. + if (MI->isDebugValue()) + continue; + // For now, allocate the base register(s) within the basic block // where they're used, and don't try to keep them around outside // of that. It may be beneficial to try sharing them more broadly @@ -169,8 +178,12 @@ for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { // Consider replacing all frame index operands that reference // an object allocated in the local block. - if (MI->getOperand(i).isFI() && - MFI->isObjectPreAllocated(MI->getOperand(i).getIndex())) { + if (MI->getOperand(i).isFI()) { + int FrameIdx = MI->getOperand(i).getIndex(); + // Don't try this with values not in the local block. + if (!MFI->isObjectPreAllocated(FrameIdx)) + continue; + DEBUG(dbgs() << "Considering: " << *MI); if (TRI->needsFrameBaseReg(MI, i)) { DEBUG(dbgs() << " Replacing FI in: " << *MI); @@ -182,6 +195,17 @@ // create a new one. // FIXME: For the moment, just always create a new one. + const TargetRegisterClass *RC = TRI->getPointerRegClass(); + unsigned BaseReg = Fn.getRegInfo().createVirtualRegister(RC); + + // Tell the target to insert the instruction to initialize + // the base register. + TRI->materializeFrameBaseRegister(I, BaseReg, FrameIdx); + + // Modify the instruction to use the new base register rather + // than the frame index operand. + TRI->resolveFrameIndex(I, BaseReg, 0); + ++NumBaseRegisters; ++NumReplacements; } Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=111315&r1=111314&r2=111315&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Tue Aug 17 17:41:55 2010 @@ -560,7 +560,7 @@ // check for whether the frame is large enough to want to use virtual // frame index registers. Functions which don't want/need this optimization // will continue to use the existing code path. - if (EnableLocalStackAlloc) { + if (EnableLocalStackAlloc && MFI->getLocalFrameSize()) { unsigned Align = MFI->getLocalFrameMaxAlign(); // Adjust to alignment boundary. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=111315&r1=111314&r2=111315&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Tue Aug 17 17:41:55 2010 @@ -1407,6 +1407,49 @@ } } +/// materializeFrameBaseRegister - Insert defining instruction(s) for +/// BaseReg to be a pointer to FrameIdx before insertion point I. +void ARMBaseRegisterInfo:: +materializeFrameBaseRegister(MachineBasicBlock::iterator I, + unsigned BaseReg, int FrameIdx) const { + ARMFunctionInfo *AFI = + I->getParent()->getParent()->getInfo(); + unsigned ADDriOpc = !AFI->isThumbFunction() ? ARM::ADDri : ARM::t2ADDri; + assert(!AFI->isThumb1OnlyFunction() && + "This materializeFrameBaseRegister does not support Thumb1!"); + + MachineInstrBuilder MIB = + BuildMI(*I->getParent(), I, I->getDebugLoc(), TII.get(ADDriOpc), BaseReg) + .addFrameIndex(FrameIdx).addImm(0); + AddDefaultCC(AddDefaultPred(MIB)); +} + +void +ARMBaseRegisterInfo::resolveFrameIndex(MachineBasicBlock::iterator I, + unsigned BaseReg, int64_t Offset) const { + MachineInstr &MI = *I; + MachineBasicBlock &MBB = *MI.getParent(); + MachineFunction &MF = *MBB.getParent(); + ARMFunctionInfo *AFI = MF.getInfo(); + int Off = Offset; // ARM doesn't need the general 64-bit offsets + unsigned i = 0; + + assert(!AFI->isThumb1OnlyFunction() && + "This resolveFrameIndex does not support Thumb1!"); + + while (!MI.getOperand(i).isFI()) { + ++i; + assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!"); + } + bool Done = false; + if (!AFI->isThumbFunction()) + Done = rewriteARMFrameIndex(MI, i, BaseReg, Off, TII); + else { + assert(AFI->isThumb2Function()); + Done = rewriteT2FrameIndex(MI, i, BaseReg, Off, TII); + } + assert (Done && "Unable to resolve frame index!"); +} unsigned ARMBaseRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=111315&r1=111314&r2=111315&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Tue Aug 17 17:41:55 2010 @@ -106,6 +106,10 @@ bool canRealignStack(const MachineFunction &MF) const; bool needsStackRealignment(const MachineFunction &MF) const; bool needsFrameBaseReg(MachineInstr *MI, unsigned operand) const; + void materializeFrameBaseRegister(MachineBasicBlock::iterator I, + unsigned BaseReg, int FrameIdx) const; + void resolveFrameIndex(MachineBasicBlock::iterator I, + unsigned BaseReg, int64_t Offset) const; bool cannotEliminateFrame(const MachineFunction &MF) const; From gohman at apple.com Tue Aug 17 17:50:37 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 17 Aug 2010 22:50:37 -0000 Subject: [llvm-commits] [llvm] r111317 - in /llvm/trunk: lib/Analysis/IVUsers.cpp test/CodeGen/X86/licm-nested.ll test/CodeGen/X86/lsr-interesting-step.ll Message-ID: <20100817225037.A022F2A6C12E@llvm.org> Author: djg Date: Tue Aug 17 17:50:37 2010 New Revision: 111317 URL: http://llvm.org/viewvc/llvm-project?rev=111317&view=rev Log: Tweak IVUsers' concept of "interesting" to exclude add recurrences where the step value is an induction variable from an outer loop, to avoid trouble trying to re-expand such expressions. This effectively hides such expressions from indvars and lsr, which prevents them from getting into trouble. Added: llvm/trunk/test/CodeGen/X86/lsr-interesting-step.ll Modified: llvm/trunk/lib/Analysis/IVUsers.cpp llvm/trunk/test/CodeGen/X86/licm-nested.ll Modified: llvm/trunk/lib/Analysis/IVUsers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=111317&r1=111316&r2=111317&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IVUsers.cpp (original) +++ llvm/trunk/lib/Analysis/IVUsers.cpp Tue Aug 17 17:50:37 2010 @@ -38,27 +38,31 @@ /// isInteresting - Test whether the given expression is "interesting" when /// used by the given expression, within the context of analyzing the /// given loop. -static bool isInteresting(const SCEV *S, const Instruction *I, const Loop *L) { - // Anything loop-invariant is interesting. - if (!isa(S) && S->isLoopInvariant(L)) - return true; - +static bool isInteresting(const SCEV *S, const Instruction *I, const Loop *L, + ScalarEvolution *SE) { // An addrec is interesting if it's affine or if it has an interesting start. if (const SCEVAddRecExpr *AR = dyn_cast(S)) { // Keep things simple. Don't touch loop-variant strides. if (AR->getLoop() == L) return AR->isAffine() || !L->contains(I); - // Otherwise recurse to see if the start value is interesting. - return isInteresting(AR->getStart(), I, L); + // Otherwise recurse to see if the start value is interesting, and that + // the step value is not interesting, since we don't yet know how to + // do effective SCEV expansions for addrecs with interesting steps. + return isInteresting(AR->getStart(), I, L, SE) && + !isInteresting(AR->getStepRecurrence(*SE), I, L, SE); } - // An add is interesting if any of its operands is. + // An add is interesting if exactly one of its operands is interesting. if (const SCEVAddExpr *Add = dyn_cast(S)) { + bool AnyInterestingYet = false; for (SCEVAddExpr::op_iterator OI = Add->op_begin(), OE = Add->op_end(); OI != OE; ++OI) - if (isInteresting(*OI, I, L)) - return true; - return false; + if (isInteresting(*OI, I, L, SE)) { + if (AnyInterestingYet) + return false; + AnyInterestingYet = true; + } + return AnyInterestingYet; } // Nothing else is interesting here. @@ -84,7 +88,7 @@ // If we've come to an uninteresting expression, stop the traversal and // call this a user. - if (!isInteresting(ISE, I, L)) + if (!isInteresting(ISE, I, L, SE)) return false; SmallPtrSet UniqueUsers; Modified: llvm/trunk/test/CodeGen/X86/licm-nested.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/licm-nested.ll?rev=111317&r1=111316&r2=111317&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/licm-nested.ll (original) +++ llvm/trunk/test/CodeGen/X86/licm-nested.ll Tue Aug 17 17:50:37 2010 @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=x86_64-apple-darwin -march=x86-64 < %s -stats -info-output-file - | grep machine-licm | grep 2 +; RUN: llc -mtriple=x86_64-apple-darwin -march=x86-64 < %s -stats -info-output-file - | grep machine-licm | grep 3 ; MachineLICM should be able to hoist the symbolic addresses out of ; the inner loops. Added: llvm/trunk/test/CodeGen/X86/lsr-interesting-step.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/lsr-interesting-step.ll?rev=111317&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/lsr-interesting-step.ll (added) +++ llvm/trunk/test/CodeGen/X86/lsr-interesting-step.ll Tue Aug 17 17:50:37 2010 @@ -0,0 +1,51 @@ +; RUN: llc < %s -march=x86-64 -relocation-model=static -mtriple=x86_64-unknown-linux-gnu + +; The inner loop should require only one add (and no leas either). +; rdar://8100380 + +; CHECK: BB0_4: +; CHECK-NEXT: movb $0, flags(%rdx) +; CHECK-NEXT: addq %rcx, %rdx +; CHECK-NEXT: cmpq $8192, %rdx +; CHECK-NEXT: jl + + at flags = external global [8192 x i8], align 16 ; <[8192 x i8]*> [#uses=1] + +define void @foo() nounwind { +entry: + %tmp = icmp slt i64 2, 8192 ; [#uses=1] + br i1 %tmp, label %bb, label %bb21 + +bb: ; preds = %entry + br label %bb7 + +bb7: ; preds = %bb, %bb17 + %tmp8 = phi i64 [ %tmp18, %bb17 ], [ 2, %bb ] ; [#uses=2] + %tmp9 = icmp slt i64 2, 8192 ; [#uses=1] + br i1 %tmp9, label %bb10, label %bb17 + +bb10: ; preds = %bb7 + br label %bb11 + +bb11: ; preds = %bb10, %bb11 + %tmp12 = phi i64 [ %tmp14, %bb11 ], [ 2, %bb10 ] ; [#uses=2] + %tmp13 = getelementptr inbounds [8192 x i8]* @flags, i64 0, i64 %tmp12 ; [#uses=1] + store i8 0, i8* %tmp13, align 1 + %tmp14 = add nsw i64 %tmp12, %tmp8 ; [#uses=2] + %tmp15 = icmp slt i64 %tmp14, 8192 ; [#uses=1] + br i1 %tmp15, label %bb11, label %bb16 + +bb16: ; preds = %bb11 + br label %bb17 + +bb17: ; preds = %bb16, %bb7 + %tmp18 = add nsw i64 %tmp8, 1 ; [#uses=2] + %tmp19 = icmp slt i64 %tmp18, 8192 ; [#uses=1] + br i1 %tmp19, label %bb7, label %bb20 + +bb20: ; preds = %bb17 + br label %bb21 + +bb21: ; preds = %bb20, %entry + ret void +} From echristo at apple.com Tue Aug 17 17:55:27 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 17 Aug 2010 22:55:27 -0000 Subject: [llvm-commits] [llvm] r111318 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineVectorOps.cpp test/Transforms/InstCombine/vec_shuffle.ll Message-ID: <20100817225527.C99542A6C12C@llvm.org> Author: echristo Date: Tue Aug 17 17:55:27 2010 New Revision: 111318 URL: http://llvm.org/viewvc/llvm-project?rev=111318&view=rev Log: Temporarily revert r110987 as it's causing some miscompares in vector heavy code. I'll re-enable when we've tracked down the problem. Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp?rev=111318&r1=111317&r2=111318&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp Tue Aug 17 17:55:27 2010 @@ -448,8 +448,10 @@ if (isa(SVI.getOperand(2))) return ReplaceInstUsesWith(SVI, UndefValue::get(SVI.getType())); - unsigned VWidth = Mask.size(); - unsigned LHSWidth = cast(LHS->getType())->getNumElements(); + unsigned VWidth = cast(SVI.getType())->getNumElements(); + + if (VWidth != cast(LHS->getType())->getNumElements()) + return 0; APInt UndefElts(VWidth, 0); APInt AllOnesEltMask(APInt::getAllOnesValue(VWidth)); @@ -462,12 +464,14 @@ // Canonicalize shuffle(x ,x,mask) -> shuffle(x, undef,mask') // Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask'). if (LHS == RHS || isa(LHS)) { - if (isa(LHS) && LHS == RHS) - return ReplaceInstUsesWith(SVI, UndefValue::get(SVI.getType())); + if (isa(LHS) && LHS == RHS) { + // shuffle(undef,undef,mask) -> undef. + return ReplaceInstUsesWith(SVI, LHS); + } // Remap any references to RHS to use LHS. std::vector Elts; - for (unsigned i = 0, e = LHSWidth; i != VWidth; ++i) { + for (unsigned i = 0, e = Mask.size(); i != e; ++i) { if (Mask[i] >= 2*e) Elts.push_back(UndefValue::get(Type::getInt32Ty(SVI.getContext()))); else { @@ -491,130 +495,67 @@ } // Analyze the shuffle, are the LHS or RHS and identity shuffles? - if (VWidth == LHSWidth) { - bool isLHSID = true, isRHSID = true; - - for (unsigned i = 0, e = Mask.size(); i != e; ++i) { - if (Mask[i] >= e*2) continue; // Ignore undef values. - // Is this an identity shuffle of the LHS value? - isLHSID &= (Mask[i] == i); - - // Is this an identity shuffle of the RHS value? - isRHSID &= (Mask[i]-e == i); - } - - // Eliminate identity shuffles. - if (isLHSID) return ReplaceInstUsesWith(SVI, LHS); - if (isRHSID) return ReplaceInstUsesWith(SVI, RHS); - } + bool isLHSID = true, isRHSID = true; - // Check for a handful of important shuffle(shuffle()) combinations. - ShuffleVectorInst *LSVI = dyn_cast(LHS); - if (!LSVI) - return MadeChange ? &SVI : 0; - - LHS = LSVI->getOperand(0); - std::vector LHSMask = getShuffleMask(LSVI); - unsigned LHSInNElts = cast(LHS->getType())->getNumElements(); - - // If the LHS is an identity shuffle, or if SVI + LHS form a full unpack - // operation, merge the LHS and SVI shuffles. This allows llvm to emit - // efficient code for matrix transposes written with generic vector ops. - bool isLHSLoExtract = true, isLHSHiExtract = true; - bool isUnpackLo = isPowerOf2_32(VWidth); - bool isUnpackHi = isPowerOf2_32(VWidth); - for (unsigned i = 0, e = LHSMask.size(); i != e; ++i) { - if (LHSMask[i] >= LHSInNElts*2) continue; // Ignore undef values; - isLHSLoExtract &= (LHSMask[i] == i); - isLHSHiExtract &= (LHSMask[i] == i+(LHSInNElts/2)); - isUnpackLo &= (LHSMask[i] == (i/2)); - isUnpackHi &= (LHSMask[i] == (i/2) + (e/2)); - } - for (unsigned i = 0, e = Mask.size(); i != e && (isUnpackLo || isUnpackHi); - i += 2) { - isUnpackLo &= (Mask[i] == i) && (Mask[i+1] == (i/2)+e); - isUnpackHi &= (Mask[i] == i) && (Mask[i+1] == (i/2)+e+(e/2)); - } - if ((isLHSLoExtract || isLHSHiExtract || isUnpackLo || isUnpackHi) && - (isa(RHS) || (LHSWidth == LHSInNElts))) { - std::vector Elts; - for (unsigned i = 0, e = VWidth; i != e; ++i) { - if (Mask[i] >= 2*LHSWidth) - Elts.push_back(UndefValue::get(Type::getInt32Ty(SVI.getContext()))); - else if (Mask[i] >= e) - Elts.push_back(ConstantInt::get(Type::getInt32Ty(SVI.getContext()), - Mask[i])); - else - Elts.push_back(ConstantInt::get(Type::getInt32Ty(SVI.getContext()), - LHSMask[Mask[i]])); - } - if (isa(RHS)) - RHS = UndefValue::get(LHS->getType()); - return new ShuffleVectorInst(LHS, RHS, ConstantVector::get(Elts)); - } - - // If rhs is shuffle + identity, propagate. - if (ShuffleVectorInst *RSVI = dyn_cast(RHS)) { - std::vector RHSMask = getShuffleMask(RSVI); - unsigned RHSInNElts = - cast(RSVI->getOperand(0)->getType())->getNumElements(); - - // If rhs is identity, propagate - bool isRHSLoExtract = true, isRHSHiExtract = true; - for (unsigned i = 0, e = RHSMask.size(); i != e; ++i) { - if (RHSMask[i] >= RHSInNElts*2) continue; // Ignore undef values; - isRHSLoExtract &= (RHSMask[i] == i); - isRHSHiExtract &= (RHSMask[i] == i+(RHSInNElts/2)); - } - if ((isRHSLoExtract || isRHSHiExtract) && (LHSWidth == RHSInNElts)) { - std::vector Elts; - for (unsigned i = 0, e = VWidth; i != e; ++i) { - if (Mask[i] >= 2*LHSWidth) - Elts.push_back(UndefValue::get(Type::getInt32Ty(SVI.getContext()))); - else if (Mask[i] < LHSWidth) - Elts.push_back(ConstantInt::get(Type::getInt32Ty(SVI.getContext()), - Mask[i])); - else - Elts.push_back(ConstantInt::get(Type::getInt32Ty(SVI.getContext()), - RHSMask[Mask[i]-LHSWidth]+LHSWidth)); - } - SVI.setOperand(1, RSVI->getOperand(0)); - SVI.setOperand(2, ConstantVector::get(Elts)); - return &SVI; - } + for (unsigned i = 0, e = Mask.size(); i != e; ++i) { + if (Mask[i] >= e*2) continue; // Ignore undef values. + // Is this an identity shuffle of the LHS value? + isLHSID &= (Mask[i] == i); + + // Is this an identity shuffle of the RHS value? + isRHSID &= (Mask[i]-e == i); } - // Be extremely conservative when merging shufflevector instructions. It is - // difficult for the code generator to recognize a merged shuffle, which - // usually leads to worse code from merging a shuffle. - if (!isa(RHS)) - return MadeChange ? &SVI : 0; - - // If the merged shuffle mask is one of the two input shuffle masks, which - // just removes one instruction. This should handle splat(splat) -> splat. - if (LHSMask.size() == Mask.size()) { - std::vector NewMask; - for (unsigned i = 0, e = Mask.size(); i != e; ++i) - if (Mask[i] >= e) - NewMask.push_back(2*e); - else - NewMask.push_back(LHSMask[Mask[i]]); - - // If the result mask is equal to the src shuffle or this shuffle mask, - // do the replacement. - if (NewMask == LHSMask || NewMask == Mask) { - std::vector Elts; - for (unsigned i = 0, e = NewMask.size(); i != e; ++i) { - if (NewMask[i] >= LHSInNElts*2) { - Elts.push_back(UndefValue::get(Type::getInt32Ty(SVI.getContext()))); - } else { - Elts.push_back(ConstantInt::get(Type::getInt32Ty(SVI.getContext()), - NewMask[i])); + // Eliminate identity shuffles. + if (isLHSID) return ReplaceInstUsesWith(SVI, LHS); + if (isRHSID) return ReplaceInstUsesWith(SVI, RHS); + + // If the LHS is a shufflevector itself, see if we can combine it with this + // one without producing an unusual shuffle. Here we are really conservative: + // we are absolutely afraid of producing a shuffle mask not in the input + // program, because the code gen may not be smart enough to turn a merged + // shuffle into two specific shuffles: it may produce worse code. As such, + // we only merge two shuffles if the result is one of the two input shuffle + // masks. In this case, merging the shuffles just removes one instruction, + // which we know is safe. This is good for things like turning: + // (splat(splat)) -> splat. + if (ShuffleVectorInst *LHSSVI = dyn_cast(LHS)) { + if (isa(RHS)) { + std::vector LHSMask = getShuffleMask(LHSSVI); + + if (LHSMask.size() == Mask.size()) { + std::vector NewMask; + for (unsigned i = 0, e = Mask.size(); i != e; ++i) + if (Mask[i] >= e) + NewMask.push_back(2*e); + else + NewMask.push_back(LHSMask[Mask[i]]); + + // If the result mask is equal to the src shuffle or this + // shuffle mask, do the replacement. + if (NewMask == LHSMask || NewMask == Mask) { + unsigned LHSInNElts = + cast(LHSSVI->getOperand(0)->getType())-> + getNumElements(); + std::vector Elts; + for (unsigned i = 0, e = NewMask.size(); i != e; ++i) { + if (NewMask[i] >= LHSInNElts*2) { + Elts.push_back(UndefValue::get( + Type::getInt32Ty(SVI.getContext()))); + } else { + Elts.push_back(ConstantInt::get( + Type::getInt32Ty(SVI.getContext()), + NewMask[i])); + } + } + return new ShuffleVectorInst(LHSSVI->getOperand(0), + LHSSVI->getOperand(1), + ConstantVector::get(Elts)); } } - return new ShuffleVectorInst(LHS, LSVI->getOperand(1), - ConstantVector::get(Elts)); } } + return MadeChange ? &SVI : 0; } + Modified: llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll?rev=111318&r1=111317&r2=111318&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll Tue Aug 17 17:55:27 2010 @@ -87,32 +87,3 @@ %tmp9 = shufflevector <4 x i8> %tmp7, <4 x i8> undef, <4 x i32> < i32 3, i32 1, i32 2, i32 0 > ; <<4 x i8>> [#uses=1] ret <4 x i8> %tmp9 } - -; Test fold of hi/lo vector halves -; Test fold of unpack operation -define void @test10(<16 x i8>* %out, <16 x i8> %r, <16 x i8> %g, <16 x i8> %b, <16 x i8> %a) nounwind ssp { -; CHECK: @test10 -; CHECK-NEXT: shufflevector -; CHECK-NEXT: shufflevector -; CHECK-NEXT: store -; CHECK-NEXT: getelementptr -; CHECK-NEXT: store -; CHECK-NEXT: ret - %tmp1 = shufflevector <16 x i8> %r, <16 x i8> undef, <8 x i32> ; <<8 x i8>> [#uses=1] - %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> undef, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp4 = shufflevector <16 x i8> undef, <16 x i8> %tmp3, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp6 = shufflevector <16 x i8> %b, <16 x i8> undef, <8 x i32> ; <<8 x i8>> [#uses=1] - %tmp8 = shufflevector <8 x i8> %tmp6, <8 x i8> undef, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp9 = shufflevector <16 x i8> %tmp4, <16 x i8> %tmp8, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp11 = shufflevector <16 x i8> %r, <16 x i8> undef, <8 x i32> ; <<8 x i8>> [#uses=1] - %tmp13 = shufflevector <8 x i8> %tmp11, <8 x i8> undef, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp14 = shufflevector <16 x i8> undef, <16 x i8> %tmp13, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp16 = shufflevector <16 x i8> %b, <16 x i8> undef, <8 x i32> ; <<8 x i8>> [#uses=1] - %tmp18 = shufflevector <8 x i8> %tmp16, <8 x i8> undef, <16 x i32> ; <<16 x i8>> [#uses=1] - %tmp19 = shufflevector <16 x i8> %tmp14, <16 x i8> %tmp18, <16 x i32> ; <<16 x i8>> [#uses=1] - %arrayidx = getelementptr inbounds <16 x i8>* %out, i64 0 ; <<16 x i8>*> [#uses=1] - store <16 x i8> %tmp9, <16 x i8>* %arrayidx - %arrayidx24 = getelementptr inbounds <16 x i8>* %out, i64 1 ; <<16 x i8>*> [#uses=1] - store <16 x i8> %tmp19, <16 x i8>* %arrayidx24 - ret void -} From nlewycky at google.com Tue Aug 17 17:58:10 2010 From: nlewycky at google.com (Nick Lewycky) Date: Tue, 17 Aug 2010 15:58:10 -0700 Subject: [llvm-commits] PATCH: implement vector zext when vector types are legal (neon) Message-ID: This patch implements custom lowering for ZEXT to N x i32 vector types. Currently llvm just crashes. I'm not very qualified either in the backend or with ARM assembly. Please review carefully! Since you're probably wondering, the code it produces is lengthy: test1: @ @test1 @ BB#0: str r11, [sp, #-4]! mov r11, sp sub sp, sp, #28 bic sp, sp, #15 vmov.i32 d0, #0x0 vmov.u16 r2, d0[0] vmov d0, r0, r1 strh r2, [sp, #14] strh r2, [sp, #10] strh r2, [sp, #6] strh r2, [sp, #2] vmov.u16 r0, d0[3] vmov.u16 r2, d0[2] vmov.u16 r1, d0[1] strh r0, [sp, #12] strh r2, [sp, #8] vmov.u16 r2, d0[0] strh r1, [sp, #4] mov r1, sp strh r2, [sp] vldmia r1, {d0, d1} vmov r0, r1, d0 vmov r2, r3, d1 mov sp, r11 ldr r11, [sp], #4 mov pc, lr Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/6182bb88/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: neon-zext.patch Type: text/x-patch Size: 2569 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/6182bb88/attachment.bin From sabre at nondot.org Tue Aug 17 18:03:53 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 23:03:53 -0000 Subject: [llvm-commits] [llvm] r111320 - /llvm/trunk/lib/Support/ErrorHandling.cpp Message-ID: <20100817230353.CE07A2A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 18:03:53 2010 New Revision: 111320 URL: http://llvm.org/viewvc/llvm-project?rev=111320&view=rev Log: report_fatal_error can't use errs(), because errs() can call into report_fatal_error. Just blast the string to stderr with write(2) and hope for the best! Part of rdar://8318441 Modified: llvm/trunk/lib/Support/ErrorHandling.cpp Modified: llvm/trunk/lib/Support/ErrorHandling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ErrorHandling.cpp?rev=111320&r1=111319&r2=111320&view=diff ============================================================================== --- llvm/trunk/lib/Support/ErrorHandling.cpp (original) +++ llvm/trunk/lib/Support/ErrorHandling.cpp Tue Aug 17 18:03:53 2010 @@ -18,8 +18,18 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" #include "llvm/System/Threading.h" +#include "llvm/ADT/SmallVector.h" #include #include + +#if defined(HAVE_UNISTD_H) +# include +#endif +#if defined(_MSC_VER) +# include +# include +#endif + using namespace llvm; using namespace std; @@ -39,19 +49,27 @@ ErrorHandler = 0; } -void llvm::report_fatal_error(const char *reason) { - report_fatal_error(Twine(reason)); +void llvm::report_fatal_error(const char *Reason) { + report_fatal_error(Twine(Reason)); } -void llvm::report_fatal_error(const std::string &reason) { - report_fatal_error(Twine(reason)); +void llvm::report_fatal_error(const std::string &Reason) { + report_fatal_error(Twine(Reason)); } -void llvm::report_fatal_error(const Twine &reason) { - if (!ErrorHandler) { - errs() << "LLVM ERROR: " << reason << "\n"; +void llvm::report_fatal_error(const Twine &Reason) { + if (ErrorHandler) { + ErrorHandler(ErrorHandlerUserData, Reason.str()); } else { - ErrorHandler(ErrorHandlerUserData, reason.str()); + // Blast the result out to stderr. We don't try hard to make sure this + // succeeds (e.g. handling EINTR) and we can't use errs() here because + // raw ostreams can call report_fatal_error. + SmallVector Buffer; + StringRef ReasonStr = Reason.toStringRef(Buffer); + + ::write(2, "LLVM ERROR: ", 12); + ::write(2, ReasonStr.data(), ReasonStr.size()); + ::write(2, "\n", 1); } // If we reached here, we are failing ungracefully. Run the interrupt handlers From sabre at nondot.org Tue Aug 17 18:11:56 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 23:11:56 -0000 Subject: [llvm-commits] [llvm] r111321 - /llvm/trunk/lib/Support/raw_ostream.cpp Message-ID: <20100817231156.B1DDC2A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 18:11:56 2010 New Revision: 111321 URL: http://llvm.org/viewvc/llvm-project?rev=111321&view=rev Log: Fix the rest of rdar://8318441 which happens when a raw_fd_ostream (e.g. errs()) fails in close() due to (e.g.) a broken pipe. As previously written, the had_error() flag would get set and then the raw_ostream dtor would report a fatal error. There is nothing the client can do about this and we have no way to report the error, so just eat it. Modified: llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111321&r1=111320&r2=111321&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Aug 17 18:11:56 2010 @@ -415,15 +415,31 @@ raw_fd_ostream::~raw_fd_ostream() { if (FD < 0) return; - flush(); - if (ShouldClose) - while (::close(FD) != 0) - if (errno != EINTR) { - error_detected(); - break; - } + if (!ShouldClose) { + flush(); + return; + } + + bool HadError = has_error(); + close(); + + // If we had a failure closing the stream, there is no way for the client to + // handle it, just eat the failure. + if (!HadError && has_error()) + clear_error(); } +void raw_fd_ostream::close() { + assert(ShouldClose); + ShouldClose = false; + flush(); + while (::close(FD) != 0) + if (errno != EINTR) { + error_detected(); + break; + } + FD = -1; +} void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) { assert(FD >= 0 && "File already closed."); @@ -461,18 +477,6 @@ } while (Size > 0); } -void raw_fd_ostream::close() { - assert(ShouldClose); - ShouldClose = false; - flush(); - while (::close(FD) != 0) - if (errno != EINTR) { - error_detected(); - break; - } - FD = -1; -} - uint64_t raw_fd_ostream::seek(uint64_t off) { flush(); pos = ::lseek(FD, off, SEEK_SET); From sabre at nondot.org Tue Aug 17 18:22:10 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 23:22:10 -0000 Subject: [llvm-commits] [llvm] r111325 - /llvm/trunk/lib/Support/ErrorHandling.cpp Message-ID: <20100817232210.455A02A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 18:22:10 2010 New Revision: 111325 URL: http://llvm.org/viewvc/llvm-project?rev=111325&view=rev Log: include config.h to get config params, hopefully unbreaking mingw builder. Modified: llvm/trunk/lib/Support/ErrorHandling.cpp Modified: llvm/trunk/lib/Support/ErrorHandling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ErrorHandling.cpp?rev=111325&r1=111324&r2=111325&view=diff ============================================================================== --- llvm/trunk/lib/Support/ErrorHandling.cpp (original) +++ llvm/trunk/lib/Support/ErrorHandling.cpp Tue Aug 17 18:22:10 2010 @@ -19,6 +19,7 @@ #include "llvm/System/Signals.h" #include "llvm/System/Threading.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Config/config.h" #include #include From sabre at nondot.org Tue Aug 17 18:26:04 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 17 Aug 2010 23:26:04 -0000 Subject: [llvm-commits] [llvm] r111326 - /llvm/trunk/docs/LangRef.html Message-ID: <20100817232604.C28662A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 18:26:04 2010 New Revision: 111326 URL: http://llvm.org/viewvc/llvm-project?rev=111326&view=rev Log: fix a broken link Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=111326&r1=111325&r2=111326&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Aug 17 18:26:04 2010 @@ -789,7 +789,7 @@

You may give a name to any type except - "void". Type name aliases may be used anywhere a type + "void". Type name aliases may be used anywhere a type is expected with the syntax "%mytype".

Note that type names are aliases for the structural type that they indicate, From gohman at apple.com Tue Aug 17 18:31:47 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 17 Aug 2010 16:31:47 -0700 Subject: [llvm-commits] [llvm] r111321 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: <20100817231156.B1DDC2A6C12C@llvm.org> References: <20100817231156.B1DDC2A6C12C@llvm.org> Message-ID: <4167C2AD-25F3-42D7-B154-484FAF60352E@apple.com> On Aug 17, 2010, at 4:11 PM, Chris Lattner wrote: > Author: lattner > Date: Tue Aug 17 18:11:56 2010 > New Revision: 111321 > > URL: http://llvm.org/viewvc/llvm-project?rev=111321&view=rev > Log: > Fix the rest of rdar://8318441 which happens when a raw_fd_ostream > (e.g. errs()) fails in close() due to (e.g.) a broken pipe. As > previously written, the had_error() flag would get set and then > the raw_ostream dtor would report a fatal error. There is nothing > the client can do about this and we have no way to report the error, > so just eat it. For errs(), ShouldClose is set to false, so this problem shouldn't be possible. For raw_fd_ostream in general, it's not safe to ignore close(2) errors, especially since raw_fd_ostream doesn't use fsync. There is in fact something the client can do: it can call close() on the raw_fd_ostream, and then check for errors. Dan From clattner at apple.com Tue Aug 17 18:34:22 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Aug 2010 16:34:22 -0700 Subject: [llvm-commits] [llvm] r111321 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: <4167C2AD-25F3-42D7-B154-484FAF60352E@apple.com> References: <20100817231156.B1DDC2A6C12C@llvm.org> <4167C2AD-25F3-42D7-B154-484FAF60352E@apple.com> Message-ID: On Aug 17, 2010, at 4:31 PM, Dan Gohman wrote: On Aug 17, 2010, at 4:11 PM, Chris Lattner wrote: >> Author: lattner >> Date: Tue Aug 17 18:11:56 2010 >> New Revision: 111321 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111321&view=rev >> Log: >> Fix the rest of rdar://8318441 which happens when a raw_fd_ostream >> (e.g. errs()) fails in close() due to (e.g.) a broken pipe. As >> previously written, the had_error() flag would get set and then >> the raw_ostream dtor would report a fatal error. There is nothing >> the client can do about this and we have no way to report the error, >> so just eat it. > > For errs(), ShouldClose is set to false, so this problem shouldn't > be possible. > > For raw_fd_ostream in general, it's not safe to ignore close(2) > errors, especially since raw_fd_ostream doesn't use fsync. There is > in fact something the client can do: it can call close() on the > raw_fd_ostream, and then check for errors. In practice, we're getting mysterious spurious failures in clang with stack traces like this: 3 clang: llvm::report_fatal_error + 69 3 clang: llvm::report_fatal_error + 40 3 clang: llvm::raw_fd_ostream::~raw_fd_ostream + 229 3 libSystem.B.dylib: __cxa_finalize + 274 3 libSystem.B.dylib: exit + 18 3 clang: start + 59 Since the only streams that are globals that I'm aware of are errs() and outs(), this sounds to me like an error closing these streams. What do you suggest we do? -Chris From sabre at nondot.org Tue Aug 17 19:11:25 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 00:11:25 -0000 Subject: [llvm-commits] [llvm] r111332 - /llvm/trunk/include/llvm/ADT/StringRef.h Message-ID: <20100818001125.984432A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 19:11:25 2010 New Revision: 111332 URL: http://llvm.org/viewvc/llvm-project?rev=111332&view=rev Log: Don't pass in a null pointer to std::string's ctor, an empty string ref should produce an empty std::string. This fixes PR7879. Modified: llvm/trunk/include/llvm/ADT/StringRef.h Modified: llvm/trunk/include/llvm/ADT/StringRef.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=111332&r1=111331&r2=111332&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/StringRef.h (original) +++ llvm/trunk/include/llvm/ADT/StringRef.h Tue Aug 17 19:11:25 2010 @@ -149,7 +149,10 @@ unsigned edit_distance(StringRef Other, bool AllowReplacements = true); /// str - Get the contents as an std::string. - std::string str() const { return std::string(Data, Length); } + std::string str() const { + if (Data == 0) return ""; + return std::string(Data, Length); + } /// @} /// @name Operator Overloads From sabre at nondot.org Tue Aug 17 19:29:18 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 00:29:18 -0000 Subject: [llvm-commits] [llvm] r111336 - /llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Message-ID: <20100818002918.E30C52A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 19:29:18 2010 New Revision: 111336 URL: http://llvm.org/viewvc/llvm-project?rev=111336&view=rev Log: don't emit zero bit fields with Emit, fixing undefined behavior, PR7778 Modified: llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Modified: llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h?rev=111336&r1=111335&r2=111336&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h (original) +++ llvm/trunk/include/llvm/Bitcode/BitstreamWriter.h Tue Aug 17 19:29:18 2010 @@ -88,7 +88,7 @@ //===--------------------------------------------------------------------===// void Emit(uint32_t Val, unsigned NumBits) { - assert(NumBits <= 32 && "Invalid value size!"); + assert(NumBits && NumBits <= 32 && "Invalid value size!"); assert((Val & ~(~0U >> (32-NumBits))) == 0 && "High bits set!"); CurValue |= Val << CurBit; if (CurBit + NumBits < 32) { @@ -277,10 +277,12 @@ switch (Op.getEncoding()) { default: assert(0 && "Unknown encoding!"); case BitCodeAbbrevOp::Fixed: - Emit((unsigned)V, (unsigned)Op.getEncodingData()); + if (Op.getEncodingData()) + Emit((unsigned)V, (unsigned)Op.getEncodingData()); break; case BitCodeAbbrevOp::VBR: - EmitVBR64(V, (unsigned)Op.getEncodingData()); + if (Op.getEncodingData()) + EmitVBR64(V, (unsigned)Op.getEncodingData()); break; case BitCodeAbbrevOp::Char6: Emit(BitCodeAbbrevOp::EncodeChar6((char)V), 6); From sabre at nondot.org Tue Aug 17 19:33:47 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 00:33:47 -0000 Subject: [llvm-commits] [llvm] r111337 - /llvm/trunk/lib/Support/APInt.cpp Message-ID: <20100818003347.C677F2A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 19:33:47 2010 New Revision: 111337 URL: http://llvm.org/viewvc/llvm-project?rev=111337&view=rev Log: stomp some more undefined behavior, PR7775. Modified: llvm/trunk/lib/Support/APInt.cpp Modified: llvm/trunk/lib/Support/APInt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=111337&r1=111336&r2=111337&view=diff ============================================================================== --- llvm/trunk/lib/Support/APInt.cpp (original) +++ llvm/trunk/lib/Support/APInt.cpp Tue Aug 17 19:33:47 2010 @@ -2123,15 +2123,16 @@ char *BufPtr = Buffer+65; uint64_t N; - if (Signed) { + if (!Signed) { + N = getZExtValue(); + } else { int64_t I = getSExtValue(); - if (I < 0) { + if (I >= 0) { + N = I; + } else { Str.push_back('-'); - I = -I; + N = -(uint64_t)I; } - N = I; - } else { - N = getZExtValue(); } while (N) { From gohman at apple.com Tue Aug 17 20:34:52 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 01:34:52 -0000 Subject: [llvm-commits] [llvm] r111339 - /llvm/trunk/lib/Support/raw_ostream.cpp Message-ID: <20100818013453.084FF2A6C12C@llvm.org> Author: djg Date: Tue Aug 17 20:34:52 2010 New Revision: 111339 URL: http://llvm.org/viewvc/llvm-project?rev=111339&view=rev Log: Revert r111321. This doesn't fix a problem. Modified: llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111339&r1=111338&r2=111339&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Aug 17 20:34:52 2010 @@ -415,32 +415,16 @@ raw_fd_ostream::~raw_fd_ostream() { if (FD < 0) return; - if (!ShouldClose) { - flush(); - return; - } - - bool HadError = has_error(); - close(); - - // If we had a failure closing the stream, there is no way for the client to - // handle it, just eat the failure. - if (!HadError && has_error()) - clear_error(); -} - -void raw_fd_ostream::close() { - assert(ShouldClose); - ShouldClose = false; flush(); - while (::close(FD) != 0) - if (errno != EINTR) { - error_detected(); - break; - } - FD = -1; + if (ShouldClose) + while (::close(FD) != 0) + if (errno != EINTR) { + error_detected(); + break; + } } + void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) { assert(FD >= 0 && "File already closed."); pos += Size; @@ -477,6 +461,18 @@ } while (Size > 0); } +void raw_fd_ostream::close() { + assert(ShouldClose); + ShouldClose = false; + flush(); + while (::close(FD) != 0) + if (errno != EINTR) { + error_detected(); + break; + } + FD = -1; +} + uint64_t raw_fd_ostream::seek(uint64_t off) { flush(); pos = ::lseek(FD, off, SEEK_SET); From gohman at apple.com Tue Aug 17 20:35:53 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 01:35:53 -0000 Subject: [llvm-commits] [llvm] r111340 - /llvm/trunk/Makefile.rules Message-ID: <20100818013554.02BD32A6C12C@llvm.org> Author: djg Date: Tue Aug 17 20:35:53 2010 New Revision: 111340 URL: http://llvm.org/viewvc/llvm-project?rev=111340&view=rev Log: Fix the "Finished Creating" messages for aliases to print the right name. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=111340&r1=111339&r2=111340&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Aug 17 20:35:53 2010 @@ -1358,7 +1358,7 @@ $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg) $(Verb) $(RM) -f $(ToolAliasBuildPath) $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath) - $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLNAME) \ + $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \ $(StripWarnMsg) endif From bob.wilson at apple.com Tue Aug 17 20:45:52 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 18 Aug 2010 01:45:52 -0000 Subject: [llvm-commits] [llvm] r111341 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/neon-ops.ll Message-ID: <20100818014552.7B7462A6C12C@llvm.org> Author: bwilson Date: Tue Aug 17 20:45:52 2010 New Revision: 111341 URL: http://llvm.org/viewvc/llvm-project?rev=111341&view=rev Log: Expand ZERO_EXTEND operations for NEON vector types. Testcase from Nick Lewycky. Added: llvm/trunk/test/CodeGen/ARM/neon-ops.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=111341&r1=111340&r2=111341&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Aug 17 20:45:52 2010 @@ -125,6 +125,7 @@ setOperationAction(ISD::EXTRACT_SUBVECTOR, VT.getSimpleVT(), Expand); setOperationAction(ISD::SELECT, VT.getSimpleVT(), Expand); setOperationAction(ISD::SELECT_CC, VT.getSimpleVT(), Expand); + setOperationAction(ISD::ZERO_EXTEND, VT.getSimpleVT(), Expand); if (VT.isInteger()) { setOperationAction(ISD::SHL, VT.getSimpleVT(), Custom); setOperationAction(ISD::SRA, VT.getSimpleVT(), Custom); Added: llvm/trunk/test/CodeGen/ARM/neon-ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/neon-ops.ll?rev=111341&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/neon-ops.ll (added) +++ llvm/trunk/test/CodeGen/ARM/neon-ops.ll Tue Aug 17 20:45:52 2010 @@ -0,0 +1,7 @@ +; RUN: llc -march=arm -mattr=+neon -O2 -o /dev/null + +; This used to crash. +define <4 x i32> @test1(<4 x i16> %a) { + %A = zext <4 x i16> %a to <4 x i32> + ret <4 x i32> %A +} From gohman at apple.com Tue Aug 17 20:48:51 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 17 Aug 2010 18:48:51 -0700 Subject: [llvm-commits] [llvm] r111321 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: References: <20100817231156.B1DDC2A6C12C@llvm.org> <4167C2AD-25F3-42D7-B154-484FAF60352E@apple.com> Message-ID: On Aug 17, 2010, at 4:34 PM, Chris Lattner wrote: > On Aug 17, 2010, at 4:31 PM, Dan Gohman wrote: > On Aug 17, 2010, at 4:11 PM, Chris Lattner wrote: >>> Author: lattner >>> Date: Tue Aug 17 18:11:56 2010 >>> New Revision: 111321 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=111321&view=rev >>> Log: >>> Fix the rest of rdar://8318441 which happens when a raw_fd_ostream >>> (e.g. errs()) fails in close() due to (e.g.) a broken pipe. As >>> previously written, the had_error() flag would get set and then >>> the raw_ostream dtor would report a fatal error. There is nothing >>> the client can do about this and we have no way to report the error, >>> so just eat it. >> >> For errs(), ShouldClose is set to false, so this problem shouldn't >> be possible. >> >> For raw_fd_ostream in general, it's not safe to ignore close(2) >> errors, especially since raw_fd_ostream doesn't use fsync. There is >> in fact something the client can do: it can call close() on the >> raw_fd_ostream, and then check for errors. > > In practice, we're getting mysterious spurious failures in clang with stack traces like this: > > 3 clang: llvm::report_fatal_error + 69 > 3 clang: llvm::report_fatal_error + 40 > 3 clang: llvm::raw_fd_ostream::~raw_fd_ostream + 229 > 3 libSystem.B.dylib: __cxa_finalize + 274 > 3 libSystem.B.dylib: exit + 18 > 3 clang: start + 59 > > Since the only streams that are globals that I'm aware of are errs() and outs(), this sounds to me like an error closing these streams. What do you suggest we do? The problematic condition appears to have been when errs() happens to get destroyed before outs(), outs() happens to have a non-empty buffer when it gets destroyed, and there's a write error when outs() flushes its buffer. When this happens, report_fatal_error tries to use a destroyed errs(), and badness ensues. r111320 fixes it. 111321 doesn't appear to fix anything, so I reverted it. Dan From bob.wilson at apple.com Tue Aug 17 20:49:48 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 17 Aug 2010 18:49:48 -0700 Subject: [llvm-commits] PATCH: implement vector zext when vector types are legal (neon) In-Reply-To: References: Message-ID: That's pretty clever, but I've got a simpler patch that produces better code. Committed as svn 111341. _test1: @ @test1 Leh_func_begin0: @ BB#0: vmov d0, r0, r1 vmov.u16 r0, d0[0] mov r1, #255 orr r1, r1, #255, 24 @ 65280 vmov.u16 r2, d0[1] vmov.u16 r3, d0[2] vmov.u16 r12, d0[3] and r0, r0, r1 and r2, r2, r1 and r3, r3, r1 and r1, r12, r1 vmov s3, r1 vmov s2, r3 vmov s1, r2 vmov s0, r0 vmov r0, r1, d0 vmov r2, r3, d1 mov pc, lr Leh_func_end0: It's still pretty awful. The ANDs to mask off the high bits are unnecessary, and all those extra VMOVs should be avoided. We probably need to expand SIGN_EXTEND and ANY_EXTEND as well. I can look at that later, since I'm off to dinner now. On Aug 17, 2010, at 3:58 PM, Nick Lewycky wrote: > This patch implements custom lowering for ZEXT to N x i32 vector types. Currently llvm just crashes. > > I'm not very qualified either in the backend or with ARM assembly. Please review carefully! > > Since you're probably wondering, the code it produces is lengthy: > > test1: @ @test1 > @ BB#0: > str r11, [sp, #-4]! > mov r11, sp > sub sp, sp, #28 > bic sp, sp, #15 > vmov.i32 d0, #0x0 > vmov.u16 r2, d0[0] > vmov d0, r0, r1 > strh r2, [sp, #14] > strh r2, [sp, #10] > strh r2, [sp, #6] > strh r2, [sp, #2] > vmov.u16 r0, d0[3] > vmov.u16 r2, d0[2] > vmov.u16 r1, d0[1] > strh r0, [sp, #12] > strh r2, [sp, #8] > vmov.u16 r2, d0[0] > strh r1, [sp, #4] > mov r1, sp > strh r2, [sp] > vldmia r1, {d0, d1} > vmov r0, r1, d0 > vmov r2, r3, d1 > mov sp, r11 > ldr r11, [sp], #4 > mov pc, lr > > Nick > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue Aug 17 21:37:07 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 02:37:07 -0000 Subject: [llvm-commits] [llvm] r111342 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <20100818023707.30A692A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 21:37:06 2010 New Revision: 111342 URL: http://llvm.org/viewvc/llvm-project?rev=111342&view=rev Log: remove dead prototype. Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=111342&r1=111341&r2=111342&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Aug 17 21:37:06 2010 @@ -114,8 +114,7 @@ void DoScalarReplacement(AllocaInst *AI, std::vector &WorkList); void DeleteDeadInstructions(); - AllocaInst *AddNewAlloca(Function &F, const Type *Ty, AllocaInst *Base); - + void RewriteForScalarRepl(Instruction *I, AllocaInst *AI, uint64_t Offset, SmallVector &NewElts); void RewriteBitCast(BitCastInst *BC, AllocaInst *AI, uint64_t Offset, From sabre at nondot.org Tue Aug 17 21:40:44 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 02:40:44 -0000 Subject: [llvm-commits] [llvm] r111343 - /llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Message-ID: <20100818024044.DDCAB2A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 21:40:44 2010 New Revision: 111343 URL: http://llvm.org/viewvc/llvm-project?rev=111343&view=rev Log: remove some code that is dead now that lea's are modeled with segment registers. Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=111343&r1=111342&r2=111343&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Aug 17 21:40:44 2010 @@ -41,8 +41,6 @@ MCAsmLexer &getLexer() const { return Parser.getLexer(); } - void Warning(SMLoc L, const Twine &Msg) { Parser.Warning(L, Msg); } - bool Error(SMLoc L, const Twine &Msg) { return Parser.Error(L, Msg); } bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc); @@ -272,10 +270,6 @@ !getMemIndexReg() && getMemScale() == 1; } - bool isNoSegMem() const { - return Kind == Memory && !getMemSegReg(); - } - bool isReg() const { return Kind == Register; } void addExpr(MCInst &Inst, const MCExpr *Expr) const { @@ -310,14 +304,6 @@ Inst.addOperand(MCOperand::CreateExpr(getMemDisp())); } - void addNoSegMemOperands(MCInst &Inst, unsigned N) const { - assert((N == 4) && "Invalid number of operands!"); - Inst.addOperand(MCOperand::CreateReg(getMemBaseReg())); - Inst.addOperand(MCOperand::CreateImm(getMemScale())); - Inst.addOperand(MCOperand::CreateReg(getMemIndexReg())); - addExpr(Inst, getMemDisp()); - } - static X86Operand *CreateToken(StringRef Str, SMLoc Loc) { X86Operand *Res = new X86Operand(Token, Loc, Loc); Res->Tok.Data = Str.data(); From sabre at nondot.org Tue Aug 17 21:41:56 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 02:41:56 -0000 Subject: [llvm-commits] [llvm] r111344 - in /llvm/trunk/lib/Transforms: Scalar/SCCP.cpp Utils/LowerSwitch.cpp Utils/PromoteMemoryToRegister.cpp Message-ID: <20100818024156.66B0E2A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 21:41:56 2010 New Revision: 111344 URL: http://llvm.org/viewvc/llvm-project?rev=111344&view=rev Log: remove some dead code. Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=111344&r1=111343&r2=111344&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Tue Aug 17 21:41:56 2010 @@ -275,12 +275,12 @@ return I->second; } - LatticeVal getStructLatticeValueFor(Value *V, unsigned i) const { + /*LatticeVal getStructLatticeValueFor(Value *V, unsigned i) const { DenseMap, LatticeVal>::const_iterator I = StructValueState.find(std::make_pair(V, i)); assert(I != StructValueState.end() && "V is not in valuemap!"); return I->second; - } + }*/ /// getTrackedRetVals - Get the inferred return value map. /// @@ -518,7 +518,6 @@ void visitUnwindInst (TerminatorInst &I) { /*returns void*/ } void visitUnreachableInst(TerminatorInst &I) { /*returns void*/ } void visitAllocaInst (Instruction &I) { markOverdefined(&I); } - void visitVANextInst (Instruction &I) { markOverdefined(&I); } void visitVAArgInst (Instruction &I) { markAnythingOverdefined(&I); } void visitInstruction(Instruction &I) { Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=111344&r1=111343&r2=111344&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Tue Aug 17 21:41:56 2010 @@ -29,8 +29,7 @@ namespace { /// LowerSwitch Pass - Replace all SwitchInst instructions with chained branch - /// instructions. Note that this cannot be a BasicBlock pass because it - /// modifies the CFG! + /// instructions. class LowerSwitch : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid @@ -50,8 +49,7 @@ Constant* High; BasicBlock* BB; - CaseRange() : Low(0), High(0), BB(0) { } - CaseRange(Constant* low, Constant* high, BasicBlock* bb) : + CaseRange(Constant *low = 0, Constant *high = 0, BasicBlock *bb = 0) : Low(low), High(high), BB(bb) { } }; Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=111344&r1=111343&r2=111344&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Tue Aug 17 21:41:56 2010 @@ -228,14 +228,6 @@ void run(); - /// properlyDominates - Return true if I1 properly dominates I2. - /// - bool properlyDominates(Instruction *I1, Instruction *I2) const { - if (InvokeInst *II = dyn_cast(I1)) - I1 = II->getNormalDest()->begin(); - return DT.properlyDominates(I1->getParent(), I2->getParent()); - } - /// dominates - Return true if BB1 dominates BB2 using the DominatorTree. /// bool dominates(BasicBlock *BB1, BasicBlock *BB2) const { From sabre at nondot.org Tue Aug 17 21:42:11 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 02:42:11 -0000 Subject: [llvm-commits] [llvm] r111345 - in /llvm/trunk/lib/Target: Alpha/AsmPrinter/AlphaAsmPrinter.cpp MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp Message-ID: <20100818024211.4BB762A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 21:42:11 2010 New Revision: 111345 URL: http://llvm.org/viewvc/llvm-project?rev=111345&view=rev Log: remove some dead code. Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp llvm/trunk/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=111345&r1=111344&r2=111345&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Tue Aug 17 21:42:11 2010 @@ -53,8 +53,6 @@ void printOp(const MachineOperand &MO, raw_ostream &O); void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O); - void printBaseOffsetPair(const MachineInstr *MI, int i, raw_ostream &O, - bool brackets=true); virtual void EmitFunctionBodyStart(); virtual void EmitFunctionBodyEnd(); void EmitStartOfAsmFile(Module &M); Modified: llvm/trunk/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp?rev=111345&r1=111344&r2=111345&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp Tue Aug 17 21:42:11 2010 @@ -65,11 +65,8 @@ void printFSLImm(const MachineInstr *MI, int opNum, raw_ostream &O); void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O, const char *Modifier = 0); - void printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O, - const char *Modifier = 0); void printSavedRegsBitmask(raw_ostream &OS); - const char *emitCurrentABIString(); void emitFrameDirective(); void printInstruction(const MachineInstr *MI, raw_ostream &O); @@ -292,13 +289,6 @@ printOperand(MI, opNum, O); } -void MBlazeAsmPrinter:: -printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O, - const char *Modifier) { - const MachineOperand& MO = MI->getOperand(opNum); - O << MBlaze::MBlazeFCCToString((MBlaze::CondCode)MO.getImm()); -} - // Force static initialization. extern "C" void LLVMInitializeMBlazeAsmPrinter() { RegisterAsmPrinter X(TheMBlazeTarget); From clattner at apple.com Tue Aug 17 21:51:08 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 17 Aug 2010 19:51:08 -0700 Subject: [llvm-commits] [llvm] r111321 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: References: <20100817231156.B1DDC2A6C12C@llvm.org> <4167C2AD-25F3-42D7-B154-484FAF60352E@apple.com> Message-ID: <50F3A25C-FE8C-4776-B646-7D00F8D424A4@apple.com> >> In practice, we're getting mysterious spurious failures in clang with stack traces like this: >> >> 3 clang: llvm::report_fatal_error + 69 >> 3 clang: llvm::report_fatal_error + 40 >> 3 clang: llvm::raw_fd_ostream::~raw_fd_ostream + 229 >> 3 libSystem.B.dylib: __cxa_finalize + 274 >> 3 libSystem.B.dylib: exit + 18 >> 3 clang: start + 59 >> >> Since the only streams that are globals that I'm aware of are errs() and outs(), this sounds to me like an error closing these streams. What do you suggest we do? > > > The problematic condition appears to have been when errs() happens > to get destroyed before outs(), outs() happens to have a > non-empty buffer when it gets destroyed, and there's a write error > when outs() flushes its buffer. When this happens, report_fatal_error > tries to use a destroyed errs(), and badness ensues. r111320 fixes it. > > 111321 doesn't appear to fix anything, so I reverted it. So now instead of calling a method on an object that is destroyed, this helpfully causes llvm_fatal_error() to be called. This is progress (as noted when I committed this) but wasn't sufficient to fix rdar://8318441 or PR7043. Since you've now reverted them, you've regressed both. How exactly does 111321 not fix anything? -Chris From sabre at nondot.org Tue Aug 17 22:13:35 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 03:13:35 -0000 Subject: [llvm-commits] [llvm] r111348 - /llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Message-ID: <20100818031335.9B1452A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 22:13:35 2010 New Revision: 111348 URL: http://llvm.org/viewvc/llvm-project?rev=111348&view=rev Log: fit in 80 cols Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=111348&r1=111347&r2=111348&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Tue Aug 17 22:13:35 2010 @@ -257,7 +257,7 @@ case Instruction::Switch: // Should remove entry default: case Instruction::Ret: // Cannot happen, has no successors! - llvm_unreachable("Unhandled terminator instruction type in RemoveSuccessor!"); + llvm_unreachable("Unhandled terminator inst type in RemoveSuccessor!"); } if (NewTI) // If it's a different instruction, replace. @@ -411,7 +411,8 @@ DominatorTree *DT = P ? P->getAnalysisIfAvailable() : 0; if (DT) DT->splitBlock(NewBB); - if (DominanceFrontier *DF = P ? P->getAnalysisIfAvailable():0) + if (DominanceFrontier *DF = + P ? P->getAnalysisIfAvailable() : 0) DF->splitBlock(NewBB); // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI From sabre at nondot.org Tue Aug 17 22:14:36 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 03:14:36 -0000 Subject: [llvm-commits] [llvm] r111349 - in /llvm/trunk: lib/Transforms/Scalar/JumpThreading.cpp test/Transforms/JumpThreading/crash.ll Message-ID: <20100818031436.AD3132A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 22:14:36 2010 New Revision: 111349 URL: http://llvm.org/viewvc/llvm-project?rev=111349&view=rev Log: Fix PR7755: knowing something about an inval for a pred from the LHS should disable reconsidering that pred on the RHS. However, knowing something about the pred on the RHS shouldn't disable subsequent additions on the RHS from happening. Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp llvm/trunk/test/Transforms/JumpThreading/crash.ll Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=111349&r1=111348&r2=111349&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Tue Aug 17 22:14:36 2010 @@ -341,25 +341,21 @@ else InterestingVal = ConstantInt::getFalse(I->getContext()); + SmallPtrSet LHSKnownBBs; + // Scan for the sentinel. If we find an undef, force it to the // interesting value: x|undef -> true and x&undef -> false. for (unsigned i = 0, e = LHSVals.size(); i != e; ++i) if (LHSVals[i].first == InterestingVal || LHSVals[i].first == 0) { Result.push_back(LHSVals[i]); Result.back().first = InterestingVal; + LHSKnownBBs.insert(LHSVals[i].second); } for (unsigned i = 0, e = RHSVals.size(); i != e; ++i) if (RHSVals[i].first == InterestingVal || RHSVals[i].first == 0) { // If we already inferred a value for this block on the LHS, don't // re-add it. - bool HasValue = false; - for (unsigned r = 0, e = Result.size(); r != e; ++r) - if (Result[r].second == RHSVals[i].second) { - HasValue = true; - break; - } - - if (!HasValue) { + if (!LHSKnownBBs.count(RHSVals[i].second)) { Result.push_back(RHSVals[i]); Result.back().first = InterestingVal; } Modified: llvm/trunk/test/Transforms/JumpThreading/crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/JumpThreading/crash.ll?rev=111349&r1=111348&r2=111349&view=diff ============================================================================== --- llvm/trunk/test/Transforms/JumpThreading/crash.ll (original) +++ llvm/trunk/test/Transforms/JumpThreading/crash.ll Tue Aug 17 22:14:36 2010 @@ -436,4 +436,28 @@ ret void } +; PR7755 +define void @test16(i1 %c, i1 %c2, i1 %c3, i1 %c4) nounwind ssp { +entry: + %cmp = icmp sgt i32 undef, 1 ; [#uses=1] + br i1 %c, label %land.end, label %land.rhs + +land.rhs: ; preds = %entry + br i1 %c2, label %lor.lhs.false.i, label %land.end + +lor.lhs.false.i: ; preds = %land.rhs + br i1 %c3, label %land.end, label %land.end + +land.end: + %0 = phi i1 [ true, %entry ], [ false, %land.rhs ], [false, %lor.lhs.false.i], [false, %lor.lhs.false.i] ; [#uses=1] + %cmp12 = and i1 %cmp, %0 + %xor1 = xor i1 %cmp12, %c4 + br i1 %xor1, label %if.then, label %if.end + +if.then: + ret void + +if.end: + ret void +} From sabre at nondot.org Tue Aug 17 23:25:43 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 04:25:43 -0000 Subject: [llvm-commits] [llvm] r111350 - /llvm/trunk/test/Analysis/BasicAA/featuretest.ll Message-ID: <20100818042543.855902A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 23:25:43 2010 New Revision: 111350 URL: http://llvm.org/viewvc/llvm-project?rev=111350&view=rev Log: filecheckize and detrivialize. Modified: llvm/trunk/test/Analysis/BasicAA/featuretest.ll Modified: llvm/trunk/test/Analysis/BasicAA/featuretest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/featuretest.ll?rev=111350&r1=111349&r2=111350&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/featuretest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/featuretest.ll Tue Aug 17 23:25:43 2010 @@ -1,17 +1,22 @@ ; This testcase tests for various features the basicaa test should be able to ; determine, as noted in the comments. -; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | not grep REMOVE +; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @Global = external global { i32 } +declare void @external(i32*) + ; Array test: Test that operations on one local array do not invalidate ; operations on another array. Important for scientific codes. ; define i32 @different_array_test(i64 %A, i64 %B) { %Array1 = alloca i32, i32 100 %Array2 = alloca i32, i32 200 + + call void @external(i32* %Array1) + call void @external(i32* %Array2) %pointer = getelementptr i32* %Array1, i64 %A %val = load i32* %pointer @@ -22,6 +27,8 @@ %REMOVE = load i32* %pointer ; redundant with above load %retval = sub i32 %REMOVE, %val ret i32 %retval +; CHECK: @different_array_test +; CHECK: ret i32 0 } ; Constant index test: Constant indexes into the same array should not @@ -29,6 +36,8 @@ ; define i32 @constant_array_index_test() { %Array = alloca i32, i32 100 + call void @external(i32* %Array) + %P1 = getelementptr i32* %Array, i64 7 %P2 = getelementptr i32* %Array, i64 6 @@ -37,6 +46,8 @@ %BREMOVE = load i32* %P1 %Val = sub i32 %A, %BREMOVE ret i32 %Val +; CHECK: @constant_array_index_test +; CHECK: ret i32 0 } ; Test that if two pointers are spaced out by a constant getelementptr, that @@ -48,6 +59,8 @@ %REMOVEv = load i32* %A %r = sub i32 %REMOVEu, %REMOVEv ret i32 %r +; CHECK: @gep_distance_test +; CHECK: ret i32 0 } ; Test that if two pointers are spaced out by a constant offset, that they @@ -60,6 +73,8 @@ %REMOVEv = load i32* %A1 %r = sub i32 %REMOVEu, %REMOVEv ret i32 %r +; CHECK: @gep_distance_test2 +; CHECK: ret i32 0 } ; Test that we can do funny pointer things and that distance calc will still @@ -68,16 +83,24 @@ %X = load i32* %A %B = bitcast i32* %A to i8* %C = getelementptr i8* %B, i64 4 - %Y = load i8* %C - ret i32 8 + store i8 42, i8* %C + %Y = load i32* %A + %R = sub i32 %X, %Y + ret i32 %R +; CHECK: @gep_distance_test3 +; CHECK: ret i32 0 } ; Test that we can disambiguate globals reached through constantexpr geps define i32 @constexpr_test() { %X = alloca i32 + call void @external(i32* %X) + %Y = load i32* %X store i32 5, i32* getelementptr ({ i32 }* @Global, i64 0, i32 0) %REMOVE = load i32* %X %retval = sub i32 %Y, %REMOVE ret i32 %retval +; CHECK: @constexpr_test +; CHECK: ret i32 0 } From sabre at nondot.org Tue Aug 17 23:28:19 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 04:28:19 -0000 Subject: [llvm-commits] [llvm] r111352 - in /llvm/trunk: lib/Analysis/ValueTracking.cpp test/Analysis/BasicAA/featuretest.ll Message-ID: <20100818042819.CD7012A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 23:28:19 2010 New Revision: 111352 URL: http://llvm.org/viewvc/llvm-project?rev=111352&view=rev Log: fix PR7589: In brief: gep P, (zext x) != gep P, (sext x) DecomposeGEPExpression was getting this wrong, confusing basicaa. Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp llvm/trunk/test/Analysis/BasicAA/featuretest.ll Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=111352&r1=111351&r2=111352&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Tue Aug 17 23:28:19 2010 @@ -1018,9 +1018,9 @@ } } - // Since clients don't care about the high bits of the value, just scales and - // offsets, we can look through extensions. - if (isa(V) || isa(V)) { + // Since GEP indices are sign extended anyway, we don't care about the high + // bits of a sign extended value - just scales and offsets. + if (isa(V)) { Value *CastOp = cast(V)->getOperand(0); unsigned OldWidth = Scale.getBitWidth(); unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); Modified: llvm/trunk/test/Analysis/BasicAA/featuretest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/featuretest.ll?rev=111352&r1=111351&r2=111352&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/featuretest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/featuretest.ll Tue Aug 17 23:28:19 2010 @@ -104,3 +104,24 @@ ; CHECK: @constexpr_test ; CHECK: ret i32 0 } + + + +; PR7589 +; These two index expressions are different, this cannot be CSE'd. +define i16 @zext_sext_confusion(i16* %row2col, i5 %j) nounwind{ +entry: + %sum5.cast = zext i5 %j to i64 ; [#uses=1] + %P1 = getelementptr i16* %row2col, i64 %sum5.cast + %row2col.load.1.2 = load i16* %P1, align 1 ; [#uses=1] + + %sum13.cast31 = sext i5 %j to i6 ; [#uses=1] + %sum13.cast = zext i6 %sum13.cast31 to i64 ; [#uses=1] + %P2 = getelementptr i16* %row2col, i64 %sum13.cast + %row2col.load.1.6 = load i16* %P2, align 1 ; [#uses=1] + + %.ret = sub i16 %row2col.load.1.6, %row2col.load.1.2 ; [#uses=1] + ret i16 %.ret +; CHECK: @zext_sext_confusion +; CHECK: ret i16 %.ret +} From sabre at nondot.org Tue Aug 17 23:55:12 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 04:55:12 -0000 Subject: [llvm-commits] [llvm] r111354 - /llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Message-ID: <20100818045512.773A82A6C12C@llvm.org> Author: lattner Date: Tue Aug 17 23:55:12 2010 New Revision: 111354 URL: http://llvm.org/viewvc/llvm-project?rev=111354&view=rev Log: fix a buggy test Modified: llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Modified: llvm/trunk/test/Analysis/BasicAA/gep-alias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/gep-alias.ll?rev=111354&r1=111353&r2=111354&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/gep-alias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Tue Aug 17 23:55:12 2010 @@ -115,13 +115,13 @@ ; CHECK: ret i32 0 } -; P[zext(i)] != p[zext(i+1)] +; P[sext(i)] != p[sext(i+1)] ; PR1143 define i32 @test8(i32* %p, i32 %i) { - %i1 = zext i32 %i to i64 + %i1 = sext i32 %i to i64 %pi = getelementptr i32* %p, i64 %i1 %i.next = add i32 %i, 1 - %i.next2 = zext i32 %i.next to i64 + %i.next2 = sext i32 %i.next to i64 %pi.next = getelementptr i32* %p, i64 %i.next2 %x = load i32* %pi store i32 42, i32* %pi.next From resistor at mac.com Wed Aug 18 00:25:37 2010 From: resistor at mac.com (Owen Anderson) Date: Tue, 17 Aug 2010 22:25:37 -0700 Subject: [llvm-commits] [PATCH] InstCombine: Generalized patch for (icmp eq (A&B), C) & (icmp eq (A&D), E) In-Reply-To: <4C6B0925.1080701@web.de> References: <4C6B0925.1080701@web.de> Message-ID: <5FFE3192-DDF8-47D2-AA7A-D2E8C8F069C4@mac.com> Dirk, Your updated testcase (bit-checks.ll) doesn't pass for me after applying your patch. --Owen On Aug 17, 2010, at 3:11 PM, Dirk Steinke wrote: > Hi, > > a few weeks ago I volunteered to provide a more generalized form > for one of Owens InstCombine transforms. Well, here it is. > Sorry, I didn't run all tests to make sure that it doesn't break anything. My machine is currently not set up for that. (Basically > it's just Visual Studio.) But all transforms have been tested and should not fire inappropriately. > > If there are any issues with the patch, I'll fix them. > > To Owen: > Sorry for ripping out your original transform. But at least > it's still in 2.8. ;-) > > Bye > Dirk > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nlewycky at google.com Wed Aug 18 00:56:51 2010 From: nlewycky at google.com (Nick Lewycky) Date: Tue, 17 Aug 2010 22:56:51 -0700 Subject: [llvm-commits] PATCH: implement vector zext when vector types are legal (neon) In-Reply-To: References: Message-ID: On 17 August 2010 18:49, Bob Wilson wrote: > That's pretty clever, but I've got a simpler patch that produces better > code. Committed as svn 111341. > Hah. Yeah that is a bit simpler, isn't it. Thank you. If you don't mind I'm going to let you do -- hopefully the exact same thing -- for sign extend and any extend. To hijack my own thread, I'm also trying to add a combine for (add (mul (zext a), (zext b)), c) --> (vmlal a, b, c). There's an intrinsic for vmlal and I tried producing that, but ended up triggering "Could not select: intrinsic %llvm.arm.neon.vmlalu" even though it handles that intrinsic coming from IR just fine. Would you mind taking a look at the attached patch and telling me if there's a much simpler way to do this too? :) I don't want to manually list out which types vmlal is valid for, but I didn't find an API which would lower a single intrinsic for me or else return SDValue(), for example. Thanks! Nick _test1: @ @test1 > Leh_func_begin0: > @ BB#0: > vmov d0, r0, r1 > vmov.u16 r0, d0[0] > mov r1, #255 > orr r1, r1, #255, 24 @ 65280 > vmov.u16 r2, d0[1] > vmov.u16 r3, d0[2] > vmov.u16 r12, d0[3] > and r0, r0, r1 > and r2, r2, r1 > and r3, r3, r1 > and r1, r12, r1 > vmov s3, r1 > vmov s2, r3 > vmov s1, r2 > vmov s0, r0 > vmov r0, r1, d0 > vmov r2, r3, d1 > mov pc, lr > Leh_func_end0: > > It's still pretty awful. The ANDs to mask off the high bits are > unnecessary, and all those extra VMOVs should be avoided. > > We probably need to expand SIGN_EXTEND and ANY_EXTEND as well. I can look > at that later, since I'm off to dinner now. > > On Aug 17, 2010, at 3:58 PM, Nick Lewycky wrote: > > > This patch implements custom lowering for ZEXT to N x i32 vector types. > Currently llvm just crashes. > > > > I'm not very qualified either in the backend or with ARM assembly. Please > review carefully! > > > > Since you're probably wondering, the code it produces is lengthy: > > > > test1: @ @test1 > > @ BB#0: > > str r11, [sp, #-4]! > > mov r11, sp > > sub sp, sp, #28 > > bic sp, sp, #15 > > vmov.i32 d0, #0x0 > > vmov.u16 r2, d0[0] > > vmov d0, r0, r1 > > strh r2, [sp, #14] > > strh r2, [sp, #10] > > strh r2, [sp, #6] > > strh r2, [sp, #2] > > vmov.u16 r0, d0[3] > > vmov.u16 r2, d0[2] > > vmov.u16 r1, d0[1] > > strh r0, [sp, #12] > > strh r2, [sp, #8] > > vmov.u16 r2, d0[0] > > strh r1, [sp, #4] > > mov r1, sp > > strh r2, [sp] > > vldmia r1, {d0, d1} > > vmov r0, r1, d0 > > vmov r2, r3, d1 > > mov sp, r11 > > ldr r11, [sp], #4 > > mov pc, lr > > > > Nick > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/b3807b76/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: combine-vmlal-broken.patch Type: text/x-patch Size: 1198 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100817/b3807b76/attachment.bin From dirty at apple.com Wed Aug 18 04:30:05 2010 From: dirty at apple.com (Cameron Esfahani) Date: Wed, 18 Aug 2010 02:30:05 -0700 Subject: [llvm-commits] [WinABI patch] Make sure to call __chkstk when appropriate Message-ID: Windows ABI requires the function prologue to call __chkstk if there is >= 4096 bytes allocated on the stack. Here's a patch which implements that functionality. And, there's a test case! -------------- next part -------------- A non-text attachment was scrubbed... Name: chkstk_patch Type: application/octet-stream Size: 2540 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/98ee9266/attachment.obj -------------- next part -------------- Cameron Esfahani dirty at apple.com "I cannot for the life of me understand why, while people without driver's licenses are not allowed on public roads, in bookstores one can find any number of books by persons without decency - let alone knowledge." "His Master's Voice", Stanislaw Lem From asl at math.spbu.ru Wed Aug 18 04:43:57 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 18 Aug 2010 13:43:57 +0400 Subject: [llvm-commits] [WinABI patch] Make sure to call __chkstk when appropriate In-Reply-To: References: Message-ID: Hello, Cameron > Windows ABI requires the function prologue to call __chkstk if there is >= 4096 bytes allocated on the stack. The patch is invalid due to many reasons: - It does the stuff in wrong place - It clobbers eax which can be incoming arg reg in case of inreg params / fast CC - __chkstk is same as __alloca call in mingw case, which is already implemented Also, I don't recall offhand, but iirc this call had some special CC, it clobbers quite alot of regs, etc. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From kalle.raiskila at nokia.com Wed Aug 18 04:50:31 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Wed, 18 Aug 2010 09:50:31 -0000 Subject: [llvm-commits] [llvm] r111358 - in /llvm/trunk: lib/Target/CellSPU/SPUCallingConv.td test/CodeGen/CellSPU/arg_ret.ll Message-ID: <20100818095031.203C12A6C12C@llvm.org> Author: kraiskil Date: Wed Aug 18 04:50:30 2010 New Revision: 111358 URL: http://llvm.org/viewvc/llvm-project?rev=111358&view=rev Log: Change SPU C calling convention to match that described in "SPU Application Binary Interface Specification, v1.9" by IBM. Specifically: use r3-r74 to pass parameters and the return value. Added: llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td?rev=111358&r1=111357&r2=111358&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Wed Aug 18 04:50:30 2010 @@ -19,16 +19,18 @@ // Return Value Calling Convention //===----------------------------------------------------------------------===// -// Return-value convention for Cell SPU: Everything can be passed back via $3: +// Return-value convention for Cell SPU: return value to be passed in reg 3-74 def RetCC_SPU : CallingConv<[ - CCIfType<[i8], CCAssignToReg<[R3]>>, - CCIfType<[i16], CCAssignToReg<[R3]>>, - CCIfType<[i32], CCAssignToReg<[R3]>>, - CCIfType<[i64], CCAssignToReg<[R3]>>, - CCIfType<[i128], CCAssignToReg<[R3]>>, - CCIfType<[f32, f64], CCAssignToReg<[R3]>>, - CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToReg<[R3]>>, - CCIfType<[v2i32, v2f32], CCAssignToReg<[R3]>> + CCIfType<[i8,i16,i32,i64,i128,f32,f64,v16i8,v8i16,v4i32,v2i64,v4f32,v2f64, + v2i32, v2f32], + CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10, R11, + R12, R13, R14, R15, R16, R17, R18, R19, R20, + R21, R22, R23, R24, R25, R26, R27, R28, R29, + R30, R31, R32, R33, R34, R35, R36, R37, R38, + R39, R40, R41, R42, R43, R44, R45, R46, R47, + R48, R49, R50, R51, R52, R53, R54, R55, R56, + R57, R58, R59, R60, R61, R62, R63, R64, R65, + R66, R67, R68, R69, R70, R71, R72, R73, R74]>> ]>; @@ -45,8 +47,7 @@ R39, R40, R41, R42, R43, R44, R45, R46, R47, R48, R49, R50, R51, R52, R53, R54, R55, R56, R57, R58, R59, R60, R61, R62, R63, R64, R65, - R66, R67, R68, R69, R70, R71, R72, R73, R74, - R75, R76, R77, R78, R79]>>, + R66, R67, R68, R69, R70, R71, R72, R73, R74]>>, // Integer/FP values get stored in stack slots that are 8 bytes in size and // 8-byte aligned if there are no more registers to hold them. CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>, Added: llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll?rev=111358&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll (added) +++ llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll Wed Aug 18 04:50:30 2010 @@ -0,0 +1,33 @@ +; Test parameter passing and return values +;RUN: llc --march=cellspu %s -o - | FileCheck %s + +; this fits into registers r3-r74 +%paramstruct = type { i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32, + i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32, + i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32, + i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32, + i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32, + i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32} +define ccc i32 @test_regs( %paramstruct %prm ) +{ +;CHECK: lr $3, $74 +;CHECK: bi $lr + %1 = extractvalue %paramstruct %prm, 71 + ret i32 %1 +} + +define ccc i32 @test_regs_and_stack( %paramstruct %prm, i32 %stackprm ) +{ +;CHECK-NOT: a $3, $74, $75 + %1 = extractvalue %paramstruct %prm, 71 + %2 = add i32 %1, %stackprm + ret i32 %2 +} + +define ccc %paramstruct @test_return( i32 %param, %paramstruct %prm ) +{ +;CHEKC: lqd $75, 80($sp) +;CHECK: lr $3, $4 + ret %paramstruct %prm +} + From kalle.raiskila at nokia.com Wed Aug 18 05:04:39 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Wed, 18 Aug 2010 10:04:39 -0000 Subject: [llvm-commits] [llvm] r111360 - in /llvm/trunk: lib/Target/CellSPU/SPUCallingConv.td lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUMathInstr.td lib/Target/CellSPU/SPURegisterInfo.td test/CodeGen/CellSPU/arg_ret.ll test/CodeGen/CellSPU/v2f32.ll test/CodeGen/CellSPU/v2i32.ll Message-ID: <20100818100439.C6B222A6C12C@llvm.org> Author: kraiskil Date: Wed Aug 18 05:04:39 2010 New Revision: 111360 URL: http://llvm.org/viewvc/llvm-project?rev=111360&view=rev Log: Remove all traces of v2[i,f]32 on SPU. The "half vectors" are now widened to full size by the legalizer. The only exception is in parameter passing, where half vectors are expanded. This causes changes to some dejagnu tests. Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll llvm/trunk/test/CodeGen/CellSPU/v2f32.ll llvm/trunk/test/CodeGen/CellSPU/v2i32.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Wed Aug 18 05:04:39 2010 @@ -21,8 +21,7 @@ // Return-value convention for Cell SPU: return value to be passed in reg 3-74 def RetCC_SPU : CallingConv<[ - CCIfType<[i8,i16,i32,i64,i128,f32,f64,v16i8,v8i16,v4i32,v2i64,v4f32,v2f64, - v2i32, v2f32], + CCIfType<[i8,i16,i32,i64,i128,f32,f64,v16i8,v8i16,v4i32,v2i64,v4f32,v2f64], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, @@ -39,7 +38,7 @@ //===----------------------------------------------------------------------===// def CCC_SPU : CallingConv<[ CCIfType<[i8, i16, i32, i64, i128, f32, f64, - v16i8, v8i16, v4i32, v4f32, v2i64, v2f64, v2i32, v2f32], + v16i8, v8i16, v4i32, v4f32, v2i64, v2f64], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Aug 18 05:04:39 2010 @@ -426,10 +426,6 @@ addRegisterClass(MVT::v4f32, SPU::VECREGRegisterClass); addRegisterClass(MVT::v2f64, SPU::VECREGRegisterClass); - // "Odd size" vector classes that we're willing to support: - addRegisterClass(MVT::v2i32, SPU::VECREGRegisterClass); - addRegisterClass(MVT::v2f32, SPU::VECREGRegisterClass); - for (unsigned i = (unsigned)MVT::FIRST_VECTOR_VALUETYPE; i <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++i) { MVT::SimpleValueType VT = (MVT::SimpleValueType)i; @@ -470,9 +466,6 @@ setOperationAction(ISD::FDIV, MVT::v4f32, Legal); - setOperationAction(ISD::STORE, MVT::v2i32, Custom); - setOperationAction(ISD::STORE, MVT::v2f32, Custom); - setShiftAmountType(MVT::i32); setBooleanContents(ZeroOrNegativeOneBooleanContent); @@ -1085,8 +1078,6 @@ case MVT::v4i32: case MVT::v8i16: case MVT::v16i8: - case MVT::v2i32: - case MVT::v2f32: ArgRegClass = &SPU::VECREGRegClass; break; } @@ -1641,10 +1632,6 @@ SDValue T = DAG.getConstant(unsigned(SplatBits), VT.getVectorElementType()); return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, T, T, T, T); } - case MVT::v2f32: - case MVT::v2i32: { - return SDValue(); - } case MVT::v2i64: { return SPU::LowerV2I64Splat(VT, DAG, SplatBits, dl); } @@ -1788,9 +1775,6 @@ } else if (EltVT == MVT::i16) { V2EltIdx0 = 8; maskVT = MVT::v8i16; - } else if (VecVT == MVT::v2i32 || VecVT == MVT::v2f32 ) { - V2EltIdx0 = 2; - maskVT = MVT::v4i32; } else if (EltVT == MVT::i32 || EltVT == MVT::f32) { V2EltIdx0 = 4; maskVT = MVT::v4i32; @@ -1870,16 +1854,6 @@ for (unsigned j = 0; j < BytesPerElement; ++j) ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j,MVT::i8)); } - // For half vectors padd the mask with zeros for the second half. - // This is needed because mask is assumed to be full vector elsewhere in - // the SPU backend. - if(VecVT == MVT::v2i32 || VecVT == MVT::v2f32) - for( unsigned i = 0; i < 2; ++i ) - { - for (unsigned j = 0; j < BytesPerElement; ++j) - ResultMask.push_back(DAG.getConstant(0,MVT::i8)); - } - SDValue VPermMask = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v16i8, &ResultMask[0], ResultMask.size()); return DAG.getNode(SPUISD::SHUFB, dl, V1.getValueType(), V1, V2, VPermMask); @@ -1909,7 +1883,6 @@ case MVT::v4f32: n_copies = 4; VT = MVT::f32; break; case MVT::v2i64: n_copies = 2; VT = MVT::i64; break; case MVT::v2f64: n_copies = 2; VT = MVT::f64; break; - case MVT::v2i32: n_copies = 2; VT = MVT::i32; break; } SDValue CValue = DAG.getConstant(CN->getZExtValue(), VT); Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Wed Aug 18 05:04:39 2010 @@ -62,9 +62,6 @@ def v4f32: LoadDFormVec; def v2f64: LoadDFormVec; - def v2i32: LoadDFormVec; - def v2f32: LoadDFormVec; - def r128: LoadDForm; def r64: LoadDForm; def r32: LoadDForm; @@ -97,9 +94,6 @@ def v4f32: LoadAFormVec; def v2f64: LoadAFormVec; - def v2i32: LoadAFormVec; - def v2f32: LoadAFormVec; - def r128: LoadAForm; def r64: LoadAForm; def r32: LoadAForm; @@ -132,9 +126,6 @@ def v4f32: LoadXFormVec; def v2f64: LoadXFormVec; - def v2i32: LoadXFormVec; - def v2f32: LoadXFormVec; - def r128: LoadXForm; def r64: LoadXForm; def r32: LoadXForm; @@ -183,9 +174,6 @@ def v4f32: StoreDFormVec; def v2f64: StoreDFormVec; - def v2i32: StoreDFormVec; - def v2f32: StoreDFormVec; - def r128: StoreDForm; def r64: StoreDForm; def r32: StoreDForm; @@ -216,9 +204,6 @@ def v4f32: StoreAFormVec; def v2f64: StoreAFormVec; - def v2i32: StoreAFormVec; - def v2f32: StoreAFormVec; - def r128: StoreAForm; def r64: StoreAForm; def r32: StoreAForm; @@ -251,9 +236,6 @@ def v4f32: StoreXFormVec; def v2f64: StoreXFormVec; - def v2i32: StoreXFormVec; - def v2f32: StoreXFormVec; - def r128: StoreXForm; def r64: StoreXForm; def r32: StoreXForm; @@ -613,7 +595,6 @@ multiclass AddInstruction { def v4i32: AVecInst; def v16i8: AVecInst; - def v2i32: AVecInst; def r32: ARegInst; } @@ -678,11 +659,6 @@ "sf\t$rT, $rA, $rB", IntegerOp, [(set (v4i32 VECREG:$rT), (sub (v4i32 VECREG:$rB), (v4i32 VECREG:$rA)))]>; -def SF2vec : RRForm<0b00000010000, (outs VECREG:$rT), - (ins VECREG:$rA, VECREG:$rB), - "sf\t$rT, $rA, $rB", IntegerOp, - [(set (v2i32 VECREG:$rT), (sub (v2i32 VECREG:$rB), (v2i32 VECREG:$rA)))]>; - def SFr32 : RRForm<0b00000010000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB), "sf\t$rT, $rA, $rB", IntegerOp, @@ -841,10 +817,6 @@ MPYUInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), [/* no pattern */]>; -def MPYUv2i32: - MPYUInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), - [/* no pattern */]>; - def MPYUr16: MPYUInst<(outs R32C:$rT), (ins R16C:$rA, R16C:$rB), [(set R32C:$rT, (mul (zext R16C:$rA), (zext R16C:$rB)))]>; @@ -924,10 +896,6 @@ MPYHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), [/* no pattern */]>; -def MPYHv2i32: - MPYHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), - [/* no pattern */]>; - def MPYHr32: MPYHInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB), [/* no pattern */]>; @@ -1517,13 +1485,6 @@ def f32_v4f32: ORExtractElt; def f64_v2f64: ORExtractElt; - // half <-> full vector mappings - def v2i32_v4i32: ORCvtVecVec; - def v4i32_v2i32: ORCvtVecVec; - def v2f32_v4f32: ORCvtVecVec; - def v4f32_v2f32: ORCvtVecVec; - - // Conversion from vector to GPRC def i128_vec: ORCvtVecGPRC; @@ -1591,18 +1552,12 @@ def : Pat<(v4i32 (SPUprefslot2vec R32C:$rA)), (ORv4i32_i32 R32C:$rA)>; -def : Pat<(v2i32 (SPUprefslot2vec R32C:$rA)), - (ORv4i32_i32 R32C:$rA)>; - def : Pat<(v2i64 (SPUprefslot2vec R64C:$rA)), (ORv2i64_i64 R64C:$rA)>; def : Pat<(v4f32 (SPUprefslot2vec R32FP:$rA)), (ORv4f32_f32 R32FP:$rA)>; -def : Pat<(v2f32 (SPUprefslot2vec R32FP:$rA)), - (ORv4f32_f32 R32FP:$rA)>; - def : Pat<(v2f64 (SPUprefslot2vec R64FP:$rA)), (ORv2f64_f64 R64FP:$rA)>; @@ -1618,33 +1573,15 @@ def : Pat<(SPUvec2prefslot (v4i32 VECREG:$rA)), (ORi32_v4i32 VECREG:$rA)>; -def : Pat<(SPUvec2prefslot (v2i32 VECREG:$rA)), - (ORi32_v4i32 VECREG:$rA)>; - def : Pat<(SPUvec2prefslot (v2i64 VECREG:$rA)), (ORi64_v2i64 VECREG:$rA)>; def : Pat<(SPUvec2prefslot (v4f32 VECREG:$rA)), (ORf32_v4f32 VECREG:$rA)>; -def : Pat<(SPUvec2prefslot (v2f32 VECREG:$rA)), - (ORf32_v4f32 VECREG:$rA)>; - def : Pat<(SPUvec2prefslot (v2f64 VECREG:$rA)), (ORf64_v2f64 VECREG:$rA)>; -// Conversions between 64 bit and 128 bit vectors. - -def : Pat<(v4i32 (SPUhalf2vec (v2i32 VECREG:$rA))), - (ORv4i32_v2i32 (v2i32 VECREG:$rA))>; -def : Pat<(v4f32 (SPUhalf2vec (v2f32 VECREG:$rA))), - (ORv4f32_v2f32 (v2f32 VECREG:$rA))>; - -def : Pat<(v2i32 (SPUvec2half (v4i32 VECREG:$rA))), - (ORv2i32_v4i32 VECREG:$rA)>; -def : Pat<(v2f32 (SPUvec2half (v4f32 VECREG:$rA))), - (ORv2f32_v4f32 VECREG:$rA)>; - // Load Register: This is an assembler alias for a bitwise OR of a register // against itself. It's here because it brings some clarity to assembly // language output. @@ -2177,15 +2114,11 @@ def v8i16_m32 : SHUFBVecInst; def v4i32 : SHUFBVecInst; def v4i32_m32 : SHUFBVecInst; - def v2i32 : SHUFBVecInst; - def v2i32_m32 : SHUFBVecInst; def v2i64 : SHUFBVecInst; def v2i64_m32 : SHUFBVecInst; def v4f32 : SHUFBVecInst; def v4f32_m32 : SHUFBVecInst; - def v2f32 : SHUFBVecInst; - def v2f32_m32 : SHUFBVecInst; def v2f64 : SHUFBVecInst; def v2f64_m32 : SHUFBVecInst; @@ -3928,7 +3861,6 @@ multiclass SFPAdd { def v4f32: FAVecInst; - def v2f32: FAVecInst; def f32: FAInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), [(set R32FP:$rT, (fadd R32FP:$rA, R32FP:$rB))]>; } @@ -3947,7 +3879,6 @@ multiclass SFPSub { def v4f32: FSVecInst; - def v2f32: FSVecInst; def f32: FSInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), [(set R32FP:$rT, (fsub R32FP:$rA, R32FP:$rB))]>; } @@ -3967,7 +3898,6 @@ multiclass SFPMul { def v4f32: FMVecInst; - def v2f32: FMVecInst; def f32: FMInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), [(set R32FP:$rT, (fmul R32FP:$rA, R32FP:$rB))]>; } Modified: llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td Wed Aug 18 05:04:39 2010 @@ -39,7 +39,7 @@ (FSMBIv8i16 0xcccc))>; //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ -// v4i32, v2i32, i32 multiply instruction sequence: +// v4i32, i32 multiply instruction sequence: //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ def MPYv4i32: @@ -49,14 +49,6 @@ (v4i32 (MPYHv4i32 VECREG:$rB, VECREG:$rA)))), (v4i32 (MPYUv4i32 VECREG:$rA, VECREG:$rB)))>; -def MPYv2i32: - Pat<(mul (v2i32 VECREG:$rA), (v2i32 VECREG:$rB)), - (Av2i32 - (v2i32 (Av2i32 (v2i32 (MPYHv2i32 VECREG:$rA, VECREG:$rB)), - (v2i32 (MPYHv2i32 VECREG:$rB, VECREG:$rA)))), - (v2i32 (MPYUv2i32 VECREG:$rA, VECREG:$rB)))>; - - def MPYi32: Pat<(mul R32C:$rA, R32C:$rB), (Ar32 Modified: llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td Wed Aug 18 05:04:39 2010 @@ -394,7 +394,7 @@ // The SPU's registers as vector registers: def VECREG : RegisterClass<"SPU", - [v16i8,v8i16,v2i32,v2f32,v4i32,v4f32,v2i64,v2f64], + [v16i8,v8i16,v4i32,v4f32,v2i64,v2f64], 128, [ /* volatile register */ Modified: llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/arg_ret.ll Wed Aug 18 05:04:39 2010 @@ -26,7 +26,7 @@ define ccc %paramstruct @test_return( i32 %param, %paramstruct %prm ) { -;CHEKC: lqd $75, 80($sp) +;CHECK: lqd $75, 80($sp) ;CHECK: lr $3, $4 ret %paramstruct %prm } Modified: llvm/trunk/test/CodeGen/CellSPU/v2f32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2f32.ll?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2f32.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/v2f32.ll Wed Aug 18 05:04:39 2010 @@ -9,7 +9,7 @@ define %vec @test_add(%vec %param) { -;CHECK: fa $3, $3, $3 +;CHECK: fa {{\$.}}, $3, $3 %1 = fadd %vec %param, %param ;CHECK: bi $lr ret %vec %1 @@ -17,7 +17,7 @@ define %vec @test_sub(%vec %param) { -;CHECK: fs $3, $3, $3 +;CHECK: fs {{\$.}}, $3, $3 %1 = fsub %vec %param, %param ;CHECK: bi $lr @@ -26,7 +26,7 @@ define %vec @test_mul(%vec %param) { -;CHECK: fm $3, $3, $3 +;CHECK: fm {{\$.}}, $3, $3 %1 = fmul %vec %param, %param ;CHECK: bi $lr @@ -47,7 +47,7 @@ ;CHECK: stqd store %vec undef, %vec* null -;CHECK: stqd $3, 0($4) +;CHECK: stqd $3, 0(${{.}}) ;CHECK: bi $lr store %vec %val, %vec* %ptr ret void Modified: llvm/trunk/test/CodeGen/CellSPU/v2i32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2i32.ll?rev=111360&r1=111359&r2=111360&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2i32.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/v2i32.ll Wed Aug 18 05:04:39 2010 @@ -9,7 +9,7 @@ define %vec @test_add(%vec %param) { -;CHECK: a $3, $3, $3 +;CHECK: a {{\$.}}, $3, $3 %1 = add %vec %param, %param ;CHECK: bi $lr ret %vec %1 @@ -17,7 +17,7 @@ define %vec @test_sub(%vec %param) { -;CHECK: sf $3, $4, $3 +;CHECK: sf {{\$.}}, $4, $3 %1 = sub %vec %param, ;CHECK: bi $lr @@ -28,8 +28,8 @@ { ;CHECK: mpyu ;CHECK: mpyh -;CHECK: a -;CHECK: a $3 +;CHECK: a {{\$., \$., \$.}} +;CHECK: a {{\$., \$., \$.}} %1 = mul %vec %param, %param ;CHECK: bi $lr @@ -57,7 +57,7 @@ define void @test_store( %vec %val, %vec* %ptr) { -;CHECK: stqd $3, 0($4) +;CHECK: stqd $3, 0(${{.}}) ;CHECK: bi $lr store %vec %val, %vec* %ptr ret void From kalle.raiskila at nokia.com Wed Aug 18 05:20:30 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Wed, 18 Aug 2010 10:20:30 -0000 Subject: [llvm-commits] [llvm] r111361 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp test/CodeGen/CellSPU/shuffles.ll Message-ID: <20100818102030.1EC7F2A6C12C@llvm.org> Author: kraiskil Date: Wed Aug 18 05:20:29 2010 New Revision: 111361 URL: http://llvm.org/viewvc/llvm-project?rev=111361&view=rev Log: Fix a bug with insertelement on SPU. The previous algorithm in LowerVECTOR_SHUFFLE didn't check all requirements for "monotonic" shuffles. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=111361&r1=111360&r2=111361&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Aug 18 05:20:29 2010 @@ -1755,11 +1755,12 @@ // If we have a single element being moved from V1 to V2, this can be handled // using the C*[DX] compute mask instructions, but the vector elements have - // to be monotonically increasing with one exception element. + // to be monotonically increasing with one exception element, and the source + // slot of the element to move must be the same as the destination. EVT VecVT = V1.getValueType(); EVT EltVT = VecVT.getVectorElementType(); unsigned EltsFromV2 = 0; - unsigned V2Elt = 0; + unsigned V2EltOffset = 0; unsigned V2EltIdx0 = 0; unsigned CurrElt = 0; unsigned MaxElts = VecVT.getVectorNumElements(); @@ -1792,9 +1793,13 @@ if (monotonic) { if (SrcElt >= V2EltIdx0) { - if (1 >= (++EltsFromV2)) { - V2Elt = (V2EltIdx0 - SrcElt) << 2; - } + // TODO: optimize for the monotonic case when several consecutive + // elements are taken form V2. Do we ever get such a case? + if (EltsFromV2 == 0 && CurrElt == (SrcElt - V2EltIdx0)) + V2EltOffset = (SrcElt - V2EltIdx0) * (EltVT.getSizeInBits()/8); + else + monotonic = false; + ++EltsFromV2; } else if (CurrElt != SrcElt) { monotonic = false; } @@ -1830,7 +1835,7 @@ // R1 ($sp) is used here only as it is guaranteed to have last bits zero SDValue Pointer = DAG.getNode(SPUISD::IndirectAddr, dl, PtrVT, DAG.getRegister(SPU::R1, PtrVT), - DAG.getConstant(V2Elt, MVT::i32)); + DAG.getConstant(V2EltOffset, MVT::i32)); SDValue ShufMaskOp = DAG.getNode(SPUISD::SHUFFLE_MASK, dl, maskVT, Pointer); Modified: llvm/trunk/test/CodeGen/CellSPU/shuffles.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/shuffles.ll?rev=111361&r1=111360&r2=111361&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/shuffles.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Wed Aug 18 05:20:29 2010 @@ -16,3 +16,18 @@ ret <4 x float> %val } +define void @test_insert( <2 x float>* %ptr, float %val1, float %val2 ) { + %sl2_17_tmp1 = insertelement <2 x float> zeroinitializer, float %val1, i32 0 +;CHECK: lqa $6, +;CHECK: shufb $4, $4, $5, $6 + %sl2_17 = insertelement <2 x float> %sl2_17_tmp1, float %val2, i32 1 + +;CHECK: cdd $5, 0($3) +;CHECK: lqd $6, 0($3) +;CHECK: shufb $4, $4, $6, $5 +;CHECK: stqd $4, 0($3) +;CHECK: bi $lr + store <2 x float> %sl2_17, <2 x float>* %ptr + ret void +} + From dirty at apple.com Wed Aug 18 05:30:48 2010 From: dirty at apple.com (Cameron Esfahani) Date: Wed, 18 Aug 2010 03:30:48 -0700 Subject: [llvm-commits] [WinABI patch] Make sure to call __chkstk when appropriate In-Reply-To: References: Message-ID: On Aug 18, 2010, at 2:43 AM, Anton Korobeynikov wrote: > Hello, Cameron > >> Windows ABI requires the function prologue to call __chkstk if there is >= 4096 bytes allocated on the stack. > The patch is invalid due to many reasons: > - It does the stuff in wrong place I put it in the same area as the mingw case, for __alloca, so I thought it was in the right place. > - It clobbers eax which can be incoming arg reg in case of inreg > params / fast CC You're right it will clobber eax in the 32-bit case, so there'd have to be some code added to save/restore it. > - __chkstk is same as __alloca call in mingw case, which is already implemented > I'll have to take your word that __chkstk is the same as __alloca, but reading the documentation on Microsoft's website, it doesn't come across that way: __alloca: > Allocates memory on the stack. This function is deprecated because a more secure version is available; see _malloca. > __chkstk: > Called by the compiler when you have more than one page of local variables in your function. > > Also, I don't recall offhand, but iirc this call had some special CC, > it clobbers quite alot of regs, etc. According to the Microsoft website: > The __chkstk helper will not modify any registers other than R10, R11, and the condition codes. In particular, it will return RAX unchanged and leave all nonvolatile registers and argument-passing registers unmodified. > So, the only registers which are munged, in the 64-bit case, are the volatile ones. I assumed that the 32-bit case would be similar. The reason I didn't add this code to the mingw case is because that path never calls emitSPUpdate(): it relys on __alloca to do all the stack manipulation. This didn't appear to me that it would be valid, according to the Windows ABI. Cameron Esfahani dirty at apple.com "There are times in the life of a nation when the only place a decent man can find himself is in prison." -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/452400e6/attachment.html From asl at math.spbu.ru Wed Aug 18 05:56:13 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 18 Aug 2010 14:56:13 +0400 Subject: [llvm-commits] [WinABI patch] Make sure to call __chkstk when appropriate In-Reply-To: References: Message-ID: Hello, Cameron > I put it in the same area as the mingw case, for __alloca, so I thought it > was in the right place. Hrm... Doesn't seem so. Stuff really should be done inside emitPrologue(), not within some helper routine. > You're right it will clobber eax in the 32-bit case, so there'd have to be > some code added to save/restore it. emitPrologue() already handles this case for __alloca, no need to code duplication, you'll just have to tune the name there. > I'll have to take your word that __chkstk is the same as __alloca, but > reading the documentation on Microsoft's website, it doesn't come across > that way: > __alloca: > > Allocates memory on the stack. This function is deprecated because a more > secure version is available; see?_malloca. MS __alloca != mingw32 __alloca > The __chkstk helper will not modify any registers other than R10, R11, and > the condition codes. In particular, it will return RAX unchanged and leave > all nonvolatile registers and argument-passing registers unmodified. > > So, the only registers which are munged, in the 64-bit case, are the > volatile ones. ?I assumed that the 32-bit case would be similar. There is one point > The reason I didn't add this code to the mingw case is because that path > never calls?emitSPUpdate(): ?it relys on __alloca to do all the stack > manipulation. ?This didn't ?appear to me that it would be valid, according > to the Windows ABI. It definitely does all the stack manipulations, see above. I'm not quite sure about 64 bit case. I vague recall some discussion on gcc ML, that on 64 bit __chkstk != __alloca -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From etherzhhb at gmail.com Wed Aug 18 09:25:03 2010 From: etherzhhb at gmail.com (ether zhhb) Date: Wed, 18 Aug 2010 22:25:03 +0800 Subject: [llvm-commits] [PATCH] RegionInfo: Also free cached nodes when we clear the node cache. Message-ID: Hi, i also notice that in function clearNodeCahche of region class, we forget to delete the cached node before we clear the map. best regards ether --- lib/Analysis/RegionInfo.cpp | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp index abc057a..dfc76db 100644 --- a/lib/Analysis/RegionInfo.cpp +++ b/lib/Analysis/RegionInfo.cpp @@ -376,6 +376,11 @@ void Region::dump() const { } void Region::clearNodeCache() { + // Free the cached nodes. + for (BBNodeMapT::iterator it = BBNodeMap.begin(), + ie = BBNodeMap.end(); it != ie; ++it) + delete it->second; + BBNodeMap.clear(); for (Region::iterator RI = begin(), RE = end(); RI != RE; ++RI) (*RI)->clearNodeCache(); -- 1.7.1 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-RegionInfo-Also-free-cached-nodes-when-we-clear-the-.patch Type: application/octet-stream Size: 861 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/dba829be/attachment.obj From asl at math.spbu.ru Wed Aug 18 09:25:11 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 18 Aug 2010 18:25:11 +0400 Subject: [llvm-commits] PATCH: implement vector zext when vector types are legal (neon) In-Reply-To: References: Message-ID: > It's still pretty awful. ?The ANDs to mask off the high bits are unnecessary, and all those extra VMOVs should be avoided. Probably the best way is to splat zero into reg and after this emit a VZIP -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From kuwerty at gmail.com Wed Aug 18 00:32:32 2010 From: kuwerty at gmail.com (Krister Wombell) Date: Wed, 18 Aug 2010 13:32:32 +0800 Subject: [llvm-commits] [PATCH] Preserve sub-registers in PHIElimination Message-ID: PHI elimination doesn't preserve sub-registers of source operands when creating copy instructions. As an example take the following PHI instruction: %reg1045 = PHI %reg3456:v4sub2, , %reg1050, ; GPR:%reg1045,1050 QPR:%reg3456 QPR represents 128 bit registers with 4 x 32 bit sub-registers and GPR represents single 32 bit registers. The PHI is correct: it's selecting either a 32 bit register from reg1050 or selecting a 32 bit sub-register of reg3456. After PHI elimination BB7 contains: %reg3566 = COPY %reg3456; GPR:%reg3566 QPR:%reg3456 Now there's a copy of a 128 bit register to a 32 bit register but without any sub-register to determine what is going on. The patch preserves the sub-registers when creating copy instructions. Krister -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/2a38708d/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: patch Type: application/octet-stream Size: 994 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/2a38708d/attachment.obj From bob.wilson at apple.com Wed Aug 18 10:48:57 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 18 Aug 2010 08:48:57 -0700 Subject: [llvm-commits] PATCH: implement vector zext when vector types are legal (neon) In-Reply-To: References: Message-ID: On Aug 18, 2010, at 7:25 AM, Anton Korobeynikov wrote: >> It's still pretty awful. The ANDs to mask off the high bits are unnecessary, and all those extra VMOVs should be avoided. > Probably the best way is to splat zero into reg and after this emit a VZIP Nope. VMOVL is better. I realized last night that you can do it in one instruction. I'm looking now at all the NEON intrinsics for basic operations that extend one or both operands, and I can't figure out why they were ever needed. I'm starting to think that I just totally screwed that up. We should be able to avoid the intrinsics and represent those operations with zero_extend and sign_extend patterns. That would also avoid the need for the DAG combine pattern for vmlal. I'll give that a try. We'll either end up with a better solution or I'll remember why I did it that way in the first place. From clattner at apple.com Wed Aug 18 10:59:55 2010 From: clattner at apple.com (Chris Lattner) Date: Wed, 18 Aug 2010 08:59:55 -0700 Subject: [llvm-commits] [llvm] r111354 - /llvm/trunk/test/Analysis/BasicAA/gep-alias.ll In-Reply-To: <20100818045512.773A82A6C12C@llvm.org> References: <20100818045512.773A82A6C12C@llvm.org> Message-ID: <0010437A-95E5-4FF9-9BCF-7BC1BBF8E2EC@apple.com> FWIW I realized afterward that this test wasn't buggy, I will need to enhance the code to handle this. It's on my todo list. -Chris On Aug 17, 2010, at 9:55 PM, Chris Lattner wrote: > Author: lattner > Date: Tue Aug 17 23:55:12 2010 > New Revision: 111354 > > URL: http://llvm.org/viewvc/llvm-project?rev=111354&view=rev > Log: > fix a buggy test > > Modified: > llvm/trunk/test/Analysis/BasicAA/gep-alias.ll > > Modified: llvm/trunk/test/Analysis/BasicAA/gep-alias.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/gep-alias.ll?rev=111354&r1=111353&r2=111354&view=diff > ============================================================================== > --- llvm/trunk/test/Analysis/BasicAA/gep-alias.ll (original) > +++ llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Tue Aug 17 23:55:12 2010 > @@ -115,13 +115,13 @@ > ; CHECK: ret i32 0 > } > > -; P[zext(i)] != p[zext(i+1)] > +; P[sext(i)] != p[sext(i+1)] > ; PR1143 > define i32 @test8(i32* %p, i32 %i) { > - %i1 = zext i32 %i to i64 > + %i1 = sext i32 %i to i64 > %pi = getelementptr i32* %p, i64 %i1 > %i.next = add i32 %i, 1 > - %i.next2 = zext i32 %i.next to i64 > + %i.next2 = sext i32 %i.next to i64 > %pi.next = getelementptr i32* %p, i64 %i.next2 > %x = load i32* %pi > store i32 42, i32* %pi.next > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Wed Aug 18 11:02:24 2010 From: clattner at apple.com (Chris Lattner) Date: Wed, 18 Aug 2010 09:02:24 -0700 Subject: [llvm-commits] [llvm] r111360 - in /llvm/trunk: lib/Target/CellSPU/SPUCallingConv.td lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUMathInstr.td lib/Target/CellSPU/SPURegisterInfo.td test/CodeGen/CellSPU/arg_ret.ll test/CodeGen/CellSPU/v2f32.ll test/CodeGen/CellSPU/v2i32.ll In-Reply-To: <20100818100439.C6B222A6C12C@llvm.org> References: <20100818100439.C6B222A6C12C@llvm.org> Message-ID: On Aug 18, 2010, at 3:04 AM, Kalle Raiskila wrote: > Author: kraiskil > Date: Wed Aug 18 05:04:39 2010 > New Revision: 111360 > > URL: http://llvm.org/viewvc/llvm-project?rev=111360&view=rev > Log: > Remove all traces of v2[i,f]32 on SPU. > > The "half vectors" are now widened to full size by the legalizer. > The only exception is in parameter passing, where half vectors are > expanded. This causes changes to some dejagnu tests. Nice! From stoklund at 2pi.dk Wed Aug 18 11:09:47 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 16:09:47 -0000 Subject: [llvm-commits] [llvm] r111366 - /llvm/trunk/lib/CodeGen/PHIElimination.cpp Message-ID: <20100818160947.422A62A6C12C@llvm.org> Author: stoklund Date: Wed Aug 18 11:09:47 2010 New Revision: 111366 URL: http://llvm.org/viewvc/llvm-project?rev=111366&view=rev Log: Preserve subregs on PHI source operands. Patch by Krister Wombell! Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=111366&r1=111365&r2=111366&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Wed Aug 18 11:09:47 2010 @@ -181,6 +181,7 @@ unsigned NumSrcs = (MPhi->getNumOperands() - 1) / 2; unsigned DestReg = MPhi->getOperand(0).getReg(); + assert(MPhi->getOperand(0).getSubReg() == 0 && "Can't handle sub-reg PHIs"); bool isDead = MPhi->getOperand(0).isDead(); // Create a new register for the incoming PHI arguments. @@ -267,6 +268,8 @@ SmallPtrSet MBBsInsertedInto; for (int i = NumSrcs - 1; i >= 0; --i) { unsigned SrcReg = MPhi->getOperand(i*2+1).getReg(); + unsigned SrcSubReg = MPhi->getOperand(i*2+1).getSubReg(); + assert(TargetRegisterInfo::isVirtualRegister(SrcReg) && "Machine PHI Operands must all be virtual registers!"); @@ -296,7 +299,7 @@ // Insert the copy. if (!reusedIncoming && IncomingReg) BuildMI(opBlock, InsertPos, MPhi->getDebugLoc(), - TII->get(TargetOpcode::COPY), IncomingReg).addReg(SrcReg); + TII->get(TargetOpcode::COPY), IncomingReg).addReg(SrcReg, 0, SrcSubReg); // Now update live variable information if we have it. Otherwise we're done if (!LV) continue; From stoklund at 2pi.dk Wed Aug 18 11:11:26 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 09:11:26 -0700 Subject: [llvm-commits] [PATCH] Preserve sub-registers in PHIElimination In-Reply-To: References: Message-ID: <2E42E878-0AD0-4FAD-B255-C2AD454910B1@2pi.dk> On Aug 17, 2010, at 10:32 PM, Krister Wombell wrote: > PHI elimination doesn't preserve sub-registers of source operands when creating copy instructions. As an example take the following PHI instruction: > > %reg1045 = PHI %reg3456:v4sub2, , %reg1050, ; GPR:%reg1045,1050 QPR:%reg3456 > > QPR represents 128 bit registers with 4 x 32 bit sub-registers and GPR represents single 32 bit registers. The PHI is correct: it's selecting either a 32 bit register from reg1050 or selecting a 32 bit sub-register of reg3456. > > After PHI elimination BB7 contains: > > %reg3566 = COPY %reg3456; GPR:%reg3566 QPR:%reg3456 > > Now there's a copy of a 128 bit register to a 32 bit register but without any sub-register to determine what is going on. > > The patch preserves the sub-registers when creating copy instructions. Thanks, applied in r111366 with an additional assertion for subregs in the PHI def operand. Do you have any test cases? I am a little confused how this is even possible. Random subreg operands are not introduced until coalescing. /jakob From gohman at apple.com Wed Aug 18 12:20:51 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 17:20:51 -0000 Subject: [llvm-commits] [llvm] r111367 - /llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <20100818172051.38A512A6C12C@llvm.org> Author: djg Date: Wed Aug 18 12:20:51 2010 New Revision: 111367 URL: http://llvm.org/viewvc/llvm-project?rev=111367&view=rev Log: Remove an unused command-line option. Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp?rev=111367&r1=111366&r2=111367&view=diff ============================================================================== --- llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp (original) +++ llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Wed Aug 18 12:20:51 2010 @@ -46,9 +46,6 @@ static cl::opt InputFilename(cl::Positional, cl::desc(""), cl::init("-")); -static cl::opt - OutputFilename("-o", cl::init("-"), cl::desc("")); - static cl::opt Dump("dump", cl::desc("Dump low level bitcode trace")); //===----------------------------------------------------------------------===// From gohman at apple.com Wed Aug 18 12:21:42 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 17:21:42 -0000 Subject: [llvm-commits] [llvm] r111368 - /llvm/trunk/tools/llvm-extract/llvm-extract.cpp Message-ID: <20100818172142.D9EA62A6C12C@llvm.org> Author: djg Date: Wed Aug 18 12:21:42 2010 New Revision: 111368 URL: http://llvm.org/viewvc/llvm-project?rev=111368&view=rev Log: Don't register stdout to be deleted on a signal. Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-extract/llvm-extract.cpp?rev=111368&r1=111367&r2=111368&view=diff ============================================================================== --- llvm/trunk/tools/llvm-extract/llvm-extract.cpp (original) +++ llvm/trunk/tools/llvm-extract/llvm-extract.cpp Wed Aug 18 12:21:42 2010 @@ -118,7 +118,8 @@ // Make sure that the Output file gets unlinked from the disk if we get a // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + if (OutputFilename != "-") + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); std::string ErrorInfo; raw_fd_ostream Out(OutputFilename.c_str(), ErrorInfo, From gohman at apple.com Wed Aug 18 12:26:50 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 17:26:50 -0000 Subject: [llvm-commits] [llvm] r111370 - /llvm/trunk/tools/llc/llc.cpp Message-ID: <20100818172650.7E3962A6C12C@llvm.org> Author: djg Date: Wed Aug 18 12:26:50 2010 New Revision: 111370 URL: http://llvm.org/viewvc/llvm-project?rev=111370&view=rev Log: Don't translate "-" to outs() manually; raw_ostream does that automatically. Modified: llvm/trunk/tools/llc/llc.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=111370&r1=111369&r2=111370&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Wed Aug 18 12:26:50 2010 @@ -127,14 +127,11 @@ static formatted_raw_ostream *GetOutputStream(const char *TargetName, Triple::OSType OS, const char *ProgName) { - if (OutputFilename != "") { - if (OutputFilename == "-") - return new formatted_raw_ostream(outs(), - formatted_raw_ostream::PRESERVE_STREAM); - + if (!OutputFilename.empty()) { // Make sure that the Out file gets unlinked from the disk if we get a // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + if (OutputFilename != "-") + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); std::string error; raw_fd_ostream *FDOut = From gohman at apple.com Wed Aug 18 12:40:10 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 17:40:10 -0000 Subject: [llvm-commits] [llvm] r111371 - /llvm/trunk/tools/opt/opt.cpp Message-ID: <20100818174010.C5DEA2A6C12C@llvm.org> Author: djg Date: Wed Aug 18 12:40:10 2010 New Revision: 111371 URL: http://llvm.org/viewvc/llvm-project?rev=111371&view=rev Log: Don't translate "-" to outs() manually; raw_ostream does that automatically. Modified: llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=111371&r1=111370&r2=111371&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Wed Aug 18 12:40:10 2010 @@ -53,7 +53,7 @@ static cl::opt OutputFilename("o", cl::desc("Override output filename"), - cl::value_desc("filename"), cl::init("-")); + cl::value_desc("filename")); static cl::opt Force("f", cl::desc("Enable binary output on terminals")); @@ -381,34 +381,27 @@ // Figure out what stream we are supposed to write to... raw_ostream *Out = 0; - bool DeleteStream = false; - if (!NoOutput && !AnalyzeOnly) { - if (OutputFilename == "-") { - // Print to stdout. - Out = &outs(); - // If we're printing a bitcode file, switch stdout to binary mode. - // FIXME: This switches outs() globally, not just for the bitcode output. - if (!OutputAssembly) - sys::Program::ChangeStdoutToBinary(); - } else { - if (NoOutput || AnalyzeOnly) { - errs() << "WARNING: The -o (output filename) option is ignored when\n" - "the --disable-output or --analyze options are used.\n"; - } else { - // Make sure that the Output file gets unlinked from the disk if we get - // a SIGINT. - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - - std::string ErrorInfo; - Out = new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary); - if (!ErrorInfo.empty()) { - errs() << ErrorInfo << '\n'; - delete Out; - return 1; - } - DeleteStream = true; - } + if (NoOutput || AnalyzeOnly) { + if (!OutputFilename.empty()) + errs() << "WARNING: The -o (output filename) option is ignored when\n" + "the --disable-output or --analyze options are used.\n"; + } else { + // Default to standard output. + if (OutputFilename.empty()) + OutputFilename = "-"; + + // Make sure that the Output file gets unlinked from the disk if we get + // a SIGINT. + if (OutputFilename != "-") + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + + std::string ErrorInfo; + Out = new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary); + if (!ErrorInfo.empty()) { + errs() << ErrorInfo << '\n'; + delete Out; + return 1; } } @@ -553,7 +546,6 @@ Passes.run(*M.get()); // Delete the raw_fd_ostream. - if (DeleteStream) - delete Out; + delete Out; return 0; } From gohman at apple.com Wed Aug 18 12:42:59 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 17:42:59 -0000 Subject: [llvm-commits] [llvm] r111372 - /llvm/trunk/tools/opt/opt.cpp Message-ID: <20100818174259.E10AD2A6C12C@llvm.org> Author: djg Date: Wed Aug 18 12:42:59 2010 New Revision: 111372 URL: http://llvm.org/viewvc/llvm-project?rev=111372&view=rev Log: Allow the -analyze option to follow the -o option, which defaults to standard output, instead of just hardcoding outs(). Modified: llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=111372&r1=111371&r2=111372&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Wed Aug 18 12:42:59 2010 @@ -138,17 +138,18 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass { static char ID; const PassInfo *PassToPrint; - CallGraphSCCPassPrinter(const PassInfo *PI) : - CallGraphSCCPass(ID), PassToPrint(PI) {} + raw_ostream &Out; + CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out) : + CallGraphSCCPass(ID), PassToPrint(PI), Out(out) {} virtual bool runOnSCC(CallGraphSCC &SCC) { if (!Quiet) { - outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; + Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { Function *F = (*I)->getFunction(); if (F) - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + getAnalysisID(PassToPrint->getTypeInfo()).print(Out, F->getParent()); } } @@ -169,13 +170,14 @@ struct ModulePassPrinter : public ModulePass { static char ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : ModulePass(ID), - PassToPrint(PI) {} + raw_ostream &Out; + ModulePassPrinter(const PassInfo *PI, raw_ostream &out) + : ModulePass(ID), PassToPrint(PI), Out(out) {} virtual bool runOnModule(Module &M) { if (!Quiet) { - outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), &M); + Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; + getAnalysisID(PassToPrint->getTypeInfo()).print(Out, &M); } // Get and print pass... @@ -193,17 +195,18 @@ char ModulePassPrinter::ID = 0; struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; + raw_ostream &Out; static char ID; - FunctionPassPrinter(const PassInfo *PI) : FunctionPass(ID), - PassToPrint(PI) {} + FunctionPassPrinter(const PassInfo *PI, raw_ostream &out) + : FunctionPass(ID), PassToPrint(PI), Out(out) {} virtual bool runOnFunction(Function &F) { if (!Quiet) { - outs() << "Printing analysis '" << PassToPrint->getPassName() - << "' for function '" << F.getName() << "':\n"; + Out << "Printing analysis '" << PassToPrint->getPassName() + << "' for function '" << F.getName() << "':\n"; } // Get and print pass... - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + getAnalysisID(PassToPrint->getTypeInfo()).print(Out, F.getParent()); return false; } @@ -221,13 +224,14 @@ struct LoopPassPrinter : public LoopPass { static char ID; const PassInfo *PassToPrint; - LoopPassPrinter(const PassInfo *PI) : - LoopPass(ID), PassToPrint(PI) {} + raw_ostream &Out; + LoopPassPrinter(const PassInfo *PI, raw_ostream &out) : + LoopPass(ID), PassToPrint(PI), Out(out) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { if (!Quiet) { - outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; + getAnalysisID(PassToPrint->getTypeInfo()).print(Out, L->getHeader()->getParent()->getParent()); } // Get and print pass... @@ -246,18 +250,19 @@ struct BasicBlockPassPrinter : public BasicBlockPass { const PassInfo *PassToPrint; + raw_ostream &Out; static char ID; - BasicBlockPassPrinter(const PassInfo *PI) - : BasicBlockPass(ID), PassToPrint(PI) {} + BasicBlockPassPrinter(const PassInfo *PI, raw_ostream &out) + : BasicBlockPass(ID), PassToPrint(PI), Out(out) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { - outs() << "Printing Analysis info for BasicBlock '" << BB.getName() - << "': Pass " << PassToPrint->getPassName() << ":\n"; + Out << "Printing Analysis info for BasicBlock '" << BB.getName() + << "': Pass " << PassToPrint->getPassName() << ":\n"; } // Get and print pass... - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + getAnalysisID(PassToPrint->getTypeInfo()).print(Out, BB.getParent()->getParent()); return false; } @@ -381,10 +386,10 @@ // Figure out what stream we are supposed to write to... raw_ostream *Out = 0; - if (NoOutput || AnalyzeOnly) { + if (NoOutput) { if (!OutputFilename.empty()) errs() << "WARNING: The -o (output filename) option is ignored when\n" - "the --disable-output or --analyze options are used.\n"; + "the --disable-output option is used.\n"; } else { // Default to standard output. if (OutputFilename.empty()) @@ -485,19 +490,19 @@ if (AnalyzeOnly) { switch (Kind) { case PT_BasicBlock: - Passes.add(new BasicBlockPassPrinter(PassInf)); + Passes.add(new BasicBlockPassPrinter(PassInf, *Out)); break; case PT_Loop: - Passes.add(new LoopPassPrinter(PassInf)); + Passes.add(new LoopPassPrinter(PassInf, *Out)); break; case PT_Function: - Passes.add(new FunctionPassPrinter(PassInf)); + Passes.add(new FunctionPassPrinter(PassInf, *Out)); break; case PT_CallGraphSCC: - Passes.add(new CallGraphSCCPassPrinter(PassInf)); + Passes.add(new CallGraphSCCPassPrinter(PassInf, *Out)); break; default: - Passes.add(new ModulePassPrinter(PassInf)); + Passes.add(new ModulePassPrinter(PassInf, *Out)); break; } } @@ -534,7 +539,7 @@ if (!NoVerify && !VerifyEach) Passes.add(createVerifierPass()); - // Write bitcode or assembly out to disk or outs() as the last step... + // Write bitcode or assembly to the output as the last step... if (!NoOutput && !AnalyzeOnly) { if (OutputAssembly) Passes.add(createPrintModulePass(Out)); From gohman at apple.com Wed Aug 18 12:55:15 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 17:55:15 -0000 Subject: [llvm-commits] [llvm] r111373 - /llvm/trunk/tools/llc/llc.cpp Message-ID: <20100818175515.A3E512A6C12C@llvm.org> Author: djg Date: Wed Aug 18 12:55:15 2010 New Revision: 111373 URL: http://llvm.org/viewvc/llvm-project?rev=111373&view=rev Log: Eliminate some redundancy by relying on raw_fd_ostream to handle "-" properly. Modified: llvm/trunk/tools/llc/llc.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=111373&r1=111372&r2=111373&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Wed Aug 18 12:55:15 2010 @@ -127,66 +127,57 @@ static formatted_raw_ostream *GetOutputStream(const char *TargetName, Triple::OSType OS, const char *ProgName) { - if (!OutputFilename.empty()) { - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - - std::string error; - raw_fd_ostream *FDOut = - new raw_fd_ostream(OutputFilename.c_str(), error, - raw_fd_ostream::F_Binary); - if (!error.empty()) { - errs() << error << '\n'; - delete FDOut; - return 0; + // If we don't yet have an output filename, make one. + if (OutputFilename.empty()) { + if (InputFilename == "-") + OutputFilename = "-"; + else { + OutputFilename = GetFileNameRoot(InputFilename); + + switch (FileType) { + default: assert(0 && "Unknown file type"); + case TargetMachine::CGFT_AssemblyFile: + if (TargetName[0] == 'c') { + if (TargetName[1] == 0) + OutputFilename += ".cbe.c"; + else if (TargetName[1] == 'p' && TargetName[2] == 'p') + OutputFilename += ".cpp"; + else + OutputFilename += ".s"; + } else + OutputFilename += ".s"; + break; + case TargetMachine::CGFT_ObjectFile: + if (OS == Triple::Win32) + OutputFilename += ".obj"; + else + OutputFilename += ".o"; + break; + case TargetMachine::CGFT_Null: + OutputFilename += ".null"; + break; + } } - formatted_raw_ostream *Out = - new formatted_raw_ostream(*FDOut, formatted_raw_ostream::DELETE_STREAM); - - return Out; } - if (InputFilename == "-") { - OutputFilename = "-"; - return new formatted_raw_ostream(outs(), - formatted_raw_ostream::PRESERVE_STREAM); - } - - OutputFilename = GetFileNameRoot(InputFilename); - + // Decide if we need "binary" output. bool Binary = false; switch (FileType) { default: assert(0 && "Unknown file type"); case TargetMachine::CGFT_AssemblyFile: - if (TargetName[0] == 'c') { - if (TargetName[1] == 0) - OutputFilename += ".cbe.c"; - else if (TargetName[1] == 'p' && TargetName[2] == 'p') - OutputFilename += ".cpp"; - else - OutputFilename += ".s"; - } else - OutputFilename += ".s"; break; case TargetMachine::CGFT_ObjectFile: - if (OS == Triple::Win32) - OutputFilename += ".obj"; - else - OutputFilename += ".o"; - Binary = true; - break; case TargetMachine::CGFT_Null: - OutputFilename += ".null"; Binary = true; break; } // Make sure that the Out file gets unlinked from the disk if we get a // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + if (OutputFilename != "-") + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + // Open the file. std::string error; unsigned OpenFlags = 0; if (Binary) OpenFlags |= raw_fd_ostream::F_Binary; From grosbach at apple.com Wed Aug 18 12:57:37 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 18 Aug 2010 17:57:37 -0000 Subject: [llvm-commits] [llvm] r111374 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h Message-ID: <20100818175737.BA9A92A6C12C@llvm.org> Author: grosbach Date: Wed Aug 18 12:57:37 2010 New Revision: 111374 URL: http://llvm.org/viewvc/llvm-project?rev=111374&view=rev Log: Add hook for re-using virtual base registers for local stack slot access. Nothing fancy, just ask the target if any currently available base reg is in range for the instruction under consideration and use the first one that is. Placeholder ARM implementation simply returns false for now. ongoing saga of rdar://8277890 Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111374&r1=111373&r2=111374&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Wed Aug 18 12:57:37 2010 @@ -659,6 +659,13 @@ assert(0 && "resolveFrameIndex does not exist on this target"); } + /// isBaseRegInRange - Determine whether a given base register definition + /// is in range to resolve a frame index. + virtual bool isBaseRegInRange(const MachineInstr *MI, unsigned Reg, + int64_t Offset) const { + assert(0 && "isBaseRegInRange does not exist on this target"); + return false; // Must return a value in order to compile with VS 2005 + } /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the /// frame setup/destroy instructions if they exist (-1 otherwise). Some Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111374&r1=111373&r2=111374&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Wed Aug 18 12:57:37 2010 @@ -146,6 +146,20 @@ MFI->setLocalFrameMaxAlign(MaxAlign); } +static inline bool +lookupCandidateBaseReg(const SmallVector, 8> &Regs, + std::pair &RegOffset, + const MachineInstr *MI, + const TargetRegisterInfo *TRI) { + unsigned e = Regs.size(); + for (unsigned i = 0; i < e; ++i) { + RegOffset = Regs[i]; + if (TRI->isBaseRegInRange(MI, RegOffset.first, RegOffset.second)) + return true; + } + return false; +} + void LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) { // Scan the function's instructions looking for frame index references. // For each, ask the target if it wants a virtual base register for it @@ -169,6 +183,9 @@ if (MI->isDebugValue()) continue; + // A base register definition is a register+offset pair. + SmallVector, 8> BaseRegisters; + // For now, allocate the base register(s) within the basic block // where they're used, and don't try to keep them around outside // of that. It may be beneficial to try sharing them more broadly @@ -186,27 +203,39 @@ DEBUG(dbgs() << "Considering: " << *MI); if (TRI->needsFrameBaseReg(MI, i)) { + unsigned BaseReg = 0; + unsigned Offset = 0; + DEBUG(dbgs() << " Replacing FI in: " << *MI); - // FIXME: Make sure any new base reg is aligned reasonably. TBD - // what "reasonably" really means. Conservatively, can just - // use the alignment of the local block. // If we have a suitable base register available, use it; otherwise // create a new one. - // FIXME: For the moment, just always create a new one. - - const TargetRegisterClass *RC = TRI->getPointerRegClass(); - unsigned BaseReg = Fn.getRegInfo().createVirtualRegister(RC); - // Tell the target to insert the instruction to initialize - // the base register. - TRI->materializeFrameBaseRegister(I, BaseReg, FrameIdx); + std::pair RegOffset; + if (lookupCandidateBaseReg(BaseRegisters, RegOffset, MI, TRI)) { + // We found a register to reuse. + BaseReg = RegOffset.first; + Offset = RegOffset.second; + } else { + // No previously defined register was in range, so create a + // new one. + const TargetRegisterClass *RC = TRI->getPointerRegClass(); + BaseReg = Fn.getRegInfo().createVirtualRegister(RC); + + // Tell the target to insert the instruction to initialize + // the base register. + TRI->materializeFrameBaseRegister(I, BaseReg, FrameIdx); + + BaseRegisters.push_back(std::pair(BaseReg, + Offset)); + ++NumBaseRegisters; + } + assert(BaseReg != 0 && "Unable to allocate virtual base register!"); // Modify the instruction to use the new base register rather // than the frame index operand. - TRI->resolveFrameIndex(I, BaseReg, 0); + TRI->resolveFrameIndex(I, BaseReg, Offset); - ++NumBaseRegisters; ++NumReplacements; } Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=111374&r1=111373&r2=111374&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Aug 18 12:57:37 2010 @@ -1451,6 +1451,12 @@ assert (Done && "Unable to resolve frame index!"); } +bool ARMBaseRegisterInfo::isBaseRegInRange(const MachineInstr *MI, + unsigned Reg, int64_t Offset) const { + + return false; +} + unsigned ARMBaseRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, FrameIndexValue *Value, Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=111374&r1=111373&r2=111374&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Wed Aug 18 12:57:37 2010 @@ -110,6 +110,8 @@ unsigned BaseReg, int FrameIdx) const; void resolveFrameIndex(MachineBasicBlock::iterator I, unsigned BaseReg, int64_t Offset) const; + bool isBaseRegInRange(const MachineInstr *MI, unsigned Reg, + int64_t Offset) const; bool cannotEliminateFrame(const MachineFunction &MF) const; From sabre at nondot.org Wed Aug 18 13:22:17 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 18:22:17 -0000 Subject: [llvm-commits] [llvm] r111375 - in /llvm/trunk: include/llvm/Analysis/ValueTracking.h lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/ValueTracking.cpp Message-ID: <20100818182217.8A01B2A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 13:22:17 2010 New Revision: 111375 URL: http://llvm.org/viewvc/llvm-project?rev=111375&view=rev Log: move gep decomposition out of ValueTracking into BasicAA. The form of decomposition that it is doing is very basicaa specific and is only used by basicaa. Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=111375&r1=111374&r2=111375&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ValueTracking.h (original) +++ llvm/trunk/include/llvm/Analysis/ValueTracking.h Wed Aug 18 13:22:17 2010 @@ -77,25 +77,6 @@ /// bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0); - /// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose - /// it into a base pointer with a constant offset and a number of scaled - /// symbolic offsets. - /// - /// The scaled symbolic offsets (represented by pairs of a Value* and a scale - /// in the VarIndices vector) are Value*'s that are known to be scaled by the - /// specified amount, but which may have other unrepresented high bits. As - /// such, the gep cannot necessarily be reconstructed from its decomposed - /// form. - /// - /// When TargetData is around, this function is capable of analyzing - /// everything that Value::getUnderlyingObject() can look through. When not, - /// it just looks through pointer casts. - /// - const Value *DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl > &VarIndices, - const TargetData *TD); - - /// FindInsertedValue - Given an aggregrate and an sequence of indices, see if /// the scalar value indexed is already around as a register, for example if Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=111375&r1=111374&r2=111375&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 18 13:22:17 2010 @@ -30,6 +30,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/GetElementPtrTypeIterator.h" #include using namespace llvm; @@ -193,6 +194,218 @@ ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } //===----------------------------------------------------------------------===// +// GetElementPtr Instruction Decomposition and Analysis +//===----------------------------------------------------------------------===// + + +/// GetLinearExpression - Analyze the specified value as a linear expression: +/// "A*V + B", where A and B are constant integers. Return the scale and offset +/// values as APInts and return V as a Value*. The incoming Value is known to +/// have IntegerType. Note that this looks through extends, so the high bits +/// may not be represented in the result. +static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, + const TargetData *TD, unsigned Depth) { + assert(V->getType()->isIntegerTy() && "Not an integer value"); + + // Limit our recursion depth. + if (Depth == 6) { + Scale = 1; + Offset = 0; + return V; + } + + if (BinaryOperator *BOp = dyn_cast(V)) { + if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { + switch (BOp->getOpcode()) { + default: break; + case Instruction::Or: + // X|C == X+C if all the bits in C are unset in X. Otherwise we can't + // analyze it. + if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) + break; + // FALL THROUGH. + case Instruction::Add: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset += RHSC->getValue(); + return V; + case Instruction::Mul: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset *= RHSC->getValue(); + Scale *= RHSC->getValue(); + return V; + case Instruction::Shl: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset <<= RHSC->getValue().getLimitedValue(); + Scale <<= RHSC->getValue().getLimitedValue(); + return V; + } + } + } + + // Since GEP indices are sign extended anyway, we don't care about the high + // bits of a sign extended value - just scales and offsets. + if (isa(V)) { + Value *CastOp = cast(V)->getOperand(0); + unsigned OldWidth = Scale.getBitWidth(); + unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); + Scale.trunc(SmallWidth); + Offset.trunc(SmallWidth); + Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); + Scale.zext(OldWidth); + Offset.zext(OldWidth); + return Result; + } + + Scale = 1; + Offset = 0; + return V; +} + +/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it +/// into a base pointer with a constant offset and a number of scaled symbolic +/// offsets. +/// +/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in +/// the VarIndices vector) are Value*'s that are known to be scaled by the +/// specified amount, but which may have other unrepresented high bits. As such, +/// the gep cannot necessarily be reconstructed from its decomposed form. +/// +/// When TargetData is around, this function is capable of analyzing everything +/// that Value::getUnderlyingObject() can look through. When not, it just looks +/// through pointer casts. +/// +static const Value * +DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, + SmallVectorImpl > &VarIndices, + const TargetData *TD) { + // Limit recursion depth to limit compile time in crazy cases. + unsigned MaxLookup = 6; + + BaseOffs = 0; + do { + // Look through global aliases and bitcasts. + V = V->stripPointerCasts(); + + const GEPOperator *GEPOp = dyn_cast(V); + if (GEPOp == 0) + return V; + + // Don't attempt to analyze GEPs over unsized objects. + if (!cast(GEPOp->getOperand(0)->getType()) + ->getElementType()->isSized()) + return V; + + // If we are lacking TargetData information, we can't compute the offets of + // elements computed by GEPs. However, we can handle bitcast equivalent + // GEPs. + if (!TD) { + if (!GEPOp->hasAllZeroIndices()) + return V; + V = GEPOp->getOperand(0); + continue; + } + + // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. + gep_type_iterator GTI = gep_type_begin(GEPOp); + for (User::const_op_iterator I = GEPOp->op_begin()+1, + E = GEPOp->op_end(); I != E; ++I) { + Value *Index = *I; + // Compute the (potentially symbolic) offset in bytes for this index. + if (const StructType *STy = dyn_cast(*GTI++)) { + // For a struct, add the member offset. + unsigned FieldNo = cast(Index)->getZExtValue(); + if (FieldNo == 0) continue; + + BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); + continue; + } + + // For an array/pointer, add the element offset, explicitly scaled. + if (ConstantInt *CIdx = dyn_cast(Index)) { + if (CIdx->isZero()) continue; + BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); + continue; + } + + uint64_t Scale = TD->getTypeAllocSize(*GTI); + + // Use GetLinearExpression to decompose the index into a C1*V+C2 form. + unsigned Width = cast(Index->getType())->getBitWidth(); + APInt IndexScale(Width, 0), IndexOffset(Width, 0); + Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); + + // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. + // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. + BaseOffs += IndexOffset.getZExtValue()*Scale; + Scale *= IndexScale.getZExtValue(); + + + // If we already had an occurrance of this index variable, merge this + // scale into it. For example, we want to handle: + // A[x][x] -> x*16 + x*4 -> x*20 + // This also ensures that 'x' only appears in the index list once. + for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { + if (VarIndices[i].first == Index) { + Scale += VarIndices[i].second; + VarIndices.erase(VarIndices.begin()+i); + break; + } + } + + // Make sure that we have a scale that makes sense for this target's + // pointer size. + if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { + Scale <<= ShiftBits; + Scale >>= ShiftBits; + } + + if (Scale) + VarIndices.push_back(std::make_pair(Index, Scale)); + } + + // Analyze the base pointer next. + V = GEPOp->getOperand(0); + } while (--MaxLookup); + + // If the chain of expressions is too deep, just return early. + return V; +} + +/// GetIndexDifference - Dest and Src are the variable indices from two +/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base +/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic +/// difference between the two pointers. +static void GetIndexDifference( + SmallVectorImpl > &Dest, + const SmallVectorImpl > &Src) { + if (Src.empty()) return; + + for (unsigned i = 0, e = Src.size(); i != e; ++i) { + const Value *V = Src[i].first; + int64_t Scale = Src[i].second; + + // Find V in Dest. This is N^2, but pointer indices almost never have more + // than a few variable indexes. + for (unsigned j = 0, e = Dest.size(); j != e; ++j) { + if (Dest[j].first != V) continue; + + // If we found it, subtract off Scale V's from the entry in Dest. If it + // goes to zero, remove the entry. + if (Dest[j].second != Scale) + Dest[j].second -= Scale; + else + Dest.erase(Dest.begin()+j); + Scale = 0; + break; + } + + // If we didn't consume this entry, add it to the end of the Dest list. + if (Scale) + Dest.push_back(std::make_pair(V, -Scale)); + } +} + +//===----------------------------------------------------------------------===// // BasicAliasAnalysis Pass //===----------------------------------------------------------------------===// @@ -467,40 +680,6 @@ } -/// GetIndexDifference - Dest and Src are the variable indices from two -/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base -/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic -/// difference between the two pointers. -static void GetIndexDifference( - SmallVectorImpl > &Dest, - const SmallVectorImpl > &Src) { - if (Src.empty()) return; - - for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].first; - int64_t Scale = Src[i].second; - - // Find V in Dest. This is N^2, but pointer indices almost never have more - // than a few variable indexes. - for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].first != V) continue; - - // If we found it, subtract off Scale V's from the entry in Dest. If it - // goes to zero, remove the entry. - if (Dest[j].second != Scale) - Dest[j].second -= Scale; - else - Dest.erase(Dest.begin()+j); - Scale = 0; - break; - } - - // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) - Dest.push_back(std::make_pair(V, -Scale)); - } -} - /// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction /// against another pointer. We know that V1 is a GEP, but we don't know /// anything about V2. UnderlyingV1 is GEP1->getUnderlyingObject(), Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=111375&r1=111374&r2=111375&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Aug 18 13:22:17 2010 @@ -974,194 +974,6 @@ } -/// GetLinearExpression - Analyze the specified value as a linear expression: -/// "A*V + B", where A and B are constant integers. Return the scale and offset -/// values as APInts and return V as a Value*. The incoming Value is known to -/// have IntegerType. Note that this looks through extends, so the high bits -/// may not be represented in the result. -static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, - const TargetData *TD, unsigned Depth) { - assert(V->getType()->isIntegerTy() && "Not an integer value"); - - // Limit our recursion depth. - if (Depth == 6) { - Scale = 1; - Offset = 0; - return V; - } - - if (BinaryOperator *BOp = dyn_cast(V)) { - if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { - switch (BOp->getOpcode()) { - default: break; - case Instruction::Or: - // X|C == X+C if all the bits in C are unset in X. Otherwise we can't - // analyze it. - if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) - break; - // FALL THROUGH. - case Instruction::Add: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset += RHSC->getValue(); - return V; - case Instruction::Mul: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset *= RHSC->getValue(); - Scale *= RHSC->getValue(); - return V; - case Instruction::Shl: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset <<= RHSC->getValue().getLimitedValue(); - Scale <<= RHSC->getValue().getLimitedValue(); - return V; - } - } - } - - // Since GEP indices are sign extended anyway, we don't care about the high - // bits of a sign extended value - just scales and offsets. - if (isa(V)) { - Value *CastOp = cast(V)->getOperand(0); - unsigned OldWidth = Scale.getBitWidth(); - unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); - Scale.trunc(SmallWidth); - Offset.trunc(SmallWidth); - Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); - Scale.zext(OldWidth); - Offset.zext(OldWidth); - return Result; - } - - Scale = 1; - Offset = 0; - return V; -} - -/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it -/// into a base pointer with a constant offset and a number of scaled symbolic -/// offsets. -/// -/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in -/// the VarIndices vector) are Value*'s that are known to be scaled by the -/// specified amount, but which may have other unrepresented high bits. As such, -/// the gep cannot necessarily be reconstructed from its decomposed form. -/// -/// When TargetData is around, this function is capable of analyzing everything -/// that Value::getUnderlyingObject() can look through. When not, it just looks -/// through pointer casts. -/// -const Value *llvm::DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl > &VarIndices, - const TargetData *TD) { - // Limit recursion depth to limit compile time in crazy cases. - unsigned MaxLookup = 6; - - BaseOffs = 0; - do { - // See if this is a bitcast or GEP. - const Operator *Op = dyn_cast(V); - if (Op == 0) { - // The only non-operator case we can handle are GlobalAliases. - if (const GlobalAlias *GA = dyn_cast(V)) { - if (!GA->mayBeOverridden()) { - V = GA->getAliasee(); - continue; - } - } - return V; - } - - if (Op->getOpcode() == Instruction::BitCast) { - V = Op->getOperand(0); - continue; - } - - const GEPOperator *GEPOp = dyn_cast(Op); - if (GEPOp == 0) - return V; - - // Don't attempt to analyze GEPs over unsized objects. - if (!cast(GEPOp->getOperand(0)->getType()) - ->getElementType()->isSized()) - return V; - - // If we are lacking TargetData information, we can't compute the offets of - // elements computed by GEPs. However, we can handle bitcast equivalent - // GEPs. - if (!TD) { - if (!GEPOp->hasAllZeroIndices()) - return V; - V = GEPOp->getOperand(0); - continue; - } - - // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. - gep_type_iterator GTI = gep_type_begin(GEPOp); - for (User::const_op_iterator I = GEPOp->op_begin()+1, - E = GEPOp->op_end(); I != E; ++I) { - Value *Index = *I; - // Compute the (potentially symbolic) offset in bytes for this index. - if (const StructType *STy = dyn_cast(*GTI++)) { - // For a struct, add the member offset. - unsigned FieldNo = cast(Index)->getZExtValue(); - if (FieldNo == 0) continue; - - BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); - continue; - } - - // For an array/pointer, add the element offset, explicitly scaled. - if (ConstantInt *CIdx = dyn_cast(Index)) { - if (CIdx->isZero()) continue; - BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); - continue; - } - - uint64_t Scale = TD->getTypeAllocSize(*GTI); - - // Use GetLinearExpression to decompose the index into a C1*V+C2 form. - unsigned Width = cast(Index->getType())->getBitWidth(); - APInt IndexScale(Width, 0), IndexOffset(Width, 0); - Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); - - // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. - // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. - BaseOffs += IndexOffset.getZExtValue()*Scale; - Scale *= IndexScale.getZExtValue(); - - - // If we already had an occurrance of this index variable, merge this - // scale into it. For example, we want to handle: - // A[x][x] -> x*16 + x*4 -> x*20 - // This also ensures that 'x' only appears in the index list once. - for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { - if (VarIndices[i].first == Index) { - Scale += VarIndices[i].second; - VarIndices.erase(VarIndices.begin()+i); - break; - } - } - - // Make sure that we have a scale that makes sense for this target's - // pointer size. - if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { - Scale <<= ShiftBits; - Scale >>= ShiftBits; - } - - if (Scale) - VarIndices.push_back(std::make_pair(Index, Scale)); - } - - // Analyze the base pointer next. - V = GEPOp->getOperand(0); - } while (--MaxLookup); - - // If the chain of expressions is too deep, just return early. - return V; -} - - // This is the recursive version of BuildSubAggregate. It takes a few different // arguments. Idxs is the index within the nested struct From that we are // looking at now (which is of type IndexedType). IdxSkip is the number of From daniel at zuster.org Wed Aug 18 13:22:37 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 18:22:37 -0000 Subject: [llvm-commits] [llvm] r111376 - in /llvm/trunk: lib/MC/MCAssembler.cpp test/MC/ELF/ test/MC/ELF/bss.ll test/MC/ELF/dg.exp Message-ID: <20100818182237.50FFC2A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 13:22:37 2010 New Revision: 111376 URL: http://llvm.org/viewvc/llvm-project?rev=111376&view=rev Log: MC/ELF: Allow null values in virtual sections, ELF doesn't use special directives for putting contents in .bss, for example. Added: llvm/trunk/test/MC/ELF/ llvm/trunk/test/MC/ELF/bss.ll llvm/trunk/test/MC/ELF/dg.exp Modified: llvm/trunk/lib/MC/MCAssembler.cpp Modified: llvm/trunk/lib/MC/MCAssembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=111376&r1=111375&r2=111376&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAssembler.cpp (original) +++ llvm/trunk/lib/MC/MCAssembler.cpp Wed Aug 18 13:22:37 2010 @@ -628,8 +628,23 @@ switch (it->getKind()) { default: assert(0 && "Invalid fragment in virtual section!"); + case MCFragment::FT_Data: { + // Check that we aren't trying to write a non-zero contents (or fixups) + // into a virtual section. This is to support clients which use standard + // directives to fill the contents of virtual sections. + MCDataFragment &DF = cast(*it); + assert(DF.fixup_begin() == DF.fixup_end() && + "Cannot have fixups in virtual section!"); + for (unsigned i = 0, e = DF.getContents().size(); i != e; ++i) + assert(DF.getContents()[i] == 0 && + "Invalid data value for virtual section!"); + break; + } case MCFragment::FT_Align: - assert(!cast(it)->getValueSize() && + // Check that we aren't trying to write a non-zero value into a virtual + // section. + assert((!cast(it)->getValueSize() || + !cast(it)->getValue()) && "Invalid align in virtual section!"); break; case MCFragment::FT_Fill: Added: llvm/trunk/test/MC/ELF/bss.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/bss.ll?rev=111376&view=auto ============================================================================== --- llvm/trunk/test/MC/ELF/bss.ll (added) +++ llvm/trunk/test/MC/ELF/bss.ll Wed Aug 18 13:22:37 2010 @@ -0,0 +1,8 @@ +; RUN: llc -filetype=obj %s -o %t +; FIXME: Add ELF dumping tool to check results. + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" +target triple = "i386-pc-linux-gnu" + + at g0 = global i8* null, align 4 ; [#uses=0] + Added: llvm/trunk/test/MC/ELF/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/dg.exp?rev=111376&view=auto ============================================================================== --- llvm/trunk/test/MC/ELF/dg.exp (added) +++ llvm/trunk/test/MC/ELF/dg.exp Wed Aug 18 13:22:37 2010 @@ -0,0 +1,5 @@ +load_lib llvm.exp + +if { [llvm_supports_target X86] } { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]] +} From resistor at mac.com Wed Aug 18 13:39:02 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Aug 2010 18:39:02 -0000 Subject: [llvm-commits] [llvm] r111382 - in /llvm/trunk: include/llvm/Analysis/LazyValueInfo.h lib/Analysis/LazyValueInfo.cpp lib/Transforms/Scalar/JumpThreading.cpp Message-ID: <20100818183902.19F6D2A6C12C@llvm.org> Author: resistor Date: Wed Aug 18 13:39:01 2010 New Revision: 111382 URL: http://llvm.org/viewvc/llvm-project?rev=111382&view=rev Log: Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues. Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h llvm/trunk/lib/Analysis/LazyValueInfo.cpp llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=111382&r1=111381&r2=111382&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h Wed Aug 18 13:39:01 2010 @@ -61,6 +61,8 @@ /// PredBB to OldSucc to be from PredBB to NewSucc instead. void threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc, BasicBlock *NewSucc); + /// eraseBlock - Inform the analysis cache that we have erased a block. + void eraseBlock(BasicBlock *BB); // Implementation boilerplate. Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=111382&r1=111381&r2=111382&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Wed Aug 18 13:39:01 2010 @@ -274,12 +274,12 @@ public: /// BlockCacheEntryTy - This is a computed lattice value at the end of the /// specified basic block for a Value* that depends on context. - typedef std::pair BlockCacheEntryTy; + typedef std::pair, LVILatticeVal> BlockCacheEntryTy; /// ValueCacheEntryTy - This is all of the cached block information for /// exactly one Value*. The entries are sorted by the BasicBlock* of the /// entries, allowing us to do a lookup with a binary search. - typedef std::map ValueCacheEntryTy; + typedef std::map, LVILatticeVal> ValueCacheEntryTy; private: /// LVIValueHandle - A callback value handle update the cache when @@ -307,7 +307,7 @@ /// OverDefinedCache - This tracks, on a per-block basis, the set of /// values that are over-defined at the end of that block. This is required /// for cache updating. - std::set > OverDefinedCache; + std::set, Value*> > OverDefinedCache; public: @@ -323,6 +323,16 @@ /// edge from PredBB to OldSucc has been threaded to be from PredBB to /// NewSucc. void threadEdge(BasicBlock *PredBB,BasicBlock *OldSucc,BasicBlock *NewSucc); + + /// eraseBlock - This is part of the update interface to inform the cache + /// that a block has been deleted. + void eraseBlock(BasicBlock *BB); + + /// clear - Empty the cache. + void clear() { + ValueCache.clear(); + OverDefinedCache.clear(); + } }; } // end anonymous namespace @@ -350,7 +360,7 @@ ValueCacheEntryTy &Cache; /// This tracks, for each block, what values are overdefined. - std::set > &OverDefinedCache; + std::set, Value*> > &OverDefinedCache; /// NewBlocks - This is a mapping of the new BasicBlocks which have been /// added to cache but that are not in sorted order. @@ -359,7 +369,7 @@ LVIQuery(Value *V, LazyValueInfoCache &P, ValueCacheEntryTy &VC, - std::set > &ODC) + std::set, Value*> > &ODC) : Val(V), Parent(P), Cache(VC), OverDefinedCache(ODC) { } @@ -384,11 +394,11 @@ } // end anonymous namespace void LazyValueInfoCache::LVIValueHandle::deleted() { - for (std::set >::iterator + for (std::set, Value*> >::iterator I = Parent->OverDefinedCache.begin(), E = Parent->OverDefinedCache.end(); I != E; ) { - std::set >::iterator tmp = I; + std::set, Value*> >::iterator tmp = I; ++I; if (tmp->second == getValPtr()) Parent->OverDefinedCache.erase(tmp); @@ -399,6 +409,19 @@ Parent->ValueCache.erase(*this); } +void LazyValueInfoCache::eraseBlock(BasicBlock *BB) { + for (std::set, Value*> >::iterator + I = OverDefinedCache.begin(), E = OverDefinedCache.end(); I != E; ) { + std::set, Value*> >::iterator tmp = I; + ++I; + if (tmp->first == BB) + OverDefinedCache.erase(tmp); + } + + for (std::map::iterator + I = ValueCache.begin(), E = ValueCache.end(); I != E; ++I) + I->second.erase(BB); +} /// getCachedEntryForBlock - See if we already have a value for this block. If /// so, return it, otherwise create a new entry in the Cache map to use. @@ -479,14 +502,10 @@ // Return the merged value, which is more precise than 'overdefined'. assert(!Result.isOverdefined()); - Cache[BB] = Result; - + return Cache[BB] = Result; } else { } - - DEBUG(dbgs() << " compute BB '" << BB->getName() - << "' - overdefined because inst def found.\n"); LVILatticeVal Result; Result.markOverdefined(); @@ -630,7 +649,7 @@ worklist.push_back(OldSucc); DenseSet ClearSet; - for (std::set >::iterator + for (std::set, Value*> >::iterator I = OverDefinedCache.begin(), E = OverDefinedCache.end(); I != E; ++I) { if (I->first == OldSucc) ClearSet.insert(I->second); @@ -651,7 +670,7 @@ for (DenseSet::iterator I = ClearSet.begin(),E = ClearSet.end(); I != E; ++I) { // If a value was marked overdefined in OldSucc, and is here too... - std::set >::iterator OI = + std::set, Value*> >::iterator OI = OverDefinedCache.find(std::make_pair(ToUpdate, *I)); if (OI == OverDefinedCache.end()) continue; @@ -678,12 +697,6 @@ // LazyValueInfo Impl //===----------------------------------------------------------------------===// -bool LazyValueInfo::runOnFunction(Function &F) { - TD = getAnalysisIfAvailable(); - // Fully lazy. - return false; -} - /// getCache - This lazily constructs the LazyValueInfoCache. static LazyValueInfoCache &getCache(void *&PImpl) { if (!PImpl) @@ -691,6 +704,15 @@ return *static_cast(PImpl); } +bool LazyValueInfo::runOnFunction(Function &F) { + if (PImpl) + getCache(PImpl).clear(); + + TD = getAnalysisIfAvailable(); + // Fully lazy. + return false; +} + void LazyValueInfo::releaseMemory() { // If the cache was allocated, free it. if (PImpl) { @@ -792,5 +814,9 @@ void LazyValueInfo::threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc, BasicBlock* NewSucc) { - getCache(PImpl).threadEdge(PredBB, OldSucc, NewSucc); + if (PImpl) getCache(PImpl).threadEdge(PredBB, OldSucc, NewSucc); +} + +void LazyValueInfo::eraseBlock(BasicBlock *BB) { + if (PImpl) getCache(PImpl).eraseBlock(BB); } Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=111382&r1=111381&r2=111382&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Wed Aug 18 13:39:01 2010 @@ -147,6 +147,7 @@ DEBUG(dbgs() << " JT: Deleting dead block '" << BB->getName() << "' with terminator: " << *BB->getTerminator() << '\n'); LoopHeaders.erase(BB); + if (LVI) LVI->eraseBlock(BB); DeleteDeadBlock(BB); Changed = true; } else if (BranchInst *BI = dyn_cast(BB->getTerminator())) { @@ -167,6 +168,11 @@ bool ErasedFromLoopHeaders = LoopHeaders.erase(BB); BasicBlock *Succ = BI->getSuccessor(0); + // FIXME: It is always conservatively correct to drop the info + // for a block even if it doesn't get erased. This isn't totally + // awesome, but it allows us to use AssertingVH to prevent nasty + // dangling pointer issues within LazyValueInfo. + if (LVI) LVI->eraseBlock(BB); if (TryToSimplifyUncondBranchFromEmptyBlock(BB)) { Changed = true; // If we deleted BB and BB was the header of a loop, then the @@ -489,6 +495,7 @@ // Remember if SinglePred was the entry block of the function. If so, we // will need to move BB back to the entry position. bool isEntry = SinglePred == &SinglePred->getParent()->getEntryBlock(); + if (LVI) LVI->eraseBlock(SinglePred); MergeBasicBlockIntoOnlyPred(BB); if (isEntry && BB != &BB->getParent()->getEntryBlock()) From isanbard at gmail.com Wed Aug 18 13:40:57 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 18 Aug 2010 18:40:57 -0000 Subject: [llvm-commits] [llvm] r111383 - /llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Message-ID: <20100818184057.4597A2A6C12C@llvm.org> Author: void Date: Wed Aug 18 13:40:57 2010 New Revision: 111383 URL: http://llvm.org/viewvc/llvm-project?rev=111383&view=rev Log: Marked with ATTRIBUTE_USED so that clang doesn't complain. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=111383&r1=111382&r2=111383&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Wed Aug 18 13:40:57 2010 @@ -572,7 +572,7 @@ friend bool operator<(const TableEntry &TE, unsigned V) { return TE.from < V; } - friend bool operator<(unsigned V, const TableEntry &TE) { + friend bool ATTRIBUTE_USED operator<(unsigned V, const TableEntry &TE) { return V < TE.from; } }; From isanbard at gmail.com Wed Aug 18 13:41:13 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 18 Aug 2010 18:41:13 -0000 Subject: [llvm-commits] [llvm] r111384 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Message-ID: <20100818184113.C3EE22A6C12C@llvm.org> Author: void Date: Wed Aug 18 13:41:13 2010 New Revision: 111384 URL: http://llvm.org/viewvc/llvm-project?rev=111384&view=rev Log: Improve whitespace. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=111384&r1=111383&r2=111384&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Aug 18 13:41:13 2010 @@ -1250,6 +1250,7 @@ if (const GlobalValue *GV = dyn_cast(CV)) return MCSymbolRefExpr::Create(AP.Mang->getSymbol(GV), Ctx); + if (const BlockAddress *BA = dyn_cast(CV)) return MCSymbolRefExpr::Create(AP.GetBlockAddressSymbol(BA), Ctx); @@ -1543,7 +1544,7 @@ case 8: if (AP.isVerbose()) AP.OutStreamer.GetCommentOS() << format("0x%llx\n", CI->getZExtValue()); - AP.OutStreamer.EmitIntValue(CI->getZExtValue(), Size, AddrSpace); + AP.OutStreamer.EmitIntValue(CI->getZExtValue(), Size, AddrSpace); return; default: EmitGlobalConstantLargeInt(CI, AddrSpace, AP); From daniel at zuster.org Wed Aug 18 13:43:08 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 18:43:08 -0000 Subject: [llvm-commits] [llvm] r111385 - in /llvm/trunk: include/llvm/Analysis/ValueTracking.h lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/ValueTracking.cpp Message-ID: <20100818184308.3DD752A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 13:43:08 2010 New Revision: 111385 URL: http://llvm.org/viewvc/llvm-project?rev=111385&view=rev Log: Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The form of", it doesn't pass tests. Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=111385&r1=111384&r2=111385&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ValueTracking.h (original) +++ llvm/trunk/include/llvm/Analysis/ValueTracking.h Wed Aug 18 13:43:08 2010 @@ -77,6 +77,25 @@ /// bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0); + /// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose + /// it into a base pointer with a constant offset and a number of scaled + /// symbolic offsets. + /// + /// The scaled symbolic offsets (represented by pairs of a Value* and a scale + /// in the VarIndices vector) are Value*'s that are known to be scaled by the + /// specified amount, but which may have other unrepresented high bits. As + /// such, the gep cannot necessarily be reconstructed from its decomposed + /// form. + /// + /// When TargetData is around, this function is capable of analyzing + /// everything that Value::getUnderlyingObject() can look through. When not, + /// it just looks through pointer casts. + /// + const Value *DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, + SmallVectorImpl > &VarIndices, + const TargetData *TD); + + /// FindInsertedValue - Given an aggregrate and an sequence of indices, see if /// the scalar value indexed is already around as a register, for example if Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=111385&r1=111384&r2=111385&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 18 13:43:08 2010 @@ -30,7 +30,6 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/GetElementPtrTypeIterator.h" #include using namespace llvm; @@ -194,218 +193,6 @@ ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } //===----------------------------------------------------------------------===// -// GetElementPtr Instruction Decomposition and Analysis -//===----------------------------------------------------------------------===// - - -/// GetLinearExpression - Analyze the specified value as a linear expression: -/// "A*V + B", where A and B are constant integers. Return the scale and offset -/// values as APInts and return V as a Value*. The incoming Value is known to -/// have IntegerType. Note that this looks through extends, so the high bits -/// may not be represented in the result. -static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, - const TargetData *TD, unsigned Depth) { - assert(V->getType()->isIntegerTy() && "Not an integer value"); - - // Limit our recursion depth. - if (Depth == 6) { - Scale = 1; - Offset = 0; - return V; - } - - if (BinaryOperator *BOp = dyn_cast(V)) { - if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { - switch (BOp->getOpcode()) { - default: break; - case Instruction::Or: - // X|C == X+C if all the bits in C are unset in X. Otherwise we can't - // analyze it. - if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) - break; - // FALL THROUGH. - case Instruction::Add: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset += RHSC->getValue(); - return V; - case Instruction::Mul: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset *= RHSC->getValue(); - Scale *= RHSC->getValue(); - return V; - case Instruction::Shl: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset <<= RHSC->getValue().getLimitedValue(); - Scale <<= RHSC->getValue().getLimitedValue(); - return V; - } - } - } - - // Since GEP indices are sign extended anyway, we don't care about the high - // bits of a sign extended value - just scales and offsets. - if (isa(V)) { - Value *CastOp = cast(V)->getOperand(0); - unsigned OldWidth = Scale.getBitWidth(); - unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); - Scale.trunc(SmallWidth); - Offset.trunc(SmallWidth); - Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); - Scale.zext(OldWidth); - Offset.zext(OldWidth); - return Result; - } - - Scale = 1; - Offset = 0; - return V; -} - -/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it -/// into a base pointer with a constant offset and a number of scaled symbolic -/// offsets. -/// -/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in -/// the VarIndices vector) are Value*'s that are known to be scaled by the -/// specified amount, but which may have other unrepresented high bits. As such, -/// the gep cannot necessarily be reconstructed from its decomposed form. -/// -/// When TargetData is around, this function is capable of analyzing everything -/// that Value::getUnderlyingObject() can look through. When not, it just looks -/// through pointer casts. -/// -static const Value * -DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl > &VarIndices, - const TargetData *TD) { - // Limit recursion depth to limit compile time in crazy cases. - unsigned MaxLookup = 6; - - BaseOffs = 0; - do { - // Look through global aliases and bitcasts. - V = V->stripPointerCasts(); - - const GEPOperator *GEPOp = dyn_cast(V); - if (GEPOp == 0) - return V; - - // Don't attempt to analyze GEPs over unsized objects. - if (!cast(GEPOp->getOperand(0)->getType()) - ->getElementType()->isSized()) - return V; - - // If we are lacking TargetData information, we can't compute the offets of - // elements computed by GEPs. However, we can handle bitcast equivalent - // GEPs. - if (!TD) { - if (!GEPOp->hasAllZeroIndices()) - return V; - V = GEPOp->getOperand(0); - continue; - } - - // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. - gep_type_iterator GTI = gep_type_begin(GEPOp); - for (User::const_op_iterator I = GEPOp->op_begin()+1, - E = GEPOp->op_end(); I != E; ++I) { - Value *Index = *I; - // Compute the (potentially symbolic) offset in bytes for this index. - if (const StructType *STy = dyn_cast(*GTI++)) { - // For a struct, add the member offset. - unsigned FieldNo = cast(Index)->getZExtValue(); - if (FieldNo == 0) continue; - - BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); - continue; - } - - // For an array/pointer, add the element offset, explicitly scaled. - if (ConstantInt *CIdx = dyn_cast(Index)) { - if (CIdx->isZero()) continue; - BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); - continue; - } - - uint64_t Scale = TD->getTypeAllocSize(*GTI); - - // Use GetLinearExpression to decompose the index into a C1*V+C2 form. - unsigned Width = cast(Index->getType())->getBitWidth(); - APInt IndexScale(Width, 0), IndexOffset(Width, 0); - Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); - - // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. - // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. - BaseOffs += IndexOffset.getZExtValue()*Scale; - Scale *= IndexScale.getZExtValue(); - - - // If we already had an occurrance of this index variable, merge this - // scale into it. For example, we want to handle: - // A[x][x] -> x*16 + x*4 -> x*20 - // This also ensures that 'x' only appears in the index list once. - for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { - if (VarIndices[i].first == Index) { - Scale += VarIndices[i].second; - VarIndices.erase(VarIndices.begin()+i); - break; - } - } - - // Make sure that we have a scale that makes sense for this target's - // pointer size. - if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { - Scale <<= ShiftBits; - Scale >>= ShiftBits; - } - - if (Scale) - VarIndices.push_back(std::make_pair(Index, Scale)); - } - - // Analyze the base pointer next. - V = GEPOp->getOperand(0); - } while (--MaxLookup); - - // If the chain of expressions is too deep, just return early. - return V; -} - -/// GetIndexDifference - Dest and Src are the variable indices from two -/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base -/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic -/// difference between the two pointers. -static void GetIndexDifference( - SmallVectorImpl > &Dest, - const SmallVectorImpl > &Src) { - if (Src.empty()) return; - - for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].first; - int64_t Scale = Src[i].second; - - // Find V in Dest. This is N^2, but pointer indices almost never have more - // than a few variable indexes. - for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].first != V) continue; - - // If we found it, subtract off Scale V's from the entry in Dest. If it - // goes to zero, remove the entry. - if (Dest[j].second != Scale) - Dest[j].second -= Scale; - else - Dest.erase(Dest.begin()+j); - Scale = 0; - break; - } - - // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) - Dest.push_back(std::make_pair(V, -Scale)); - } -} - -//===----------------------------------------------------------------------===// // BasicAliasAnalysis Pass //===----------------------------------------------------------------------===// @@ -680,6 +467,40 @@ } +/// GetIndexDifference - Dest and Src are the variable indices from two +/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base +/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic +/// difference between the two pointers. +static void GetIndexDifference( + SmallVectorImpl > &Dest, + const SmallVectorImpl > &Src) { + if (Src.empty()) return; + + for (unsigned i = 0, e = Src.size(); i != e; ++i) { + const Value *V = Src[i].first; + int64_t Scale = Src[i].second; + + // Find V in Dest. This is N^2, but pointer indices almost never have more + // than a few variable indexes. + for (unsigned j = 0, e = Dest.size(); j != e; ++j) { + if (Dest[j].first != V) continue; + + // If we found it, subtract off Scale V's from the entry in Dest. If it + // goes to zero, remove the entry. + if (Dest[j].second != Scale) + Dest[j].second -= Scale; + else + Dest.erase(Dest.begin()+j); + Scale = 0; + break; + } + + // If we didn't consume this entry, add it to the end of the Dest list. + if (Scale) + Dest.push_back(std::make_pair(V, -Scale)); + } +} + /// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction /// against another pointer. We know that V1 is a GEP, but we don't know /// anything about V2. UnderlyingV1 is GEP1->getUnderlyingObject(), Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=111385&r1=111384&r2=111385&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Aug 18 13:43:08 2010 @@ -974,6 +974,194 @@ } +/// GetLinearExpression - Analyze the specified value as a linear expression: +/// "A*V + B", where A and B are constant integers. Return the scale and offset +/// values as APInts and return V as a Value*. The incoming Value is known to +/// have IntegerType. Note that this looks through extends, so the high bits +/// may not be represented in the result. +static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, + const TargetData *TD, unsigned Depth) { + assert(V->getType()->isIntegerTy() && "Not an integer value"); + + // Limit our recursion depth. + if (Depth == 6) { + Scale = 1; + Offset = 0; + return V; + } + + if (BinaryOperator *BOp = dyn_cast(V)) { + if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { + switch (BOp->getOpcode()) { + default: break; + case Instruction::Or: + // X|C == X+C if all the bits in C are unset in X. Otherwise we can't + // analyze it. + if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) + break; + // FALL THROUGH. + case Instruction::Add: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset += RHSC->getValue(); + return V; + case Instruction::Mul: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset *= RHSC->getValue(); + Scale *= RHSC->getValue(); + return V; + case Instruction::Shl: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset <<= RHSC->getValue().getLimitedValue(); + Scale <<= RHSC->getValue().getLimitedValue(); + return V; + } + } + } + + // Since GEP indices are sign extended anyway, we don't care about the high + // bits of a sign extended value - just scales and offsets. + if (isa(V)) { + Value *CastOp = cast(V)->getOperand(0); + unsigned OldWidth = Scale.getBitWidth(); + unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); + Scale.trunc(SmallWidth); + Offset.trunc(SmallWidth); + Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); + Scale.zext(OldWidth); + Offset.zext(OldWidth); + return Result; + } + + Scale = 1; + Offset = 0; + return V; +} + +/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it +/// into a base pointer with a constant offset and a number of scaled symbolic +/// offsets. +/// +/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in +/// the VarIndices vector) are Value*'s that are known to be scaled by the +/// specified amount, but which may have other unrepresented high bits. As such, +/// the gep cannot necessarily be reconstructed from its decomposed form. +/// +/// When TargetData is around, this function is capable of analyzing everything +/// that Value::getUnderlyingObject() can look through. When not, it just looks +/// through pointer casts. +/// +const Value *llvm::DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, + SmallVectorImpl > &VarIndices, + const TargetData *TD) { + // Limit recursion depth to limit compile time in crazy cases. + unsigned MaxLookup = 6; + + BaseOffs = 0; + do { + // See if this is a bitcast or GEP. + const Operator *Op = dyn_cast(V); + if (Op == 0) { + // The only non-operator case we can handle are GlobalAliases. + if (const GlobalAlias *GA = dyn_cast(V)) { + if (!GA->mayBeOverridden()) { + V = GA->getAliasee(); + continue; + } + } + return V; + } + + if (Op->getOpcode() == Instruction::BitCast) { + V = Op->getOperand(0); + continue; + } + + const GEPOperator *GEPOp = dyn_cast(Op); + if (GEPOp == 0) + return V; + + // Don't attempt to analyze GEPs over unsized objects. + if (!cast(GEPOp->getOperand(0)->getType()) + ->getElementType()->isSized()) + return V; + + // If we are lacking TargetData information, we can't compute the offets of + // elements computed by GEPs. However, we can handle bitcast equivalent + // GEPs. + if (!TD) { + if (!GEPOp->hasAllZeroIndices()) + return V; + V = GEPOp->getOperand(0); + continue; + } + + // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. + gep_type_iterator GTI = gep_type_begin(GEPOp); + for (User::const_op_iterator I = GEPOp->op_begin()+1, + E = GEPOp->op_end(); I != E; ++I) { + Value *Index = *I; + // Compute the (potentially symbolic) offset in bytes for this index. + if (const StructType *STy = dyn_cast(*GTI++)) { + // For a struct, add the member offset. + unsigned FieldNo = cast(Index)->getZExtValue(); + if (FieldNo == 0) continue; + + BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); + continue; + } + + // For an array/pointer, add the element offset, explicitly scaled. + if (ConstantInt *CIdx = dyn_cast(Index)) { + if (CIdx->isZero()) continue; + BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); + continue; + } + + uint64_t Scale = TD->getTypeAllocSize(*GTI); + + // Use GetLinearExpression to decompose the index into a C1*V+C2 form. + unsigned Width = cast(Index->getType())->getBitWidth(); + APInt IndexScale(Width, 0), IndexOffset(Width, 0); + Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); + + // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. + // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. + BaseOffs += IndexOffset.getZExtValue()*Scale; + Scale *= IndexScale.getZExtValue(); + + + // If we already had an occurrance of this index variable, merge this + // scale into it. For example, we want to handle: + // A[x][x] -> x*16 + x*4 -> x*20 + // This also ensures that 'x' only appears in the index list once. + for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { + if (VarIndices[i].first == Index) { + Scale += VarIndices[i].second; + VarIndices.erase(VarIndices.begin()+i); + break; + } + } + + // Make sure that we have a scale that makes sense for this target's + // pointer size. + if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { + Scale <<= ShiftBits; + Scale >>= ShiftBits; + } + + if (Scale) + VarIndices.push_back(std::make_pair(Index, Scale)); + } + + // Analyze the base pointer next. + V = GEPOp->getOperand(0); + } while (--MaxLookup); + + // If the chain of expressions is too deep, just return early. + return V; +} + + // This is the recursive version of BuildSubAggregate. It takes a few different // arguments. Idxs is the index within the nested struct From that we are // looking at now (which is of type IndexedType). IdxSkip is the number of From stoklund at 2pi.dk Wed Aug 18 14:00:06 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 19:00:06 -0000 Subject: [llvm-commits] [llvm] r111392 - /llvm/trunk/include/llvm/ADT/DepthFirstIterator.h Message-ID: <20100818190006.2F50C2A6C12C@llvm.org> Author: stoklund Date: Wed Aug 18 14:00:05 2010 New Revision: 111392 URL: http://llvm.org/viewvc/llvm-project?rev=111392&view=rev Log: Add df_iterator::getPathLength and getPath as a way of getting a path from the entry node to the current node. Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DepthFirstIterator.h?rev=111392&r1=111391&r2=111392&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/DepthFirstIterator.h (original) +++ llvm/trunk/include/llvm/ADT/DepthFirstIterator.h Wed Aug 18 14:00:05 2010 @@ -183,6 +183,16 @@ inline bool nodeVisited(NodeType *Node) const { return this->Visited.count(Node) != 0; } + + /// getPathLength - Return the length of the path from the entry node to the + /// current node, counting both nodes. + unsigned getPathLength() const { return VisitStack.size(); } + + /// getPath - Return the n'th node in the path from the the entry node to the + /// current node. + NodeType *getPath(unsigned n) const { + return VisitStack[n].first.getPointer(); + } }; From stoklund at 2pi.dk Wed Aug 18 14:00:08 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 19:00:08 -0000 Subject: [llvm-commits] [llvm] r111393 - in /llvm/trunk/lib/CodeGen: SplitKit.cpp SplitKit.h Message-ID: <20100818190008.B00052A6C12D@llvm.org> Author: stoklund Date: Wed Aug 18 14:00:08 2010 New Revision: 111393 URL: http://llvm.org/viewvc/llvm-project?rev=111393&view=rev Log: Add the LiveIntervalMap class. Don't hook it up yet. LiveIntervalMap maps values from a parent LiveInterval to a child interval that is a strict subset. It will create phi-def values as needed to preserve the VNInfo SSA form in the child interval. This leads to an algorithm very similar to the one in SSAUpdaterImpl.h, but with enough differences that the code can't be reused: - We don't need to manipulate PHI instructions. - LiveIntervals have kills. - We have MachineDominatorTree. - We can use df_iterator. Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp llvm/trunk/lib/CodeGen/SplitKit.h Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111393&r1=111392&r2=111393&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 14:00:08 2010 @@ -17,7 +17,7 @@ #include "VirtRegMap.h" #include "llvm/CodeGen/CalcSpillWeights.h" #include "llvm/CodeGen/LiveIntervalAnalysis.h" -#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -337,6 +337,218 @@ } //===----------------------------------------------------------------------===// +// LiveIntervalMap +//===----------------------------------------------------------------------===// + +// defValue - Introduce a li_ def for ParentVNI that could be later than +// ParentVNI->def. +VNInfo *LiveIntervalMap::defValue(const VNInfo *ParentVNI, SlotIndex Idx) { + assert(ParentVNI && "Mapping NULL value"); + assert(Idx.isValid() && "Invalid SlotIndex"); + assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); + + // Is this a simple 1-1 mapping? Not likely. + if (Idx == ParentVNI->def) + return mapValue(ParentVNI, Idx); + + // This is a complex def. Mark with a NULL in valueMap. + VNInfo *OldVNI = + valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; + (void)OldVNI; + assert(OldVNI == 0 && "Simple/Complex values mixed"); + + // Should we insert a minimal snippet of VNI LiveRange, or can we count on + // callers to do that? We need it for lookups of complex values. + VNInfo *VNI = li_.getNextValue(Idx, 0, true, lis_.getVNInfoAllocator()); + return VNI; +} + +// mapValue - Find the mapped value for ParentVNI at Idx. +// Potentially create phi-def values. +VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx) { + assert(ParentVNI && "Mapping NULL value"); + assert(Idx.isValid() && "Invalid SlotIndex"); + assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); + + // Use insert for lookup, so we can add missing values with a second lookup. + std::pair InsP = + valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); + + // This was an unknown value. Create a simple mapping. + if (InsP.second) + return InsP.first->second = li_.createValueCopy(ParentVNI, + lis_.getVNInfoAllocator()); + // This was a simple mapped value. + if (InsP.first->second) + return InsP.first->second; + + // This is a complex mapped value. There may be multiple defs, and we may need + // to create phi-defs. + MachineBasicBlock *IdxMBB = lis_.getMBBFromIndex(Idx); + assert(IdxMBB && "No MBB at Idx"); + + // Is there a def in the same MBB we can extend? + if (VNInfo *VNI = extendTo(IdxMBB, Idx)) + return VNI; + + // Now for the fun part. We know that ParentVNI potentially has multiple defs, + // and we may need to create even more phi-defs to preserve VNInfo SSA form. + // Perform a depth-first search for predecessor blocks where we know the + // dominating VNInfo. Insert phi-def VNInfos along the path back to IdxMBB. + + // Track MBBs where we have created or learned the dominating value. + // This may change during the DFS as we create new phi-defs. + typedef DenseMap MBBValueMap; + MBBValueMap DomValue; + + for (idf_iterator + IDFI = idf_begin(IdxMBB), + IDFE = idf_end(IdxMBB); IDFI != IDFE;) { + MachineBasicBlock *MBB = *IDFI; + SlotIndex End = lis_.getMBBEndIdx(MBB); + + // We are operating on the restricted CFG where ParentVNI is live. + if (parentli_.getVNInfoAt(End.getPrevSlot()) != ParentVNI) { + IDFI.skipChildren(); + continue; + } + + // Do we have a dominating value in this block? + VNInfo *VNI = extendTo(MBB, End); + if (!VNI) { + ++IDFI; + continue; + } + + // Yes, VNI dominates MBB. Track the path back to IdxMBB, creating phi-defs + // as needed along the way. + for (unsigned PI = IDFI.getPathLength()-1; PI != 0; --PI) { + // Start from MBB's immediate successor. + MachineBasicBlock *Succ = IDFI.getPath(PI-1); + std::pair InsP = + DomValue.insert(MBBValueMap::value_type(Succ, VNI)); + SlotIndex Start = lis_.getMBBStartIdx(Succ); + if (InsP.second) { + // This is the first time we backtrack to Succ. Verify dominance. + if (Succ->pred_size() == 1 || dt_.dominates(MBB, Succ)) + continue; + } else if (InsP.first->second == VNI || + InsP.first->second->def == Start) { + // We have previously backtracked VNI to Succ, or Succ already has a + // phi-def. No need to backtrack further. + break; + } + // VNI does not dominate Succ, we need a new phi-def. + VNI = li_.getNextValue(Start, 0, true, lis_.getVNInfoAllocator()); + VNI->setIsPHIDef(true); + InsP.first->second = VNI; + MBB = Succ; + } + + // No need to search the children, we found a dominating value. + // FIXME: We could prune up to the last phi-def we inserted, need df_iterator + // for that. + IDFI.skipChildren(); + } + + // The search should at least find a dominating value for IdxMBB. + assert(!DomValue.empty() && "Couldn't find a reaching definition"); + + // Since we went through the trouble of a full DFS visiting all reaching defs, + // the values in DomValue are now accurate. No more phi-defs are needed for + // these blocks, so we can color the live ranges. + // This makes the next mapValue call much faster. + VNInfo *IdxVNI = 0; + for (MBBValueMap::iterator I = DomValue.begin(), E = DomValue.end(); I != E; + ++I) { + MachineBasicBlock *MBB = I->first; + VNInfo *VNI = I->second; + SlotIndex Start = lis_.getMBBStartIdx(MBB); + if (MBB == IdxMBB) { + // Don't add full liveness to IdxMBB, stop at Idx. + if (Start != Idx) + li_.addRange(LiveRange(Start, Idx, VNI)); + IdxVNI = VNI; + } else + li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); + } + + assert(IdxVNI && "Didn't find value for Idx"); + return IdxVNI; +} + +// extendTo - Find the last li_ value defined in MBB at or before Idx. The +// parentli_ is assumed to be live at Idx. Extend the live range to Idx. +// Return the found VNInfo, or NULL. +VNInfo *LiveIntervalMap::extendTo(MachineBasicBlock *MBB, SlotIndex Idx) { + LiveInterval::iterator I = std::upper_bound(li_.begin(), li_.end(), Idx); + if (I == li_.begin()) + return 0; + --I; + if (I->start < lis_.getMBBStartIdx(MBB)) + return 0; + if (I->end < Idx) + I->end = Idx; + return I->valno; +} + +// addSimpleRange - Add a simple range from parentli_ to li_. +// ParentVNI must be live in the [Start;End) interval. +void LiveIntervalMap::addSimpleRange(SlotIndex Start, SlotIndex End, + const VNInfo *ParentVNI) { + VNInfo *VNI = mapValue(ParentVNI, Start); + // A simple mappoing is easy. + if (VNI->def == ParentVNI->def) { + li_.addRange(LiveRange(Start, End, VNI)); + return; + } + + // ParentVNI is a complex value. We must map per MBB. + MachineFunction::iterator MBB = lis_.getMBBFromIndex(Start); + MachineFunction::iterator MBBE = lis_.getMBBFromIndex(End); + + if (MBB == MBBE) { + li_.addRange(LiveRange(Start, End, VNI)); + return; + } + + // First block. + li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); + + // Run sequence of full blocks. + for (++MBB; MBB != MBBE; ++MBB) { + Start = lis_.getMBBStartIdx(MBB); + li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), + mapValue(ParentVNI, Start))); + } + + // Final block. + Start = lis_.getMBBStartIdx(MBB); + if (Start != End) + li_.addRange(LiveRange(Start, End, mapValue(ParentVNI, Start))); +} + +/// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. +/// All needed values whose def is not inside [Start;End) must be defined +/// beforehand so mapValue will work. +void LiveIntervalMap::addRange(SlotIndex Start, SlotIndex End) { + LiveInterval::const_iterator B = parentli_.begin(), E = parentli_.end(); + LiveInterval::const_iterator I = std::lower_bound(B, E, Start); + + // Check if --I begins before Start and overlaps. + if (I != B) { + --I; + if (I->end > Start) + addSimpleRange(Start, std::min(End, I->end), I->valno); + ++I; + } + + // The remaining ranges begin after Start. + for (;I != E && I->start < End; ++I) + addSimpleRange(I->start, std::min(End, I->end), I->valno); +} + +//===----------------------------------------------------------------------===// // Split Editor //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/CodeGen/SplitKit.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=111393&r1=111392&r2=111393&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.h (original) +++ llvm/trunk/lib/CodeGen/SplitKit.h Wed Aug 18 14:00:08 2010 @@ -20,6 +20,7 @@ class LiveInterval; class LiveIntervals; +class MachineDominatorTree; class MachineInstr; class MachineLoop; class MachineLoopInfo; @@ -135,6 +136,71 @@ const MachineBasicBlock *getBlockForInsideSplit(); }; + +/// LiveIntervalMap - Map values from a large LiveInterval into a small +/// interval that is a subset. Insert phi-def values as needed. This class is +/// used by SplitEditor to create new smaller LiveIntervals. +/// +/// parentli_ is the larger interval, li_ is the subset interval. Every value +/// in li_ corresponds to exactly one value in parentli_, and the live range +/// of the value is contained within the live range of the parentli_ value. +/// Values in parentli_ may map to any number of openli_ values, including 0. +class LiveIntervalMap { + LiveIntervals &lis_; + MachineDominatorTree &dt_; + + // The parent interval is never changed. + const LiveInterval &parentli_; + + // The child interval's values are fully contained inside parentli_ values. + LiveInterval &li_; + + typedef DenseMap ValueMap; + + // Map parentli_ values to simple values in li_ that are defined at the same + // SlotIndex, or NULL for parentli_ values that have complex li_ defs. + // Note there is a difference between values mapping to NULL (complex), and + // values not present (unknown/unmapped). + ValueMap valueMap_; + + // extendTo - Find the last li_ value defined in MBB at or before Idx. The + // parentli_ is assumed to be live at Idx. Extend the live range to Idx. + // Return the found VNInfo, or NULL. + VNInfo *extendTo(MachineBasicBlock *MBB, SlotIndex Idx); + + // addSimpleRange - Add a simple range from parentli_ to li_. + // ParentVNI must be live in the [Start;End) interval. + void addSimpleRange(SlotIndex Start, SlotIndex End, const VNInfo *ParentVNI); + +public: + LiveIntervalMap(LiveIntervals &lis, + MachineDominatorTree &dt, + const LiveInterval &parentli, + LiveInterval &li) + : lis_(lis), dt_(dt), parentli_(parentli), li_(li) {} + + /// defValue - define a value in li_ from the parentli_ value VNI and Idx. + /// Idx does not have to be ParentVNI->def, but it must be contained within + /// ParentVNI's live range in parentli_. + /// Return the new li_ value. + VNInfo *defValue(const VNInfo *ParentVNI, SlotIndex Idx); + + /// mapValue - map ParentVNI to the corresponding li_ value at Idx. It is + /// assumed that ParentVNI is live at Idx. + /// If ParentVNI has not been defined by defValue, it is assumed that + /// ParentVNI->def dominates Idx. + /// If ParentVNI has been defined by defValue one or more times, a value that + /// dominates Idx will be returned. This may require creating extra phi-def + /// values and adding live ranges to li_. + VNInfo *mapValue(const VNInfo *ParentVNI, SlotIndex Idx); + + /// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. + /// All needed values whose def is not inside [Start;End) must be defined + /// beforehand so mapValue will work. + void addRange(SlotIndex Start, SlotIndex End); +}; + + /// SplitEditor - Edit machine code and LiveIntervals for live range /// splitting. /// From stoklund at 2pi.dk Wed Aug 18 14:00:11 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 19:00:11 -0000 Subject: [llvm-commits] [llvm] r111394 - in /llvm/trunk: include/llvm/ADT/DepthFirstIterator.h lib/CodeGen/SplitKit.cpp Message-ID: <20100818190011.C497C2A6C12E@llvm.org> Author: stoklund Date: Wed Aug 18 14:00:11 2010 New Revision: 111394 URL: http://llvm.org/viewvc/llvm-project?rev=111394&view=rev Log: Aggressively prune the DFS when inserting phi-defs. Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h llvm/trunk/lib/CodeGen/SplitKit.cpp Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DepthFirstIterator.h?rev=111394&r1=111393&r2=111394&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/DepthFirstIterator.h (original) +++ llvm/trunk/include/llvm/ADT/DepthFirstIterator.h Wed Aug 18 14:00:11 2010 @@ -193,6 +193,15 @@ NodeType *getPath(unsigned n) const { return VisitStack[n].first.getPointer(); } + + /// skipChildren - Skip all children of Node, assuming that Node is on the + /// current path. This allows more aggressive pruning than just skipping + /// children of the current node. + _Self& skipChildren(NodeType *Node) { + while (!VisitStack.empty() && **this != Node) + VisitStack.pop_back(); + return skipChildren(); + } }; Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111394&r1=111393&r2=111394&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 14:00:11 2010 @@ -446,9 +446,9 @@ } // No need to search the children, we found a dominating value. - // FIXME: We could prune up to the last phi-def we inserted, need df_iterator - // for that. - IDFI.skipChildren(); + // MBB is either the found dominating value, or the last phi-def we created. + // Either way, the children of MBB would be shadowed, so don't search them. + IDFI.skipChildren(MBB); } // The search should at least find a dominating value for IdxMBB. From stoklund at 2pi.dk Wed Aug 18 15:06:05 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 20:06:05 -0000 Subject: [llvm-commits] [llvm] r111397 - in /llvm/trunk: include/llvm/ADT/DepthFirstIterator.h lib/CodeGen/SplitKit.cpp Message-ID: <20100818200606.01B672A6C12C@llvm.org> Author: stoklund Date: Wed Aug 18 15:06:05 2010 New Revision: 111397 URL: http://llvm.org/viewvc/llvm-project?rev=111397&view=rev Log: Revert r111394. It was too aggressive. We must complete the DFS, otherwise we might miss needed phi-defs, and prematurely color live ranges with a non-dominating value. This is not a big deal since we get to color more of the CFG and the next mapValue call will be faster. Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h llvm/trunk/lib/CodeGen/SplitKit.cpp Modified: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DepthFirstIterator.h?rev=111397&r1=111396&r2=111397&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/DepthFirstIterator.h (original) +++ llvm/trunk/include/llvm/ADT/DepthFirstIterator.h Wed Aug 18 15:06:05 2010 @@ -193,15 +193,6 @@ NodeType *getPath(unsigned n) const { return VisitStack[n].first.getPointer(); } - - /// skipChildren - Skip all children of Node, assuming that Node is on the - /// current path. This allows more aggressive pruning than just skipping - /// children of the current node. - _Self& skipChildren(NodeType *Node) { - while (!VisitStack.empty() && **this != Node) - VisitStack.pop_back(); - return skipChildren(); - } }; Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111397&r1=111396&r2=111397&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 15:06:05 2010 @@ -446,9 +446,9 @@ } // No need to search the children, we found a dominating value. - // MBB is either the found dominating value, or the last phi-def we created. - // Either way, the children of MBB would be shadowed, so don't search them. - IDFI.skipChildren(MBB); + // FIXME: We could prune up to the last phi-def we inserted, need df_iterator + // for that. + IDFI.skipChildren(); } // The search should at least find a dominating value for IdxMBB. From gohman at apple.com Wed Aug 18 15:16:39 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 20:16:39 -0000 Subject: [llvm-commits] [llvm] r111398 - /llvm/trunk/include/llvm/Support/ErrorHandling.h Message-ID: <20100818201639.485F22A6C12C@llvm.org> Author: djg Date: Wed Aug 18 15:16:39 2010 New Revision: 111398 URL: http://llvm.org/viewvc/llvm-project?rev=111398&view=rev Log: Introduce a ScopedFatalErrorHandler class to make it easy to register fatal error handlers which automatically get unregistered at the end of a scope. Modified: llvm/trunk/include/llvm/Support/ErrorHandling.h Modified: llvm/trunk/include/llvm/Support/ErrorHandling.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ErrorHandling.h?rev=111398&r1=111397&r2=111398&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ErrorHandling.h (original) +++ llvm/trunk/include/llvm/Support/ErrorHandling.h Wed Aug 18 15:16:39 2010 @@ -52,6 +52,18 @@ /// llvm_stop_multithreaded(). void remove_fatal_error_handler(); + /// ScopedFatalErrorHandler - This is a simple helper class which just + /// calls install_fatal_error_handler in its constructor and + /// remove_fatal_error_handler in its destructor. + struct ScopedFatalErrorHandler { + explicit ScopedFatalErrorHandler(fatal_error_handler_t handler, + void *user_data = 0) { + install_fatal_error_handler(handler, user_data); + } + + ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } + }; + /// Reports a serious error, calling any installed error handler. These /// functions are intended to be used for error conditions which are outside /// the control of the compiler (I/O errors, invalid user input, etc.) From stoklund at 2pi.dk Wed Aug 18 15:29:53 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 20:29:53 -0000 Subject: [llvm-commits] [llvm] r111400 - in /llvm/trunk/lib/CodeGen: SplitKit.cpp SplitKit.h Message-ID: <20100818202954.061232A6C12C@llvm.org> Author: stoklund Date: Wed Aug 18 15:29:53 2010 New Revision: 111400 URL: http://llvm.org/viewvc/llvm-project?rev=111400&view=rev Log: Thinking about it, we don't need MachineDominatorTree after all. The DomValue map discovers the iterated dominance frontier for free. Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp llvm/trunk/lib/CodeGen/SplitKit.h Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111400&r1=111399&r2=111400&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 15:29:53 2010 @@ -17,7 +17,6 @@ #include "VirtRegMap.h" #include "llvm/CodeGen/CalcSpillWeights.h" #include "llvm/CodeGen/LiveIntervalAnalysis.h" -#include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -423,31 +422,41 @@ // Yes, VNI dominates MBB. Track the path back to IdxMBB, creating phi-defs // as needed along the way. for (unsigned PI = IDFI.getPathLength()-1; PI != 0; --PI) { - // Start from MBB's immediate successor. + // Start from MBB's immediate successor. End at IdxMBB. MachineBasicBlock *Succ = IDFI.getPath(PI-1); std::pair InsP = DomValue.insert(MBBValueMap::value_type(Succ, VNI)); + + // This is the first time we backtrack to Succ. + if (InsP.second) + continue; + + // We reached Succ again with the same VNI. Nothing is going to change. + VNInfo *OVNI = InsP.first->second; + if (OVNI == VNI) + break; + + // Succ already has a phi-def. No need to continue. SlotIndex Start = lis_.getMBBStartIdx(Succ); - if (InsP.second) { - // This is the first time we backtrack to Succ. Verify dominance. - if (Succ->pred_size() == 1 || dt_.dominates(MBB, Succ)) - continue; - } else if (InsP.first->second == VNI || - InsP.first->second->def == Start) { - // We have previously backtracked VNI to Succ, or Succ already has a - // phi-def. No need to backtrack further. + if (OVNI->def == Start) break; - } - // VNI does not dominate Succ, we need a new phi-def. + + // We have a collision between the old and new VNI at Succ. That means + // neither dominates and we need a new phi-def. VNI = li_.getNextValue(Start, 0, true, lis_.getVNInfoAllocator()); VNI->setIsPHIDef(true); InsP.first->second = VNI; - MBB = Succ; + + // Replace OVNI with VNI in the remaining path. + for (; PI > 1 ; --PI) { + MBBValueMap::iterator I = DomValue.find(IDFI.getPath(PI-2)); + if (I == DomValue.end() || I->second != OVNI) + break; + I->second = VNI; + } } // No need to search the children, we found a dominating value. - // FIXME: We could prune up to the last phi-def we inserted, need df_iterator - // for that. IDFI.skipChildren(); } @@ -468,6 +477,7 @@ // Don't add full liveness to IdxMBB, stop at Idx. if (Start != Idx) li_.addRange(LiveRange(Start, Idx, VNI)); + // The caller had better add some liveness to IdxVNI, or it leaks. IdxVNI = VNI; } else li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); Modified: llvm/trunk/lib/CodeGen/SplitKit.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=111400&r1=111399&r2=111400&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.h (original) +++ llvm/trunk/lib/CodeGen/SplitKit.h Wed Aug 18 15:29:53 2010 @@ -20,7 +20,6 @@ class LiveInterval; class LiveIntervals; -class MachineDominatorTree; class MachineInstr; class MachineLoop; class MachineLoopInfo; @@ -147,7 +146,6 @@ /// Values in parentli_ may map to any number of openli_ values, including 0. class LiveIntervalMap { LiveIntervals &lis_; - MachineDominatorTree &dt_; // The parent interval is never changed. const LiveInterval &parentli_; @@ -174,10 +172,9 @@ public: LiveIntervalMap(LiveIntervals &lis, - MachineDominatorTree &dt, const LiveInterval &parentli, LiveInterval &li) - : lis_(lis), dt_(dt), parentli_(parentli), li_(li) {} + : lis_(lis), parentli_(parentli), li_(li) {} /// defValue - define a value in li_ from the parentli_ value VNI and Idx. /// Idx does not have to be ParentVNI->def, but it must be contained within From gohman at apple.com Wed Aug 18 15:32:46 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 20:32:46 -0000 Subject: [llvm-commits] [llvm] r111401 - in /llvm/trunk/test/CodeGen/X86: 2009-03-23-MultiUseSched.ll constant-pool-remat-0.ll critical-edge-split.ll licm-nested.ll vec_insert-6.ll vec_shuffle-19.ll vec_shuffle-20.ll zero-remat.ll Message-ID: <20100818203246.C3F622A6C12D@llvm.org> Author: djg Date: Wed Aug 18 15:32:46 2010 New Revision: 111401 URL: http://llvm.org/viewvc/llvm-project?rev=111401&view=rev Log: When sending stats output to stdout for grepping, don't emit normal output to standard output also. Modified: llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll llvm/trunk/test/CodeGen/X86/critical-edge-split.ll llvm/trunk/test/CodeGen/X86/licm-nested.ll llvm/trunk/test/CodeGen/X86/vec_insert-6.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-19.ll llvm/trunk/test/CodeGen/X86/vec_shuffle-20.ll llvm/trunk/test/CodeGen/X86/zero-remat.ll Modified: llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll Wed Aug 18 15:32:46 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=x86_64-linux -relocation-model=static -stats -info-output-file - > %t +; RUN: llc < %s -mtriple=x86_64-linux -relocation-model=static -o /dev/null -stats -info-output-file - > %t ; RUN: not grep spill %t ; RUN: not grep {%rsp} %t ; RUN: not grep {%rbp} %t Modified: llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll (original) +++ llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll Wed Aug 18 15:32:46 2010 @@ -1,7 +1,7 @@ ; RUN: llc < %s -march=x86-64 | grep LCPI | count 3 -; RUN: llc < %s -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 6 +; RUN: llc < %s -march=x86-64 -o /dev/null -stats -info-output-file - | grep asm-printer | grep 6 ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep LCPI | count 3 -; RUN: llc < %s -march=x86 -mattr=+sse2 -stats -info-output-file - | grep asm-printer | grep 12 +; RUN: llc < %s -march=x86 -mattr=+sse2 -o /dev/null -stats -info-output-file - | grep asm-printer | grep 12 declare float @qux(float %y) Modified: llvm/trunk/test/CodeGen/X86/critical-edge-split.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/critical-edge-split.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/critical-edge-split.ll (original) +++ llvm/trunk/test/CodeGen/X86/critical-edge-split.ll Wed Aug 18 15:32:46 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=i386-apple-darwin -stats -info-output-file - | grep asm-printer | grep 29 +; RUN: llc < %s -mtriple=i386-apple-darwin -o /dev/null -stats -info-output-file - | grep asm-printer | grep 29 %CC = type { %Register } %II = type { %"struct.XX::II::$_74" } Modified: llvm/trunk/test/CodeGen/X86/licm-nested.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/licm-nested.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/licm-nested.ll (original) +++ llvm/trunk/test/CodeGen/X86/licm-nested.ll Wed Aug 18 15:32:46 2010 @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=x86_64-apple-darwin -march=x86-64 < %s -stats -info-output-file - | grep machine-licm | grep 3 +; RUN: llc -mtriple=x86_64-apple-darwin -march=x86-64 < %s -o /dev/null -stats -info-output-file - | grep machine-licm | grep 3 ; MachineLICM should be able to hoist the symbolic addresses out of ; the inner loops. Modified: llvm/trunk/test/CodeGen/X86/vec_insert-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_insert-6.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_insert-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_insert-6.ll Wed Aug 18 15:32:46 2010 @@ -1,5 +1,5 @@ ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep pslldq -; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin9 -stats -info-output-file - | grep asm-printer | grep 6 +; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin9 -o /dev/null -stats -info-output-file - | grep asm-printer | grep 6 define <4 x float> @t3(<4 x float>* %P) nounwind { %tmp1 = load <4 x float>* %P Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-19.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-19.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-19.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-19.ll Wed Aug 18 15:32:46 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin9 -stats -info-output-file - | grep asm-printer | grep 4 +; RUN: llc < %s -o /dev/null -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin9 -stats -info-output-file - | grep asm-printer | grep 4 ; PR2485 define <4 x i32> @t(<4 x i32> %a, <4 x i32> %b) nounwind { Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-20.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-20.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-20.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-20.ll Wed Aug 18 15:32:46 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin9 -stats -info-output-file - | grep asm-printer | grep 3 +; RUN: llc < %s -o /dev/null -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin9 -stats -info-output-file - | grep asm-printer | grep 3 define <4 x float> @func(<4 x float> %fp0, <4 x float> %fp1) nounwind { entry: Modified: llvm/trunk/test/CodeGen/X86/zero-remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zero-remat.ll?rev=111401&r1=111400&r2=111401&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/zero-remat.ll (original) +++ llvm/trunk/test/CodeGen/X86/zero-remat.ll Wed Aug 18 15:32:46 2010 @@ -1,5 +1,5 @@ ; RUN: llc < %s -march=x86-64 | FileCheck %s --check-prefix=CHECK-64 -; RUN: llc < %s -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 12 +; RUN: llc < %s -march=x86-64 -o /dev/null -stats -info-output-file - | grep asm-printer | grep 12 ; RUN: llc < %s -march=x86 | FileCheck %s --check-prefix=CHECK-32 declare void @bar(double %x) From resistor at mac.com Wed Aug 18 16:11:38 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Aug 2010 21:11:38 -0000 Subject: [llvm-commits] [llvm] r111425 - /llvm/trunk/lib/Analysis/LazyValueInfo.cpp Message-ID: <20100818211138.1F0742A6C12C@llvm.org> Author: resistor Date: Wed Aug 18 16:11:37 2010 New Revision: 111425 URL: http://llvm.org/viewvc/llvm-project?rev=111425&view=rev Log: Use ConstantRange to propagate information through value definitions. Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=111425&r1=111424&r2=111425&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Wed Aug 18 16:11:37 2010 @@ -503,13 +503,92 @@ // Return the merged value, which is more precise than 'overdefined'. assert(!Result.isOverdefined()); return Cache[BB] = Result; - } else { - } + assert(Cache[BB].isOverdefined() && "Recursive query changed our cache?"); + + // We can only analyze the definitions of certain classes of instructions + // (integral binops and casts at the moment), so bail if this isn't one. LVILatticeVal Result; - Result.markOverdefined(); - return Result; + if ((!isa(BBI) && !isa(BBI)) || + !BBI->getType()->isIntegerTy()) { + DEBUG(dbgs() << " compute BB '" << BB->getName() + << "' - overdefined because inst def found.\n"); + Result.markOverdefined(); + return Result; + } + + // FIXME: We're currently limited to binops with a constant RHS. This should + // be improved. + BinaryOperator *BO = dyn_cast(BBI); + if (BO && !isa(BO->getOperand(1))) { + DEBUG(dbgs() << " compute BB '" << BB->getName() + << "' - overdefined because inst def found.\n"); + + Result.markOverdefined(); + return Result; + } + + // Figure out the range of the LHS. If that fails, bail. + LVILatticeVal LHSVal = Parent.getValueInBlock(BBI->getOperand(0), BB); + if (!LHSVal.isConstantRange()) { + Result.markOverdefined(); + return Result; + } + + ConstantInt *RHS = 0; + ConstantRange LHSRange = LHSVal.getConstantRange(); + ConstantRange RHSRange(1); + const IntegerType *ResultTy = cast(BBI->getType()); + if (isa(BBI)) { + RHS = cast(BBI->getOperand(1)); + RHSRange = ConstantRange(RHS->getValue(), RHS->getValue()+1); + } + + // NOTE: We're currently limited by the set of operations that ConstantRange + // can evaluate symbolically. Enhancing that set will allows us to analyze + // more definitions. + switch (BBI->getOpcode()) { + case Instruction::Add: + Result.markConstantRange(LHSRange.add(RHSRange)); + break; + case Instruction::Sub: + Result.markConstantRange(LHSRange.sub(RHSRange)); + break; + case Instruction::Mul: + Result.markConstantRange(LHSRange.multiply(RHSRange)); + break; + case Instruction::UDiv: + Result.markConstantRange(LHSRange.udiv(RHSRange)); + break; + case Instruction::Shl: + Result.markConstantRange(LHSRange.shl(RHSRange)); + break; + case Instruction::LShr: + Result.markConstantRange(LHSRange.lshr(RHSRange)); + break; + case Instruction::Trunc: + Result.markConstantRange(LHSRange.truncate(ResultTy->getBitWidth())); + break; + case Instruction::SExt: + Result.markConstantRange(LHSRange.signExtend(ResultTy->getBitWidth())); + break; + case Instruction::ZExt: + Result.markConstantRange(LHSRange.zeroExtend(ResultTy->getBitWidth())); + break; + case Instruction::BitCast: + Result.markConstantRange(LHSRange); + break; + + // Unhandled instructions are overdefined. + default: + DEBUG(dbgs() << " compute BB '" << BB->getName() + << "' - overdefined because inst def found.\n"); + Result.markOverdefined(); + break; + } + + return Cache[BB] = Result; } From isanbard at gmail.com Wed Aug 18 16:32:07 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 18 Aug 2010 21:32:07 -0000 Subject: [llvm-commits] [llvm] r111430 - /llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Message-ID: <20100818213207.47C8A2A6C12C@llvm.org> Author: void Date: Wed Aug 18 16:32:07 2010 New Revision: 111430 URL: http://llvm.org/viewvc/llvm-project?rev=111430&view=rev Log: Minor simplification. Gets rid of a needless temporary. Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=111430&r1=111429&r2=111430&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Wed Aug 18 16:32:07 2010 @@ -1403,14 +1403,13 @@ case ARM::ADDri: case ARM::SUBri: case ARM::t2ADDri: - case ARM::t2SUBri: { + case ARM::t2SUBri: MI->RemoveOperand(5); - MachineInstrBuilder MB(MI); - MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); + MachineInstrBuilder(MI) + .addReg(ARM::CPSR, RegState::Define | RegState::Implicit); CmpInstr->eraseFromParent(); return true; } - } return false; } From resistor at mac.com Wed Aug 18 17:02:29 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Aug 2010 22:02:29 -0000 Subject: [llvm-commits] [test-suite] r111431 - /test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c Message-ID: <20100818220229.78BCF2A6C12C@llvm.org> Author: resistor Date: Wed Aug 18 17:02:29 2010 New Revision: 111431 URL: http://llvm.org/viewvc/llvm-project?rev=111431&view=rev Log: Try to stop this test from using the host's PRNG. Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c?rev=111431&r1=111430&r2=111431&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c (original) +++ test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c Wed Aug 18 17:02:29 2010 @@ -214,7 +214,7 @@ /* step 4 */ r = BN_is_prime_fasttest_ex(q, DSS_prime_checks, ctx, - seed_is_random, cb); + 1, cb); if (r > 0) break; if (r != 0) From gohman at apple.com Wed Aug 18 17:04:43 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 22:04:43 -0000 Subject: [llvm-commits] [llvm] r111432 - /llvm/trunk/lib/Support/ErrorHandling.cpp Message-ID: <20100818220443.A70592A6C12C@llvm.org> Author: djg Date: Wed Aug 18 17:04:43 2010 New Revision: 111432 URL: http://llvm.org/viewvc/llvm-project?rev=111432&view=rev Log: Tidy. Modified: llvm/trunk/lib/Support/ErrorHandling.cpp Modified: llvm/trunk/lib/Support/ErrorHandling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ErrorHandling.cpp?rev=111432&r1=111431&r2=111432&view=diff ============================================================================== --- llvm/trunk/lib/Support/ErrorHandling.cpp (original) +++ llvm/trunk/lib/Support/ErrorHandling.cpp Wed Aug 18 17:04:43 2010 @@ -66,11 +66,10 @@ // succeeds (e.g. handling EINTR) and we can't use errs() here because // raw ostreams can call report_fatal_error. SmallVector Buffer; - StringRef ReasonStr = Reason.toStringRef(Buffer); - - ::write(2, "LLVM ERROR: ", 12); - ::write(2, ReasonStr.data(), ReasonStr.size()); - ::write(2, "\n", 1); + raw_svector_ostream OS(Buffer); + OS << "LLVM ERROR: " << Reason << "\n"; + StringRef MessageStr = OS.str(); + (void)::write(2, MessageStr.data(), MessageStr.size()); } // If we reached here, we are failing ungracefully. Run the interrupt handlers From sabre at nondot.org Wed Aug 18 17:07:29 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 22:07:29 -0000 Subject: [llvm-commits] [llvm] r111433 - in /llvm/trunk: include/llvm/Analysis/ValueTracking.h lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/ValueTracking.cpp Message-ID: <20100818220729.941932A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 17:07:29 2010 New Revision: 111433 URL: http://llvm.org/viewvc/llvm-project?rev=111433&view=rev Log: move gep decomposition out of ValueTracking into BasicAA. The form of decomposition that it is doing is very basicaa specific and is only used by basicaa. Now with less tree breakingness. Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/include/llvm/Analysis/ValueTracking.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ValueTracking.h?rev=111433&r1=111432&r2=111433&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ValueTracking.h (original) +++ llvm/trunk/include/llvm/Analysis/ValueTracking.h Wed Aug 18 17:07:29 2010 @@ -77,25 +77,6 @@ /// bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0); - /// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose - /// it into a base pointer with a constant offset and a number of scaled - /// symbolic offsets. - /// - /// The scaled symbolic offsets (represented by pairs of a Value* and a scale - /// in the VarIndices vector) are Value*'s that are known to be scaled by the - /// specified amount, but which may have other unrepresented high bits. As - /// such, the gep cannot necessarily be reconstructed from its decomposed - /// form. - /// - /// When TargetData is around, this function is capable of analyzing - /// everything that Value::getUnderlyingObject() can look through. When not, - /// it just looks through pointer casts. - /// - const Value *DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl > &VarIndices, - const TargetData *TD); - - /// FindInsertedValue - Given an aggregrate and an sequence of indices, see if /// the scalar value indexed is already around as a register, for example if Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=111433&r1=111432&r2=111433&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 18 17:07:29 2010 @@ -18,6 +18,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" +#include "llvm/GlobalAlias.h" #include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" @@ -30,6 +31,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/GetElementPtrTypeIterator.h" #include using namespace llvm; @@ -193,6 +195,233 @@ ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } //===----------------------------------------------------------------------===// +// GetElementPtr Instruction Decomposition and Analysis +//===----------------------------------------------------------------------===// + + +/// GetLinearExpression - Analyze the specified value as a linear expression: +/// "A*V + B", where A and B are constant integers. Return the scale and offset +/// values as APInts and return V as a Value*. The incoming Value is known to +/// have IntegerType. Note that this looks through extends, so the high bits +/// may not be represented in the result. +static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, + const TargetData *TD, unsigned Depth) { + assert(V->getType()->isIntegerTy() && "Not an integer value"); + + // Limit our recursion depth. + if (Depth == 6) { + Scale = 1; + Offset = 0; + return V; + } + + if (BinaryOperator *BOp = dyn_cast(V)) { + if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { + switch (BOp->getOpcode()) { + default: break; + case Instruction::Or: + // X|C == X+C if all the bits in C are unset in X. Otherwise we can't + // analyze it. + if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) + break; + // FALL THROUGH. + case Instruction::Add: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset += RHSC->getValue(); + return V; + case Instruction::Mul: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset *= RHSC->getValue(); + Scale *= RHSC->getValue(); + return V; + case Instruction::Shl: + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + Offset <<= RHSC->getValue().getLimitedValue(); + Scale <<= RHSC->getValue().getLimitedValue(); + return V; + } + } + } + + // Since GEP indices are sign extended anyway, we don't care about the high + // bits of a sign extended value - just scales and offsets. + if (isa(V)) { + Value *CastOp = cast(V)->getOperand(0); + unsigned OldWidth = Scale.getBitWidth(); + unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); + Scale.trunc(SmallWidth); + Offset.trunc(SmallWidth); + Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); + Scale.zext(OldWidth); + Offset.zext(OldWidth); + return Result; + } + + Scale = 1; + Offset = 0; + return V; +} + +/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it +/// into a base pointer with a constant offset and a number of scaled symbolic +/// offsets. +/// +/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in +/// the VarIndices vector) are Value*'s that are known to be scaled by the +/// specified amount, but which may have other unrepresented high bits. As such, +/// the gep cannot necessarily be reconstructed from its decomposed form. +/// +/// When TargetData is around, this function is capable of analyzing everything +/// that Value::getUnderlyingObject() can look through. When not, it just looks +/// through pointer casts. +/// +static const Value * +DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, + SmallVectorImpl > &VarIndices, + const TargetData *TD) { + // Limit recursion depth to limit compile time in crazy cases. + unsigned MaxLookup = 6; + + BaseOffs = 0; + do { + // See if this is a bitcast or GEP. + const Operator *Op = dyn_cast(V); + if (Op == 0) { + // The only non-operator case we can handle are GlobalAliases. + if (const GlobalAlias *GA = dyn_cast(V)) { + if (!GA->mayBeOverridden()) { + V = GA->getAliasee(); + continue; + } + } + return V; + } + + if (Op->getOpcode() == Instruction::BitCast) { + V = Op->getOperand(0); + continue; + } + + const GEPOperator *GEPOp = dyn_cast(Op); + if (GEPOp == 0) + return V; + + // Don't attempt to analyze GEPs over unsized objects. + if (!cast(GEPOp->getOperand(0)->getType()) + ->getElementType()->isSized()) + return V; + + // If we are lacking TargetData information, we can't compute the offets of + // elements computed by GEPs. However, we can handle bitcast equivalent + // GEPs. + if (!TD) { + if (!GEPOp->hasAllZeroIndices()) + return V; + V = GEPOp->getOperand(0); + continue; + } + + // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. + gep_type_iterator GTI = gep_type_begin(GEPOp); + for (User::const_op_iterator I = GEPOp->op_begin()+1, + E = GEPOp->op_end(); I != E; ++I) { + Value *Index = *I; + // Compute the (potentially symbolic) offset in bytes for this index. + if (const StructType *STy = dyn_cast(*GTI++)) { + // For a struct, add the member offset. + unsigned FieldNo = cast(Index)->getZExtValue(); + if (FieldNo == 0) continue; + + BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); + continue; + } + + // For an array/pointer, add the element offset, explicitly scaled. + if (ConstantInt *CIdx = dyn_cast(Index)) { + if (CIdx->isZero()) continue; + BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); + continue; + } + + uint64_t Scale = TD->getTypeAllocSize(*GTI); + + // Use GetLinearExpression to decompose the index into a C1*V+C2 form. + unsigned Width = cast(Index->getType())->getBitWidth(); + APInt IndexScale(Width, 0), IndexOffset(Width, 0); + Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); + + // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. + // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. + BaseOffs += IndexOffset.getZExtValue()*Scale; + Scale *= IndexScale.getZExtValue(); + + + // If we already had an occurrance of this index variable, merge this + // scale into it. For example, we want to handle: + // A[x][x] -> x*16 + x*4 -> x*20 + // This also ensures that 'x' only appears in the index list once. + for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { + if (VarIndices[i].first == Index) { + Scale += VarIndices[i].second; + VarIndices.erase(VarIndices.begin()+i); + break; + } + } + + // Make sure that we have a scale that makes sense for this target's + // pointer size. + if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { + Scale <<= ShiftBits; + Scale >>= ShiftBits; + } + + if (Scale) + VarIndices.push_back(std::make_pair(Index, Scale)); + } + + // Analyze the base pointer next. + V = GEPOp->getOperand(0); + } while (--MaxLookup); + + // If the chain of expressions is too deep, just return early. + return V; +} + +/// GetIndexDifference - Dest and Src are the variable indices from two +/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base +/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic +/// difference between the two pointers. +static void GetIndexDifference( + SmallVectorImpl > &Dest, + const SmallVectorImpl > &Src) { + if (Src.empty()) return; + + for (unsigned i = 0, e = Src.size(); i != e; ++i) { + const Value *V = Src[i].first; + int64_t Scale = Src[i].second; + + // Find V in Dest. This is N^2, but pointer indices almost never have more + // than a few variable indexes. + for (unsigned j = 0, e = Dest.size(); j != e; ++j) { + if (Dest[j].first != V) continue; + + // If we found it, subtract off Scale V's from the entry in Dest. If it + // goes to zero, remove the entry. + if (Dest[j].second != Scale) + Dest[j].second -= Scale; + else + Dest.erase(Dest.begin()+j); + Scale = 0; + break; + } + + // If we didn't consume this entry, add it to the end of the Dest list. + if (Scale) + Dest.push_back(std::make_pair(V, -Scale)); + } +} + +//===----------------------------------------------------------------------===// // BasicAliasAnalysis Pass //===----------------------------------------------------------------------===// @@ -467,40 +696,6 @@ } -/// GetIndexDifference - Dest and Src are the variable indices from two -/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base -/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic -/// difference between the two pointers. -static void GetIndexDifference( - SmallVectorImpl > &Dest, - const SmallVectorImpl > &Src) { - if (Src.empty()) return; - - for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].first; - int64_t Scale = Src[i].second; - - // Find V in Dest. This is N^2, but pointer indices almost never have more - // than a few variable indexes. - for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].first != V) continue; - - // If we found it, subtract off Scale V's from the entry in Dest. If it - // goes to zero, remove the entry. - if (Dest[j].second != Scale) - Dest[j].second -= Scale; - else - Dest.erase(Dest.begin()+j); - Scale = 0; - break; - } - - // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) - Dest.push_back(std::make_pair(V, -Scale)); - } -} - /// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction /// against another pointer. We know that V1 is a GEP, but we don't know /// anything about V2. UnderlyingV1 is GEP1->getUnderlyingObject(), Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=111433&r1=111432&r2=111433&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Aug 18 17:07:29 2010 @@ -973,195 +973,6 @@ return false; } - -/// GetLinearExpression - Analyze the specified value as a linear expression: -/// "A*V + B", where A and B are constant integers. Return the scale and offset -/// values as APInts and return V as a Value*. The incoming Value is known to -/// have IntegerType. Note that this looks through extends, so the high bits -/// may not be represented in the result. -static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, - const TargetData *TD, unsigned Depth) { - assert(V->getType()->isIntegerTy() && "Not an integer value"); - - // Limit our recursion depth. - if (Depth == 6) { - Scale = 1; - Offset = 0; - return V; - } - - if (BinaryOperator *BOp = dyn_cast(V)) { - if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { - switch (BOp->getOpcode()) { - default: break; - case Instruction::Or: - // X|C == X+C if all the bits in C are unset in X. Otherwise we can't - // analyze it. - if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) - break; - // FALL THROUGH. - case Instruction::Add: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset += RHSC->getValue(); - return V; - case Instruction::Mul: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset *= RHSC->getValue(); - Scale *= RHSC->getValue(); - return V; - case Instruction::Shl: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); - Offset <<= RHSC->getValue().getLimitedValue(); - Scale <<= RHSC->getValue().getLimitedValue(); - return V; - } - } - } - - // Since GEP indices are sign extended anyway, we don't care about the high - // bits of a sign extended value - just scales and offsets. - if (isa(V)) { - Value *CastOp = cast(V)->getOperand(0); - unsigned OldWidth = Scale.getBitWidth(); - unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); - Scale.trunc(SmallWidth); - Offset.trunc(SmallWidth); - Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); - Scale.zext(OldWidth); - Offset.zext(OldWidth); - return Result; - } - - Scale = 1; - Offset = 0; - return V; -} - -/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it -/// into a base pointer with a constant offset and a number of scaled symbolic -/// offsets. -/// -/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in -/// the VarIndices vector) are Value*'s that are known to be scaled by the -/// specified amount, but which may have other unrepresented high bits. As such, -/// the gep cannot necessarily be reconstructed from its decomposed form. -/// -/// When TargetData is around, this function is capable of analyzing everything -/// that Value::getUnderlyingObject() can look through. When not, it just looks -/// through pointer casts. -/// -const Value *llvm::DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl > &VarIndices, - const TargetData *TD) { - // Limit recursion depth to limit compile time in crazy cases. - unsigned MaxLookup = 6; - - BaseOffs = 0; - do { - // See if this is a bitcast or GEP. - const Operator *Op = dyn_cast(V); - if (Op == 0) { - // The only non-operator case we can handle are GlobalAliases. - if (const GlobalAlias *GA = dyn_cast(V)) { - if (!GA->mayBeOverridden()) { - V = GA->getAliasee(); - continue; - } - } - return V; - } - - if (Op->getOpcode() == Instruction::BitCast) { - V = Op->getOperand(0); - continue; - } - - const GEPOperator *GEPOp = dyn_cast(Op); - if (GEPOp == 0) - return V; - - // Don't attempt to analyze GEPs over unsized objects. - if (!cast(GEPOp->getOperand(0)->getType()) - ->getElementType()->isSized()) - return V; - - // If we are lacking TargetData information, we can't compute the offets of - // elements computed by GEPs. However, we can handle bitcast equivalent - // GEPs. - if (!TD) { - if (!GEPOp->hasAllZeroIndices()) - return V; - V = GEPOp->getOperand(0); - continue; - } - - // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. - gep_type_iterator GTI = gep_type_begin(GEPOp); - for (User::const_op_iterator I = GEPOp->op_begin()+1, - E = GEPOp->op_end(); I != E; ++I) { - Value *Index = *I; - // Compute the (potentially symbolic) offset in bytes for this index. - if (const StructType *STy = dyn_cast(*GTI++)) { - // For a struct, add the member offset. - unsigned FieldNo = cast(Index)->getZExtValue(); - if (FieldNo == 0) continue; - - BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); - continue; - } - - // For an array/pointer, add the element offset, explicitly scaled. - if (ConstantInt *CIdx = dyn_cast(Index)) { - if (CIdx->isZero()) continue; - BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); - continue; - } - - uint64_t Scale = TD->getTypeAllocSize(*GTI); - - // Use GetLinearExpression to decompose the index into a C1*V+C2 form. - unsigned Width = cast(Index->getType())->getBitWidth(); - APInt IndexScale(Width, 0), IndexOffset(Width, 0); - Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); - - // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. - // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. - BaseOffs += IndexOffset.getZExtValue()*Scale; - Scale *= IndexScale.getZExtValue(); - - - // If we already had an occurrance of this index variable, merge this - // scale into it. For example, we want to handle: - // A[x][x] -> x*16 + x*4 -> x*20 - // This also ensures that 'x' only appears in the index list once. - for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { - if (VarIndices[i].first == Index) { - Scale += VarIndices[i].second; - VarIndices.erase(VarIndices.begin()+i); - break; - } - } - - // Make sure that we have a scale that makes sense for this target's - // pointer size. - if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { - Scale <<= ShiftBits; - Scale >>= ShiftBits; - } - - if (Scale) - VarIndices.push_back(std::make_pair(Index, Scale)); - } - - // Analyze the base pointer next. - V = GEPOp->getOperand(0); - } while (--MaxLookup); - - // If the chain of expressions is too deep, just return early. - return V; -} - - // This is the recursive version of BuildSubAggregate. It takes a few different // arguments. Idxs is the index within the nested struct From that we are // looking at now (which is of type IndexedType). IdxSkip is the number of From gohman at apple.com Wed Aug 18 17:22:44 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 22:22:44 -0000 Subject: [llvm-commits] [llvm] r111435 - /llvm/trunk/test/CodeGen/ARM/remat.ll Message-ID: <20100818222244.54BD52A6C12C@llvm.org> Author: djg Date: Wed Aug 18 17:22:44 2010 New Revision: 111435 URL: http://llvm.org/viewvc/llvm-project?rev=111435&view=rev Log: When sending stats output to stdout for grepping, don't emit normal output to standard output also. Modified: llvm/trunk/test/CodeGen/ARM/remat.ll Modified: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=111435&r1=111434&r2=111435&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/remat.ll (original) +++ llvm/trunk/test/CodeGen/ARM/remat.ll Wed Aug 18 17:22:44 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=arm -mattr=+v6,+vfp2 -stats -info-output-file - | grep "Number of re-materialization" +; RUN: llc < %s -march=arm -mattr=+v6,+vfp2 -o /dev/null -stats -info-output-file - | grep "Number of re-materialization" define i32 @main(i32 %argc, i8** nocapture %argv, double %d1, double %d2) nounwind { entry: From gohman at apple.com Wed Aug 18 17:26:19 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 22:26:19 -0000 Subject: [llvm-commits] [llvm] r111436 - in /llvm/trunk: include/llvm/Support/raw_ostream.h lib/Support/raw_ostream.cpp Message-ID: <20100818222619.6EE002A6C12C@llvm.org> Author: djg Date: Wed Aug 18 17:26:19 2010 New Revision: 111436 URL: http://llvm.org/viewvc/llvm-project?rev=111436&view=rev Log: Make raw_fd_ostream consider itself the owner of STDOUT_FILENO when constructed with an output filename of "-". In particular, allow the file descriptor to be closed, and close the file descriptor in the destructor if it hasn't been explicitly closed already, to ensure that any write errors are detected. Modified: llvm/trunk/include/llvm/Support/raw_ostream.h llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111436&r1=111435&r2=111436&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Wed Aug 18 17:26:19 2010 @@ -353,8 +353,11 @@ /// be immediately destroyed; the string will be empty if no error occurred. /// This allows optional flags to control how the file will be opened. /// - /// \param Filename - The file to open. If this is "-" then the - /// stream will use stdout instead. + /// As a special case, if Filename is "-", then the stream will use + /// STDOUT_FILENO instead of opening a file. Note that it will still consider + /// itself to own the file descriptor. In particular, it will close the + /// file descriptor when it is done (this is necessary to detect + /// output errors). raw_fd_ostream(const char *Filename, std::string &ErrorInfo, unsigned Flags = 0); Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111436&r1=111435&r2=111436&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Wed Aug 18 17:26:19 2010 @@ -377,14 +377,17 @@ ErrorInfo.clear(); - // Handle "-" as stdout. + // Handle "-" as stdout. Note that when we do this, we consider ourself + // the owner of stdout. This means that we can do things like close the + // file descriptor when we're done and set the "binary" flag globally. if (Filename[0] == '-' && Filename[1] == 0) { FD = STDOUT_FILENO; // If user requested binary then put stdout into binary mode if // possible. if (Flags & F_Binary) sys::Program::ChangeStdoutToBinary(); - ShouldClose = false; + // Close stdout when we're done, to detect any output errors. + ShouldClose = true; return; } From resistor at mac.com Wed Aug 18 17:34:06 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Aug 2010 22:34:06 -0000 Subject: [llvm-commits] [test-suite] r111438 - /test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c Message-ID: <20100818223406.3712D2A6C12C@llvm.org> Author: resistor Date: Wed Aug 18 17:34:06 2010 New Revision: 111438 URL: http://llvm.org/viewvc/llvm-project?rev=111438&view=rev Log: Revert r111431. It didn't address the issue I was trying to tackle. Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c?rev=111438&r1=111437&r2=111438&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c (original) +++ test-suite/trunk/MultiSource/Applications/OpenSSL/dsa_gen.c Wed Aug 18 17:34:06 2010 @@ -214,7 +214,7 @@ /* step 4 */ r = BN_is_prime_fasttest_ex(q, DSS_prime_checks, ctx, - 1, cb); + seed_is_random, cb); if (r > 0) break; if (r != 0) From resistor at mac.com Wed Aug 18 17:34:27 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Aug 2010 22:34:27 -0000 Subject: [llvm-commits] [test-suite] r111439 - /test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c Message-ID: <20100818223427.A0C782A6C12C@llvm.org> Author: resistor Date: Wed Aug 18 17:34:27 2010 New Revision: 111439 URL: http://llvm.org/viewvc/llvm-project?rev=111439&view=rev Log: Disable use of /dev/random and friends to make this test more portable. Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c?rev=111439&r1=111438&r2=111439&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c (original) +++ test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c Wed Aug 18 17:34:27 2010 @@ -133,259 +133,7 @@ # define FD_SETSIZE (8*sizeof(fd_set)) #endif -#ifdef __VOS__ -int RAND_poll(void) -{ - unsigned char buf[ENTROPY_NEEDED]; - pid_t curr_pid; - uid_t curr_uid; - static int first=1; - int i; - long rnd = 0; - struct timespec ts; - unsigned seed; - -/* The VOS random() function starts from a static seed so its - initial value is predictable. If random() returns the - initial value, reseed it with dynamic data. The VOS - real-time clock has a granularity of 1 nsec so it should be - reasonably difficult to predict its exact value. Do not - gratuitously reseed the PRNG because other code in this - process or thread may be using it. */ - - if (first) { - first = 0; - rnd = random (); - if (rnd == 1804289383) { - clock_gettime (CLOCK_REALTIME, &ts); - curr_pid = getpid(); - curr_uid = getuid(); - seed = ts.tv_sec ^ ts.tv_nsec ^ curr_pid ^ curr_uid; - srandom (seed); - } - } - - for (i = 0; i < sizeof(buf); i++) { - if (i % 4 == 0) - rnd = random(); - buf[i] = rnd; - rnd >>= 8; - } - RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); - memset(buf, 0, sizeof(buf)); - - return 1; -} -#elif defined __OpenBSD__ -int RAND_poll(void) -{ - u_int32_t rnd = 0, i; - unsigned char buf[ENTROPY_NEEDED]; - - for (i = 0; i < sizeof(buf); i++) { - if (i % 4 == 0) - rnd = arc4random(); - buf[i] = rnd; - rnd >>= 8; - } - RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); - memset(buf, 0, sizeof(buf)); - - return 1; -} -#else /* !defined(__OpenBSD__) */ -int RAND_poll(void) -{ - unsigned long l; - pid_t curr_pid = getpid(); -#if defined(DEVRANDOM) || defined(DEVRANDOM_EGD) - unsigned char tmpbuf[ENTROPY_NEEDED]; - int n = 0; -#endif -#ifdef DEVRANDOM - static const char *randomfiles[] = { DEVRANDOM }; - struct stat randomstats[sizeof(randomfiles)/sizeof(randomfiles[0])]; - int fd; - unsigned int i; -#endif -#ifdef DEVRANDOM_EGD - static const char *egdsockets[] = { DEVRANDOM_EGD, NULL }; - const char **egdsocket = NULL; -#endif - -#ifdef DEVRANDOM - memset(randomstats,0,sizeof(randomstats)); - /* Use a random entropy pool device. Linux, FreeBSD and OpenBSD - * have this. Use /dev/urandom if you can as /dev/random may block - * if it runs out of random entries. */ - - for (i = 0; (i < sizeof(randomfiles)/sizeof(randomfiles[0])) && - (n < ENTROPY_NEEDED); i++) - { - if ((fd = open(randomfiles[i], O_RDONLY -#ifdef O_NONBLOCK - |O_NONBLOCK -#endif -#ifdef O_BINARY - |O_BINARY -#endif -#ifdef O_NOCTTY /* If it happens to be a TTY (god forbid), do not make it - our controlling tty */ - |O_NOCTTY -#endif - )) >= 0) - { - int usec = 10*1000; /* spend 10ms on each file */ - int r; - unsigned int j; - struct stat *st=&randomstats[i]; - - /* Avoid using same input... Used to be O_NOFOLLOW - * above, but it's not universally appropriate... */ - if (fstat(fd,st) != 0) { close(fd); continue; } - for (j=0;jst_ino && - randomstats[j].st_dev==st->st_dev) - break; - } - if (j 0 && (unsigned)fd >= FD_SETSIZE) - { - /* can't use select, so just try to read once anyway */ - try_read = 1; - } - else - { - FD_ZERO(&fset); - FD_SET(fd, &fset); - - if (select(fd+1,&fset,NULL,NULL,&t) >= 0) - { - usec = t.tv_usec; - if (FD_ISSET(fd, &fset)) - try_read = 1; - } - else - usec = 0; - } -#endif - - if (try_read) - { - r = read(fd,(unsigned char *)tmpbuf+n, ENTROPY_NEEDED-n); - if (r > 0) - n += r; -#if defined(OPENSSL_SYS_BEOS_R5) - if (r == 0) - snooze(t.tv_usec); -#endif - } - else - r = -1; - - /* Some Unixen will update t in select(), some - won't. For those who won't, or if we - didn't use select() in the first place, - give up here, otherwise, we will do - this once again for the remaining - time. */ - if (usec == 10*1000) - usec = 0; - } - while ((r > 0 || - (errno == EINTR || errno == EAGAIN)) && usec != 0 && n < ENTROPY_NEEDED); - - close(fd); - } - } -#endif /* defined(DEVRANDOM) */ - -#ifdef DEVRANDOM_EGD - /* Use an EGD socket to read entropy from an EGD or PRNGD entropy - * collecting daemon. */ - - for (egdsocket = egdsockets; *egdsocket && n < ENTROPY_NEEDED; egdsocket++) - { - int r; - - r = RAND_query_egd_bytes(*egdsocket, (unsigned char *)tmpbuf+n, - ENTROPY_NEEDED-n); - if (r > 0) - n += r; - } -#endif /* defined(DEVRANDOM_EGD) */ - -#if defined(DEVRANDOM) || defined(DEVRANDOM_EGD) - if (n > 0) - { - RAND_add(tmpbuf,sizeof tmpbuf,(double)n); - OPENSSL_cleanse(tmpbuf,n); - } -#endif - - /* put in some default random data, we need more than just this */ - l=curr_pid; - RAND_add(&l,sizeof(l),0.0); - l=getuid(); - RAND_add(&l,sizeof(l),0.0); - - l=time(NULL); - RAND_add(&l,sizeof(l),0.0); - -#if defined(OPENSSL_SYS_BEOS) - { - system_info sysInfo; - get_system_info(&sysInfo); - RAND_add(&sysInfo,sizeof(sysInfo),0); - } -#endif - -#if defined(DEVRANDOM) || defined(DEVRANDOM_EGD) - return 1; -#else - return 0; -#endif -} - -#endif /* defined(__OpenBSD__) */ -#endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */ - - -#if defined(OPENSSL_SYS_VXWORKS) int RAND_poll(void) { return 0; } -#endif From gohman at apple.com Wed Aug 18 17:35:57 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 18 Aug 2010 22:35:57 -0000 Subject: [llvm-commits] [llvm] r111440 - /llvm/trunk/test/Other/close-stderr.ll Message-ID: <20100818223557.0EB4F2A6C12C@llvm.org> Author: djg Date: Wed Aug 18 17:35:56 2010 New Revision: 111440 URL: http://llvm.org/viewvc/llvm-project?rev=111440&view=rev Log: Add a testcase to verify that commands don't crash when they hit errors on stderr. Added: llvm/trunk/test/Other/close-stderr.ll Added: llvm/trunk/test/Other/close-stderr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/close-stderr.ll?rev=111440&view=auto ============================================================================== --- llvm/trunk/test/Other/close-stderr.ll (added) +++ llvm/trunk/test/Other/close-stderr.ll Wed Aug 18 17:35:56 2010 @@ -0,0 +1,9 @@ +; RUN: sh -c "\ +; RUN: opt --reject-this-option 2>&-; echo $?; \ +; RUN: opt -o /dev/null /dev/null 2>&-; echo $?; \ +; RUN: " | FileCheck %s +; CHECK: {{^1$}} +; CHECK: {{^0$}} + +; Test that the error handling when writing to stderr fails exits the +; program cleanly rather than aborting. From criswell at uiuc.edu Wed Aug 18 17:40:06 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 18 Aug 2010 22:40:06 -0000 Subject: [llvm-commits] [poolalloc] r111441 - /poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Message-ID: <20100818224006.B212F2A6C12C@llvm.org> Author: criswell Date: Wed Aug 18 17:40:06 2010 New Revision: 111441 URL: http://llvm.org/viewvc/llvm-project?rev=111441&view=rev Log: When we find that a function's DSGraph has been inlined into this DSGraph, go ahead and merge its arguments into the arguments of the other functions and set its DSGraph to be common DSGraph constructed for the equivalence class. This fixes the assertion in poolalloc that asserts on 254.gap when poolalloc assigns different numbers of pools to pass into different functions targeted by the same indirect call site. Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=111441&r1=111440&r2=111441&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original) +++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Wed Aug 18 17:40:06 2010 @@ -109,7 +109,40 @@ BaseGraph = getOrCreateGraph(F); BaseGraph->getFunctionArgumentsForCall(F, Args); } else if (BaseGraph->containsFunction(F)) { - // The DSGraph for this function has already been merged. + // + // The DSGraph for this function has already been merged into the + // graph that we are creating. However, that does not mean that + // function arguments of this function have been merged with the + // function arguments of the other functions in the equivalence graph + // (or even with functions belonging to the same SCC in the call + // graph). Furthermore, it doesn't necessarily imply that the + // contained function's DSGraph is the same as the one we're + // building; it is possible (I think) for only the function's DSNodes + // and other information to have been merged in. + // + // For these reasons, we will merge the function argument DSNodes and + // set this function's DSGraph to be the same graph used for all + // other function's in this equivalence class. + // + + // + // Merge the arguments together. + // + std::vector NextArgs; + BaseGraph->getFunctionArgumentsForCall(F, NextArgs); + unsigned i = 0, e = Args.size(); + for (; i != e; ++i) { + if (i == NextArgs.size()) break; + Args[i].mergeWith(NextArgs[i]); + } + for (e = NextArgs.size(); i != e; ++i) + Args.push_back(NextArgs[i]); + + // + // Make this function use the DSGraph that we're creating for all of + // the functions in this equivalence class. + // + setDSGraph(*F, BaseGraph); } else { // // Merge in the DSGraph. From resistor at mac.com Wed Aug 18 17:43:20 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 18 Aug 2010 22:43:20 -0000 Subject: [llvm-commits] [test-suite] r111442 - /test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c Message-ID: <20100818224320.296CA2A6C12C@llvm.org> Author: resistor Date: Wed Aug 18 17:43:19 2010 New Revision: 111442 URL: http://llvm.org/viewvc/llvm-project?rev=111442&view=rev Log: Fix the building of this test. Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c Modified: test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c?rev=111442&r1=111441&r2=111442&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c (original) +++ test-suite/trunk/MultiSource/Applications/OpenSSL/rand_unix.c Wed Aug 18 17:43:19 2010 @@ -116,22 +116,6 @@ #include "rand.h" #include "rand_lcl.h" -#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) - -#include -#include -#include -#include -#include -#include -#include -#if defined(OPENSSL_SYS_LINUX) /* should actually be available virtually everywhere */ -# include -#endif -#include -#ifndef FD_SETSIZE -# define FD_SETSIZE (8*sizeof(fd_set)) -#endif int RAND_poll(void) { From grosbach at apple.com Wed Aug 18 17:44:49 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 18 Aug 2010 22:44:49 -0000 Subject: [llvm-commits] [llvm] r111443 - in /llvm/trunk/lib: CodeGen/LocalStackSlotAllocation.cpp Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20100818224449.CF2F62A6C12C@llvm.org> Author: grosbach Date: Wed Aug 18 17:44:49 2010 New Revision: 111443 URL: http://llvm.org/viewvc/llvm-project?rev=111443&view=rev Log: Enable ARM base register reuse to local stack slot allocation. Whenever a new frame index reference to an object in the local block is seen, check if it's near enough to any previously allocaated base register to re-use. rdar://8277890 Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111443&r1=111442&r2=111443&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Wed Aug 18 17:44:49 2010 @@ -43,8 +43,11 @@ namespace { class LocalStackSlotPass: public MachineFunctionPass { - void calculateFrameObjectOffsets(MachineFunction &Fn); + SmallVector LocalOffsets; + void AdjustStackOffset(MachineFrameInfo *MFI, int FrameIdx, int64_t &Offset, + unsigned &MaxAlign); + void calculateFrameObjectOffsets(MachineFunction &Fn); void insertFrameReferenceRegisters(MachineFunction &Fn); public: static char ID; // Pass identification, replacement for typeid @@ -70,18 +73,29 @@ } bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) { + MachineFrameInfo *MFI = MF.getFrameInfo(); + unsigned LocalObjectCount = MFI->getObjectIndexEnd(); + + // Early exit if there are no locals to consider + if (!LocalObjectCount) + return true; + + // Make sure we have enough space to store the local offsets. + LocalOffsets.resize(MFI->getObjectIndexEnd()); + // Lay out the local blob. calculateFrameObjectOffsets(MF); // Insert virtual base registers to resolve frame index references. insertFrameReferenceRegisters(MF); + return true; } /// AdjustStackOffset - Helper function used to adjust the stack frame offset. -static inline void -AdjustStackOffset(MachineFrameInfo *MFI, int FrameIdx, int64_t &Offset, - unsigned &MaxAlign) { +void LocalStackSlotPass::AdjustStackOffset(MachineFrameInfo *MFI, + int FrameIdx, int64_t &Offset, + unsigned &MaxAlign) { unsigned Align = MFI->getObjectAlignment(FrameIdx); // If the alignment of this object is greater than that of the stack, then @@ -93,6 +107,9 @@ DEBUG(dbgs() << "Allocate FI(" << FrameIdx << ") to local offset " << Offset << "\n"); + // Keep the offset available for base register allocation + LocalOffsets[FrameIdx] = Offset; + // And tell MFI about it for PEI to use later MFI->mapLocalFrameObject(FrameIdx, Offset); Offset += MFI->getObjectSize(FrameIdx); @@ -149,12 +166,16 @@ static inline bool lookupCandidateBaseReg(const SmallVector, 8> &Regs, std::pair &RegOffset, + int64_t LocalFrameOffset, const MachineInstr *MI, const TargetRegisterInfo *TRI) { unsigned e = Regs.size(); for (unsigned i = 0; i < e; ++i) { RegOffset = Regs[i]; - if (TRI->isBaseRegInRange(MI, RegOffset.first, RegOffset.second)) + // Check if the relative offset from the where the base register references + // to the target address is in range for the instruction. + int64_t Offset = LocalFrameOffset - RegOffset.second; + if (TRI->isBaseRegInRange(MI, RegOffset.first, Offset)) return true; } return false; @@ -173,6 +194,9 @@ for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { + // A base register definition is a register+offset pair. + SmallVector, 8> BaseRegisters; + for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { MachineInstr *MI = I; // Debug value instructions can't be out of range, so they don't need @@ -183,9 +207,6 @@ if (MI->isDebugValue()) continue; - // A base register definition is a register+offset pair. - SmallVector, 8> BaseRegisters; - // For now, allocate the base register(s) within the basic block // where they're used, and don't try to keep them around outside // of that. It may be beneficial to try sharing them more broadly @@ -212,10 +233,12 @@ // create a new one. std::pair RegOffset; - if (lookupCandidateBaseReg(BaseRegisters, RegOffset, MI, TRI)) { + if (lookupCandidateBaseReg(BaseRegisters, RegOffset, + LocalOffsets[FrameIdx], MI, TRI)) { + DEBUG(dbgs() << " Reusing base register " << RegOffset.first); // We found a register to reuse. BaseReg = RegOffset.first; - Offset = RegOffset.second; + Offset = LocalOffsets[FrameIdx] - RegOffset.second; } else { // No previously defined register was in range, so create a // new one. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=111443&r1=111442&r2=111443&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Aug 18 17:44:49 2010 @@ -1453,6 +1453,75 @@ bool ARMBaseRegisterInfo::isBaseRegInRange(const MachineInstr *MI, unsigned Reg, int64_t Offset) const { + const TargetInstrDesc &Desc = MI->getDesc(); + unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask); + unsigned i = 0; + + while (!MI->getOperand(i).isFI()) { + ++i; + assert(i < MI->getNumOperands() &&"Instr doesn't have FrameIndex operand!"); + } + + // AddrMode4 and AddrMode6 cannot handle any offset. + if (AddrMode == ARMII::AddrMode4 || AddrMode == ARMII::AddrMode6) + return Offset == 0; + + unsigned NumBits = 0; + unsigned Scale = 1; + unsigned ImmIdx = 0; + int InstrOffs; + switch(AddrMode) { + case ARMII::AddrModeT2_i8: + case ARMII::AddrModeT2_i12: + // i8 supports only negative, and i12 supports only positive, so + // based on Offset sign, consider the appropriate instruction + Offset += MI->getOperand(i+1).getImm(); + if (Offset < 0) { + NumBits = 8; + Offset = -Offset; + } else { + NumBits = 12; + } + break; + case ARMII::AddrMode5: { + // VFP address mode. + const MachineOperand &OffOp = MI->getOperand(i+1); + int InstrOffs = ARM_AM::getAM5Offset(OffOp.getImm()); + if (ARM_AM::getAM5Op(OffOp.getImm()) == ARM_AM::sub) + InstrOffs = -InstrOffs; + NumBits = 8; + Scale = 4; + break; + } + case ARMII::AddrMode2: { + ImmIdx = i+2; + InstrOffs = ARM_AM::getAM2Offset(MI->getOperand(ImmIdx).getImm()); + if (ARM_AM::getAM2Op(MI->getOperand(ImmIdx).getImm()) == ARM_AM::sub) + InstrOffs = -InstrOffs; + NumBits = 12; + break; + } + case ARMII::AddrMode3: { + ImmIdx = i+2; + InstrOffs = ARM_AM::getAM3Offset(MI->getOperand(ImmIdx).getImm()); + if (ARM_AM::getAM3Op(MI->getOperand(ImmIdx).getImm()) == ARM_AM::sub) + InstrOffs = -InstrOffs; + NumBits = 8; + break; + } + default: + llvm_unreachable("Unsupported addressing mode!"); + break; + } + + Offset += InstrOffs * Scale; + assert((Offset & (Scale-1)) == 0 && "Can't encode this offset!"); + if (Offset < 0) + Offset = -Offset; + + unsigned Mask = (1 << NumBits) - 1; + if ((unsigned)Offset <= Mask * Scale) + return true; return false; } From sabre at nondot.org Wed Aug 18 17:47:57 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 22:47:57 -0000 Subject: [llvm-commits] [llvm] r111444 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100818224757.2529C2A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 17:47:56 2010 New Revision: 111444 URL: http://llvm.org/viewvc/llvm-project?rev=111444&view=rev Log: rework GEP decomposition to make a new VariableGEPIndex struct instead of using a pair. This tidies up the code a bit. While setting things up, add a (currently unused) field to keep track of how the value is extended. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=111444&r1=111443&r2=111444&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 18 17:47:56 2010 @@ -198,6 +198,20 @@ // GetElementPtr Instruction Decomposition and Analysis //===----------------------------------------------------------------------===// +namespace { + enum ExtensionKind { + EK_NotExtended, + EK_SignExt, + EK_ZeroExt + }; + + struct VariableGEPIndex { + const Value *V; + ExtensionKind Extension; + int64_t Scale; + }; +} + /// GetLinearExpression - Analyze the specified value as a linear expression: /// "A*V + B", where A and B are constant integers. Return the scale and offset @@ -277,7 +291,7 @@ /// static const Value * DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl > &VarIndices, + SmallVectorImpl &VarIndices, const TargetData *TD) { // Limit recursion depth to limit compile time in crazy cases. unsigned MaxLookup = 6; @@ -344,6 +358,7 @@ } uint64_t Scale = TD->getTypeAllocSize(*GTI); + ExtensionKind Extension = EK_NotExtended; // Use GetLinearExpression to decompose the index into a C1*V+C2 form. unsigned Width = cast(Index->getType())->getBitWidth(); @@ -361,8 +376,9 @@ // A[x][x] -> x*16 + x*4 -> x*20 // This also ensures that 'x' only appears in the index list once. for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { - if (VarIndices[i].first == Index) { - Scale += VarIndices[i].second; + if (VarIndices[i].V == Index && + VarIndices[i].Extension == Extension) { + Scale += VarIndices[i].Scale; VarIndices.erase(VarIndices.begin()+i); break; } @@ -375,8 +391,10 @@ Scale >>= ShiftBits; } - if (Scale) - VarIndices.push_back(std::make_pair(Index, Scale)); + if (Scale) { + VariableGEPIndex Entry = {Index, Extension, Scale}; + VarIndices.push_back(Entry); + } } // Analyze the base pointer next. @@ -391,24 +409,24 @@ /// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base /// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic /// difference between the two pointers. -static void GetIndexDifference( - SmallVectorImpl > &Dest, - const SmallVectorImpl > &Src) { +static void GetIndexDifference(SmallVectorImpl &Dest, + const SmallVectorImpl &Src) { if (Src.empty()) return; for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].first; - int64_t Scale = Src[i].second; + const Value *V = Src[i].V; + ExtensionKind Extension = Src[i].Extension; + int64_t Scale = Src[i].Scale; // Find V in Dest. This is N^2, but pointer indices almost never have more // than a few variable indexes. for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].first != V) continue; + if (Dest[j].V != V || Dest[j].Extension != Extension) continue; // If we found it, subtract off Scale V's from the entry in Dest. If it // goes to zero, remove the entry. - if (Dest[j].second != Scale) - Dest[j].second -= Scale; + if (Dest[j].Scale != Scale) + Dest[j].Scale -= Scale; else Dest.erase(Dest.begin()+j); Scale = 0; @@ -416,8 +434,10 @@ } // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) - Dest.push_back(std::make_pair(V, -Scale)); + if (Scale) { + VariableGEPIndex Entry = { V, Extension, -Scale }; + Dest.push_back(Entry); + } } } @@ -714,7 +734,7 @@ return MayAlias; int64_t GEP1BaseOffset; - SmallVector, 4> GEP1VariableIndices; + SmallVector GEP1VariableIndices; // If we have two gep instructions with must-alias'ing base pointers, figure // out if the indexes to the GEP tell us anything about the derived pointer. @@ -734,7 +754,7 @@ DecomposeGEPExpression(GEP1, GEP1BaseOffset, GEP1VariableIndices, TD); int64_t GEP2BaseOffset; - SmallVector, 4> GEP2VariableIndices; + SmallVector GEP2VariableIndices; const Value *GEP2BasePtr = DecomposeGEPExpression(GEP2, GEP2BaseOffset, GEP2VariableIndices, TD); @@ -805,8 +825,8 @@ // provides an offset of 4 bytes (assuming a <= 4 byte access). for (unsigned i = 0, e = GEP1VariableIndices.size(); i != e && GEP1BaseOffset;++i) - if (int64_t RemovedOffset = GEP1BaseOffset/GEP1VariableIndices[i].second) - GEP1BaseOffset -= RemovedOffset*GEP1VariableIndices[i].second; + if (int64_t RemovedOffset = GEP1BaseOffset/GEP1VariableIndices[i].Scale) + GEP1BaseOffset -= RemovedOffset*GEP1VariableIndices[i].Scale; // If our known offset is bigger than the access size, we know we don't have // an alias. From sabre at nondot.org Wed Aug 18 17:52:09 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 22:52:09 -0000 Subject: [llvm-commits] [llvm] r111445 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100818225209.C74D22A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 17:52:09 2010 New Revision: 111445 URL: http://llvm.org/viewvc/llvm-project?rev=111445&view=rev Log: GetLinearExpression is only called when TD is non-null, pass as a reference instead of pointer. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=111445&r1=111444&r2=111445&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 18 17:52:09 2010 @@ -219,7 +219,7 @@ /// have IntegerType. Note that this looks through extends, so the high bits /// may not be represented in the result. static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, - const TargetData *TD, unsigned Depth) { + const TargetData &TD, unsigned Depth) { assert(V->getType()->isIntegerTy() && "Not an integer value"); // Limit our recursion depth. @@ -236,7 +236,7 @@ case Instruction::Or: // X|C == X+C if all the bits in C are unset in X. Otherwise we can't // analyze it. - if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), TD)) + if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), &TD)) break; // FALL THROUGH. case Instruction::Add: @@ -328,7 +328,7 @@ // If we are lacking TargetData information, we can't compute the offets of // elements computed by GEPs. However, we can handle bitcast equivalent // GEPs. - if (!TD) { + if (TD == 0) { if (!GEPOp->hasAllZeroIndices()) return V; V = GEPOp->getOperand(0); @@ -363,7 +363,7 @@ // Use GetLinearExpression to decompose the index into a C1*V+C2 form. unsigned Width = cast(Index->getType())->getBitWidth(); APInt IndexScale(Width, 0), IndexOffset(Width, 0); - Index = GetLinearExpression(Index, IndexScale, IndexOffset, TD, 0); + Index = GetLinearExpression(Index, IndexScale, IndexOffset, *TD, 0); // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. From wdietz2 at illinois.edu Wed Aug 18 18:02:09 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Wed, 18 Aug 2010 23:02:09 -0000 Subject: [llvm-commits] [poolalloc] r111446 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100818230209.67B522A6C12C@llvm.org> Author: wdietz2 Date: Wed Aug 18 18:02:09 2010 New Revision: 111446 URL: http://llvm.org/viewvc/llvm-project?rev=111446&view=rev Log: When checking byval-ness, don't walk off the end of the function argument list. Fixes segfault on 253.perlbmk Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=111446&r1=111445&r2=111446&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Wed Aug 18 18:02:09 2010 @@ -1410,8 +1410,9 @@ // argument is not (or vice-versa), then the function is not a valid target. // if (!noDSACallConv) { - Function::const_arg_iterator farg = F->arg_begin(); - for (unsigned index = 1; index < (CS.arg_size() + 1); ++farg, ++index) { + Function::const_arg_iterator farg = F->arg_begin(), fend = F->arg_end(); + for (unsigned index = 1; index < (CS.arg_size() + 1) && farg != fend; + ++farg, ++index) { if (CS.paramHasAttr (index, Attribute::ByVal) != farg->hasByValAttr()) { return false; } From evan.cheng at apple.com Wed Aug 18 18:09:25 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 18 Aug 2010 23:09:25 -0000 Subject: [llvm-commits] [llvm] r111450 - /llvm/trunk/lib/CodeGen/MachineSink.cpp Message-ID: <20100818230925.8A61D2A6C12D@llvm.org> Author: evancheng Date: Wed Aug 18 18:09:25 2010 New Revision: 111450 URL: http://llvm.org/viewvc/llvm-project?rev=111450&view=rev Log: If any def of a machine-sink candidate has local uses, it's obviously not safe to sink it to a successor block. This bug has been hidden because a later check for critical-edge disable these illegal optimizations. This patch should significantly reduce the amount of time spent on checking dominator information for obviously unsafe sinking. Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=111450&r1=111449&r2=111450&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Wed Aug 18 18:09:25 2010 @@ -60,7 +60,8 @@ private: bool ProcessBlock(MachineBasicBlock &MBB); bool SinkInstruction(MachineInstr *MI, bool &SawStore); - bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const; + bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB, + MachineBasicBlock *DefMBB, bool &LocalUse) const; }; } // end anonymous namespace @@ -71,9 +72,13 @@ FunctionPass *llvm::createMachineSinkingPass() { return new MachineSinking(); } /// AllUsesDominatedByBlock - Return true if all uses of the specified register -/// occur in blocks dominated by the specified block. +/// occur in blocks dominated by the specified block. If any use is in the +/// definition block, then return false since it is never legal to move def +/// after uses. bool MachineSinking::AllUsesDominatedByBlock(unsigned Reg, - MachineBasicBlock *MBB) const { + MachineBasicBlock *MBB, + MachineBasicBlock *DefMBB, + bool &LocalUse) const { assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Only makes sense for vregs"); // Ignoring debug uses is necessary so debug info doesn't affect the code. @@ -86,6 +91,10 @@ // Determine the block of the use. MachineInstr *UseInst = &*I; MachineBasicBlock *UseBlock = UseInst->getParent(); + if (UseBlock == DefMBB) { + LocalUse = true; + return false; + } if (UseInst->isPHI()) { // PHI nodes use the operand in the predecessor block, not the block with @@ -189,6 +198,7 @@ // decide. MachineBasicBlock *SuccToSinkTo = 0; + bool LocalUse = false; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &MO = MI->getOperand(i); if (!MO.isReg()) continue; // Ignore non-register operands. @@ -246,7 +256,7 @@ if (SuccToSinkTo) { // If a previous operand picked a block to sink to, then this operand // must be sinkable to the same block. - if (!AllUsesDominatedByBlock(Reg, SuccToSinkTo)) + if (!AllUsesDominatedByBlock(Reg, SuccToSinkTo, ParentBlock, LocalUse)) return false; continue; @@ -256,10 +266,13 @@ // we should sink to. for (MachineBasicBlock::succ_iterator SI = ParentBlock->succ_begin(), E = ParentBlock->succ_end(); SI != E; ++SI) { - if (AllUsesDominatedByBlock(Reg, *SI)) { + if (AllUsesDominatedByBlock(Reg, *SI, ParentBlock, LocalUse)) { SuccToSinkTo = *SI; break; } + if (LocalUse) + // Def is used locally, it's never safe to move this def. + return false; } // If we couldn't find a block to sink to, ignore this instruction. From sabre at nondot.org Wed Aug 18 18:09:49 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 23:09:49 -0000 Subject: [llvm-commits] [llvm] r111452 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/gep-alias.ll Message-ID: <20100818230949.E0C1E2A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 18:09:49 2010 New Revision: 111452 URL: http://llvm.org/viewvc/llvm-project?rev=111452&view=rev Log: refix PR1143 by making basicaa analyze zexts of indices aggresively, which I broke with a recent patch. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=111452&r1=111451&r2=111452&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 18 18:09:49 2010 @@ -215,10 +215,14 @@ /// GetLinearExpression - Analyze the specified value as a linear expression: /// "A*V + B", where A and B are constant integers. Return the scale and offset -/// values as APInts and return V as a Value*. The incoming Value is known to -/// have IntegerType. Note that this looks through extends, so the high bits -/// may not be represented in the result. +/// values as APInts and return V as a Value*, and return whether we looked +/// through any sign or zero extends. The incoming Value is known to have +/// IntegerType and it may already be sign or zero extended. +/// +/// Note that this looks through extends, so the high bits may not be +/// represented in the result. static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, + ExtensionKind &Extension, const TargetData &TD, unsigned Depth) { assert(V->getType()->isIntegerTy() && "Not an integer value"); @@ -240,16 +244,19 @@ break; // FALL THROUGH. case Instruction::Add: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, Extension, + TD, Depth+1); Offset += RHSC->getValue(); return V; case Instruction::Mul: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, Extension, + TD, Depth+1); Offset *= RHSC->getValue(); Scale *= RHSC->getValue(); return V; case Instruction::Shl: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD, Depth+1); + V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, Extension, + TD, Depth+1); Offset <<= RHSC->getValue().getLimitedValue(); Scale <<= RHSC->getValue().getLimitedValue(); return V; @@ -258,16 +265,22 @@ } // Since GEP indices are sign extended anyway, we don't care about the high - // bits of a sign extended value - just scales and offsets. - if (isa(V)) { + // bits of a sign or zero extended value - just scales and offsets. The + // extensions have to be consistent though. + if ((isa(V) && Extension != EK_ZeroExt) || + (isa(V) && Extension != EK_SignExt)) { Value *CastOp = cast(V)->getOperand(0); unsigned OldWidth = Scale.getBitWidth(); unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); Scale.trunc(SmallWidth); Offset.trunc(SmallWidth); - Value *Result = GetLinearExpression(CastOp, Scale, Offset, TD, Depth+1); + Extension = isa(V) ? EK_SignExt : EK_ZeroExt; + + Value *Result = GetLinearExpression(CastOp, Scale, Offset, Extension, + TD, Depth+1); Scale.zext(OldWidth); Offset.zext(OldWidth); + return Result; } @@ -360,10 +373,16 @@ uint64_t Scale = TD->getTypeAllocSize(*GTI); ExtensionKind Extension = EK_NotExtended; - // Use GetLinearExpression to decompose the index into a C1*V+C2 form. + // If the integer type is smaller than the pointer size, it is implicitly + // sign extended to pointer size. unsigned Width = cast(Index->getType())->getBitWidth(); + if (TD->getPointerSizeInBits() > Width) + Extension = EK_SignExt; + + // Use GetLinearExpression to decompose the index into a C1*V+C2 form. APInt IndexScale(Width, 0), IndexOffset(Width, 0); - Index = GetLinearExpression(Index, IndexScale, IndexOffset, *TD, 0); + Index = GetLinearExpression(Index, IndexScale, IndexOffset, Extension, + *TD, 0); // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. Modified: llvm/trunk/test/Analysis/BasicAA/gep-alias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/gep-alias.ll?rev=111452&r1=111451&r2=111452&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/gep-alias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Wed Aug 18 18:09:49 2010 @@ -115,14 +115,14 @@ ; CHECK: ret i32 0 } -; P[sext(i)] != p[sext(i+1)] +; P[zext(i)] != p[zext(i+1)] ; PR1143 -define i32 @test8(i32* %p, i32 %i) { - %i1 = sext i32 %i to i64 - %pi = getelementptr i32* %p, i64 %i1 - %i.next = add i32 %i, 1 - %i.next2 = sext i32 %i.next to i64 - %pi.next = getelementptr i32* %p, i64 %i.next2 +define i32 @test8(i32* %p, i16 %i) { + %i1 = zext i16 %i to i32 + %pi = getelementptr i32* %p, i32 %i1 + %i.next = add i16 %i, 1 + %i.next2 = zext i16 %i.next to i32 + %pi.next = getelementptr i32* %p, i32 %i.next2 %x = load i32* %pi store i32 42, i32* %pi.next %y = load i32* %pi From grosbach at apple.com Wed Aug 18 18:14:02 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 18 Aug 2010 23:14:02 -0000 Subject: [llvm-commits] [llvm] r111453 - /llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Message-ID: <20100818231402.B8F642A6C12C@llvm.org> Author: grosbach Date: Wed Aug 18 18:14:02 2010 New Revision: 111453 URL: http://llvm.org/viewvc/llvm-project?rev=111453&view=rev Log: Add a newline to debug output Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111453&r1=111452&r2=111453&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Wed Aug 18 18:14:02 2010 @@ -235,7 +235,8 @@ std::pair RegOffset; if (lookupCandidateBaseReg(BaseRegisters, RegOffset, LocalOffsets[FrameIdx], MI, TRI)) { - DEBUG(dbgs() << " Reusing base register " << RegOffset.first); + DEBUG(dbgs() << " Reusing base register " << + RegOffset.first << "\n"); // We found a register to reuse. BaseReg = RegOffset.first; Offset = LocalOffsets[FrameIdx] - RegOffset.second; From rideau3 at gmail.com Wed Aug 18 18:23:09 2010 From: rideau3 at gmail.com (Sean Hunt) Date: Wed, 18 Aug 2010 23:23:09 -0000 Subject: [llvm-commits] [llvm] r111454 - in /llvm/trunk: include/llvm/ADT/StringSwitch.h utils/TableGen/ClangAttrEmitter.cpp utils/TableGen/ClangAttrEmitter.h utils/TableGen/TableGen.cpp Message-ID: <20100818232309.921512A6C12C@llvm.org> Author: coppro Date: Wed Aug 18 18:23:09 2010 New Revision: 111454 URL: http://llvm.org/viewvc/llvm-project?rev=111454&view=rev Log: Finish full attribute class emission for clang. For more information, see the accompanying clang patch. Modified: llvm/trunk/include/llvm/ADT/StringSwitch.h llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp llvm/trunk/utils/TableGen/ClangAttrEmitter.h llvm/trunk/utils/TableGen/TableGen.cpp Modified: llvm/trunk/include/llvm/ADT/StringSwitch.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringSwitch.h?rev=111454&r1=111453&r2=111454&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/StringSwitch.h (original) +++ llvm/trunk/include/llvm/ADT/StringSwitch.h Wed Aug 18 18:23:09 2010 @@ -61,6 +61,26 @@ return *this; } + template + StringSwitch& EndsWith(const char (&S)[N], const T &Value) { + if (!Result && Str.size() >= N-1 && + std::memcmp(S, Str.data() + Str.size() + 1 - N, N-1) == 0) { + Result = &Value; + } + + return *this; + } + + template + StringSwitch& StartsWith(const char (&S)[N], const T &Value) { + if (!Result && Str.size() >= N-1 && + std::memcmp(S, Str.data(), N-1) == 0) { + Result = &Value; + } + + return *this; + } + template StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1], const T& Value) { Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=111454&r1=111453&r2=111454&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Wed Aug 18 18:23:09 2010 @@ -13,10 +13,444 @@ #include "ClangAttrEmitter.h" #include "Record.h" +#include "llvm/ADT/StringSwitch.h" #include using namespace llvm; +static const std::vector getValueAsListOfStrings(Record &R, + StringRef FieldName) { + ListInit *List = R.getValueAsListInit(FieldName); + assert (List && "Got a null ListInit"); + + std::vector Strings; + Strings.reserve(List->getSize()); + + for (ListInit::iterator i = List->begin(), e = List->end(); i != e; ++i) { + assert(*i && "Got a null element in a ListInit"); + if (StringInit *S = dynamic_cast(*i)) + Strings.push_back(S->getValue()); + else if (CodeInit *C = dynamic_cast(*i)) + Strings.push_back(C->getValue()); + else + assert(false && "Got a non-string, non-code element in a ListInit"); + } + + return Strings; +} + +std::string ReadPCHRecord(StringRef type) { + return StringSwitch(type) + .EndsWith("Decl *", "cast_or_null<" + std::string(type, 0, type.size()-1) + + ">(GetDecl(Record[Idx++]))") + .Case("QualType", "ReadTypeRecord(Idx++)") + .Default("Record[Idx++]"); +} + +// Assumes that the way to get the value is SA->getname() +std::string WritePCHRecord(StringRef type, StringRef name) { + return StringSwitch(type) + .EndsWith("Decl *", "AddDeclRef(" + std::string(name) + + ", Record);\n") + .Case("QualType", "AddTypeRef(" + std::string(name) + ", Record);\n") + .Default("Record.push_back(" + std::string(name) + ");\n"); +} + +namespace { + class Argument { + std::string lowerName, upperName; + StringRef attrName; + + public: + Argument(Record &Arg, StringRef Attr) + : lowerName(Arg.getValueAsString("Name")), upperName(lowerName), + attrName(Attr) { + if (!lowerName.empty()) { + lowerName[0] = std::tolower(lowerName[0]); + upperName[0] = std::toupper(upperName[0]); + } + } + + StringRef getLowerName() const { return lowerName; }; + StringRef getUpperName() const { return upperName; }; + StringRef getAttrName() const { return attrName; }; + + // These functions print the argument contents formatted in different ways. + virtual void writeAccessors(raw_ostream &OS) const = 0; + virtual void writeAccessorDefinitions(raw_ostream &OS) const {} + virtual void writeCloneArgs(raw_ostream &OS) const = 0; + virtual void writeCtorBody(raw_ostream &OS) const {} + virtual void writeCtorInitializers(raw_ostream &OS) const = 0; + virtual void writeCtorParameters(raw_ostream &OS) const = 0; + virtual void writeDeclarations(raw_ostream &OS) const = 0; + virtual void writePCHReadArgs(raw_ostream &OS) const = 0; + virtual void writePCHReadDecls(raw_ostream &OS) const = 0; + virtual void writePCHWrite(raw_ostream &OS) const = 0; + }; + + class SimpleArgument : public Argument { + std::string type; + + public: + SimpleArgument(Record &Arg, StringRef Attr, std::string T) + : Argument(Arg, Attr), type(T) + {} + + std::string getType() const { return type; } + + void writeAccessors(raw_ostream &OS) const { + OS << " " << type << " get" << getUpperName() << "() const {\n"; + OS << " return " << getLowerName() << ";\n"; + OS << " }"; + } + void writeCloneArgs(raw_ostream &OS) const { + OS << getLowerName(); + } + void writeCtorInitializers(raw_ostream &OS) const { + OS << getLowerName() << "(" << getUpperName() << ")"; + } + void writeCtorParameters(raw_ostream &OS) const { + OS << type << " " << getUpperName(); + } + void writeDeclarations(raw_ostream &OS) const { + OS << type << " " << getLowerName() << ";"; + } + void writePCHReadDecls(raw_ostream &OS) const { + std::string read = ReadPCHRecord(type); + OS << " " << type << " " << getLowerName() << " = " << read << ";\n"; + } + void writePCHReadArgs(raw_ostream &OS) const { + OS << getLowerName(); + } + void writePCHWrite(raw_ostream &OS) const { + OS << " " << WritePCHRecord(type, "SA->get" + + std::string(getUpperName()) + "()"); + } + }; + + class StringArgument : public Argument { + public: + StringArgument(Record &Arg, StringRef Attr) + : Argument(Arg, Attr) + {} + + void writeAccessors(raw_ostream &OS) const { + OS << " llvm::StringRef get" << getUpperName() << "() const {\n"; + OS << " return llvm::StringRef(" << getLowerName() << ", " + << getLowerName() << "Length);\n"; + OS << " }\n"; + OS << " unsigned get" << getUpperName() << "Length() const {\n"; + OS << " return " << getLowerName() << "Length;\n"; + OS << " }\n"; + OS << " void set" << getUpperName() + << "(ASTContext &C, llvm::StringRef S) {\n"; + OS << " " << getLowerName() << "Length = S.size();\n"; + OS << " this->" << getLowerName() << " = new (C, 1) char [" + << getLowerName() << "Length];\n"; + OS << " std::memcpy(this->" << getLowerName() << ", S.data(), " + << getLowerName() << "Length);\n"; + OS << " }"; + } + void writeCloneArgs(raw_ostream &OS) const { + OS << "get" << getUpperName() << "()"; + } + void writeCtorBody(raw_ostream &OS) const { + OS << " std::memcpy(" << getLowerName() << ", " << getUpperName() + << ".data(), " << getLowerName() << "Length);"; + } + void writeCtorInitializers(raw_ostream &OS) const { + OS << getLowerName() << "Length(" << getUpperName() << ".size())," + << getLowerName() << "(new (Ctx, 1) char[" << getLowerName() + << "Length])"; + } + void writeCtorParameters(raw_ostream &OS) const { + OS << "llvm::StringRef " << getUpperName(); + } + void writeDeclarations(raw_ostream &OS) const { + OS << "unsigned " << getLowerName() << "Length;\n"; + OS << "char *" << getLowerName() << ";"; + } + void writePCHReadDecls(raw_ostream &OS) const { + OS << " std::string " << getLowerName() << "= ReadString(Record, Idx);\n"; + } + void writePCHReadArgs(raw_ostream &OS) const { + OS << getLowerName(); + } + void writePCHWrite(raw_ostream &OS) const { + OS << " AddString(SA->get" << getUpperName() << "(), Record);\n"; + } + }; + + class AlignedArgument : public Argument { + public: + AlignedArgument(Record &Arg, StringRef Attr) + : Argument(Arg, Attr) + {} + + void writeAccessors(raw_ostream &OS) const { + OS << " bool is" << getUpperName() << "Dependent() const;\n"; + + OS << " unsigned get" << getUpperName() << "(ASTContext &Ctx) const;\n"; + + OS << " bool is" << getUpperName() << "Expr() const {\n"; + OS << " return is" << getLowerName() << "Expr;\n"; + OS << " }\n"; + + OS << " Expr *get" << getUpperName() << "Expr() const {\n"; + OS << " assert(is" << getLowerName() << "Expr);\n"; + OS << " return " << getLowerName() << "Expr;\n"; + OS << " }\n"; + + OS << " TypeSourceInfo *get" << getUpperName() << "Type() const {\n"; + OS << " assert(!is" << getLowerName() << "Expr);\n"; + OS << " return " << getLowerName() << "Type;\n"; + OS << " }"; + } + void writeAccessorDefinitions(raw_ostream &OS) const { + OS << "bool " << getAttrName() << "Attr::is" << getUpperName() + << "Dependent() const {\n"; + OS << " if (is" << getLowerName() << "Expr)\n"; + OS << " return " << getLowerName() << "Expr && (" << getLowerName() + << "Expr->isValueDependent() || " << getLowerName() + << "Expr->isTypeDependent());\n"; + OS << " else\n"; + OS << " return " << getLowerName() + << "Type->getType()->isDependentType();\n"; + OS << "}\n"; + + // FIXME: Do not do the calculation here + // FIXME: Handle types correctly + // A null pointer means maximum alignment + // FIXME: Load the platform-specific maximum alignment, rather than + // 16, the x86 max. + OS << "unsigned " << getAttrName() << "Attr::get" << getUpperName() + << "(ASTContext &Ctx) const {\n"; + OS << " assert(!is" << getUpperName() << "Dependent());\n"; + OS << " if (is" << getLowerName() << "Expr)\n"; + OS << " return (" << getLowerName() << "Expr ? " << getLowerName() + << "Expr->EvaluateAsInt(Ctx).getZExtValue() : 16)" + << "* Ctx.getCharWidth();\n"; + OS << " else\n"; + OS << " return 0; // FIXME\n"; + OS << "}\n"; + } + void writeCloneArgs(raw_ostream &OS) const { + OS << "is" << getLowerName() << "Expr, is" << getLowerName() + << "Expr ? static_cast(" << getLowerName() + << "Expr) : " << getLowerName() + << "Type"; + } + void writeCtorBody(raw_ostream &OS) const { + OS << " if (is" << getLowerName() << "Expr)\n"; + OS << " " << getLowerName() << "Expr = reinterpret_cast(" + << getUpperName() << ");\n"; + OS << " else\n"; + OS << " " << getLowerName() + << "Type = reinterpret_cast(" << getUpperName() + << ");"; + } + void writeCtorInitializers(raw_ostream &OS) const { + OS << "is" << getLowerName() << "Expr(Is" << getUpperName() << "Expr)"; + } + void writeCtorParameters(raw_ostream &OS) const { + OS << "bool Is" << getUpperName() << "Expr, void *" << getUpperName(); + } + void writeDeclarations(raw_ostream &OS) const { + OS << "bool is" << getLowerName() << "Expr;\n"; + OS << "union {\n"; + OS << "Expr *" << getLowerName() << "Expr;\n"; + OS << "TypeSourceInfo *" << getLowerName() << "Type;\n"; + OS << "};"; + } + void writePCHReadArgs(raw_ostream &OS) const { + OS << "is" << getLowerName() << "Expr, " << getLowerName() << "Ptr"; + } + void writePCHReadDecls(raw_ostream &OS) const { + OS << " bool is" << getLowerName() << "Expr = Record[Idx++];\n"; + OS << " void *" << getLowerName() << "Ptr;\n"; + OS << " if (is" << getLowerName() << "Expr)\n"; + OS << " " << getLowerName() << "Ptr = ReadExpr(DeclsCursor);\n"; + OS << " else\n"; + OS << " " << getLowerName() + << "Ptr = GetTypeSourceInfo(DeclsCursor, Record, Idx);\n"; + } + void writePCHWrite(raw_ostream &OS) const { + OS << " Record.push_back(SA->is" << getUpperName() << "Expr());\n"; + OS << " if (SA->is" << getUpperName() << "Expr())\n"; + OS << " AddStmt(SA->get" << getUpperName() << "Expr());\n"; + OS << " else\n"; + OS << " AddTypeSourceInfo(SA->get" << getUpperName() + << "Type(), Record);\n"; + } + }; + + class VariadicArgument : public Argument { + std::string type; + + public: + VariadicArgument(Record &Arg, StringRef Attr, std::string T) + : Argument(Arg, Attr), type(T) + {} + + std::string getType() const { return type; } + + void writeAccessors(raw_ostream &OS) const { + OS << " typedef " << type << "* " << getLowerName() << "_iterator;\n"; + OS << " " << getLowerName() << "_iterator " << getLowerName() + << "_begin() const {\n"; + OS << " return " << getLowerName() << ";\n"; + OS << " }\n"; + OS << " " << getLowerName() << "_iterator " << getLowerName() + << "_end() const {\n"; + OS << " return " << getLowerName() << " + " << getLowerName() + << "Size;\n"; + OS << " }\n"; + OS << " unsigned " << getLowerName() << "_size() const {\n" + << " return " << getLowerName() << "Size;\n;"; + OS << " }"; + } + void writeCloneArgs(raw_ostream &OS) const { + OS << getLowerName() << ", " << getLowerName() << "Size"; + } + void writeCtorBody(raw_ostream &OS) const { + // FIXME: memcpy is not safe on non-trivial types. + OS << " std::memcpy(" << getLowerName() << ", " << getUpperName() + << ", " << getLowerName() << "Size * sizeof(" << getType() << "));\n"; + } + void writeCtorInitializers(raw_ostream &OS) const { + OS << getLowerName() << "Size(" << getUpperName() << "Size), " + << getLowerName() << "(new (Ctx, 16) " << getType() << "[" + << getLowerName() << "Size])"; + } + void writeCtorParameters(raw_ostream &OS) const { + OS << getType() << " *" << getUpperName() << ", unsigned " + << getUpperName() << "Size"; + } + void writeDeclarations(raw_ostream &OS) const { + OS << " unsigned " << getLowerName() << "Size;\n"; + OS << " " << getType() << " *" << getLowerName() << ";"; + } + void writePCHReadDecls(raw_ostream &OS) const { + OS << " unsigned " << getLowerName() << "Size = Record[Idx++];\n"; + OS << " llvm::SmallVector<" << type << ", 4> " << getLowerName() + << ";\n"; + OS << " " << getLowerName() << ".reserve(" << getLowerName() + << "Size);\n"; + OS << " for (unsigned i = " << getLowerName() << "Size; i; --i)\n"; + + std::string read = ReadPCHRecord(type); + OS << " " << getLowerName() << ".push_back(" << read << ");\n"; + } + void writePCHReadArgs(raw_ostream &OS) const { + OS << getLowerName() << ".data(), " << getLowerName() << "Size"; + } + void writePCHWrite(raw_ostream &OS) const{ + OS << " Record.push_back(SA->" << getLowerName() << "_size());\n"; + OS << " for (" << getAttrName() << "Attr::" << getLowerName() + << "_iterator i = SA->" << getLowerName() << "_begin(), e = SA->" + << getLowerName() << "_end(); i != e; ++i)\n"; + OS << " " << WritePCHRecord(type, "(*i)"); + } + }; + + class EnumArgument : public Argument { + StringRef type; + std::vector values, enums; + public: + EnumArgument(Record &Arg, StringRef Attr) + : Argument(Arg, Attr), type(Arg.getValueAsString("Type")), + values(getValueAsListOfStrings(Arg, "Values")), + enums(getValueAsListOfStrings(Arg, "Enums")) + {} + + void writeAccessors(raw_ostream &OS) const { + OS << " " << type << " get" << getUpperName() << "() const {\n"; + OS << " return " << getLowerName() << ";\n"; + OS << " }"; + } + void writeCloneArgs(raw_ostream &OS) const { + OS << getLowerName(); + } + void writeCtorInitializers(raw_ostream &OS) const { + OS << getLowerName() << "(" << getUpperName() << ")"; + } + void writeCtorParameters(raw_ostream &OS) const { + OS << type << " " << getUpperName(); + } + void writeDeclarations(raw_ostream &OS) const { + // Calculate the various enum values + std::vector uniques(enums); + std::sort(uniques.begin(), uniques.end()); + uniques.erase(std::unique(uniques.begin(), uniques.end()), + uniques.end()); + // FIXME: Emit a proper error + assert(!uniques.empty()); + + std::vector::iterator i = uniques.begin(), + e = uniques.end(); + // The last one needs to not have a comma. + --e; + + OS << "public:\n"; + OS << " enum " << type << " {\n"; + for (; i != e; ++i) + OS << " " << *i << ",\n"; + OS << " " << *e << "\n"; + OS << " };\n"; + OS << "private:\n"; + OS << " " << type << " " << getLowerName() << ";"; + } + void writePCHReadDecls(raw_ostream &OS) const { + OS << " " << getAttrName() << "Attr::" << type << " " << getLowerName() + << "(static_cast<" << getAttrName() << "Attr::" << type + << ">(Record[Idx++]));\n"; + } + void writePCHReadArgs(raw_ostream &OS) const { + OS << getLowerName(); + } + void writePCHWrite(raw_ostream &OS) const { + OS << "Record.push_back(SA->get" << getUpperName() << "());\n"; + } + }; +} + +static Argument *createArgument(Record &Arg, StringRef Attr, + Record *Search = 0) { + if (!Search) + Search = &Arg; + + Argument *Ptr = 0; + llvm::StringRef ArgName = Search->getName(); + + if (ArgName == "AlignedArgument") Ptr = new AlignedArgument(Arg, Attr); + else if (ArgName == "EnumArgument") Ptr = new EnumArgument(Arg, Attr); + else if (ArgName == "ExprArgument") Ptr = new SimpleArgument(Arg, Attr, + "Expr *"); + else if (ArgName == "FunctionArgument") + Ptr = new SimpleArgument(Arg, Attr, "FunctionDecl *"); + else if (ArgName == "IdentifierArgument") + Ptr = new SimpleArgument(Arg, Attr, "IdentifierInfo *"); + else if (ArgName == "IntArgument") Ptr = new SimpleArgument(Arg, Attr, "int"); + else if (ArgName == "StringArgument") Ptr = new StringArgument(Arg, Attr); + else if (ArgName == "TypeArgument") + Ptr = new SimpleArgument(Arg, Attr, "QualType"); + else if (ArgName == "UnsignedArgument") + Ptr = new SimpleArgument(Arg, Attr, "unsigned"); + else if (ArgName == "VariadicUnsignedArgument") + Ptr = new VariadicArgument(Arg, Attr, "unsigned"); + + if (!Ptr) { + std::vector Bases = Search->getSuperClasses(); + for (std::vector::iterator i = Bases.begin(), e = Bases.end(); + i != e; ++i) { + Ptr = createArgument(Arg, Attr, *i); + if (Ptr) + break; + } + } + return Ptr; +} + void ClangAttrClassEmitter::run(raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n"; @@ -28,29 +462,63 @@ i != e; ++i) { Record &R = **i; - if (R.getValueAsBit("DoNotEmit")) - continue; - OS << "class " << R.getName() << "Attr : public Attr {\n"; - std::vector Args = R.getValueAsListOfDefs("Args"); + std::vector ArgRecords = R.getValueAsListOfDefs("Args"); + std::vector Args; + std::vector::iterator ai, ae; + Args.reserve(ArgRecords.size()); + + for (std::vector::iterator ri = ArgRecords.begin(), + re = ArgRecords.end(); + ri != re; ++ri) { + Record &ArgRecord = **ri; + Argument *Arg = createArgument(ArgRecord, R.getName()); + assert(Arg); + Args.push_back(Arg); + + Arg->writeDeclarations(OS); + OS << "\n\n"; + } - // FIXME: Handle arguments - assert(Args.empty() && "Can't yet handle arguments"); + ae = Args.end(); OS << "\n public:\n"; - OS << " " << R.getName() << "Attr("; + OS << " " << R.getName() << "Attr(SourceLocation L, ASTContext &Ctx\n"; - // Arguments go here + for (ai = Args.begin(); ai != ae; ++ai) { + OS << " , "; + (*ai)->writeCtorParameters(OS); + OS << "\n"; + } - OS << ")\n"; - OS << " : Attr(attr::" << R.getName() << ")"; + OS << " )\n"; + OS << " : Attr(attr::" << R.getName() << ", L)\n"; - // Arguments go here - - OS << " {}\n\n"; + for (ai = Args.begin(); ai != ae; ++ai) { + OS << " , "; + (*ai)->writeCtorInitializers(OS); + OS << "\n"; + } + + OS << " {\n"; + + for (ai = Args.begin(); ai != ae; ++ai) { + (*ai)->writeCtorBody(OS); + OS << "\n"; + } + OS << " }\n\n"; + + OS << " virtual " << R.getName() << "Attr *clone (ASTContext &C) const;\n"; + + for (ai = Args.begin(); ai != ae; ++ai) { + (*ai)->writeAccessors(OS); + OS << "\n\n"; + } + + OS << R.getValueAsCode("AdditionalMembers"); + OS << "\n\n"; - OS << " virtual Attr *clone (ASTContext &C) const;\n"; OS << " static bool classof(const Attr *A) { return A->getKind() == " << "attr::" << R.getName() << "; }\n"; OS << " static bool classof(const " << R.getName() @@ -61,6 +529,34 @@ OS << "#endif\n"; } +void ClangAttrImplEmitter::run(raw_ostream &OS) { + OS << "// This file is generated by TableGen. Do not edit.\n\n"; + + std::vector Attrs = Records.getAllDerivedDefinitions("Attr"); + std::vector::iterator i = Attrs.begin(), e = Attrs.end(), ri, re; + std::vector::iterator ai, ae; + + for (; i != e; ++i) { + Record &R = **i; + std::vector ArgRecords = R.getValueAsListOfDefs("Args"); + std::vector Args; + for (ri = ArgRecords.begin(), re = ArgRecords.end(); ri != re; ++ri) + Args.push_back(createArgument(**ri, R.getName())); + + for (ai = Args.begin(), ae = Args.end(); ai != ae; ++ai) + (*ai)->writeAccessorDefinitions(OS); + + OS << R.getName() << "Attr *" << R.getName() + << "Attr::clone(ASTContext &C) const {\n"; + OS << " return new (C) " << R.getName() << "Attr(getLocation(), C"; + for (ai = Args.begin(); ai != ae; ++ai) { + OS << ", "; + (*ai)->writeCloneArgs(OS); + } + OS << ");\n}\n\n"; + } +} + void ClangAttrListEmitter::run(raw_ostream &OS) { OS << "// This file is generated by TableGen. Do not edit.\n\n"; @@ -82,3 +578,61 @@ OS << "#undef LAST_ATTR\n"; OS << "#undef ATTR\n"; } + +void ClangAttrPCHReadEmitter::run(raw_ostream &OS) { + OS << "// This file is generated by TableGen. Do not edi.\n\n"; + + std::vector Attrs = Records.getAllDerivedDefinitions("Attr"), + ArgRecords; + std::vector::iterator i = Attrs.begin(), e = Attrs.end(), ai, ae; + std::vector Args; + std::vector::iterator ri, re; + + OS << " switch (Kind) {\n"; + OS << " default:\n"; + OS << " assert(0 && \"Unknown attribute!\");\n"; + OS << " break;\n"; + for (; i != e; ++i) { + Record &R = **i; + OS << " case attr::" << R.getName() << ": {\n"; + ArgRecords = R.getValueAsListOfDefs("Args"); + Args.clear(); + for (ai = ArgRecords.begin(), ae = ArgRecords.end(); ai != ae; ++ai) { + Argument *A = createArgument(**ai, R.getName()); + Args.push_back(A); + A->writePCHReadDecls(OS); + } + OS << " New = new (*Context) " << R.getName() << "Attr(Loc, *Context"; + for (ri = Args.begin(), re = Args.end(); ri != re; ++ri) { + OS << ", "; + (*ri)->writePCHReadArgs(OS); + } + OS << ");\n"; + OS << " break;\n"; + OS << " }\n"; + } + OS << " }\n"; +} + +void ClangAttrPCHWriteEmitter::run(raw_ostream &OS) { + std::vector Attrs = Records.getAllDerivedDefinitions("Attr"), Args; + std::vector::iterator i = Attrs.begin(), e = Attrs.end(), ai, ae; + + OS << " switch (A->getKind()) {\n"; + OS << " default:\n"; + OS << " llvm_unreachable(\"Unknown attribute kind!\");\n"; + OS << " break;\n"; + for (; i != e; ++i) { + Record &R = **i; + OS << " case attr::" << R.getName() << ": {\n"; + Args = R.getValueAsListOfDefs("Args"); + if (!Args.empty()) + OS << " const " << R.getName() << "Attr *SA = cast<" << R.getName() + << "Attr>(A);\n"; + for (ai = Args.begin(), ae = Args.end(); ai != ae; ++ai) + createArgument(**ai, R.getName())->writePCHWrite(OS); + OS << " break;\n"; + OS << " }\n"; + } + OS << " }\n"; +} Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangAttrEmitter.h?rev=111454&r1=111453&r2=111454&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangAttrEmitter.h (original) +++ llvm/trunk/utils/TableGen/ClangAttrEmitter.h Wed Aug 18 18:23:09 2010 @@ -31,6 +31,19 @@ void run(raw_ostream &OS); }; +/// ClangAttrImplEmitter - class emits the class method defintions for +/// attributes for clang. +class ClangAttrImplEmitter : public TableGenBackend { + RecordKeeper &Records; + + public: + explicit ClangAttrImplEmitter(RecordKeeper &R) + : Records(R) + {} + + void run(raw_ostream &OS); +}; + /// ClangAttrListEmitter - class emits the enumeration list for attributes for /// clang. class ClangAttrListEmitter : public TableGenBackend { @@ -44,6 +57,32 @@ void run(raw_ostream &OS); }; +/// ClangAttrPCHReadEmitter - class emits the code to read an attribute from +/// a clang precompiled header. +class ClangAttrPCHReadEmitter : public TableGenBackend { + RecordKeeper &Records; + +public: + explicit ClangAttrPCHReadEmitter(RecordKeeper &R) + : Records(R) + {} + + void run(raw_ostream &OS); +}; + +/// ClangAttrPCHWriteEmitter - class emits the code to read an attribute from +/// a clang precompiled header. +class ClangAttrPCHWriteEmitter : public TableGenBackend { + RecordKeeper &Records; + +public: + explicit ClangAttrPCHWriteEmitter(RecordKeeper &R) + : Records(R) + {} + + void run(raw_ostream &OS); +}; + } #endif Modified: llvm/trunk/utils/TableGen/TableGen.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=111454&r1=111453&r2=111454&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TableGen.cpp (original) +++ llvm/trunk/utils/TableGen/TableGen.cpp Wed Aug 18 18:23:09 2010 @@ -55,7 +55,10 @@ GenDisassembler, GenCallingConv, GenClangAttrClasses, + GenClangAttrImpl, GenClangAttrList, + GenClangAttrPCHRead, + GenClangAttrPCHWrite, GenClangDiagsDefs, GenClangDiagGroups, GenClangDeclNodes, @@ -116,8 +119,14 @@ "Generate target intrinsic information"), clEnumValN(GenClangAttrClasses, "gen-clang-attr-classes", "Generate clang attribute clases"), + clEnumValN(GenClangAttrImpl, "gen-clang-attr-impl", + "Generate clang attribute implementations"), clEnumValN(GenClangAttrList, "gen-clang-attr-list", "Generate a clang attribute list"), + clEnumValN(GenClangAttrPCHRead, "gen-clang-attr-pch-read", + "Generate clang PCH attribute reader"), + clEnumValN(GenClangAttrPCHWrite, "gen-clang-attr-pch-write", + "Generate clang PCH attribute writer"), clEnumValN(GenClangDiagsDefs, "gen-clang-diags-defs", "Generate Clang diagnostics definitions"), clEnumValN(GenClangDiagGroups, "gen-clang-diag-groups", @@ -256,9 +265,18 @@ case GenClangAttrClasses: ClangAttrClassEmitter(Records).run(Out); break; + case GenClangAttrImpl: + ClangAttrImplEmitter(Records).run(Out); + break; case GenClangAttrList: ClangAttrListEmitter(Records).run(Out); break; + case GenClangAttrPCHRead: + ClangAttrPCHReadEmitter(Records).run(Out); + break; + case GenClangAttrPCHWrite: + ClangAttrPCHWriteEmitter(Records).run(Out); + break; case GenClangDiagsDefs: ClangDiagsDefsEmitter(Records, ClangComponent).run(Out); break; From echristo at apple.com Wed Aug 18 18:38:16 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 18 Aug 2010 23:38:16 -0000 Subject: [llvm-commits] [llvm] r111456 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <20100818233816.3C96A2A6C12C@llvm.org> Author: echristo Date: Wed Aug 18 18:38:16 2010 New Revision: 111456 URL: http://llvm.org/viewvc/llvm-project?rev=111456&view=rev Log: Remove extra header. Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=111456&r1=111455&r2=111456&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Aug 18 18:38:16 2010 @@ -21,7 +21,6 @@ #include "Thumb2InstrInfo.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" From daniel at zuster.org Wed Aug 18 18:43:31 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 23:43:31 -0000 Subject: [llvm-commits] [test-suite] r111458 - in /test-suite/trunk/MultiSource/Examples: MultipleResults/README.txt README.txt Message-ID: <20100818234331.602C82A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 18:43:31 2010 New Revision: 111458 URL: http://llvm.org/viewvc/llvm-project?rev=111458&view=rev Log: Add some notes on the MultiSource/Examples dir. Added: test-suite/trunk/MultiSource/Examples/MultipleResults/README.txt test-suite/trunk/MultiSource/Examples/README.txt Added: test-suite/trunk/MultiSource/Examples/MultipleResults/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Examples/MultipleResults/README.txt?rev=111458&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Examples/MultipleResults/README.txt (added) +++ test-suite/trunk/MultiSource/Examples/MultipleResults/README.txt Wed Aug 18 18:43:31 2010 @@ -0,0 +1,16 @@ +This example shows how to generate multiple numeric results from a single tests. + +The test is expected to create an output file: + Output/FOO.extra-results.txt +where FOO is the tests' name. + +The format of the file should be one result per line, with each line in the +form: +-- +Result-SomeName: NNN.NNN +-- +where SomeName is the name that will be given to the pseudo-test created for the +result, and NNN.NNN is the value for the result. + +There is currently no support for assocating a pass/fail indicator with subtest +results. Added: test-suite/trunk/MultiSource/Examples/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Examples/README.txt?rev=111458&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Examples/README.txt (added) +++ test-suite/trunk/MultiSource/Examples/README.txt Wed Aug 18 18:43:31 2010 @@ -0,0 +1,2 @@ +This directory contains examples of how programs can be integrated into the LLVM +test-suite infrastructure. From daniel at zuster.org Wed Aug 18 18:43:43 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 23:43:43 -0000 Subject: [llvm-commits] [test-suite] r111459 - /test-suite/trunk/HashProgramOutput.sh Message-ID: <20100818234343.E36352A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 18:43:43 2010 New Revision: 111459 URL: http://llvm.org/viewvc/llvm-project?rev=111459&view=rev Log: HashProgramOutput: Use compute md5 command. Modified: test-suite/trunk/HashProgramOutput.sh Modified: test-suite/trunk/HashProgramOutput.sh URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/HashProgramOutput.sh?rev=111459&r1=111458&r2=111459&view=diff ============================================================================== --- test-suite/trunk/HashProgramOutput.sh (original) +++ test-suite/trunk/HashProgramOutput.sh Wed Aug 18 18:43:43 2010 @@ -15,5 +15,5 @@ fi mv $1 $1.bak -md5 < $1.bak > $1 +$md5cmd < $1.bak > $1 rm -f $1.bak From daniel at zuster.org Wed Aug 18 18:43:47 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 23:43:47 -0000 Subject: [llvm-commits] [test-suite] r111460 - /test-suite/trunk/HashProgramOutput.sh Message-ID: <20100818234347.9E6042A6C12D@llvm.org> Author: ddunbar Date: Wed Aug 18 18:43:47 2010 New Revision: 111460 URL: http://llvm.org/viewvc/llvm-project?rev=111460&view=rev Log: HashProgramOutput: Filter md5sum output to match expected format. Modified: test-suite/trunk/HashProgramOutput.sh Modified: test-suite/trunk/HashProgramOutput.sh URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/HashProgramOutput.sh?rev=111460&r1=111459&r2=111460&view=diff ============================================================================== --- test-suite/trunk/HashProgramOutput.sh (original) +++ test-suite/trunk/HashProgramOutput.sh Wed Aug 18 18:43:47 2010 @@ -6,8 +6,10 @@ fi md5cmd=$(which md5sum) +is_md5sum=1 if [ ! -x "$md5cmd" ]; then md5cmd=$(which md5) + is_md5sum=0 if [ ! -x "$md5cmd" ]; then echo "error: unable to find either 'md5sum' or 'md5'" exit 1 @@ -15,5 +17,9 @@ fi mv $1 $1.bak -$md5cmd < $1.bak > $1 +if [ $is_md5sum = "0" ]; then + $md5cmd < $1.bak > $1 +else + $md5cmd < $1.bak | cut -d' ' -f 1 > $1 +fi rm -f $1.bak From daniel at zuster.org Wed Aug 18 18:43:52 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 23:43:52 -0000 Subject: [llvm-commits] [test-suite] r111461 - /test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.reference_output Message-ID: <20100818234352.CFA052A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 18:43:52 2010 New Revision: 111461 URL: http://llvm.org/viewvc/llvm-project?rev=111461&view=rev Log: Add a reference output Added: test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.reference_output Added: test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.reference_output?rev=111461&view=auto ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.reference_output (added) +++ test-suite/trunk/SingleSource/UnitTests/2007-04-25-weak.reference_output Wed Aug 18 18:43:52 2010 @@ -0,0 +1 @@ +exit 0 From daniel at zuster.org Wed Aug 18 18:43:57 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 18 Aug 2010 23:43:57 -0000 Subject: [llvm-commits] [test-suite] r111462 - /test-suite/trunk/RunSafely.sh Message-ID: <20100818234357.1CB572A6C12D@llvm.org> Author: ddunbar Date: Wed Aug 18 18:43:56 2010 New Revision: 111462 URL: http://llvm.org/viewvc/llvm-project?rev=111462&view=rev Log: RunSafely: Bump memory limit slightly, Clang++ needs this to build tramp3d-v4 on my Ubuntu box. Modified: test-suite/trunk/RunSafely.sh Modified: test-suite/trunk/RunSafely.sh URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunSafely.sh?rev=111462&r1=111461&r2=111462&view=diff ============================================================================== --- test-suite/trunk/RunSafely.sh (original) +++ test-suite/trunk/RunSafely.sh Wed Aug 18 18:43:56 2010 @@ -111,8 +111,8 @@ # of files being output by the tests. 10 MB should be enough for anybody. ;) ULIMITCMD="$ULIMITCMD ulimit -f 10485760;" - # virtual memory: 300 MB should be enough for anybody. ;) - ULIMITCMD="$ULIMITCMD ulimit -v 300000;" + # virtual memory: 400 MB should be enough for anybody. ;) + ULIMITCMD="$ULIMITCMD ulimit -v 400000;" esac rm -f core core.* From stoklund at 2pi.dk Wed Aug 18 18:56:46 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 18 Aug 2010 23:56:46 -0000 Subject: [llvm-commits] [llvm] r111468 - in /llvm/trunk/lib/Target/Mips: MipsISelDAGToDAG.cpp MipsInstrInfo.td Message-ID: <20100818235646.B43872A6C12D@llvm.org> Author: stoklund Date: Wed Aug 18 18:56:46 2010 New Revision: 111468 URL: http://llvm.org/viewvc/llvm-project?rev=111468&view=rev Log: Don't call Predicate_* in Mips. Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=111468&r1=111467&r2=111468&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Wed Aug 18 18:56:46 2010 @@ -137,7 +137,7 @@ // Operand is a result from an ADD. if (Addr.getOpcode() == ISD::ADD) { if (ConstantSDNode *CN = dyn_cast(Addr.getOperand(1))) { - if (Predicate_immSExt16(CN)) { + if (isInt<16>(CN->getSExtValue())) { // If the first operand is a FI, get the TargetFI Node if (FrameIndexSDNode *FIN = dyn_cast @@ -248,8 +248,8 @@ SDValue Chain = N->getOperand(0); - if (!Predicate_unindexedstore(N) || - !Predicate_store(N)) + StoreSDNode *SN = cast(N); + if (SN->isTruncatingStore() || SN->getAddressingMode() != ISD::UNINDEXED) return NULL; SDValue N1 = N->getOperand(1); Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=111468&r1=111467&r2=111468&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Wed Aug 18 18:56:46 2010 @@ -96,12 +96,7 @@ // Node immediate fits as 16-bit sign extended on target immediate. // e.g. addi, andi -def immSExt16 : PatLeaf<(imm), [{ - if (N->getValueType(0) == MVT::i32) - return (int32_t)N->getZExtValue() == (short)N->getZExtValue(); - else - return (int64_t)N->getZExtValue() == (short)N->getZExtValue(); -}]>; +def immSExt16 : PatLeaf<(imm), [{ return isInt<16>(N->getSExtValue()); }]>; // Node immediate fits as 16-bit zero extended on target immediate. // The LO16 param means that only the lower 16 bits of the node From sabre at nondot.org Wed Aug 18 18:57:31 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 23:57:31 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111477 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Message-ID: <20100818235731.9BBE02A6C12D@llvm.org> Author: lattner Date: Wed Aug 18 18:57:31 2010 New Revision: 111477 URL: http://llvm.org/viewvc/llvm-project?rev=111477&view=rev Log: fix this to stop making assumptions about ABI padding. When returning "struct {char, long}" on x86-64, the upper 7 bytes of RAX are not defined. With this clang passes test 8/9 and all tests at -O[123]. There are still some failures (likely bogus) at -O0. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c?rev=111477&r1=111476&r2=111477&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Wed Aug 18 18:57:31 2010 @@ -21,7 +21,8 @@ #define xmm1d xmm_regs[1]._double typedef enum { - INT = 0, + INT1 = 0, + INT2, INT4, INT8, SSE_F, SSE_D, X87, @@ -35,23 +36,23 @@ } Type; /* Structures which should be returned in INTEGER. */ -#define D(I,MEMBERS,B) struct S_ ## I { MEMBERS ; }; Type class_ ## I = INT; \ +#define D(I,MEMBERS,B,INTSIZE) struct S_ ## I { MEMBERS ; }; Type class_ ## I = INT ## INTSIZE; \ struct S_ ## I f_ ## I (void) { struct S_ ## I s; memset (&s, 0, sizeof(s)); B; return s; } -D(1,char m1, s.m1=42) -D(2,short m1, s.m1=42) -D(3,int m1, s.m1=42) -D(4,long m1, s.m1=42) -D(5,long long m1, s.m1=42) -D(6,char m1;short s, s.m1=42) -D(7,char m1;int i, s.m1=42) -D(8,char m1; long l, s.m1=42) -D(9,char m1; long long l, s.m1=42) -D(10,char m1[16], s.m1[0]=42) -D(11,short m1[8], s.m1[0]=42) -D(12,int m1[4], s.m1[0]=42) -D(13,long m1[2], s.m1[0]=42) -D(14,long long m1[2], s.m1[0]=42) +D(1,char m1, s.m1=42, 1) +D(2,short m1, s.m1=42, 2) +D(3,int m1, s.m1=42, 4) +D(4,long m1, s.m1=42, 8) +D(5,long long m1, s.m1=42, 8) +D(6,char m1;short s, s.m1=42, 1) +D(7,char m1;int i, s.m1=42, 1) +D(8,char m1; long l, s.m1=42, 1) +D(9,char m1; long long l, s.m1=42, 1) +D(10,char m1[16], s.m1[0]=42, 8) +D(11,short m1[8], s.m1[0]=42, 8) +D(12,int m1[4], s.m1[0]=42, 8) +D(13,long m1[2], s.m1[0]=42, 8) +D(14,long long m1[2], s.m1[0]=42, 8) #undef D @@ -181,10 +182,13 @@ clear_x87_registers; } -void check_all (Type class, unsigned long size) +void check_all (Type class) { switch (class) { - case INT: if (size < 8) rax &= ~0UL >> (64-8*size); assert (rax == 42); break; + case INT1: assert ((rax & 0xFF) == 42); break; + case INT2: assert ((rax & 0xFFFF) == 42); break; + case INT4: assert ((rax & 0xFFFFFFFF) == 42); break; + case INT8: assert (rax == 42); break; case SSE_F: assert (xmm0f[0] == 42); break; case SSE_D: assert (xmm0d[0] == 42); break; case SSE_F_V: assert (xmm0f[0] == 42 && xmm0f[1]==42 && xmm1f[0] == 42 && xmm1f[1] == 42); break; @@ -209,7 +213,7 @@ #define D(I) { struct S_ ## I s; current_test = I; struct_addr = (void*)&s; \ clear_all(); \ s = WRAP_RET(f_ ## I) (); \ - check_all(class_ ## I, sizeof(s)); \ + check_all(class_ ## I); \ } int From sabre at nondot.org Wed Aug 18 18:59:30 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 18 Aug 2010 23:59:30 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111479 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Message-ID: <20100818235930.3375E2A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 18:59:30 2010 New Revision: 111479 URL: http://llvm.org/viewvc/llvm-project?rev=111479&view=rev Log: fix another bogus assumption in the test: when a struct is returned in a mem, rax and rdx are not defined to be equal to each other. With this, clang passes all abi tests here. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c?rev=111479&r1=111478&r2=111479&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Wed Aug 18 18:59:30 2010 @@ -206,7 +206,7 @@ stack, but noone is forbidding that it could be a static variable if there's no threading or proper locking. Nobody in his right mind will not use the stack for that. */ - case MEM: assert (*(unsigned char*)struct_addr == 42 && rdi == rax); break; + case MEM: assert (*(unsigned char*)struct_addr == 42); break; } } From rideau3 at gmail.com Wed Aug 18 19:03:05 2010 From: rideau3 at gmail.com (Sean Hunt) Date: Thu, 19 Aug 2010 00:03:05 -0000 Subject: [llvm-commits] [llvm] r111480 - /llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Message-ID: <20100819000305.73A7F2A6C12C@llvm.org> Author: coppro Date: Wed Aug 18 19:03:05 2010 New Revision: 111480 URL: http://llvm.org/viewvc/llvm-project?rev=111480&view=rev Log: Remove three spurious semicolons Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=111480&r1=111479&r2=111480&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Wed Aug 18 19:03:05 2010 @@ -71,9 +71,9 @@ } } - StringRef getLowerName() const { return lowerName; }; - StringRef getUpperName() const { return upperName; }; - StringRef getAttrName() const { return attrName; }; + StringRef getLowerName() const { return lowerName; } + StringRef getUpperName() const { return upperName; } + StringRef getAttrName() const { return attrName; } // These functions print the argument contents formatted in different ways. virtual void writeAccessors(raw_ostream &OS) const = 0; From clattner at apple.com Wed Aug 18 19:04:35 2010 From: clattner at apple.com (Chris Lattner) Date: Wed, 18 Aug 2010 17:04:35 -0700 Subject: [llvm-commits] [llvm] r111468 - in /llvm/trunk/lib/Target/Mips: MipsISelDAGToDAG.cpp MipsInstrInfo.td In-Reply-To: <20100818235646.B43872A6C12D@llvm.org> References: <20100818235646.B43872A6C12D@llvm.org> Message-ID: On Aug 18, 2010, at 4:56 PM, Jakob Stoklund Olesen wrote: > Author: stoklund > Date: Wed Aug 18 18:56:46 2010 > New Revision: 111468 > > URL: http://llvm.org/viewvc/llvm-project?rev=111468&view=rev > Log: > Don't call Predicate_* in Mips. Very nice. When all the predicate calls go away, tblgen can be fixed to not emit them anymore. -Chris From isanbard at gmail.com Wed Aug 18 19:05:48 2010 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 19 Aug 2010 00:05:48 -0000 Subject: [llvm-commits] [llvm] r111481 - /llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Message-ID: <20100819000549.139DC2A6C12C@llvm.org> Author: void Date: Wed Aug 18 19:05:48 2010 New Revision: 111481 URL: http://llvm.org/viewvc/llvm-project?rev=111481&view=rev Log: Add the "isCompare" attribute to the defm instead of each individual instr. Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=111481&r1=111480&r2=111481&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Wed Aug 18 19:05:48 2010 @@ -523,7 +523,7 @@ /// T2I_cmp_irs - Defines a set of (op r, {so_imm|r|so_reg}) cmp / test /// patterns. Similar to T2I_bin_irs except the instruction does not produce /// a explicit result, only implicitly set CPSR. -let Defs = [CPSR] in { +let isCompare = 1, Defs = [CPSR] in { multiclass T2I_cmp_irs opcod, string opc, PatFrag opnode> { // shifted imm def ri : T2I<(outs), (ins GPR:$lhs, t2_so_imm:$rhs), IIC_iCMPi, @@ -2136,12 +2136,10 @@ //===----------------------------------------------------------------------===// // Comparison Instructions... // -let isCompare = 1 in { defm t2CMP : T2I_cmp_irs<0b1101, "cmp", BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>; defm t2CMPz : T2I_cmp_irs<0b1101, "cmp", BinOpFrag<(ARMcmpZ node:$LHS, node:$RHS)>>; -} //FIXME: Disable CMN, as CCodes are backwards from compare expectations // Compare-to-zero still works out, just not the relationals From dalej at apple.com Wed Aug 18 19:08:34 2010 From: dalej at apple.com (Dale Johannesen) Date: Thu, 19 Aug 2010 00:08:34 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111482 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <20100819000834.2CE0E2A6C12C@llvm.org> Author: johannes Date: Wed Aug 18 19:08:33 2010 New Revision: 111482 URL: http://llvm.org/viewvc/llvm-project?rev=111482&view=rev Log: When an ABI calls for passing a parameter with lesser alignment than the parameter's type, the prolog needs to make a correctly aligned copy of it for future use. Examples: structs containing long double on x86-32, large vectors on x86-64, double on Sparc. 7952755. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=111482&r1=111481&r2=111482&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Aug 18 19:08:33 2010 @@ -249,6 +249,11 @@ llvm_store_scalar_argument((LOC),(ARG),(TYPE),(SIZE),(BUILDER)) #endif +// This is true for types whose alignment when passed on the stack is less +// than the alignment of the type. +#define LLVM_BYVAL_ALIGNMENT_TOO_SMALL(T) \ + (LLVM_BYVAL_ALIGNMENT(T) && LLVM_BYVAL_ALIGNMENT(T) < TYPE_ALIGN_UNIT(T)) + namespace { /// FunctionPrologArgumentConversion - This helper class is driven by the ABI /// definition for this target to figure out how to retrieve arguments from @@ -365,6 +370,33 @@ } void HandleByValArgument(const llvm::Type *LLVMTy, tree type) { + if (LLVM_BYVAL_ALIGNMENT_TOO_SMALL(type)) { + // Incoming object on stack is insufficiently aligned for the type. + // Make a correctly aligned copy. + assert(!LocStack.empty()); + Value *Loc = LocStack.back(); + // We cannot use field-by-field copy here; x86 long double is 16 + // bytes, but only 10 are copied. If the object is really a union + // we might need the other bytes. We must also be careful to use + // the smaller alignment. + const Type *SBP = Type::getInt8PtrTy(Context); + const Type *IntPtr = getTargetData().getIntPtrType(Context); + Value *Ops[5] = { + Builder.CreateCast(Instruction::BitCast, Loc, SBP), + Builder.CreateCast(Instruction::BitCast, AI, SBP), + ConstantInt::get(IntPtr, + TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type))), + ConstantInt::get(Type::getInt32Ty(Context), + LLVM_BYVAL_ALIGNMENT(type)), + ConstantInt::get(Type::getInt1Ty(Context), false) + }; + const Type *ArgTypes[3] = {SBP, SBP, IntPtr }; + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::memcpy, + ArgTypes, 3), Ops, Ops+5); + + AI->setName(NameStack.back()); + } ++AI; } @@ -659,12 +691,17 @@ bool isInvRef = isPassedByInvisibleReference(TREE_TYPE(Args)); if (isInvRef || (ArgTy->isVectorTy() && - LLVM_SHOULD_PASS_VECTOR_USING_BYVAL_ATTR(TREE_TYPE(Args))) || + LLVM_SHOULD_PASS_VECTOR_USING_BYVAL_ATTR(TREE_TYPE(Args)) && + !LLVM_BYVAL_ALIGNMENT_TOO_SMALL(TREE_TYPE(Args))) || (!ArgTy->isSingleValueType() && isPassedByVal(TREE_TYPE(Args), ArgTy, ScalarArgs, - Client.isShadowReturn(), CallingConv))) { + Client.isShadowReturn(), CallingConv) && + !LLVM_BYVAL_ALIGNMENT_TOO_SMALL(TREE_TYPE(Args)))) { // If the value is passed by 'invisible reference' or 'byval reference', - // the l-value for the argument IS the argument itself. + // the l-value for the argument IS the argument itself. But for byval + // arguments whose alignment as an argument is less than the normal + // alignment of the type (examples are x86-32 aggregates containing long + // double and large x86-64 vectors), we need to make the copy. AI->setName(Name); SET_DECL_LLVM(Args, AI); if (!isInvRef && EmitDebugInfo()) @@ -676,7 +713,7 @@ // Otherwise, we create an alloca to hold the argument value and provide // an l-value. On entry to the function, we copy formal argument values // into the alloca. - Value *Tmp = CreateTemporary(ArgTy); + Value *Tmp = CreateTemporary(ArgTy, TYPE_ALIGN_UNIT(TREE_TYPE(Args))); Tmp->setName(std::string(Name)+"_addr"); SET_DECL_LLVM(Args, Tmp); if (EmitDebugInfo()) @@ -1375,7 +1412,7 @@ /// CreateTemporary - Create a new alloca instruction of the specified type, /// inserting it into the entry block and returning it. The resulting /// instruction's type is a pointer to the specified type. -AllocaInst *TreeToLLVM::CreateTemporary(const Type *Ty) { +AllocaInst *TreeToLLVM::CreateTemporary(const Type *Ty, unsigned align) { if (AllocaInsertionPoint == 0) { // Create a dummy instruction in the entry block as a marker to insert new // alloc instructions before. It doesn't matter what this instruction is, @@ -1388,7 +1425,10 @@ Fn->begin()->getInstList().insert(Fn->begin()->begin(), AllocaInsertionPoint); } - return new AllocaInst(Ty, 0, "memtmp", AllocaInsertionPoint); + if (align) + return new AllocaInst(Ty, 0, align, "memtmp", AllocaInsertionPoint); + else + return new AllocaInst(Ty, 0, "memtmp", AllocaInsertionPoint); } /// CreateTempLoc - Like CreateTemporary, but returns a MemRef. Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=111482&r1=111481&r2=111482&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Wed Aug 18 19:08:33 2010 @@ -386,7 +386,7 @@ /// CreateTemporary - Create a new alloca instruction of the specified type, /// inserting it into the entry block and returning it. The resulting /// instruction's type is a pointer to the specified type. - AllocaInst *CreateTemporary(const Type *Ty); + AllocaInst *CreateTemporary(const Type *Ty, unsigned align=0); /// CreateTempLoc - Like CreateTemporary, but returns a MemRef. MemRef CreateTempLoc(const Type *Ty); From dalej at apple.com Wed Aug 18 19:09:07 2010 From: dalej at apple.com (Dale Johannesen) Date: Thu, 19 Aug 2010 00:09:07 -0000 Subject: [llvm-commits] [llvm] r111483 - /llvm/trunk/test/FrontendC/misaligned-param.c Message-ID: <20100819000907.D79262A6C12C@llvm.org> Author: johannes Date: Wed Aug 18 19:09:07 2010 New Revision: 111483 URL: http://llvm.org/viewvc/llvm-project?rev=111483&view=rev Log: Testcase for llvm-gcc checkin 111482. Added: llvm/trunk/test/FrontendC/misaligned-param.c Added: llvm/trunk/test/FrontendC/misaligned-param.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/misaligned-param.c?rev=111483&view=auto ============================================================================== --- llvm/trunk/test/FrontendC/misaligned-param.c (added) +++ llvm/trunk/test/FrontendC/misaligned-param.c Wed Aug 18 19:09:07 2010 @@ -0,0 +1,15 @@ +// RUN: %llvmgcc %s -m32 -S -o - | FileCheck %s +// Misaligned parameter must be memcpy'd to correctly aligned temporary. +// XFAIL: * +// XTARGET: x86,i386,i686,darwin + +struct s { int x; long double y; }; +long double foo(struct s x, int i, struct s y) { +// CHECK: foo +// CHECK: %x_addr = alloca %struct.s, align 16 +// CHECK: %y_addr = alloca %struct.s, align 16 +// CHECK: memcpy +// CHECK: memcpy +// CHECK: bar + return bar(&x, &y); +} From rideau3 at gmail.com Wed Aug 18 19:19:03 2010 From: rideau3 at gmail.com (Sean Hunt) Date: Thu, 19 Aug 2010 00:19:03 -0000 Subject: [llvm-commits] [llvm] r111484 - /llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Message-ID: <20100819001903.DF3762A6C12C@llvm.org> Author: coppro Date: Wed Aug 18 19:19:03 2010 New Revision: 111484 URL: http://llvm.org/viewvc/llvm-project?rev=111484&view=rev Log: Add include missing for VC build. Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=111484&r1=111483&r2=111484&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Wed Aug 18 19:19:03 2010 @@ -15,6 +15,7 @@ #include "Record.h" #include "llvm/ADT/StringSwitch.h" #include +#include using namespace llvm; From daniel at zuster.org Wed Aug 18 19:22:45 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 00:22:45 -0000 Subject: [llvm-commits] [llvm] r111487 - /llvm/trunk/utils/lit/lit/TestFormats.py Message-ID: <20100819002245.B37032A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 19:22:45 2010 New Revision: 111487 URL: http://llvm.org/viewvc/llvm-project?rev=111487&view=rev Log: lit/GoogleTest: Add .exe to the suffix when looking for tests. Modified: llvm/trunk/utils/lit/lit/TestFormats.py Modified: llvm/trunk/utils/lit/lit/TestFormats.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestFormats.py?rev=111487&r1=111486&r2=111487&view=diff ============================================================================== --- llvm/trunk/utils/lit/lit/TestFormats.py (original) +++ llvm/trunk/utils/lit/lit/TestFormats.py Wed Aug 18 19:22:45 2010 @@ -1,14 +1,21 @@ import os +import platform import Test import TestRunner import Util +kIsWindows = platform.system() == 'Windows' + class GoogleTest(object): def __init__(self, test_sub_dir, test_suffix): self.test_sub_dir = str(test_sub_dir) self.test_suffix = str(test_suffix) + # On Windows, assume tests will also end in '.exe'. + if kIsWindows: + self.test_suffix += '.exe' + def getGTestTests(self, path, litConfig, localConfig): """getGTestTests(path) - [name] From echristo at apple.com Wed Aug 18 19:37:05 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 00:37:05 -0000 Subject: [llvm-commits] [llvm] r111489 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20100819003705.C5FB52A6C12C@llvm.org> Author: echristo Date: Wed Aug 18 19:37:05 2010 New Revision: 111489 URL: http://llvm.org/viewvc/llvm-project?rev=111489&view=rev Log: Add an AddOptionalDefs method and use it. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111489&r1=111488&r2=111489&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Wed Aug 18 19:37:05 2010 @@ -14,6 +14,7 @@ //===----------------------------------------------------------------------===// #include "ARM.h" +#include "ARMBaseInstrInfo.h" #include "ARMRegisterInfo.h" #include "ARMTargetMachine.h" #include "ARMSubtarget.h" @@ -98,18 +99,60 @@ #include "ARMGenFastISel.inc" - }; + private: + bool DefinesOptionalPredicate(MachineInstr *MI, bool *CPSR); + const MachineInstrBuilder &AddOptionalDefs(const MachineInstrBuilder &MIB); +}; } // end anonymous namespace // #include "ARMGenCallingConv.inc" +// DefinesOptionalPredicate - This is different from DefinesPredicate in that +// we don't care about implicit defs here, just places we'll need to add a +// default CCReg argument. Sets CPSR if we're setting CPSR instead of CCR. +bool ARMFastISel::DefinesOptionalPredicate(MachineInstr *MI, bool *CPSR) { + const TargetInstrDesc &TID = MI->getDesc(); + if (!TID.hasOptionalDef()) + return false; + + // Look to see if our OptionalDef is defining CPSR or CCR. + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + const MachineOperand &MO = MI->getOperand(i); + if (MO.isDef() && MO.isReg() && MO.getReg() == ARM::CPSR) + *CPSR = true; + } + return true; +} + +// If the machine is predicable go ahead and add the predicate operands, if +// it needs default CC operands add those. +const MachineInstrBuilder & +ARMFastISel::AddOptionalDefs(const MachineInstrBuilder &MIB) { + MachineInstr *MI = &*MIB; + + // Do we use a predicate? + if (TII.isPredicable(MI)) + AddDefaultPred(MIB); + + // Do we optionally set a predicate? Preds is size > 0 iff the predicate + // defines CPSR. All other OptionalDefines in ARM are the CCR register. + bool CPSR; + if (DefinesOptionalPredicate(MI, &CPSR)) { + if (CPSR) + AddDefaultT1CC(MIB); + else + AddDefaultCC(MIB); + } + return MIB; +} + unsigned ARMFastISel::FastEmitInst_(unsigned MachineInstOpcode, const TargetRegisterClass* RC) { unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg)); + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg)); return ResultReg; } @@ -120,12 +163,12 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill)); else { - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill)); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(II.ImplicitDefs[0])); } @@ -140,14 +183,14 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill)); else { - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill)); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(II.ImplicitDefs[0])); } @@ -162,14 +205,14 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Imm)); else { - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Imm)); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(II.ImplicitDefs[0])); } @@ -184,14 +227,14 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addFPImm(FPImm)); else { - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addFPImm(FPImm)); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(II.ImplicitDefs[0])); } @@ -207,16 +250,16 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill) .addImm(Imm)); else { - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill) .addImm(Imm)); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(II.ImplicitDefs[0])); } @@ -230,12 +273,12 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addImm(Imm)); else { - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addImm(Imm)); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(II.ImplicitDefs[0])); } @@ -248,7 +291,7 @@ unsigned ResultReg = createResultReg(TLI.getRegClassFor(RetVT)); assert(TargetRegisterInfo::isVirtualRegister(Op0) && "Cannot yet extract from physregs"); - AddDefaultPred(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY), ResultReg) .addReg(Op0, getKillRegState(Op0IsKill), Idx)); return ResultReg; From sabre at nondot.org Wed Aug 18 20:00:34 2010 From: sabre at nondot.org (Chris Lattner) Date: Thu, 19 Aug 2010 01:00:34 -0000 Subject: [llvm-commits] [llvm] r111494 - /llvm/trunk/lib/Target/X86/X86InstrFormats.td Message-ID: <20100819010034.BC8372A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 20:00:34 2010 New Revision: 111494 URL: http://llvm.org/viewvc/llvm-project?rev=111494&view=rev Log: minor progress towards fixing PR7465 Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=111494&r1=111493&r2=111494&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Wed Aug 18 20:00:34 2010 @@ -224,13 +224,13 @@ // Iseg32 - 16-bit segment selector, 32-bit offset class Iseg16 o, Format f, dag outs, dag ins, string asm, - list pattern> : X86Inst { + list pattern> : X86Inst { let Pattern = pattern; let CodeSize = 3; } class Iseg32 o, Format f, dag outs, dag ins, string asm, - list pattern> : X86Inst { + list pattern> : X86Inst { let Pattern = pattern; let CodeSize = 3; } From gohman at apple.com Wed Aug 18 20:02:31 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 19 Aug 2010 01:02:31 -0000 Subject: [llvm-commits] [llvm] r111495 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <20100819010231.9BF5F2A6C12C@llvm.org> Author: djg Date: Wed Aug 18 20:02:31 2010 New Revision: 111495 URL: http://llvm.org/viewvc/llvm-project?rev=111495&view=rev Log: Process the step before the start, because it's usually the simpler of the two. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=111495&r1=111494&r2=111495&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed Aug 18 20:02:31 2010 @@ -441,12 +441,12 @@ // Distribute the sdiv over addrec operands, if the addrec doesn't overflow. if (const SCEVAddRecExpr *AR = dyn_cast(LHS)) { if (IgnoreSignificantBits || isAddRecSExtable(AR, SE)) { - const SCEV *Start = getExactSDiv(AR->getStart(), RHS, SE, - IgnoreSignificantBits); - if (!Start) return 0; const SCEV *Step = getExactSDiv(AR->getStepRecurrence(SE), RHS, SE, IgnoreSignificantBits); if (!Step) return 0; + const SCEV *Start = getExactSDiv(AR->getStart(), RHS, SE, + IgnoreSignificantBits); + if (!Start) return 0; return SE.getAddRecExpr(Start, Step, AR->getLoop()); } return 0; From sabre at nondot.org Wed Aug 18 20:18:43 2010 From: sabre at nondot.org (Chris Lattner) Date: Thu, 19 Aug 2010 01:18:43 -0000 Subject: [llvm-commits] [llvm] r111496 - in /llvm/trunk: lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrInfo.h lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86MCCodeEmitter.cpp test/MC/AsmParser/X86/x86_32-new-encoder.s Message-ID: <20100819011843.E72452A6C12C@llvm.org> Author: lattner Date: Wed Aug 18 20:18:43 2010 New Revision: 111496 URL: http://llvm.org/viewvc/llvm-project?rev=111496&view=rev Log: fix PR7465, mishandling of lcall and ljmp: intersegment long call and jumps. Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=111496&r1=111495&r2=111496&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Wed Aug 18 20:18:43 2010 @@ -39,6 +39,7 @@ def MRM_F0 : Format<40>; def MRM_F8 : Format<41>; def MRM_F9 : Format<42>; +def RawFrmImm16 : Format<43>; // ImmType - This specifies the immediate type used by an instruction. This is // part of the ad-hoc solution used to emit machine instruction encodings by our Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=111496&r1=111495&r2=111496&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Wed Aug 18 20:18:43 2010 @@ -311,6 +311,12 @@ MRM_F0 = 40, MRM_F8 = 41, MRM_F9 = 42, + + /// RawFrmImm16 - This is used for CALL FAR instructions, which have two + /// immediates, the first of which is a 16 or 32-bit immediate (specified by + /// the imm encoding) and the second is a 16-bit fixed value. In the AMD + /// manual, this operand is described as pntr16:32 and pntr16:16 + RawFrmImm16 = 43, FormMask = 63, @@ -522,6 +528,7 @@ case X86II::AddRegFrm: case X86II::MRMDestReg: case X86II::MRMSrcReg: + case X86II::RawFrmImm16: return -1; case X86II::MRMDestMem: return 0; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=111496&r1=111495&r2=111496&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Aug 18 20:18:43 2010 @@ -675,12 +675,12 @@ def JMP32m : I<0xFF, MRM4m, (outs), (ins i32mem:$dst), "jmp{l}\t{*}$dst", [(brind (loadi32 addr:$dst))]>, Requires<[In32BitMode]>; - def FARJMP16i : Iseg16<0xEA, RawFrm, (outs), - (ins i16imm:$seg, i16imm:$off), - "ljmp{w}\t$seg, $off", []>, OpSize; - def FARJMP32i : Iseg32<0xEA, RawFrm, (outs), - (ins i16imm:$seg, i32imm:$off), - "ljmp{l}\t$seg, $off", []>; + def FARJMP16i : Iseg16<0xEA, RawFrmImm16, (outs), + (ins i16imm:$off, i16imm:$seg), + "ljmp{w}\t{$seg, $off|$off, $seg}", []>, OpSize; + def FARJMP32i : Iseg32<0xEA, RawFrmImm16, (outs), + (ins i32imm:$off, i16imm:$seg), + "ljmp{l}\t{$seg, $off|$off, $seg}", []>; def FARJMP16m : I<0xFF, MRM5m, (outs), (ins opaque32mem:$dst), "ljmp{w}\t{*}$dst", []>, OpSize; @@ -716,12 +716,12 @@ def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops), "call\t{*}$dst", [(X86call (loadi32 addr:$dst))]>; - def FARCALL16i : Iseg16<0x9A, RawFrm, (outs), - (ins i16imm:$seg, i16imm:$off), - "lcall{w}\t$seg, $off", []>, OpSize; - def FARCALL32i : Iseg32<0x9A, RawFrm, (outs), - (ins i16imm:$seg, i32imm:$off), - "lcall{l}\t$seg, $off", []>; + def FARCALL16i : Iseg16<0x9A, RawFrmImm16, (outs), + (ins i16imm:$off, i16imm:$seg), + "lcall{w}\t{$seg, $off|$off, $seg}", []>, OpSize; + def FARCALL32i : Iseg32<0x9A, RawFrmImm16, (outs), + (ins i32imm:$off, i16imm:$seg), + "lcall{l}\t{$seg, $off|$off, $seg}", []>; def FARCALL16m : I<0xFF, MRM3m, (outs), (ins opaque32mem:$dst), "lcall{w}\t{*}$dst", []>, OpSize; Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=111496&r1=111495&r2=111496&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Wed Aug 18 20:18:43 2010 @@ -827,6 +827,14 @@ case X86II::RawFrm: EmitByte(BaseOpcode, CurByte, OS); break; + + case X86II::RawFrmImm16: + EmitByte(BaseOpcode, CurByte, OS); + EmitImmediate(MI.getOperand(CurOp++), + X86II::getSizeOfImm(TSFlags), getImmFixupKind(TSFlags), + CurByte, OS, Fixups); + EmitImmediate(MI.getOperand(CurOp++), 2, FK_Data_2, CurByte, OS, Fixups); + break; case X86II::AddRegFrm: EmitByte(BaseOpcode + GetX86RegNum(MI.getOperand(CurOp++)), CurByte, OS); Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s?rev=111496&r1=111495&r2=111496&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s Wed Aug 18 20:18:43 2010 @@ -418,3 +418,8 @@ // CHECK: jmpl *8(%eax) // CHECK: encoding: [0xff,0x60,0x08] jmp *8(%eax) + +// PR7465 +// CHECK: lcalll $2, $4660 +// CHECK: encoding: [0x9a,0x34,0x12,0x00,0x00,0x02,0x00] +lcalll $0x2, $0x1234 From echristo at apple.com Wed Aug 18 20:25:50 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 01:25:50 -0000 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Message-ID: <20100819012550.CDDB72A6C12C@llvm.org> Author: echristo Date: Wed Aug 18 20:25:50 2010 New Revision: 111499 URL: http://llvm.org/viewvc/llvm-project?rev=111499&view=rev Log: Reapply the virtual register patch from 109102. The places where we were depending on the number of virtual registers appear to have all been handled now. Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111499&r1=111498&r2=111499&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Wed Aug 18 20:25:50 2010 @@ -301,7 +301,7 @@ /// considered to be a 'virtual' register, which is part of the SSA /// namespace. This must be the same for all targets, which means that each /// target is limited to this fixed number of registers. - FirstVirtualRegister = 1024 + FirstVirtualRegister = 16384 }; /// isPhysicalRegister - Return true if the specified register number is in From gohman at apple.com Wed Aug 18 20:29:07 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 19 Aug 2010 01:29:07 -0000 Subject: [llvm-commits] [llvm] r111500 - in /llvm/trunk: include/llvm/Pass.h include/llvm/PassManagers.h lib/Analysis/IPA/CallGraphSCCPass.cpp lib/Analysis/LoopPass.cpp lib/VMCore/Pass.cpp lib/VMCore/PassManager.cpp Message-ID: <20100819012907.6069D2A6C12C@llvm.org> Author: djg Date: Wed Aug 18 20:29:07 2010 New Revision: 111500 URL: http://llvm.org/viewvc/llvm-project?rev=111500&view=rev Log: Revert r111199; it breaks -debug-pass=Structure output. Modified: llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/Analysis/LoopPass.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=111500&r1=111499&r2=111500&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Wed Aug 18 20:29:07 2010 @@ -163,7 +163,7 @@ virtual void verifyAnalysis() const; // dumpPassStructure - Implement the -debug-passes=PassStructure option - void dumpPass(unsigned Offset = 0); + virtual void dumpPassStructure(unsigned Offset = 0); // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=111500&r1=111499&r2=111500&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Wed Aug 18 20:29:07 2010 @@ -362,9 +362,6 @@ InheritedAnalysis[Index++] = (*I)->getAvailableAnalysis(); } - /// dumpPassStructure - Implement the -debug-passes=PassStructure option. - virtual void dumpPassStructure(unsigned Offset) = 0; - protected: // Top level manager. Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=111500&r1=111499&r2=111500&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Wed Aug 18 20:29:07 2010 @@ -73,7 +73,7 @@ errs().indent(Offset*2) << "Call Graph SCC Pass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); - P->dumpPass(Offset + 1); + P->dumpPassStructure(Offset + 1); dumpLastUses(P, Offset+1); } } Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=111500&r1=111499&r2=111500&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Wed Aug 18 20:29:07 2010 @@ -332,7 +332,7 @@ errs().indent(Offset*2) << "Loop Pass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); - P->dumpPass(Offset + 1); + P->dumpPassStructure(Offset + 1); dumpLastUses(P, Offset+1); } } Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=111500&r1=111499&r2=111500&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Wed Aug 18 20:29:07 2010 @@ -48,8 +48,8 @@ return Resolver->getAnalysisIfAvailable(&AID, true) != 0; } -// dumpPass - Implement the -debug-passes=Structure option -void Pass::dumpPass(unsigned Offset) { +// dumpPassStructure - Implement the -debug-passes=Structure option +void Pass::dumpPassStructure(unsigned Offset) { dbgs().indent(Offset*2) << getPassName() << "\n"; } Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=111500&r1=111499&r2=111500&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Wed Aug 18 20:29:07 2010 @@ -192,7 +192,7 @@ llvm::dbgs() << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { BasicBlockPass *BP = getContainedPass(Index); - BP->dumpPass(Offset + 1); + BP->dumpPassStructure(Offset + 1); dumpLastUses(BP, Offset+1); } } @@ -286,11 +286,6 @@ FPPassManager *FP = static_cast(PassManagers[N]); return FP; } - - /// dumpPassStructure - Implement the -debug-passes=PassStructure option. - void dumpPassStructure(unsigned) { - llvm_unreachable("dumpPassStructure called on FunctionPassManagerImpl"); - } }; char FunctionPassManagerImpl::ID = 0; @@ -353,7 +348,7 @@ llvm::dbgs() << std::string(Offset*2, ' ') << "ModulePass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { ModulePass *MP = getContainedPass(Index); - MP->dumpPass(Offset + 1); + MP->dumpPassStructure(Offset + 1); std::map::const_iterator I = OnTheFlyManagers.find(MP); if (I != OnTheFlyManagers.end()) @@ -437,11 +432,6 @@ MPPassManager *MP = static_cast(PassManagers[N]); return MP; } - - /// dumpPassStructure - Implement the -debug-passes=PassStructure option. - void dumpPassStructure(unsigned) { - llvm_unreachable("dumpPassStructure called on PassManagerImpl"); - } }; char PassManagerImpl::ID = 0; @@ -667,14 +657,16 @@ // Print out the immutable passes for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) { - ImmutablePasses[i]->dumpPass(); + ImmutablePasses[i]->dumpPassStructure(0); } - // Print out the normal passes. We add an extra layer of indentation here - // to help distinguish them visually from the immutable passes. + // Every class that derives from PMDataManager also derives from Pass + // (sometimes indirectly), but there's no inheritance relationship + // between PMDataManager and Pass, so we have to getAsPass to get + // from a PMDataManager* to a Pass*. for (SmallVector::const_iterator I = PassManagers.begin(), E = PassManagers.end(); I != E; ++I) - (*I)->dumpPassStructure(1); + (*I)->getAsPass()->dumpPassStructure(1); } void PMTopLevelManager::dumpArguments() const { @@ -1049,7 +1041,7 @@ for (SmallVector::iterator I = LUses.begin(), E = LUses.end(); I != E; ++I) { llvm::dbgs() << "--" << std::string(Offset*2, ' '); - (*I)->dumpPass(0); + (*I)->dumpPassStructure(0); } } @@ -1417,7 +1409,7 @@ llvm::dbgs() << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index); - FP->dumpPass(Offset + 1); + FP->dumpPassStructure(Offset + 1); dumpLastUses(FP, Offset+1); } } From daniel at zuster.org Wed Aug 18 20:29:11 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 01:29:11 -0000 Subject: [llvm-commits] [test-suite] r111501 - in /test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram: anagram.c anagram.reference_output Message-ID: <20100819012911.E37372A6C12D@llvm.org> Author: ddunbar Date: Wed Aug 18 20:29:11 2010 New Revision: 111501 URL: http://llvm.org/viewvc/llvm-project?rev=111501&view=rev Log: Change qsort compare function to be total, to make sort stable. Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c?rev=111501&r1=111500&r2=111501&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c Wed Aug 18 20:29:11 2010 @@ -578,10 +578,15 @@ } int Cdecl CompareFrequency(char *pch1, char *pch2) { - return auGlobalFrequency[*pch1] < auGlobalFrequency[*pch2] - ? -1 : - auGlobalFrequency[*pch1] == auGlobalFrequency[*pch2] - ? 0 : 1; + if (auGlobalFrequency[*pch1] < auGlobalFrequency[*pch2]) + return -1; + if (auGlobalFrequency[*pch1] > auGlobalFrequency[*pch2]) + return 1; + if (*pch1 < *pch2) + return -1; + if (*pch1 > *pch2) + return -1; + return 0; } void SortCandidates(void) { Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output?rev=111501&r1=111500&r2=111501&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output (original) +++ test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output Wed Aug 18 20:29:11 2010 @@ -2,2728 +2,2728 @@ 3048 bytes wasted warning: this program uses gets(), which is unsafe. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq situ dot Dan du no ti ad 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud Ito at 2nd nut ado ti SD du ton it'd a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us to did Nat tun to did sa dun to Ida St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's odd Titan du into ad 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Sutton I'd ad oust it'd DNA du o's IT&T Dan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA Ott I'd 2nd nu sod ti tad dud on i's tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do tid tan UN o's IT&T dad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taut no I'd SD out tid a's ND du ado stint 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud tao dint nu dot it sad du son IT&T ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us Ott Ida 2nd tuna do ti d's dun tao I'd St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sou I'd tat 2nd du do sit Nat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq suit don tad nut Io add 1st du dot sin at 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us don IT&T ad tout I'd an d's dud so IT&T an 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's no IT&T add UN tot did sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau dot i's ND out I'd and St du to it sa ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud ton Ida nu oat tid d's dud no tit sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq aunt DOD sit UN toad ti d's dust Toni ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq situ DOD Nat du no ti at SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud Io tat 2nd nut ado I'd t's du ton Ida St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us not it dad tun to Ida d's dun to Ida 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's odd it Nat Dutton is ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau ton I'd d's oust nit dad du o's nit tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA to it'd ND nu sod IT&T ad dud on tit a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do ti at ND UN odd is AT&T 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taut Io 2nd d's out tid an d's du ado tin St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud ton I'd at nu dot aid St. du soda tint 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us Ott aid 2nd tuna Dido 1st dun tao I'd t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sou tint add du do ti an St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq suit DOD Nat nut Io dad St. du dot tin as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us DOD it tan tout I'd a's 2nd dud so in tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's no tit dad UN tot I'd sad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau dot is 2nd out I'd Nat d's du to it as ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud on ti ad nu to it'd sad dud no IT&T sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq aunt do ti d's UN Ito tad d's dust on it ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq situ do at 2nd du no tit sad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud into tad nut tao I'd d's du ton Ida 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us not it'd ad tun to is dad dun ado ti St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's odd ti Nat Dutton I'd a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau sod it 2nd oust din tad du o's din AT&T 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA to tid 2nd nu so tit dad dud on IT&T a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do it'd tan UN odd i's tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taut DOD sin out tid as ND du not is tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud Ott I'd an nu dot aid St du sod it ant 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us Ott I'd DNA tuna Dido t's dun ditto a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sou IT&T ad 2nd du do ti at n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA ton it'd nut Dido sat du don it sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us DOD ti tan tout I'd as ND dud so taint 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's toad it 2nd UN tot i's dad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau dot I'd n's out in tad d's du to sit DNA 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud oat din nu to ti ad d's dud NATO sit 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq aunt do I'd St UN Ito dad t's dust Odin at 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq unit Todd a's du toad ti n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud dot anti nut soda it'd du tao tid n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us nod tid at tun ado ti SD dun ado it t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's odd nit at Dutton said 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau so tid 2nd oust tin dad du on tid sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA dot it 2nd nu so did tat dud on is tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do dint at UN odd tit a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taut do is ND out it dad n's du not Ida St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud on ti tad nu dot Ida 1st du sod ti Nat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us on tid tad tun DOD i's at dun dot ti a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's tao tid 2nd du do IT&T San 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA Ott din nut dot I'd as du don ITT a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us DOD ITT an tout I'd ad n's dud ton it as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's toad ti ND UN toast did 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau don I'd 1st out in dad St du to ti sand 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud not aid nu to I'd ad 1st dud Ito an St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq aunt Dido St. UN Ito add St dust to in ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq unit odd sat du toad in 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud don ti at nut sod ti ad du tao it'd n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us nod it'd at tun ado I'd t's dun ado it St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's odd IT&T an UN DOD it sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau so it'd ND oust tid Dan du on it ad St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA don't it'd nu so IT&T add dud oat isn't 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do din AT&T UN odd ITT a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taut do in d's out it DNA SD du not tid sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud on IT&T ad nu dot is tad du sod IT&T an 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us on ITT dad tun DOD it a's dun dot it a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's tao it'd ND du do ain't 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA to it ND nut dot said du don i's tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us DOD tit an tout Dis Dan dud ton ti a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's Ito tad 2nd UN Todd it a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau don it d's out in add 1st du to ti a's 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud no it ad nu to I'd at SD dud Ito at n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq aunt Dido t's UN do Dis tat dust not Ida 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq unit toad SD du toad isn't 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud do ti Nat nut so tid ad du tao nit d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us nod ITT ad tun toad Dis dun Ito at SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's oat tid ND UN DOD i's AT&T 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau o's tid 2nd oust it ad ND du on it at SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA do I'd TNT nu Ott i's dad dud oat NTIS 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do ITT and UN odd IT&T a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Titus on dad out it and d's du not aid t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud on I'd tat nu dot tid sa du sod in tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us on tit add tun DOD ti a's dun dot i's at 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's ton it dad du do anti St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA not it'd nut DOD ti a's du don tit a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us DOD in AT&T tout is ad 2nd dud tao isn't 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's dot tid an UN Todd ti as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau don ti SD out it'd as ND du to ti sa 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud NATO I'd nu to Dis tad dud ion at St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq audit not SD UN do I'd at St. dust no it ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq unit DOD sat du NATO I'd 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud do it ant nut so it'd ad du tao din St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us no tid tad tun do tid a's dun Ito ad t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's oat it'd 2nd UN DOD tit sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau o's didn't out Dis at 2nd du on ti ad t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA do IT&T ND nu Ott I'd sad dud oat in St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do tint ad UN oat did St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Titus nod ad Saud ton tid du not aid St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud Odin AT&T nu DOD i's tat du sod taint 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us on did AT&T tun tao I'd SD dun Ott said 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's ton ti add du do in at St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA nod IT&T nut DOD i's at du don IT&T a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do tid tan tout in ad SD dud tao NTIS 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's dot it and UN sod I'd AT&T 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau DOD in 1st out it'd sa 2nd du to ti as 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud Ito DNA nu ado tit SD dud Io a's TNT 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq audit nod 1st UN do tid sat dust NATO I'd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq unit do ad St. du NATO it d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud do IT&T an nut Otis dad du Taoist ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us no ITT add tun do sit ad dun do IT&T sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to tid DNA UN DOD ITT sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau on it'd SD out Ida 2nd St du on ti ad St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA do tit 2nd nu Ott did sa dud to stain 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do IT&T Dan UN oat did St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Titus don ad Saud to dint du not i's tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud oat ti ND nu DOD is AT&T du so tid Nat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us odd it tan tun sod it ad dun Ott I'd sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's ton did at du do in at t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA dot tin nut DOD it as du don is tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do it at ND tout sin add dud tao in t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's dot ti and UN sod it tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau DOD ti n's out it'd an d's du to ain't d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud ion tad nu ado it'd St dud Io Nat St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq audit dot n's UN do it ad 1st dust Ito Dan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq unit do ad t's du don't is at 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud do Titan nut o's it dad du Taos it ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us no tit dad tun do it'd sa dun do tit sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to it ad 2nd UN DOD IT&T sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau on did St out Ida ND St. du on it'd sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USA Dido TNT nu Ott Ida d's dud to sit an 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's do tit Dan UN oat it'd d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Titus do Dan Saud to it ND du not it'd a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud oat dint nu DOD ITT as du so it at ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us odd ti tan tun so tid ad dun Otis tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's tot Ida ND du do tin sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA don ITT nut do Ida St du Ott i's Dan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do it'd ant nu tao tid d's dud Taos nit 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's dot nit ad UN sod tit ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau do din St. out it'd ad n's du to I'd an St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud into ad nu ado ITT d's dud Io tan 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq audit don t's UN do it at SD dust do ain't 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq daunt so tid du don't it a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud do nit at nut o's I'd tad du Taos dint 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us no did AT&T tun do it sad dun do it sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to it'd and UN dot is tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau odd isn't out Ida ND t's du on I'd at St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sound I'd tat nu Ott is dad dud to i's ant 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's ditto DNA UN to did sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Titus ado ND Saud not tid du nod is AT&T 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud to ti DNA nu DOD IT&T as du so ITT DNA 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us odd nit at tun so it add dun o's ti tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's tot aid ND du do tint sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USDA do tint nut do Ida St. du Ott ani d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do nit tad nu tao it'd SD dud Santo ti 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's dot I'd ant UN so did tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau do din t's out dint sad du to I'd at n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud do ti an nu ado tid 1st dud Io tan t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq audio SD TNT UN do ti ad St dust iota ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq daunt o's it'd du don't ti as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud ado tint nut o's ti dad du Sao tit ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us toad ti ND tun do aid t's dun do ITT sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to nit add UN dot Ida St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau odd in St. out did an 1st du on I'd at 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sound ti tad nu o's tit dad dud to ani t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's ado ITT 2nd UN to I'd ad t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USN to I'd tad Saud nod tit du nod sit at 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud to it DNA nu DOD tit as du so ti at 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us odd IT&T an tun so I'd tad dun o's it'd at 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's tot I'd and du do sin tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sun odd it at nut do aid 1st du Ott in sad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do din AT&T nu tao did St. dud Ott Sian 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's don't it ad UN so it'd tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau do tin d's out din ad St. du to anti d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stud do in at nu ado tid t's dud Io ant St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us tao it'd 2nd UN do ti at d's dust Io at 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq daunt Ito d's du Ito tan d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Sudan to it'd nut odd it sa du Sao IT&T 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us Ito tad 2nd tun do aid 1st dun do i's tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to din tad UN dot tid a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau odd it n's out did an St. du oint ad St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sound ITT ad nu o's did tat dud to ani St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's ado tit ND UN to I'd ad 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USN to did at Saud don't ti du nod ITT a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud to I'd tan nu do it'd sat du so it'd tan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us odd Titan tun Otis add dun o's I'd tat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's Todd in at du iota 2nd St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sun to I'd tad nut do it'd as du Ott din as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do ITT and nu tot i's dad dud Ott in a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's don tid at UN so ITT add 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau do nit SD out din at SD du to in ad St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq studio at ND nu toad ti d's dud Io tat n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us ton tid ad UN do tit sad dun tot i's ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq daunt do sit du Ito sat 2nd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Sudan dot it nut odd ti a's du Santo it'd 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us Io add TNT tun do Ida St. dun Io AT&T d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to tin dad UN dot aid t's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau to Dis 2nd out aid 2nd St. du oint ad 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stout I'd DNA nu o's IT&T add dud to tin as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq auto I'd ND St. UN to it ad SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USN to ti add Saud don IT&T du nod ti sat 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud to nit ad nu do it ad 1st du so tit Dan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us oat it'd ND tun o's it add dun oat it d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's Todd ain't du iota ND 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sun to it'd ad nut do ti sad du Ott is and 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do tin tad nu tot aid SD dud Otis ant 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's don it'd at UN so IT&T dad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taunt sod I'd out ti dad n's du to in at d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stun oat did nu toad I'd St du tot i's and 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us ton ti dad UN Dido at St dun tot I'd as 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Datsun do ti du Ito tad n's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Sudan do ITT nut oat I'd d's du Toni ad St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us dot it DNA tun do is tad dun Io tat SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's to did ant UN dot aid 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau to did n's out aid ND St du Odin at St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stout aid 2nd nu odd sit at dud to nit a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq auto I'd 2nd St UN to ti ad SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USN Ott I'd ad Saudi tot 2nd du nod tit a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud to din at nu do it at SD du so IT&T Dan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us to tid and tun o's ti dad dun oat I'd St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's Ott in add du ion AT&T d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sun to did at nut do i's tad du Otis at ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do IT&T Dan nu tot did as dud o's it tan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's don ITT ad UN Ott is dad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taunt odd i's out ti DNA SD du to dint sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stun Ito add nu Ito tad SD du tot sin ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us ton I'd tad UN Dido at 1st dun tot is ad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq snout it add du Ito DNA 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq Ainu Todd St nut to is add du Toni ad St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us dot ti DNA tun Io add St. dun Io tad St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's not it add UN dot i's tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq tau nod I'd 1st out didn't as du Odin at St. 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stout Ida ND nu odd tit as dud to is tan 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq auto I'd 2nd t's UN ado tid St 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq USN dot ti ad Saudi Ott ND du nod IT&T a's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sud not I'd at nu do ti ad 1st du so nit tad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us to it ad ND tun odd i's at dun to ti sad 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's Ott din ad du ion tad 1st 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq sun dot I'd at nut do tid a's du o's tid ant 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us do tit and nu tot Ida d's dud o's ITT an 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq u's DOD in tat UN Ott did sa 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq taunt DOD is out ti and d's du to is at ND 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq stun dot Ida nu Ito add St. du tot ani SD 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq us tot in dad Tunis to add dun soda tit 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq snout ti dad du Ito ant d's 169 candidates -Order of search will be uoiadsntgjklmfepqrcbvwxyhz +Order of search will be uoiadsntwygjklmxzhrcbvfepq suit Todd an nut to Ida d's du dot sit an 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb act cos 7th cab SC 7th tore bear Oct SC 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob etc sac 7th cab ROTC eh 1st bear cot SC 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob chat c's et cab hoc St. ret beach c's trot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob cast tech cab etc h's tor be ROTC sac 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC SC 6th et cab torch EST be RCA SC 5th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC c's 4th et cab c's 10th to re be Oct scar 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob act c's the cab c's 7th tore be hoc SC tart 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abo CRT etc h's cab CRT hot e's be AC SC 4th tor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe ROTC SC 8th cab cost 7th re be arc Scot 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe CRT hoc St. cab core 7th St be act SC 9th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe cos CRT 4th cab core 9th 1st be c's tract ho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sect 5th or cab chest rot be c's actor 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sec 7th tor Cabot c's 9th re be c's AC 6th rot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc Scot 5th re carob tech 1st be c's act 7th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC Roth et carob c's 6th et be CRT SC oath 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 5th or et CBS acre 7th to be CRT AC 5th so 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc ROTC h's et CBS RCA the to be CRT AC h's to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc Oct her 1st CBS race 9th to be cot arch St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc etch St or CBS Oct 10th ear be cot AC 8th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc escort 5th CBS Oct he tar be cost arc 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's he tort CBS Oct 6th Rae be chat Oct r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's 9th or et CBS hoc re AT&T be char Oct 1st 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc CRT the so CBS etc 9th oar be catch t's or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc cot her St. CBS ace 10th tor be cat ROTC h's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc cos 4th ret CBS arc 10th toe be cart SC hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 5th St CBS torch eat be cart cos 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 10th St. CBS CRT ho tea be car SC 9th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe cat SC 4th CBS cot hat re be car cost 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe act SC 5th CBS cot 5th ear bath etc SC or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab Oct 5th re CBS cot he art bate cosh CRT 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab etc 9th or CBS core 4th at batch cost re 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab cot 6th re CBS cheat rot bat soccer 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sorb AC etc 5th CBS cat 10th roe bat c's Oct her 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob chart etc CBS cat 4th ore bat cos retch 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob car etc 4th CBS cart oh et bat core c's 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob ace CRT 9th CBS car 10th toe bare Oct SC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab scorch et CBS AC the tor bare cot SC 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab c's Oct her CBS AC 4th tore bar Oct sec 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab cos retch CBS AC her tot bar etc hoc t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab core c's 5th CBS act 10th ore bar cot etc h's both etc scar 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn CBS act 6th ore bah ROTC SC et both crate c's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra sect 5th bah CRT c's toe botch sec tar 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra etch 1st Bach Scot ret botch RCA set 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Corbett cash Bach Oct rest botch c's re at 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab SC 8th toe Bach CRT so et Bose CRT AC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Oct 10th e's brace Scot 4th Bosch CRT tea 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Oct he St. brace c's 4th to bore c's act 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc 4th o's bract tech so bore cat c's 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc shot bract echo St. Bohr AC etc t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab c's hot et brae Oct SC 4th Boca SC 7th ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab cot he St brae cot SC 4th Boca c's 10th ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab cos 7th et breach Scott Boca CRT eh St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb cot SC at breath c's Oct Boca crest 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb AC SC Ott Brett Chao SC boat chert c's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob sec tract broth AC SC et boar c's etc 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob CRT SC eta b's Oct race 7th beth ROTC sac 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob CRT c's eat b's etc RCA hot beth c's AC tor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob car etc St. b's arc etc hot beth car c's to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn strobe catch b's crochet at bet RCA SC hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb etc sac 6th b's cot race 6th bet arccos 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb cat sec 8th b's chore tact bet arc hoc St 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC sect 8th b's cat tech or bet c's AC 7th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC etch St b's cat core 5th bet CRT hoc sa 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb act sec 8th b's care Oct 8th bet cos RCA 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb Oct sac 8th b's car cot the bet coca 7th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb accost 10th b's AC etch tor bet cat hoc r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cot sac 5th b's AC CRT eh to bet car c's hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 6th St b's act Oct her best char Oct 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 9th St cab sector 4th berth cot sac 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coat c's 8th cab sect Thor Bert Acts hoc 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cat cot h's cab sec 7th tor Bert c's act oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC Scot 9th cab Scot 6th re Bert coach t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC c's 9th to cab SC 10th to re Bert cash cot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb act c's hot cab SC 7th or et bear Oct SC 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob etch SC at cab ROTC 8th e's bear cot SC 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob chat sect cab Oct h's ret beach ROTC 1st 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob cat c's the cab etch t's or be tract SC ho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC tech 1st cab escort 6th be RCA Scot 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC c's 9th et cab c's 9th or et be Oct scar 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob act SC the cab c's her tot be actor SC 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abo CRT sec 7th cab CRT hoe St. be AC SC 7th tor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe ROTC SC 5th cab cot her St. be arc Scot 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe CRT hoc St cab cos 8th ret be act SC 8th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe cos CRT 5th cab core 9th St be c's arch tot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sect Thor cab core 6th 1st be c's actor 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sec 5th tor Cabot c's 4th re be c's AC 8th rot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc Scot 8th re carob tech St be c's arc 10th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 8th tore carob etch St. be CRT scat ho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 5th to re CBS acre 5th to be CRT AC 7th so 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc ROTC 6th e's CBS reach Ott be CRT AC ho St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc Oct her t's CBS race 8th to be cot arch t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc etch 1st or CBS Oct 10th Rae be cot AC 7th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc escort 4th CBS Oct 5th ear be cost RCA 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's the tor CBS Oct 7th ear be chat SC rot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's 5th tore CBS hoc ret at be char SC tot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc CRT hoe St CBS etc ha tor be Chao CRT St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc cot her t's CBS ace 8th tor be cat SC 8th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc cos 5th ret CBS arc 8th toe be cast CRT oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 5th 1st CBS teach rot be cart cos 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 8th St CBS CRT ho ate be car SC 8th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe cat SC 10th CBS cot 8th era be car cost 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe act SC 4th CBS cot 5th Rae bath ROTC sec 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab retch to CBS cot he tar bate CRT c's oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab etc 4th or CBS core 9th at batch c's to re 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab cot 7th re CBS chert tao bat soccer 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sorb AC etc 7th CBS cat the or bat c's ROTC he 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob CRT teach CBS cat 4th o'er bat cot SC her 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob car etc 10th CBS cat 7th ore bat core c's 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob ace CRT 6th CBS car 8th toe bare Oct SC 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab soccer 10th CBS AC 8th or et bare cot SC 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab c's ROTC eh CBS AC 4th to re bar Scot tech 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab cot SC her CBS AC 7th tore bar etc hoc St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab core c's 8th CBS act the or bar cot sec 7th both RCA sect 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn CBS act eh rot bar chest cot both crest AC 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra sect 10th bah CRT etc o's both car SC et 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra SC 6th et Bach sec trot botch acre 1st 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Corbett c's ha Bach Oct St. re botch arc set 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Scot the Bach c's tor et Bose CRT AC 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab octet h's brace Scot 5th Bosch CRT ate 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Oct he 1st brace c's 5th to bore c's act 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc 6th o's bract sect oh bore cat SC 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc 9th so bract etch so Bohr AC etc St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab c's he tot brae Oct SC 8th Boca SC 4th ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab cot h's et brae cot SC 8th Boca etc 7th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab coset 10th brash etc Oct Boca CRT eh 1st 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb cotta c's breach cot 1st Boca crest 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb act cost Brett hoc sac boat CRT c's he 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb Acts Oct broth cat sec boar c's etc 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob c's etc art b's Oct acre 8th betroth AC SC 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob CRT c's eta b's etc ROTC ha beth c's actor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob car etc t's b's arc Oct the beth car Scot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Hobart etc SC b's crotch ate bet ROTC SC ah 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb etc sac 7th b's cot race 5th bet arccos 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb cat sec 9th b's coat CRT he bet arc SC hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC sect 4th b's catch or et bet c's hoc art 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC SC 10th et b's cat core 8th bet CRT sac oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb Acts etch b's care Oct 4th bet cos RCA 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb Oct sac 4th b's car etch to bet coca 8th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb accost 8th b's AC Oct 5th re bet chaos CRT 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cot sac 6th b's AC CRT ho et bet car hoc St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 6th t's b's act ROTC he best CRT AC oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 4th St. b's act core 6th berth AC SC to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coat c's 5th cab sect 6th or Bert hoc scat 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cat hoc 1st cab sec 6th tor Bert c's AC hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC Scot 5th cab Scot 10th re Bert cos AC 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC c's 5th to cab SC 9th tore Bert cast hoc 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb act hoc St cab SC her tot bear Oct SC 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob tact SC he cab ROTC 9th e's bear cot SC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob c's etch at cab Oct her 1st beach ROTC St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob cat SC the cab etch sort be SC arch Ott 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC tech St. cab escort 10th be RCA Scot 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC c's 10th et cab c's 9th tore be Oct arch St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob act sec 6th cab c's eh trot be actor SC 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abo CRT sec 8th cab CRT hoe St be AC SC 5th tor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe ROTC SC 4th cab cot her St be arc Scot 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe CRT SC hot cab cos 9th ret be act SC 7th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe cos CRT 8th cab core 5th 1st be torch AC t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sect 8th or cab core 6th St be c's Oct hart 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sec 9th tor Cabot etch r's be c's AC 5th rot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc Scot 10th re carob sect 5th be c's arc 6th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 6th tore carob etch t's be CRT Scot ha 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 9th or et CBS acre 10th to be CRT AC 4th so 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc ROTC eh 1st CBS retch oat be CRT AC ho t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc Oct h's ret CBS RCA 7th toe be CRT c's oath 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc etch t's or CBS Oct hat re be cot starch 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc escort 10th CBS Oct 5th Rae be cost RCA 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's 8th tore CBS Oct 7th Rae be cos CRT hat 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's 5th or et CBS hoc rat et be char Scott 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc CRT hoe 1st CBS etc oh art be Chao CRT St 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc crest hot CBS etc 7th oar be cat SC 7th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc cos 6th ret CBS ace 7th tor be cast torch 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 9th St CBS arc 7th toe be cart cos 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 8th 1st CBS CRT oh eat be car SC 6th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe cat SC 9th CBS cot 8th are be car cost 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe act SC 9th CBS cot 9th ear bathe c's ROTC 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab tech tor CBS cot 6th era bate CRT SC oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab etc 8th or CBS core 8th at batch escort 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab cot 8th re CBS chore tat bat ROTC SC eh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sorb AC etc 10th CBS cat 8th roe bat torch sec 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob CRT etc ah CBS cat 5th roe bat crotch e's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob car etc 8th CBS cat 7th o'er bat core c's 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob act CRT eh CBS care 6th to Barth cos etc 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab soccer 8th CBS car 7th toe bare c's Oct 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab torch sec CBS AC 5th or et bare cot c's 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab crotch e's CBS AC 7th to re bar etc SC hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab core c's 6th CBS act 8th ore bar cot sec 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn throb AC c's et CBS act 4th o'er bar cos etc 9th both c's act re 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra sect 9th bah CRT SC toe both caret c's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra SC 7th et Bach sect tor botch acre St 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Corbett SC ha Bach Oct St re botch AC St. re 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Scott he Bach c's tot re botch car set 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab SC the to Bach cost ret Bosch act ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Oct h's et brace SC 6th to bore c's act 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc 7th o's brace cost 6th bore cat SC 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc oh 1st bract hoc set Bohr etc Acts 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab c's 5th toe bract cosh et Boca SC 9th ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab cot eh t's brae c's Oct 9th Boca etc 4th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab coset 5th brae cot c's 9th Boca CRT he St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb c's Oct at breach cot St. Boca crest 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb act SC to Brest coca 6th boat CRT SC he 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb AC cot t's broach etc 1st boar c's etc 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob c's etc rat b's Oct acre 5th boa CRT c's the 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob CRT ace 1st b's etch actor beth act SC or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob cart c's et b's ace ROTC 8th beth cat c's or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob AC CRT EST b's crotch eta bet scorch at 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb etc sac 10th b's cot race 8th bet arccos 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb catch EST b's coca 4th ret bet AC SC Roth 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC sect 5th b's Chao CRT et bet c's RCA hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC SC 7th et b's cat core 10th bet c's act rho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC c's 6th et b's care Oct 9th bet cos RCA 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb scotch at b's car tech to bet cos CRT ha 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb accost 4th b's AC Oct 10th re bet char c's to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cot sac 7th b's AC etc Roth bet car hoc t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 8th St b's ache CRT to best torch AC 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 4th 1st b's act core 10th berth accost 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coat c's 9th cab sect 10th or Bert Oct SC ha 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cat hoc t's cab sec 8th tor Bert c's Oct ah 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC Scot 7th cab Scot 5th re Bert cos AC 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC c's 7th to cab SC 9th or et Bert cat c's ho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb act hoc t's cab SC eh trot bear Oct SC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob SC tech at cab ROTC he St. bear cot SC 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob c's tact he cab Oct her St beach SC trot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob cat sec 9th cab etch r's to be scorch AT&T 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC sect 7th cab escort 5th be RCA Scot 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC etch St. cab c's 5th to re be Oct arch St 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob act sec 5th cab c's 6th to re be actor SC 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abo CRT sec 10th cab CRT the o's be AC SC 10th tor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abet CRT c's oh cab cot h's ret be AC Oct 4th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe c's ROTC 8th cab cos 4th ret be arc SC 9th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe cos CRT 10th cab core 5th St be torch AC 1st 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sect 10th or cab core 8th 1st be c's RCA 9th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc sec 8th tor Cabot SC 8th re be c's AC 7th rot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc tech 1st or carob sect 10th be c's arc 5th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 6th or et carob SC 4th et be c's torch at 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc SC 9th to re CBS acre 6th to be CRT Acts oh 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc ROTC eh St CBS ROTC eh at be CRT AC 10th so 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc ROTC 7th e's CBS RCA eh Ott be CRT c's ho at 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc hector 1st CBS Oct 8th era be cot scar 10th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc etc short CBS Oct hater be cost RCA 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's 8th to re CBS Oct eh rat be cosh tract 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's 7th to re CBS tact eh or be chart c's to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc c's Roth et CBS etc 10th oar be char cot t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc CRT ho set CBS etc 4th oar be cat SC Roth 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc cost 8th re CBS ace 6th rot be cat c's 8th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 9th 1st CBS arc he tot be cart cos 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abc core 4th St CBS CRT oh eta be car SC 5th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe catch t's CBS crate hot be car cost 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe cat c's 7th CBS cot 9th Rae Bator c's etch 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn robe act c's 10th CBS cot 6th ear bate torch SC 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab etc 10th or CBS cot earth batch SC tore 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn scab cot 10th re CBS coat 6th re bat SC tech or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sorb act tech CBS cater hot bat etc SC rho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob etc RCA 5th CBS cat ho ret bat CRT hoc e's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob car etc 6th CBS cat rho et bat core SC 5th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn sob act retch CBS care 5th to Barth Oct sec 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab soccer 4th CBS car he Ott bare c's Oct 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab etc SC rho CBS AC 9th tore bare cot c's 7th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab CRT hoc e's CBS AC he tort bar etch Scot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn tab core SC 5th CBS act 9th o'er bar cot sec 9th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn throb AC sect CBS act 4th roe bar cos etc 10th both c's AC ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn CBS arch to et bah c's etc tor both cart sec 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra SC 8th et bah cos CRT et botch sac ret 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn cobra c's 5th et Bach ROTC EST botch AC t's re 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab sec 5th to Bach c's Ott re botch care St. 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab SC eh tot Bach cot rest Bosch etc tar 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab Oct eh St. brace SC 7th to bore act SC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc 8th so brace cost 7th bore cat SC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab etc oh St bract Oct she Bohr etc scat 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab c's eh Ott bract cost he Bohr cast etc 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab cot eh St brae c's Oct 10th Boca etc 9th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn crab coset 6th brae cot c's 10th Boca CRT he 1st 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb Oct scat breach c's tot Boca CRT Seth 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb cast cot Brest coca 8th boat c's retch 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn herb AC cot St broach etc t's boar c's etc 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob etc RCA St b's Oct acre 6th boa CRT SC the 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob CRT ace t's b's hoc tact re beth arc Scot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob cart sect b's ace ROTC 5th beth cost arc 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn hob arc etc t's b's CRT echo at beta cosh CRT 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb etc sac 5th b's cot acre 7th bet hoc RCA t's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb chat c's et b's coca 6th ret bet AC SC 5th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb cast tech b's char etc to bet c's ROTC ah 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC SC 9th et b's cat CRT hoe bet c's AC 4th or 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb AC c's 8th et b's cart cot eh bet cot crash 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn orb act c's the b's care cot 6th bet cos arc 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb hoc SC AT&T b's AC Oct 6th re bet char Scot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cot sac 9th b's AC etc 5th or bet car SC hot 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 8th t's b's AC cot 9th re bet car cos 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coca 5th St b's act core 5th Bertha cot c's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb coat SC 6th cab sect 5th or berth coat c's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb cat Oct h's cab sec 10th tor Bert act SC ho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC Scot 6th cab Scott her Bert cos AC 8th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb AC c's 6th to cab SC 5th to re Bert cat SC ho 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb act SC hot cab SC 6th to re beast CRT hoc 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn reb act cos 9th cab ROTC he St bear c's Oct 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob etc sac 10th cab ROTC 7th e's bear cot c's 6th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob cat sec 4th cab hector t's be scotch art 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC sect 4th cab etc short be ROTC sac 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob AC etch 1st cab c's he tort be RCA SC 7th to 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn rob act sec 8th cab c's 8th or et be actor SC 4th 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abo CRT sec 6th cab CRT h's toe be AC SC 8th tor 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn abet CRT SC oh cab CRT those be AC Oct 5th r's 348 candidates -Order of search will be bchsoreatnpquvwxyzdfgijklm +Order of search will be bchsoreatugdzyfpqwvxijklmn Abe c's ROTC 5th cab cost 6th re be arc SC 8th to 46 candidates -Order of search will be guoirhsklmnpqtvwxyazbcdefj +Order of search will be guoirhsywefjkvcbdqztlxapmn exit 0 From daniel at zuster.org Wed Aug 18 20:29:16 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 01:29:16 -0000 Subject: [llvm-commits] [test-suite] r111502 - in /test-suite/trunk: MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c SingleSource/Benchmarks/BenchmarkGame/puzzle.c SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output Message-ID: <20100819012916.A8BA72A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 20:29:16 2010 New Revision: 111502 URL: http://llvm.org/viewvc/llvm-project?rev=111502&view=rev Log: Use ?rand48 instead of rand(), for more predictable results. Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output?rev=111502&r1=111501&r2=111502&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output (original) +++ test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output Wed Aug 18 20:29:16 2010 @@ -1,10 +1,10 @@ Bit counter algorithm benchmark -Optimized 1 bit/loop counter > Bits: 13254024 -Ratko's mystery algorithm > Bits: 15454236 -Recursive bit count by nybbles > Bits: 16468711 -Non-recursive bit count by nybbles > Bits: 18724896 -Non-recursive bit count by bytes (BW) > Bits: 15997399 -Non-recursive bit count by bytes (AR) > Bits: 16733373 -Shift and count bits > Bits: 15589355 +Optimized 1 bit/loop counter > Bits: 15830918 +Ratko's mystery algorithm > Bits: 18246946 +Recursive bit count by nybbles > Bits: 18853553 +Non-recursive bit count by nybbles > Bits: 17783741 +Non-recursive bit count by bytes (BW) > Bits: 16157105 +Non-recursive bit count by bytes (AR) > Bits: 13742280 +Shift and count bits > Bits: 15552206 exit 0 Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c?rev=111502&r1=111501&r2=111502&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c Wed Aug 18 20:29:16 2010 @@ -53,12 +53,13 @@ puts("Bit counter algorithm benchmark\n"); + srand48(1); for (i = 0; i < FUNCS; i++) { #if 0 start = clock(); #endif - for (j = n = 0, seed = rand(); j < iterations; j++, seed += 13) + for (j = n = 0, seed = lrand48(); j < iterations; j++, seed += 13) n += pBitCntFunc[i](seed); #if 0 Modified: test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c?rev=111502&r1=111501&r2=111502&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c (original) +++ test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c Wed Aug 18 20:29:16 2010 @@ -8,7 +8,7 @@ int randInt(int min, int max) { int k, n; n = (max - min) + 1; - k = (int)(n * (rand() / (RAND_MAX + 1.0))); + k = (int)(n * (lrand48() / (RAND_MAX + 1.0))); return (k == n) ? k + min - 1 : k + min; } @@ -53,7 +53,7 @@ int i, j, duplicate; int *rndArr; - srand(1); + srand48(1); for (i = 0; i < NLOOPS1; i++) { rndArr = createRandomArray(ARRAY_SIZE); @@ -64,4 +64,4 @@ } return 0; -} \ No newline at end of file +} Modified: test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output?rev=111502&r1=111501&r2=111502&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output (original) +++ test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output Wed Aug 18 20:29:16 2010 @@ -1,6 +1,6 @@ -Found duplicate: 4 -Found duplicate: 485365 -Found duplicate: 417267 -Found duplicate: 436989 -Found duplicate: 60067 +Found duplicate: 20816 +Found duplicate: 227247 +Found duplicate: 417409 +Found duplicate: 167994 +Found duplicate: 282745 exit 0 From daniel at zuster.org Wed Aug 18 20:29:19 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 01:29:19 -0000 Subject: [llvm-commits] [test-suite] r111503 - in /test-suite/trunk/SingleSource/UnitTests: 2002-05-02-ManyArguments.c 2002-05-02-ManyArguments.reference_output 2006-01-23-UnionInit.c 2006-01-23-UnionInit.reference_output Message-ID: <20100819012919.C016F2A6C12E@llvm.org> Author: ddunbar Date: Wed Aug 18 20:29:19 2010 New Revision: 111503 URL: http://llvm.org/viewvc/llvm-project?rev=111503&view=rev Log: Avoid %p, which has non-predictable behavior for null values. Modified: test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.c test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.reference_output test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.c test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.reference_output Modified: test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.c?rev=111503&r1=111502&r2=111503&view=diff ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.c (original) +++ test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.c Wed Aug 18 20:29:19 2010 @@ -3,7 +3,7 @@ void printfn(int a, short b, double C, float D, signed char E, char F, void *G, double *H, int I, long long J) { printf("%d, %d, %f, %f, %d\n", a, b, C, D, E); - printf("%d, 0x%p, 0x%p, %d, %lld\n", F, G, H, I, J); + printf("%d, %ld, %ld, %d, %lld\n", F, (long) G, (long) H, I, J); } int main() { Modified: test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.reference_output?rev=111503&r1=111502&r2=111503&view=diff ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.reference_output (original) +++ test-suite/trunk/SingleSource/UnitTests/2002-05-02-ManyArguments.reference_output Wed Aug 18 20:29:19 2010 @@ -1,3 +1,3 @@ 12, 2, 123.234000, 1231.123169, -12 -23, 0x0x1e240, 0x0x0, 1234567, 123124124124 +23, 123456, 0, 1234567, 123124124124 exit 0 Modified: test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.c?rev=111503&r1=111502&r2=111503&view=diff ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.c (original) +++ test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.c Wed Aug 18 20:29:19 2010 @@ -150,7 +150,7 @@ hobbit2.values[1], hobbit2.values[2]); printf("PR431: %d, %d, %d, %d\n", data.x, data.v[0], data.v[1], data.v[2]); - printf("PR654: %p, '%s'\n", s.inplace, s.chunk_data); + printf("PR654: %ld, '%s'\n", (long) s.inplace, s.chunk_data); printf("PR323: %d, '%s'\n", ai.lsk.agid, ai.lsk.key); lock = (spinlock_t) { .raw_lock = one_raw_spinlock() }; printf("PR627: %d\n", (int)sizeof(lock)); Modified: test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.reference_output?rev=111503&r1=111502&r2=111503&view=diff ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.reference_output (original) +++ test-suite/trunk/SingleSource/UnitTests/2006-01-23-UnionInit.reference_output Wed Aug 18 20:29:19 2010 @@ -6,7 +6,7 @@ PR199: 5, 1, 2, 3 PR199: 5, 1, 2, 3 PR431: 0, 1, 2, 3 -PR654: 0x0, ' xyzkasjdlf ' +PR654: 0, ' xyzkasjdlf ' PR323: 3, 'foo' returning raw_lock PR627: 0 From dirty at apple.com Wed Aug 18 20:35:02 2010 From: dirty at apple.com (Cameron Esfahani) Date: Wed, 18 Aug 2010 18:35:02 -0700 Subject: [llvm-commits] [WinABI patch] Make sure to call __chkstk when appropriate In-Reply-To: References: Message-ID: Anton and I had a discussion about this and I think this updated version of the patch resolves most of the issues. The long and the short of it is that Microsoft changed the functionality of __chkstk in the 64-bit case. Previously __chkstk, like __alloca, would touch the stack and adjust the stack pointer. In the 64-bit case, __chkstk is only responsible for touching the stack. The 64-bit prologue code is responsible for adjusting the stack pointer. In this new patch, I have added the 32-bit Windows case to the existing CygMing logic, and call __chkstk instead of __alloca. The 64-bit Windows case is on its own. I also put a nice big comment explaining how the 64-bit version of __chkstk has different functionality than the 32-bit version. One question that I have, though: should we treat 64-bit CygMing like 64-bit Windows? Does the 64-bit __alloca implementation in CygMing adjust the stack pointer? Current, the logic in emitPrologue() is that the all flavors of CygMing (32 and 64-bit) go through the 32-bit CygMing/Windows path? Based on revision 111498: -------------- next part -------------- A non-text attachment was scrubbed... Name: stack.patch Type: application/octet-stream Size: 6739 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100818/c1c44b5f/attachment.obj -------------- next part -------------- On Aug 18, 2010, at 3:56 AM, Anton Korobeynikov wrote: > Hello, Cameron > >> I put it in the same area as the mingw case, for __alloca, so I thought it >> was in the right place. > Hrm... Doesn't seem so. Stuff really should be done inside emitPrologue(), > not within some helper routine. > >> You're right it will clobber eax in the 32-bit case, so there'd have to be >> some code added to save/restore it. > emitPrologue() already handles this case for __alloca, no need to code > duplication, > you'll just have to tune the name there. > >> I'll have to take your word that __chkstk is the same as __alloca, but >> reading the documentation on Microsoft's website, it doesn't come across >> that way: >> __alloca: >> >> Allocates memory on the stack. This function is deprecated because a more >> secure version is available; see _malloca. > MS __alloca != mingw32 __alloca > >> The __chkstk helper will not modify any registers other than R10, R11, and >> the condition codes. In particular, it will return RAX unchanged and leave >> all nonvolatile registers and argument-passing registers unmodified. >> >> So, the only registers which are munged, in the 64-bit case, are the >> volatile ones. I assumed that the 32-bit case would be similar. > There is one point > >> The reason I didn't add this code to the mingw case is because that path >> never calls emitSPUpdate(): it relys on __alloca to do all the stack >> manipulation. This didn't appear to me that it would be valid, according >> to the Windows ABI. > It definitely does all the stack manipulations, see above. I'm not quite sure > about 64 bit case. I vague recall some discussion on gcc ML, that on 64 bit > __chkstk != __alloca > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University Cameron Esfahani dirty at apple.com "There are times in the life of a nation when the only place a decent man can find himself is in prison." From daniel at zuster.org Wed Aug 18 21:02:59 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 02:02:59 -0000 Subject: [llvm-commits] [test-suite] r111505 - in /test-suite/trunk/MultiSource: Applications/obsequi/Obsequi.reference_output Benchmarks/Prolangs-C/archie-client/archie.reference_output Benchmarks/Prolangs-C/plot2fig/plot2fig.reference_output Message-ID: <20100819020259.C9E182A6C12C@llvm.org> Author: ddunbar Date: Wed Aug 18 21:02:59 2010 New Revision: 111505 URL: http://llvm.org/viewvc/llvm-project?rev=111505&view=rev Log: Add some reference outputs. Added: test-suite/trunk/MultiSource/Applications/obsequi/Obsequi.reference_output test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/archie.reference_output test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/plot2fig/plot2fig.reference_output Added: test-suite/trunk/MultiSource/Applications/obsequi/Obsequi.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/obsequi/Obsequi.reference_output?rev=111505&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/obsequi/Obsequi.reference_output (added) +++ test-suite/trunk/MultiSource/Applications/obsequi/Obsequi.reference_output Wed Aug 18 21:02:59 2010 @@ -0,0 +1,166 @@ +Starting + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 + + Vertical Horizontal + Real Safe Real Safe + 1) 4 0 4 0 Number of rows = 8 + 2) 4 0 4 0 Number of columns = 8 + 3) 4 0 4 0 + 4) 4 0 4 0 + 5) 4 0 4 0 + 6) 4 0 4 0 + 7) 4 0 4 0 + 8) 4 0 4 0 +Totals: 32 0 32 0 +Move (2,1), value 0: 1. +alpha -5000, beta 5000. +Move (2,3), value 0: 2. +alpha 0, beta 5000. +Move (2,5), value 0: 3. +alpha 0, beta 5000. +Move (2,7), value 0: 4. +alpha 0, beta 5000. +Move (7,1), value 0: 5. +alpha 0, beta 5000. +Move (7,3), value 0: 6. +alpha 0, beta 5000. +Move (7,5), value 0: 7. +alpha 0, beta 5000. +Move (7,7), value 0: 8. +alpha 0, beta 5000. +Move (1,1), value 0: 9. +alpha 0, beta 5000. +Move (1,3), value 0: 10. +alpha 0, beta 5000. +Move (1,5), value 0: 11. +alpha 0, beta 5000. +Move (1,7), value 0: 12. +alpha 0, beta 5000. +Move (2,2), value -4: 13. +alpha 0, beta 5000. +Move (2,4), value -3: 14. +alpha 0, beta 5000. +Move (2,6), value -4: 15. +alpha 0, beta 5000. +Move (3,1), value 0: 16. +alpha 0, beta 5000. +Move (3,3), value 0: 17. +alpha 0, beta 5000. +Move (3,5), value 0: 18. +alpha 0, beta 5000. +Move (3,7), value 0: 19. +alpha 0, beta 5000. +Move (4,1), value 0: 20. +alpha 0, beta 5000. +Move (4,3), value 0: 21. +alpha 0, beta 5000. +Move (4,5), value 0: 22. +alpha 0, beta 5000. +Move (4,7), value 0: 23. +alpha 0, beta 5000. +Move (5,1), value 0: 24. +alpha 0, beta 5000. +Move (5,3), value 0: 25. +alpha 0, beta 5000. +Move (5,5), value 0: 26. +alpha 0, beta 5000. +Move (5,7), value 0: 27. +alpha 0, beta 5000. +Move (6,1), value 0: 28. +alpha 0, beta 5000. +Move (6,3), value 0: 29. +alpha 0, beta 5000. +Move (6,5), value 0: 30. +alpha 0, beta 5000. +Move (6,7), value 0: 31. +alpha 0, beta 5000. +Move (7,2), value -4: 32. +alpha 0, beta 5000. +Move (7,4), value -3: 33. +alpha 0, beta 5000. +Move (7,6), value -4: 34. +alpha 0, beta 5000. +Move (8,1), value 0: 35. +alpha 0, beta 5000. +Move (8,3), value 0: 36. +alpha 0, beta 5000. +Move (8,5), value 0: 37. +alpha 0, beta 5000. +Move (8,7), value 0: 38. +alpha 0, beta 5000. +Move (1,2), value -5: 39. +alpha 0, beta 5000. +Move (1,4), value -4: 40. +alpha 0, beta 5000. +Move (1,6), value -5: 41. +alpha 0, beta 5000. +Move (3,2), value -3: 42. +alpha 0, beta 5000. +Move (3,4), value -2: 43. +alpha 0, beta 5000. +Move (3,6), value -3: 44. +alpha 0, beta 5000. +Move (4,2), value -7: 45. +alpha 0, beta 5000. +Move (4,4), value -6: 46. +alpha 0, beta 5000. +Move (4,6), value -5: 47. +alpha 0, beta 5000. +Move (5,2), value -5: 48. +alpha 0, beta 5000. +Move (5,4), value -4: 49. +alpha 0, beta 5000. +Move (5,6), value -5: 50. +alpha 0, beta 5000. +Move (6,2), value -3: 51. +alpha 0, beta 5000. +Move (6,4), value -2: 52. +alpha 0, beta 5000. +Move (6,6), value -3: 53. +alpha 0, beta 5000. +Move (8,2), value -5: 54. +alpha 0, beta 5000. +Move (8,4), value -4: 55. +alpha 0, beta 5000. +Move (8,6), value -5: 56. +alpha 0, beta 5000. +0 0 0 0. + +cutoffs depth 1: (56) 0 - 0 0 0 0 0 >0. +The value is -5 at a depth of 1. +Nodes: 56. +Move (2,1), value 5000: 2,023,301. +alpha -5000, beta 5000. +Winner found: 5000. +1356 2450 1316053 104829. + +cutoffs depth 1: (1) 0 - 0 0 0 0 0 >0. +cutoffs depth 2: (52) 52 - 52 0 0 0 0 >0. +cutoffs depth 3: (52) 0 - 0 0 0 0 0 >0. +cutoffs depth 4: (1263) 728 - 728 0 0 0 0 >0. +cutoffs depth 5: (728) 0 - 0 0 0 0 0 >0. +cutoffs depth 6: (21651) 9812 - 9810 1 1 0 0 >0. +cutoffs depth 7: (9815) 3 - 2 0 0 0 1 >0. +cutoffs depth 8: (160368) 38732 - 38714 14 4 0 0 >0. +cutoffs depth 9: (38807) 50 - 39 6 5 0 0 >0. +cutoffs depth 10: (631941) 86758 - 86673 52 10 2 2 >19. +cutoffs depth 11: (87924) 775 - 634 85 19 21 10 >6. +cutoffs depth 12: (771767) 55353 - 54840 256 82 15 64 >96. +cutoffs depth 13: (64920) 3921 - 3389 387 124 16 5 >0. +cutoffs depth 14: (187771) 7691 - 6649 766 123 44 105 >4. +cutoffs depth 15: (24493) 3183 - 2950 210 13 7 3 >0. +cutoffs depth 16: (14596) 1814 - 1786 26 0 0 2 >0. +cutoffs depth 17: (5052) 559 - 523 33 3 0 0 >0. +cutoffs depth 18: (1699) 181 - 167 9 5 0 0 >0. +cutoffs depth 19: (326) 34 - 34 0 0 0 0 >0. +cutoffs depth 20: (73) 2 - 2 0 0 0 0 >0. +cutoffs depth 21: (2) 0 - 0 0 0 0 0 >0. +winner V, move (1,2), nodes 2,023,301. +exit 0 Added: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/archie.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/archie.reference_output?rev=111505&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/archie.reference_output (added) +++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/archie.reference_output Wed Aug 18 21:02:59 2010 @@ -0,0 +1,12 @@ +Usage: archie [-[cers][l][t][m#][h host][L][N#]] string + -c : case sensitive substring search + -e : exact string match (default) + -r : regular expression search + -s : case insensitive substring search + -l : list one match per line + -t : sort inverted by date + -m# : specifies maximum number of hits to return (default 95) + -h host : specifies server host + -L : list known servers and current default + -N# : specifies query niceness level (0-35765) +exit 1 Added: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/plot2fig/plot2fig.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/plot2fig/plot2fig.reference_output?rev=111505&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/plot2fig/plot2fig.reference_output (added) +++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/plot2fig/plot2fig.reference_output Wed Aug 18 21:02:59 2010 @@ -0,0 +1,3 @@ +#FIG 2.0 +80 2 +exit 0 From daniel at zuster.org Wed Aug 18 21:03:05 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 02:03:05 -0000 Subject: [llvm-commits] [test-suite] r111506 - /test-suite/trunk/MultiSource/Applications/minisat/Main.cpp Message-ID: <20100819020305.867B62A6C12D@llvm.org> Author: ddunbar Date: Wed Aug 18 21:03:05 2010 New Revision: 111506 URL: http://llvm.org/viewvc/llvm-project?rev=111506&view=rev Log: Avoid Linux only printf, to match reference output. Modified: test-suite/trunk/MultiSource/Applications/minisat/Main.cpp Modified: test-suite/trunk/MultiSource/Applications/minisat/Main.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/minisat/Main.cpp?rev=111506&r1=111505&r2=111506&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/minisat/Main.cpp (original) +++ test-suite/trunk/MultiSource/Applications/minisat/Main.cpp Wed Aug 18 21:03:05 2010 @@ -197,7 +197,6 @@ reportf("decisions : %-12lld (%4.2f %% random)\n", solver.decisions, (float)solver.rnd_decisions*100 / (float)solver.decisions); reportf("propagations : %-12lld\n", solver.propagations); reportf("conflict literals : %-12lld (%4.2f %% deleted)\n", solver.tot_literals, (solver.max_literals - solver.tot_literals)*100 / (double)solver.max_literals); - if (mem_used != 0) reportf("Memory used : %.2f MB\n", mem_used / 1048576.0); } Solver* solver; @@ -286,7 +285,6 @@ #if defined(__linux__) && defined(_FPU_EXTENDED) && defined(_FPU_DOUBLE) fpu_control_t oldcw, newcw; _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw); - reportf("WARNING: for repeatability, setting FPU to use double precision\n"); #endif double cpu_time = cpuTime(); From grosbach at apple.com Wed Aug 18 21:47:08 2010 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 19 Aug 2010 02:47:08 -0000 Subject: [llvm-commits] [llvm] r111508 - in /llvm/trunk: include/llvm/CodeGen/MachineFrameInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <20100819024708.487F12A6C12C@llvm.org> Author: grosbach Date: Wed Aug 18 21:47:08 2010 New Revision: 111508 URL: http://llvm.org/viewvc/llvm-project?rev=111508&view=rev Log: Update local stack block allocation to let PEI do the allocs if no additional base registers were required. This will allow for slightly better packing of the locals when alignment padding is necessary after callee saved registers. Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h?rev=111508&r1=111507&r2=111508&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h Wed Aug 18 21:47:08 2010 @@ -216,6 +216,11 @@ /// alignment of any object in it. unsigned LocalFrameMaxAlign; + /// Whether the local object blob needs to be allocated together. If not, + /// PEI should ignore the isPreAllocated flags on the stack objects and + /// just allocate them normally. + bool UseLocalStackAllocationBlock; + public: explicit MachineFrameInfo(const TargetFrameInfo &tfi) : TFI(tfi) { StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0; @@ -315,6 +320,17 @@ /// object blob. unsigned getLocalFrameMaxAlign() { return LocalFrameMaxAlign; } + /// getUseLocalStackAllocationBlock - Get whether the local allocation blob + /// should be allocated together or let PEI allocate the locals in it + /// directly. + bool getUseLocalStackAllocationBlock() {return UseLocalStackAllocationBlock;} + + /// setUseLocalStackAllocationBlock - Set whether the local allocation blob + /// should be allocated together or let PEI allocate the locals in it + /// directly. + void setUseLocalStackAllocationBlock(bool v) { + UseLocalStackAllocationBlock = v; + } /// isObjectPreAllocated - Return true if the object was pre-allocated into /// the local block. Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111508&r1=111507&r2=111508&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Wed Aug 18 21:47:08 2010 @@ -89,6 +89,13 @@ // Insert virtual base registers to resolve frame index references. insertFrameReferenceRegisters(MF); + // Tell MFI whether any base registers were allocated. PEI will only + // want to use the local block allocations from this pass if there were any. + // Otherwise, PEI can do a bit better job of getting the alignment right + // without a hole at the start since it knows the alignment of the stack + // at the start of local allocation, and this pass doesn't. + MFI->setUseLocalStackAllocationBlock(NumBaseRegisters > 0); + return true; } Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=111508&r1=111507&r2=111508&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Aug 18 21:47:08 2010 @@ -560,7 +560,7 @@ // check for whether the frame is large enough to want to use virtual // frame index registers. Functions which don't want/need this optimization // will continue to use the existing code path. - if (EnableLocalStackAlloc && MFI->getLocalFrameSize()) { + if (EnableLocalStackAlloc && MFI->getUseLocalStackAllocationBlock()) { unsigned Align = MFI->getLocalFrameMaxAlign(); // Adjust to alignment boundary. @@ -593,7 +593,8 @@ // Assign large stack objects first. for (unsigned i = 0, e = MFI->getObjectIndexEnd(); i != e; ++i) { - if (MFI->isObjectPreAllocated(i)) + if (MFI->isObjectPreAllocated(i) && + MFI->getUseLocalStackAllocationBlock()) continue; if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex) continue; @@ -614,7 +615,8 @@ // Then assign frame offsets to stack objects that are not used to spill // callee saved registers. for (unsigned i = 0, e = MFI->getObjectIndexEnd(); i != e; ++i) { - if (MFI->isObjectPreAllocated(i)) + if (MFI->isObjectPreAllocated(i) && + MFI->getUseLocalStackAllocationBlock()) continue; if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex) continue; From eli.friedman at gmail.com Thu Aug 19 01:11:05 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Thu, 19 Aug 2010 06:11:05 -0000 Subject: [llvm-commits] [llvm] r111513 - /llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Message-ID: <20100819061105.5576D2A6C12C@llvm.org> Author: efriedma Date: Thu Aug 19 01:11:05 2010 New Revision: 111513 URL: http://llvm.org/viewvc/llvm-project?rev=111513&view=rev Log: Use std::string instead of StringRef in ClangAttrEmitter.cpp; per report on cfe-dev, fixes an error compiling with MSVC. Using a StringRef here doesn't look safe in any case. Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Modified: llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=111513&r1=111512&r2=111513&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ClangAttrEmitter.cpp Thu Aug 19 01:11:05 2010 @@ -355,7 +355,7 @@ }; class EnumArgument : public Argument { - StringRef type; + std::string type; std::vector values, enums; public: EnumArgument(Record &Arg, StringRef Attr) From clchiou at gmail.com Thu Aug 19 07:08:26 2010 From: clchiou at gmail.com (Che-Liang Chiou) Date: Thu, 19 Aug 2010 20:08:26 +0800 Subject: [llvm-commits] [patch][Target/PTX] Create PTX backend In-Reply-To: <4C68732E.20103@mxc.ca> References: <4C68732E.20103@mxc.ca> Message-ID: Hi Nick, I added some code in lib/Support/Triple.cpp that I didn't in previous patch. I re-generate a patch against revision 111515. Thank you very much. Regards, Che-Liang On Mon, Aug 16, 2010 at 7:07 AM, Nick Lewycky wrote: > Hi Che-Liang, > > I appreciate that you're doing this one small patch at a time. That's really > the right approach, but in this case we have two competing backends for a > PTX target. Is there any way we could see the full source to yours so we can > take a look and decide whether we want to invest time in reviewing yours, or > Helge's or both? > > Nick > > Che-Liang Chiou wrote: >> >> SVN revision: 110776 >> >> This patch is a part of upstream work of a PTX backend using LLVM code >> generator. >> >> Change list summary: >> - Add an empty backend that is merely compilable >> - Add PTX entry to autoconf/configure.ac and include/llvm/ADT/Triple.h >> >> Outcome: >> $ ./configure --enable-targets=ptx >> $ make >> $ llc -version | grep ptx >> ? ? ptx ? - PTX >> >> Misc: >> - Diff of auto-generated files are put in a separated patch >> - The autotool version on my machine is newer than >> autoconf/AutoGegen.sh requires, so the diff of auto-gen'd files might >> be differ with that on your machine >> >> Cheers, >> Che-Liang >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > -------------- next part -------------- A non-text attachment was scrubbed... Name: r111515-add-ptx-backend.patch Type: text/x-patch Size: 4169 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100819/0a53c3e2/attachment.bin From kennethuil at gmail.com Thu Aug 19 07:42:38 2010 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Thu, 19 Aug 2010 12:42:38 -0000 Subject: [llvm-commits] [llvm] r111516 - /llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll Message-ID: <20100819124238.DA0DD2A6C12C@llvm.org> Author: kennethuil Date: Thu Aug 19 07:42:38 2010 New Revision: 111516 URL: http://llvm.org/viewvc/llvm-project?rev=111516&view=rev Log: Fixed and reactivated a partial specialization test Modified: llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll Modified: llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll?rev=111516&r1=111515&r2=111516&view=diff ============================================================================== --- llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll (original) +++ llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll Thu Aug 19 07:42:38 2010 @@ -1,8 +1,8 @@ ; If there are two specializations of a function, make sure each callsite ; calls the right one. ; -; RN: opt -S -partialspecialization %s | FileCheck %s -; RUN: true +; RUN: opt -S -partialspecialization -disable-inlining %s | opt -S -inline | FileCheck %s -check-prefix=CORRECT +; RUN: opt -S -partialspecialization -disable-inlining %s | FileCheck %s declare void @callback1() declare void @callback2() @@ -14,14 +14,18 @@ define void @foo(void()* %pNonConstCallback) { Entry: +; CORRECT: Entry +; CORRECT-NEXT: call void @callback1() +; CORRECT-NEXT: call void @callback1() +; CORRECT-NEXT: call void @callback2() +; CORRECT-NEXT: call void %pNonConstCallback() +; CORRECT-NEXT: call void @callback1() +; CORRECT-NEXT: call void @callback2() +; CORRECT-NEXT: call void @callback2() ; CHECK: Entry -; CHECK-NEXT: call void @callback1() -; CHECK-NEXT: call void @callback1() -; CHECK-NEXT: call void @callback2() -; CHECK-NEXT: call void %pNonConstCallback() -; CHECK-NEXT: call void @callback1() -; CHECK-NEXT: call void @callback2() -; CHECK-NEXT: call void @callback2() +; CHECK-NOT: call void @UseCallback(void ()* @callback1) +; CHECK-NOT: call void @UseCallback(void ()* @callback2) +; CHECK: ret void call void @UseCallback(void()* @callback1) call void @UseCallback(void()* @callback1) call void @UseCallback(void()* @callback2) From benny.kra at googlemail.com Thu Aug 19 08:44:49 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Thu, 19 Aug 2010 13:44:49 -0000 Subject: [llvm-commits] [llvm] r111517 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20100819134449.84F0F2A6C12C@llvm.org> Author: d0k Date: Thu Aug 19 08:44:49 2010 New Revision: 111517 URL: http://llvm.org/viewvc/llvm-project?rev=111517&view=rev Log: MCELF: Count the section orders properly. Patch by Roman Divacky. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111517&r1=111516&r2=111517&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu Aug 19 08:44:49 2010 @@ -932,11 +932,16 @@ // ... then all of the sections ... DenseMap SectionOffsetMap; + DenseMap SectionIndexMap; + + unsigned Index = 1; for (MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end(); it != ie; ++it) { // Remember the offset into the file for this section. SectionOffsetMap[&it->getSection()] = FileOff; + SectionIndexMap[&it->getSection()] = Index++; + const MCSectionData &SD = *it; FileOff += Layout.getSectionFileSize(&SD); @@ -968,15 +973,11 @@ case ELF::SHT_RELA: { const MCSection *SymtabSection; const MCSection *InfoSection; - const MCSectionData *SymtabSD; - const MCSectionData *InfoSD; SymtabSection = Asm.getContext().getELFSection(".symtab", ELF::SHT_SYMTAB, 0, SectionKind::getReadOnly(), false); - SymtabSD = &Asm.getSectionData(*SymtabSection); - // we have to count the empty section in too - sh_link = SymtabSD->getLayoutOrder() + 1; + sh_link = SectionIndexMap[SymtabSection]; // Remove ".rel" and ".rela" prefixes. unsigned SecNameLen = (Section.getType() == ELF::SHT_REL) ? 4 : 5; @@ -986,8 +987,7 @@ ELF::SHT_PROGBITS, 0, SectionKind::getReadOnly(), false); - InfoSD = &Asm.getSectionData(*InfoSection); - sh_info = InfoSD->getLayoutOrder() + 1; + sh_info = SectionIndexMap[InfoSection]; break; } From bigcheesegs at gmail.com Thu Aug 19 09:10:36 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Thu, 19 Aug 2010 10:10:36 -0400 Subject: [llvm-commits] [llvm] r111393 - in /llvm/trunk/lib/CodeGen: SplitKit.cpp SplitKit.h In-Reply-To: <20100818190008.B00052A6C12D@llvm.org> References: <20100818190008.B00052A6C12D@llvm.org> Message-ID: On Wed, Aug 18, 2010 at 3:00 PM, Jakob Stoklund Olesen wrote: > Author: stoklund > Date: Wed Aug 18 14:00:08 2010 > New Revision: 111393 > > URL: http://llvm.org/viewvc/llvm-project?rev=111393&view=rev > Log: > Add the LiveIntervalMap class. Don't hook it up yet. > > LiveIntervalMap maps values from a parent LiveInterval to a child interval that > is a strict subset. It will create phi-def values as needed to preserve the > VNInfo SSA form in the child interval. > > This leads to an algorithm very similar to the one in SSAUpdaterImpl.h, but with > enough differences that the code can't be reused: > > - We don't need to manipulate PHI instructions. > - LiveIntervals have kills. > - We have MachineDominatorTree. > - We can use df_iterator. > > Modified: > ? ?llvm/trunk/lib/CodeGen/SplitKit.cpp > ? ?llvm/trunk/lib/CodeGen/SplitKit.h > > Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111393&r1=111392&r2=111393&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) > +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 14:00:08 2010 > @@ -17,7 +17,7 @@ > ?#include "VirtRegMap.h" > ?#include "llvm/CodeGen/CalcSpillWeights.h" > ?#include "llvm/CodeGen/LiveIntervalAnalysis.h" > -#include "llvm/CodeGen/MachineFunctionPass.h" > +#include "llvm/CodeGen/MachineDominators.h" > ?#include "llvm/CodeGen/MachineInstrBuilder.h" > ?#include "llvm/CodeGen/MachineLoopInfo.h" > ?#include "llvm/CodeGen/MachineRegisterInfo.h" > @@ -337,6 +337,218 @@ > ?} > > ?//===----------------------------------------------------------------------===// > +// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LiveIntervalMap > +//===----------------------------------------------------------------------===// > + > +// defValue - Introduce a li_ def for ParentVNI that could be later than > +// ParentVNI->def. > +VNInfo *LiveIntervalMap::defValue(const VNInfo *ParentVNI, SlotIndex Idx) { > + ?assert(ParentVNI && "Mapping ?NULL value"); > + ?assert(Idx.isValid() && "Invalid SlotIndex"); > + ?assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); > + > + ?// Is this a simple 1-1 mapping? Not likely. > + ?if (Idx == ParentVNI->def) > + ? ?return mapValue(ParentVNI, Idx); > + > + ?// This is a complex def. Mark with a NULL in valueMap. > + ?VNInfo *OldVNI = > + ? ?valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; This produces an error in visual studio 2010. 1> SplitKit.cpp 1>G:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility(163): error C2440: 'initializing' : cannot convert from 'int' to 'llvm::VNInfo *' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast 1> G:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility(247) : see reference to function template instantiation 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base(_Other1,_Other2 &&)' being compiled 1> with 1> [ 1> _Ty1=const llvm::VNInfo *, 1> _Ty2=llvm::VNInfo *, 1> _Ty=int, 1> _Other1=const llvm::VNInfo *&, 1> _Other2=int 1> ] 1> ..\..\..\..\llvm\lib\CodeGen\SplitKit.cpp(355) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair(_Other1,_Other2 &&)' being compiled 1> with 1> [ 1> _Ty1=const llvm::VNInfo *, 1> _Ty2=llvm::VNInfo *, 1> _Other1=const llvm::VNInfo *&, 1> _Other2=int 1> ] 1>G:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility(163): error C2439: 'std::_Pair_base<_Ty1,_Ty2>::second' : member could not be initialized 1> with 1> [ 1> _Ty1=const llvm::VNInfo *, 1> _Ty2=llvm::VNInfo * 1> ] 1> G:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility(167) : see declaration of 'std::_Pair_base<_Ty1,_Ty2>::second' 1> with 1> [ 1> _Ty1=const llvm::VNInfo *, 1> _Ty2=llvm::VNInfo * 1> ] The problem isn't obvious to me, but I think it's msvc's fault. I'm looking into it, but would appreciate any help. - Michael Spencer > + ?(void)OldVNI; > + ?assert(OldVNI == 0 && "Simple/Complex values mixed"); > + > + ?// Should we insert a minimal snippet of VNI LiveRange, or can we count on > + ?// callers to do that? We need it for lookups of complex values. > + ?VNInfo *VNI = li_.getNextValue(Idx, 0, true, lis_.getVNInfoAllocator()); > + ?return VNI; > +} > + > +// mapValue - Find the mapped value for ParentVNI at Idx. > +// Potentially create phi-def values. > +VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx) { > + ?assert(ParentVNI && "Mapping ?NULL value"); > + ?assert(Idx.isValid() && "Invalid SlotIndex"); > + ?assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); > + > + ?// Use insert for lookup, so we can add missing values with a second lookup. > + ?std::pair InsP = > + ? ?valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); > + > + ?// This was an unknown value. Create a simple mapping. > + ?if (InsP.second) > + ? ?return InsP.first->second = li_.createValueCopy(ParentVNI, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?lis_.getVNInfoAllocator()); > + ?// This was a simple mapped value. > + ?if (InsP.first->second) > + ? ?return InsP.first->second; > + > + ?// This is a complex mapped value. There may be multiple defs, and we may need > + ?// to create phi-defs. > + ?MachineBasicBlock *IdxMBB = lis_.getMBBFromIndex(Idx); > + ?assert(IdxMBB && "No MBB at Idx"); > + > + ?// Is there a def in the same MBB we can extend? > + ?if (VNInfo *VNI = extendTo(IdxMBB, Idx)) > + ? ?return VNI; > + > + ?// Now for the fun part. We know that ParentVNI potentially has multiple defs, > + ?// and we may need to create even more phi-defs to preserve VNInfo SSA form. > + ?// Perform a depth-first search for predecessor blocks where we know the > + ?// dominating VNInfo. Insert phi-def VNInfos along the path back to IdxMBB. > + > + ?// Track MBBs where we have created or learned the dominating value. > + ?// This may change during the DFS as we create new phi-defs. > + ?typedef DenseMap MBBValueMap; > + ?MBBValueMap DomValue; > + > + ?for (idf_iterator > + ? ? ? ? IDFI = idf_begin(IdxMBB), > + ? ? ? ? IDFE = idf_end(IdxMBB); IDFI != IDFE;) { > + ? ?MachineBasicBlock *MBB = *IDFI; > + ? ?SlotIndex End = lis_.getMBBEndIdx(MBB); > + > + ? ?// We are operating on the restricted CFG where ParentVNI is live. > + ? ?if (parentli_.getVNInfoAt(End.getPrevSlot()) != ParentVNI) { > + ? ? ?IDFI.skipChildren(); > + ? ? ?continue; > + ? ?} > + > + ? ?// Do we have a dominating value in this block? > + ? ?VNInfo *VNI = extendTo(MBB, End); > + ? ?if (!VNI) { > + ? ? ?++IDFI; > + ? ? ?continue; > + ? ?} > + > + ? ?// Yes, VNI dominates MBB. Track the path back to IdxMBB, creating phi-defs > + ? ?// as needed along the way. > + ? ?for (unsigned PI = IDFI.getPathLength()-1; PI != 0; --PI) { > + ? ? ?// Start from MBB's immediate successor. > + ? ? ?MachineBasicBlock *Succ = IDFI.getPath(PI-1); > + ? ? ?std::pair InsP = > + ? ? ? ?DomValue.insert(MBBValueMap::value_type(Succ, VNI)); > + ? ? ?SlotIndex Start = lis_.getMBBStartIdx(Succ); > + ? ? ?if (InsP.second) { > + ? ? ? ?// This is the first time we backtrack to Succ. Verify dominance. > + ? ? ? ?if (Succ->pred_size() == 1 || dt_.dominates(MBB, Succ)) > + ? ? ? ? ?continue; > + ? ? ?} else if (InsP.first->second == VNI || > + ? ? ? ? ? ? ? ? InsP.first->second->def == Start) { > + ? ? ? ?// We have previously backtracked VNI to Succ, or Succ already has a > + ? ? ? ?// phi-def. No need to backtrack further. > + ? ? ? ?break; > + ? ? ?} > + ? ? ?// VNI does not dominate Succ, we need a new phi-def. > + ? ? ?VNI = li_.getNextValue(Start, 0, true, lis_.getVNInfoAllocator()); > + ? ? ?VNI->setIsPHIDef(true); > + ? ? ?InsP.first->second = VNI; > + ? ? ?MBB = Succ; > + ? ?} > + > + ? ?// No need to search the children, we found a dominating value. > + ? ?// FIXME: We could prune up to the last phi-def we inserted, need df_iterator > + ? ?// for that. > + ? ?IDFI.skipChildren(); > + ?} > + > + ?// The search should at least find a dominating value for IdxMBB. > + ?assert(!DomValue.empty() && "Couldn't find a reaching definition"); > + > + ?// Since we went through the trouble of a full DFS visiting all reaching defs, > + ?// the values in DomValue are now accurate. No more phi-defs are needed for > + ?// these blocks, so we can color the live ranges. > + ?// This makes the next mapValue call much faster. > + ?VNInfo *IdxVNI = 0; > + ?for (MBBValueMap::iterator I = DomValue.begin(), E = DomValue.end(); I != E; > + ? ? ? ++I) { > + ? ? MachineBasicBlock *MBB = I->first; > + ? ? VNInfo *VNI = I->second; > + ? ? SlotIndex Start = lis_.getMBBStartIdx(MBB); > + ? ? if (MBB == IdxMBB) { > + ? ? ? // Don't add full liveness to IdxMBB, stop at Idx. > + ? ? ? if (Start != Idx) > + ? ? ? ? li_.addRange(LiveRange(Start, Idx, VNI)); > + ? ? ? IdxVNI = VNI; > + ? ? } else > + ? ? ?li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); > + ?} > + > + ?assert(IdxVNI && "Didn't find value for Idx"); > + ?return IdxVNI; > +} > + > +// extendTo - Find the last li_ value defined in MBB at or before Idx. The > +// parentli_ is assumed to be live at Idx. Extend the live range to Idx. > +// Return the found VNInfo, or NULL. > +VNInfo *LiveIntervalMap::extendTo(MachineBasicBlock *MBB, SlotIndex Idx) { > + ?LiveInterval::iterator I = std::upper_bound(li_.begin(), li_.end(), Idx); > + ?if (I == li_.begin()) > + ? ?return 0; > + ?--I; > + ?if (I->start < lis_.getMBBStartIdx(MBB)) > + ? ?return 0; > + ?if (I->end < Idx) > + ? ?I->end = Idx; > + ?return I->valno; > +} > + > +// addSimpleRange - Add a simple range from parentli_ to li_. > +// ParentVNI must be live in the [Start;End) interval. > +void LiveIntervalMap::addSimpleRange(SlotIndex Start, SlotIndex End, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const VNInfo *ParentVNI) { > + ?VNInfo *VNI = mapValue(ParentVNI, Start); > + ?// A simple mappoing is easy. > + ?if (VNI->def == ParentVNI->def) { > + ? ?li_.addRange(LiveRange(Start, End, VNI)); > + ? ?return; > + ?} > + > + ?// ParentVNI is a complex value. We must map per MBB. > + ?MachineFunction::iterator MBB = lis_.getMBBFromIndex(Start); > + ?MachineFunction::iterator MBBE = lis_.getMBBFromIndex(End); > + > + ?if (MBB == MBBE) { > + ? ?li_.addRange(LiveRange(Start, End, VNI)); > + ? ?return; > + ?} > + > + ?// First block. > + ?li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); > + > + ?// Run sequence of full blocks. > + ?for (++MBB; MBB != MBBE; ++MBB) { > + ? ?Start = lis_.getMBBStartIdx(MBB); > + ? ?li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), > + ? ? ? ? ? ? ? ? ? ? ? ? ? mapValue(ParentVNI, Start))); > + ?} > + > + ?// Final block. > + ?Start = lis_.getMBBStartIdx(MBB); > + ?if (Start != End) > + ? ?li_.addRange(LiveRange(Start, End, mapValue(ParentVNI, Start))); > +} > + > +/// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. > +/// All needed values whose def is not inside [Start;End) must be defined > +/// beforehand so mapValue will work. > +void LiveIntervalMap::addRange(SlotIndex Start, SlotIndex End) { > + ?LiveInterval::const_iterator B = parentli_.begin(), E = parentli_.end(); > + ?LiveInterval::const_iterator I = std::lower_bound(B, E, Start); > + > + ?// Check if --I begins before Start and overlaps. > + ?if (I != B) { > + ? ?--I; > + ? ?if (I->end > Start) > + ? ? ?addSimpleRange(Start, std::min(End, I->end), I->valno); > + ? ?++I; > + ?} > + > + ?// The remaining ranges begin after Start. > + ?for (;I != E && I->start < End; ++I) > + ? ?addSimpleRange(I->start, std::min(End, I->end), I->valno); > +} > + > +//===----------------------------------------------------------------------===// > ?// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Split Editor > ?//===----------------------------------------------------------------------===// > > > Modified: llvm/trunk/lib/CodeGen/SplitKit.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=111393&r1=111392&r2=111393&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/SplitKit.h (original) > +++ llvm/trunk/lib/CodeGen/SplitKit.h Wed Aug 18 14:00:08 2010 > @@ -20,6 +20,7 @@ > > ?class LiveInterval; > ?class LiveIntervals; > +class MachineDominatorTree; > ?class MachineInstr; > ?class MachineLoop; > ?class MachineLoopInfo; > @@ -135,6 +136,71 @@ > ? const MachineBasicBlock *getBlockForInsideSplit(); > ?}; > > + > +/// LiveIntervalMap - Map values from a large LiveInterval into a small > +/// interval that is a subset. Insert phi-def values as needed. This class is > +/// used by SplitEditor to create new smaller LiveIntervals. > +/// > +/// parentli_ is the larger interval, li_ is the subset interval. Every value > +/// in li_ corresponds to exactly one value in parentli_, and the live range > +/// of the value is contained within the live range of the parentli_ value. > +/// Values in parentli_ may map to any number of openli_ values, including 0. > +class LiveIntervalMap { > + ?LiveIntervals &lis_; > + ?MachineDominatorTree &dt_; > + > + ?// The parent interval is never changed. > + ?const LiveInterval &parentli_; > + > + ?// The child interval's values are fully contained inside parentli_ values. > + ?LiveInterval &li_; > + > + ?typedef DenseMap ValueMap; > + > + ?// Map parentli_ values to simple values in li_ that are defined at the same > + ?// SlotIndex, or NULL for parentli_ values that have complex li_ defs. > + ?// Note there is a difference between values mapping to NULL (complex), and > + ?// values not present (unknown/unmapped). > + ?ValueMap valueMap_; > + > + ?// extendTo - Find the last li_ value defined in MBB at or before Idx. The > + ?// parentli_ is assumed to be live at Idx. Extend the live range to Idx. > + ?// Return the found VNInfo, or NULL. > + ?VNInfo *extendTo(MachineBasicBlock *MBB, SlotIndex Idx); > + > + ?// addSimpleRange - Add a simple range from parentli_ to li_. > + ?// ParentVNI must be live in the [Start;End) interval. > + ?void addSimpleRange(SlotIndex Start, SlotIndex End, const VNInfo *ParentVNI); > + > +public: > + ?LiveIntervalMap(LiveIntervals &lis, > + ? ? ? ? ? ? ? ? ?MachineDominatorTree &dt, > + ? ? ? ? ? ? ? ? ?const LiveInterval &parentli, > + ? ? ? ? ? ? ? ? ?LiveInterval &li) > + ? ?: lis_(lis), dt_(dt), parentli_(parentli), li_(li) {} > + > + ?/// defValue - define a value in li_ from the parentli_ value VNI and Idx. > + ?/// Idx does not have to be ParentVNI->def, but it must be contained within > + ?/// ParentVNI's live range in parentli_. > + ?/// Return the new li_ value. > + ?VNInfo *defValue(const VNInfo *ParentVNI, SlotIndex Idx); > + > + ?/// mapValue - map ParentVNI to the corresponding li_ value at Idx. It is > + ?/// assumed that ParentVNI is live at Idx. > + ?/// If ParentVNI has not been defined by defValue, it is assumed that > + ?/// ParentVNI->def dominates Idx. > + ?/// If ParentVNI has been defined by defValue one or more times, a value that > + ?/// dominates Idx will be returned. This may require creating extra phi-def > + ?/// values and adding live ranges to li_. > + ?VNInfo *mapValue(const VNInfo *ParentVNI, SlotIndex Idx); > + > + ?/// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. > + ?/// All needed values whose def is not inside [Start;End) must be defined > + ?/// beforehand so mapValue will work. > + ?void addRange(SlotIndex Start, SlotIndex End); > +}; > + > + > ?/// SplitEditor - Edit machine code and LiveIntervals for live range > ?/// splitting. > ?/// > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From echristo at apple.com Thu Aug 19 10:35:27 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 15:35:27 -0000 Subject: [llvm-commits] [llvm] r111518 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20100819153527.732672A6C12C@llvm.org> Author: echristo Date: Thu Aug 19 10:35:27 2010 New Revision: 111518 URL: http://llvm.org/viewvc/llvm-project?rev=111518&view=rev Log: Silence warning. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111518&r1=111517&r2=111518&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Thu Aug 19 10:35:27 2010 @@ -137,7 +137,7 @@ // Do we optionally set a predicate? Preds is size > 0 iff the predicate // defines CPSR. All other OptionalDefines in ARM are the CCR register. - bool CPSR; + bool CPSR = false; if (DefinesOptionalPredicate(MI, &CPSR)) { if (CPSR) AddDefaultT1CC(MIB); From bigcheesegs at gmail.com Thu Aug 19 11:02:11 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Thu, 19 Aug 2010 12:02:11 -0400 Subject: [llvm-commits] [llvm] r111393 - in /llvm/trunk/lib/CodeGen: SplitKit.cpp SplitKit.h In-Reply-To: References: <20100818190008.B00052A6C12D@llvm.org> Message-ID: On Thu, Aug 19, 2010 at 10:10 AM, Michael Spencer wrote: > On Wed, Aug 18, 2010 at 3:00 PM, Jakob Stoklund Olesen wrote: >> Author: stoklund >> Date: Wed Aug 18 14:00:08 2010 >> New Revision: 111393 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111393&view=rev >> Log: >> Add the LiveIntervalMap class. Don't hook it up yet. >> >> LiveIntervalMap maps values from a parent LiveInterval to a child interval that >> is a strict subset. It will create phi-def values as needed to preserve the >> VNInfo SSA form in the child interval. >> >> This leads to an algorithm very similar to the one in SSAUpdaterImpl.h, but with >> enough differences that the code can't be reused: >> >> - We don't need to manipulate PHI instructions. >> - LiveIntervals have kills. >> - We have MachineDominatorTree. >> - We can use df_iterator. >> >> Modified: >> ? ?llvm/trunk/lib/CodeGen/SplitKit.cpp >> ? ?llvm/trunk/lib/CodeGen/SplitKit.h >> >> Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111393&r1=111392&r2=111393&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 14:00:08 2010 >> @@ -17,7 +17,7 @@ >> ?#include "VirtRegMap.h" >> ?#include "llvm/CodeGen/CalcSpillWeights.h" >> ?#include "llvm/CodeGen/LiveIntervalAnalysis.h" >> -#include "llvm/CodeGen/MachineFunctionPass.h" >> +#include "llvm/CodeGen/MachineDominators.h" >> ?#include "llvm/CodeGen/MachineInstrBuilder.h" >> ?#include "llvm/CodeGen/MachineLoopInfo.h" >> ?#include "llvm/CodeGen/MachineRegisterInfo.h" >> @@ -337,6 +337,218 @@ >> ?} >> >> ?//===----------------------------------------------------------------------===// >> +// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? LiveIntervalMap >> +//===----------------------------------------------------------------------===// >> + >> +// defValue - Introduce a li_ def for ParentVNI that could be later than >> +// ParentVNI->def. >> +VNInfo *LiveIntervalMap::defValue(const VNInfo *ParentVNI, SlotIndex Idx) { >> + ?assert(ParentVNI && "Mapping ?NULL value"); >> + ?assert(Idx.isValid() && "Invalid SlotIndex"); >> + ?assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); >> + >> + ?// Is this a simple 1-1 mapping? Not likely. >> + ?if (Idx == ParentVNI->def) >> + ? ?return mapValue(ParentVNI, Idx); >> + >> + ?// This is a complex def. Mark with a NULL in valueMap. >> + ?VNInfo *OldVNI = >> + ? ?valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; > > This produces an error in visual studio 2010. > > 1> ?SplitKit.cpp > 1>G:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\utility(163): error C2440: 'initializing' : cannot > convert from 'int' to 'llvm::VNInfo *' > 1> ? ? ? ? ?Conversion from integral type to pointer type requires > reinterpret_cast, C-style cast or function-style cast > 1> ? ? ? ? ?G:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\utility(247) : see reference to function template > instantiation 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base llvm::VNInfo*&,_Ty>(_Other1,_Other2 &&)' being compiled > 1> ? ? ? ? ?with > 1> ? ? ? ? ?[ > 1> ? ? ? ? ? ? ?_Ty1=const llvm::VNInfo *, > 1> ? ? ? ? ? ? ?_Ty2=llvm::VNInfo *, > 1> ? ? ? ? ? ? ?_Ty=int, > 1> ? ? ? ? ? ? ?_Other1=const llvm::VNInfo *&, > 1> ? ? ? ? ? ? ?_Other2=int > 1> ? ? ? ? ?] > 1> ? ? ? ? ?..\..\..\..\llvm\lib\CodeGen\SplitKit.cpp(355) : see > reference to function template instantiation > 'std::pair<_Ty1,_Ty2>::pair(_Other1,_Other2 > &&)' being compiled > 1> ? ? ? ? ?with > 1> ? ? ? ? ?[ > 1> ? ? ? ? ? ? ?_Ty1=const llvm::VNInfo *, > 1> ? ? ? ? ? ? ?_Ty2=llvm::VNInfo *, > 1> ? ? ? ? ? ? ?_Other1=const llvm::VNInfo *&, > 1> ? ? ? ? ? ? ?_Other2=int > 1> ? ? ? ? ?] > 1>G:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\utility(163): error C2439: > 'std::_Pair_base<_Ty1,_Ty2>::second' : member could not be initialized > 1> ? ? ? ? ?with > 1> ? ? ? ? ?[ > 1> ? ? ? ? ? ? ?_Ty1=const llvm::VNInfo *, > 1> ? ? ? ? ? ? ?_Ty2=llvm::VNInfo * > 1> ? ? ? ? ?] > 1> ? ? ? ? ?G:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\include\utility(167) : see declaration of > 'std::_Pair_base<_Ty1,_Ty2>::second' > 1> ? ? ? ? ?with > 1> ? ? ? ? ?[ > 1> ? ? ? ? ? ? ?_Ty1=const llvm::VNInfo *, > 1> ? ? ? ? ? ? ?_Ty2=llvm::VNInfo * > 1> ? ? ? ? ?] > > The problem isn't obvious to me, but I think it's msvc's fault. I'm > looking into it, but would appreciate any help. > > - Michael Spencer Apparently this is a known problem with msvc 2010 because it implements a buggy version of C++0x. The problem has been fixed in C++0x, but not in msvc yet. The workaround is: @@ -352,7 +352,7 @@ VNInfo *LiveIntervalMap::defValue(const VNInfo *ParentVNI, SlotIndex Idx) { // This is a complex def. Mark with a NULL in valueMap. VNInfo *OldVNI = - valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; + valueMap_.insert(ValueMap::value_type(ParentVNI, static_cast(0))).first->second; (void)OldVNI; assert(OldVNI == 0 && "Simple/Complex values mixed"); @@ -371,7 +371,7 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx) { // Use insert for lookup, so we can add missing values with a second lookup. std::pair InsP = - valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); + valueMap_.insert(ValueMap::value_type(ParentVNI, static_cast(0))); // This was an unknown value. Create a simple mapping. if (InsP.second) With this change all of llvm + clang compiles and works with msvc 2010. Is it ok to commit? - Michael Spencer > >> + ?(void)OldVNI; >> + ?assert(OldVNI == 0 && "Simple/Complex values mixed"); >> + >> + ?// Should we insert a minimal snippet of VNI LiveRange, or can we count on >> + ?// callers to do that? We need it for lookups of complex values. >> + ?VNInfo *VNI = li_.getNextValue(Idx, 0, true, lis_.getVNInfoAllocator()); >> + ?return VNI; >> +} >> + >> +// mapValue - Find the mapped value for ParentVNI at Idx. >> +// Potentially create phi-def values. >> +VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx) { >> + ?assert(ParentVNI && "Mapping ?NULL value"); >> + ?assert(Idx.isValid() && "Invalid SlotIndex"); >> + ?assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); >> + >> + ?// Use insert for lookup, so we can add missing values with a second lookup. >> + ?std::pair InsP = >> + ? ?valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); >> + >> + ?// This was an unknown value. Create a simple mapping. >> + ?if (InsP.second) >> + ? ?return InsP.first->second = li_.createValueCopy(ParentVNI, >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?lis_.getVNInfoAllocator()); >> + ?// This was a simple mapped value. >> + ?if (InsP.first->second) >> + ? ?return InsP.first->second; >> + >> + ?// This is a complex mapped value. There may be multiple defs, and we may need >> + ?// to create phi-defs. >> + ?MachineBasicBlock *IdxMBB = lis_.getMBBFromIndex(Idx); >> + ?assert(IdxMBB && "No MBB at Idx"); >> + >> + ?// Is there a def in the same MBB we can extend? >> + ?if (VNInfo *VNI = extendTo(IdxMBB, Idx)) >> + ? ?return VNI; >> + >> + ?// Now for the fun part. We know that ParentVNI potentially has multiple defs, >> + ?// and we may need to create even more phi-defs to preserve VNInfo SSA form. >> + ?// Perform a depth-first search for predecessor blocks where we know the >> + ?// dominating VNInfo. Insert phi-def VNInfos along the path back to IdxMBB. >> + >> + ?// Track MBBs where we have created or learned the dominating value. >> + ?// This may change during the DFS as we create new phi-defs. >> + ?typedef DenseMap MBBValueMap; >> + ?MBBValueMap DomValue; >> + >> + ?for (idf_iterator >> + ? ? ? ? IDFI = idf_begin(IdxMBB), >> + ? ? ? ? IDFE = idf_end(IdxMBB); IDFI != IDFE;) { >> + ? ?MachineBasicBlock *MBB = *IDFI; >> + ? ?SlotIndex End = lis_.getMBBEndIdx(MBB); >> + >> + ? ?// We are operating on the restricted CFG where ParentVNI is live. >> + ? ?if (parentli_.getVNInfoAt(End.getPrevSlot()) != ParentVNI) { >> + ? ? ?IDFI.skipChildren(); >> + ? ? ?continue; >> + ? ?} >> + >> + ? ?// Do we have a dominating value in this block? >> + ? ?VNInfo *VNI = extendTo(MBB, End); >> + ? ?if (!VNI) { >> + ? ? ?++IDFI; >> + ? ? ?continue; >> + ? ?} >> + >> + ? ?// Yes, VNI dominates MBB. Track the path back to IdxMBB, creating phi-defs >> + ? ?// as needed along the way. >> + ? ?for (unsigned PI = IDFI.getPathLength()-1; PI != 0; --PI) { >> + ? ? ?// Start from MBB's immediate successor. >> + ? ? ?MachineBasicBlock *Succ = IDFI.getPath(PI-1); >> + ? ? ?std::pair InsP = >> + ? ? ? ?DomValue.insert(MBBValueMap::value_type(Succ, VNI)); >> + ? ? ?SlotIndex Start = lis_.getMBBStartIdx(Succ); >> + ? ? ?if (InsP.second) { >> + ? ? ? ?// This is the first time we backtrack to Succ. Verify dominance. >> + ? ? ? ?if (Succ->pred_size() == 1 || dt_.dominates(MBB, Succ)) >> + ? ? ? ? ?continue; >> + ? ? ?} else if (InsP.first->second == VNI || >> + ? ? ? ? ? ? ? ? InsP.first->second->def == Start) { >> + ? ? ? ?// We have previously backtracked VNI to Succ, or Succ already has a >> + ? ? ? ?// phi-def. No need to backtrack further. >> + ? ? ? ?break; >> + ? ? ?} >> + ? ? ?// VNI does not dominate Succ, we need a new phi-def. >> + ? ? ?VNI = li_.getNextValue(Start, 0, true, lis_.getVNInfoAllocator()); >> + ? ? ?VNI->setIsPHIDef(true); >> + ? ? ?InsP.first->second = VNI; >> + ? ? ?MBB = Succ; >> + ? ?} >> + >> + ? ?// No need to search the children, we found a dominating value. >> + ? ?// FIXME: We could prune up to the last phi-def we inserted, need df_iterator >> + ? ?// for that. >> + ? ?IDFI.skipChildren(); >> + ?} >> + >> + ?// The search should at least find a dominating value for IdxMBB. >> + ?assert(!DomValue.empty() && "Couldn't find a reaching definition"); >> + >> + ?// Since we went through the trouble of a full DFS visiting all reaching defs, >> + ?// the values in DomValue are now accurate. No more phi-defs are needed for >> + ?// these blocks, so we can color the live ranges. >> + ?// This makes the next mapValue call much faster. >> + ?VNInfo *IdxVNI = 0; >> + ?for (MBBValueMap::iterator I = DomValue.begin(), E = DomValue.end(); I != E; >> + ? ? ? ++I) { >> + ? ? MachineBasicBlock *MBB = I->first; >> + ? ? VNInfo *VNI = I->second; >> + ? ? SlotIndex Start = lis_.getMBBStartIdx(MBB); >> + ? ? if (MBB == IdxMBB) { >> + ? ? ? // Don't add full liveness to IdxMBB, stop at Idx. >> + ? ? ? if (Start != Idx) >> + ? ? ? ? li_.addRange(LiveRange(Start, Idx, VNI)); >> + ? ? ? IdxVNI = VNI; >> + ? ? } else >> + ? ? ?li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); >> + ?} >> + >> + ?assert(IdxVNI && "Didn't find value for Idx"); >> + ?return IdxVNI; >> +} >> + >> +// extendTo - Find the last li_ value defined in MBB at or before Idx. The >> +// parentli_ is assumed to be live at Idx. Extend the live range to Idx. >> +// Return the found VNInfo, or NULL. >> +VNInfo *LiveIntervalMap::extendTo(MachineBasicBlock *MBB, SlotIndex Idx) { >> + ?LiveInterval::iterator I = std::upper_bound(li_.begin(), li_.end(), Idx); >> + ?if (I == li_.begin()) >> + ? ?return 0; >> + ?--I; >> + ?if (I->start < lis_.getMBBStartIdx(MBB)) >> + ? ?return 0; >> + ?if (I->end < Idx) >> + ? ?I->end = Idx; >> + ?return I->valno; >> +} >> + >> +// addSimpleRange - Add a simple range from parentli_ to li_. >> +// ParentVNI must be live in the [Start;End) interval. >> +void LiveIntervalMap::addSimpleRange(SlotIndex Start, SlotIndex End, >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const VNInfo *ParentVNI) { >> + ?VNInfo *VNI = mapValue(ParentVNI, Start); >> + ?// A simple mappoing is easy. >> + ?if (VNI->def == ParentVNI->def) { >> + ? ?li_.addRange(LiveRange(Start, End, VNI)); >> + ? ?return; >> + ?} >> + >> + ?// ParentVNI is a complex value. We must map per MBB. >> + ?MachineFunction::iterator MBB = lis_.getMBBFromIndex(Start); >> + ?MachineFunction::iterator MBBE = lis_.getMBBFromIndex(End); >> + >> + ?if (MBB == MBBE) { >> + ? ?li_.addRange(LiveRange(Start, End, VNI)); >> + ? ?return; >> + ?} >> + >> + ?// First block. >> + ?li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); >> + >> + ?// Run sequence of full blocks. >> + ?for (++MBB; MBB != MBBE; ++MBB) { >> + ? ?Start = lis_.getMBBStartIdx(MBB); >> + ? ?li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), >> + ? ? ? ? ? ? ? ? ? ? ? ? ? mapValue(ParentVNI, Start))); >> + ?} >> + >> + ?// Final block. >> + ?Start = lis_.getMBBStartIdx(MBB); >> + ?if (Start != End) >> + ? ?li_.addRange(LiveRange(Start, End, mapValue(ParentVNI, Start))); >> +} >> + >> +/// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. >> +/// All needed values whose def is not inside [Start;End) must be defined >> +/// beforehand so mapValue will work. >> +void LiveIntervalMap::addRange(SlotIndex Start, SlotIndex End) { >> + ?LiveInterval::const_iterator B = parentli_.begin(), E = parentli_.end(); >> + ?LiveInterval::const_iterator I = std::lower_bound(B, E, Start); >> + >> + ?// Check if --I begins before Start and overlaps. >> + ?if (I != B) { >> + ? ?--I; >> + ? ?if (I->end > Start) >> + ? ? ?addSimpleRange(Start, std::min(End, I->end), I->valno); >> + ? ?++I; >> + ?} >> + >> + ?// The remaining ranges begin after Start. >> + ?for (;I != E && I->start < End; ++I) >> + ? ?addSimpleRange(I->start, std::min(End, I->end), I->valno); >> +} >> + >> +//===----------------------------------------------------------------------===// >> ?// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Split Editor >> ?//===----------------------------------------------------------------------===// >> >> >> Modified: llvm/trunk/lib/CodeGen/SplitKit.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=111393&r1=111392&r2=111393&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/SplitKit.h (original) >> +++ llvm/trunk/lib/CodeGen/SplitKit.h Wed Aug 18 14:00:08 2010 >> @@ -20,6 +20,7 @@ >> >> ?class LiveInterval; >> ?class LiveIntervals; >> +class MachineDominatorTree; >> ?class MachineInstr; >> ?class MachineLoop; >> ?class MachineLoopInfo; >> @@ -135,6 +136,71 @@ >> ? const MachineBasicBlock *getBlockForInsideSplit(); >> ?}; >> >> + >> +/// LiveIntervalMap - Map values from a large LiveInterval into a small >> +/// interval that is a subset. Insert phi-def values as needed. This class is >> +/// used by SplitEditor to create new smaller LiveIntervals. >> +/// >> +/// parentli_ is the larger interval, li_ is the subset interval. Every value >> +/// in li_ corresponds to exactly one value in parentli_, and the live range >> +/// of the value is contained within the live range of the parentli_ value. >> +/// Values in parentli_ may map to any number of openli_ values, including 0. >> +class LiveIntervalMap { >> + ?LiveIntervals &lis_; >> + ?MachineDominatorTree &dt_; >> + >> + ?// The parent interval is never changed. >> + ?const LiveInterval &parentli_; >> + >> + ?// The child interval's values are fully contained inside parentli_ values. >> + ?LiveInterval &li_; >> + >> + ?typedef DenseMap ValueMap; >> + >> + ?// Map parentli_ values to simple values in li_ that are defined at the same >> + ?// SlotIndex, or NULL for parentli_ values that have complex li_ defs. >> + ?// Note there is a difference between values mapping to NULL (complex), and >> + ?// values not present (unknown/unmapped). >> + ?ValueMap valueMap_; >> + >> + ?// extendTo - Find the last li_ value defined in MBB at or before Idx. The >> + ?// parentli_ is assumed to be live at Idx. Extend the live range to Idx. >> + ?// Return the found VNInfo, or NULL. >> + ?VNInfo *extendTo(MachineBasicBlock *MBB, SlotIndex Idx); >> + >> + ?// addSimpleRange - Add a simple range from parentli_ to li_. >> + ?// ParentVNI must be live in the [Start;End) interval. >> + ?void addSimpleRange(SlotIndex Start, SlotIndex End, const VNInfo *ParentVNI); >> + >> +public: >> + ?LiveIntervalMap(LiveIntervals &lis, >> + ? ? ? ? ? ? ? ? ?MachineDominatorTree &dt, >> + ? ? ? ? ? ? ? ? ?const LiveInterval &parentli, >> + ? ? ? ? ? ? ? ? ?LiveInterval &li) >> + ? ?: lis_(lis), dt_(dt), parentli_(parentli), li_(li) {} >> + >> + ?/// defValue - define a value in li_ from the parentli_ value VNI and Idx. >> + ?/// Idx does not have to be ParentVNI->def, but it must be contained within >> + ?/// ParentVNI's live range in parentli_. >> + ?/// Return the new li_ value. >> + ?VNInfo *defValue(const VNInfo *ParentVNI, SlotIndex Idx); >> + >> + ?/// mapValue - map ParentVNI to the corresponding li_ value at Idx. It is >> + ?/// assumed that ParentVNI is live at Idx. >> + ?/// If ParentVNI has not been defined by defValue, it is assumed that >> + ?/// ParentVNI->def dominates Idx. >> + ?/// If ParentVNI has been defined by defValue one or more times, a value that >> + ?/// dominates Idx will be returned. This may require creating extra phi-def >> + ?/// values and adding live ranges to li_. >> + ?VNInfo *mapValue(const VNInfo *ParentVNI, SlotIndex Idx); >> + >> + ?/// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. >> + ?/// All needed values whose def is not inside [Start;End) must be defined >> + ?/// beforehand so mapValue will work. >> + ?void addRange(SlotIndex Start, SlotIndex End); >> +}; >> + >> + >> ?/// SplitEditor - Edit machine code and LiveIntervals for live range >> ?/// splitting. >> ?/// >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > From bob.wilson at apple.com Thu Aug 19 11:15:05 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 19 Aug 2010 09:15:05 -0700 Subject: [llvm-commits] [llvm] r111393 - in /llvm/trunk/lib/CodeGen: SplitKit.cpp SplitKit.h In-Reply-To: References: <20100818190008.B00052A6C12D@llvm.org> Message-ID: <0502BB1A-63A7-478A-AC7D-B018A9A4837E@apple.com> Yes, please commit that change. (Jakob is on vacation.) On Aug 19, 2010, at 9:02 AM, Michael Spencer wrote: > On Thu, Aug 19, 2010 at 10:10 AM, Michael Spencer wrote: >> On Wed, Aug 18, 2010 at 3:00 PM, Jakob Stoklund Olesen wrote: >>> Author: stoklund >>> Date: Wed Aug 18 14:00:08 2010 >>> New Revision: 111393 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=111393&view=rev >>> Log: >>> Add the LiveIntervalMap class. Don't hook it up yet. >>> >>> LiveIntervalMap maps values from a parent LiveInterval to a child interval that >>> is a strict subset. It will create phi-def values as needed to preserve the >>> VNInfo SSA form in the child interval. >>> >>> This leads to an algorithm very similar to the one in SSAUpdaterImpl.h, but with >>> enough differences that the code can't be reused: >>> >>> - We don't need to manipulate PHI instructions. >>> - LiveIntervals have kills. >>> - We have MachineDominatorTree. >>> - We can use df_iterator. >>> >>> Modified: >>> llvm/trunk/lib/CodeGen/SplitKit.cpp >>> llvm/trunk/lib/CodeGen/SplitKit.h >>> >>> Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111393&r1=111392&r2=111393&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) >>> +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 18 14:00:08 2010 >>> @@ -17,7 +17,7 @@ >>> #include "VirtRegMap.h" >>> #include "llvm/CodeGen/CalcSpillWeights.h" >>> #include "llvm/CodeGen/LiveIntervalAnalysis.h" >>> -#include "llvm/CodeGen/MachineFunctionPass.h" >>> +#include "llvm/CodeGen/MachineDominators.h" >>> #include "llvm/CodeGen/MachineInstrBuilder.h" >>> #include "llvm/CodeGen/MachineLoopInfo.h" >>> #include "llvm/CodeGen/MachineRegisterInfo.h" >>> @@ -337,6 +337,218 @@ >>> } >>> >>> //===----------------------------------------------------------------------===// >>> +// LiveIntervalMap >>> +//===----------------------------------------------------------------------===// >>> + >>> +// defValue - Introduce a li_ def for ParentVNI that could be later than >>> +// ParentVNI->def. >>> +VNInfo *LiveIntervalMap::defValue(const VNInfo *ParentVNI, SlotIndex Idx) { >>> + assert(ParentVNI && "Mapping NULL value"); >>> + assert(Idx.isValid() && "Invalid SlotIndex"); >>> + assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); >>> + >>> + // Is this a simple 1-1 mapping? Not likely. >>> + if (Idx == ParentVNI->def) >>> + return mapValue(ParentVNI, Idx); >>> + >>> + // This is a complex def. Mark with a NULL in valueMap. >>> + VNInfo *OldVNI = >>> + valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; >> >> This produces an error in visual studio 2010. >> >> 1> SplitKit.cpp >> 1>G:\Program Files (x86)\Microsoft Visual Studio >> 10.0\VC\include\utility(163): error C2440: 'initializing' : cannot >> convert from 'int' to 'llvm::VNInfo *' >> 1> Conversion from integral type to pointer type requires >> reinterpret_cast, C-style cast or function-style cast >> 1> G:\Program Files (x86)\Microsoft Visual Studio >> 10.0\VC\include\utility(247) : see reference to function template >> instantiation 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base> llvm::VNInfo*&,_Ty>(_Other1,_Other2 &&)' being compiled >> 1> with >> 1> [ >> 1> _Ty1=const llvm::VNInfo *, >> 1> _Ty2=llvm::VNInfo *, >> 1> _Ty=int, >> 1> _Other1=const llvm::VNInfo *&, >> 1> _Other2=int >> 1> ] >> 1> ..\..\..\..\llvm\lib\CodeGen\SplitKit.cpp(355) : see >> reference to function template instantiation >> 'std::pair<_Ty1,_Ty2>::pair(_Other1,_Other2 >> &&)' being compiled >> 1> with >> 1> [ >> 1> _Ty1=const llvm::VNInfo *, >> 1> _Ty2=llvm::VNInfo *, >> 1> _Other1=const llvm::VNInfo *&, >> 1> _Other2=int >> 1> ] >> 1>G:\Program Files (x86)\Microsoft Visual Studio >> 10.0\VC\include\utility(163): error C2439: >> 'std::_Pair_base<_Ty1,_Ty2>::second' : member could not be initialized >> 1> with >> 1> [ >> 1> _Ty1=const llvm::VNInfo *, >> 1> _Ty2=llvm::VNInfo * >> 1> ] >> 1> G:\Program Files (x86)\Microsoft Visual Studio >> 10.0\VC\include\utility(167) : see declaration of >> 'std::_Pair_base<_Ty1,_Ty2>::second' >> 1> with >> 1> [ >> 1> _Ty1=const llvm::VNInfo *, >> 1> _Ty2=llvm::VNInfo * >> 1> ] >> >> The problem isn't obvious to me, but I think it's msvc's fault. I'm >> looking into it, but would appreciate any help. >> >> - Michael Spencer > > Apparently this is a known problem with msvc 2010 because it > implements a buggy version of C++0x. The problem has been fixed in > C++0x, but not in msvc yet. > > The workaround is: > > @@ -352,7 +352,7 @@ VNInfo *LiveIntervalMap::defValue(const VNInfo > *ParentVNI, SlotIndex Idx) { > > // This is a complex def. Mark with a NULL in valueMap. > VNInfo *OldVNI = > - valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; > + valueMap_.insert(ValueMap::value_type(ParentVNI, > static_cast(0))).first->second; > (void)OldVNI; > assert(OldVNI == 0 && "Simple/Complex values mixed"); > > @@ -371,7 +371,7 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo > *ParentVNI, SlotIndex Idx) { > > // Use insert for lookup, so we can add missing values with a second lookup. > std::pair InsP = > - valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); > + valueMap_.insert(ValueMap::value_type(ParentVNI, > static_cast(0))); > > // This was an unknown value. Create a simple mapping. > if (InsP.second) > > With this change all of llvm + clang compiles and works with msvc > 2010. Is it ok to commit? > > - Michael Spencer > >> >>> + (void)OldVNI; >>> + assert(OldVNI == 0 && "Simple/Complex values mixed"); >>> + >>> + // Should we insert a minimal snippet of VNI LiveRange, or can we count on >>> + // callers to do that? We need it for lookups of complex values. >>> + VNInfo *VNI = li_.getNextValue(Idx, 0, true, lis_.getVNInfoAllocator()); >>> + return VNI; >>> +} >>> + >>> +// mapValue - Find the mapped value for ParentVNI at Idx. >>> +// Potentially create phi-def values. >>> +VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx) { >>> + assert(ParentVNI && "Mapping NULL value"); >>> + assert(Idx.isValid() && "Invalid SlotIndex"); >>> + assert(parentli_.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI"); >>> + >>> + // Use insert for lookup, so we can add missing values with a second lookup. >>> + std::pair InsP = >>> + valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); >>> + >>> + // This was an unknown value. Create a simple mapping. >>> + if (InsP.second) >>> + return InsP.first->second = li_.createValueCopy(ParentVNI, >>> + lis_.getVNInfoAllocator()); >>> + // This was a simple mapped value. >>> + if (InsP.first->second) >>> + return InsP.first->second; >>> + >>> + // This is a complex mapped value. There may be multiple defs, and we may need >>> + // to create phi-defs. >>> + MachineBasicBlock *IdxMBB = lis_.getMBBFromIndex(Idx); >>> + assert(IdxMBB && "No MBB at Idx"); >>> + >>> + // Is there a def in the same MBB we can extend? >>> + if (VNInfo *VNI = extendTo(IdxMBB, Idx)) >>> + return VNI; >>> + >>> + // Now for the fun part. We know that ParentVNI potentially has multiple defs, >>> + // and we may need to create even more phi-defs to preserve VNInfo SSA form. >>> + // Perform a depth-first search for predecessor blocks where we know the >>> + // dominating VNInfo. Insert phi-def VNInfos along the path back to IdxMBB. >>> + >>> + // Track MBBs where we have created or learned the dominating value. >>> + // This may change during the DFS as we create new phi-defs. >>> + typedef DenseMap MBBValueMap; >>> + MBBValueMap DomValue; >>> + >>> + for (idf_iterator >>> + IDFI = idf_begin(IdxMBB), >>> + IDFE = idf_end(IdxMBB); IDFI != IDFE;) { >>> + MachineBasicBlock *MBB = *IDFI; >>> + SlotIndex End = lis_.getMBBEndIdx(MBB); >>> + >>> + // We are operating on the restricted CFG where ParentVNI is live. >>> + if (parentli_.getVNInfoAt(End.getPrevSlot()) != ParentVNI) { >>> + IDFI.skipChildren(); >>> + continue; >>> + } >>> + >>> + // Do we have a dominating value in this block? >>> + VNInfo *VNI = extendTo(MBB, End); >>> + if (!VNI) { >>> + ++IDFI; >>> + continue; >>> + } >>> + >>> + // Yes, VNI dominates MBB. Track the path back to IdxMBB, creating phi-defs >>> + // as needed along the way. >>> + for (unsigned PI = IDFI.getPathLength()-1; PI != 0; --PI) { >>> + // Start from MBB's immediate successor. >>> + MachineBasicBlock *Succ = IDFI.getPath(PI-1); >>> + std::pair InsP = >>> + DomValue.insert(MBBValueMap::value_type(Succ, VNI)); >>> + SlotIndex Start = lis_.getMBBStartIdx(Succ); >>> + if (InsP.second) { >>> + // This is the first time we backtrack to Succ. Verify dominance. >>> + if (Succ->pred_size() == 1 || dt_.dominates(MBB, Succ)) >>> + continue; >>> + } else if (InsP.first->second == VNI || >>> + InsP.first->second->def == Start) { >>> + // We have previously backtracked VNI to Succ, or Succ already has a >>> + // phi-def. No need to backtrack further. >>> + break; >>> + } >>> + // VNI does not dominate Succ, we need a new phi-def. >>> + VNI = li_.getNextValue(Start, 0, true, lis_.getVNInfoAllocator()); >>> + VNI->setIsPHIDef(true); >>> + InsP.first->second = VNI; >>> + MBB = Succ; >>> + } >>> + >>> + // No need to search the children, we found a dominating value. >>> + // FIXME: We could prune up to the last phi-def we inserted, need df_iterator >>> + // for that. >>> + IDFI.skipChildren(); >>> + } >>> + >>> + // The search should at least find a dominating value for IdxMBB. >>> + assert(!DomValue.empty() && "Couldn't find a reaching definition"); >>> + >>> + // Since we went through the trouble of a full DFS visiting all reaching defs, >>> + // the values in DomValue are now accurate. No more phi-defs are needed for >>> + // these blocks, so we can color the live ranges. >>> + // This makes the next mapValue call much faster. >>> + VNInfo *IdxVNI = 0; >>> + for (MBBValueMap::iterator I = DomValue.begin(), E = DomValue.end(); I != E; >>> + ++I) { >>> + MachineBasicBlock *MBB = I->first; >>> + VNInfo *VNI = I->second; >>> + SlotIndex Start = lis_.getMBBStartIdx(MBB); >>> + if (MBB == IdxMBB) { >>> + // Don't add full liveness to IdxMBB, stop at Idx. >>> + if (Start != Idx) >>> + li_.addRange(LiveRange(Start, Idx, VNI)); >>> + IdxVNI = VNI; >>> + } else >>> + li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); >>> + } >>> + >>> + assert(IdxVNI && "Didn't find value for Idx"); >>> + return IdxVNI; >>> +} >>> + >>> +// extendTo - Find the last li_ value defined in MBB at or before Idx. The >>> +// parentli_ is assumed to be live at Idx. Extend the live range to Idx. >>> +// Return the found VNInfo, or NULL. >>> +VNInfo *LiveIntervalMap::extendTo(MachineBasicBlock *MBB, SlotIndex Idx) { >>> + LiveInterval::iterator I = std::upper_bound(li_.begin(), li_.end(), Idx); >>> + if (I == li_.begin()) >>> + return 0; >>> + --I; >>> + if (I->start < lis_.getMBBStartIdx(MBB)) >>> + return 0; >>> + if (I->end < Idx) >>> + I->end = Idx; >>> + return I->valno; >>> +} >>> + >>> +// addSimpleRange - Add a simple range from parentli_ to li_. >>> +// ParentVNI must be live in the [Start;End) interval. >>> +void LiveIntervalMap::addSimpleRange(SlotIndex Start, SlotIndex End, >>> + const VNInfo *ParentVNI) { >>> + VNInfo *VNI = mapValue(ParentVNI, Start); >>> + // A simple mappoing is easy. >>> + if (VNI->def == ParentVNI->def) { >>> + li_.addRange(LiveRange(Start, End, VNI)); >>> + return; >>> + } >>> + >>> + // ParentVNI is a complex value. We must map per MBB. >>> + MachineFunction::iterator MBB = lis_.getMBBFromIndex(Start); >>> + MachineFunction::iterator MBBE = lis_.getMBBFromIndex(End); >>> + >>> + if (MBB == MBBE) { >>> + li_.addRange(LiveRange(Start, End, VNI)); >>> + return; >>> + } >>> + >>> + // First block. >>> + li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), VNI)); >>> + >>> + // Run sequence of full blocks. >>> + for (++MBB; MBB != MBBE; ++MBB) { >>> + Start = lis_.getMBBStartIdx(MBB); >>> + li_.addRange(LiveRange(Start, lis_.getMBBEndIdx(MBB), >>> + mapValue(ParentVNI, Start))); >>> + } >>> + >>> + // Final block. >>> + Start = lis_.getMBBStartIdx(MBB); >>> + if (Start != End) >>> + li_.addRange(LiveRange(Start, End, mapValue(ParentVNI, Start))); >>> +} >>> + >>> +/// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. >>> +/// All needed values whose def is not inside [Start;End) must be defined >>> +/// beforehand so mapValue will work. >>> +void LiveIntervalMap::addRange(SlotIndex Start, SlotIndex End) { >>> + LiveInterval::const_iterator B = parentli_.begin(), E = parentli_.end(); >>> + LiveInterval::const_iterator I = std::lower_bound(B, E, Start); >>> + >>> + // Check if --I begins before Start and overlaps. >>> + if (I != B) { >>> + --I; >>> + if (I->end > Start) >>> + addSimpleRange(Start, std::min(End, I->end), I->valno); >>> + ++I; >>> + } >>> + >>> + // The remaining ranges begin after Start. >>> + for (;I != E && I->start < End; ++I) >>> + addSimpleRange(I->start, std::min(End, I->end), I->valno); >>> +} >>> + >>> +//===----------------------------------------------------------------------===// >>> // Split Editor >>> //===----------------------------------------------------------------------===// >>> >>> >>> Modified: llvm/trunk/lib/CodeGen/SplitKit.h >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=111393&r1=111392&r2=111393&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/CodeGen/SplitKit.h (original) >>> +++ llvm/trunk/lib/CodeGen/SplitKit.h Wed Aug 18 14:00:08 2010 >>> @@ -20,6 +20,7 @@ >>> >>> class LiveInterval; >>> class LiveIntervals; >>> +class MachineDominatorTree; >>> class MachineInstr; >>> class MachineLoop; >>> class MachineLoopInfo; >>> @@ -135,6 +136,71 @@ >>> const MachineBasicBlock *getBlockForInsideSplit(); >>> }; >>> >>> + >>> +/// LiveIntervalMap - Map values from a large LiveInterval into a small >>> +/// interval that is a subset. Insert phi-def values as needed. This class is >>> +/// used by SplitEditor to create new smaller LiveIntervals. >>> +/// >>> +/// parentli_ is the larger interval, li_ is the subset interval. Every value >>> +/// in li_ corresponds to exactly one value in parentli_, and the live range >>> +/// of the value is contained within the live range of the parentli_ value. >>> +/// Values in parentli_ may map to any number of openli_ values, including 0. >>> +class LiveIntervalMap { >>> + LiveIntervals &lis_; >>> + MachineDominatorTree &dt_; >>> + >>> + // The parent interval is never changed. >>> + const LiveInterval &parentli_; >>> + >>> + // The child interval's values are fully contained inside parentli_ values. >>> + LiveInterval &li_; >>> + >>> + typedef DenseMap ValueMap; >>> + >>> + // Map parentli_ values to simple values in li_ that are defined at the same >>> + // SlotIndex, or NULL for parentli_ values that have complex li_ defs. >>> + // Note there is a difference between values mapping to NULL (complex), and >>> + // values not present (unknown/unmapped). >>> + ValueMap valueMap_; >>> + >>> + // extendTo - Find the last li_ value defined in MBB at or before Idx. The >>> + // parentli_ is assumed to be live at Idx. Extend the live range to Idx. >>> + // Return the found VNInfo, or NULL. >>> + VNInfo *extendTo(MachineBasicBlock *MBB, SlotIndex Idx); >>> + >>> + // addSimpleRange - Add a simple range from parentli_ to li_. >>> + // ParentVNI must be live in the [Start;End) interval. >>> + void addSimpleRange(SlotIndex Start, SlotIndex End, const VNInfo *ParentVNI); >>> + >>> +public: >>> + LiveIntervalMap(LiveIntervals &lis, >>> + MachineDominatorTree &dt, >>> + const LiveInterval &parentli, >>> + LiveInterval &li) >>> + : lis_(lis), dt_(dt), parentli_(parentli), li_(li) {} >>> + >>> + /// defValue - define a value in li_ from the parentli_ value VNI and Idx. >>> + /// Idx does not have to be ParentVNI->def, but it must be contained within >>> + /// ParentVNI's live range in parentli_. >>> + /// Return the new li_ value. >>> + VNInfo *defValue(const VNInfo *ParentVNI, SlotIndex Idx); >>> + >>> + /// mapValue - map ParentVNI to the corresponding li_ value at Idx. It is >>> + /// assumed that ParentVNI is live at Idx. >>> + /// If ParentVNI has not been defined by defValue, it is assumed that >>> + /// ParentVNI->def dominates Idx. >>> + /// If ParentVNI has been defined by defValue one or more times, a value that >>> + /// dominates Idx will be returned. This may require creating extra phi-def >>> + /// values and adding live ranges to li_. >>> + VNInfo *mapValue(const VNInfo *ParentVNI, SlotIndex Idx); >>> + >>> + /// addRange - Add live ranges to li_ where [Start;End) intersects parentli_. >>> + /// All needed values whose def is not inside [Start;End) must be defined >>> + /// beforehand so mapValue will work. >>> + void addRange(SlotIndex Start, SlotIndex End); >>> +}; >>> + >>> + >>> /// SplitEditor - Edit machine code and LiveIntervals for live range >>> /// splitting. >>> /// >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From daniel at zuster.org Thu Aug 19 11:22:09 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 16:22:09 -0000 Subject: [llvm-commits] [test-suite] r111521 - in /test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram: anagram.c anagram.reference_output Message-ID: <20100819162209.1D0752A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 19 11:22:08 2010 New Revision: 111521 URL: http://llvm.org/viewvc/llvm-project?rev=111521&view=rev Log: Revert r111501, "Change qsort compare function to be total, to make sort stable.", this didn't solve the problem, and broke the test on Leopard. Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c?rev=111521&r1=111520&r2=111521&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.c Thu Aug 19 11:22:08 2010 @@ -578,15 +578,10 @@ } int Cdecl CompareFrequency(char *pch1, char *pch2) { - if (auGlobalFrequency[*pch1] < auGlobalFrequency[*pch2]) - return -1; - if (auGlobalFrequency[*pch1] > auGlobalFrequency[*pch2]) - return 1; - if (*pch1 < *pch2) - return -1; - if (*pch1 > *pch2) - return -1; - return 0; + return auGlobalFrequency[*pch1] < auGlobalFrequency[*pch2] + ? -1 : + auGlobalFrequency[*pch1] == auGlobalFrequency[*pch2] + ? 0 : 1; } void SortCandidates(void) { Modified: test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output?rev=111521&r1=111520&r2=111521&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output (original) +++ test-suite/trunk/MultiSource/Benchmarks/Ptrdist/anagram/anagram.reference_output Thu Aug 19 11:22:08 2010 @@ -2,2728 +2,2728 @@ 3048 bytes wasted warning: this program uses gets(), which is unsafe. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz situ dot Dan du no ti ad 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud Ito at 2nd nut ado ti SD du ton it'd a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us to did Nat tun to did sa dun to Ida St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's odd Titan du into ad 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Sutton I'd ad oust it'd DNA du o's IT&T Dan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA Ott I'd 2nd nu sod ti tad dud on i's tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do tid tan UN o's IT&T dad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taut no I'd SD out tid a's ND du ado stint 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud tao dint nu dot it sad du son IT&T ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us Ott Ida 2nd tuna do ti d's dun tao I'd St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sou I'd tat 2nd du do sit Nat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz suit don tad nut Io add 1st du dot sin at 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us don IT&T ad tout I'd an d's dud so IT&T an 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's no IT&T add UN tot did sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau dot i's ND out I'd and St du to it sa ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud ton Ida nu oat tid d's dud no tit sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz aunt DOD sit UN toad ti d's dust Toni ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz situ DOD Nat du no ti at SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud Io tat 2nd nut ado I'd t's du ton Ida St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us not it dad tun to Ida d's dun to Ida 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's odd it Nat Dutton is ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau ton I'd d's oust nit dad du o's nit tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA to it'd ND nu sod IT&T ad dud on tit a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do ti at ND UN odd is AT&T 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taut Io 2nd d's out tid an d's du ado tin St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud ton I'd at nu dot aid St. du soda tint 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us Ott aid 2nd tuna Dido 1st dun tao I'd t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sou tint add du do ti an St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz suit DOD Nat nut Io dad St. du dot tin as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us DOD it tan tout I'd a's 2nd dud so in tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's no tit dad UN tot I'd sad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau dot is 2nd out I'd Nat d's du to it as ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud on ti ad nu to it'd sad dud no IT&T sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz aunt do ti d's UN Ito tad d's dust on it ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz situ do at 2nd du no tit sad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud into tad nut tao I'd d's du ton Ida 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us not it'd ad tun to is dad dun ado ti St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's odd ti Nat Dutton I'd a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau sod it 2nd oust din tad du o's din AT&T 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA to tid 2nd nu so tit dad dud on IT&T a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do it'd tan UN odd i's tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taut DOD sin out tid as ND du not is tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud Ott I'd an nu dot aid St du sod it ant 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us Ott I'd DNA tuna Dido t's dun ditto a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sou IT&T ad 2nd du do ti at n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA ton it'd nut Dido sat du don it sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us DOD ti tan tout I'd as ND dud so taint 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's toad it 2nd UN tot i's dad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau dot I'd n's out in tad d's du to sit DNA 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud oat din nu to ti ad d's dud NATO sit 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz aunt do I'd St UN Ito dad t's dust Odin at 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz unit Todd a's du toad ti n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud dot anti nut soda it'd du tao tid n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us nod tid at tun ado ti SD dun ado it t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's odd nit at Dutton said 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau so tid 2nd oust tin dad du on tid sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA dot it 2nd nu so did tat dud on is tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do dint at UN odd tit a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taut do is ND out it dad n's du not Ida St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud on ti tad nu dot Ida 1st du sod ti Nat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us on tid tad tun DOD i's at dun dot ti a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's tao tid 2nd du do IT&T San 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA Ott din nut dot I'd as du don ITT a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us DOD ITT an tout I'd ad n's dud ton it as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's toad ti ND UN toast did 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau don I'd 1st out in dad St du to ti sand 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud not aid nu to I'd ad 1st dud Ito an St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz aunt Dido St. UN Ito add St dust to in ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz unit odd sat du toad in 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud don ti at nut sod ti ad du tao it'd n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us nod it'd at tun ado I'd t's dun ado it St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's odd IT&T an UN DOD it sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau so it'd ND oust tid Dan du on it ad St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA don't it'd nu so IT&T add dud oat isn't 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do din AT&T UN odd ITT a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taut do in d's out it DNA SD du not tid sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud on IT&T ad nu dot is tad du sod IT&T an 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us on ITT dad tun DOD it a's dun dot it a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's tao it'd ND du do ain't 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA to it ND nut dot said du don i's tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us DOD tit an tout Dis Dan dud ton ti a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's Ito tad 2nd UN Todd it a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau don it d's out in add 1st du to ti a's 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud no it ad nu to I'd at SD dud Ito at n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz aunt Dido t's UN do Dis tat dust not Ida 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz unit toad SD du toad isn't 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud do ti Nat nut so tid ad du tao nit d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us nod ITT ad tun toad Dis dun Ito at SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's oat tid ND UN DOD i's AT&T 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau o's tid 2nd oust it ad ND du on it at SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA do I'd TNT nu Ott i's dad dud oat NTIS 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do ITT and UN odd IT&T a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Titus on dad out it and d's du not aid t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud on I'd tat nu dot tid sa du sod in tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us on tit add tun DOD ti a's dun dot i's at 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's ton it dad du do anti St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA not it'd nut DOD ti a's du don tit a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us DOD in AT&T tout is ad 2nd dud tao isn't 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's dot tid an UN Todd ti as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau don ti SD out it'd as ND du to ti sa 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud NATO I'd nu to Dis tad dud ion at St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz audit not SD UN do I'd at St. dust no it ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz unit DOD sat du NATO I'd 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud do it ant nut so it'd ad du tao din St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us no tid tad tun do tid a's dun Ito ad t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's oat it'd 2nd UN DOD tit sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau o's didn't out Dis at 2nd du on ti ad t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA do IT&T ND nu Ott I'd sad dud oat in St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do tint ad UN oat did St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Titus nod ad Saud ton tid du not aid St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud Odin AT&T nu DOD i's tat du sod taint 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us on did AT&T tun tao I'd SD dun Ott said 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's ton ti add du do in at St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA nod IT&T nut DOD i's at du don IT&T a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do tid tan tout in ad SD dud tao NTIS 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's dot it and UN sod I'd AT&T 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau DOD in 1st out it'd sa 2nd du to ti as 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud Ito DNA nu ado tit SD dud Io a's TNT 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz audit nod 1st UN do tid sat dust NATO I'd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz unit do ad St. du NATO it d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud do IT&T an nut Otis dad du Taoist ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us no ITT add tun do sit ad dun do IT&T sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to tid DNA UN DOD ITT sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau on it'd SD out Ida 2nd St du on ti ad St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA do tit 2nd nu Ott did sa dud to stain 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do IT&T Dan UN oat did St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Titus don ad Saud to dint du not i's tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud oat ti ND nu DOD is AT&T du so tid Nat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us odd it tan tun sod it ad dun Ott I'd sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's ton did at du do in at t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA dot tin nut DOD it as du don is tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do it at ND tout sin add dud tao in t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's dot ti and UN sod it tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau DOD ti n's out it'd an d's du to ain't d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud ion tad nu ado it'd St dud Io Nat St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz audit dot n's UN do it ad 1st dust Ito Dan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz unit do ad t's du don't is at 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud do Titan nut o's it dad du Taos it ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us no tit dad tun do it'd sa dun do tit sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to it ad 2nd UN DOD IT&T sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau on did St out Ida ND St. du on it'd sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USA Dido TNT nu Ott Ida d's dud to sit an 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's do tit Dan UN oat it'd d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Titus do Dan Saud to it ND du not it'd a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud oat dint nu DOD ITT as du so it at ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us odd ti tan tun so tid ad dun Otis tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's tot Ida ND du do tin sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA don ITT nut do Ida St du Ott i's Dan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do it'd ant nu tao tid d's dud Taos nit 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's dot nit ad UN sod tit ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau do din St. out it'd ad n's du to I'd an St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud into ad nu ado ITT d's dud Io tan 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz audit don t's UN do it at SD dust do ain't 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz daunt so tid du don't it a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud do nit at nut o's I'd tad du Taos dint 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us no did AT&T tun do it sad dun do it sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to it'd and UN dot is tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau odd isn't out Ida ND t's du on I'd at St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sound I'd tat nu Ott is dad dud to i's ant 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's ditto DNA UN to did sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Titus ado ND Saud not tid du nod is AT&T 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud to ti DNA nu DOD IT&T as du so ITT DNA 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us odd nit at tun so it add dun o's ti tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's tot aid ND du do tint sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USDA do tint nut do Ida St. du Ott ani d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do nit tad nu tao it'd SD dud Santo ti 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's dot I'd ant UN so did tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau do din t's out dint sad du to I'd at n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud do ti an nu ado tid 1st dud Io tan t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz audio SD TNT UN do ti ad St dust iota ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz daunt o's it'd du don't ti as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud ado tint nut o's ti dad du Sao tit ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us toad ti ND tun do aid t's dun do ITT sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to nit add UN dot Ida St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau odd in St. out did an 1st du on I'd at 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sound ti tad nu o's tit dad dud to ani t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's ado ITT 2nd UN to I'd ad t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USN to I'd tad Saud nod tit du nod sit at 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud to it DNA nu DOD tit as du so ti at 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us odd IT&T an tun so I'd tad dun o's it'd at 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's tot I'd and du do sin tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sun odd it at nut do aid 1st du Ott in sad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do din AT&T nu tao did St. dud Ott Sian 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's don't it ad UN so it'd tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau do tin d's out din ad St. du to anti d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stud do in at nu ado tid t's dud Io ant St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us tao it'd 2nd UN do ti at d's dust Io at 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz daunt Ito d's du Ito tan d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Sudan to it'd nut odd it sa du Sao IT&T 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us Ito tad 2nd tun do aid 1st dun do i's tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to din tad UN dot tid a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau odd it n's out did an St. du oint ad St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sound ITT ad nu o's did tat dud to ani St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's ado tit ND UN to I'd ad 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USN to did at Saud don't ti du nod ITT a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud to I'd tan nu do it'd sat du so it'd tan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us odd Titan tun Otis add dun o's I'd tat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's Todd in at du iota 2nd St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sun to I'd tad nut do it'd as du Ott din as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do ITT and nu tot i's dad dud Ott in a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's don tid at UN so ITT add 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau do nit SD out din at SD du to in ad St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz studio at ND nu toad ti d's dud Io tat n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us ton tid ad UN do tit sad dun tot i's ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz daunt do sit du Ito sat 2nd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Sudan dot it nut odd ti a's du Santo it'd 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us Io add TNT tun do Ida St. dun Io AT&T d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to tin dad UN dot aid t's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau to Dis 2nd out aid 2nd St. du oint ad 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stout I'd DNA nu o's IT&T add dud to tin as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz auto I'd ND St. UN to it ad SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USN to ti add Saud don IT&T du nod ti sat 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud to nit ad nu do it ad 1st du so tit Dan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us oat it'd ND tun o's it add dun oat it d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's Todd ain't du iota ND 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sun to it'd ad nut do ti sad du Ott is and 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do tin tad nu tot aid SD dud Otis ant 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's don it'd at UN so IT&T dad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taunt sod I'd out ti dad n's du to in at d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stun oat did nu toad I'd St du tot i's and 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us ton ti dad UN Dido at St dun tot I'd as 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Datsun do ti du Ito tad n's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Sudan do ITT nut oat I'd d's du Toni ad St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us dot it DNA tun do is tad dun Io tat SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's to did ant UN dot aid 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau to did n's out aid ND St du Odin at St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stout aid 2nd nu odd sit at dud to nit a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz auto I'd 2nd St UN to ti ad SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USN Ott I'd ad Saudi tot 2nd du nod tit a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud to din at nu do it at SD du so IT&T Dan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us to tid and tun o's ti dad dun oat I'd St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's Ott in add du ion AT&T d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sun to did at nut do i's tad du Otis at ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do IT&T Dan nu tot did as dud o's it tan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's don ITT ad UN Ott is dad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taunt odd i's out ti DNA SD du to dint sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stun Ito add nu Ito tad SD du tot sin ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us ton I'd tad UN Dido at 1st dun tot is ad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz snout it add du Ito DNA 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz Ainu Todd St nut to is add du Toni ad St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us dot ti DNA tun Io add St. dun Io tad St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's not it add UN dot i's tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz tau nod I'd 1st out didn't as du Odin at St. 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stout Ida ND nu odd tit as dud to is tan 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz auto I'd 2nd t's UN ado tid St 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz USN dot ti ad Saudi Ott ND du nod IT&T a's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sud not I'd at nu do ti ad 1st du so nit tad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us to it ad ND tun odd i's at dun to ti sad 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's Ott din ad du ion tad 1st 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz sun dot I'd at nut do tid a's du o's tid ant 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us do tit and nu tot Ida d's dud o's ITT an 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz u's DOD in tat UN Ott did sa 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz taunt DOD is out ti and d's du to is at ND 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz stun dot Ida nu Ito add St. du tot ani SD 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz us tot in dad Tunis to add dun soda tit 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz snout ti dad du Ito ant d's 169 candidates -Order of search will be uoiadsntwygjklmxzhrcbvfepq +Order of search will be uoiadsntgjklmfepqrcbvwxyhz suit Todd an nut to Ida d's du dot sit an 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb act cos 7th cab SC 7th tore bear Oct SC 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob etc sac 7th cab ROTC eh 1st bear cot SC 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob chat c's et cab hoc St. ret beach c's trot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob cast tech cab etc h's tor be ROTC sac 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC SC 6th et cab torch EST be RCA SC 5th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC c's 4th et cab c's 10th to re be Oct scar 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob act c's the cab c's 7th tore be hoc SC tart 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abo CRT etc h's cab CRT hot e's be AC SC 4th tor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe ROTC SC 8th cab cost 7th re be arc Scot 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe CRT hoc St. cab core 7th St be act SC 9th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe cos CRT 4th cab core 9th 1st be c's tract ho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sect 5th or cab chest rot be c's actor 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sec 7th tor Cabot c's 9th re be c's AC 6th rot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc Scot 5th re carob tech 1st be c's act 7th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC Roth et carob c's 6th et be CRT SC oath 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 5th or et CBS acre 7th to be CRT AC 5th so 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc ROTC h's et CBS RCA the to be CRT AC h's to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc Oct her 1st CBS race 9th to be cot arch St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc etch St or CBS Oct 10th ear be cot AC 8th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc escort 5th CBS Oct he tar be cost arc 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's he tort CBS Oct 6th Rae be chat Oct r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's 9th or et CBS hoc re AT&T be char Oct 1st 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc CRT the so CBS etc 9th oar be catch t's or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc cot her St. CBS ace 10th tor be cat ROTC h's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc cos 4th ret CBS arc 10th toe be cart SC hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 5th St CBS torch eat be cart cos 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 10th St. CBS CRT ho tea be car SC 9th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe cat SC 4th CBS cot hat re be car cost 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe act SC 5th CBS cot 5th ear bath etc SC or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab Oct 5th re CBS cot he art bate cosh CRT 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab etc 9th or CBS core 4th at batch cost re 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab cot 6th re CBS cheat rot bat soccer 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sorb AC etc 5th CBS cat 10th roe bat c's Oct her 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob chart etc CBS cat 4th ore bat cos retch 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob car etc 4th CBS cart oh et bat core c's 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob ace CRT 9th CBS car 10th toe bare Oct SC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab scorch et CBS AC the tor bare cot SC 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab c's Oct her CBS AC 4th tore bar Oct sec 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab cos retch CBS AC her tot bar etc hoc t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab core c's 5th CBS act 10th ore bar cot etc h's both etc scar 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm CBS act 6th ore bah ROTC SC et both crate c's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra sect 5th bah CRT c's toe botch sec tar 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra etch 1st Bach Scot ret botch RCA set 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Corbett cash Bach Oct rest botch c's re at 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab SC 8th toe Bach CRT so et Bose CRT AC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Oct 10th e's brace Scot 4th Bosch CRT tea 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Oct he St. brace c's 4th to bore c's act 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc 4th o's bract tech so bore cat c's 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc shot bract echo St. Bohr AC etc t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab c's hot et brae Oct SC 4th Boca SC 7th ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab cot he St brae cot SC 4th Boca c's 10th ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab cos 7th et breach Scott Boca CRT eh St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb cot SC at breath c's Oct Boca crest 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb AC SC Ott Brett Chao SC boat chert c's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob sec tract broth AC SC et boar c's etc 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob CRT SC eta b's Oct race 7th beth ROTC sac 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob CRT c's eat b's etc RCA hot beth c's AC tor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob car etc St. b's arc etc hot beth car c's to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm strobe catch b's crochet at bet RCA SC hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb etc sac 6th b's cot race 6th bet arccos 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb cat sec 8th b's chore tact bet arc hoc St 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC sect 8th b's cat tech or bet c's AC 7th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC etch St b's cat core 5th bet CRT hoc sa 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb act sec 8th b's care Oct 8th bet cos RCA 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb Oct sac 8th b's car cot the bet coca 7th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb accost 10th b's AC etch tor bet cat hoc r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cot sac 5th b's AC CRT eh to bet car c's hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 6th St b's act Oct her best char Oct 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 9th St cab sector 4th berth cot sac 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coat c's 8th cab sect Thor Bert Acts hoc 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cat cot h's cab sec 7th tor Bert c's act oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC Scot 9th cab Scot 6th re Bert coach t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC c's 9th to cab SC 10th to re Bert cash cot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb act c's hot cab SC 7th or et bear Oct SC 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob etch SC at cab ROTC 8th e's bear cot SC 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob chat sect cab Oct h's ret beach ROTC 1st 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob cat c's the cab etch t's or be tract SC ho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC tech 1st cab escort 6th be RCA Scot 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC c's 9th et cab c's 9th or et be Oct scar 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob act SC the cab c's her tot be actor SC 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abo CRT sec 7th cab CRT hoe St. be AC SC 7th tor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe ROTC SC 5th cab cot her St. be arc Scot 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe CRT hoc St cab cos 8th ret be act SC 8th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe cos CRT 5th cab core 9th St be c's arch tot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sect Thor cab core 6th 1st be c's actor 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sec 5th tor Cabot c's 4th re be c's AC 8th rot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc Scot 8th re carob tech St be c's arc 10th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 8th tore carob etch St. be CRT scat ho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 5th to re CBS acre 5th to be CRT AC 7th so 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc ROTC 6th e's CBS reach Ott be CRT AC ho St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc Oct her t's CBS race 8th to be cot arch t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc etch 1st or CBS Oct 10th Rae be cot AC 7th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc escort 4th CBS Oct 5th ear be cost RCA 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's the tor CBS Oct 7th ear be chat SC rot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's 5th tore CBS hoc ret at be char SC tot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc CRT hoe St CBS etc ha tor be Chao CRT St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc cot her t's CBS ace 8th tor be cat SC 8th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc cos 5th ret CBS arc 8th toe be cast CRT oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 5th 1st CBS teach rot be cart cos 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 8th St CBS CRT ho ate be car SC 8th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe cat SC 10th CBS cot 8th era be car cost 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe act SC 4th CBS cot 5th Rae bath ROTC sec 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab retch to CBS cot he tar bate CRT c's oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab etc 4th or CBS core 9th at batch c's to re 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab cot 7th re CBS chert tao bat soccer 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sorb AC etc 7th CBS cat the or bat c's ROTC he 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob CRT teach CBS cat 4th o'er bat cot SC her 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob car etc 10th CBS cat 7th ore bat core c's 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob ace CRT 6th CBS car 8th toe bare Oct SC 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab soccer 10th CBS AC 8th or et bare cot SC 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab c's ROTC eh CBS AC 4th to re bar Scot tech 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab cot SC her CBS AC 7th tore bar etc hoc St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab core c's 8th CBS act the or bar cot sec 7th both RCA sect 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm CBS act eh rot bar chest cot both crest AC 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra sect 10th bah CRT etc o's both car SC et 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra SC 6th et Bach sec trot botch acre 1st 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Corbett c's ha Bach Oct St. re botch arc set 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Scot the Bach c's tor et Bose CRT AC 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab octet h's brace Scot 5th Bosch CRT ate 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Oct he 1st brace c's 5th to bore c's act 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc 6th o's bract sect oh bore cat SC 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc 9th so bract etch so Bohr AC etc St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab c's he tot brae Oct SC 8th Boca SC 4th ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab cot h's et brae cot SC 8th Boca etc 7th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab coset 10th brash etc Oct Boca CRT eh 1st 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb cotta c's breach cot 1st Boca crest 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb act cost Brett hoc sac boat CRT c's he 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb Acts Oct broth cat sec boar c's etc 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob c's etc art b's Oct acre 8th betroth AC SC 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob CRT c's eta b's etc ROTC ha beth c's actor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob car etc t's b's arc Oct the beth car Scot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Hobart etc SC b's crotch ate bet ROTC SC ah 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb etc sac 7th b's cot race 5th bet arccos 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb cat sec 9th b's coat CRT he bet arc SC hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC sect 4th b's catch or et bet c's hoc art 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC SC 10th et b's cat core 8th bet CRT sac oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb Acts etch b's care Oct 4th bet cos RCA 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb Oct sac 4th b's car etch to bet coca 8th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb accost 8th b's AC Oct 5th re bet chaos CRT 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cot sac 6th b's AC CRT ho et bet car hoc St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 6th t's b's act ROTC he best CRT AC oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 4th St. b's act core 6th berth AC SC to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coat c's 5th cab sect 6th or Bert hoc scat 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cat hoc 1st cab sec 6th tor Bert c's AC hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC Scot 5th cab Scot 10th re Bert cos AC 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC c's 5th to cab SC 9th tore Bert cast hoc 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb act hoc St cab SC her tot bear Oct SC 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob tact SC he cab ROTC 9th e's bear cot SC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob c's etch at cab Oct her 1st beach ROTC St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob cat SC the cab etch sort be SC arch Ott 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC tech St. cab escort 10th be RCA Scot 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC c's 10th et cab c's 9th tore be Oct arch St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob act sec 6th cab c's eh trot be actor SC 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abo CRT sec 8th cab CRT hoe St be AC SC 5th tor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe ROTC SC 4th cab cot her St be arc Scot 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe CRT SC hot cab cos 9th ret be act SC 7th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe cos CRT 8th cab core 5th 1st be torch AC t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sect 8th or cab core 6th St be c's Oct hart 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sec 9th tor Cabot etch r's be c's AC 5th rot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc Scot 10th re carob sect 5th be c's arc 6th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 6th tore carob etch t's be CRT Scot ha 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 9th or et CBS acre 10th to be CRT AC 4th so 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc ROTC eh 1st CBS retch oat be CRT AC ho t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc Oct h's ret CBS RCA 7th toe be CRT c's oath 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc etch t's or CBS Oct hat re be cot starch 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc escort 10th CBS Oct 5th Rae be cost RCA 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's 8th tore CBS Oct 7th Rae be cos CRT hat 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's 5th or et CBS hoc rat et be char Scott 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc CRT hoe 1st CBS etc oh art be Chao CRT St 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc crest hot CBS etc 7th oar be cat SC 7th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc cos 6th ret CBS ace 7th tor be cast torch 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 9th St CBS arc 7th toe be cart cos 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 8th 1st CBS CRT oh eat be car SC 6th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe cat SC 9th CBS cot 8th are be car cost 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe act SC 9th CBS cot 9th ear bathe c's ROTC 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab tech tor CBS cot 6th era bate CRT SC oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab etc 8th or CBS core 8th at batch escort 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab cot 8th re CBS chore tat bat ROTC SC eh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sorb AC etc 10th CBS cat 8th roe bat torch sec 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob CRT etc ah CBS cat 5th roe bat crotch e's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob car etc 8th CBS cat 7th o'er bat core c's 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob act CRT eh CBS care 6th to Barth cos etc 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab soccer 8th CBS car 7th toe bare c's Oct 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab torch sec CBS AC 5th or et bare cot c's 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab crotch e's CBS AC 7th to re bar etc SC hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab core c's 6th CBS act 8th ore bar cot sec 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm throb AC c's et CBS act 4th o'er bar cos etc 9th both c's act re 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra sect 9th bah CRT SC toe both caret c's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra SC 7th et Bach sect tor botch acre St 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Corbett SC ha Bach Oct St re botch AC St. re 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Scott he Bach c's tot re botch car set 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab SC the to Bach cost ret Bosch act ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Oct h's et brace SC 6th to bore c's act 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc 7th o's brace cost 6th bore cat SC 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc oh 1st bract hoc set Bohr etc Acts 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab c's 5th toe bract cosh et Boca SC 9th ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab cot eh t's brae c's Oct 9th Boca etc 4th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab coset 5th brae cot c's 9th Boca CRT he St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb c's Oct at breach cot St. Boca crest 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb act SC to Brest coca 6th boat CRT SC he 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb AC cot t's broach etc 1st boar c's etc 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob c's etc rat b's Oct acre 5th boa CRT c's the 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob CRT ace 1st b's etch actor beth act SC or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob cart c's et b's ace ROTC 8th beth cat c's or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob AC CRT EST b's crotch eta bet scorch at 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb etc sac 10th b's cot race 8th bet arccos 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb catch EST b's coca 4th ret bet AC SC Roth 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC sect 5th b's Chao CRT et bet c's RCA hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC SC 7th et b's cat core 10th bet c's act rho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC c's 6th et b's care Oct 9th bet cos RCA 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb scotch at b's car tech to bet cos CRT ha 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb accost 4th b's AC Oct 10th re bet char c's to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cot sac 7th b's AC etc Roth bet car hoc t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 8th St b's ache CRT to best torch AC 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 4th 1st b's act core 10th berth accost 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coat c's 9th cab sect 10th or Bert Oct SC ha 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cat hoc t's cab sec 8th tor Bert c's Oct ah 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC Scot 7th cab Scot 5th re Bert cos AC 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC c's 7th to cab SC 9th or et Bert cat c's ho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb act hoc t's cab SC eh trot bear Oct SC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob SC tech at cab ROTC he St. bear cot SC 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob c's tact he cab Oct her St beach SC trot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob cat sec 9th cab etch r's to be scorch AT&T 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC sect 7th cab escort 5th be RCA Scot 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC etch St. cab c's 5th to re be Oct arch St 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob act sec 5th cab c's 6th to re be actor SC 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abo CRT sec 10th cab CRT the o's be AC SC 10th tor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abet CRT c's oh cab cot h's ret be AC Oct 4th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe c's ROTC 8th cab cos 4th ret be arc SC 9th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe cos CRT 10th cab core 5th St be torch AC 1st 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sect 10th or cab core 8th 1st be c's RCA 9th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc sec 8th tor Cabot SC 8th re be c's AC 7th rot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc tech 1st or carob sect 10th be c's arc 5th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 6th or et carob SC 4th et be c's torch at 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc SC 9th to re CBS acre 6th to be CRT Acts oh 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc ROTC eh St CBS ROTC eh at be CRT AC 10th so 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc ROTC 7th e's CBS RCA eh Ott be CRT c's ho at 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc hector 1st CBS Oct 8th era be cot scar 10th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc etc short CBS Oct hater be cost RCA 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's 8th to re CBS Oct eh rat be cosh tract 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's 7th to re CBS tact eh or be chart c's to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc c's Roth et CBS etc 10th oar be char cot t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc CRT ho set CBS etc 4th oar be cat SC Roth 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc cost 8th re CBS ace 6th rot be cat c's 8th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 9th 1st CBS arc he tot be cart cos 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abc core 4th St CBS CRT oh eta be car SC 5th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe catch t's CBS crate hot be car cost 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe cat c's 7th CBS cot 9th Rae Bator c's etch 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm robe act c's 10th CBS cot 6th ear bate torch SC 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab etc 10th or CBS cot earth batch SC tore 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm scab cot 10th re CBS coat 6th re bat SC tech or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sorb act tech CBS cater hot bat etc SC rho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob etc RCA 5th CBS cat ho ret bat CRT hoc e's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob car etc 6th CBS cat rho et bat core SC 5th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm sob act retch CBS care 5th to Barth Oct sec 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab soccer 4th CBS car he Ott bare c's Oct 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab etc SC rho CBS AC 9th tore bare cot c's 7th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab CRT hoc e's CBS AC he tort bar etch Scot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm tab core SC 5th CBS act 9th o'er bar cot sec 9th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm throb AC sect CBS act 4th roe bar cos etc 10th both c's AC ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm CBS arch to et bah c's etc tor both cart sec 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra SC 8th et bah cos CRT et botch sac ret 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm cobra c's 5th et Bach ROTC EST botch AC t's re 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab sec 5th to Bach c's Ott re botch care St. 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab SC eh tot Bach cot rest Bosch etc tar 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab Oct eh St. brace SC 7th to bore act SC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc 8th so brace cost 7th bore cat SC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab etc oh St bract Oct she Bohr etc scat 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab c's eh Ott bract cost he Bohr cast etc 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab cot eh St brae c's Oct 10th Boca etc 9th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm crab coset 6th brae cot c's 10th Boca CRT he 1st 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb Oct scat breach c's tot Boca CRT Seth 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb cast cot Brest coca 8th boat c's retch 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm herb AC cot St broach etc t's boar c's etc 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob etc RCA St b's Oct acre 6th boa CRT SC the 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob CRT ace t's b's hoc tact re beth arc Scot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob cart sect b's ace ROTC 5th beth cost arc 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm hob arc etc t's b's CRT echo at beta cosh CRT 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb etc sac 5th b's cot acre 7th bet hoc RCA t's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb chat c's et b's coca 6th ret bet AC SC 5th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb cast tech b's char etc to bet c's ROTC ah 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC SC 9th et b's cat CRT hoe bet c's AC 4th or 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb AC c's 8th et b's cart cot eh bet cot crash 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm orb act c's the b's care cot 6th bet cos arc 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb hoc SC AT&T b's AC Oct 6th re bet char Scot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cot sac 9th b's AC etc 5th or bet car SC hot 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 8th t's b's AC cot 9th re bet car cos 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coca 5th St b's act core 5th Bertha cot c's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb coat SC 6th cab sect 5th or berth coat c's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb cat Oct h's cab sec 10th tor Bert act SC ho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC Scot 6th cab Scott her Bert cos AC 8th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb AC c's 6th to cab SC 5th to re Bert cat SC ho 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb act SC hot cab SC 6th to re beast CRT hoc 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm reb act cos 9th cab ROTC he St bear c's Oct 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob etc sac 10th cab ROTC 7th e's bear cot c's 6th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob cat sec 4th cab hector t's be scotch art 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC sect 4th cab etc short be ROTC sac 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob AC etch 1st cab c's he tort be RCA SC 7th to 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm rob act sec 8th cab c's 8th or et be actor SC 4th 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abo CRT sec 6th cab CRT h's toe be AC SC 8th tor 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm abet CRT SC oh cab CRT those be AC Oct 5th r's 348 candidates -Order of search will be bchsoreatugdzyfpqwvxijklmn +Order of search will be bchsoreatnpquvwxyzdfgijklm Abe c's ROTC 5th cab cost 6th re be arc SC 8th to 46 candidates -Order of search will be guoirhsywefjkvcbdqztlxapmn +Order of search will be guoirhsklmnpqtvwxyazbcdefj exit 0 From daniel at zuster.org Thu Aug 19 11:22:12 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 16:22:12 -0000 Subject: [llvm-commits] [test-suite] r111522 - in /test-suite/trunk: MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c SingleSource/Benchmarks/BenchmarkGame/puzzle.c SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output Message-ID: <20100819162212.B52082A6C12D@llvm.org> Author: ddunbar Date: Thu Aug 19 11:22:12 2010 New Revision: 111522 URL: http://llvm.org/viewvc/llvm-project?rev=111522&view=rev Log: Revert r111502, "Use ?rand48 instead of rand(), for more predictable results.", apparently MinGW doesn't have ?rand48(), which is rather unfortunate. - I'll come up with a different solution, one day (probably by creating a runtime support library for use by the tests, which would be generally handy). Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output?rev=111522&r1=111521&r2=111522&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output (original) +++ test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/automotive-bitcount.reference_output Thu Aug 19 11:22:12 2010 @@ -1,10 +1,10 @@ Bit counter algorithm benchmark -Optimized 1 bit/loop counter > Bits: 15830918 -Ratko's mystery algorithm > Bits: 18246946 -Recursive bit count by nybbles > Bits: 18853553 -Non-recursive bit count by nybbles > Bits: 17783741 -Non-recursive bit count by bytes (BW) > Bits: 16157105 -Non-recursive bit count by bytes (AR) > Bits: 13742280 -Shift and count bits > Bits: 15552206 +Optimized 1 bit/loop counter > Bits: 13254024 +Ratko's mystery algorithm > Bits: 15454236 +Recursive bit count by nybbles > Bits: 16468711 +Non-recursive bit count by nybbles > Bits: 18724896 +Non-recursive bit count by bytes (BW) > Bits: 15997399 +Non-recursive bit count by bytes (AR) > Bits: 16733373 +Shift and count bits > Bits: 15589355 exit 0 Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c?rev=111522&r1=111521&r2=111522&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/MiBench/automotive-bitcount/bitcnts.c Thu Aug 19 11:22:12 2010 @@ -53,13 +53,12 @@ puts("Bit counter algorithm benchmark\n"); - srand48(1); for (i = 0; i < FUNCS; i++) { #if 0 start = clock(); #endif - for (j = n = 0, seed = lrand48(); j < iterations; j++, seed += 13) + for (j = n = 0, seed = rand(); j < iterations; j++, seed += 13) n += pBitCntFunc[i](seed); #if 0 Modified: test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c?rev=111522&r1=111521&r2=111522&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c (original) +++ test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.c Thu Aug 19 11:22:12 2010 @@ -8,7 +8,7 @@ int randInt(int min, int max) { int k, n; n = (max - min) + 1; - k = (int)(n * (lrand48() / (RAND_MAX + 1.0))); + k = (int)(n * (rand() / (RAND_MAX + 1.0))); return (k == n) ? k + min - 1 : k + min; } @@ -53,7 +53,7 @@ int i, j, duplicate; int *rndArr; - srand48(1); + srand(1); for (i = 0; i < NLOOPS1; i++) { rndArr = createRandomArray(ARRAY_SIZE); @@ -64,4 +64,4 @@ } return 0; -} +} \ No newline at end of file Modified: test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output?rev=111522&r1=111521&r2=111522&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output (original) +++ test-suite/trunk/SingleSource/Benchmarks/BenchmarkGame/puzzle.reference_output Thu Aug 19 11:22:12 2010 @@ -1,6 +1,6 @@ -Found duplicate: 20816 -Found duplicate: 227247 -Found duplicate: 417409 -Found duplicate: 167994 -Found duplicate: 282745 +Found duplicate: 4 +Found duplicate: 485365 +Found duplicate: 417267 +Found duplicate: 436989 +Found duplicate: 60067 exit 0 From bob.wilson at apple.com Thu Aug 19 11:24:13 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 19 Aug 2010 09:24:13 -0700 Subject: [llvm-commits] PATCH: implement vector zext when vector types are legal (neon) In-Reply-To: References: Message-ID: <7468208A-7CEB-4DC8-A7EB-C329B0017198@apple.com> On Aug 18, 2010, at 8:48 AM, Bob Wilson wrote: > > I'm looking now at all the NEON intrinsics for basic operations that extend one or both operands, and I can't figure out why they were ever needed. I'm starting to think that I just totally screwed that up. We should be able to avoid the intrinsics and represent those operations with zero_extend and sign_extend patterns. That would also avoid the need for the DAG combine pattern for vmlal. > > I'll give that a try. We'll either end up with a better solution or I'll remember why I did it that way in the first place. I remembered. At the time I added the NEON port, zero_extend and sign_extend did not work with vector types, so we decided to just go with intrinsics. The situation may have improved since then, but there are still issues. The DAG combiner really wants to form extending loads, whether the target says they are legal for vectors or not, and then legalization fails to correctly handle the expansion of the extending loads. There may be others. It would be nice to avoid using intrinsics for these things, so I'll see if I can work through the issues without spending too much time on it. From daniel at zuster.org Thu Aug 19 11:46:52 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 16:46:52 -0000 Subject: [llvm-commits] [llvm] r111524 - /llvm/trunk/test/lit.cfg Message-ID: <20100819164652.9F24B2A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 19 11:46:52 2010 New Revision: 111524 URL: http://llvm.org/viewvc/llvm-project?rev=111524&view=rev Log: tests: Ignore whitespace in llvm_supports_binding() and llvm_gcc_supports(). Modified: llvm/trunk/test/lit.cfg Modified: llvm/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=111524&r1=111523&r2=111524&view=diff ============================================================================== --- llvm/trunk/test/lit.cfg (original) +++ llvm/trunk/test/lit.cfg Thu Aug 19 11:46:52 2010 @@ -148,13 +148,13 @@ def llvm_supports_darwin_and_target(name): return 'darwin' in config.target_triple and llvm_supports_target(name) -langs = set(site_exp['llvmgcc_langs'].split(',')) +langs = set([s.strip for s in site_exp['llvmgcc_langs'].split(',')]) def llvm_gcc_supports(name): - return name in langs + return name.strip() in langs -bindings = set(site_exp['llvm_bindings'].split(',')) +bindings = set([s.strip for s in site_exp['llvm_bindings'].split(',')]) def llvm_supports_binding(name): - return name in bindings + return name.strip() in bindings # Provide on_clone hook for reading 'dg.exp'. import os From daniel at zuster.org Thu Aug 19 11:47:54 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 16:47:54 -0000 Subject: [llvm-commits] [llvm] r111525 - /llvm/trunk/test/lit.cfg Message-ID: <20100819164754.56D2E2A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 19 11:47:54 2010 New Revision: 111525 URL: http://llvm.org/viewvc/llvm-project?rev=111525&view=rev Log: tests: Haste makes waste. Modified: llvm/trunk/test/lit.cfg Modified: llvm/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=111525&r1=111524&r2=111525&view=diff ============================================================================== --- llvm/trunk/test/lit.cfg (original) +++ llvm/trunk/test/lit.cfg Thu Aug 19 11:47:54 2010 @@ -148,11 +148,11 @@ def llvm_supports_darwin_and_target(name): return 'darwin' in config.target_triple and llvm_supports_target(name) -langs = set([s.strip for s in site_exp['llvmgcc_langs'].split(',')]) +langs = set([s.strip() for s in site_exp['llvmgcc_langs'].split(',')]) def llvm_gcc_supports(name): return name.strip() in langs -bindings = set([s.strip for s in site_exp['llvm_bindings'].split(',')]) +bindings = set([s.strip() for s in site_exp['llvm_bindings'].split(',')]) def llvm_supports_binding(name): return name.strip() in bindings From daniel at zuster.org Thu Aug 19 12:03:28 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 10:03:28 -0700 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h In-Reply-To: <20100819012550.CDDB72A6C12C@llvm.org> References: <20100819012550.CDDB72A6C12C@llvm.org> Message-ID: Hi Eric, Did you time the performance impact of this change? I have some tentative evidence that it may be involved in some compile time regressions, but unfortunately the Clang build was broken at the time so I don't have an exact commit identified yet. - Daniel On Wed, Aug 18, 2010 at 6:25 PM, Eric Christopher wrote: > Author: echristo > Date: Wed Aug 18 20:25:50 2010 > New Revision: 111499 > > URL: http://llvm.org/viewvc/llvm-project?rev=111499&view=rev > Log: > Reapply the virtual register patch from 109102. The places where we were > depending on the number of virtual registers appear to have all been handled > now. > > Modified: > ? ?llvm/trunk/include/llvm/Target/TargetRegisterInfo.h > > Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111499&r1=111498&r2=111499&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) > +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Wed Aug 18 20:25:50 2010 > @@ -301,7 +301,7 @@ > ? ? /// considered to be a 'virtual' register, which is part of the SSA > ? ? /// namespace. ?This must be the same for all targets, which means that each > ? ? /// target is limited to this fixed number of registers. > - ? ?FirstVirtualRegister = 1024 > + ? ?FirstVirtualRegister = 16384 > ? }; > > ? /// isPhysicalRegister - Return true if the specified register number is in > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From daniel at zuster.org Thu Aug 19 12:14:53 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 10:14:53 -0700 Subject: [llvm-commits] [llvm] r111440 - /llvm/trunk/test/Other/close-stderr.ll In-Reply-To: <20100818223557.0EB4F2A6C12C@llvm.org> References: <20100818223557.0EB4F2A6C12C@llvm.org> Message-ID: Hi Dan, Can you rewrite this as a unit test instead? - Daniel On Wed, Aug 18, 2010 at 3:35 PM, Dan Gohman wrote: > Author: djg > Date: Wed Aug 18 17:35:56 2010 > New Revision: 111440 > > URL: http://llvm.org/viewvc/llvm-project?rev=111440&view=rev > Log: > Add a testcase to verify that commands don't crash when they hit > errors on stderr. > > Added: > ? ?llvm/trunk/test/Other/close-stderr.ll > > Added: llvm/trunk/test/Other/close-stderr.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/close-stderr.ll?rev=111440&view=auto > ============================================================================== > --- llvm/trunk/test/Other/close-stderr.ll (added) > +++ llvm/trunk/test/Other/close-stderr.ll Wed Aug 18 17:35:56 2010 > @@ -0,0 +1,9 @@ > +; RUN: sh -c "\ > +; RUN: ? ? ? ?opt --reject-this-option 2>&-; echo $?; \ > +; RUN: ? ? ? ?opt -o /dev/null /dev/null 2>&-; echo $?; \ > +; RUN: ? ? ? " | FileCheck %s > +; CHECK: {{^1$}} > +; CHECK: {{^0$}} > + > +; Test that the error handling when writing to stderr fails exits the > +; program cleanly rather than aborting. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From echristo at apple.com Thu Aug 19 12:20:10 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 10:20:10 -0700 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h In-Reply-To: References: <20100819012550.CDDB72A6C12C@llvm.org> Message-ID: On Aug 19, 2010, at 10:03 AM, Daniel Dunbar wrote: > Hi Eric, > > Did you time the performance impact of this change? > > I have some tentative evidence that it may be involved in some compile > time regressions, but unfortunately the Clang build was broken at the > time so I don't have an exact commit identified yet. I didn't, I'll back it out again. It seems that my nightly tester didn't like it either. -eric From echristo at apple.com Thu Aug 19 12:21:11 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 17:21:11 -0000 Subject: [llvm-commits] [llvm] r111527 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Message-ID: <20100819172111.1AAB82A6C12C@llvm.org> Author: echristo Date: Thu Aug 19 12:21:10 2010 New Revision: 111527 URL: http://llvm.org/viewvc/llvm-project?rev=111527&view=rev Log: Re-re-revert this patch. It seems to be causing performance and correctness regressions. Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111527&r1=111526&r2=111527&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Thu Aug 19 12:21:10 2010 @@ -301,7 +301,7 @@ /// considered to be a 'virtual' register, which is part of the SSA /// namespace. This must be the same for all targets, which means that each /// target is limited to this fixed number of registers. - FirstVirtualRegister = 16384 + FirstVirtualRegister = 1024 }; /// isPhysicalRegister - Return true if the specified register number is in From daniel at zuster.org Thu Aug 19 12:21:17 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 17:21:17 -0000 Subject: [llvm-commits] [llvm] r111528 - /llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp Message-ID: <20100819172117.6DC352A6C12D@llvm.org> Author: ddunbar Date: Thu Aug 19 12:21:17 2010 New Revision: 111528 URL: http://llvm.org/viewvc/llvm-project?rev=111528&view=rev Log: buildbot/valgrind: Suppress warnings about leaks in /bin/grep. Modified: llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp Modified: llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp?rev=111528&r1=111527&r2=111528&view=diff ============================================================================== --- llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp (original) +++ llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp Thu Aug 19 12:21:17 2010 @@ -28,6 +28,12 @@ } { + We don't care if grep leaks + Memcheck:Leak + obj:/bin/grep +} + +{ We don't care if python leaks Memcheck:Leak fun:malloc From daniel at zuster.org Thu Aug 19 12:21:21 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 17:21:21 -0000 Subject: [llvm-commits] [llvm] r111529 - /llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp Message-ID: <20100819172122.079B32A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 19 12:21:21 2010 New Revision: 111529 URL: http://llvm.org/viewvc/llvm-project?rev=111529&view=rev Log: buildbot/valgrind: Update RegisterPass false positive suppression for API changes. Modified: llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp Modified: llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp?rev=111529&r1=111528&r2=111529&view=diff ============================================================================== --- llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp (original) +++ llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu.supp Thu Aug 19 12:21:21 2010 @@ -2,8 +2,7 @@ False leak under RegisterPass Memcheck:Leak ... - fun:_ZN83_GLOBAL_*PassRegistrar12RegisterPassERKN4llvm8PassInfoE - fun:_ZN4llvm8PassInfo12registerPassEv + fun:_ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoE } # Python false positives according to From daniel at zuster.org Thu Aug 19 12:28:34 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 10:28:34 -0700 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h In-Reply-To: References: <20100819012550.CDDB72A6C12C@llvm.org> Message-ID: On Thu, Aug 19, 2010 at 10:20 AM, Eric Christopher wrote: > > On Aug 19, 2010, at 10:03 AM, Daniel Dunbar wrote: > >> Hi Eric, >> >> Did you time the performance impact of this change? >> >> I have some tentative evidence that it may be involved in some compile >> time regressions, but unfortunately the Clang build was broken at the >> time so I don't have an exact commit identified yet. > > I didn't, I'll back it out again. ?It seems that my nightly tester didn't like it > either. Ok, you don't need to back it out for my sake, I was just curious. Although at least this way I should be able to tell if it was the cause or not. - Daniel > > -eric From echristo at apple.com Thu Aug 19 12:33:04 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 10:33:04 -0700 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h In-Reply-To: References: <20100819012550.CDDB72A6C12C@llvm.org> Message-ID: <39891783-6212-494A-A0B8-81A463CEC3AE@apple.com> On Aug 19, 2010, at 10:28 AM, Daniel Dunbar wrote: > On Thu, Aug 19, 2010 at 10:20 AM, Eric Christopher wrote: >> >> On Aug 19, 2010, at 10:03 AM, Daniel Dunbar wrote: >> >>> Hi Eric, >>> >>> Did you time the performance impact of this change? >>> >>> I have some tentative evidence that it may be involved in some compile >>> time regressions, but unfortunately the Clang build was broken at the >>> time so I don't have an exact commit identified yet. >> >> I didn't, I'll back it out again. It seems that my nightly tester didn't like it >> either. > > Ok, you don't need to back it out for my sake, I was just curious. > Although at least this way I should be able to tell if it was the > cause or not. Yeah something funky was happening on one of my testers too so I'll back it out to double check. -eric From evan.cheng at apple.com Thu Aug 19 12:33:11 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 19 Aug 2010 17:33:11 -0000 Subject: [llvm-commits] [llvm] r111530 - /llvm/trunk/lib/CodeGen/MachineSink.cpp Message-ID: <20100819173311.BCD312A6C12C@llvm.org> Author: evancheng Date: Thu Aug 19 12:33:11 2010 New Revision: 111530 URL: http://llvm.org/viewvc/llvm-project?rev=111530&view=rev Log: Teach machine-sink to break critical edges when appropriate. Work in progress. Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=111530&r1=111529&r2=111530&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Thu Aug 19 12:33:11 2010 @@ -26,11 +26,21 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; -STATISTIC(NumSunk, "Number of machine instructions sunk"); +static cl::opt +SplitEdges("machine-sink-split", + cl::desc("Split critical edges during machine sinking"), + cl::init(false), cl::Hidden); +static cl::opt +SplitLimit("split-limit", + cl::init(~0u), cl::Hidden); + +STATISTIC(NumSunk, "Number of machine instructions sunk"); +STATISTIC(NumSplit, "Number of critical edges split"); namespace { class MachineSinking : public MachineFunctionPass { @@ -59,6 +69,8 @@ } private: bool ProcessBlock(MachineBasicBlock &MBB); + MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *From, + MachineBasicBlock *To); bool SinkInstruction(MachineInstr *MI, bool &SawStore); bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB, MachineBasicBlock *DefMBB, bool &LocalUse) const; @@ -175,6 +187,66 @@ return MadeChange; } +MachineBasicBlock *MachineSinking::SplitCriticalEdge(MachineBasicBlock *FromBB, + MachineBasicBlock *ToBB) { + // Avoid breaking back edge. From == To means backedge for single BB loop. + if (!SplitEdges || NumSplit == SplitLimit || FromBB == ToBB) + return 0; + + // Check for more "complex" loops. + if (LI->getLoopFor(FromBB) != LI->getLoopFor(ToBB) || + !LI->isLoopHeader(ToBB)) { + // It's not always legal to break critical edges and sink the computation + // to the edge. + // + // BB#1: + // v1024 + // Beq BB#3 + // + // BB#2: + // ... no uses of v1024 + // + // BB#3: + // ... + // = v1024 + // + // If BB#1 -> BB#3 edge is broken and computation of v1024 is inserted: + // + // BB#1: + // ... + // Bne BB#2 + // BB#4: + // v1024 = + // B BB#3 + // BB#2: + // ... no uses of v1024 + // + // BB#3: + // ... + // = v1024 + // + // This is incorrect since v1024 is not computed along the BB#1->BB#2->BB#3 + // flow. We need to ensure the new basic block where the computation is + // sunk to dominates all the uses. + // It's only legal to break critical edge and sink the computation to the + // new block if all the predecessors of "To", except for "From", are + // not dominated by "From". Given SSA property, this means these + // predecessors are dominated by "To". + for (MachineBasicBlock::pred_iterator PI = ToBB->pred_begin(), + E = ToBB->pred_end(); PI != E; ++PI) { + if (*PI == FromBB) + continue; + if (!DT->dominates(ToBB, *PI)) + return 0; + } + + // FIXME: Determine if it's cost effective to break this edge. + return FromBB->SplitCriticalEdge(ToBB, this); + } + + return 0; +} + /// SinkInstruction - Determine whether it is safe to sink the specified machine /// instruction out of its current block into a successor. bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) { @@ -316,27 +388,46 @@ if (SuccToSinkTo->pred_size() > 1) { // We cannot sink a load across a critical edge - there may be stores in // other code paths. + bool TryBreak = false; bool store = true; if (!MI->isSafeToMove(TII, AA, store)) { - DEBUG(dbgs() << " *** PUNTING: Wont sink load along critical edge.\n"); - return false; + DEBUG(dbgs() << " *** PUNTING: Won't sink load along critical edge.\n"); + TryBreak = true; } // We don't want to sink across a critical edge if we don't dominate the // successor. We could be introducing calculations to new code paths. - if (!DT->dominates(ParentBlock, SuccToSinkTo)) { + if (!TryBreak && !DT->dominates(ParentBlock, SuccToSinkTo)) { DEBUG(dbgs() << " *** PUNTING: Critical edge found\n"); - return false; + TryBreak = true; } // Don't sink instructions into a loop. - if (LI->isLoopHeader(SuccToSinkTo)) { + if (!TryBreak && LI->isLoopHeader(SuccToSinkTo)) { DEBUG(dbgs() << " *** PUNTING: Loop header found\n"); - return false; + TryBreak = true; } // Otherwise we are OK with sinking along a critical edge. - DEBUG(dbgs() << "Sinking along critical edge.\n"); + if (!TryBreak) + DEBUG(dbgs() << "Sinking along critical edge.\n"); + else { + MachineBasicBlock *NewSucc = SplitCriticalEdge(ParentBlock, SuccToSinkTo); + if (!NewSucc) { + DEBUG(dbgs() << + " *** PUNTING: Not legal or profitable to break critical edge\n"); + return false; + } else { + DEBUG(dbgs() << "*** Splitting critical edge:" + " BB#" << ParentBlock->getNumber() + << " -- BB#" << NewSucc->getNumber() + << " -- BB#" << SuccToSinkTo->getNumber() << '\n'); + //assert(DT->dominates(NewSucc, SuccToSinkTo) && + //"New BB doesn't dominate all uses!"); + SuccToSinkTo = NewSucc; + ++NumSplit; + } + } } // Determine where to insert into. Skip phi nodes. From evan.cheng at apple.com Thu Aug 19 12:33:49 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 19 Aug 2010 17:33:49 -0000 Subject: [llvm-commits] [llvm] r111531 - /llvm/trunk/lib/CodeGen/MachineSink.cpp Message-ID: <20100819173349.117AF2A6C12C@llvm.org> Author: evancheng Date: Thu Aug 19 12:33:48 2010 New Revision: 111531 URL: http://llvm.org/viewvc/llvm-project?rev=111531&view=rev Log: Remove disabled assertion. Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=111531&r1=111530&r2=111531&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Thu Aug 19 12:33:48 2010 @@ -422,8 +422,6 @@ " BB#" << ParentBlock->getNumber() << " -- BB#" << NewSucc->getNumber() << " -- BB#" << SuccToSinkTo->getNumber() << '\n'); - //assert(DT->dominates(NewSucc, SuccToSinkTo) && - //"New BB doesn't dominate all uses!"); SuccToSinkTo = NewSucc; ++NumSplit; } From bob.wilson at apple.com Thu Aug 19 12:37:05 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 19 Aug 2010 10:37:05 -0700 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h In-Reply-To: <39891783-6212-494A-A0B8-81A463CEC3AE@apple.com> References: <20100819012550.CDDB72A6C12C@llvm.org> <39891783-6212-494A-A0B8-81A463CEC3AE@apple.com> Message-ID: On Aug 19, 2010, at 10:33 AM, Eric Christopher wrote: > > On Aug 19, 2010, at 10:28 AM, Daniel Dunbar wrote: > >> On Thu, Aug 19, 2010 at 10:20 AM, Eric Christopher wrote: >>> >>> On Aug 19, 2010, at 10:03 AM, Daniel Dunbar wrote: >>> >>>> Hi Eric, >>>> >>>> Did you time the performance impact of this change? >>>> >>>> I have some tentative evidence that it may be involved in some compile >>>> time regressions, but unfortunately the Clang build was broken at the >>>> time so I don't have an exact commit identified yet. >>> >>> I didn't, I'll back it out again. It seems that my nightly tester didn't like it >>> either. >> >> Ok, you don't need to back it out for my sake, I was just curious. >> Although at least this way I should be able to tell if it was the >> cause or not. > > Yeah something funky was happening on one of my testers too so I'll back it out to > double check. Unlike the last time, I didn't notice any compile time regressions on any of the ARM testers. From grosbach at apple.com Thu Aug 19 12:52:13 2010 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 19 Aug 2010 17:52:13 -0000 Subject: [llvm-commits] [llvm] r111533 - in /llvm/trunk/lib/Target/ARM: ARMBaseRegisterInfo.cpp Thumb1RegisterInfo.cpp Thumb1RegisterInfo.h Message-ID: <20100819175213.C962D2A6C12C@llvm.org> Author: grosbach Date: Thu Aug 19 12:52:13 2010 New Revision: 111533 URL: http://llvm.org/viewvc/llvm-project?rev=111533&view=rev Log: Add Thumb1 support for virtual frame indices. rdar://8277890 Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.h Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=111533&r1=111532&r2=111533&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Thu Aug 19 12:52:13 2010 @@ -1385,13 +1385,6 @@ // FIXME: For testing, return true for all loads/stores and false for // everything else. We want to create lots of base regs to shake out bugs. - // - // FIXME: This is Thumb2/ARM only for now to keep it simpler. - ARMFunctionInfo *AFI = - MI->getParent()->getParent()->getInfo(); - if (AFI->isThumb1OnlyFunction()) - return false; - unsigned Opc = MI->getOpcode(); switch (Opc) { @@ -1401,6 +1394,7 @@ case ARM::t2STRi12: case ARM::t2STRi8: case ARM::VLDRS: case ARM::VLDRD: case ARM::VSTRS: case ARM::VSTRD: + case ARM::tSTRspi: case ARM::tLDRspi: return true; default: return false; @@ -1414,14 +1408,14 @@ unsigned BaseReg, int FrameIdx) const { ARMFunctionInfo *AFI = I->getParent()->getParent()->getInfo(); - unsigned ADDriOpc = !AFI->isThumbFunction() ? ARM::ADDri : ARM::t2ADDri; - assert(!AFI->isThumb1OnlyFunction() && - "This materializeFrameBaseRegister does not support Thumb1!"); + unsigned ADDriOpc = !AFI->isThumbFunction() ? ARM::ADDri : + (AFI->isThumb1OnlyFunction() ? ARM::tADDrSPi : ARM::t2ADDri); MachineInstrBuilder MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), TII.get(ADDriOpc), BaseReg) .addFrameIndex(FrameIdx).addImm(0); - AddDefaultCC(AddDefaultPred(MIB)); + if (!AFI->isThumb1OnlyFunction()) + AddDefaultCC(AddDefaultPred(MIB)); } void @@ -1469,13 +1463,14 @@ unsigned NumBits = 0; unsigned Scale = 1; unsigned ImmIdx = 0; - int InstrOffs; + int InstrOffs = 0;; switch(AddrMode) { case ARMII::AddrModeT2_i8: case ARMII::AddrModeT2_i12: // i8 supports only negative, and i12 supports only positive, so // based on Offset sign, consider the appropriate instruction - Offset += MI->getOperand(i+1).getImm(); + InstrOffs = MI->getOperand(i+1).getImm(); + Scale = 1; if (Offset < 0) { NumBits = 8; Offset = -Offset; @@ -1509,6 +1504,13 @@ NumBits = 8; break; } + case ARMII::AddrModeT1_s: { + ImmIdx = i+1; + InstrOffs = MI->getOperand(ImmIdx).getImm(); + NumBits = 5; + Scale = 4; + break; + } default: llvm_unreachable("Unsupported addressing mode!"); break; Modified: llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp?rev=111533&r1=111532&r2=111533&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp Thu Aug 19 12:52:13 2010 @@ -363,107 +363,19 @@ MI.RemoveOperand(Op); } -int Thumb1RegisterInfo:: -rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx, - unsigned FrameReg, int Offset, - unsigned MOVOpc, unsigned ADDriOpc, unsigned SUBriOpc) const -{ - // if/when eliminateFrameIndex() conforms with ARMBaseRegisterInfo - // version then can pull out Thumb1 specific parts here - return 0; -} - -/// saveScavengerRegister - Spill the register so it can be used by the -/// register scavenger. Return true. -bool -Thumb1RegisterInfo::saveScavengerRegister(MachineBasicBlock &MBB, - MachineBasicBlock::iterator I, - MachineBasicBlock::iterator &UseMI, - const TargetRegisterClass *RC, - unsigned Reg) const { - // Thumb1 can't use the emergency spill slot on the stack because - // ldr/str immediate offsets must be positive, and if we're referencing - // off the frame pointer (if, for example, there are alloca() calls in - // the function, the offset will be negative. Use R12 instead since that's - // a call clobbered register that we know won't be used in Thumb1 mode. - DebugLoc DL; - BuildMI(MBB, I, DL, TII.get(ARM::tMOVtgpr2gpr)). - addReg(ARM::R12, RegState::Define).addReg(Reg, RegState::Kill); - - // The UseMI is where we would like to restore the register. If there's - // interference with R12 before then, however, we'll need to restore it - // before that instead and adjust the UseMI. - bool done = false; - for (MachineBasicBlock::iterator II = I; !done && II != UseMI ; ++II) { - if (II->isDebugValue()) - continue; - // If this instruction affects R12, adjust our restore point. - for (unsigned i = 0, e = II->getNumOperands(); i != e; ++i) { - const MachineOperand &MO = II->getOperand(i); - if (!MO.isReg() || MO.isUndef() || !MO.getReg() || - TargetRegisterInfo::isVirtualRegister(MO.getReg())) - continue; - if (MO.getReg() == ARM::R12) { - UseMI = II; - done = true; - break; - } - } - } - // Restore the register from R12 - BuildMI(MBB, UseMI, DL, TII.get(ARM::tMOVgpr2tgpr)). - addReg(Reg, RegState::Define).addReg(ARM::R12, RegState::Kill); - - return true; -} - -unsigned -Thumb1RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - int SPAdj, FrameIndexValue *Value, - RegScavenger *RS) const{ - unsigned VReg = 0; - unsigned i = 0; +bool Thumb1RegisterInfo:: +rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx, + unsigned FrameReg, int &Offset, + const ARMBaseInstrInfo &TII) const { MachineInstr &MI = *II; MachineBasicBlock &MBB = *MI.getParent(); - MachineFunction &MF = *MBB.getParent(); - ARMFunctionInfo *AFI = MF.getInfo(); DebugLoc dl = MI.getDebugLoc(); - - while (!MI.getOperand(i).isFI()) { - ++i; - assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!"); - } - - unsigned FrameReg = ARM::SP; - int FrameIndex = MI.getOperand(i).getIndex(); - int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) + - MF.getFrameInfo()->getStackSize() + SPAdj; - - if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex)) - Offset -= AFI->getGPRCalleeSavedArea1Offset(); - else if (AFI->isGPRCalleeSavedArea2Frame(FrameIndex)) - Offset -= AFI->getGPRCalleeSavedArea2Offset(); - else if (MF.getFrameInfo()->hasVarSizedObjects()) { - assert(SPAdj == 0 && hasFP(MF) && "Unexpected"); - // There are alloca()'s in this function, must reference off the frame - // pointer instead. - FrameReg = getFrameRegister(MF); - Offset -= AFI->getFramePtrSpillOffset(); - } - - // Special handling of dbg_value instructions. - if (MI.isDebugValue()) { - MI.getOperand(i). ChangeToRegister(FrameReg, false /*isDef*/); - MI.getOperand(i+1).ChangeToImmediate(Offset); - return 0; - } - unsigned Opcode = MI.getOpcode(); const TargetInstrDesc &Desc = MI.getDesc(); unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask); if (Opcode == ARM::tADDrSPi) { - Offset += MI.getOperand(i+1).getImm(); + Offset += MI.getOperand(FrameRegIdx+1).getImm(); // Can't use tADDrSPi if it's based off the frame pointer. unsigned NumBits = 0; @@ -483,12 +395,13 @@ if (Offset == 0 && getInstrPredicate(&MI, PredReg) == ARMCC::AL) { // Turn it into a move. MI.setDesc(TII.get(ARM::tMOVgpr2tgpr)); - MI.getOperand(i).ChangeToRegister(FrameReg, false); + MI.getOperand(FrameRegIdx).ChangeToRegister(FrameReg, false); // Remove offset and remaining explicit predicate operands. - do MI.RemoveOperand(i+1); - while (MI.getNumOperands() > i+1 && - (!MI.getOperand(i+1).isReg() || !MI.getOperand(i+1).isImm())); - return 0; + do MI.RemoveOperand(FrameRegIdx+1); + while (MI.getNumOperands() > FrameRegIdx+1 && + (!MI.getOperand(FrameRegIdx+1).isReg() || + !MI.getOperand(FrameRegIdx+1).isImm())); + return true; } // Common case: small offset, fits into instruction. @@ -496,15 +409,15 @@ if (((Offset / Scale) & ~Mask) == 0) { // Replace the FrameIndex with sp / fp if (Opcode == ARM::tADDi3) { - removeOperands(MI, i); + removeOperands(MI, FrameRegIdx); MachineInstrBuilder MIB(&MI); AddDefaultPred(AddDefaultT1CC(MIB).addReg(FrameReg) .addImm(Offset / Scale)); } else { - MI.getOperand(i).ChangeToRegister(FrameReg, false); - MI.getOperand(i+1).ChangeToImmediate(Offset / Scale); + MI.getOperand(FrameRegIdx).ChangeToRegister(FrameReg, false); + MI.getOperand(FrameRegIdx+1).ChangeToImmediate(Offset / Scale); } - return 0; + return true; } unsigned DestReg = MI.getOperand(0).getReg(); @@ -516,7 +429,7 @@ emitThumbRegPlusImmediate(MBB, II, DestReg, FrameReg, Offset, TII, *this, dl); MBB.erase(II); - return 0; + return true; } if (Offset > 0) { @@ -524,12 +437,12 @@ // r0 = add sp, 255*4 // r0 = add r0, (imm - 255*4) if (Opcode == ARM::tADDi3) { - removeOperands(MI, i); + removeOperands(MI, FrameRegIdx); MachineInstrBuilder MIB(&MI); AddDefaultPred(AddDefaultT1CC(MIB).addReg(FrameReg).addImm(Mask)); } else { - MI.getOperand(i).ChangeToRegister(FrameReg, false); - MI.getOperand(i+1).ChangeToImmediate(Mask); + MI.getOperand(FrameRegIdx).ChangeToRegister(FrameReg, false); + MI.getOperand(FrameRegIdx+1).ChangeToImmediate(Mask); } Offset = (Offset - Mask * Scale); MachineBasicBlock::iterator NII = llvm::next(II); @@ -542,14 +455,14 @@ emitThumbConstant(MBB, II, DestReg, Offset, TII, *this, dl); MI.setDesc(TII.get(ARM::tADDhirr)); - MI.getOperand(i).ChangeToRegister(DestReg, false, false, true); - MI.getOperand(i+1).ChangeToRegister(FrameReg, false); + MI.getOperand(FrameRegIdx).ChangeToRegister(DestReg, false, false, true); + MI.getOperand(FrameRegIdx+1).ChangeToRegister(FrameReg, false); if (Opcode == ARM::tADDi3) { MachineInstrBuilder MIB(&MI); AddDefaultPred(MIB); } } - return 0; + return true; } else { unsigned ImmIdx = 0; int InstrOffs = 0; @@ -557,7 +470,7 @@ unsigned Scale = 1; switch (AddrMode) { case ARMII::AddrModeT1_s: { - ImmIdx = i+1; + ImmIdx = FrameRegIdx+1; InstrOffs = MI.getOperand(ImmIdx).getImm(); NumBits = (FrameReg == ARM::SP) ? 8 : 5; Scale = 4; @@ -577,9 +490,9 @@ unsigned Mask = (1 << NumBits) - 1; if ((unsigned)Offset <= Mask * Scale) { // Replace the FrameIndex with sp - MI.getOperand(i).ChangeToRegister(FrameReg, false); + MI.getOperand(FrameRegIdx).ChangeToRegister(FrameReg, false); ImmOp.ChangeToImmediate(ImmedOffset); - return 0; + return true; } bool isThumSpillRestore = Opcode == ARM::tRestore || Opcode == ARM::tSpill; @@ -600,12 +513,124 @@ Offset &= ~(Mask*Scale); } } + return Offset == 0; +} + +void +Thumb1RegisterInfo::resolveFrameIndex(MachineBasicBlock::iterator I, + unsigned BaseReg, int64_t Offset) const { + MachineInstr &MI = *I; + int Off = Offset; // ARM doesn't need the general 64-bit offsets + unsigned i = 0; + + while (!MI.getOperand(i).isFI()) { + ++i; + assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!"); + } + bool Done = false; + Done = rewriteFrameIndex(MI, i, BaseReg, Off, TII); + assert (Done && "Unable to resolve frame index!"); +} + +/// saveScavengerRegister - Spill the register so it can be used by the +/// register scavenger. Return true. +bool +Thumb1RegisterInfo::saveScavengerRegister(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, + MachineBasicBlock::iterator &UseMI, + const TargetRegisterClass *RC, + unsigned Reg) const { + // Thumb1 can't use the emergency spill slot on the stack because + // ldr/str immediate offsets must be positive, and if we're referencing + // off the frame pointer (if, for example, there are alloca() calls in + // the function, the offset will be negative. Use R12 instead since that's + // a call clobbered register that we know won't be used in Thumb1 mode. + DebugLoc DL; + BuildMI(MBB, I, DL, TII.get(ARM::tMOVtgpr2gpr)). + addReg(ARM::R12, RegState::Define).addReg(Reg, RegState::Kill); + + // The UseMI is where we would like to restore the register. If there's + // interference with R12 before then, however, we'll need to restore it + // before that instead and adjust the UseMI. + bool done = false; + for (MachineBasicBlock::iterator II = I; !done && II != UseMI ; ++II) { + if (II->isDebugValue()) + continue; + // If this instruction affects R12, adjust our restore point. + for (unsigned i = 0, e = II->getNumOperands(); i != e; ++i) { + const MachineOperand &MO = II->getOperand(i); + if (!MO.isReg() || MO.isUndef() || !MO.getReg() || + TargetRegisterInfo::isVirtualRegister(MO.getReg())) + continue; + if (MO.getReg() == ARM::R12) { + UseMI = II; + done = true; + break; + } + } + } + // Restore the register from R12 + BuildMI(MBB, UseMI, DL, TII.get(ARM::tMOVgpr2tgpr)). + addReg(Reg, RegState::Define).addReg(ARM::R12, RegState::Kill); + + return true; +} + +unsigned +Thumb1RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, + int SPAdj, FrameIndexValue *Value, + RegScavenger *RS) const{ + unsigned VReg = 0; + unsigned i = 0; + MachineInstr &MI = *II; + MachineBasicBlock &MBB = *MI.getParent(); + MachineFunction &MF = *MBB.getParent(); + ARMFunctionInfo *AFI = MF.getInfo(); + DebugLoc dl = MI.getDebugLoc(); + + while (!MI.getOperand(i).isFI()) { + ++i; + assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!"); + } + + unsigned FrameReg = ARM::SP; + int FrameIndex = MI.getOperand(i).getIndex(); + int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) + + MF.getFrameInfo()->getStackSize() + SPAdj; + + if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex)) + Offset -= AFI->getGPRCalleeSavedArea1Offset(); + else if (AFI->isGPRCalleeSavedArea2Frame(FrameIndex)) + Offset -= AFI->getGPRCalleeSavedArea2Offset(); + else if (MF.getFrameInfo()->hasVarSizedObjects()) { + assert(SPAdj == 0 && hasFP(MF) && "Unexpected"); + // There are alloca()'s in this function, must reference off the frame + // pointer instead. + FrameReg = getFrameRegister(MF); + Offset -= AFI->getFramePtrSpillOffset(); + } + + // Special handling of dbg_value instructions. + if (MI.isDebugValue()) { + MI.getOperand(i). ChangeToRegister(FrameReg, false /*isDef*/); + MI.getOperand(i+1).ChangeToImmediate(Offset); + return 0; + } + + // Modify MI as necessary to handle as much of 'Offset' as possible + assert(AFI->isThumbFunction() && + "This eliminateFrameIndex only supports Thumb1!"); + if (rewriteFrameIndex(MI, i, FrameReg, Offset, TII)) + return 0; // If we get here, the immediate doesn't fit into the instruction. We folded // as much as possible above, handle the rest, providing a register that is // SP+LargeImm. assert(Offset && "This code isn't needed if offset already handled!"); + unsigned Opcode = MI.getOpcode(); + const TargetInstrDesc &Desc = MI.getDesc(); + // Remove predicate first. int PIdx = MI.findFirstPredOperandIdx(); if (PIdx != -1) Modified: llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.h?rev=111533&r1=111532&r2=111533&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.h (original) +++ llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.h Thu Aug 19 12:52:13 2010 @@ -44,13 +44,14 @@ MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; - // rewrite MI to access 'Offset' bytes from the FP. Return the offset that - // could not be handled directly in MI. - int rewriteFrameIndex(MachineInstr &MI, unsigned FrameRegIdx, - unsigned FrameReg, int Offset, - unsigned MOVOpc, unsigned ADDriOpc, - unsigned SUBriOpc) const; - + // rewrite MI to access 'Offset' bytes from the FP. Update Offset to be + // however much remains to be handled. Return 'true' if no further + // work is required. + bool rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx, + unsigned FrameReg, int &Offset, + const ARMBaseInstrInfo &TII) const; + void resolveFrameIndex(MachineBasicBlock::iterator I, + unsigned BaseReg, int64_t Offset) const; bool saveScavengerRegister(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, MachineBasicBlock::iterator &UseMI, From dalej at apple.com Thu Aug 19 12:58:35 2010 From: dalej at apple.com (Dale Johannesen) Date: Thu, 19 Aug 2010 17:58:35 -0000 Subject: [llvm-commits] [llvm] r111534 - /llvm/trunk/lib/Support/APFloat.cpp Message-ID: <20100819175835.AEC962A6C12C@llvm.org> Author: johannes Date: Thu Aug 19 12:58:35 2010 New Revision: 111534 URL: http://llvm.org/viewvc/llvm-project?rev=111534&view=rev Log: Do not assert when reading an exponent out of range. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=111534&r1=111533&r2=111534&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Thu Aug 19 12:58:35 2010 @@ -153,6 +153,7 @@ value += absExponent * 10; if (absExponent >= overlargeExponent) { absExponent = overlargeExponent; + p = end; /* outwit assert below */ break; } absExponent = value; From bigcheesegs at gmail.com Thu Aug 19 13:16:39 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Thu, 19 Aug 2010 18:16:39 -0000 Subject: [llvm-commits] [llvm] r111535 - /llvm/trunk/lib/CodeGen/SplitKit.cpp Message-ID: <20100819181639.8CC902A6C12C@llvm.org> Author: mspencer Date: Thu Aug 19 13:16:39 2010 New Revision: 111535 URL: http://llvm.org/viewvc/llvm-project?rev=111535&view=rev Log: Fix the msvc 2010 build. The Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 implements parts of C++0x based on the draft standard. An old version of the draft had a bug that makes std::pair(something, 0) fail to compile. This is because the template pair(U&& x, V&& y) constructor is selected, even though it later fails to implicitly convert U and V to frist_type and second_type. This has been fixed in n3090, but it seems that Microsoft is not going to update msvc. Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=111535&r1=111534&r2=111535&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Thu Aug 19 13:16:39 2010 @@ -352,7 +352,16 @@ // This is a complex def. Mark with a NULL in valueMap. VNInfo *OldVNI = - valueMap_.insert(ValueMap::value_type(ParentVNI, 0)).first->second; + valueMap_.insert( + ValueMap::value_type(ParentVNI, static_cast(0))).first->second; + // The static_cast is only needed to work around a bug in an + // old version of the C++0x standard which the following compilers + // implemented and have yet to fix: + // + // Microsoft Visual Studio 2010 Version 10.0.30319.1 RTMRel + // Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 + // + // If/When we move to C++0x, this can be replaced by nullptr. (void)OldVNI; assert(OldVNI == 0 && "Simple/Complex values mixed"); @@ -371,7 +380,15 @@ // Use insert for lookup, so we can add missing values with a second lookup. std::pair InsP = - valueMap_.insert(ValueMap::value_type(ParentVNI, 0)); + valueMap_.insert(ValueMap::value_type(ParentVNI, static_cast(0))); + // The static_cast is only needed to work around a bug in an + // old version of the C++0x standard which the following compilers + // implemented and have yet to fix: + // + // Microsoft Visual Studio 2010 Version 10.0.30319.1 RTMRel + // Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 + // + // If/When we move to C++0x, this can be replaced by nullptr. // This was an unknown value. Create a simple mapping. if (InsP.second) From evan.cheng at apple.com Thu Aug 19 13:33:30 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 19 Aug 2010 18:33:30 -0000 Subject: [llvm-commits] [llvm] r111537 - in /llvm/trunk: lib/CodeGen/MachineSink.cpp test/CodeGen/X86/MachineSink-PHIUse.ll Message-ID: <20100819183330.2454C2A6C12C@llvm.org> Author: evancheng Date: Thu Aug 19 13:33:29 2010 New Revision: 111537 URL: http://llvm.org/viewvc/llvm-project?rev=111537&view=rev Log: It's possible to sink a def if its local uses are PHI's. Added: llvm/trunk/test/CodeGen/X86/MachineSink-PHIUse.ll Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=111537&r1=111536&r2=111537&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Thu Aug 19 13:33:29 2010 @@ -103,15 +103,14 @@ // Determine the block of the use. MachineInstr *UseInst = &*I; MachineBasicBlock *UseBlock = UseInst->getParent(); - if (UseBlock == DefMBB) { - LocalUse = true; - return false; - } if (UseInst->isPHI()) { // PHI nodes use the operand in the predecessor block, not the block with // the PHI. UseBlock = UseInst->getOperand(I.getOperandNo()+1).getMBB(); + } else if (UseBlock == DefMBB) { + LocalUse = true; + return false; } // Check that it dominates. @@ -270,7 +269,6 @@ // decide. MachineBasicBlock *SuccToSinkTo = 0; - bool LocalUse = false; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &MO = MI->getOperand(i); if (!MO.isReg()) continue; // Ignore non-register operands. @@ -328,6 +326,7 @@ if (SuccToSinkTo) { // If a previous operand picked a block to sink to, then this operand // must be sinkable to the same block. + bool LocalUse = false; if (!AllUsesDominatedByBlock(Reg, SuccToSinkTo, ParentBlock, LocalUse)) return false; @@ -338,6 +337,7 @@ // we should sink to. for (MachineBasicBlock::succ_iterator SI = ParentBlock->succ_begin(), E = ParentBlock->succ_end(); SI != E; ++SI) { + bool LocalUse = false; if (AllUsesDominatedByBlock(Reg, *SI, ParentBlock, LocalUse)) { SuccToSinkTo = *SI; break; Added: llvm/trunk/test/CodeGen/X86/MachineSink-PHIUse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/MachineSink-PHIUse.ll?rev=111537&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/MachineSink-PHIUse.ll (added) +++ llvm/trunk/test/CodeGen/X86/MachineSink-PHIUse.ll Thu Aug 19 13:33:29 2010 @@ -0,0 +1,39 @@ +; RUN: llc < %s -mtriple=x86_64-appel-darwin -stats |& grep {machine-sink} + +define fastcc void @t() nounwind ssp { +entry: + br i1 undef, label %bb, label %bb4 + +bb: ; preds = %entry + br i1 undef, label %return, label %bb3 + +bb3: ; preds = %bb + unreachable + +bb4: ; preds = %entry + br i1 undef, label %bb.nph, label %return + +bb.nph: ; preds = %bb4 + br label %bb5 + +bb5: ; preds = %bb9, %bb.nph + %indvar = phi i64 [ 0, %bb.nph ], [ %tmp12, %bb9 ] ; [#uses=1] + %tmp12 = add i64 %indvar, 1 ; [#uses=2] + %tmp13 = trunc i64 %tmp12 to i32 ; [#uses=0] + br i1 undef, label %bb9, label %bb6 + +bb6: ; preds = %bb5 + br i1 undef, label %bb9, label %bb7 + +bb7: ; preds = %bb6 + br i1 undef, label %bb9, label %bb8 + +bb8: ; preds = %bb7 + unreachable + +bb9: ; preds = %bb7, %bb6, %bb5 + br i1 undef, label %bb5, label %return + +return: ; preds = %bb9, %bb4, %bb + ret void +} From echristo at apple.com Thu Aug 19 13:37:20 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 11:37:20 -0700 Subject: [llvm-commits] [llvm] r111499 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h In-Reply-To: References: <20100819012550.CDDB72A6C12C@llvm.org> <39891783-6212-494A-A0B8-81A463CEC3AE@apple.com> Message-ID: On Aug 19, 2010, at 10:37 AM, Bob Wilson wrote: > > On Aug 19, 2010, at 10:33 AM, Eric Christopher wrote: > >> >> On Aug 19, 2010, at 10:28 AM, Daniel Dunbar wrote: >> >>> On Thu, Aug 19, 2010 at 10:20 AM, Eric Christopher wrote: >>>> >>>> On Aug 19, 2010, at 10:03 AM, Daniel Dunbar wrote: >>>> >>>>> Hi Eric, >>>>> >>>>> Did you time the performance impact of this change? >>>>> >>>>> I have some tentative evidence that it may be involved in some compile >>>>> time regressions, but unfortunately the Clang build was broken at the >>>>> time so I don't have an exact commit identified yet. >>>> >>>> I didn't, I'll back it out again. It seems that my nightly tester didn't like it >>>> either. >>> >>> Ok, you don't need to back it out for my sake, I was just curious. >>> Although at least this way I should be able to tell if it was the >>> cause or not. >> >> Yeah something funky was happening on one of my testers too so I'll back it out to >> double check. > > Unlike the last time, I didn't notice any compile time regressions on any of the ARM testers. OK. I think the plaid run on my testers was a configuration error on my side. I'm double checking and if Daniel says that it looks good on his side (no change) then I'll re-recommit it :) -eric From isanbard at gmail.com Thu Aug 19 13:52:02 2010 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 19 Aug 2010 18:52:02 -0000 Subject: [llvm-commits] [llvm] r111539 - /llvm/trunk/unittests/ADT/SmallVectorTest.cpp Message-ID: <20100819185202.7D7E52A6C12D@llvm.org> Author: void Date: Thu Aug 19 13:52:02 2010 New Revision: 111539 URL: http://llvm.org/viewvc/llvm-project?rev=111539&view=rev Log: Silence 'unused' warning. Modified: llvm/trunk/unittests/ADT/SmallVectorTest.cpp Modified: llvm/trunk/unittests/ADT/SmallVectorTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/SmallVectorTest.cpp?rev=111539&r1=111538&r2=111539&view=diff ============================================================================== --- llvm/trunk/unittests/ADT/SmallVectorTest.cpp (original) +++ llvm/trunk/unittests/ADT/SmallVectorTest.cpp Thu Aug 19 13:52:02 2010 @@ -13,6 +13,7 @@ #include "gtest/gtest.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Compiler.h" #include #include @@ -76,7 +77,8 @@ return c0.getValue() == c1.getValue(); } - friend bool operator!=(const Constructable & c0, const Constructable & c1) { + friend bool ATTRIBUTE_UNUSED + operator!=(const Constructable & c0, const Constructable & c1) { return c0.getValue() != c1.getValue(); } }; From isanbard at gmail.com Thu Aug 19 13:52:17 2010 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 19 Aug 2010 18:52:17 -0000 Subject: [llvm-commits] [llvm] r111540 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp Message-ID: <20100819185217.D31642A6C12C@llvm.org> Author: void Date: Thu Aug 19 13:52:17 2010 New Revision: 111540 URL: http://llvm.org/viewvc/llvm-project?rev=111540&view=rev Log: Correct header. Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=111540&r1=111539&r2=111540&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 19 13:52:17 2010 @@ -1,4 +1,4 @@ -//===-- MachineVerifier.cpp - Machine Code Verifier -------------*- C++ -*-===// +//===-- MachineVerifier.cpp - Machine Code Verifier -----------------------===// // // The LLVM Compiler Infrastructure // From echristo at apple.com Thu Aug 19 13:55:15 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 11:55:15 -0700 Subject: [llvm-commits] [llvm] r111540 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp In-Reply-To: <20100819185217.D31642A6C12C@llvm.org> References: <20100819185217.D31642A6C12C@llvm.org> Message-ID: On Aug 19, 2010, at 11:52 AM, Bill Wendling wrote: > -//===-- MachineVerifier.cpp - Machine Code Verifier -------------*- C++ -*-===// > +//===-- MachineVerifier.cpp - Machine Code Verifier -----------------------===// ? It sure looks like c++ to me... -eric From resistor at mac.com Thu Aug 19 14:04:40 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 19 Aug 2010 19:04:40 -0000 Subject: [llvm-commits] [llvm] r111543 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Message-ID: <20100819190440.343CD2A6C12C@llvm.org> Author: resistor Date: Thu Aug 19 14:04:40 2010 New Revision: 111543 URL: http://llvm.org/viewvc/llvm-project?rev=111543&view=rev Log: Tentatively enabled LVI by default. I'll be monitoring for any failures. Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=111543&r1=111542&r2=111543&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Aug 19 14:04:40 2010 @@ -47,7 +47,7 @@ static cl::opt EnableLVI("enable-jump-threading-lvi", cl::desc("Use LVI for jump threading"), - cl::init(false), + cl::init(true), cl::ReallyHidden); From grosser at fim.uni-passau.de Thu Aug 19 14:13:57 2010 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Thu, 19 Aug 2010 21:13:57 +0200 Subject: [llvm-commits] [llvm] r111540 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp In-Reply-To: <9118_1282244166_4C6D7E46_9118_2768_1_E4B28743-2420-4A8E-A773-8AD833AF7A25@apple.com> References: <20100819185217.D31642A6C12C@llvm.org> <9118_1282244166_4C6D7E46_9118_2768_1_E4B28743-2420-4A8E-A773-8AD833AF7A25@apple.com> Message-ID: <4C6D8275.20402@fim.uni-passau.de> On 08/19/2010 08:55 PM, Eric Christopher wrote: > > On Aug 19, 2010, at 11:52 AM, Bill Wendling wrote: > >> -//===-- MachineVerifier.cpp - Machine Code Verifier -------------*- C++ -*-===// >> +//===-- MachineVerifier.cpp - Machine Code Verifier -----------------------===// > > ? > > It sure looks like c++ to me... Sure. But this emacs hint is not required for files that are named *.cpp. It is only needed to recognize that .h files contain C++ and not C. Cheers Tobi From andrewl at lenharth.org Thu Aug 19 14:20:34 2010 From: andrewl at lenharth.org (Andrew Lenharth) Date: Thu, 19 Aug 2010 19:20:34 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111548 - in /llvm-gcc-4.2/trunk/gcc/config/alpha: alpha.h llvm-alpha-target.h llvm-alpha.cpp Message-ID: <20100819192034.C851E2A6C12C@llvm.org> Author: alenhar2 Date: Thu Aug 19 14:20:34 2010 New Revision: 111548 URL: http://llvm.org/viewvc/llvm-project?rev=111548&view=rev Log: move llvm alpha include and handle (once target independent changes go in) shadow i128 returns Added: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h?rev=111548&r1=111547&r2=111548&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h Thu Aug 19 14:20:34 2010 @@ -24,6 +24,9 @@ #ifdef ENABLE_LLVM #undef TARGET_LONG_DOUBLE_128 #define TARGET_LONG_DOUBLE_128 0 + +#include "llvm-alpha-target.h" + #endif /* LLVM LOCAL end */ @@ -1599,28 +1602,3 @@ /* The system headers under Alpha systems are generally C++-aware. */ #define NO_IMPLICIT_EXTERN_C -/* LLVM LOCAL begin */ -#ifdef ENABLE_LLVM - -/* LLVM_TARGET_INTRINSIC_PREFIX - Specify what prefix this target uses for its - * intrinsics. - */ -#define LLVM_TARGET_INTRINSIC_PREFIX "alpha" - -/* LLVM_TARGET_NAME - This specifies the name of the target, which correlates to - * the llvm::InitializeXXXTarget() function. - */ -#define LLVM_TARGET_NAME Alpha - -#define TARGET_ALPHA - -/* LLVM_TARGET_INTRINSIC_LOWER - To handle builtins, we want to expand the - * invocation into normal LLVM code. If the target can handle the builtin, this - * macro should call the target TreeToLLVM::TargetIntrinsicLower method and - * return true.This macro is invoked from a method in the TreeToLLVM class. - */ -#define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, \ - DESTTY, OPS) \ - TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS); -#endif /* ENABLE_LLVM */ -/* LLVM LOCAL end */ Added: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h?rev=111548&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h (added) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h Thu Aug 19 14:20:34 2010 @@ -0,0 +1,38 @@ +/* LLVM LOCAL begin (ENTIRE FILE!) */ +#ifdef ENABLE_LLVM + + +/* LLVM_TARGET_INTRINSIC_PREFIX - Specify what prefix this target uses for its + * intrinsics. + */ +#define LLVM_TARGET_INTRINSIC_PREFIX "alpha" + +/* LLVM_TARGET_NAME - This specifies the name of the target, which correlates to + * the llvm::InitializeXXXTarget() function. + */ +#define LLVM_TARGET_NAME Alpha + +#define TARGET_ALPHA + +/* LLVM_TARGET_INTRINSIC_LOWER - To handle builtins, we want to expand the + * invocation into normal LLVM code. If the target can handle the builtin, this + * macro should call the target TreeToLLVM::TargetIntrinsicLower method and + * return true.This macro is invoked from a method in the TreeToLLVM class. + */ +#define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, \ + DESTTY, OPS) \ + TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS); + +#ifdef LLVM_ABI_H + +extern bool llvm_alpha_should_return_scalar_as_shadow(const Type* Ty); + +/* check if i128 should be a shadow return */ +#define LLVM_SHOULD_RETURN_SCALAR_AS_SHADOW(X) \ + llvm_alpha_should_return_scalar_as_shadow(X) + +#endif /* LLVM_ABI_H */ + +#endif /* ENABLE_LLVM */ +/* LLVM LOCAL end (ENTIRE FILE!) */ + Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=111548&r1=111547&r2=111548&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Thu Aug 19 14:20:34 2010 @@ -183,5 +183,11 @@ return false; } +#include +bool llvm_alpha_should_return_scalar_as_shadow(const Type* Ty) { + if (Ty && Ty->isIntegerTy(128)) + return true; + return false; +} /* LLVM LOCAL end (ENTIRE FILE!) */ From andrewl at lenharth.org Thu Aug 19 14:22:00 2010 From: andrewl at lenharth.org (Andrew Lenharth) Date: Thu, 19 Aug 2010 19:22:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111549 - /llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Message-ID: <20100819192200.E5BFB2A6C12C@llvm.org> Author: alenhar2 Date: Thu Aug 19 14:22:00 2010 New Revision: 111549 URL: http://llvm.org/viewvc/llvm-project?rev=111549&view=rev Log: oops, bogus include Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=111549&r1=111548&r2=111549&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Thu Aug 19 14:22:00 2010 @@ -183,7 +183,7 @@ return false; } -#include + bool llvm_alpha_should_return_scalar_as_shadow(const Type* Ty) { if (Ty && Ty->isIntegerTy(128)) return true; From resistor at mac.com Thu Aug 19 14:47:08 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 19 Aug 2010 19:47:08 -0000 Subject: [llvm-commits] [llvm] r111551 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Message-ID: <20100819194708.A97022A6C12C@llvm.org> Author: resistor Date: Thu Aug 19 14:47:08 2010 New Revision: 111551 URL: http://llvm.org/viewvc/llvm-project?rev=111551&view=rev Log: Disable LVI while I evaluate a failure. Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=111551&r1=111550&r2=111551&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Aug 19 14:47:08 2010 @@ -47,7 +47,7 @@ static cl::opt EnableLVI("enable-jump-threading-lvi", cl::desc("Use LVI for jump threading"), - cl::init(true), + cl::init(false), cl::ReallyHidden); From foldr at codedgers.com Thu Aug 19 15:03:54 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Thu, 19 Aug 2010 20:03:54 -0000 Subject: [llvm-commits] [llvm] r111552 - /llvm/trunk/examples/Makefile Message-ID: <20100819200354.15C622A6C12C@llvm.org> Author: foldr Date: Thu Aug 19 15:03:53 2010 New Revision: 111552 URL: http://llvm.org/viewvc/llvm-project?rev=111552&view=rev Log: Trailing whitespace. Modified: llvm/trunk/examples/Makefile Modified: llvm/trunk/examples/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Makefile?rev=111552&r1=111551&r2=111552&view=diff ============================================================================== --- llvm/trunk/examples/Makefile (original) +++ llvm/trunk/examples/Makefile Thu Aug 19 15:03:53 2010 @@ -1,10 +1,10 @@ ##===- examples/Makefile -----------------------------------*- Makefile -*-===## -# +# # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. -# +# ##===----------------------------------------------------------------------===## LEVEL=.. @@ -13,7 +13,7 @@ PARALLEL_DIRS:= BrainF Fibonacci HowToUseJIT Kaleidoscope ModuleMaker ifeq ($(HAVE_PTHREAD),1) -PARALLEL_DIRS += ParallelJIT +PARALLEL_DIRS += ParallelJIT endif ifeq ($(LLVM_ON_UNIX),1) From foldr at codedgers.com Thu Aug 19 15:04:19 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Thu, 19 Aug 2010 20:04:19 -0000 Subject: [llvm-commits] [llvm] r111553 - in /llvm/trunk: tools/llvmc/ tools/llvmc/example/Hello/ tools/llvmc/example/Simple/ tools/llvmc/example/Skeleton/ tools/llvmc/example/Skeleton/driver/ tools/llvmc/example/Skeleton/plugins/ tools/llvmc/example/Skeleton/plugins/Plugin/ tools/llvmc/example/mcc16/ tools/llvmc/example/mcc16/driver/ tools/llvmc/example/mcc16/plugins/ tools/llvmc/example/mcc16/plugins/PIC16Base/ tools/llvmc/examples/ tools/llvmc/examples/Hello/ tools/llvmc/examples/Simple/ tools/llvmc/examples/Skeleton/ tools/l... Message-ID: <20100819200419.9F6A12A6C12C@llvm.org> Author: foldr Date: Thu Aug 19 15:04:19 2010 New Revision: 111553 URL: http://llvm.org/viewvc/llvm-project?rev=111553&view=rev Log: llvmc: Update examples. Added: llvm/trunk/tools/llvmc/examples/ llvm/trunk/tools/llvmc/examples/Hello/ llvm/trunk/tools/llvmc/examples/Hello/Hello.cpp llvm/trunk/tools/llvmc/examples/Hello/Makefile - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Hello/Makefile llvm/trunk/tools/llvmc/examples/Makefile - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile llvm/trunk/tools/llvmc/examples/Simple/ llvm/trunk/tools/llvmc/examples/Simple/Makefile - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Simple/Makefile llvm/trunk/tools/llvmc/examples/Simple/Simple.cpp llvm/trunk/tools/llvmc/examples/Simple/Simple.td - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Simple/Simple.td llvm/trunk/tools/llvmc/examples/Skeleton/ llvm/trunk/tools/llvmc/examples/Skeleton/AutoGenerated.td - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td llvm/trunk/tools/llvmc/examples/Skeleton/Hooks.cpp - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp llvm/trunk/tools/llvmc/examples/Skeleton/Main.cpp - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp llvm/trunk/tools/llvmc/examples/Skeleton/Makefile llvm/trunk/tools/llvmc/examples/Skeleton/README - copied, changed from r111552, llvm/trunk/tools/llvmc/example/Skeleton/README llvm/trunk/tools/llvmc/examples/mcc16/ llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp - copied, changed from r111552, llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp llvm/trunk/tools/llvmc/examples/mcc16/Main.cpp - copied, changed from r111552, llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp llvm/trunk/tools/llvmc/examples/mcc16/Makefile - copied, changed from r111552, llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile llvm/trunk/tools/llvmc/examples/mcc16/PIC16.td - copied, changed from r111552, llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td llvm/trunk/tools/llvmc/examples/mcc16/README - copied, changed from r111552, llvm/trunk/tools/llvmc/example/mcc16/README Removed: llvm/trunk/tools/llvmc/example/Hello/Hello.cpp llvm/trunk/tools/llvmc/example/Hello/Makefile llvm/trunk/tools/llvmc/example/Simple/Makefile llvm/trunk/tools/llvmc/example/Simple/PluginMain.cpp llvm/trunk/tools/llvmc/example/Simple/Simple.td llvm/trunk/tools/llvmc/example/Skeleton/Makefile llvm/trunk/tools/llvmc/example/Skeleton/README llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp llvm/trunk/tools/llvmc/example/Skeleton/driver/Makefile llvm/trunk/tools/llvmc/example/Skeleton/plugins/Makefile llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp llvm/trunk/tools/llvmc/example/mcc16/Makefile llvm/trunk/tools/llvmc/example/mcc16/README llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp llvm/trunk/tools/llvmc/example/mcc16/driver/Makefile llvm/trunk/tools/llvmc/example/mcc16/plugins/Makefile llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp Modified: llvm/trunk/tools/llvmc/Makefile llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Modified: llvm/trunk/tools/llvmc/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/Makefile?rev=111553&r1=111552&r2=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/Makefile (original) +++ llvm/trunk/tools/llvmc/Makefile Thu Aug 19 15:04:19 2010 @@ -11,4 +11,8 @@ DIRS = src +ifeq ($(BUILD_EXAMPLES),1) + OPTIONAL_DIRS += examples +endif + include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Hello/Hello.cpp?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Hello/Hello.cpp (original) +++ llvm/trunk/tools/llvmc/example/Hello/Hello.cpp (removed) @@ -1,33 +0,0 @@ -//===- Hello.cpp - Example code from "Writing an LLVMC Plugin" ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Test plugin for LLVMC. Shows how to write plugins without using TableGen. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CompilerDriver/CompilationGraph.h" -#include "llvm/CompilerDriver/Plugin.h" -#include "llvm/Support/raw_ostream.h" - -namespace { -struct MyPlugin : public llvmc::BasePlugin { - - void PreprocessOptions() const - {} - - void PopulateLanguageMap(llvmc::LanguageMap&) const - { outs() << "Hello!\n"; } - - void PopulateCompilationGraph(llvmc::CompilationGraph&) const - {} -}; - -static llvmc::RegisterPlugin RP("Hello", "Hello World plugin"); - -} Removed: llvm/trunk/tools/llvmc/example/Hello/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Hello/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Hello/Makefile (original) +++ llvm/trunk/tools/llvmc/example/Hello/Makefile (removed) @@ -1,14 +0,0 @@ -##===- tools/llvmc/plugins/Hello/Makefile ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. - -LLVMC_PLUGIN = Hello - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Simple/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Simple/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Simple/Makefile (original) +++ llvm/trunk/tools/llvmc/example/Simple/Makefile (removed) @@ -1,15 +0,0 @@ -##===- tools/llvmc/plugins/Simple/Makefile -----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. - -LLVMC_PLUGIN = Simple -BUILT_SOURCES = AutoGenerated.inc - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Simple/PluginMain.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Simple/PluginMain.cpp?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Simple/PluginMain.cpp (original) +++ llvm/trunk/tools/llvmc/example/Simple/PluginMain.cpp (removed) @@ -1 +0,0 @@ -#include "AutoGenerated.inc" Removed: llvm/trunk/tools/llvmc/example/Simple/Simple.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Simple/Simple.td?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Simple/Simple.td (original) +++ llvm/trunk/tools/llvmc/example/Simple/Simple.td (removed) @@ -1,37 +0,0 @@ -//===- Simple.td - A simple plugin for LLVMC ------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// A simple LLVMC-based gcc wrapper that shows how to write LLVMC plugins. -// -// To compile, use this command: -// -// $ cd $LLVMC_DIR/example/Simple -// $ make -// -// Run as: -// -// $ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so -// -// For instructions on how to build your own LLVMC-based driver, see -// the 'example/Skeleton' directory. -//===----------------------------------------------------------------------===// - -include "llvm/CompilerDriver/Common.td" - -def gcc : Tool< -[(in_language "c"), - (out_language "executable"), - (output_suffix "out"), - (cmd_line "gcc $INFILE -o $OUTFILE"), - (sink) -]>; - -def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>; - -def CompilationGraph : CompilationGraph<[Edge<"root", "gcc">]>; Removed: llvm/trunk/tools/llvmc/example/Skeleton/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/Makefile (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/Makefile (removed) @@ -1,24 +0,0 @@ -##===- llvmc/example/Skeleton/Makefile ---------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -# Change this so that $(BASE_LEVEL)/Makefile.common refers to -# $LLVM_DIR/Makefile.common or $YOUR_LLVM_BASED_PROJECT/Makefile.common. -export LLVMC_BASE_LEVEL = ../../../.. - -# Change this to the name of your LLVMC-based driver. -export LLVMC_BASED_DRIVER_NAME = llvmc-skeleton - -# List your plugin names here -export LLVMC_BUILTIN_PLUGINS = # Plugin - -LEVEL = $(LLVMC_BASE_LEVEL) - -DIRS = plugins driver - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Skeleton/README URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/README?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/README (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/README (removed) @@ -1,6 +0,0 @@ - -This is a template that can be used to create your own LLVMC-based drivers. Just -copy the `Skeleton` directory to the location of your preference and edit -`Skeleton/Makefile` and `Skeleton/plugins/Plugin`. - -The build system assumes that your project is based on LLVM. Removed: llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp (removed) @@ -1,14 +0,0 @@ -//===--- Main.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open -// Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Just include CompilerDriver/Main.inc. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CompilerDriver/Main.inc" Removed: llvm/trunk/tools/llvmc/example/Skeleton/driver/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/driver/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/driver/Makefile (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/driver/Makefile (removed) @@ -1,13 +0,0 @@ -##===- llvmc/example/Skeleton/driver/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. -LLVMC_BASED_DRIVER = $(LLVMC_BASED_DRIVER_NAME) - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Skeleton/plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/plugins/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/plugins/Makefile (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/plugins/Makefile (removed) @@ -1,18 +0,0 @@ -##===- llvmc/example/Skeleton/plugins/Makefile -------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. - -ifneq ($(LLVMC_BUILTIN_PLUGINS),) -DIRS = $(LLVMC_BUILTIN_PLUGINS) -endif - -export LLVMC_BUILTIN_PLUGIN=1 - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile (removed) @@ -1,17 +0,0 @@ -##===- llvmc/example/Skeleton/plugins/Plugin/Makefile ------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/../.. - -# Change this to the name of your plugin. -LLVMC_PLUGIN = Plugin - -BUILT_SOURCES = AutoGenerated.inc - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td (removed) @@ -1,7 +0,0 @@ -//===- Plugin.td - A skeleton plugin for LLVMC -------------*- tablegen -*-===// -// -// Write the code for your plugin here. -// -//===----------------------------------------------------------------------===// - -include "llvm/CompilerDriver/Common.td" Removed: llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp (original) +++ llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/PluginMain.cpp (removed) @@ -1 +0,0 @@ -#include "AutoGenerated.inc" Removed: llvm/trunk/tools/llvmc/example/mcc16/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/Makefile (original) +++ llvm/trunk/tools/llvmc/example/mcc16/Makefile (removed) @@ -1,18 +0,0 @@ -##===- llvmc/example/mcc16/Makefile ------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -export LLVMC_BASE_LEVEL = ../../../.. -export LLVMC_BASED_DRIVER_NAME = mcc16 -export LLVMC_BUILTIN_PLUGINS = PIC16Base - -LEVEL = $(LLVMC_BASE_LEVEL) - -DIRS = plugins driver - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/mcc16/README URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/README?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/README (original) +++ llvm/trunk/tools/llvmc/example/mcc16/README (removed) @@ -1,75 +0,0 @@ -This is a basic compiler driver for the PIC16 toolchain that shows how to create -your own llvmc-based drivers. It is based on the example/Skeleton template. - -The PIC16 toolchain looks like this: - -clang-cc (FE) -> llvm-ld (optimizer) -> llc (codegen) -> native-as -> native-ld - -Following features were requested by Sanjiv: - -From: Sanjiv Gupta microchip.com> -Subject: Re: llvmc for PIC16 -Newsgroups: gmane.comp.compilers.llvm.devel -Date: 2009-06-05 06:51:14 GMT - -The salient features that we want to have in the driver are: -1. llvm-ld will be used as "The Optimizer". -2. If the user has specified to generate the final executable, then -llvm-ld should run on all the .bc files generated by clang and create a -single optimized .bc file for further tools. -3. -Wo - pass optimizations to the llvm-ld -4. mcc16 -Wl - pass options to native linker. -5. mcc16 -Wa - pass options to native assembler. - -Here are some example command lines and sample command invocations as to -what should be done. - -$ mcc16 -S foo.c -// [clang-cc foo.c] -> foo.bc -// [llvm-ld foo.bc] -> foo.opt.bc -// [llc foo.opt.bc] -> foo.s - -$ mcc16 -S foo.c bar.c -// [clang-cc foo.c] -> foo.bc -// [llvm-ld foo.bc] -> foo.opt.bc -// [llc foo.opt.bc] -> foo.s -// [clang-cc bar.c] -> bar.bc -// [llvm-ld bar.bc] -> bar.opt.bc -// [llc bar.opt.bc] -> bar.s - -** Use of -g causes llvm-ld to run with -disable-opt -$ mcc16 -S -g foo.c -// [clang-cc foo.c] -> foo.bc -// [llvm-ld -disable-opt foo.bc] -> foo.opt.bc -// [llc foo.opt.bc] -> foo.s - -** -I is passed to clang-cc, -pre-RA-sched=list-burr to llc. -$ mcc16 -S -g -I ../include -pre-RA-sched=list-burr foo.c -// [clang-cc -I ../include foo.c] -> foo.bc -// [llvm-ld -disable-opt foo.bc] -> foo.opt.bc -// [llc -pre-RA-sched=list-burr foo.opt.bc] -> foo.s - -** -Wo passes options to llvm-ld -$ mcc16 -Wo=opt1,opt2 -S -I ../include -pre-RA-sched=list-burr foo.c -// [clang-cc -I ../include foo.c] -> foo.bc -// [llvm-ld -opt1 -opt2 foo.bc] -> foo.opt.bc -// [llc -pre-RA-sched=list-burr foo.opt.bc] -> foo.s - -** -Wa passes options to native as. -$ mcc16 -c foo.c -Wa=opt1 -// [clang-cc foo.c] -> foo.bc -// [llvm-ld foo.bc] -> foo.opt.bc -// [llc foo.opt.bc] -> foo.s -// [native-as -opt1 foo.s] -> foo.o - -$ mcc16 -Wo=opt1 -Wl=opt2 -Wa=opt3 foo.c bar.c -// [clang-cc foo.c] -> foo.bc -// [clang-cc bar.c] -> bar.bc -// [llvm-ld -opt1 foo.bc bar.bc] -> a.out.bc -// [llc a.out.bc] -> a.out.s -// [native-as -opt3 a.out.s] -> a.out.o -// [native-ld -opt2 a.out.o] -> a.out - -Is this achievable by a tablegen based driver ? - -- Sanjiv Removed: llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp (original) +++ llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp (removed) @@ -1,54 +0,0 @@ -//===--- Main.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open -// Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Usually this file just includes CompilerDriver/Main.inc, but here we apply -// some trickery to make the built-in '-save-temps' option hidden and enable -// '--temp-dir' by default. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Config/config.h" -#include "llvm/CompilerDriver/BuiltinOptions.h" -#include "llvm/CompilerDriver/ForceLinkage.h" -#include "llvm/System/Path.h" -#include - -namespace llvmc { - int Main(int argc, char** argv); -} - -// Modify the PACKAGE_VERSION to use build number in top level configure file. -void PIC16VersionPrinter(void) { - std::cout << "MPLAB C16 1.0 " << PACKAGE_VERSION << "\n"; -} - -int main(int argc, char** argv) { - - // HACK - SaveTemps.setHiddenFlag(llvm::cl::Hidden); - TempDirname.setHiddenFlag(llvm::cl::Hidden); - Languages.setHiddenFlag(llvm::cl::Hidden); - DryRun.setHiddenFlag(llvm::cl::Hidden); - - llvm::cl::SetVersionPrinter(PIC16VersionPrinter); - - // Ask for a standard temp dir, but just cache its basename., and delete it. - llvm::sys::Path tempDir; - tempDir = llvm::sys::Path::GetTemporaryDirectory(); - TempDirname = tempDir.getBasename(); - tempDir.eraseFromDisk(true); - - // We are creating a temp dir in current dir, with the cached name. - // But before that remove if one already exists with that name.. - tempDir = TempDirname; - tempDir.eraseFromDisk(true); - - llvmc::ForceLinkage(); - return llvmc::Main(argc, argv); -} Removed: llvm/trunk/tools/llvmc/example/mcc16/driver/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/driver/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/driver/Makefile (original) +++ llvm/trunk/tools/llvmc/example/mcc16/driver/Makefile (removed) @@ -1,13 +0,0 @@ -##===- llvmc/example/mcc16/driver/Makefile -----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. -LLVMC_BASED_DRIVER = $(LLVMC_BASED_DRIVER_NAME) - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/mcc16/plugins/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/plugins/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/Makefile (original) +++ llvm/trunk/tools/llvmc/example/mcc16/plugins/Makefile (removed) @@ -1,18 +0,0 @@ -##===- llvmc/example/Skeleton/plugins/Makefile -------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/.. - -ifneq ($(LLVMC_BUILTIN_PLUGINS),) -DIRS = $(LLVMC_BUILTIN_PLUGINS) -endif - -export LLVMC_BUILTIN_PLUGIN=1 - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile (original) +++ llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile (removed) @@ -1,17 +0,0 @@ -##===- llvmc/example/Skeleton/plugins/Plugin/Makefile ------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = $(LLVMC_BASE_LEVEL)/../.. - -# Change this to the name of your plugin. -LLVMC_PLUGIN = PIC16Base - -BUILT_SOURCES = AutoGenerated.inc - -include $(LEVEL)/Makefile.common Removed: llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td (original) +++ llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td (removed) @@ -1,234 +0,0 @@ -//===- PIC16Base.td - PIC16 toolchain driver ---------------*- tablegen -*-===// -// -// A basic driver for the PIC16 toolchain. -// -//===----------------------------------------------------------------------===// - -include "llvm/CompilerDriver/Common.td" - -// Options - -def OptionList : OptionList<[ - (switch_option "g", - (help "Enable Debugging")), - (switch_option "E", - (help "Stop after preprocessing, do not compile")), - (switch_option "S", - (help "Stop after compilation, do not assemble")), - (switch_option "bc", - (help "Stop after b-code generation, do not compile")), - (switch_option "c", - (help "Stop after assemble, do not link")), - (prefix_option "p", - (help "Specify part name")), - (prefix_list_option "I", - (help "Add a directory to include path")), - (prefix_list_option "L", - (help "Add a directory to library path")), - (prefix_list_option "K", - (help "Add a directory to linker script search path")), - (parameter_option "l", - (help "Specify a library to link")), - (parameter_option "k", - (help "Specify a linker script")), - (parameter_option "m", - (help "Generate linker map file with the given name")), - (prefix_list_option "D", - (help "Define a macro")), - (switch_option "X", - (help "Do not invoke mp2hex to create an output hex file.")), - (switch_option "O0", - (help "Do not optimize")), - (switch_option "O1", - (help "Optimization Level 1.")), - (switch_option "O2", - (help "Optimization Level 2.")), - (switch_option "O3", - (help "Optimization Level 3.")), - (switch_option "Od", - (help "Perform Debug-safe Optimizations only.")), - (switch_option "w", - (help "Disable all warnings.")), -// (switch_option "O1", -// (help "Optimization level 1")), -// (switch_option "O2", -// (help "Optimization level 2. (Default)")), -// (parameter_option "pre-RA-sched", -// (help "Example of an option that is passed to llc")), - (parameter_option "regalloc", - (help "Register allocator to use (possible values: simple, linearscan, pbqp, local; default=linearscan)")), - (prefix_list_option "Wa,", (comma_separated), - (help "Pass options to assembler (Run 'gpasm -help' for assembler options)")), - (prefix_list_option "Wl,", (comma_separated), - (help "Pass options to linker (Run 'mplink -help' for linker options)")) -// (prefix_list_option "Wllc,", -// (help "Pass options to llc")), -// (prefix_list_option "Wo,", -// (help "Pass options to llvm-ld")) -]>; - -// Tools -class clang_based : Tool< -[(in_language language), - (out_language "llvm-bitcode"), - (output_suffix "bc"), - (command cmd), - (actions (case - (and (multiple_input_files), - (or (switch_on "S"), (switch_on "c"))), - (error "cannot specify -o with -c or -S with multiple files"), - (switch_on "E"), [(forward "E"), - (stop_compilation), (output_suffix ext_E)], - (and (switch_on "E"), (empty "o")), (no_out_file), - (switch_on "bc"),[(stop_compilation), (output_suffix "bc")], - (switch_on "g"), (append_cmd "-g"), - (switch_on "w"), (append_cmd "-w"), - (switch_on "O1"), (append_cmd ""), - (switch_on "O2"), (append_cmd ""), - (switch_on "O3"), (append_cmd ""), - (switch_on "Od"), (append_cmd ""), - (not_empty "D"), (forward "D"), - (not_empty "I"), (forward "I"), - (switch_on "O0"), (append_cmd "-O0"), - (default), (append_cmd "-O1"))) -// (sink) -]>; - -def clang_cc : clang_based<"c", "$CALL(GetBinDir)clang -cc1 -I $CALL(GetStdHeadersDir) -D $CALL(GetLowerCasePartDefine) -D $CALL(GetUpperCasePartDefine) -triple=pic16- -emit-llvm-bc ", "i">; - -//def clang_cc : Tool<[ -// (in_language "c"), -// (out_language "llvm-bitcode"), -// (output_suffix "bc"), -// (cmd_line "$CALL(GetBinDir)clang-cc -I $CALL(GetStdHeadersDir) -triple=pic16- -emit-llvm-bc "), -// (cmd_line kkkkk -// (actions (case -// (switch_on "g"), (append_cmd "g"), -// (not_empty "I"), (forward "I"))), -// (sink) -//]>; - - -// pre-link-and-lto step. -def llvm_ld : Tool<[ - (in_language "llvm-bitcode"), - (out_language "llvm-bitcode"), - (output_suffix "bc"), - (command "$CALL(GetBinDir)llvm-ld -L $CALL(GetStdLibsDir) -disable-licm-promotion -l std"), - (out_file_option "-b"), - (actions (case - (switch_on "O0"), (append_cmd "-disable-opt"), - (switch_on "O1"), (append_cmd "-disable-opt"), -// Whenever O3 is not specified on the command line, default i.e. disable-inlining will always be added. - (switch_on "O2"), (append_cmd ""), - (switch_on "O3"), (append_cmd ""), - (default), (append_cmd "-disable-inlining"))), - (join) -]>; - -// optimize single file -def llvm_ld_optimizer : Tool<[ - (in_language "llvm-bitcode"), - (out_language "llvm-bitcode"), - (output_suffix "bc"), -// FIXME: we are still not disabling licm-promotion. -// -disable-licm-promotion and building stdn library causes c16-71 to fail. - (command "$CALL(GetBinDir)llvm-ld "), - (out_file_option "-b"), - (actions (case - (switch_on "O0"), (append_cmd "-disable-opt"), - (switch_on "O1"), (append_cmd "-disable-opt"), -// Whenever O3 is not specified on the command line, default i.e. disable-inlining will always be added. - (switch_on "O2"), (append_cmd ""), - (switch_on "O3"), (append_cmd ""), - (default), (append_cmd "-disable-inlining"))) -]>; - -// optimizer step. -def pic16passes : Tool<[ - (in_language "llvm-bitcode"), - (out_language "llvm-bitcode"), - (output_suffix "obc"), - (command "$CALL(GetBinDir)opt -pic16cloner -pic16overlay -f"), - (actions (case - (switch_on "O0"), (append_cmd "-disable-opt"))) -]>; - -def llc : Tool<[ - (in_language "llvm-bitcode"), - (out_language "assembler"), - (output_suffix "s"), - (command "$CALL(GetBinDir)llc -march=pic16 -disable-jump-tables -pre-RA-sched=list-burr -f"), - (actions (case - (switch_on "S"), (stop_compilation), -// (not_empty "Wllc,"), (unpack_values "Wllc,"), -// (not_empty "pre-RA-sched"), (forward "pre-RA-sched"))) - (not_empty "regalloc"), (forward "regalloc"), - (empty "regalloc"), (append_cmd "-regalloc=linearscan"))) -]>; - -def gpasm : Tool<[ - (in_language "assembler"), - (out_language "object-code"), - (output_suffix "o"), - (command "$CALL(GetBinDir)gpasm -z -r decimal -I $CALL(GetStdAsmHeadersDir) -C -c -w 2"), - (actions (case - (switch_on "c"), (stop_compilation), - (switch_on "g"), (append_cmd "-g"), - (not_empty "p"), (forward "p"), - (empty "p"), (append_cmd "-p 16f1xxx"), - (not_empty "Wa,"), (forward_value "Wa,"))) -]>; - -def mplink : Tool<[ - (in_language "object-code"), - (out_language "executable"), - (output_suffix "cof"), - (command "$CALL(GetBinDir)mplink -e -k $CALL(GetStdLinkerScriptsDir) -l $CALL(GetStdLibsDir) intrinsics.lib stdn.lib"), - (actions (case - (not_empty "Wl,"), (forward_value "Wl,"), - (switch_on "X"), (append_cmd "-x"), - (not_empty "L"), (forward_as "L", "-l"), - (not_empty "K"), (forward_as "K", "-k"), - (not_empty "m"), (forward "m"), - (not_empty "p"), [(forward "p"), (append_cmd "-c")], - (empty "p"), (append_cmd "-p 16f1xxx -c"), -// (not_empty "l"), [(unpack_values "l"),(append_cmd ".lib")])), - (not_empty "k"), (forward "k"), - (not_empty "l"), (forward "l"))), - (join) -]>; - -// Language map - -def LanguageMap : LanguageMap<[ - LangToSuffixes<"c", ["c"]>, - LangToSuffixes<"c-cpp-output", ["i"]>, - LangToSuffixes<"assembler", ["s"]>, - LangToSuffixes<"assembler-with-cpp", ["S"]>, - LangToSuffixes<"llvm-assembler", ["ll"]>, - LangToSuffixes<"llvm-bitcode", ["bc"]>, - LangToSuffixes<"object-code", ["o"]>, - LangToSuffixes<"executable", ["cof"]> -]>; - -// Compilation graph - -def CompilationGraph : CompilationGraph<[ - Edge<"root", "clang_cc">, - Edge<"root", "llvm_ld">, - OptionalEdge<"root", "llvm_ld_optimizer", (case - (switch_on "S"), (inc_weight), - (switch_on "c"), (inc_weight))>, - Edge<"root", "gpasm">, - Edge<"root", "mplink">, - Edge<"clang_cc", "llvm_ld">, - OptionalEdge<"clang_cc", "llvm_ld_optimizer", (case - (switch_on "S"), (inc_weight), - (switch_on "c"), (inc_weight))>, - Edge<"llvm_ld", "pic16passes">, - Edge<"llvm_ld_optimizer", "pic16passes">, - Edge<"pic16passes", "llc">, - Edge<"llc", "gpasm">, - Edge<"gpasm", "mplink"> -]>; Removed: llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp?rev=111552&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp (original) +++ llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp (removed) @@ -1,106 +0,0 @@ -#include "AutoGenerated.inc" - -#include "llvm/System/Path.h" -#include "llvm/Support/raw_ostream.h" - -using namespace llvm; - -namespace llvmc { - extern char *ProgramName; -} - - - -// Returns the platform specific directory separator via #ifdefs. -// FIXME: This currently work on linux and windows only. It does not -// work on other unices. -static std::string GetDirSeparator() { -#if __linux__ || __APPLE__ - return "/"; -#else - return "\\"; -#endif -} - -namespace hooks { -// Get preprocessor define for the part. -// It is __partname format in lower case. -std::string -GetLowerCasePartDefine(void) { - std::string Partname; - if (AutoGeneratedParameter_p.empty()) { - Partname = "16f1xxx"; - } else { - Partname = AutoGeneratedParameter_p; - } - - std::string LowerCase; - for (unsigned i = 0; i < Partname.size(); i++) { - LowerCase.push_back(std::tolower(Partname[i])); - } - - return "__" + LowerCase; -} - -std::string -GetUpperCasePartDefine(void) { - std::string Partname; - if (AutoGeneratedParameter_p.empty()) { - Partname = "16f1xxx"; - } else { - Partname = AutoGeneratedParameter_p; - } - - std::string UpperCase; - for (unsigned i = 0; i < Partname.size(); i++) { - UpperCase.push_back(std::toupper(Partname[i])); - } - - return "__" + UpperCase; -} - - -// Get the dir where c16 executables reside. -std::string GetBinDir() { - // Construct a Path object from the program name. - void *P = (void*) (intptr_t) GetBinDir; - sys::Path ProgramFullPath - = sys::Path::GetMainExecutable(llvmc::ProgramName, P); - - // Get the dir name for the program. It's last component should be 'bin'. - std::string BinDir = ProgramFullPath.getDirname(); - - // llvm::errs() << "BinDir: " << BinDir << '\n'; - return BinDir + GetDirSeparator(); -} - -// Get the Top-level Installation dir for c16. -std::string GetInstallDir() { - sys::Path BinDirPath = sys::Path(GetBinDir()); - - // Go one more level up to get the install dir. - std::string InstallDir = BinDirPath.getDirname(); - - return InstallDir + GetDirSeparator(); -} - -// Get the dir where the c16 header files reside. -std::string GetStdHeadersDir() { - return GetInstallDir() + "include"; -} - -// Get the dir where the assembler header files reside. -std::string GetStdAsmHeadersDir() { - return GetInstallDir() + "inc"; -} - -// Get the dir where the linker scripts reside. -std::string GetStdLinkerScriptsDir() { - return GetInstallDir() + "lkr"; -} - -// Get the dir where startup code, intrinsics and lib reside. -std::string GetStdLibsDir() { - return GetInstallDir() + "lib"; -} -} Added: llvm/trunk/tools/llvmc/examples/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Hello/Hello.cpp?rev=111553&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/examples/Hello/Hello.cpp (added) +++ llvm/trunk/tools/llvmc/examples/Hello/Hello.cpp Thu Aug 19 15:04:19 2010 @@ -0,0 +1,29 @@ +//===- Hello.cpp - Example code from "Writing an LLVMC Plugin" ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Shows how to write llvmc-based drivers without using TableGen. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CompilerDriver/AutoGenerated.h" +#include "llvm/CompilerDriver/Main.inc" + +#include "llvm/Support/raw_ostream.h" + +namespace llvmc { +namespace autogenerated { + +int PreprocessOptions () { return 0; } + +int PopulateLanguageMap (LanguageMap&) { llvm::outs() << "Hello!\n"; return 0; } + +int PopulateCompilationGraph (CompilationGraph&) { return 0; } + +} +} Copied: llvm/trunk/tools/llvmc/examples/Hello/Makefile (from r111552, llvm/trunk/tools/llvmc/example/Hello/Makefile) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Hello/Makefile?p2=llvm/trunk/tools/llvmc/examples/Hello/Makefile&p1=llvm/trunk/tools/llvmc/example/Hello/Makefile&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Hello/Makefile (original) +++ llvm/trunk/tools/llvmc/examples/Hello/Makefile Thu Aug 19 15:04:19 2010 @@ -9,6 +9,6 @@ LEVEL = ../../../.. -LLVMC_PLUGIN = Hello +LLVMC_BASED_DRIVER = Hello include $(LEVEL)/Makefile.common Copied: llvm/trunk/tools/llvmc/examples/Makefile (from r111552, llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Makefile?p2=llvm/trunk/tools/llvmc/examples/Makefile&p1=llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Makefile (original) +++ llvm/trunk/tools/llvmc/examples/Makefile Thu Aug 19 15:04:19 2010 @@ -1,4 +1,4 @@ -##===- llvmc/example/Skeleton/plugins/Plugin/Makefile ------*- Makefile -*-===## +##===- tools/llvmc/examples/Makefile -----------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -7,11 +7,8 @@ # ##===----------------------------------------------------------------------===## -LEVEL = $(LLVMC_BASE_LEVEL)/../.. +LEVEL=../../.. -# Change this to the name of your plugin. -LLVMC_PLUGIN = Plugin - -BUILT_SOURCES = AutoGenerated.inc +PARALLEL_DIRS := Hello Simple mcc16 Skeleton include $(LEVEL)/Makefile.common Copied: llvm/trunk/tools/llvmc/examples/Simple/Makefile (from r111552, llvm/trunk/tools/llvmc/example/Simple/Makefile) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Simple/Makefile?p2=llvm/trunk/tools/llvmc/examples/Simple/Makefile&p1=llvm/trunk/tools/llvmc/example/Simple/Makefile&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Simple/Makefile (original) +++ llvm/trunk/tools/llvmc/examples/Simple/Makefile Thu Aug 19 15:04:19 2010 @@ -1,4 +1,4 @@ -##===- tools/llvmc/plugins/Simple/Makefile -----------------*- Makefile -*-===## +##===- llvmc/examples/Simple/Makefile ----------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -9,7 +9,7 @@ LEVEL = ../../../.. -LLVMC_PLUGIN = Simple -BUILT_SOURCES = AutoGenerated.inc +LLVMC_BASED_DRIVER = Simple +BUILT_SOURCES = Simple.inc include $(LEVEL)/Makefile.common Added: llvm/trunk/tools/llvmc/examples/Simple/Simple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Simple/Simple.cpp?rev=111553&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/examples/Simple/Simple.cpp (added) +++ llvm/trunk/tools/llvmc/examples/Simple/Simple.cpp Thu Aug 19 15:04:19 2010 @@ -0,0 +1,2 @@ +#include "llvm/CompilerDriver/Main.inc" +#include "Simple.inc" Copied: llvm/trunk/tools/llvmc/examples/Simple/Simple.td (from r111552, llvm/trunk/tools/llvmc/example/Simple/Simple.td) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Simple/Simple.td?p2=llvm/trunk/tools/llvmc/examples/Simple/Simple.td&p1=llvm/trunk/tools/llvmc/example/Simple/Simple.td&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Simple/Simple.td (original) +++ llvm/trunk/tools/llvmc/examples/Simple/Simple.td Thu Aug 19 15:04:19 2010 @@ -1,4 +1,4 @@ -//===- Simple.td - A simple plugin for LLVMC ------------------------------===// +//===- Simple.td - A simple LLVMC-based driver ----------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,19 +7,19 @@ // //===----------------------------------------------------------------------===// // -// A simple LLVMC-based gcc wrapper that shows how to write LLVMC plugins. +// A simple LLVMC-based gcc wrapper. // // To compile, use this command: // -// $ cd $LLVMC_DIR/example/Simple -// $ make +// $ cd $LLVM_OBJ_DIR/tools/llvmc +// $ make BUILD_EXAMPLES=1 // // Run as: // -// $ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so +// $ $LLVM_OBJ_DIR/$(BuildMode)/bin/Simple // // For instructions on how to build your own LLVMC-based driver, see -// the 'example/Skeleton' directory. +// the 'examples/Skeleton' directory. //===----------------------------------------------------------------------===// include "llvm/CompilerDriver/Common.td" @@ -28,8 +28,12 @@ [(in_language "c"), (out_language "executable"), (output_suffix "out"), - (cmd_line "gcc $INFILE -o $OUTFILE"), - (sink) + (command "gcc"), + (sink), + + // -o is what is used by default, out_file_option here is included for + // instructive purposes. + (out_file_option "-o") ]>; def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>; Copied: llvm/trunk/tools/llvmc/examples/Skeleton/AutoGenerated.td (from r111552, llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Skeleton/AutoGenerated.td?p2=llvm/trunk/tools/llvmc/examples/Skeleton/AutoGenerated.td&p1=llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/plugins/Plugin/Plugin.td (original) +++ llvm/trunk/tools/llvmc/examples/Skeleton/AutoGenerated.td Thu Aug 19 15:04:19 2010 @@ -1,6 +1,6 @@ -//===- Plugin.td - A skeleton plugin for LLVMC -------------*- tablegen -*-===// +//===- AutoGenerated.td ------------------------------------*- tablegen -*-===// // -// Write the code for your plugin here. +// Write the TableGen description of your llvmc-based driver here. // //===----------------------------------------------------------------------===// Copied: llvm/trunk/tools/llvmc/examples/Skeleton/Hooks.cpp (from r111552, llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Skeleton/Hooks.cpp?p2=llvm/trunk/tools/llvmc/examples/Skeleton/Hooks.cpp&p1=llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp (original) +++ llvm/trunk/tools/llvmc/examples/Skeleton/Hooks.cpp Thu Aug 19 15:04:19 2010 @@ -1,4 +1,4 @@ -//===--- Main.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===// +//===--- Hooks.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,6 @@ // //===----------------------------------------------------------------------===// // -// Just include CompilerDriver/Main.inc. +// Hook definitions should go here. // //===----------------------------------------------------------------------===// - -#include "llvm/CompilerDriver/Main.inc" Copied: llvm/trunk/tools/llvmc/examples/Skeleton/Main.cpp (from r111552, llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Skeleton/Main.cpp?p2=llvm/trunk/tools/llvmc/examples/Skeleton/Main.cpp&p1=llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/driver/Main.cpp (original) +++ llvm/trunk/tools/llvmc/examples/Skeleton/Main.cpp Thu Aug 19 15:04:19 2010 @@ -7,8 +7,9 @@ // //===----------------------------------------------------------------------===// // -// Just include CompilerDriver/Main.inc. +// Just include CompilerDriver/Main.inc and AutoGenerated.inc. // //===----------------------------------------------------------------------===// #include "llvm/CompilerDriver/Main.inc" +#include "AutoGenerated.inc" Added: llvm/trunk/tools/llvmc/examples/Skeleton/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Skeleton/Makefile?rev=111553&view=auto ============================================================================== --- llvm/trunk/tools/llvmc/examples/Skeleton/Makefile (added) +++ llvm/trunk/tools/llvmc/examples/Skeleton/Makefile Thu Aug 19 15:04:19 2010 @@ -0,0 +1,20 @@ +##===- llvmc/examples/Skeleton/Makefile --------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open +# Source License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +# Change this so that $(LEVEL)/Makefile.common refers to +# $LLVM_OBJ_DIR/Makefile.common or $YOUR_LLVM_BASED_PROJECT/Makefile.common. +export LEVEL = ../../../.. + +# Change this to the name of your LLVMC-based driver. +LLVMC_BASED_DRIVER = llvmc-skeleton + +# Change this to the name of .inc file built from your .td file. +BUILT_SOURCES = AutoGenerated.inc + +include $(LEVEL)/Makefile.common Copied: llvm/trunk/tools/llvmc/examples/Skeleton/README (from r111552, llvm/trunk/tools/llvmc/example/Skeleton/README) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Skeleton/README?p2=llvm/trunk/tools/llvmc/examples/Skeleton/README&p1=llvm/trunk/tools/llvmc/example/Skeleton/README&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/Skeleton/README (original) +++ llvm/trunk/tools/llvmc/examples/Skeleton/README Thu Aug 19 15:04:19 2010 @@ -1,6 +1,6 @@ This is a template that can be used to create your own LLVMC-based drivers. Just copy the `Skeleton` directory to the location of your preference and edit -`Skeleton/Makefile` and `Skeleton/plugins/Plugin`. +`Skeleton/Makefile` and `Skeleton/AutoGenerated.inc`. The build system assumes that your project is based on LLVM. Copied: llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp (from r111552, llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp?p2=llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp&p1=llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp Thu Aug 19 15:04:19 2010 @@ -1,19 +1,20 @@ -#include "AutoGenerated.inc" - #include "llvm/System/Path.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" +#include + using namespace llvm; namespace llvmc { extern char *ProgramName; } - +extern cl::opt AutoGeneratedParameter_p; // Returns the platform specific directory separator via #ifdefs. -// FIXME: This currently work on linux and windows only. It does not -// work on other unices. +// FIXME: This currently work on linux and windows only. It does not +// work on other unices. static std::string GetDirSeparator() { #if __linux__ || __APPLE__ return "/"; @@ -59,12 +60,11 @@ return "__" + UpperCase; } - // Get the dir where c16 executables reside. std::string GetBinDir() { - // Construct a Path object from the program name. + // Construct a Path object from the program name. void *P = (void*) (intptr_t) GetBinDir; - sys::Path ProgramFullPath + sys::Path ProgramFullPath = sys::Path::GetMainExecutable(llvmc::ProgramName, P); // Get the dir name for the program. It's last component should be 'bin'. @@ -80,7 +80,7 @@ // Go one more level up to get the install dir. std::string InstallDir = BinDirPath.getDirname(); - + return InstallDir + GetDirSeparator(); } Copied: llvm/trunk/tools/llvmc/examples/mcc16/Main.cpp (from r111552, llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/Main.cpp?p2=llvm/trunk/tools/llvmc/examples/mcc16/Main.cpp&p1=llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/driver/Main.cpp (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/Main.cpp Thu Aug 19 15:04:19 2010 @@ -13,21 +13,25 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Config/config.h" #include "llvm/CompilerDriver/BuiltinOptions.h" -#include "llvm/CompilerDriver/ForceLinkage.h" +#include "llvm/CompilerDriver/Main.h" + #include "llvm/System/Path.h" +#include "llvm/Config/config.h" + #include -namespace llvmc { - int Main(int argc, char** argv); -} +#include "PIC16.inc" + +namespace { // Modify the PACKAGE_VERSION to use build number in top level configure file. void PIC16VersionPrinter(void) { std::cout << "MPLAB C16 1.0 " << PACKAGE_VERSION << "\n"; } +} + int main(int argc, char** argv) { // HACK @@ -36,7 +40,7 @@ Languages.setHiddenFlag(llvm::cl::Hidden); DryRun.setHiddenFlag(llvm::cl::Hidden); - llvm::cl::SetVersionPrinter(PIC16VersionPrinter); + llvm::cl::SetVersionPrinter(PIC16VersionPrinter); // Ask for a standard temp dir, but just cache its basename., and delete it. llvm::sys::Path tempDir; @@ -49,6 +53,5 @@ tempDir = TempDirname; tempDir.eraseFromDisk(true); - llvmc::ForceLinkage(); return llvmc::Main(argc, argv); } Copied: llvm/trunk/tools/llvmc/examples/mcc16/Makefile (from r111552, llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/Makefile?p2=llvm/trunk/tools/llvmc/examples/mcc16/Makefile&p1=llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/Makefile (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/Makefile Thu Aug 19 15:04:19 2010 @@ -1,4 +1,4 @@ -##===- llvmc/example/Skeleton/plugins/Plugin/Makefile ------*- Makefile -*-===## +##===- llvmc/examples/mcc16/Makefile -----------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -7,11 +7,9 @@ # ##===----------------------------------------------------------------------===## -LEVEL = $(LLVMC_BASE_LEVEL)/../.. +LEVEL = ../../../.. -# Change this to the name of your plugin. -LLVMC_PLUGIN = PIC16Base - -BUILT_SOURCES = AutoGenerated.inc +LLVMC_BASED_DRIVER = mcc16 +BUILT_SOURCES = PIC16.inc include $(LEVEL)/Makefile.common Copied: llvm/trunk/tools/llvmc/examples/mcc16/PIC16.td (from r111552, llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/PIC16.td?p2=llvm/trunk/tools/llvmc/examples/mcc16/PIC16.td&p1=llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/PIC16.td Thu Aug 19 15:04:19 2010 @@ -1,4 +1,4 @@ -//===- PIC16Base.td - PIC16 toolchain driver ---------------*- tablegen -*-===// +//===- PIC16.td - PIC16 toolchain driver -------------------*- tablegen -*-===// // // A basic driver for the PIC16 toolchain. // Copied: llvm/trunk/tools/llvmc/examples/mcc16/README (from r111552, llvm/trunk/tools/llvmc/example/mcc16/README) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/README?p2=llvm/trunk/tools/llvmc/examples/mcc16/README&p1=llvm/trunk/tools/llvmc/example/mcc16/README&r1=111552&r2=111553&rev=111553&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/example/mcc16/README (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/README Thu Aug 19 15:04:19 2010 @@ -1,5 +1,5 @@ This is a basic compiler driver for the PIC16 toolchain that shows how to create -your own llvmc-based drivers. It is based on the example/Skeleton template. +your own llvmc-based drivers. It is based on the examples/Skeleton template. The PIC16 toolchain looks like this: Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=111553&r1=111552&r2=111553&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Thu Aug 19 15:04:19 2010 @@ -2950,8 +2950,6 @@ << "using namespace llvm;\n" << "using namespace llvmc;\n\n" - << "extern cl::opt OutputFilename;\n\n" - << "inline const char* checkCString(const char* s)\n" << "{ return s == NULL ? \"\" : s; }\n\n"; } From wendling at apple.com Thu Aug 19 15:05:53 2010 From: wendling at apple.com (Bill Wendling) Date: Thu, 19 Aug 2010 13:05:53 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r111548 - in /llvm-gcc-4.2/trunk/gcc/config/alpha: alpha.h llvm-alpha-target.h llvm-alpha.cpp In-Reply-To: <20100819192034.C851E2A6C12C@llvm.org> References: <20100819192034.C851E2A6C12C@llvm.org> Message-ID: <86432A90-C2FD-4163-B46B-04289F9538BA@apple.com> On Aug 19, 2010, at 12:20 PM, Andrew Lenharth wrote: > Author: alenhar2 > Date: Thu Aug 19 14:20:34 2010 > New Revision: 111548 > > URL: http://llvm.org/viewvc/llvm-project?rev=111548&view=rev > Log: > move llvm alpha include and handle (once target independent changes go in) shadow i128 returns > > Added: > llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h > Modified: > llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h > llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=111548&r1=111547&r2=111548&view=diff > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Thu Aug 19 14:20:34 2010 > @@ -183,5 +183,11 @@ > > return false; > } > +#include Do you need this #include? -bw > +bool llvm_alpha_should_return_scalar_as_shadow(const Type* Ty) { > + if (Ty && Ty->isIntegerTy(128)) > + return true; > + return false; > +} > > /* LLVM LOCAL end (ENTIRE FILE!) */ > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From andrewl at lenharth.org Thu Aug 19 15:10:42 2010 From: andrewl at lenharth.org (Andrew Lenharth) Date: Thu, 19 Aug 2010 15:10:42 -0500 Subject: [llvm-commits] [llvm-gcc-4.2] r111548 - in /llvm-gcc-4.2/trunk/gcc/config/alpha: alpha.h llvm-alpha-target.h llvm-alpha.cpp In-Reply-To: <86432A90-C2FD-4163-B46B-04289F9538BA@apple.com> References: <20100819192034.C851E2A6C12C@llvm.org> <86432A90-C2FD-4163-B46B-04289F9538BA@apple.com> Message-ID: already fixed On Thu, Aug 19, 2010 at 3:05 PM, Bill Wendling wrote: > On Aug 19, 2010, at 12:20 PM, Andrew Lenharth wrote: > >> Author: alenhar2 >> Date: Thu Aug 19 14:20:34 2010 >> New Revision: 111548 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111548&view=rev >> Log: >> move llvm alpha include and handle (once target independent changes go in) shadow i128 returns >> >> Added: >> ? ?llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha-target.h >> Modified: >> ? ?llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h >> ? ?llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp >> >> Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=111548&r1=111547&r2=111548&view=diff >> ============================================================================== >> --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (original) >> +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Thu Aug 19 14:20:34 2010 >> @@ -183,5 +183,11 @@ >> >> ? return false; >> } >> +#include > > Do you need this #include? > > -bw > >> +bool llvm_alpha_should_return_scalar_as_shadow(const Type* Ty) { >> + ?if (Ty && Ty->isIntegerTy(128)) >> + ? ?return true; >> + ?return false; >> +} >> >> /* LLVM LOCAL end (ENTIRE FILE!) ?*/ >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From echristo at apple.com Thu Aug 19 15:14:05 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 19 Aug 2010 13:14:05 -0700 Subject: [llvm-commits] [llvm] r111540 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp In-Reply-To: <4C6D8275.20402@fim.uni-passau.de> References: <20100819185217.D31642A6C12C@llvm.org> <9118_1282244166_4C6D7E46_9118_2768_1_E4B28743-2420-4A8E-A773-8AD833AF7A25@apple.com> <4C6D8275.20402@fim.uni-passau.de> Message-ID: <996699AD-0BF3-49B3-B72D-E156C99C80BE@apple.com> On Aug 19, 2010, at 12:13 PM, Tobias Grosser wrote: > On 08/19/2010 08:55 PM, Eric Christopher wrote: >> >> On Aug 19, 2010, at 11:52 AM, Bill Wendling wrote: >> >>> -//===-- MachineVerifier.cpp - Machine Code Verifier -------------*- C++ -*-===// >>> +//===-- MachineVerifier.cpp - Machine Code Verifier -----------------------===// >> >> ? >> >> It sure looks like c++ to me... > > Sure. But this emacs hint is not required for files that are named *.cpp. It is only needed to recognize that .h files contain C++ and not C. Aah. Fair enough. I thought other things read that as well, but I use emacs so I don't really care :) -eric From wdietz2 at illinois.edu Thu Aug 19 16:16:06 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Thu, 19 Aug 2010 21:16:06 -0000 Subject: [llvm-commits] [poolalloc] r111562 - /poolalloc/trunk/test/dsa/regression/2010-08-19-SimpleCallGraph.ll Message-ID: <20100819211606.6CB242A6C12C@llvm.org> Author: wdietz2 Date: Thu Aug 19 16:16:06 2010 New Revision: 111562 URL: http://llvm.org/viewvc/llvm-project?rev=111562&view=rev Log: Test to reproduce PR7929, from bugzilla. Added: poolalloc/trunk/test/dsa/regression/2010-08-19-SimpleCallGraph.ll Added: poolalloc/trunk/test/dsa/regression/2010-08-19-SimpleCallGraph.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2010-08-19-SimpleCallGraph.ll?rev=111562&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/regression/2010-08-19-SimpleCallGraph.ll (added) +++ poolalloc/trunk/test/dsa/regression/2010-08-19-SimpleCallGraph.ll Thu Aug 19 16:16:06 2010 @@ -0,0 +1,100 @@ +; ModuleID = 'test.c' +; RUN: dsaopt %s -calltarget -analyze +; RUN: dsaopt %s -calltarget -dsa-no-filter-callcc=false -analyze +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-apple-darwin10.4" + +%struct.a = type { i32, i32, i32, i32, i32, i32, i32, i32 } + +define i32 @func1(%struct.a* byval %bar) nounwind ssp { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = getelementptr inbounds %struct.a* %bar, i32 0, i32 6 ; [#uses=1] + %2 = load i32* %1, align 4 ; [#uses=1] + %3 = getelementptr inbounds %struct.a* %bar, i32 0, i32 0 ; [#uses=1] + store i32 %2, i32* %3, align 4 + %4 = getelementptr inbounds %struct.a* %bar, i32 0, i32 1 ; [#uses=1] + %5 = load i32* %4, align 4 ; [#uses=1] + %6 = mul nsw i32 %5, 2 ; [#uses=1] + store i32 %6, i32* %0, align 4 + %7 = load i32* %0, align 4 ; [#uses=1] + store i32 %7, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} + +define i32 @func2(%struct.a* %bar) nounwind ssp { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = getelementptr inbounds %struct.a* %bar, i32 0, i32 6 ; [#uses=1] + %2 = load i32* %1, align 4 ; [#uses=1] + %3 = getelementptr inbounds %struct.a* %bar, i32 0, i32 0 ; [#uses=1] + store i32 %2, i32* %3, align 4 + %4 = getelementptr inbounds %struct.a* %bar, i32 0, i32 0 ; [#uses=1] + %5 = load i32* %4, align 4 ; [#uses=1] + %6 = getelementptr inbounds %struct.a* %bar, i32 0, i32 1 ; [#uses=1] + %7 = load i32* %6, align 4 ; [#uses=1] + %8 = add nsw i32 %5, %7 ; [#uses=1] + %9 = getelementptr inbounds %struct.a* %bar, i32 0, i32 2 ; [#uses=1] + %10 = load i32* %9, align 4 ; [#uses=1] + %11 = add nsw i32 %8, %10 ; [#uses=1] + %12 = getelementptr inbounds %struct.a* %bar, i32 0, i32 7 ; [#uses=1] + %13 = load i32* %12, align 4 ; [#uses=1] + %14 = add nsw i32 %11, %13 ; [#uses=1] + store i32 %14, i32* %0, align 4 + %15 = load i32* %0, align 4 ; [#uses=1] + store i32 %15, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} + +define i32 @main(i32 %argc, i8** %argv) nounwind ssp { +entry: + %argc_addr = alloca i32 ; [#uses=3] + %argv_addr = alloca i8** ; [#uses=1] + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %data = alloca %struct.a ; <%struct.a*> [#uses=3] + %f = alloca i32 (%struct.a*)* ; [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %argc, i32* %argc_addr + store i8** %argv, i8*** %argv_addr + %1 = getelementptr inbounds %struct.a* %data, i32 0, i32 0 ; [#uses=1] + %2 = load i32* %argc_addr, align 4 ; [#uses=1] + store i32 %2, i32* %1, align 4 + %3 = load i32* %argc_addr, align 4 ; [#uses=1] + %4 = icmp sle i32 %3, 1 ; [#uses=1] + br i1 %4, label %bb, label %bb1 + +bb: ; preds = %entry + store i32 (%struct.a*)* @func1, i32 (%struct.a*)** %f, align 8 + br label %bb2 + +bb1: ; preds = %entry + store i32 (%struct.a*)* @func2, i32 (%struct.a*)** %f, align 8 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %5 = load i32 (%struct.a*)** %f, align 8 ; [#uses=1] + %6 = call fastcc i32 %5(%struct.a* byval %data) nounwind ; [#uses=0] + %7 = getelementptr inbounds %struct.a* %data, i32 0, i32 0 ; [#uses=1] + %8 = load i32* %7, align 4 ; [#uses=1] + store i32 %8, i32* %0, align 4 + %9 = load i32* %0, align 4 ; [#uses=1] + store i32 %9, i32* %retval, align 4 + br label %return + +return: ; preds = %bb2 + %retval3 = load i32* %retval ; [#uses=1] + ret i32 %retval3 +} From resistor at mac.com Thu Aug 19 17:15:40 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 19 Aug 2010 22:15:40 -0000 Subject: [llvm-commits] [llvm] r111568 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Message-ID: <20100819221540.B82312A6C12C@llvm.org> Author: resistor Date: Thu Aug 19 17:15:40 2010 New Revision: 111568 URL: http://llvm.org/viewvc/llvm-project?rev=111568&view=rev Log: When a set of bitmask operations, typically from a bitfield initialization, only modifies the low bytes of a value, we can narrow the store to only over-write the affected bytes. Added: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=111568&r1=111567&r2=111568&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Thu Aug 19 17:15:40 2010 @@ -14,11 +14,13 @@ #include "InstCombine.h" #include "llvm/IntrinsicInst.h" #include "llvm/Analysis/Loads.h" +#include "llvm/Support/PatternMatch.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/Statistic.h" using namespace llvm; +using namespace PatternMatch; STATISTIC(NumDeadStore, "Number of dead stores eliminated"); @@ -473,6 +475,49 @@ if (SI.isVolatile()) return 0; // Don't hack volatile stores. + // Attempt to narrow sequences where we load a wide value, perform bitmasks + // that only affect the low bits of it, and then store it back. This + // typically arises from bitfield initializers in C++. + ConstantInt *CI1 =0, *CI2 = 0; + Value *Ld = 0; + if (getTargetData() && + match(SI.getValueOperand(), + m_And(m_Or(m_Value(Ld), m_ConstantInt(CI1)), m_ConstantInt(CI2))) && + isa(Ld) && + equivalentAddressValues(cast(Ld)->getPointerOperand(), Ptr)) { + APInt OrMask = CI1->getValue(); + APInt AndMask = CI2->getValue(); + + // Compute the prefix of the value that is unmodified by the bitmasking. + unsigned LeadingAndOnes = AndMask.countLeadingOnes(); + unsigned LeadingOrZeros = OrMask.countLeadingZeros(); + unsigned Prefix = std::min(LeadingAndOnes, LeadingOrZeros); + uint64_t NewWidth = AndMask.getBitWidth() - Prefix; + if (!isPowerOf2_64(NewWidth)) NewWidth = NextPowerOf2(NewWidth); + + // If we can find a power-of-2 prefix (and if the values we're working with + // are themselves POT widths), then we can narrow the store. We rely on + // later iterations of instcombine to propagate the demanded bits to narrow + // the other computations in the chain. + if (NewWidth < AndMask.getBitWidth() && + isPowerOf2_64(AndMask.getBitWidth())) { + const Type *NewType = IntegerType::get(Ptr->getContext(), NewWidth); + const Type *NewPtrType = PointerType::getUnqual(NewType); + + Value *NewVal = Builder->CreateTrunc(SI.getValueOperand(), NewType); + Value *NewPtr = Builder->CreateBitCast(Ptr, NewPtrType); + + // On big endian targets, we need to offset from the original pointer + // in order to store to the low-bit suffix. + if (getTargetData()->isBigEndian()) { + uint64_t GEPOffset = (AndMask.getBitWidth() - NewWidth) / 8; + NewPtr = Builder->CreateConstGEP1_64(NewPtr, GEPOffset); + } + + return new StoreInst(NewVal, NewPtr); + } + } + // store X, null -> turns into 'unreachable' in SimplifyCFG if (isa(Ptr) && SI.getPointerAddressSpace() == 0) { if (!isa(Val)) { Added: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll?rev=111568&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Thu Aug 19 17:15:40 2010 @@ -0,0 +1,21 @@ +; RUN: opt -S -instcombine %s | not grep and +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-apple-darwin10.0.0" + +%class.A = type { i8, [3 x i8] } + +define void @_ZN1AC2Ev(%class.A* %this) nounwind ssp align 2 { +entry: + %0 = bitcast %class.A* %this to i32* ; [#uses=5] + %1 = load i32* %0, align 4 ; [#uses=1] + %2 = and i32 %1, -8 ; [#uses=2] + store i32 %2, i32* %0, align 4 + %3 = and i32 %2, -57 ; [#uses=1] + %4 = or i32 %3, 8 ; [#uses=2] + store i32 %4, i32* %0, align 4 + %5 = and i32 %4, -65 ; [#uses=2] + store i32 %5, i32* %0, align 4 + %6 = and i32 %5, -129 ; [#uses=1] + store i32 %6, i32* %0, align 4 + ret void +} From john at bass-software.com Thu Aug 19 17:58:25 2010 From: john at bass-software.com (John Tytgat) Date: Thu, 19 Aug 2010 23:58:25 +0100 Subject: [llvm-commits] [llvm] r110799 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/select.ll In-Reply-To: <20100811084316.8A1092A6C12C@llvm.org> References: <20100811084316.8A1092A6C12C@llvm.org> Message-ID: In message <20100811084316.8A1092A6C12C at llvm.org> you wrote: > Author: void > Date: Wed Aug 11 03:43:16 2010 > New Revision: 110799 > > URL: http://llvm.org/viewvc/llvm-project?rev=110799&view=rev > Log: > Consider this code snippet: > > float t1(int argc) { > return (argc == 1123) ? 1.234f : 2.38213f; > } > [...] > > Now we generate this, which looks optimal to me: > > _t1: > movw r1, #1123 > movs r2, #0 > cmp r0, r1 > adr r0, #LCPI0_0 > it eq > moveq r2, #4 > ldr r0, [r0, r2] > bx lr > .align 2 > LCPI0_0: > .long 1075344593 @ float 2.382130e+00 > .long 1067316150 @ float 1.234000e+00 I don't know enough about Thumb to be sure (much more familiar with ARM) but can't this be made more compact/faster using SUB instead of CMP eliminating the MOV Rx, #0 ? _t1: movw r1, #1123 subs r2, r0, r1 adr r0, #LCPI0_0 it ne movne r2, #4 ldr r0, [r0, r2] bx lr .align 2 LCPI0_0: .long 1067316150 @ float 1.234000e+00 .long 1075344593 @ float 2.382130e+00 John. -- John Tytgat John at bass-software.com From wendling at apple.com Thu Aug 19 18:18:48 2010 From: wendling at apple.com (Bill Wendling) Date: Thu, 19 Aug 2010 16:18:48 -0700 Subject: [llvm-commits] [llvm] r110799 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/select.ll In-Reply-To: References: <20100811084316.8A1092A6C12C@llvm.org> Message-ID: <7C3F7660-1C1C-4CEC-804C-07385CDCD52C@apple.com> On Aug 19, 2010, at 3:58 PM, John Tytgat wrote: > In message <20100811084316.8A1092A6C12C at llvm.org> you wrote: > >> Author: void >> Date: Wed Aug 11 03:43:16 2010 >> New Revision: 110799 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=110799&view=rev >> Log: >> Consider this code snippet: >> >> float t1(int argc) { >> return (argc == 1123) ? 1.234f : 2.38213f; >> } >> [...] >> >> Now we generate this, which looks optimal to me: >> >> _t1: >> movw r1, #1123 >> movs r2, #0 >> cmp r0, r1 >> adr r0, #LCPI0_0 >> it eq >> moveq r2, #4 >> ldr r0, [r0, r2] >> bx lr >> .align 2 >> LCPI0_0: >> .long 1075344593 @ float 2.382130e+00 >> .long 1067316150 @ float 1.234000e+00 > > I don't know enough about Thumb to be sure (much more familiar with ARM) > but can't this be made more compact/faster using SUB instead of CMP > eliminating the MOV Rx, #0 ? > > _t1: > movw r1, #1123 > subs r2, r0, r1 > adr r0, #LCPI0_0 > it ne > movne r2, #4 > ldr r0, [r0, r2] > bx lr > .align 2 > LCPI0_0: > .long 1067316150 @ float 1.234000e+00 > .long 1075344593 @ float 2.382130e+00 > Steve Canon pointed out that this is optimal: _t1: movw r1, #1123 adr r2, #LCPI0_0 cmp r0, r1 it eq addeq r2, r2, #4 ldr r0, [r2] bx lr Essentially, folding the offset increment into the 'it' block. -bw From scanon at apple.com Thu Aug 19 18:23:24 2010 From: scanon at apple.com (Stephen Canon) Date: Thu, 19 Aug 2010 16:23:24 -0700 Subject: [llvm-commits] [llvm] r110799 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/select.ll In-Reply-To: <7C3F7660-1C1C-4CEC-804C-07385CDCD52C@apple.com> References: <20100811084316.8A1092A6C12C@llvm.org> <7C3F7660-1C1C-4CEC-804C-07385CDCD52C@apple.com> Message-ID: On Aug 19, 2010, at 4:18 PM, Bill Wendling wrote: > > On Aug 19, 2010, at 3:58 PM, John Tytgat wrote: > >> In message <20100811084316.8A1092A6C12C at llvm.org> you wrote: >> >>> Author: void >>> Date: Wed Aug 11 03:43:16 2010 >>> New Revision: 110799 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=110799&view=rev >>> Log: >>> Consider this code snippet: >>> >>> float t1(int argc) { >>> return (argc == 1123) ? 1.234f : 2.38213f; >>> } >>> [...] >>> >>> Now we generate this, which looks optimal to me: >>> >>> _t1: >>> movw r1, #1123 >>> movs r2, #0 >>> cmp r0, r1 >>> adr r0, #LCPI0_0 >>> it eq >>> moveq r2, #4 >>> ldr r0, [r0, r2] >>> bx lr >>> .align 2 >>> LCPI0_0: >>> .long 1075344593 @ float 2.382130e+00 >>> .long 1067316150 @ float 1.234000e+00 >> >> I don't know enough about Thumb to be sure (much more familiar with ARM) >> but can't this be made more compact/faster using SUB instead of CMP >> eliminating the MOV Rx, #0 ? >> >> _t1: >> movw r1, #1123 >> subs r2, r0, r1 >> adr r0, #LCPI0_0 >> it ne >> movne r2, #4 >> ldr r0, [r0, r2] >> bx lr >> .align 2 >> LCPI0_0: >> .long 1067316150 @ float 1.234000e+00 >> .long 1075344593 @ float 2.382130e+00 >> > Steve Canon pointed out that this is optimal: > > _t1: > movw r1, #1123 > adr r2, #LCPI0_0 > cmp r0, r1 > it eq > addeq r2, r2, #4 > ldr r0, [r2] > bx lr > > Essentially, folding the offset increment into the 'it' block. Not "optimal", I don't think, but I haven't had a chance to come up with something more clever =) You could use a speculative load to avoid a stall on some dual-issue cores, but that's too something-or-other by half. _t1: movw r1, #1123 adr r2, #LCPI0_0 cmp r0, r1 ldr r0, [r2], #4 it eq ldreq r0, [r2] bx lr - Steve From resistor at mac.com Thu Aug 19 18:25:16 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 19 Aug 2010 23:25:16 -0000 Subject: [llvm-commits] [llvm] r111571 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Message-ID: <20100819232516.DF83A2A6C12C@llvm.org> Author: resistor Date: Thu Aug 19 18:25:16 2010 New Revision: 111571 URL: http://llvm.org/viewvc/llvm-project?rev=111571&view=rev Log: Revert r111568 to unbreak clang self-host. Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=111571&r1=111570&r2=111571&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Thu Aug 19 18:25:16 2010 @@ -14,13 +14,11 @@ #include "InstCombine.h" #include "llvm/IntrinsicInst.h" #include "llvm/Analysis/Loads.h" -#include "llvm/Support/PatternMatch.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/Statistic.h" using namespace llvm; -using namespace PatternMatch; STATISTIC(NumDeadStore, "Number of dead stores eliminated"); @@ -475,49 +473,6 @@ if (SI.isVolatile()) return 0; // Don't hack volatile stores. - // Attempt to narrow sequences where we load a wide value, perform bitmasks - // that only affect the low bits of it, and then store it back. This - // typically arises from bitfield initializers in C++. - ConstantInt *CI1 =0, *CI2 = 0; - Value *Ld = 0; - if (getTargetData() && - match(SI.getValueOperand(), - m_And(m_Or(m_Value(Ld), m_ConstantInt(CI1)), m_ConstantInt(CI2))) && - isa(Ld) && - equivalentAddressValues(cast(Ld)->getPointerOperand(), Ptr)) { - APInt OrMask = CI1->getValue(); - APInt AndMask = CI2->getValue(); - - // Compute the prefix of the value that is unmodified by the bitmasking. - unsigned LeadingAndOnes = AndMask.countLeadingOnes(); - unsigned LeadingOrZeros = OrMask.countLeadingZeros(); - unsigned Prefix = std::min(LeadingAndOnes, LeadingOrZeros); - uint64_t NewWidth = AndMask.getBitWidth() - Prefix; - if (!isPowerOf2_64(NewWidth)) NewWidth = NextPowerOf2(NewWidth); - - // If we can find a power-of-2 prefix (and if the values we're working with - // are themselves POT widths), then we can narrow the store. We rely on - // later iterations of instcombine to propagate the demanded bits to narrow - // the other computations in the chain. - if (NewWidth < AndMask.getBitWidth() && - isPowerOf2_64(AndMask.getBitWidth())) { - const Type *NewType = IntegerType::get(Ptr->getContext(), NewWidth); - const Type *NewPtrType = PointerType::getUnqual(NewType); - - Value *NewVal = Builder->CreateTrunc(SI.getValueOperand(), NewType); - Value *NewPtr = Builder->CreateBitCast(Ptr, NewPtrType); - - // On big endian targets, we need to offset from the original pointer - // in order to store to the low-bit suffix. - if (getTargetData()->isBigEndian()) { - uint64_t GEPOffset = (AndMask.getBitWidth() - NewWidth) / 8; - NewPtr = Builder->CreateConstGEP1_64(NewPtr, GEPOffset); - } - - return new StoreInst(NewVal, NewPtr); - } - } - // store X, null -> turns into 'unreachable' in SimplifyCFG if (isa(Ptr) && SI.getPointerAddressSpace() == 0) { if (!isa(Val)) { Modified: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll?rev=111571&r1=111570&r2=111571&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Thu Aug 19 18:25:16 2010 @@ -1,21 +0,0 @@ -; RUN: opt -S -instcombine %s | not grep and -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -target triple = "x86_64-apple-darwin10.0.0" - -%class.A = type { i8, [3 x i8] } - -define void @_ZN1AC2Ev(%class.A* %this) nounwind ssp align 2 { -entry: - %0 = bitcast %class.A* %this to i32* ; [#uses=5] - %1 = load i32* %0, align 4 ; [#uses=1] - %2 = and i32 %1, -8 ; [#uses=2] - store i32 %2, i32* %0, align 4 - %3 = and i32 %2, -57 ; [#uses=1] - %4 = or i32 %3, 8 ; [#uses=2] - store i32 %4, i32* %0, align 4 - %5 = and i32 %4, -65 ; [#uses=2] - store i32 %5, i32* %0, align 4 - %6 = and i32 %5, -129 ; [#uses=1] - store i32 %6, i32* %0, align 4 - ret void -} From evan.cheng at apple.com Thu Aug 19 18:32:47 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 19 Aug 2010 23:32:47 -0000 Subject: [llvm-commits] [llvm] r111574 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Message-ID: <20100819233247.AAD172A6C12C@llvm.org> Author: evancheng Date: Thu Aug 19 18:32:47 2010 New Revision: 111574 URL: http://llvm.org/viewvc/llvm-project?rev=111574&view=rev Log: Properly update MachineDominators when splitting critical edge. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=111574&r1=111573&r2=111574&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Thu Aug 19 18:32:47 2010 @@ -468,8 +468,31 @@ LV->addNewBlock(NMBB, this, Succ); if (MachineDominatorTree *MDT = - P->getAnalysisIfAvailable()) - MDT->addNewBlock(NMBB, this); + P->getAnalysisIfAvailable()) { + // Update dominator information. + MachineDomTreeNode *SucccDTNode = MDT->getNode(Succ); + + bool IsNewIDom = true; + for (const_pred_iterator PI = Succ->pred_begin(), E = Succ->pred_end(); + PI != E; ++PI) { + MachineBasicBlock *PredBB = *PI; + if (PredBB == NMBB) + continue; + if (!MDT->dominates(SucccDTNode, MDT->getNode(PredBB))) { + IsNewIDom = false; + break; + } + } + + // We know "this" dominates the newly created basic block. + MachineDomTreeNode *NewDTNode = MDT->addNewBlock(NMBB, this); + + // If all the other predecessors of "Succ" are dominated by "Succ" itself + // then the new block is the new immediate dominator of "Succ". Otherwise, + // the new block doesn't dominate anything. + if (IsNewIDom) + MDT->changeImmediateDominator(SucccDTNode, NewDTNode); + } if (MachineLoopInfo *MLI = P->getAnalysisIfAvailable()) if (MachineLoop *TIL = MLI->getLoopFor(this)) { From evan.cheng at apple.com Thu Aug 19 18:33:02 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 19 Aug 2010 23:33:02 -0000 Subject: [llvm-commits] [llvm] r111575 - /llvm/trunk/lib/CodeGen/MachineSink.cpp Message-ID: <20100819233303.05FBD2A6C12C@llvm.org> Author: evancheng Date: Thu Aug 19 18:33:02 2010 New Revision: 111575 URL: http://llvm.org/viewvc/llvm-project?rev=111575&view=rev Log: Update debug logs. Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=111575&r1=111574&r2=111575&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Thu Aug 19 18:33:02 2010 @@ -391,20 +391,20 @@ bool TryBreak = false; bool store = true; if (!MI->isSafeToMove(TII, AA, store)) { - DEBUG(dbgs() << " *** PUNTING: Won't sink load along critical edge.\n"); + DEBUG(dbgs() << " *** NOTE: Won't sink load along critical edge.\n"); TryBreak = true; } // We don't want to sink across a critical edge if we don't dominate the // successor. We could be introducing calculations to new code paths. if (!TryBreak && !DT->dominates(ParentBlock, SuccToSinkTo)) { - DEBUG(dbgs() << " *** PUNTING: Critical edge found\n"); + DEBUG(dbgs() << " *** NOTE: Critical edge found\n"); TryBreak = true; } // Don't sink instructions into a loop. if (!TryBreak && LI->isLoopHeader(SuccToSinkTo)) { - DEBUG(dbgs() << " *** PUNTING: Loop header found\n"); + DEBUG(dbgs() << " *** NOTE: Loop header found\n"); TryBreak = true; } @@ -418,7 +418,7 @@ " *** PUNTING: Not legal or profitable to break critical edge\n"); return false; } else { - DEBUG(dbgs() << "*** Splitting critical edge:" + DEBUG(dbgs() << " *** Splitting critical edge:" " BB#" << ParentBlock->getNumber() << " -- BB#" << NewSucc->getNumber() << " -- BB#" << SuccToSinkTo->getNumber() << '\n'); From bob.wilson at apple.com Thu Aug 19 18:39:00 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 19 Aug 2010 23:39:00 -0000 Subject: [llvm-commits] [llvm] r111577 - /llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h Message-ID: <20100819233900.8CA5F2A6C12C@llvm.org> Author: bwilson Date: Thu Aug 19 18:39:00 2010 New Revision: 111577 URL: http://llvm.org/viewvc/llvm-project?rev=111577&view=rev Log: Update comment to remove special case for vector extending loads. An extending vector load should extend each element in the same way as the corresponding scalar extending load. Modified: llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h Modified: llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h?rev=111577&r1=111576&r2=111577&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h Thu Aug 19 18:39:00 2010 @@ -633,7 +633,6 @@ /// (the result of the load and the result of the base +/- offset /// computation); a post-indexed store produces one value (the /// the result of the base +/- offset computation). - /// enum MemIndexedMode { UNINDEXED = 0, PRE_INC, @@ -651,10 +650,8 @@ /// integer result type. /// ZEXTLOAD loads the integer operand and zero extends it to a larger /// integer result type. - /// EXTLOAD is used for three things: floating point extending loads, - /// integer extending loads [the top bits are undefined], and vector - /// extending loads [load into low elt]. - /// + /// EXTLOAD is used for two things: floating point extending loads and + /// integer extending loads [the top bits are undefined]. enum LoadExtType { NON_EXTLOAD = 0, EXTLOAD, From resistor at mac.com Thu Aug 19 18:45:15 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 19 Aug 2010 23:45:15 -0000 Subject: [llvm-commits] [llvm] r111582 - /llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Message-ID: <20100819234515.3D7E72A6C12C@llvm.org> Author: resistor Date: Thu Aug 19 18:45:15 2010 New Revision: 111582 URL: http://llvm.org/viewvc/llvm-project?rev=111582&view=rev Log: Previous revert failed to remove this file. Removed: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Removed: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll?rev=111581&view=auto ============================================================================== (empty) From daniel at zuster.org Thu Aug 19 18:45:39 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 23:45:39 -0000 Subject: [llvm-commits] [llvm] r111583 - /llvm/trunk/lib/System/Unix/Signals.inc Message-ID: <20100819234539.63ED62A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 19 18:45:39 2010 New Revision: 111583 URL: http://llvm.org/viewvc/llvm-project?rev=111583&view=rev Log: CrashRecovery/Darwin: On Darwin, raise sends a signal to the main thread instead of the current thread. This has the unfortunate effect that assert() and abort() will end up bypassing our crash recovery attempts. We work around this for anything in the same linkage unit by just defining our own versions of the assert handler and abort. Modified: llvm/trunk/lib/System/Unix/Signals.inc Modified: llvm/trunk/lib/System/Unix/Signals.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=111583&r1=111582&r2=111583&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Signals.inc (original) +++ llvm/trunk/lib/System/Unix/Signals.inc Thu Aug 19 18:45:39 2010 @@ -253,3 +253,37 @@ AddSignalHandler(PrintStackTrace, 0); } + +/***/ + +// On Darwin, raise sends a signal to the main thread instead of the current +// thread. This has the unfortunate effect that assert() and abort() will end up +// bypassing our crash recovery attempts. We work around this for anything in +// the same linkage unit by just defining our own versions of the assert handler +// and abort. + +#ifdef __APPLE__ + +void __assert_rtn(const char *func, + const char *file, + int line, + const char *expr) { + if (func) + fprintf(stderr, "Assertion failed: (%s), function %s, file %s, line %d.\n", + expr, func, file, line); + else + fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n", + expr, file, line); + abort(); +} + +#include +#include + +void abort() { + pthread_kill(pthread_self(), SIGABRT); + usleep(1000); + __builtin_trap(); +} + +#endif From grosbach at apple.com Thu Aug 19 18:52:25 2010 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 19 Aug 2010 23:52:25 -0000 Subject: [llvm-commits] [llvm] r111585 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/LocalStackSlotAllocation.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h Message-ID: <20100819235225.A2AE72A6C12C@llvm.org> Author: grosbach Date: Thu Aug 19 18:52:25 2010 New Revision: 111585 URL: http://llvm.org/viewvc/llvm-project?rev=111585&view=rev Log: Better handling of offsets on frame index references. rdar://8277890 Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=111585&r1=111584&r2=111585&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Thu Aug 19 18:52:25 2010 @@ -636,6 +636,12 @@ return false; } + /// getFrameIndexInstrOffset - Get the offset from the referenced frame + /// index in the instruction, if the is one. + virtual int64_t getFrameIndexInstrOffset(MachineInstr *MI, int Idx) const { + return 0; + } + /// needsFrameBaseReg - Returns true if the instruction's frame index /// reference would be better served by a base register other than FP /// or SP. Used by LocalStackFrameAllocation to determine which frame index @@ -647,8 +653,8 @@ /// materializeFrameBaseRegister - Insert defining instruction(s) for /// BaseReg to be a pointer to FrameIdx before insertion point I. virtual void materializeFrameBaseRegister(MachineBasicBlock::iterator I, - unsigned BaseReg, - int FrameIdx) const { + unsigned BaseReg, int FrameIdx, + int64_t Offset) const { assert(0 && "materializeFrameBaseRegister does not exist on this target"); } @@ -659,11 +665,11 @@ assert(0 && "resolveFrameIndex does not exist on this target"); } - /// isBaseRegInRange - Determine whether a given base register definition - /// is in range to resolve a frame index. - virtual bool isBaseRegInRange(const MachineInstr *MI, unsigned Reg, - int64_t Offset) const { - assert(0 && "isBaseRegInRange does not exist on this target"); + /// isFrameOffsetLegal - Determine whether a given offset immediate is + /// encodable to resolve a frame index. + virtual bool isFrameOffsetLegal(const MachineInstr *MI, + int64_t Offset) const { + assert(0 && "isFrameOffsetLegal does not exist on this target"); return false; // Must return a value in order to compile with VS 2005 } Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111585&r1=111584&r2=111585&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Thu Aug 19 18:52:25 2010 @@ -182,7 +182,7 @@ // Check if the relative offset from the where the base register references // to the target address is in range for the instruction. int64_t Offset = LocalFrameOffset - RegOffset.second; - if (TRI->isBaseRegInRange(MI, RegOffset.first, Offset)) + if (TRI->isFrameOffsetLegal(MI, Offset)) return true; } return false; @@ -225,6 +225,7 @@ // an object allocated in the local block. if (MI->getOperand(i).isFI()) { int FrameIdx = MI->getOperand(i).getIndex(); + // Don't try this with values not in the local block. if (!MFI->isObjectPreAllocated(FrameIdx)) continue; @@ -232,13 +233,15 @@ DEBUG(dbgs() << "Considering: " << *MI); if (TRI->needsFrameBaseReg(MI, i)) { unsigned BaseReg = 0; - unsigned Offset = 0; + int64_t Offset = 0; DEBUG(dbgs() << " Replacing FI in: " << *MI); // If we have a suitable base register available, use it; otherwise - // create a new one. - + // create a new one. Note that any offset encoded in the + // instruction itself will be taken into account by the target, + // so we don't have to adjust for it here when reusing a base + // register. std::pair RegOffset; if (lookupCandidateBaseReg(BaseRegisters, RegOffset, LocalOffsets[FrameIdx], MI, TRI)) { @@ -250,15 +253,26 @@ } else { // No previously defined register was in range, so create a // new one. + int64_t InstrOffset = TRI->getFrameIndexInstrOffset(MI, i); const TargetRegisterClass *RC = TRI->getPointerRegClass(); BaseReg = Fn.getRegInfo().createVirtualRegister(RC); + DEBUG(dbgs() << " Materializing base register " << BaseReg << + " at frame local offset " << + LocalOffsets[FrameIdx] + InstrOffset << "\n"); // Tell the target to insert the instruction to initialize // the base register. - TRI->materializeFrameBaseRegister(I, BaseReg, FrameIdx); + TRI->materializeFrameBaseRegister(I, BaseReg, FrameIdx, + InstrOffset); - BaseRegisters.push_back(std::pair(BaseReg, - Offset)); + // The base register already includes any offset specified + // by the instruction, so account for that so it doesn't get + // applied twice. + Offset = -InstrOffset; + + BaseRegisters.push_back( + std::pair(BaseReg, + LocalOffsets[FrameIdx] + InstrOffset)); ++NumBaseRegisters; } assert(BaseReg != 0 && "Unable to allocate virtual base register!"); Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=111585&r1=111584&r2=111585&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Thu Aug 19 18:52:25 2010 @@ -1367,6 +1367,59 @@ MBB.erase(I); } + +int64_t ARMBaseRegisterInfo:: +getFrameIndexInstrOffset(MachineInstr *MI, int Idx) const { + const TargetInstrDesc &Desc = MI->getDesc(); + unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask); + int64_t InstrOffs = 0;; + int Scale = 1; + unsigned ImmIdx = 0; + switch(AddrMode) { + case ARMII::AddrModeT2_i8: + case ARMII::AddrModeT2_i12: + // i8 supports only negative, and i12 supports only positive, so + // based on Offset sign, consider the appropriate instruction + InstrOffs = MI->getOperand(Idx+1).getImm(); + Scale = 1; + break; + case ARMII::AddrMode5: { + // VFP address mode. + const MachineOperand &OffOp = MI->getOperand(Idx+1); + int InstrOffs = ARM_AM::getAM5Offset(OffOp.getImm()); + if (ARM_AM::getAM5Op(OffOp.getImm()) == ARM_AM::sub) + InstrOffs = -InstrOffs; + Scale = 4; + break; + } + case ARMII::AddrMode2: { + ImmIdx = Idx+2; + InstrOffs = ARM_AM::getAM2Offset(MI->getOperand(ImmIdx).getImm()); + if (ARM_AM::getAM2Op(MI->getOperand(ImmIdx).getImm()) == ARM_AM::sub) + InstrOffs = -InstrOffs; + break; + } + case ARMII::AddrMode3: { + ImmIdx = Idx+2; + InstrOffs = ARM_AM::getAM3Offset(MI->getOperand(ImmIdx).getImm()); + if (ARM_AM::getAM3Op(MI->getOperand(ImmIdx).getImm()) == ARM_AM::sub) + InstrOffs = -InstrOffs; + break; + } + case ARMII::AddrModeT1_s: { + ImmIdx = Idx+1; + InstrOffs = MI->getOperand(ImmIdx).getImm(); + Scale = 4; + break; + } + default: + llvm_unreachable("Unsupported addressing mode!"); + break; + } + + return InstrOffs * Scale; +} + /// needsFrameBaseReg - Returns true if the instruction's frame index /// reference would be better served by a base register other than FP /// or SP. Used by LocalStackFrameAllocation to determine which frame index @@ -1404,8 +1457,8 @@ /// materializeFrameBaseRegister - Insert defining instruction(s) for /// BaseReg to be a pointer to FrameIdx before insertion point I. void ARMBaseRegisterInfo:: -materializeFrameBaseRegister(MachineBasicBlock::iterator I, - unsigned BaseReg, int FrameIdx) const { +materializeFrameBaseRegister(MachineBasicBlock::iterator I, unsigned BaseReg, + int FrameIdx, int64_t Offset) const { ARMFunctionInfo *AFI = I->getParent()->getParent()->getInfo(); unsigned ADDriOpc = !AFI->isThumbFunction() ? ARM::ADDri : @@ -1413,7 +1466,7 @@ MachineInstrBuilder MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), TII.get(ADDriOpc), BaseReg) - .addFrameIndex(FrameIdx).addImm(0); + .addFrameIndex(FrameIdx).addImm(Offset); if (!AFI->isThumb1OnlyFunction()) AddDefaultCC(AddDefaultPred(MIB)); } @@ -1445,8 +1498,8 @@ assert (Done && "Unable to resolve frame index!"); } -bool ARMBaseRegisterInfo::isBaseRegInRange(const MachineInstr *MI, - unsigned Reg, int64_t Offset) const { +bool ARMBaseRegisterInfo::isFrameOffsetLegal(const MachineInstr *MI, + int64_t Offset) const { const TargetInstrDesc &Desc = MI->getDesc(); unsigned AddrMode = (Desc.TSFlags & ARMII::AddrModeMask); unsigned i = 0; @@ -1464,6 +1517,7 @@ unsigned Scale = 1; unsigned ImmIdx = 0; int InstrOffs = 0;; + bool isSigned = true; switch(AddrMode) { case ARMII::AddrModeT2_i8: case ARMII::AddrModeT2_i12: @@ -1509,6 +1563,7 @@ InstrOffs = MI->getOperand(ImmIdx).getImm(); NumBits = 5; Scale = 4; + isSigned = false; break; } default: @@ -1518,7 +1573,7 @@ Offset += InstrOffs * Scale; assert((Offset & (Scale-1)) == 0 && "Can't encode this offset!"); - if (Offset < 0) + if (isSigned && Offset < 0) Offset = -Offset; unsigned Mask = (1 << NumBits) - 1; Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=111585&r1=111584&r2=111585&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Thu Aug 19 18:52:25 2010 @@ -105,13 +105,14 @@ bool canRealignStack(const MachineFunction &MF) const; bool needsStackRealignment(const MachineFunction &MF) const; + int64_t getFrameIndexInstrOffset(MachineInstr *MI, int Idx) const; bool needsFrameBaseReg(MachineInstr *MI, unsigned operand) const; void materializeFrameBaseRegister(MachineBasicBlock::iterator I, - unsigned BaseReg, int FrameIdx) const; + unsigned BaseReg, int FrameIdx, + int64_t Offset) const; void resolveFrameIndex(MachineBasicBlock::iterator I, unsigned BaseReg, int64_t Offset) const; - bool isBaseRegInRange(const MachineInstr *MI, unsigned Reg, - int64_t Offset) const; + bool isFrameOffsetLegal(const MachineInstr *MI, int64_t Offset) const; bool cannotEliminateFrame(const MachineFunction &MF) const; From bob.wilson at apple.com Thu Aug 19 18:52:39 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 19 Aug 2010 23:52:39 -0000 Subject: [llvm-commits] [llvm] r111586 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <20100819235239.6E0992A6C12C@llvm.org> Author: bwilson Date: Thu Aug 19 18:52:39 2010 New Revision: 111586 URL: http://llvm.org/viewvc/llvm-project?rev=111586&view=rev Log: If the target says that an extending load is not legal, regardless of whether it involves specific floating-point types, legalize should expand an extending load to a non-extending load followed by a separate extend operation. For example, we currently expand SEXTLOAD to EXTLOAD+SIGN_EXTEND_INREG (and assert that EXTLOAD should always be supported). Now we can expand that to LOAD+SIGN_EXTEND. This is needed to allow vector SIGN_EXTEND and ZERO_EXTEND to be used for NEON. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=111586&r1=111585&r2=111586&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Aug 19 18:52:39 2010 @@ -1314,17 +1314,22 @@ } break; case TargetLowering::Expand: - // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND - // f128 = EXTLOAD {f32,f64} too - if ((SrcVT == MVT::f32 && (Node->getValueType(0) == MVT::f64 || - Node->getValueType(0) == MVT::f128)) || - (SrcVT == MVT::f64 && Node->getValueType(0) == MVT::f128)) { + if (!TLI.isLoadExtLegal(ISD::EXTLOAD, SrcVT)) { SDValue Load = DAG.getLoad(SrcVT, dl, Tmp1, Tmp2, LD->getSrcValue(), LD->getSrcValueOffset(), LD->isVolatile(), LD->isNonTemporal(), LD->getAlignment()); - Result = DAG.getNode(ISD::FP_EXTEND, dl, - Node->getValueType(0), Load); + unsigned ExtendOp; + switch (ExtType) { + case ISD::EXTLOAD: + ExtendOp = (SrcVT.isFloatingPoint() ? + ISD::FP_EXTEND : ISD::ANY_EXTEND); + break; + case ISD::SEXTLOAD: ExtendOp = ISD::SIGN_EXTEND; break; + case ISD::ZEXTLOAD: ExtendOp = ISD::ZERO_EXTEND; break; + default: assert(0 && "Unexpected extend load type!"); + } + Result = DAG.getNode(ExtendOp, dl, Node->getValueType(0), Load); Tmp1 = LegalizeOp(Result); // Relegalize new nodes. Tmp2 = LegalizeOp(Load.getValue(1)); break; From echristo at apple.com Thu Aug 19 19:20:31 2010 From: echristo at apple.com (Eric Christopher) Date: Fri, 20 Aug 2010 00:20:31 -0000 Subject: [llvm-commits] [llvm] r111592 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20100820002031.5DBBB2A6C12C@llvm.org> Author: echristo Date: Thu Aug 19 19:20:31 2010 New Revision: 111592 URL: http://llvm.org/viewvc/llvm-project?rev=111592&view=rev Log: Add a couple of random comments. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111592&r1=111591&r2=111592&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Thu Aug 19 19:20:31 2010 @@ -67,6 +67,7 @@ Subtarget = &TM.getSubtarget(); } + // Code from FastISel.cpp. virtual unsigned FastEmitInst_(unsigned MachineInstOpcode, const TargetRegisterClass *RC); virtual unsigned FastEmitInst_r(unsigned MachineInstOpcode, @@ -95,6 +96,8 @@ virtual unsigned FastEmitInst_extractsubreg(MVT RetVT, unsigned Op0, bool Op0IsKill, uint32_t Idx); + + // Backend specific FastISel code. virtual bool TargetSelectInstruction(const Instruction *I); #include "ARMGenFastISel.inc" From echristo at apple.com Thu Aug 19 19:36:24 2010 From: echristo at apple.com (Eric Christopher) Date: Fri, 20 Aug 2010 00:36:24 -0000 Subject: [llvm-commits] [llvm] r111594 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20100820003624.5F0852A6C12C@llvm.org> Author: echristo Date: Thu Aug 19 19:36:24 2010 New Revision: 111594 URL: http://llvm.org/viewvc/llvm-project?rev=111594&view=rev Log: Fix loop conditionals (MO.isDef() asserts that it's a reg) and move some constraints around. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=111594&r1=111593&r2=111594&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Thu Aug 19 19:36:24 2010 @@ -122,7 +122,8 @@ // Look to see if our OptionalDef is defining CPSR or CCR. for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &MO = MI->getOperand(i); - if (MO.isDef() && MO.isReg() && MO.getReg() == ARM::CPSR) + if (!MO.isReg() || !MO.isDef()) continue; + if (MO.getReg() == ARM::CPSR) *CPSR = true; } return true; From gohman at apple.com Thu Aug 19 19:48:10 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 00:48:10 -0000 Subject: [llvm-commits] [llvm] r111595 - in /llvm/trunk: include/llvm/Support/FormattedStream.h include/llvm/Support/raw_ostream.h lib/Support/FormattedStream.cpp lib/Support/raw_ostream.cpp Message-ID: <20100820004810.878BF2A6C12C@llvm.org> Author: djg Date: Thu Aug 19 19:48:10 2010 New Revision: 111595 URL: http://llvm.org/viewvc/llvm-project?rev=111595&view=rev Log: Introduce a new tool_output_file class, which extends raw_ostream with functionality that most command-line tools need: ensuring that the output file gets deleted if the tool is interrupted or encounters an error. Modified: llvm/trunk/include/llvm/Support/FormattedStream.h llvm/trunk/include/llvm/Support/raw_ostream.h llvm/trunk/lib/Support/FormattedStream.cpp llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/include/llvm/Support/FormattedStream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormattedStream.h?rev=111595&r1=111594&r2=111595&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/FormattedStream.h (original) +++ llvm/trunk/include/llvm/Support/FormattedStream.h Thu Aug 19 19:48:10 2010 @@ -19,10 +19,14 @@ namespace llvm { + class formatted_tool_output_file; + /// formatted_raw_ostream - Formatted raw_fd_ostream to handle /// asm-specific constructs. /// class formatted_raw_ostream : public raw_ostream { + friend class formatted_tool_output_file; + public: /// DELETE_STREAM - Tell the destructor to delete the held stream. /// @@ -136,6 +140,25 @@ } }; + /// formatted_tool_output_file - This is a subclass of formatted_raw_ostream + /// for use when the underlying stream is a tool_output_file. It exposes + /// the keep() member function. + class formatted_tool_output_file : public formatted_raw_ostream { + public: + formatted_tool_output_file(tool_output_file &Stream, bool Delete = false) + : formatted_raw_ostream(Stream, Delete) {} + + formatted_tool_output_file() {} + + ~formatted_tool_output_file(); + + void setStream(tool_output_file &Stream, bool Delete = false) { + return formatted_raw_ostream::setStream(Stream, Delete); + } + + void keep() { return static_cast(TheStream)->keep(); } + }; + /// fouts() - This returns a reference to a formatted_raw_ostream for /// standard output. Use it like: fouts() << "foo" << "bar"; formatted_raw_ostream &fouts(); Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111595&r1=111594&r2=111595&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Thu Aug 19 19:48:10 2010 @@ -370,10 +370,11 @@ ~raw_fd_ostream(); /// close - Manually flush the stream and close the file. + /// Note that this does not call fsync. void close(); /// seek - Flushes the stream and repositions the underlying file descriptor - /// positition to the offset specified from the beginning of the file. + /// positition to the offset specified from the beginning of the file. uint64_t seek(uint64_t off); virtual raw_ostream &changeColor(enum Colors colors, bool bold=false, @@ -484,6 +485,25 @@ ~raw_null_ostream(); }; +/// tool_output_file - This class behaves like a raw_fd_ostream but adds a +/// few extra features commonly needed for compiler-like tool output files: +/// - The file is automatically deleted if the process is killed. +/// - The file is automatically deleted when the tool_output_file +/// object is destroyed unless the client calls keep(). +class tool_output_file : public raw_fd_ostream { + std::string Filename; + bool Keep; +public: + tool_output_file(const char *filename, std::string &ErrorInfo, + unsigned Flags = 0); + + ~tool_output_file(); + + /// keep - Indicate that the tool's job wrt this output file has been + /// successful and the file should not be deleted. + void keep() { Keep = true; } +}; + } // end llvm namespace #endif Modified: llvm/trunk/lib/Support/FormattedStream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FormattedStream.cpp?rev=111595&r1=111594&r2=111595&view=diff ============================================================================== --- llvm/trunk/lib/Support/FormattedStream.cpp (original) +++ llvm/trunk/lib/Support/FormattedStream.cpp Thu Aug 19 19:48:10 2010 @@ -98,3 +98,6 @@ static formatted_raw_ostream S(dbgs()); return S; } + +/// ~formatted_tool_output_file - Out-of-line destructor. +formatted_tool_output_file::~formatted_tool_output_file() {} Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111595&r1=111594&r2=111595&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Thu Aug 19 19:48:10 2010 @@ -19,6 +19,7 @@ #include "llvm/Config/config.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/System/Signals.h" #include "llvm/ADT/STLExtras.h" #include #include @@ -669,3 +670,30 @@ uint64_t raw_null_ostream::current_pos() const { return 0; } + +//===----------------------------------------------------------------------===// +// tool_output_file +//===----------------------------------------------------------------------===// + +/// SetupRemoveOnSignal - This is a helper for tool_output_file's constructor +/// to allow the signal handlers to be installed before constructing the +/// base class raw_fd_ostream. +static const char *SetupRemoveOnSignal(const char *Filename) { + // Arrange for the file to be deleted if the process is killed. + if (strcmp(Filename, "-") != 0) + sys::RemoveFileOnSignal(sys::Path(Filename)); + return Filename; +} + +tool_output_file::tool_output_file(const char *filename, std::string &ErrorInfo, + unsigned Flags) + : raw_fd_ostream(SetupRemoveOnSignal(filename), ErrorInfo, Flags), + Filename(filename), + Keep(!ErrorInfo.empty() /* If open fails, no cleanup is needed. */) { +} + +tool_output_file::~tool_output_file() { + // Delete the file if the client hasn't told us not to. + if (!Keep && Filename != "-") + sys::Path(Filename).eraseFromDisk(); +} From gohman at apple.com Thu Aug 19 19:56:16 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 00:56:16 -0000 Subject: [llvm-commits] [llvm] r111596 - in /llvm/trunk/tools: bugpoint-passes/TestPasses.cpp opt/AnalysisWrappers.cpp opt/GraphPrinters.cpp Message-ID: <20100820005616.DD0372A6C131@llvm.org> Author: djg Date: Thu Aug 19 19:56:16 2010 New Revision: 111596 URL: http://llvm.org/viewvc/llvm-project?rev=111596&view=rev Log: Minor cleanups to follow the common convention for pass registration variables. Modified: llvm/trunk/tools/bugpoint-passes/TestPasses.cpp llvm/trunk/tools/opt/AnalysisWrappers.cpp llvm/trunk/tools/opt/GraphPrinters.cpp Modified: llvm/trunk/tools/bugpoint-passes/TestPasses.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint-passes/TestPasses.cpp?rev=111596&r1=111595&r2=111596&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint-passes/TestPasses.cpp (original) +++ llvm/trunk/tools/bugpoint-passes/TestPasses.cpp Thu Aug 19 19:56:16 2010 @@ -41,12 +41,12 @@ return false; } }; +} - char CrashOnCalls::ID = 0; - RegisterPass +char CrashOnCalls::ID = 0; +static RegisterPass X("bugpoint-crashcalls", "BugPoint Test Pass - Intentionally crash on CallInsts"); -} namespace { /// DeleteCalls - This pass is used to test bugpoint. It intentionally @@ -67,9 +67,9 @@ return false; } }; +} - char DeleteCalls::ID = 0; - RegisterPass +char DeleteCalls::ID = 0; +static RegisterPass Y("bugpoint-deletecalls", "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); -} Modified: llvm/trunk/tools/opt/AnalysisWrappers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp?rev=111596&r1=111595&r2=111596&view=diff ============================================================================== --- llvm/trunk/tools/opt/AnalysisWrappers.cpp (original) +++ llvm/trunk/tools/opt/AnalysisWrappers.cpp Thu Aug 19 19:56:16 2010 @@ -66,12 +66,14 @@ AU.setPreservesAll(); } }; +} - char ExternalFunctionsPassedConstants::ID = 0; - RegisterPass +char ExternalFunctionsPassedConstants::ID = 0; +static RegisterPass P1("print-externalfnconstants", "Print external fn callsites passed constants"); +namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass(ID) {} @@ -85,8 +87,8 @@ return false; } }; - - char CallGraphPrinter::ID = 0; - RegisterPass - P2("print-callgraph", "Print a call graph"); } + +char CallGraphPrinter::ID = 0; +static RegisterPass + P2("print-callgraph", "Print a call graph"); Modified: llvm/trunk/tools/opt/GraphPrinters.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=111596&r1=111595&r2=111596&view=diff ============================================================================== --- llvm/trunk/tools/opt/GraphPrinters.cpp (original) +++ llvm/trunk/tools/opt/GraphPrinters.cpp Thu Aug 19 19:56:16 2010 @@ -79,12 +79,12 @@ AU.setPreservesAll(); } }; - - char CallGraphPrinter::ID = 0; - RegisterPass P2("dot-callgraph", - "Print Call Graph to 'dot' file"); } +char CallGraphPrinter::ID = 0; +static RegisterPass P2("dot-callgraph", + "Print Call Graph to 'dot' file"); + //===----------------------------------------------------------------------===// // DomInfoPrinter Pass //===----------------------------------------------------------------------===// @@ -110,8 +110,8 @@ return false; } }; - - char DomInfoPrinter::ID = 0; - static RegisterPass - DIP("print-dom-info", "Dominator Info Printer", true, true); } + +char DomInfoPrinter::ID = 0; +static RegisterPass +DIP("print-dom-info", "Dominator Info Printer", true, true); From gohman at apple.com Thu Aug 19 20:00:03 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 01:00:03 -0000 Subject: [llvm-commits] [llvm] r111598 - /llvm/trunk/tools/opt/PrintSCC.cpp Message-ID: <20100820010003.AE9DF2A6C131@llvm.org> Author: djg Date: Thu Aug 19 20:00:03 2010 New Revision: 111598 URL: http://llvm.org/viewvc/llvm-project?rev=111598&view=rev Log: Minor cleanups to follow the common convention for pass registration variables. Modified: llvm/trunk/tools/opt/PrintSCC.cpp Modified: llvm/trunk/tools/opt/PrintSCC.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=111598&r1=111597&r2=111598&view=diff ============================================================================== --- llvm/trunk/tools/opt/PrintSCC.cpp (original) +++ llvm/trunk/tools/opt/PrintSCC.cpp Thu Aug 19 20:00:03 2010 @@ -61,16 +61,16 @@ AU.addRequired(); } }; - - char CFGSCC::ID = 0; - RegisterPass - Y("print-cfg-sccs", "Print SCCs of each function CFG"); - - char CallGraphSCC::ID = 0; - RegisterPass - Z("print-callgraph-sccs", "Print SCCs of the Call Graph"); } +char CFGSCC::ID = 0; +static RegisterPass +Y("print-cfg-sccs", "Print SCCs of each function CFG"); + +char CallGraphSCC::ID = 0; +static RegisterPass +Z("print-callgraph-sccs", "Print SCCs of the Call Graph"); + bool CFGSCC::runOnFunction(Function &F) { unsigned sccNum = 0; outs() << "SCCs for Function " << F.getName() << " in PostOrder:"; From gohman at apple.com Thu Aug 19 20:02:14 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 01:02:14 -0000 Subject: [llvm-commits] [llvm] r111599 - /llvm/trunk/tools/llvm-ld/llvm-ld.cpp Message-ID: <20100820010214.BFB982A6C131@llvm.org> Author: djg Date: Thu Aug 19 20:02:14 2010 New Revision: 111599 URL: http://llvm.org/viewvc/llvm-project?rev=111599&view=rev Log: Print chatty verbose messages to errs() instead of outs(). Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=111599&r1=111598&r2=111599&view=diff ============================================================================== --- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original) +++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Thu Aug 19 20:02:14 2010 @@ -145,8 +145,8 @@ std::vector::const_iterator I = args.begin(), E = args.end(); for (; I != E; ++I) if (*I) - outs() << "'" << *I << "'" << " "; - outs() << "\n"; outs().flush(); + errs() << "'" << *I << "'" << " "; + errs() << "\n"; } /// CopyEnv - This function takes an array of environment variables and makes a @@ -232,7 +232,7 @@ void GenerateBitcode(Module* M, const std::string& FileName) { if (Verbose) - outs() << "Generating Bitcode To " << FileName << '\n'; + errs() << "Generating Bitcode To " << FileName << '\n'; // Create the output file. std::string ErrorInfo; @@ -272,7 +272,7 @@ args.push_back(0); if (Verbose) { - outs() << "Generating Assembly With: \n"; + errs() << "Generating Assembly With: \n"; PrintCommand(args); } @@ -294,7 +294,7 @@ args.push_back(0); if (Verbose) { - outs() << "Generating C Source With: \n"; + errs() << "Generating C Source With: \n"; PrintCommand(args); } @@ -391,7 +391,7 @@ Args.push_back(0); if (Verbose) { - outs() << "Generating Native Executable With:\n"; + errs() << "Generating Native Executable With:\n"; PrintCommand(Args); } @@ -406,7 +406,7 @@ /// bitcode file for the program. static void EmitShellScript(char **argv, Module *M) { if (Verbose) - outs() << "Emitting Shell Script\n"; + errs() << "Emitting Shell Script\n"; #if defined(_WIN32) || defined(__CYGWIN__) // Windows doesn't support #!/bin/sh style shell scripts in .exe files. To // support windows systems, we copy the llvm-stub.exe executable from the From gohman at apple.com Thu Aug 19 20:03:44 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 01:03:44 -0000 Subject: [llvm-commits] [llvm] r111601 - in /llvm/trunk: docs/Passes.html tools/opt/PrintSCC.cpp Message-ID: <20100820010344.8CB412A6C131@llvm.org> Author: djg Date: Thu Aug 19 20:03:44 2010 New Revision: 111601 URL: http://llvm.org/viewvc/llvm-project?rev=111601&view=rev Log: Make the SCC printing passes use errs() instead of outs(), as the other printing passes do, and update the documentation accordingly. Modified: llvm/trunk/docs/Passes.html llvm/trunk/tools/opt/PrintSCC.cpp Modified: llvm/trunk/docs/Passes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=111601&r1=111600&r2=111601&view=diff ============================================================================== --- llvm/trunk/docs/Passes.html (original) +++ llvm/trunk/docs/Passes.html Thu Aug 19 20:03:44 2010 @@ -649,7 +649,7 @@

This pass, only available in opt, prints the call graph to - standard output in a human-readable form. + standard error in a human-readable form.

@@ -660,7 +660,7 @@

This pass, only available in opt, prints the SCCs of the call - graph to standard output in a human-readable form. + graph to standard error in a human-readable form.

@@ -671,7 +671,7 @@

This pass, only available in opt, prints the SCCs of each - function CFG to standard output in a human-readable form. + function CFG to standard error in a human-readable form.

Modified: llvm/trunk/tools/opt/PrintSCC.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=111601&r1=111600&r2=111601&view=diff ============================================================================== --- llvm/trunk/tools/opt/PrintSCC.cpp (original) +++ llvm/trunk/tools/opt/PrintSCC.cpp Thu Aug 19 20:03:44 2010 @@ -73,18 +73,18 @@ bool CFGSCC::runOnFunction(Function &F) { unsigned sccNum = 0; - outs() << "SCCs for Function " << F.getName() << " in PostOrder:"; + errs() << "SCCs for Function " << F.getName() << " in PostOrder:"; for (scc_iterator SCCI = scc_begin(&F), E = scc_end(&F); SCCI != E; ++SCCI) { std::vector &nextSCC = *SCCI; - outs() << "\nSCC #" << ++sccNum << " : "; + errs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::const_iterator I = nextSCC.begin(), E = nextSCC.end(); I != E; ++I) - outs() << (*I)->getName() << ", "; + errs() << (*I)->getName() << ", "; if (nextSCC.size() == 1 && SCCI.hasLoop()) - outs() << " (Has self-loop)."; + errs() << " (Has self-loop)."; } - outs() << "\n"; + errs() << "\n"; return true; } @@ -94,19 +94,19 @@ bool CallGraphSCC::runOnModule(Module &M) { CallGraphNode* rootNode = getAnalysis().getRoot(); unsigned sccNum = 0; - outs() << "SCCs for the program in PostOrder:"; + errs() << "SCCs for the program in PostOrder:"; for (scc_iterator SCCI = scc_begin(rootNode), E = scc_end(rootNode); SCCI != E; ++SCCI) { const std::vector &nextSCC = *SCCI; - outs() << "\nSCC #" << ++sccNum << " : "; + errs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::const_iterator I = nextSCC.begin(), E = nextSCC.end(); I != E; ++I) - outs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr() + errs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr() : std::string("external node")) << ", "; if (nextSCC.size() == 1 && SCCI.hasLoop()) - outs() << " (Has self-loop)."; + errs() << " (Has self-loop)."; } - outs() << "\n"; + errs() << "\n"; return true; } From gohman at apple.com Thu Aug 19 20:07:01 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 01:07:01 -0000 Subject: [llvm-commits] [llvm] r111603 - in /llvm/trunk/tools: llc/llc.cpp llvm-as/llvm-as.cpp llvm-dis/llvm-dis.cpp llvm-mc/Disassembler.cpp llvm-mc/Disassembler.h llvm-mc/llvm-mc.cpp opt/opt.cpp Message-ID: <20100820010701.761712A6C131@llvm.org> Author: djg Date: Thu Aug 19 20:07:01 2010 New Revision: 111603 URL: http://llvm.org/viewvc/llvm-project?rev=111603&view=rev Log: Use the new tool_output_file in several tools. This fixes a variety of problems with output files being left behind or output streams being left unclosed. Fix llvm-mc to respect the -o option in all modes, rather than hardcoding outs() in some cases. Modified: llvm/trunk/tools/llc/llc.cpp llvm/trunk/tools/llvm-as/llvm-as.cpp llvm/trunk/tools/llvm-dis/llvm-dis.cpp llvm/trunk/tools/llvm-mc/Disassembler.cpp llvm/trunk/tools/llvm-mc/Disassembler.h llvm/trunk/tools/llvm-mc/llvm-mc.cpp llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Thu Aug 19 20:07:01 2010 @@ -124,9 +124,9 @@ return outputFilename; } -static formatted_raw_ostream *GetOutputStream(const char *TargetName, - Triple::OSType OS, - const char *ProgName) { +static formatted_tool_output_file *GetOutputStream(const char *TargetName, + Triple::OSType OS, + const char *ProgName) { // If we don't yet have an output filename, make one. if (OutputFilename.empty()) { if (InputFilename == "-") @@ -172,25 +172,21 @@ break; } - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - // Open the file. std::string error; unsigned OpenFlags = 0; if (Binary) OpenFlags |= raw_fd_ostream::F_Binary; - raw_fd_ostream *FDOut = new raw_fd_ostream(OutputFilename.c_str(), error, - OpenFlags); + tool_output_file *FDOut = new tool_output_file(OutputFilename.c_str(), error, + OpenFlags); if (!error.empty()) { errs() << error << '\n'; delete FDOut; return 0; } - formatted_raw_ostream *Out = - new formatted_raw_ostream(*FDOut, formatted_raw_ostream::DELETE_STREAM); + formatted_tool_output_file *Out = + new formatted_tool_output_file(*FDOut, + formatted_raw_ostream::DELETE_STREAM); return Out; } @@ -283,9 +279,9 @@ TargetMachine &Target = *target.get(); // Figure out where we are going to send the output... - formatted_raw_ostream *Out = GetOutputStream(TheTarget->getName(), - TheTriple.getOS(), argv[0]); - if (Out == 0) return 1; + OwningPtr Out + (GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0])); + if (!Out) return 1; CodeGenOpt::Level OLvl = CodeGenOpt::Default; switch (OptLevel) { @@ -335,16 +331,13 @@ DisableVerify)) { errs() << argv[0] << ": target does not support generation of this" << " file type!\n"; - delete Out; - // And the Out file is empty and useless, so remove it now. - sys::Path(OutputFilename).eraseFromDisk(); return 1; } PM.run(mod); - // Delete the ostream. - delete Out; + // Declare success. + Out->keep(); return 0; } Modified: llvm/trunk/tools/llvm-as/llvm-as.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-as/llvm-as.cpp?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/llvm-as/llvm-as.cpp (original) +++ llvm/trunk/tools/llvm-as/llvm-as.cpp Thu Aug 19 20:07:01 2010 @@ -68,15 +68,10 @@ } } - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT. - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - std::string ErrorInfo; - std::auto_ptr Out - (new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary)); + OwningPtr Out + (new tool_output_file(OutputFilename.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; exit(1); @@ -84,6 +79,9 @@ if (Force || !CheckBitcodeOutputToConsole(*Out, true)) WriteBitcodeToFile(M, *Out); + + // Declare success. + Out->keep(); } int main(int argc, char **argv) { Modified: llvm/trunk/tools/llvm-dis/llvm-dis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dis/llvm-dis.cpp?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/llvm-dis/llvm-dis.cpp (original) +++ llvm/trunk/tools/llvm-dis/llvm-dis.cpp Thu Aug 19 20:07:01 2010 @@ -25,7 +25,6 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" -#include using namespace llvm; static cl::opt @@ -88,15 +87,10 @@ } } - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT. - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - std::string ErrorInfo; - std::auto_ptr - Out(new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary)); + OwningPtr + Out(new tool_output_file(OutputFilename.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; return 1; @@ -106,6 +100,9 @@ if (!DontPrint) *Out << *M; + // Declare success. + Out->keep(); + return 0; } Modified: llvm/trunk/tools/llvm-mc/Disassembler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/Disassembler.cpp?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/Disassembler.cpp (original) +++ llvm/trunk/tools/llvm-mc/Disassembler.cpp Thu Aug 19 20:07:01 2010 @@ -53,7 +53,7 @@ static bool PrintInsts(const MCDisassembler &DisAsm, MCInstPrinter &Printer, const ByteArrayTy &Bytes, - SourceMgr &SM) { + SourceMgr &SM, raw_ostream &Out) { // Wrap the vector in a MemoryObject. VectorMemoryObject memoryObject(Bytes); @@ -66,8 +66,8 @@ if (DisAsm.getInstruction(Inst, Size, memoryObject, Index, /*REMOVE*/ nulls())) { - Printer.printInst(&Inst, outs()); - outs() << "\n"; + Printer.printInst(&Inst, Out); + Out << "\n"; } else { SM.PrintMessage(SMLoc::getFromPointer(Bytes[Index].second), "invalid instruction encoding", "warning"); @@ -127,7 +127,8 @@ } int Disassembler::disassemble(const Target &T, const std::string &Triple, - MemoryBuffer &Buffer) { + MemoryBuffer &Buffer, + raw_ostream &Out) { // Set up disassembler. OwningPtr AsmInfo(T.createAsmInfo(Triple)); @@ -162,7 +163,7 @@ ErrorOccurred |= ByteArrayFromString(ByteArray, Str, SM); if (!ByteArray.empty()) - ErrorOccurred |= PrintInsts(*DisAsm, *IP, ByteArray, SM); + ErrorOccurred |= PrintInsts(*DisAsm, *IP, ByteArray, SM, Out); return ErrorOccurred; } @@ -179,22 +180,24 @@ } static int verboseEvaluator(uint64_t *V, unsigned R, void *Arg) { - EDDisassembler &disassembler = *((EDDisassembler *)Arg); + EDDisassembler &disassembler = *(EDDisassembler *)((void **)Arg)[0]; + raw_ostream &Out = *(raw_ostream *)((void **)Arg)[1]; if (const char *regName = disassembler.nameWithRegisterID(R)) - outs() << "[" << regName << "/" << R << "]"; + Out << "[" << regName << "/" << R << "]"; if (disassembler.registerIsStackPointer(R)) - outs() << "(sp)"; + Out << "(sp)"; if (disassembler.registerIsProgramCounter(R)) - outs() << "(pc)"; + Out << "(pc)"; *V = 0; return 0; } int Disassembler::disassembleEnhanced(const std::string &TS, - MemoryBuffer &Buffer) { + MemoryBuffer &Buffer, + raw_ostream &Out) { ByteArrayTy ByteArray; StringRef Str = Buffer.getBuffer(); SourceMgr SM; @@ -259,52 +262,52 @@ return -1; } - outs() << '['; + Out << '['; int operandIndex = token->operandID(); if (operandIndex >= 0) - outs() << operandIndex << "-"; + Out << operandIndex << "-"; switch (token->type()) { - default: outs() << "?"; break; - case EDToken::kTokenWhitespace: outs() << "w"; break; - case EDToken::kTokenPunctuation: outs() << "p"; break; - case EDToken::kTokenOpcode: outs() << "o"; break; - case EDToken::kTokenLiteral: outs() << "l"; break; - case EDToken::kTokenRegister: outs() << "r"; break; + default: Out << "?"; break; + case EDToken::kTokenWhitespace: Out << "w"; break; + case EDToken::kTokenPunctuation: Out << "p"; break; + case EDToken::kTokenOpcode: Out << "o"; break; + case EDToken::kTokenLiteral: Out << "l"; break; + case EDToken::kTokenRegister: Out << "r"; break; } - outs() << ":" << buf; + Out << ":" << buf; if (token->type() == EDToken::kTokenLiteral) { - outs() << "="; + Out << "="; if (token->literalSign()) - outs() << "-"; + Out << "-"; uint64_t absoluteValue; if (token->literalAbsoluteValue(absoluteValue)) { errs() << "error: Couldn't get the value of a literal token\n"; return -1; } - outs() << absoluteValue; + Out << absoluteValue; } else if (token->type() == EDToken::kTokenRegister) { - outs() << "="; + Out << "="; unsigned regID; if (token->registerID(regID)) { errs() << "error: Couldn't get the ID of a register token\n"; return -1; } - outs() << "r" << regID; + Out << "r" << regID; } - outs() << "]"; + Out << "]"; } - outs() << " "; + Out << " "; if (inst->isBranch()) - outs() << "
"; + Out << "
"; if (inst->isMove()) - outs() << " "; + Out << " "; unsigned numOperands = inst->numOperands(); @@ -314,7 +317,7 @@ } for (unsigned operandIndex = 0; operandIndex != numOperands; ++operandIndex) { - outs() << operandIndex << ":"; + Out << operandIndex << ":"; EDOperand *operand; if (inst->getOperand(operand, operandIndex)) { @@ -323,12 +326,12 @@ } uint64_t evaluatedResult; - evaluatedResult = operand->evaluate(evaluatedResult, verboseEvaluator, - disassembler); - outs() << "=" << evaluatedResult << " "; + void *Arg[] = { disassembler, &Out }; + evaluatedResult = operand->evaluate(evaluatedResult, verboseEvaluator, Arg); + Out << "=" << evaluatedResult << " "; } - outs() << '\n'; + Out << '\n'; return 0; } Modified: llvm/trunk/tools/llvm-mc/Disassembler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/Disassembler.h?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/Disassembler.h (original) +++ llvm/trunk/tools/llvm-mc/Disassembler.h Thu Aug 19 20:07:01 2010 @@ -21,15 +21,18 @@ class Target; class MemoryBuffer; +class raw_ostream; class Disassembler { public: static int disassemble(const Target &target, const std::string &tripleString, - MemoryBuffer &buffer); + MemoryBuffer &buffer, + raw_ostream &Out); static int disassembleEnhanced(const std::string &tripleString, - MemoryBuffer &buffer); + MemoryBuffer &buffer, + raw_ostream &Out); }; } // namespace llvm Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original) +++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Thu Aug 19 20:07:01 2010 @@ -27,6 +27,7 @@ #include "llvm/Target/TargetSelect.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileUtilities.h" #include "llvm/Support/FormattedStream.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" @@ -139,6 +140,23 @@ return 0; } +static formatted_tool_output_file *GetOutputStream() { + if (OutputFilename == "") + OutputFilename = "-"; + + std::string Err; + tool_output_file *Out = new tool_output_file(OutputFilename.c_str(), Err, + raw_fd_ostream::F_Binary); + if (!Err.empty()) { + errs() << Err << '\n'; + delete Out; + return 0; + } + + return new formatted_tool_output_file(*Out, + formatted_raw_ostream::DELETE_STREAM); +} + static int AsLexInput(const char *ProgName) { std::string ErrorMessage; MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename, @@ -171,6 +189,10 @@ AsmLexer Lexer(*MAI); Lexer.setBuffer(SrcMgr.getMemoryBuffer(0)); + OwningPtr Out(GetOutputStream()); + if (!Out) + return 1; + bool Error = false; while (Lexer.Lex().isNot(AsmToken::Eof)) { switch (Lexer.getKind()) { @@ -182,69 +204,51 @@ Error = true; // error already printed. break; case AsmToken::Identifier: - outs() << "identifier: " << Lexer.getTok().getString() << '\n'; + *Out << "identifier: " << Lexer.getTok().getString() << '\n'; break; case AsmToken::String: - outs() << "string: " << Lexer.getTok().getString() << '\n'; + *Out << "string: " << Lexer.getTok().getString() << '\n'; break; case AsmToken::Integer: - outs() << "int: " << Lexer.getTok().getString() << '\n'; + *Out << "int: " << Lexer.getTok().getString() << '\n'; break; - case AsmToken::Amp: outs() << "Amp\n"; break; - case AsmToken::AmpAmp: outs() << "AmpAmp\n"; break; - case AsmToken::Caret: outs() << "Caret\n"; break; - case AsmToken::Colon: outs() << "Colon\n"; break; - case AsmToken::Comma: outs() << "Comma\n"; break; - case AsmToken::Dollar: outs() << "Dollar\n"; break; - case AsmToken::EndOfStatement: outs() << "EndOfStatement\n"; break; - case AsmToken::Eof: outs() << "Eof\n"; break; - case AsmToken::Equal: outs() << "Equal\n"; break; - case AsmToken::EqualEqual: outs() << "EqualEqual\n"; break; - case AsmToken::Exclaim: outs() << "Exclaim\n"; break; - case AsmToken::ExclaimEqual: outs() << "ExclaimEqual\n"; break; - case AsmToken::Greater: outs() << "Greater\n"; break; - case AsmToken::GreaterEqual: outs() << "GreaterEqual\n"; break; - case AsmToken::GreaterGreater: outs() << "GreaterGreater\n"; break; - case AsmToken::LParen: outs() << "LParen\n"; break; - case AsmToken::Less: outs() << "Less\n"; break; - case AsmToken::LessEqual: outs() << "LessEqual\n"; break; - case AsmToken::LessGreater: outs() << "LessGreater\n"; break; - case AsmToken::LessLess: outs() << "LessLess\n"; break; - case AsmToken::Minus: outs() << "Minus\n"; break; - case AsmToken::Percent: outs() << "Percent\n"; break; - case AsmToken::Pipe: outs() << "Pipe\n"; break; - case AsmToken::PipePipe: outs() << "PipePipe\n"; break; - case AsmToken::Plus: outs() << "Plus\n"; break; - case AsmToken::RParen: outs() << "RParen\n"; break; - case AsmToken::Slash: outs() << "Slash\n"; break; - case AsmToken::Star: outs() << "Star\n"; break; - case AsmToken::Tilde: outs() << "Tilde\n"; break; + case AsmToken::Amp: *Out << "Amp\n"; break; + case AsmToken::AmpAmp: *Out << "AmpAmp\n"; break; + case AsmToken::Caret: *Out << "Caret\n"; break; + case AsmToken::Colon: *Out << "Colon\n"; break; + case AsmToken::Comma: *Out << "Comma\n"; break; + case AsmToken::Dollar: *Out << "Dollar\n"; break; + case AsmToken::EndOfStatement: *Out << "EndOfStatement\n"; break; + case AsmToken::Eof: *Out << "Eof\n"; break; + case AsmToken::Equal: *Out << "Equal\n"; break; + case AsmToken::EqualEqual: *Out << "EqualEqual\n"; break; + case AsmToken::Exclaim: *Out << "Exclaim\n"; break; + case AsmToken::ExclaimEqual: *Out << "ExclaimEqual\n"; break; + case AsmToken::Greater: *Out << "Greater\n"; break; + case AsmToken::GreaterEqual: *Out << "GreaterEqual\n"; break; + case AsmToken::GreaterGreater: *Out << "GreaterGreater\n"; break; + case AsmToken::LParen: *Out << "LParen\n"; break; + case AsmToken::Less: *Out << "Less\n"; break; + case AsmToken::LessEqual: *Out << "LessEqual\n"; break; + case AsmToken::LessGreater: *Out << "LessGreater\n"; break; + case AsmToken::LessLess: *Out << "LessLess\n"; break; + case AsmToken::Minus: *Out << "Minus\n"; break; + case AsmToken::Percent: *Out << "Percent\n"; break; + case AsmToken::Pipe: *Out << "Pipe\n"; break; + case AsmToken::PipePipe: *Out << "PipePipe\n"; break; + case AsmToken::Plus: *Out << "Plus\n"; break; + case AsmToken::RParen: *Out << "RParen\n"; break; + case AsmToken::Slash: *Out << "Slash\n"; break; + case AsmToken::Star: *Out << "Star\n"; break; + case AsmToken::Tilde: *Out << "Tilde\n"; break; } } - - return Error; -} - -static formatted_raw_ostream *GetOutputStream() { - if (OutputFilename == "") - OutputFilename = "-"; - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT. - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - - std::string Err; - raw_fd_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), Err, - raw_fd_ostream::F_Binary); - if (!Err.empty()) { - errs() << Err << '\n'; - delete Out; - return 0; - } - - return new formatted_raw_ostream(*Out, formatted_raw_ostream::DELETE_STREAM); + // Keep output if no errors. + if (Error == 0) Out->keep(); + + return Error; } static int AssembleInput(const char *ProgName) { @@ -277,10 +281,6 @@ assert(MAI && "Unable to create target asm info!"); MCContext Ctx(*MAI); - formatted_raw_ostream *Out = GetOutputStream(); - if (!Out) - return 1; - // FIXME: We shouldn't need to do this (and link in codegen). OwningPtr TM(TheTarget->createTargetMachine(TripleName, "")); @@ -291,6 +291,10 @@ return 1; } + OwningPtr Out(GetOutputStream()); + if (!Out) + return 1; + OwningPtr Str; if (FileType == OFT_AssemblyFile) { @@ -328,11 +332,9 @@ Parser->setTargetParser(*TAP.get()); int Res = Parser->Run(NoInitialTextSection); - delete Out; - // Delete output on errors. - if (Res && OutputFilename != "-") - sys::Path(OutputFilename).eraseFromDisk(); + // Keep output if no errors. + if (Res == 0) Out->keep(); return Res; } @@ -356,10 +358,20 @@ return 1; } + OwningPtr Out(GetOutputStream()); + if (!Out) + return 1; + + int Res; if (Enhanced) - return Disassembler::disassembleEnhanced(TripleName, *Buffer); + Res = Disassembler::disassembleEnhanced(TripleName, *Buffer, *Out); else - return Disassembler::disassemble(*TheTarget, TripleName, *Buffer); + Res = Disassembler::disassemble(*TheTarget, TripleName, *Buffer, *Out); + + // Keep output if no errors. + if (Res == 0) Out->keep(); + + return Res; } Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=111603&r1=111602&r2=111603&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Thu Aug 19 20:07:01 2010 @@ -385,7 +385,7 @@ } // Figure out what stream we are supposed to write to... - raw_ostream *Out = 0; + OwningPtr Out; if (NoOutput) { if (!OutputFilename.empty()) errs() << "WARNING: The -o (output filename) option is ignored when\n" @@ -395,17 +395,11 @@ if (OutputFilename.empty()) OutputFilename = "-"; - // Make sure that the Output file gets unlinked from the disk if we get - // a SIGINT. - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - std::string ErrorInfo; - Out = new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary); + Out.reset(new tool_output_file(OutputFilename.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; - delete Out; return 1; } } @@ -542,7 +536,7 @@ // Write bitcode or assembly to the output as the last step... if (!NoOutput && !AnalyzeOnly) { if (OutputAssembly) - Passes.add(createPrintModulePass(Out)); + Passes.add(createPrintModulePass(Out.get())); else Passes.add(createBitcodeWriterPass(*Out)); } @@ -550,7 +544,9 @@ // Now that we have all of the passes ready, run them. Passes.run(*M.get()); - // Delete the raw_fd_ostream. - delete Out; + // Declare success. + if (!NoOutput) + Out->keep(); + return 0; } From gohman at apple.com Thu Aug 19 20:12:13 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 01:12:13 -0000 Subject: [llvm-commits] [llvm] r111604 - in /llvm/trunk/tools: llvm-extract/llvm-extract.cpp llvm-link/llvm-link.cpp Message-ID: <20100820011213.856B82A6C131@llvm.org> Author: djg Date: Thu Aug 19 20:12:13 2010 New Revision: 111604 URL: http://llvm.org/viewvc/llvm-project?rev=111604&view=rev Log: Use tool_output_file in llvm-extract and llvm-link too. Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp llvm/trunk/tools/llvm-link/llvm-link.cpp Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-extract/llvm-extract.cpp?rev=111604&r1=111603&r2=111604&view=diff ============================================================================== --- llvm/trunk/tools/llvm-extract/llvm-extract.cpp (original) +++ llvm/trunk/tools/llvm-extract/llvm-extract.cpp Thu Aug 19 20:12:13 2010 @@ -116,14 +116,9 @@ Passes.add(createDeadTypeEliminationPass()); // Remove dead types... Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls - // Make sure that the Output file gets unlinked from the disk if we get a - // SIGINT - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - std::string ErrorInfo; - raw_fd_ostream Out(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary); + tool_output_file Out(OutputFilename.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; return 1; @@ -136,5 +131,8 @@ Passes.run(*M.get()); + // Declare success. + Out.keep(); + return 0; } Modified: llvm/trunk/tools/llvm-link/llvm-link.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-link/llvm-link.cpp?rev=111604&r1=111603&r2=111604&view=diff ============================================================================== --- llvm/trunk/tools/llvm-link/llvm-link.cpp (original) +++ llvm/trunk/tools/llvm-link/llvm-link.cpp Thu Aug 19 20:12:13 2010 @@ -116,19 +116,13 @@ if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite; std::string ErrorInfo; - std::auto_ptr - Out(new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary)); + tool_output_file Out(OutputFilename.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; return 1; } - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - if (verifyModule(*Composite)) { errs() << argv[0] << ": linked module is broken!\n"; return 1; @@ -136,9 +130,12 @@ if (Verbose) errs() << "Writing bitcode...\n"; if (OutputAssembly) { - *Out << *Composite; - } else if (Force || !CheckBitcodeOutputToConsole(*Out, true)) - WriteBitcodeToFile(Composite.get(), *Out); + Out << *Composite; + } else if (Force || !CheckBitcodeOutputToConsole(Out, true)) + WriteBitcodeToFile(Composite.get(), Out); + + // Declare success. + Out.keep(); return 0; } From gohman at apple.com Thu Aug 19 20:25:08 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 19 Aug 2010 18:25:08 -0700 Subject: [llvm-commits] [llvm] r111440 - /llvm/trunk/test/Other/close-stderr.ll In-Reply-To: References: <20100818223557.0EB4F2A6C12C@llvm.org> Message-ID: What kind of unit test would you suggest? This kind of test doesn't seem to fit easily into the main harnesses. Dan On Aug 19, 2010, at 10:14 AM, Daniel Dunbar wrote: > Hi Dan, > > Can you rewrite this as a unit test instead? > > - Daniel > > On Wed, Aug 18, 2010 at 3:35 PM, Dan Gohman wrote: >> Author: djg >> Date: Wed Aug 18 17:35:56 2010 >> New Revision: 111440 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111440&view=rev >> Log: >> Add a testcase to verify that commands don't crash when they hit >> errors on stderr. >> >> Added: >> llvm/trunk/test/Other/close-stderr.ll >> >> Added: llvm/trunk/test/Other/close-stderr.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/close-stderr.ll?rev=111440&view=auto >> ============================================================================== >> --- llvm/trunk/test/Other/close-stderr.ll (added) >> +++ llvm/trunk/test/Other/close-stderr.ll Wed Aug 18 17:35:56 2010 >> @@ -0,0 +1,9 @@ >> +; RUN: sh -c "\ >> +; RUN: opt --reject-this-option 2>&-; echo $?; \ >> +; RUN: opt -o /dev/null /dev/null 2>&-; echo $?; \ >> +; RUN: " | FileCheck %s >> +; CHECK: {{^1$}} >> +; CHECK: {{^0$}} >> + >> +; Test that the error handling when writing to stderr fails exits the >> +; program cleanly rather than aborting. From daniel at zuster.org Thu Aug 19 20:37:50 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 19 Aug 2010 18:37:50 -0700 Subject: [llvm-commits] [llvm] r111440 - /llvm/trunk/test/Other/close-stderr.ll In-Reply-To: References: <20100818223557.0EB4F2A6C12C@llvm.org> Message-ID: On Thu, Aug 19, 2010 at 6:25 PM, Dan Gohman wrote: > What kind of unit test would you suggest? This kind of test > doesn't seem to fit easily into the main harnesses. I may not understand what the problem was, but I thought something like: --- void f0() { close(2); llvm::errs() << "ok"; } -- would be enough to reproduce the problem? - Daniel > > Dan > > On Aug 19, 2010, at 10:14 AM, Daniel Dunbar wrote: > >> Hi Dan, >> >> Can you rewrite this as a unit test instead? >> >> - Daniel >> >> On Wed, Aug 18, 2010 at 3:35 PM, Dan Gohman wrote: >>> Author: djg >>> Date: Wed Aug 18 17:35:56 2010 >>> New Revision: 111440 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=111440&view=rev >>> Log: >>> Add a testcase to verify that commands don't crash when they hit >>> errors on stderr. >>> >>> Added: >>> ? ?llvm/trunk/test/Other/close-stderr.ll >>> >>> Added: llvm/trunk/test/Other/close-stderr.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/close-stderr.ll?rev=111440&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/Other/close-stderr.ll (added) >>> +++ llvm/trunk/test/Other/close-stderr.ll Wed Aug 18 17:35:56 2010 >>> @@ -0,0 +1,9 @@ >>> +; RUN: sh -c "\ >>> +; RUN: ? ? ? ?opt --reject-this-option 2>&-; echo $?; \ >>> +; RUN: ? ? ? ?opt -o /dev/null /dev/null 2>&-; echo $?; \ >>> +; RUN: ? ? ? " | FileCheck %s >>> +; CHECK: {{^1$}} >>> +; CHECK: {{^0$}} >>> + >>> +; Test that the error handling when writing to stderr fails exits the >>> +; program cleanly rather than aborting. > > From bob.wilson at apple.com Thu Aug 19 23:34:18 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 04:34:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111613 - /llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Message-ID: <20100820043418.E46AE2A6C12C@llvm.org> Author: bwilson Date: Thu Aug 19 23:34:18 2010 New Revision: 111613 URL: http://llvm.org/viewvc/llvm-project?rev=111613&view=rev Log: Translate NEON vmovl intrinsics to zero/sign-extend operations. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=111613&r1=111612&r2=111613&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Thu Aug 19 23:34:18 2010 @@ -1747,13 +1747,11 @@ case NEON_BUILTIN_vmovl: if (datatype == neon_datatype_signed) - intID = Intrinsic::arm_neon_vmovls; + Result = Builder.CreateSExt(Ops[0], ResultType); else if (datatype == neon_datatype_unsigned) - intID = Intrinsic::arm_neon_vmovlu; + Result = Builder.CreateZExt(Ops[0], ResultType); else return BadImmediateError(exp, Result); - intFn = Intrinsic::getDeclaration(TheModule, intID, &ResultType, 1); - Result = Builder.CreateCall(intFn, Ops[0]); break; case NEON_BUILTIN_vext: { From bob.wilson at apple.com Thu Aug 19 23:54:02 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 04:54:02 -0000 Subject: [llvm-commits] [llvm] r111614 - in /llvm/trunk: include/llvm/IntrinsicsARM.td lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMInstrNEON.td lib/VMCore/AutoUpgrade.cpp test/Bitcode/neon-intrinsics.ll test/Bitcode/neon-intrinsics.ll.bc test/CodeGen/ARM/neon-ops.ll test/CodeGen/ARM/vmov.ll Message-ID: <20100820045402.D32002A6C12C@llvm.org> Author: bwilson Date: Thu Aug 19 23:54:02 2010 New Revision: 111614 URL: http://llvm.org/viewvc/llvm-project?rev=111614&view=rev Log: Replace the arm.neon.vmovls and vmovlu intrinsics with vector sign-extend and zero-extend operations. Added: llvm/trunk/test/Bitcode/neon-intrinsics.ll llvm/trunk/test/Bitcode/neon-intrinsics.ll.bc (with props) Removed: llvm/trunk/test/CodeGen/ARM/neon-ops.ll Modified: llvm/trunk/include/llvm/IntrinsicsARM.td llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMInstrNEON.td llvm/trunk/lib/VMCore/AutoUpgrade.cpp llvm/trunk/test/CodeGen/ARM/vmov.ll Modified: llvm/trunk/include/llvm/IntrinsicsARM.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsARM.td?rev=111614&r1=111613&r2=111614&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsARM.td (original) +++ llvm/trunk/include/llvm/IntrinsicsARM.td Thu Aug 19 23:54:02 2010 @@ -60,9 +60,6 @@ class Neon_1Arg_Narrow_Intrinsic : Intrinsic<[llvm_anyvector_ty], [LLVMExtendedElementVectorType<0>], [IntrNoMem]>; - class Neon_1Arg_Long_Intrinsic - : Intrinsic<[llvm_anyvector_ty], - [LLVMTruncatedElementVectorType<0>], [IntrNoMem]>; class Neon_2Arg_Intrinsic : Intrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>; @@ -322,8 +319,6 @@ def int_arm_neon_vqmovns : Neon_1Arg_Narrow_Intrinsic; def int_arm_neon_vqmovnu : Neon_1Arg_Narrow_Intrinsic; def int_arm_neon_vqmovnsu : Neon_1Arg_Narrow_Intrinsic; -def int_arm_neon_vmovls : Neon_1Arg_Long_Intrinsic; -def int_arm_neon_vmovlu : Neon_1Arg_Long_Intrinsic; // Vector Table Lookup. // The first 1-4 arguments are the table. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=111614&r1=111613&r2=111614&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Aug 19 23:54:02 2010 @@ -125,12 +125,14 @@ setOperationAction(ISD::EXTRACT_SUBVECTOR, VT.getSimpleVT(), Expand); setOperationAction(ISD::SELECT, VT.getSimpleVT(), Expand); setOperationAction(ISD::SELECT_CC, VT.getSimpleVT(), Expand); - setOperationAction(ISD::ZERO_EXTEND, VT.getSimpleVT(), Expand); if (VT.isInteger()) { setOperationAction(ISD::SHL, VT.getSimpleVT(), Custom); setOperationAction(ISD::SRA, VT.getSimpleVT(), Custom); setOperationAction(ISD::SRL, VT.getSimpleVT(), Custom); + setLoadExtAction(ISD::SEXTLOAD, VT.getSimpleVT(), Expand); + setLoadExtAction(ISD::ZEXTLOAD, VT.getSimpleVT(), Expand); } + setLoadExtAction(ISD::EXTLOAD, VT.getSimpleVT(), Expand); // Promote all bit-wise operations. if (VT.isInteger() && VT != PromotedBitwiseVT) { @@ -320,6 +322,8 @@ setOperationAction(ISD::FNEARBYINT, MVT::v2f64, Expand); setOperationAction(ISD::FFLOOR, MVT::v2f64, Expand); + setTruncStoreAction(MVT::v2f64, MVT::v2f32, Expand); + // Neon does not support some operations on v1i64 and v2i64 types. setOperationAction(ISD::MUL, MVT::v1i64, Expand); setOperationAction(ISD::MUL, MVT::v2i64, Expand); @@ -3786,7 +3790,7 @@ case ISD::VECTOR_SHUFFLE: return LowerVECTOR_SHUFFLE(Op, DAG); case ISD::EXTRACT_VECTOR_ELT: return LowerEXTRACT_VECTOR_ELT(Op, DAG); case ISD::CONCAT_VECTORS: return LowerCONCAT_VECTORS(Op, DAG); - case ISD::FLT_ROUNDS_: return LowerFLT_ROUNDS_(Op, DAG); + case ISD::FLT_ROUNDS_: return LowerFLT_ROUNDS_(Op, DAG); } return SDValue(); } Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=111614&r1=111613&r2=111614&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Thu Aug 19 23:54:02 2010 @@ -888,14 +888,14 @@ (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "", [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>; -// Long 2-register intrinsics (currently only used for VMOVL). -class N2VLInt op24_23, bits<2> op21_20, bits<2> op19_18, - bits<2> op17_16, bits<5> op11_7, bit op6, bit op4, - InstrItinClass itin, string OpcodeStr, string Dt, - ValueType TyQ, ValueType TyD, Intrinsic IntOp> +// Long 2-register operations (currently only used for VMOVL). +class N2VL op24_23, bits<2> op21_20, bits<2> op19_18, + bits<2> op17_16, bits<5> op11_7, bit op6, bit op4, + InstrItinClass itin, string OpcodeStr, string Dt, + ValueType TyQ, ValueType TyD, SDNode OpNode> : N2V; + [(set QPR:$dst, (TyQ (OpNode (TyD DPR:$src))))]>; // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register. class N2VDShuffle op19_18, bits<5> op11_7, string OpcodeStr, string Dt> @@ -1508,14 +1508,14 @@ // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL). // source operand element sizes of 16, 32 and 64 bits: -multiclass N2VLInt_QHS op24_23, bits<5> op11_7, bit op6, bit op4, - string OpcodeStr, string Dt, Intrinsic IntOp> { - def v8i16 : N2VLInt; - def v4i32 : N2VLInt; - def v2i64 : N2VLInt; +multiclass N2VL_QHS op24_23, bits<5> op11_7, bit op6, bit op4, + string OpcodeStr, string Dt, SDNode OpNode> { + def v8i16 : N2VL; + def v4i32 : N2VL; + def v2i64 : N2VL; } @@ -3123,10 +3123,8 @@ defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD, "vqmovun", "s", int_arm_neon_vqmovnsu>; // VMOVL : Vector Lengthening Move -defm VMOVLs : N2VLInt_QHS<0b01,0b10100,0,1, "vmovl", "s", - int_arm_neon_vmovls>; -defm VMOVLu : N2VLInt_QHS<0b11,0b10100,0,1, "vmovl", "u", - int_arm_neon_vmovlu>; +defm VMOVLs : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>; +defm VMOVLu : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>; // Vector Conversions. Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=111614&r1=111613&r2=111614&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Thu Aug 19 23:54:02 2010 @@ -78,6 +78,13 @@ NewFn = F; return true; } + } else if (Name.compare(5, 9, "arm.neon.", 9) == 0) { + if (Name.compare(14, 7, "vmovls.", 7) == 0 || + Name.compare(14, 7, "vmovlu.", 7) == 0) { + // Calls to these are transformed into IR without intrinsics. + NewFn = 0; + return true; + } } break; case 'b': @@ -320,6 +327,28 @@ assert(F && "CallInst has no function associated with it."); if (!NewFn) { + // Get the Function's name. + const std::string& Name = F->getName(); + + // Upgrade ARM NEON intrinsics. + if (Name.compare(5, 9, "arm.neon.", 9) == 0) { + Instruction *NewI; + if (Name.compare(14, 7, "vmovls.", 7) == 0) { + NewI = new SExtInst(CI->getArgOperand(0), CI->getType(), + "upgraded." + CI->getName(), CI); + } else if (Name.compare(14, 7, "vmovlu.", 7) == 0) { + NewI = new ZExtInst(CI->getArgOperand(0), CI->getType(), + "upgraded." + CI->getName(), CI); + } else { + llvm_unreachable("Unknown arm.neon function for CallInst upgrade."); + } + // Replace any uses of the old CallInst. + if (!CI->use_empty()) + CI->replaceAllUsesWith(NewI); + CI->eraseFromParent(); + return; + } + bool isLoadH = false, isLoadL = false, isMovL = false; bool isMovSD = false, isShufPD = false; bool isUnpckhPD = false, isUnpcklPD = false; Added: llvm/trunk/test/Bitcode/neon-intrinsics.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/neon-intrinsics.ll?rev=111614&view=auto ============================================================================== --- llvm/trunk/test/Bitcode/neon-intrinsics.ll (added) +++ llvm/trunk/test/Bitcode/neon-intrinsics.ll Thu Aug 19 23:54:02 2010 @@ -0,0 +1,29 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; vmovls should be auto-upgraded to sext + +; CHECK: vmovls8 +; CHECK-NOT: arm.neon.vmovls.v8i16 +; CHECK: sext <8 x i8> + +; CHECK: vmovls16 +; CHECK-NOT: arm.neon.vmovls.v4i32 +; CHECK: sext <4 x i16> + +; CHECK: vmovls32 +; CHECK-NOT: arm.neon.vmovls.v2i64 +; CHECK: sext <2 x i32> + +; vmovlu should be auto-upgraded to zext + +; CHECK: vmovlu8 +; CHECK-NOT: arm.neon.vmovlu.v8i16 +; CHECK: zext <8 x i8> + +; CHECK: vmovlu16 +; CHECK-NOT: arm.neon.vmovlu.v4i32 +; CHECK: zext <4 x i16> + +; CHECK: vmovlu32 +; CHECK-NOT: arm.neon.vmovlu.v2i64 +; CHECK: zext <2 x i32> Added: llvm/trunk/test/Bitcode/neon-intrinsics.ll.bc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/neon-intrinsics.ll.bc?rev=111614&view=auto ============================================================================== Binary file - no diff available. Propchange: llvm/trunk/test/Bitcode/neon-intrinsics.ll.bc ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Removed: llvm/trunk/test/CodeGen/ARM/neon-ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/neon-ops.ll?rev=111613&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/neon-ops.ll (original) +++ llvm/trunk/test/CodeGen/ARM/neon-ops.ll (removed) @@ -1,7 +0,0 @@ -; RUN: llc -march=arm -mattr=+neon -O2 -o /dev/null - -; This used to crash. -define <4 x i32> @test1(<4 x i16> %a) { - %A = zext <4 x i16> %a to <4 x i32> - ret <4 x i32> %A -} Modified: llvm/trunk/test/CodeGen/ARM/vmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vmov.ll?rev=111614&r1=111613&r2=111614&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vmov.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vmov.ll Thu Aug 19 23:54:02 2010 @@ -192,7 +192,7 @@ ;CHECK: vmovls8: ;CHECK: vmovl.s8 %tmp1 = load <8 x i8>* %A - %tmp2 = call <8 x i16> @llvm.arm.neon.vmovls.v8i16(<8 x i8> %tmp1) + %tmp2 = sext <8 x i8> %tmp1 to <8 x i16> ret <8 x i16> %tmp2 } @@ -200,7 +200,7 @@ ;CHECK: vmovls16: ;CHECK: vmovl.s16 %tmp1 = load <4 x i16>* %A - %tmp2 = call <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16> %tmp1) + %tmp2 = sext <4 x i16> %tmp1 to <4 x i32> ret <4 x i32> %tmp2 } @@ -208,7 +208,7 @@ ;CHECK: vmovls32: ;CHECK: vmovl.s32 %tmp1 = load <2 x i32>* %A - %tmp2 = call <2 x i64> @llvm.arm.neon.vmovls.v2i64(<2 x i32> %tmp1) + %tmp2 = sext <2 x i32> %tmp1 to <2 x i64> ret <2 x i64> %tmp2 } @@ -216,7 +216,7 @@ ;CHECK: vmovlu8: ;CHECK: vmovl.u8 %tmp1 = load <8 x i8>* %A - %tmp2 = call <8 x i16> @llvm.arm.neon.vmovlu.v8i16(<8 x i8> %tmp1) + %tmp2 = zext <8 x i8> %tmp1 to <8 x i16> ret <8 x i16> %tmp2 } @@ -224,7 +224,7 @@ ;CHECK: vmovlu16: ;CHECK: vmovl.u16 %tmp1 = load <4 x i16>* %A - %tmp2 = call <4 x i32> @llvm.arm.neon.vmovlu.v4i32(<4 x i16> %tmp1) + %tmp2 = zext <4 x i16> %tmp1 to <4 x i32> ret <4 x i32> %tmp2 } @@ -232,18 +232,10 @@ ;CHECK: vmovlu32: ;CHECK: vmovl.u32 %tmp1 = load <2 x i32>* %A - %tmp2 = call <2 x i64> @llvm.arm.neon.vmovlu.v2i64(<2 x i32> %tmp1) + %tmp2 = zext <2 x i32> %tmp1 to <2 x i64> ret <2 x i64> %tmp2 } -declare <8 x i16> @llvm.arm.neon.vmovls.v8i16(<8 x i8>) nounwind readnone -declare <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16>) nounwind readnone -declare <2 x i64> @llvm.arm.neon.vmovls.v2i64(<2 x i32>) nounwind readnone - -declare <8 x i16> @llvm.arm.neon.vmovlu.v8i16(<8 x i8>) nounwind readnone -declare <4 x i32> @llvm.arm.neon.vmovlu.v4i32(<4 x i16>) nounwind readnone -declare <2 x i64> @llvm.arm.neon.vmovlu.v2i64(<2 x i32>) nounwind readnone - define <8 x i8> @vmovni16(<8 x i16>* %A) nounwind { ;CHECK: vmovni16: ;CHECK: vmovn.i16 From nicholas at mxc.ca Fri Aug 20 00:38:58 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 19 Aug 2010 22:38:58 -0700 Subject: [llvm-commits] [llvm] r111586 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <20100819235239.6E0992A6C12C@llvm.org> References: <20100819235239.6E0992A6C12C@llvm.org> Message-ID: <4C6E14F2.5050402@mxc.ca> Bob Wilson wrote: > Author: bwilson > Date: Thu Aug 19 18:52:39 2010 > New Revision: 111586 > > URL: http://llvm.org/viewvc/llvm-project?rev=111586&view=rev > Log: > If the target says that an extending load is not legal, regardless of whether > it involves specific floating-point types, legalize should expand an > extending load to a non-extending load followed by a separate extend operation. > For example, we currently expand SEXTLOAD to EXTLOAD+SIGN_EXTEND_INREG (and > assert that EXTLOAD should always be supported). Now we can expand that to > LOAD+SIGN_EXTEND. This is needed to allow vector SIGN_EXTEND and ZERO_EXTEND > to be used for NEON. Woot! Thanks!! Nick > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=111586&r1=111585&r2=111586&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Aug 19 18:52:39 2010 > @@ -1314,17 +1314,22 @@ > } > break; > case TargetLowering::Expand: > - // f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND > - // f128 = EXTLOAD {f32,f64} too > - if ((SrcVT == MVT::f32&& (Node->getValueType(0) == MVT::f64 || > - Node->getValueType(0) == MVT::f128)) || > - (SrcVT == MVT::f64&& Node->getValueType(0) == MVT::f128)) { > + if (!TLI.isLoadExtLegal(ISD::EXTLOAD, SrcVT)) { > SDValue Load = DAG.getLoad(SrcVT, dl, Tmp1, Tmp2, LD->getSrcValue(), > LD->getSrcValueOffset(), > LD->isVolatile(), LD->isNonTemporal(), > LD->getAlignment()); > - Result = DAG.getNode(ISD::FP_EXTEND, dl, > - Node->getValueType(0), Load); > + unsigned ExtendOp; > + switch (ExtType) { > + case ISD::EXTLOAD: > + ExtendOp = (SrcVT.isFloatingPoint() ? > + ISD::FP_EXTEND : ISD::ANY_EXTEND); > + break; > + case ISD::SEXTLOAD: ExtendOp = ISD::SIGN_EXTEND; break; > + case ISD::ZEXTLOAD: ExtendOp = ISD::ZERO_EXTEND; break; > + default: assert(0&& "Unexpected extend load type!"); > + } > + Result = DAG.getNode(ExtendOp, dl, Node->getValueType(0), Load); > Tmp1 = LegalizeOp(Result); // Relegalize new nodes. > Tmp2 = LegalizeOp(Load.getValue(1)); > break; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From foldr at codedgers.com Fri Aug 20 06:24:31 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 11:24:31 -0000 Subject: [llvm-commits] [llvm] r111617 - /llvm/trunk/include/llvm/Support/GraphWriter.h Message-ID: <20100820112431.3581C2A6C12C@llvm.org> Author: foldr Date: Fri Aug 20 06:24:31 2010 New Revision: 111617 URL: http://llvm.org/viewvc/llvm-project?rev=111617&view=rev Log: Trailing whitespace. Modified: llvm/trunk/include/llvm/Support/GraphWriter.h Modified: llvm/trunk/include/llvm/Support/GraphWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GraphWriter.h?rev=111617&r1=111616&r2=111617&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/GraphWriter.h (original) +++ llvm/trunk/include/llvm/Support/GraphWriter.h Fri Aug 20 06:24:31 2010 @@ -89,7 +89,7 @@ public: GraphWriter(raw_ostream &o, const GraphType &g, bool SN) : O(o), G(g) { - DTraits = DOTTraits(SN); + DTraits = DOTTraits(SN); } void writeHeader(const std::string &Name) { From foldr at codedgers.com Fri Aug 20 06:24:35 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 11:24:35 -0000 Subject: [llvm-commits] [llvm] r111618 - /llvm/trunk/include/llvm/Support/GraphWriter.h Message-ID: <20100820112435.CA9CB2A6C12D@llvm.org> Author: foldr Date: Fri Aug 20 06:24:35 2010 New Revision: 111618 URL: http://llvm.org/viewvc/llvm-project?rev=111618&view=rev Log: Disambiguate calls to WriteGraph() to disable ADL. Modified: llvm/trunk/include/llvm/Support/GraphWriter.h Modified: llvm/trunk/include/llvm/Support/GraphWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GraphWriter.h?rev=111618&r1=111617&r2=111618&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/GraphWriter.h (original) +++ llvm/trunk/include/llvm/Support/GraphWriter.h Fri Aug 20 06:24:35 2010 @@ -322,7 +322,7 @@ raw_fd_ostream O(Filename.c_str(), ErrorInfo); if (ErrorInfo.empty()) { - WriteGraph(O, G, ShortNames, Name, Title); + llvm::WriteGraph(O, G, ShortNames, Name, Title); errs() << " done. \n"; } else { errs() << "error opening file '" << Filename.str() << "' for writing!\n"; @@ -339,7 +339,7 @@ void ViewGraph(const GraphType &G, const std::string &Name, bool ShortNames = false, const std::string &Title = "", GraphProgram::Name Program = GraphProgram::DOT) { - sys::Path Filename = WriteGraph(G, Name, ShortNames, Title); + sys::Path Filename = llvm::WriteGraph(G, Name, ShortNames, Title); if (Filename.isEmpty()) return; From foldr at codedgers.com Fri Aug 20 06:24:44 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 11:24:44 -0000 Subject: [llvm-commits] [llvm] r111619 - in /llvm/trunk: include/llvm/CompilerDriver/BuiltinOptions.h lib/CompilerDriver/BuiltinOptions.cpp tools/llvmc/examples/mcc16/Hooks.cpp utils/TableGen/LLVMCConfigurationEmitter.cpp Message-ID: <20100820112444.EA7B42A6C12C@llvm.org> Author: foldr Date: Fri Aug 20 06:24:44 2010 New Revision: 111619 URL: http://llvm.org/viewvc/llvm-project?rev=111619&view=rev Log: llvmc: Cut global namespace pollution. Modified: llvm/trunk/include/llvm/CompilerDriver/BuiltinOptions.h llvm/trunk/lib/CompilerDriver/BuiltinOptions.cpp llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Modified: llvm/trunk/include/llvm/CompilerDriver/BuiltinOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CompilerDriver/BuiltinOptions.h?rev=111619&r1=111618&r2=111619&view=diff ============================================================================== --- llvm/trunk/include/llvm/CompilerDriver/BuiltinOptions.h (original) +++ llvm/trunk/include/llvm/CompilerDriver/BuiltinOptions.h Fri Aug 20 06:24:44 2010 @@ -18,6 +18,8 @@ #include +namespace llvmc { + namespace SaveTempsEnum { enum Values { Cwd, Obj, Unset }; } extern llvm::cl::list InputFilenames; @@ -32,4 +34,6 @@ extern llvm::cl::opt WriteGraph; extern llvm::cl::opt SaveTemps; +} // End namespace llvmc. + #endif // LLVM_INCLUDE_COMPILER_DRIVER_BUILTIN_OPTIONS_H Modified: llvm/trunk/lib/CompilerDriver/BuiltinOptions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CompilerDriver/BuiltinOptions.cpp?rev=111619&r1=111618&r2=111619&view=diff ============================================================================== --- llvm/trunk/lib/CompilerDriver/BuiltinOptions.cpp (original) +++ llvm/trunk/lib/CompilerDriver/BuiltinOptions.cpp Fri Aug 20 06:24:44 2010 @@ -19,7 +19,7 @@ namespace cl = llvm::cl; -// External linkage here is intentional. +namespace llvmc { cl::list InputFilenames(cl::Positional, cl::desc(""), cl::ZeroOrMore); @@ -57,3 +57,5 @@ clEnumValN(SaveTempsEnum::Obj, "", "Same as 'cwd'"), clEnumValEnd), cl::ValueOptional); + +} // End namespace llvmc. Modified: llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp?rev=111619&r1=111618&r2=111619&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp Fri Aug 20 06:24:44 2010 @@ -4,13 +4,16 @@ #include -using namespace llvm; - namespace llvmc { extern char *ProgramName; + + namespace autogenerated { + extern llvm::cl::opt AutoGeneratedParameter_p; + } } -extern cl::opt AutoGeneratedParameter_p; +using namespace llvm; +using namespace llvmc; // Returns the platform specific directory separator via #ifdefs. // FIXME: This currently work on linux and windows only. It does not @@ -29,10 +32,10 @@ std::string GetLowerCasePartDefine(void) { std::string Partname; - if (AutoGeneratedParameter_p.empty()) { + if (autogenerated::AutoGeneratedParameter_p.empty()) { Partname = "16f1xxx"; } else { - Partname = AutoGeneratedParameter_p; + Partname = autogenerated::AutoGeneratedParameter_p; } std::string LowerCase; @@ -46,10 +49,10 @@ std::string GetUpperCasePartDefine(void) { std::string Partname; - if (AutoGeneratedParameter_p.empty()) { + if (autogenerated::AutoGeneratedParameter_p.empty()) { Partname = "16f1xxx"; } else { - Partname = AutoGeneratedParameter_p; + Partname = autogenerated::AutoGeneratedParameter_p; } std::string UpperCase; Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=111619&r1=111618&r2=111619&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri Aug 20 06:24:44 2010 @@ -2909,7 +2909,6 @@ if (HookNames.empty()) return; - O << "namespace hooks {\n"; for (HookInfoMap::const_iterator B = HookNames.begin(), E = HookNames.end(); B != E; ++B) { const char* HookName = B->first(); @@ -2928,7 +2927,6 @@ O <<");\n"; } - O << "}\n\n"; } /// EmitIncludes - Emit necessary #include directives and some @@ -3013,12 +3011,19 @@ EmitIncludes(O); // Emit global option registration code. + O << "namespace llvmc {\n" + << "namespace autogenerated {\n\n"; EmitOptionDefinitions(Data.OptDescs, Data.HasSink, O); + O << "} // End namespace autogenerated.\n" + << "} // End namespace llvmc.\n\n"; // Emit hook declarations. + O << "namespace hooks {\n"; EmitHookDeclarations(Data.ToolDescs, Data.OptDescs, O); + O << "} // End namespace hooks.\n\n"; O << "namespace {\n\n"; + O << "using namespace llvmc::autogenerated;\n\n"; // Emit Tool classes. for (ToolDescriptions::const_iterator B = Data.ToolDescs.begin(), From foldr at codedgers.com Fri Aug 20 06:24:51 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 11:24:51 -0000 Subject: [llvm-commits] [llvm] r111620 - in /llvm/trunk: tools/llvmc/examples/mcc16/Hooks.cpp utils/TableGen/LLVMCConfigurationEmitter.cpp Message-ID: <20100820112451.2D77C2A6C12D@llvm.org> Author: foldr Date: Fri Aug 20 06:24:51 2010 New Revision: 111620 URL: http://llvm.org/viewvc/llvm-project?rev=111620&view=rev Log: llvmc: Do not prefix option names with AutoGenerated. Since they now live in the namespace 'autogenerated'. Modified: llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Modified: llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp?rev=111620&r1=111619&r2=111620&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp (original) +++ llvm/trunk/tools/llvmc/examples/mcc16/Hooks.cpp Fri Aug 20 06:24:51 2010 @@ -8,7 +8,7 @@ extern char *ProgramName; namespace autogenerated { - extern llvm::cl::opt AutoGeneratedParameter_p; + extern llvm::cl::opt Parameter_p; } } @@ -32,10 +32,10 @@ std::string GetLowerCasePartDefine(void) { std::string Partname; - if (autogenerated::AutoGeneratedParameter_p.empty()) { + if (autogenerated::Parameter_p.empty()) { Partname = "16f1xxx"; } else { - Partname = autogenerated::AutoGeneratedParameter_p; + Partname = autogenerated::Parameter_p; } std::string LowerCase; @@ -49,10 +49,10 @@ std::string GetUpperCasePartDefine(void) { std::string Partname; - if (autogenerated::AutoGeneratedParameter_p.empty()) { + if (autogenerated::Parameter_p.empty()) { Partname = "16f1xxx"; } else { - Partname = autogenerated::AutoGeneratedParameter_p; + Partname = autogenerated::Parameter_p; } std::string UpperCase; Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=111620&r1=111619&r2=111620&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri Aug 20 06:24:51 2010 @@ -49,7 +49,7 @@ const char * const DefaultHelpString = "NO HELP MESSAGE PROVIDED"; // Name for the "sink" option. -const char * const SinkOptionName = "AutoGeneratedSinkOption"; +const char * const SinkOptionName = "SinkOption"; //===----------------------------------------------------------------------===// /// Helper functions @@ -261,7 +261,13 @@ /// GenVariableName - Returns the variable name used in the /// generated C++ code. - std::string GenVariableName() const; + std::string GenVariableName() const + { return "autogenerated::" + GenOptionType() + EscapeVariableName(Name); } + + /// GenPlainVariableName - Returns the variable name without the namespace + /// prefix. + std::string GenPlainVariableName() const + { return GenOptionType() + EscapeVariableName(Name); } /// Merge - Merge two option descriptions. void Merge (const OptionDescription& other); @@ -315,6 +321,10 @@ { return (OptionType::IsList(this->Type) && !OptionType::IsSwitchList(this->Type)); } +private: + + // GenOptionType - Helper function used by GenVariableName(). + std::string GenOptionType() const; }; void OptionDescription::CheckConsistency() const { @@ -428,22 +438,21 @@ } } -std::string OptionDescription::GenVariableName() const { - const std::string& EscapedName = EscapeVariableName(Name); +std::string OptionDescription::GenOptionType() const { switch (Type) { case OptionType::Alias: - return "AutoGeneratedAlias_" + EscapedName; + return "Alias_"; case OptionType::PrefixList: case OptionType::ParameterList: - return "AutoGeneratedList_" + EscapedName; + return "List_"; case OptionType::Switch: - return "AutoGeneratedSwitch_" + EscapedName; + return "Switch_"; case OptionType::SwitchList: - return "AutoGeneratedSwitchList_" + EscapedName; + return "SwitchList_"; case OptionType::Prefix: case OptionType::Parameter: default: - return "AutoGeneratedParameter_" + EscapedName; + return "Parameter_"; } } @@ -2210,13 +2219,15 @@ O.indent(Indent2) << "}\n\n"; // Handle the Sink property. + std::string SinkOption("autogenerated::"); + SinkOption += SinkOptionName; if (D.isSink()) { - O.indent(Indent2) << "if (!" << SinkOptionName << ".empty()) {\n"; + O.indent(Indent2) << "if (!" << SinkOption << ".empty()) {\n"; O.indent(Indent3) << "for (cl::list::iterator B = " - << SinkOptionName << ".begin(), E = " << SinkOptionName + << SinkOption << ".begin(), E = " << SinkOption << ".end(); B != E; ++B)\n"; - O.indent(Indent4) << "vec.push_back(std::make_pair(" << SinkOptionName - << ".getPosition(B - " << SinkOptionName + O.indent(Indent4) << "vec.push_back(std::make_pair(" << SinkOption + << ".getPosition(B - " << SinkOption << ".begin()), *B));\n"; O.indent(Indent2) << "}\n"; } @@ -2365,7 +2376,7 @@ } O << val.GenTypeDeclaration() << ' ' - << val.GenVariableName(); + << val.GenPlainVariableName(); O << "(\"" << val.Name << "\"\n"; @@ -2427,7 +2438,7 @@ // Emit the sink option. if (HasSink) - O << "cl" << "::list " << SinkOptionName << "(cl::Sink);\n"; + O << "cl::list " << SinkOptionName << "(cl::Sink);\n"; O << '\n'; } From benny.kra at googlemail.com Fri Aug 20 08:03:33 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Fri, 20 Aug 2010 13:03:33 -0000 Subject: [llvm-commits] [llvm] r111621 - in /llvm/trunk/test/LLVMC: ForwardTransformedValue.td ForwardValue.td Message-ID: <20100820130333.62D842A6C12C@llvm.org> Author: d0k Date: Fri Aug 20 08:03:33 2010 New Revision: 111621 URL: http://llvm.org/viewvc/llvm-project?rev=111621&view=rev Log: Update LLVMC tests for r111620. Modified: llvm/trunk/test/LLVMC/ForwardTransformedValue.td llvm/trunk/test/LLVMC/ForwardValue.td Modified: llvm/trunk/test/LLVMC/ForwardTransformedValue.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/ForwardTransformedValue.td?rev=111621&r1=111620&r2=111621&view=diff ============================================================================== --- llvm/trunk/test/LLVMC/ForwardTransformedValue.td (original) +++ llvm/trunk/test/LLVMC/ForwardTransformedValue.td Fri Aug 20 08:03:33 2010 @@ -18,9 +18,9 @@ (in_language "dummy"), (out_language "dummy"), (actions (case - // CHECK: HookA(AutoGeneratedParameter_a + // CHECK: HookA(autogenerated::Parameter_a (not_empty "a"), (forward_transformed_value "a", "HookA"), - // CHECK: HookB(AutoGeneratedList_b + // CHECK: HookB(autogenerated::List_b (not_empty "b"), (forward_transformed_value "b", "HookB"))) ]>; Modified: llvm/trunk/test/LLVMC/ForwardValue.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/ForwardValue.td?rev=111621&r1=111620&r2=111621&view=diff ============================================================================== --- llvm/trunk/test/LLVMC/ForwardValue.td (original) +++ llvm/trunk/test/LLVMC/ForwardValue.td Fri Aug 20 08:03:33 2010 @@ -15,9 +15,9 @@ (in_language "dummy"), (out_language "dummy"), (actions (case - // CHECK: , AutoGeneratedParameter_a)); + // CHECK: , autogenerated::Parameter_a)); (not_empty "a"), (forward_value "a"), - // CHECK: B = AutoGeneratedList_b.begin() + // CHECK: B = autogenerated::List_b.begin() (not_empty "b"), (forward_value "b"))) ]>; From bob.wilson at apple.com Fri Aug 20 09:19:38 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 14:19:38 -0000 Subject: [llvm-commits] [llvm] r111622 - /llvm/trunk/test/lit.cfg Message-ID: <20100820141938.CE58B2A6C12C@llvm.org> Author: bwilson Date: Fri Aug 20 09:19:38 2010 New Revision: 111622 URL: http://llvm.org/viewvc/llvm-project?rev=111622&view=rev Log: The %ocamlopt setting has embedded quotes. Copy the entire value instead of stopping at the first embedded quote. Modified: llvm/trunk/test/lit.cfg Modified: llvm/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=111622&r1=111621&r2=111622&view=diff ============================================================================== --- llvm/trunk/test/lit.cfg (original) +++ llvm/trunk/test/lit.cfg Fri Aug 20 09:19:38 2010 @@ -111,7 +111,7 @@ site_exp = {} # FIXME: Implement lit.site.cfg. for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')): - m = re.match('set ([^ ]+) "([^"]*)"', line) + m = re.match('set ([^ ]+) "(.*)"', line) if m: site_exp[m.group(1)] = m.group(2) From bob.wilson at apple.com Fri Aug 20 09:20:17 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 14:20:17 -0000 Subject: [llvm-commits] [llvm] r111623 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml bitreader.ml bitwriter.ml executionengine.ml vmcore.ml Message-ID: <20100820142017.CB34F2A6C12C@llvm.org> Author: bwilson Date: Fri Aug 20 09:20:17 2010 New Revision: 111623 URL: http://llvm.org/viewvc/llvm-project?rev=111623&view=rev Log: Fix some Ocaml tests: the %t substitution now returns an absolute path. Modified: llvm/trunk/test/Bindings/Ocaml/analysis.ml llvm/trunk/test/Bindings/Ocaml/bitreader.ml llvm/trunk/test/Bindings/Ocaml/bitwriter.ml llvm/trunk/test/Bindings/Ocaml/executionengine.ml llvm/trunk/test/Bindings/Ocaml/vmcore.ml Modified: llvm/trunk/test/Bindings/Ocaml/analysis.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/analysis.ml?rev=111623&r1=111622&r2=111623&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/analysis.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/analysis.ml Fri Aug 20 09:20:17 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_analysis.cmxa %s -o %t - * RUN: ./%t %t.bc + * RUN: %t %t.bc *) open Llvm Modified: llvm/trunk/test/Bindings/Ocaml/bitreader.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/bitreader.ml?rev=111623&r1=111622&r2=111623&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/bitreader.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/bitreader.ml Fri Aug 20 09:20:17 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_bitreader.cmxa llvm_bitwriter.cmxa %s -o %t - * RUN: ./%t %t.bc + * RUN: %t %t.bc * RUN: llvm-dis < %t.bc | grep caml_int_ty *) Modified: llvm/trunk/test/Bindings/Ocaml/bitwriter.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/bitwriter.ml?rev=111623&r1=111622&r2=111623&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/bitwriter.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/bitwriter.ml Fri Aug 20 09:20:17 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A unix.cmxa llvm.cmxa llvm_bitwriter.cmxa %s -o %t - * RUN: ./%t %t.bc + * RUN: %t %t.bc * RUN: llvm-dis < %t.bc | grep caml_int_ty *) Modified: llvm/trunk/test/Bindings/Ocaml/executionengine.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/executionengine.ml?rev=111623&r1=111622&r2=111623&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/executionengine.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/executionengine.ml Fri Aug 20 09:20:17 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa llvm_executionengine.cmxa %s -o %t - * RUN: ./%t %t.bc + * RUN: %t %t.bc *) open Llvm Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=111623&r1=111622&r2=111623&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Fri Aug 20 09:20:17 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_analysis.cmxa llvm_bitwriter.cmxa %s -o %t - * RUN: ./%t %t.bc + * RUN: %t %t.bc * RUN: llvm-dis < %t.bc > %t.ll *) From foldr at codedgers.com Fri Aug 20 09:46:16 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 14:46:16 +0000 (UTC) Subject: [llvm-commits] [llvm] r111621 - in /llvm/trunk/test/LLVMC: ForwardTransformedValue.td ForwardValue.td References: <20100820130333.62D842A6C12C@llvm.org> Message-ID: Benjamin Kramer writes: > > Author: d0k > Date: Fri Aug 20 08:03:33 2010 > New Revision: 111621 > > URL: http://llvm.org/viewvc/llvm-project?rev=111621&view=rev > Log: > Update LLVMC tests for r111620. Thanks! From idadesub at users.sourceforge.net Fri Aug 20 09:51:16 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 14:51:16 -0000 Subject: [llvm-commits] [llvm] r111624 - /llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Message-ID: <20100820145116.347722A6C12C@llvm.org> Author: erickt Date: Fri Aug 20 09:51:16 2010 New Revision: 111624 URL: http://llvm.org/viewvc/llvm-project?rev=111624&view=rev Log: Fix arguments to ocaml's llvm_params. Thanks to Jianzhou Zhao for finding this. Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=111624&r1=111623&r2=111624&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original) +++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Fri Aug 20 09:51:16 2010 @@ -964,8 +964,8 @@ return LLVMGetParam(Fn, Int_val(Index)); } -/* llvalue -> int -> llvalue */ -CAMLprim value llvm_params(LLVMValueRef Fn, value Index) { +/* llvalue -> llvalue */ +CAMLprim value llvm_params(LLVMValueRef Fn) { value Params = alloc(LLVMCountParams(Fn), 0); LLVMGetParams(Fn, (LLVMValueRef *) Op_val(Params)); return Params; From idadesub at users.sourceforge.net Fri Aug 20 09:51:22 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 14:51:22 -0000 Subject: [llvm-commits] [llvm] r111625 - in /llvm/trunk: bindings/ocaml/llvm/llvm.ml bindings/ocaml/llvm/llvm.mli bindings/ocaml/llvm/llvm_ocaml.c include/llvm-c/Core.h lib/VMCore/Core.cpp test/Bindings/Ocaml/vmcore.ml Message-ID: <20100820145122.BEDDF2A6C12D@llvm.org> Author: erickt Date: Fri Aug 20 09:51:22 2010 New Revision: 111625 URL: http://llvm.org/viewvc/llvm-project?rev=111625&view=rev Log: Expose LLVMSetOperand and LLVMGetNumOperands to llvm-c and ocaml. Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml llvm/trunk/bindings/ocaml/llvm/llvm.mli llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c llvm/trunk/include/llvm-c/Core.h llvm/trunk/lib/VMCore/Core.cpp llvm/trunk/test/Bindings/Ocaml/vmcore.ml Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=111625&r1=111624&r2=111625&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/llvm/llvm.ml (original) +++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Fri Aug 20 09:51:22 2010 @@ -280,6 +280,8 @@ (*--... Operations on users ................................................--*) external operand : llvalue -> int -> llvalue = "llvm_operand" +external set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand" +external num_operands : llvalue -> int = "llvm_num_operands" (*--... Operations on constants of (mostly) any type .......................--*) external is_constant : llvalue -> bool = "llvm_is_constant" Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=111625&r1=111624&r2=111625&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original) +++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Fri Aug 20 09:51:22 2010 @@ -557,6 +557,14 @@ method [llvm::User::getOperand]. *) external operand : llvalue -> int -> llvalue = "llvm_operand" +(** [set_operand v i o] sets the operand of the value [v] at the index [i] to + the value [o]. + See the method [llvm::User::setOperand]. *) +external set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand" + +(** [num_operands v] returns the number of operands for the value [v]. + See the method [llvm::User::getNumOperands]. *) +external num_operands : llvalue -> int = "llvm_num_operands" (** {7 Operations on constants of (mostly) any type} *) Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=111625&r1=111624&r2=111625&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original) +++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Fri Aug 20 09:51:22 2010 @@ -452,6 +452,17 @@ return LLVMGetOperand(V, Int_val(I)); } +/* llvalue -> int -> llvalue -> unit */ +CAMLprim value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) { + LLVMSetOperand(U, Int_val(I), V); + return Val_unit; +} + +/* llvalue -> int */ +CAMLprim value llvm_num_operands(LLVMValueRef V) { + return Val_int(LLVMGetNumOperands(V)); +} + /*--... Operations on constants of (mostly) any type .......................--*/ /* llvalue -> bool */ Modified: llvm/trunk/include/llvm-c/Core.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=111625&r1=111624&r2=111625&view=diff ============================================================================== --- llvm/trunk/include/llvm-c/Core.h (original) +++ llvm/trunk/include/llvm-c/Core.h Fri Aug 20 09:51:22 2010 @@ -523,6 +523,8 @@ /* Operations on Users */ LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index); +void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val); +int LLVMGetNumOperands(LLVMValueRef Val); /* Operations on constants of any type */ LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */ Modified: llvm/trunk/lib/VMCore/Core.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=111625&r1=111624&r2=111625&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Core.cpp (original) +++ llvm/trunk/lib/VMCore/Core.cpp Fri Aug 20 09:51:22 2010 @@ -489,6 +489,14 @@ return wrap(unwrap(Val)->getOperand(Index)); } +void LLVMSetOperand(LLVMValueRef Val, unsigned Index, LLVMValueRef Op) { + unwrap(Val)->setOperand(Index, unwrap(Op)); +} + +int LLVMGetNumOperands(LLVMValueRef Val) { + return unwrap(Val)->getNumOperands(); +} + /*--.. Operations on constants of any type .................................--*/ LLVMValueRef LLVMConstNull(LLVMTypeRef Ty) { Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=111625&r1=111624&r2=111625&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Fri Aug 20 09:51:22 2010 @@ -642,11 +642,18 @@ let p1 = param fn 0 in let p2 = param fn 1 in + let a3 = build_alloca i32_type "user_alloca" b in + let p3 = build_load a3 "user_load" b in let i = build_add p1 p2 "sum" b in + insist ((num_operands i) = 2); insist ((operand i 0) = p1); insist ((operand i 1) = p2); + set_operand i 1 p3; + insist ((operand i 1) != p2); + insist ((operand i 1) = p3); + ignore (build_unreachable b) From idadesub at users.sourceforge.net Fri Aug 20 09:51:27 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 14:51:27 -0000 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml Message-ID: <20100820145127.226CB2A6C12C@llvm.org> Author: erickt Date: Fri Aug 20 09:51:26 2010 New Revision: 111626 URL: http://llvm.org/viewvc/llvm-project?rev=111626&view=rev Log: Fix the running of ocaml tests. Modified: llvm/trunk/test/Bindings/Ocaml/analysis.ml llvm/trunk/test/Bindings/Ocaml/executionengine.ml llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml llvm/trunk/test/Bindings/Ocaml/target.ml llvm/trunk/test/Bindings/Ocaml/vmcore.ml Modified: llvm/trunk/test/Bindings/Ocaml/analysis.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/analysis.ml?rev=111626&r1=111625&r2=111626&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/analysis.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/analysis.ml Fri Aug 20 09:51:26 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_analysis.cmxa %s -o %t - * RUN: %t %t.bc + * RUN: %t *) open Llvm Modified: llvm/trunk/test/Bindings/Ocaml/executionengine.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/executionengine.ml?rev=111626&r1=111625&r2=111626&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/executionengine.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/executionengine.ml Fri Aug 20 09:51:26 2010 @@ -1,5 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa llvm_executionengine.cmxa %s -o %t - * RUN: %t %t.bc + * RUN: %t *) open Llvm Modified: llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml?rev=111626&r1=111625&r2=111626&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml Fri Aug 20 09:51:26 2010 @@ -1,4 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_scalar_opts.cmxa llvm_target.cmxa %s -o %t + * RUN: %t %t.bc *) (* Note: It takes several seconds for ocamlopt to link an executable with @@ -13,8 +14,11 @@ let void_type = Llvm.void_type context (* Tiny unit test framework - really just to help find which line is busted *) +let print_checkpoints = false + let suite name f = - prerr_endline (name ^ ":"); + if print_checkpoints then + prerr_endline (name ^ ":"); f () Modified: llvm/trunk/test/Bindings/Ocaml/target.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/target.ml?rev=111626&r1=111625&r2=111626&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/target.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/target.ml Fri Aug 20 09:51:26 2010 @@ -1,4 +1,5 @@ (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa %s -o %t + * RUN: %t %t.bc *) (* Note: It takes several seconds for ocamlopt to link an executable with @@ -8,13 +9,17 @@ open Llvm open Llvm_target + let context = global_context () let i32_type = Llvm.i32_type context let i64_type = Llvm.i64_type context (* Tiny unit test framework - really just to help find which line is busted *) +let print_checkpoints = false + let suite name f = - prerr_endline (name ^ ":"); + if print_checkpoints then + prerr_endline (name ^ ":"); f () Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=111626&r1=111625&r2=111626&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Fri Aug 20 09:51:26 2010 @@ -455,7 +455,7 @@ ignore (define_global "const_shufflevector" (const_shufflevector (const_vector [| zero; one |]) (const_vector [| one; zero |]) - (const_bitcast foldbomb (vector_type i32_type 2))) m); + (const_vector [| const_int i32_type 1; const_int i32_type 2 |])) m); group "asm"; begin let ft = function_type void_type [| i32_type; i32_type; i32_type |] in @@ -1236,13 +1236,19 @@ group "dbg"; begin (* RUN: grep {%dbg = add i32 %P1, %P2, !dbg !1} < %t.ll - * RUN: grep {!1 = metadata !\{i32 2, metadata !"dbg test"\}} < %t.ll + * RUN: grep {!1 = metadata !\{i32 2, i32 3, metadata !2, metadata !2\}} < %t.ll *) - let m1 = const_int i32_type 2 in - let m2 = mdstring context "dbg test" in - let md = mdnode context [| m1; m2 |] in + insist ((current_debug_location atentry) = None); + + let m_line = const_int i32_type 2 in + let m_col = const_int i32_type 3 in + let m_scope = mdnode context [| |] in + let m_inlined = mdnode context [| |] in + let md = mdnode context [| m_line; m_col; m_scope; m_inlined |] in set_current_debug_location atentry md; + insist ((current_debug_location atentry) = Some md); + let i = build_add p1 p2 "dbg" atentry in insist ((has_metadata i) = true); From bob.wilson at apple.com Fri Aug 20 09:54:37 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 14:54:37 -0000 Subject: [llvm-commits] [llvm] r111627 - /llvm/trunk/bindings/ocaml/llvm/llvm.mli Message-ID: <20100820145438.0579B2A6C12C@llvm.org> Author: bwilson Date: Fri Aug 20 09:54:37 2010 New Revision: 111627 URL: http://llvm.org/viewvc/llvm-project?rev=111627&view=rev Log: Fix a typo. Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=111627&r1=111626&r2=111627&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original) +++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Fri Aug 20 09:54:37 2010 @@ -999,7 +999,7 @@ = "LLVMConstInsertElement" (** [const_shufflevector a b mask] returns a constant [shufflevector]. - See the LLVM Language Reference for details on the [sufflevector] + See the LLVM Language Reference for details on the [shufflevector] instruction. See the method [llvm::ConstantExpr::getShuffleVector]. *) external const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue From bob.wilson at apple.com Fri Aug 20 09:57:33 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 07:57:33 -0700 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml In-Reply-To: <20100820145127.226CB2A6C12C@llvm.org> References: <20100820145127.226CB2A6C12C@llvm.org> Message-ID: Thanks! On Aug 20, 2010, at 7:51 AM, Erick Tryzelaar wrote: > Author: erickt > Date: Fri Aug 20 09:51:26 2010 > New Revision: 111626 > > URL: http://llvm.org/viewvc/llvm-project?rev=111626&view=rev > Log: > Fix the running of ocaml tests. > > Modified: > llvm/trunk/test/Bindings/Ocaml/analysis.ml > llvm/trunk/test/Bindings/Ocaml/executionengine.ml > llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml > llvm/trunk/test/Bindings/Ocaml/target.ml > llvm/trunk/test/Bindings/Ocaml/vmcore.ml > > Modified: llvm/trunk/test/Bindings/Ocaml/analysis.ml > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/analysis.ml?rev=111626&r1=111625&r2=111626&view=diff > ============================================================================== > --- llvm/trunk/test/Bindings/Ocaml/analysis.ml (original) > +++ llvm/trunk/test/Bindings/Ocaml/analysis.ml Fri Aug 20 09:51:26 2010 > @@ -1,5 +1,5 @@ > (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_analysis.cmxa %s -o %t > - * RUN: %t %t.bc > + * RUN: %t > *) > > open Llvm > > Modified: llvm/trunk/test/Bindings/Ocaml/executionengine.ml > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/executionengine.ml?rev=111626&r1=111625&r2=111626&view=diff > ============================================================================== > --- llvm/trunk/test/Bindings/Ocaml/executionengine.ml (original) > +++ llvm/trunk/test/Bindings/Ocaml/executionengine.ml Fri Aug 20 09:51:26 2010 > @@ -1,5 +1,5 @@ > (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa llvm_executionengine.cmxa %s -o %t > - * RUN: %t %t.bc > + * RUN: %t > *) > > open Llvm > > Modified: llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml?rev=111626&r1=111625&r2=111626&view=diff > ============================================================================== > --- llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml (original) > +++ llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml Fri Aug 20 09:51:26 2010 > @@ -1,4 +1,5 @@ > (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_scalar_opts.cmxa llvm_target.cmxa %s -o %t > + * RUN: %t %t.bc > *) > > (* Note: It takes several seconds for ocamlopt to link an executable with > @@ -13,8 +14,11 @@ > let void_type = Llvm.void_type context > > (* Tiny unit test framework - really just to help find which line is busted *) > +let print_checkpoints = false > + > let suite name f = > - prerr_endline (name ^ ":"); > + if print_checkpoints then > + prerr_endline (name ^ ":"); > f () > > > > Modified: llvm/trunk/test/Bindings/Ocaml/target.ml > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/target.ml?rev=111626&r1=111625&r2=111626&view=diff > ============================================================================== > --- llvm/trunk/test/Bindings/Ocaml/target.ml (original) > +++ llvm/trunk/test/Bindings/Ocaml/target.ml Fri Aug 20 09:51:26 2010 > @@ -1,4 +1,5 @@ > (* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa %s -o %t > + * RUN: %t %t.bc > *) > > (* Note: It takes several seconds for ocamlopt to link an executable with > @@ -8,13 +9,17 @@ > open Llvm > open Llvm_target > > + > let context = global_context () > let i32_type = Llvm.i32_type context > let i64_type = Llvm.i64_type context > > (* Tiny unit test framework - really just to help find which line is busted *) > +let print_checkpoints = false > + > let suite name f = > - prerr_endline (name ^ ":"); > + if print_checkpoints then > + prerr_endline (name ^ ":"); > f () > > > > Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=111626&r1=111625&r2=111626&view=diff > ============================================================================== > --- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original) > +++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Fri Aug 20 09:51:26 2010 > @@ -455,7 +455,7 @@ > ignore (define_global "const_shufflevector" (const_shufflevector > (const_vector [| zero; one |]) > (const_vector [| one; zero |]) > - (const_bitcast foldbomb (vector_type i32_type 2))) m); > + (const_vector [| const_int i32_type 1; const_int i32_type 2 |])) m); > > group "asm"; begin > let ft = function_type void_type [| i32_type; i32_type; i32_type |] in > @@ -1236,13 +1236,19 @@ > > group "dbg"; begin > (* RUN: grep {%dbg = add i32 %P1, %P2, !dbg !1} < %t.ll > - * RUN: grep {!1 = metadata !\{i32 2, metadata !"dbg test"\}} < %t.ll > + * RUN: grep {!1 = metadata !\{i32 2, i32 3, metadata !2, metadata !2\}} < %t.ll > *) > - let m1 = const_int i32_type 2 in > - let m2 = mdstring context "dbg test" in > - let md = mdnode context [| m1; m2 |] in > + insist ((current_debug_location atentry) = None); > + > + let m_line = const_int i32_type 2 in > + let m_col = const_int i32_type 3 in > + let m_scope = mdnode context [| |] in > + let m_inlined = mdnode context [| |] in > + let md = mdnode context [| m_line; m_col; m_scope; m_inlined |] in > set_current_debug_location atentry md; > > + insist ((current_debug_location atentry) = Some md); > + > let i = build_add p1 p2 "dbg" atentry in > insist ((has_metadata i) = true); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From idadesub at users.sourceforge.net Fri Aug 20 11:03:12 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 09:03:12 -0700 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml In-Reply-To: References: <20100820145127.226CB2A6C12C@llvm.org> Message-ID: On Friday, August 20, 2010, Bob Wilson wrote: > Thanks! No problem! I had most of the patch done yesterday but work expected me to work for some reason :) From bob.wilson at apple.com Fri Aug 20 11:17:58 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 09:17:58 -0700 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml In-Reply-To: References: <20100820145127.226CB2A6C12C@llvm.org> Message-ID: On Aug 20, 2010, at 9:03 AM, Erick Tryzelaar wrote: > On Friday, August 20, 2010, Bob Wilson wrote: >> Thanks! > > No problem! I had most of the patch done yesterday but work expected > me to work for some reason :) The vmcore test is still failing. Can you investigate? From gohman at apple.com Fri Aug 20 11:27:38 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:27:38 -0000 Subject: [llvm-commits] [llvm] r111638 - /llvm/trunk/include/llvm/Support/FormattedStream.h Message-ID: <20100820162738.E25862A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:27:38 2010 New Revision: 111638 URL: http://llvm.org/viewvc/llvm-project?rev=111638&view=rev Log: Export error-handling functions in formatted_tool_output_file. Modified: llvm/trunk/include/llvm/Support/FormattedStream.h Modified: llvm/trunk/include/llvm/Support/FormattedStream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormattedStream.h?rev=111638&r1=111637&r2=111638&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/FormattedStream.h (original) +++ llvm/trunk/include/llvm/Support/FormattedStream.h Fri Aug 20 11:27:38 2010 @@ -142,8 +142,13 @@ /// formatted_tool_output_file - This is a subclass of formatted_raw_ostream /// for use when the underlying stream is a tool_output_file. It exposes - /// the keep() member function. + /// keep() and several other member functions. class formatted_tool_output_file : public formatted_raw_ostream { + private: + tool_output_file &get_tool_output_file() const { + return *static_cast(TheStream); + } + public: formatted_tool_output_file(tool_output_file &Stream, bool Delete = false) : formatted_raw_ostream(Stream, Delete) {} @@ -156,7 +161,10 @@ return formatted_raw_ostream::setStream(Stream, Delete); } - void keep() { return static_cast(TheStream)->keep(); } + void keep() { return get_tool_output_file().keep(); } + bool has_error() const { return get_tool_output_file().has_error(); } + void clear_error() { return get_tool_output_file().clear_error(); } + void close() { return get_tool_output_file().close(); } }; /// fouts() - This returns a reference to a formatted_raw_ostream for From idadesub at users.sourceforge.net Fri Aug 20 11:31:18 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 09:31:18 -0700 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml In-Reply-To: References: <20100820145127.226CB2A6C12C@llvm.org> Message-ID: On Fri, Aug 20, 2010 at 9:17 AM, Bob Wilson wrote: > > The vmcore test is still failing. ?Can you investigate? > Oh drat, I'll investigate. I'm erickt on #llvm as well if there are more problems. From gohman at apple.com Fri Aug 20 11:34:20 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:34:20 -0000 Subject: [llvm-commits] [llvm] r111639 - in /llvm/trunk: include/llvm/Support/raw_ostream.h lib/Support/raw_ostream.cpp Message-ID: <20100820163420.2FBDF2A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:34:20 2010 New Revision: 111639 URL: http://llvm.org/viewvc/llvm-project?rev=111639&view=rev Log: Move raw_ostream's Error flag into raw_fd_ostream, as that's the only class which is using it. Modified: llvm/trunk/include/llvm/Support/raw_ostream.h llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111639&r1=111638&r2=111639&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Fri Aug 20 11:34:20 2010 @@ -58,10 +58,6 @@ ExternalBuffer } BufferMode; - /// Error This flag is true if an error of any kind has been detected. - /// - bool Error; - public: // color order matches ANSI escape sequence, don't change enum Colors { @@ -77,7 +73,7 @@ }; explicit raw_ostream(bool unbuffered=false) - : BufferMode(unbuffered ? Unbuffered : InternalBuffer), Error(false) { + : BufferMode(unbuffered ? Unbuffered : InternalBuffer) { // Start out ready to flush. OutBufStart = OutBufEnd = OutBufCur = 0; } @@ -87,21 +83,6 @@ /// tell - Return the current offset with the file. uint64_t tell() const { return current_pos() + GetNumBytesInBuffer(); } - /// has_error - Return the value of the flag in this raw_ostream indicating - /// whether an output error has been encountered. - /// This doesn't implicitly flush any pending output. - bool has_error() const { - return Error; - } - - /// clear_error - Set the flag read by has_error() to false. If the error - /// flag is set at the time when this raw_ostream's destructor is called, - /// report_fatal_error is called to report the error. Use clear_error() - /// after handling the error to avoid this behavior. - void clear_error() { - Error = false; - } - //===--------------------------------------------------------------------===// // Configuration Interface //===--------------------------------------------------------------------===// @@ -285,10 +266,6 @@ /// underlying output mechanism. virtual size_t preferred_buffer_size() const; - /// error_detected - Set the flag indicating that an output error has - /// been encountered. - void error_detected() { Error = true; } - /// getBufferStart - Return the beginning of the current stream buffer, or 0 /// if the stream is unbuffered. const char *getBufferStart() const { return OutBufStart; } @@ -319,6 +296,11 @@ class raw_fd_ostream : public raw_ostream { int FD; bool ShouldClose; + + /// Error This flag is true if an error of any kind has been detected. + /// + bool Error; + uint64_t pos; /// write_impl - See raw_ostream::write_impl. @@ -331,6 +313,10 @@ /// preferred_buffer_size - Determine an efficient buffer size. virtual size_t preferred_buffer_size() const; + /// error_detected - Set the flag indicating that an output error has + /// been encountered. + void error_detected() { Error = true; } + public: enum { @@ -365,7 +351,8 @@ /// ShouldClose is true, this closes the file when the stream is destroyed. raw_fd_ostream(int fd, bool shouldClose, bool unbuffered=false) : raw_ostream(unbuffered), FD(fd), - ShouldClose(shouldClose) {} + ShouldClose(shouldClose), + Error(false) {} ~raw_fd_ostream(); @@ -382,6 +369,21 @@ virtual raw_ostream &resetColor(); virtual bool is_displayed() const; + + /// has_error - Return the value of the flag in this raw_fd_ostream indicating + /// whether an output error has been encountered. + /// This doesn't implicitly flush any pending output. + bool has_error() const { + return Error; + } + + /// clear_error - Set the flag read by has_error() to false. If the error + /// flag is set at the time when this raw_ostream's destructor is called, + /// report_fatal_error is called to report the error. Use clear_error() + /// after handling the error to avoid this behavior. + void clear_error() { + Error = false; + } }; /// raw_stdout_ostream - This is a stream that always prints to stdout. Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111639&r1=111638&r2=111639&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Fri Aug 20 11:34:20 2010 @@ -57,13 +57,6 @@ if (BufferMode == InternalBuffer) delete [] OutBufStart; - - // If there are any pending errors, report them now. Clients wishing - // to avoid report_fatal_error calls should check for errors with - // has_error() and clear the error flag with clear_error() before - // destructing raw_ostream objects which may have errors. - if (Error) - report_fatal_error("IO failure on output stream."); } // An out of line virtual method to provide a home for the class vtable. @@ -370,7 +363,7 @@ /// stream should be immediately destroyed; the string will be empty /// if no error occurred. raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo, - unsigned Flags) : pos(0) { + unsigned Flags) : Error(false), pos(0) { assert(Filename != 0 && "Filename is null"); // Verify that we don't have both "append" and "excl". assert((!(Flags & F_Excl) || !(Flags & F_Append)) && @@ -418,14 +411,22 @@ } raw_fd_ostream::~raw_fd_ostream() { - if (FD < 0) return; - flush(); - if (ShouldClose) - while (::close(FD) != 0) - if (errno != EINTR) { - error_detected(); - break; - } + if (FD >= 0) { + flush(); + if (ShouldClose) + while (::close(FD) != 0) + if (errno != EINTR) { + error_detected(); + break; + } + } + + // If there are any pending errors, report them now. Clients wishing + // to avoid report_fatal_error calls should check for errors with + // has_error() and clear the error flag with clear_error() before + // destructing raw_ostream objects which may have errors. + if (has_error()) + report_fatal_error("IO failure on output stream."); } From gohman at apple.com Fri Aug 20 11:35:30 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:35:30 -0000 Subject: [llvm-commits] [llvm] r111640 - /llvm/trunk/include/llvm/Support/raw_ostream.h Message-ID: <20100820163530.5C9532A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:35:30 2010 New Revision: 111640 URL: http://llvm.org/viewvc/llvm-project?rev=111640&view=rev Log: Add a comment. Modified: llvm/trunk/include/llvm/Support/raw_ostream.h Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111640&r1=111639&r2=111640&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Fri Aug 20 11:35:30 2010 @@ -372,7 +372,8 @@ /// has_error - Return the value of the flag in this raw_fd_ostream indicating /// whether an output error has been encountered. - /// This doesn't implicitly flush any pending output. + /// This doesn't implicitly flush any pending output. Also, it doesn't + /// guarantee to detect all errors unless the the stream has been closed. bool has_error() const { return Error; } From gohman at apple.com Fri Aug 20 11:36:19 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:36:19 -0000 Subject: [llvm-commits] [llvm] r111641 - /llvm/trunk/include/llvm/Support/raw_ostream.h Message-ID: <20100820163619.9A1C22A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:36:19 2010 New Revision: 111641 URL: http://llvm.org/viewvc/llvm-project?rev=111641&view=rev Log: Add an inspirational quote. Modified: llvm/trunk/include/llvm/Support/raw_ostream.h Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111641&r1=111640&r2=111641&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Fri Aug 20 11:36:19 2010 @@ -382,6 +382,11 @@ /// flag is set at the time when this raw_ostream's destructor is called, /// report_fatal_error is called to report the error. Use clear_error() /// after handling the error to avoid this behavior. + /// + /// "Errors should never pass silently. + /// Unless explicitly silenced." + /// - from The Zen of Python, by Tim Peters + /// void clear_error() { Error = false; } From gohman at apple.com Fri Aug 20 11:39:41 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:39:41 -0000 Subject: [llvm-commits] [llvm] r111642 - in /llvm/trunk: include/llvm/Support/raw_ostream.h lib/Support/raw_ostream.cpp Message-ID: <20100820163941.98ABC2A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:39:41 2010 New Revision: 111642 URL: http://llvm.org/viewvc/llvm-project?rev=111642&view=rev Log: Delete raw_stdout_ostream and raw_stderr_ostream, which are unused outside of outs() and errs() themselves, and they don't really need custom classes. Modified: llvm/trunk/include/llvm/Support/raw_ostream.h llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111642&r1=111641&r2=111642&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Fri Aug 20 11:39:41 2010 @@ -392,24 +392,6 @@ } }; -/// raw_stdout_ostream - This is a stream that always prints to stdout. -/// -class raw_stdout_ostream : public raw_fd_ostream { - // An out of line virtual method to provide a home for the class vtable. - virtual void handle(); -public: - raw_stdout_ostream(); -}; - -/// raw_stderr_ostream - This is a stream that always prints to stderr. -/// -class raw_stderr_ostream : public raw_fd_ostream { - // An out of line virtual method to provide a home for the class vtable. - virtual void handle(); -public: - raw_stderr_ostream(); -}; - /// outs() - This returns a reference to a raw_ostream for standard output. /// Use it like: outs() << "foo" << "bar"; raw_ostream &outs(); Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111642&r1=111641&r2=111642&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Fri Aug 20 11:39:41 2010 @@ -543,27 +543,19 @@ // raw_stdout/err_ostream //===----------------------------------------------------------------------===// -// Set buffer settings to model stdout and stderr behavior. -// Set standard error to be unbuffered by default. -raw_stdout_ostream::raw_stdout_ostream():raw_fd_ostream(STDOUT_FILENO, false) {} -raw_stderr_ostream::raw_stderr_ostream():raw_fd_ostream(STDERR_FILENO, false, - true) {} - -// An out of line virtual method to provide a home for the class vtable. -void raw_stdout_ostream::handle() {} -void raw_stderr_ostream::handle() {} - /// outs() - This returns a reference to a raw_ostream for standard output. /// Use it like: outs() << "foo" << "bar"; raw_ostream &llvm::outs() { - static raw_stdout_ostream S; + // Set buffer settings to model stdout behavior. + static raw_fd_ostream S(STDOUT_FILENO, false); return S; } /// errs() - This returns a reference to a raw_ostream for standard error. /// Use it like: errs() << "foo" << "bar"; raw_ostream &llvm::errs() { - static raw_stderr_ostream S; + // Set standard error to be unbuffered by default. + static raw_fd_ostream S(STDERR_FILENO, false, true); return S; } From gohman at apple.com Fri Aug 20 11:44:56 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:44:56 -0000 Subject: [llvm-commits] [llvm] r111643 - /llvm/trunk/lib/Support/raw_ostream.cpp Message-ID: <20100820164456.60A772A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:44:56 2010 New Revision: 111643 URL: http://llvm.org/viewvc/llvm-project?rev=111643&view=rev Log: Make outs() close its file when its stream is destructed, so that pending output errors are detected. Modified: llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111643&r1=111642&r2=111643&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Fri Aug 20 11:44:56 2010 @@ -540,14 +540,16 @@ } //===----------------------------------------------------------------------===// -// raw_stdout/err_ostream +// outs(), errs(), nulls() //===----------------------------------------------------------------------===// /// outs() - This returns a reference to a raw_ostream for standard output. /// Use it like: outs() << "foo" << "bar"; raw_ostream &llvm::outs() { // Set buffer settings to model stdout behavior. - static raw_fd_ostream S(STDOUT_FILENO, false); + // Delete the file descriptor when the program exists, forcing error + // detection. If you don't want this behavior, don't use outs(). + static raw_fd_ostream S(STDOUT_FILENO, true); return S; } From gohman at apple.com Fri Aug 20 11:45:59 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:45:59 -0000 Subject: [llvm-commits] [llvm] r111644 - /llvm/trunk/utils/TableGen/TableGen.cpp Message-ID: <20100820164559.1FA3B2A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:45:58 2010 New Revision: 111644 URL: http://llvm.org/viewvc/llvm-project?rev=111644&view=rev Log: Convert tablegen to use tool_output_file. Modified: llvm/trunk/utils/TableGen/TableGen.cpp Modified: llvm/trunk/utils/TableGen/TableGen.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=111644&r1=111643&r2=111644&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TableGen.cpp (original) +++ llvm/trunk/utils/TableGen/TableGen.cpp Fri Aug 20 11:45:58 2010 @@ -216,16 +216,13 @@ return 1; std::string Error; - raw_fd_ostream Out(OutputFilename.c_str(), Error); + tool_output_file Out(OutputFilename.c_str(), Error); if (!Error.empty()) { errs() << argv[0] << ": error opening " << OutputFilename << ":" << Error << "\n"; return 1; } - // Make sure the file gets removed if *gasp* tablegen crashes... - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - try { switch (Action) { case PrintRecords: @@ -339,6 +336,8 @@ return 1; } + // Declare success. + Out.keep(); return 0; } catch (const TGError &Error) { @@ -353,7 +352,5 @@ errs() << argv[0] << ": Unknown unexpected exception occurred.\n"; } - if (OutputFilename != "-") - std::remove(OutputFilename.c_str()); // Remove the file, it's broken return 1; } From grosbach at apple.com Fri Aug 20 11:48:30 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 20 Aug 2010 16:48:30 -0000 Subject: [llvm-commits] [llvm] r111646 - /llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Message-ID: <20100820164830.A7D0D2A6C12C@llvm.org> Author: grosbach Date: Fri Aug 20 11:48:30 2010 New Revision: 111646 URL: http://llvm.org/viewvc/llvm-project?rev=111646&view=rev Log: properly check for whether base regs were inserted Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111646&r1=111645&r2=111646&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Fri Aug 20 11:48:30 2010 @@ -48,7 +48,7 @@ void AdjustStackOffset(MachineFrameInfo *MFI, int FrameIdx, int64_t &Offset, unsigned &MaxAlign); void calculateFrameObjectOffsets(MachineFunction &Fn); - void insertFrameReferenceRegisters(MachineFunction &Fn); + bool insertFrameReferenceRegisters(MachineFunction &Fn); public: static char ID; // Pass identification, replacement for typeid explicit LocalStackSlotPass() : MachineFunctionPass(ID) { } @@ -87,14 +87,14 @@ calculateFrameObjectOffsets(MF); // Insert virtual base registers to resolve frame index references. - insertFrameReferenceRegisters(MF); + bool UsedBaseRegs = insertFrameReferenceRegisters(MF); // Tell MFI whether any base registers were allocated. PEI will only // want to use the local block allocations from this pass if there were any. // Otherwise, PEI can do a bit better job of getting the alignment right // without a hole at the start since it knows the alignment of the stack // at the start of local allocation, and this pass doesn't. - MFI->setUseLocalStackAllocationBlock(NumBaseRegisters > 0); + MFI->setUseLocalStackAllocationBlock(UsedBaseRegs); return true; } @@ -188,13 +188,14 @@ return false; } -void LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) { +bool LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) { // Scan the function's instructions looking for frame index references. // For each, ask the target if it wants a virtual base register for it // based on what we can tell it about where the local will end up in the // stack frame. If it wants one, re-use a suitable one we've previously // allocated, or if there isn't one that fits the bill, allocate a new one // and ask the target to create a defining instruction for it. + bool UsedBaseReg = false; MachineFrameInfo *MFI = Fn.getFrameInfo(); const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); @@ -274,6 +275,7 @@ std::pair(BaseReg, LocalOffsets[FrameIdx] + InstrOffset)); ++NumBaseRegisters; + UsedBaseReg = true; } assert(BaseReg != 0 && "Unable to allocate virtual base register!"); @@ -288,4 +290,5 @@ } } } + return UsedBaseReg; } From criswell at uiuc.edu Fri Aug 20 11:50:25 2010 From: criswell at uiuc.edu (John Criswell) Date: Fri, 20 Aug 2010 16:50:25 -0000 Subject: [llvm-commits] [poolalloc] r111647 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Message-ID: <20100820165025.719C22A6C12C@llvm.org> Author: criswell Date: Fri Aug 20 11:50:25 2010 New Revision: 111647 URL: http://llvm.org/viewvc/llvm-project?rev=111647&view=rev Log: Added comment. Standardized formatting of if statement. No functionality changes. Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=111647&r1=111646&r2=111647&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Fri Aug 20 11:50:25 2010 @@ -712,8 +712,14 @@ eraseCS = std::includes(CalledFuncs.begin(), CalledFuncs.end(), NodeCallees.begin(), NodeCallees.end()); } - if (eraseCS) ++NumIndResolved; - else ++NumIndUnresolved; + + // + // Update the statistics on resolved indirect function calls. + // + if (eraseCS) + ++NumIndResolved; + else + ++NumIndUnresolved; } DSGraph *GI; From gohman at apple.com Fri Aug 20 11:54:27 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:54:27 -0000 Subject: [llvm-commits] [llvm] r111648 - /llvm/trunk/utils/FileUpdate/FileUpdate.cpp Message-ID: <20100820165427.98B842A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:54:27 2010 New Revision: 111648 URL: http://llvm.org/viewvc/llvm-project?rev=111648&view=rev Log: Convert FileUpdate to use tool_output_file, and to use errs() instead of outs() for its verbose messages. Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileUpdate/FileUpdate.cpp?rev=111648&r1=111647&r2=111648&view=diff ============================================================================== --- llvm/trunk/utils/FileUpdate/FileUpdate.cpp (original) +++ llvm/trunk/utils/FileUpdate/FileUpdate.cpp Fri Aug 20 11:54:27 2010 @@ -54,7 +54,7 @@ memcmp(In->getBufferStart(), Out->getBufferStart(), Out->getBufferSize()) == 0) { if (!Quiet) - outs() << argv[0] << ": Not updating '" << OutputFilename + errs() << argv[0] << ": Not updating '" << OutputFilename << "', contents match input.\n"; return 0; } @@ -63,10 +63,10 @@ // Otherwise, overwrite the output. if (!Quiet) - outs() << argv[0] << ": Updating '" << OutputFilename + errs() << argv[0] << ": Updating '" << OutputFilename << "', contents changed.\n"; - raw_fd_ostream OutStream(OutputFilename.c_str(), ErrorStr, - raw_fd_ostream::F_Binary); + tool_output_file OutStream(OutputFilename.c_str(), ErrorStr, + raw_fd_ostream::F_Binary); if (!ErrorStr.empty()) { errs() << argv[0] << ": Unable to write output '" << OutputFilename << "': " << ErrorStr << '\n'; @@ -74,14 +74,9 @@ } OutStream.write(In->getBufferStart(), In->getBufferSize()); - OutStream.close(); - if (OutStream.has_error()) { - errs() << argv[0] << ": Could not open output file '" - << OutputFilename << "': " << ErrorStr << '\n'; - OutStream.clear_error(); - return 1; - } + // Declare success. + OutStream.keep(); return 0; } From gohman at apple.com Fri Aug 20 11:56:11 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:56:11 -0000 Subject: [llvm-commits] [llvm] r111649 - /llvm/trunk/utils/FileUpdate/FileUpdate.cpp Message-ID: <20100820165611.478FF2A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:56:11 2010 New Revision: 111649 URL: http://llvm.org/viewvc/llvm-project?rev=111649&view=rev Log: Diagnose attempts to update standard output. Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileUpdate/FileUpdate.cpp?rev=111649&r1=111648&r2=111649&view=diff ============================================================================== --- llvm/trunk/utils/FileUpdate/FileUpdate.cpp (original) +++ llvm/trunk/utils/FileUpdate/FileUpdate.cpp Fri Aug 20 11:56:11 2010 @@ -36,6 +36,11 @@ PrettyStackTraceProgram X(argc, argv); cl::ParseCommandLineOptions(argc, argv); + if (OutputFilename == "-") { + errs() << argv[0] << ": error: Can't update standard output\n"; + return 1; + } + // Get the input data. std::string ErrorStr; MemoryBuffer *In = From gohman at apple.com Fri Aug 20 11:59:15 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 16:59:15 -0000 Subject: [llvm-commits] [llvm] r111651 - in /llvm/trunk/tools: bugpoint/ExtractFunction.cpp bugpoint/OptimizerDriver.cpp gold/gold-plugin.cpp llvm-ld/llvm-ld.cpp lto/LTOCodeGenerator.cpp opt/GraphPrinters.cpp Message-ID: <20100820165915.4C05D2A6C12C@llvm.org> Author: djg Date: Fri Aug 20 11:59:15 2010 New Revision: 111651 URL: http://llvm.org/viewvc/llvm-project?rev=111651&view=rev Log: Convert tools to use tool_output_file, and introduce error checking to places which previously lacked it. Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/OptimizerDriver.cpp llvm/trunk/tools/gold/gold-plugin.cpp llvm/trunk/tools/llvm-ld/llvm-ld.cpp llvm/trunk/tools/lto/LTOCodeGenerator.cpp llvm/trunk/tools/opt/GraphPrinters.cpp Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=111651&r1=111650&r2=111651&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Fri Aug 20 11:59:15 2010 @@ -325,7 +325,7 @@ sys::RemoveFileOnSignal(uniqueFilename); std::string ErrorInfo; - raw_fd_ostream BlocksToNotExtractFile(uniqueFilename.c_str(), ErrorInfo); + tool_output_file BlocksToNotExtractFile(uniqueFilename.c_str(), ErrorInfo); if (!ErrorInfo.empty()) { outs() << "*** Basic Block extraction failed!\n"; errs() << "Error writing list of blocks to not extract: " << ErrorInfo @@ -343,6 +343,14 @@ << BB->getName() << "\n"; } BlocksToNotExtractFile.close(); + if (BlocksToNotExtractFile.has_error()) { + errs() << "Error writing list of blocks to not extract: " << ErrorInfo + << "\n"; + EmitProgressBitcode(M, "basicblockextractfail", true); + BlocksToNotExtractFile.clear_error(); + return 0; + } + BlocksToNotExtractFile.keep(); std::string uniqueFN = "--extract-blocks-file=" + uniqueFilename.str(); const char *ExtraArg = uniqueFN.c_str(); Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=111651&r1=111650&r2=111651&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Fri Aug 20 11:59:15 2010 @@ -54,12 +54,18 @@ bool BugDriver::writeProgramToFile(const std::string &Filename, const Module *M) const { std::string ErrInfo; - raw_fd_ostream Out(Filename.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); - if (!ErrInfo.empty()) return true; - - WriteBitcodeToFile(M, Out); - return false; + tool_output_file Out(Filename.c_str(), ErrInfo, + raw_fd_ostream::F_Binary); + if (ErrInfo.empty()) { + WriteBitcodeToFile(M, Out); + Out.close(); + if (!Out.has_error()) { + Out.keep(); + return false; + } + } + Out.clear_error(); + return true; } @@ -125,8 +131,8 @@ } std::string ErrInfo; - raw_fd_ostream InFile(inputFilename.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); + tool_output_file InFile(inputFilename.c_str(), ErrInfo, + raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) { @@ -135,6 +141,12 @@ } WriteBitcodeToFile(Program, InFile); InFile.close(); + if (InFile.has_error()) { + errs() << "Error writing bitcode file: " << inputFilename.str() << "\n"; + InFile.clear_error(); + return 1; + } + InFile.keep(); // setup the child process' arguments SmallVector Args; Modified: llvm/trunk/tools/gold/gold-plugin.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=111651&r1=111650&r2=111651&view=diff ============================================================================== --- llvm/trunk/tools/gold/gold-plugin.cpp (original) +++ llvm/trunk/tools/gold/gold-plugin.cpp Fri Aug 20 11:59:15 2010 @@ -453,8 +453,8 @@ (*message)(LDPL_ERROR, "%s", ErrMsg.c_str()); return LDPS_ERR; } - raw_fd_ostream objFile(uniqueObjPath.c_str(), ErrMsg, - raw_fd_ostream::F_Binary); + tool_output_file objFile(uniqueObjPath.c_str(), ErrMsg, + raw_fd_ostream::F_Binary); if (!ErrMsg.empty()) { (*message)(LDPL_ERROR, "%s", ErrMsg.c_str()); return LDPS_ERR; @@ -462,6 +462,13 @@ objFile.write(buffer, bufsize); objFile.close(); + if (objFile.has_error()) { + (*message)(LDPL_ERROR, "Error writing output file '%s'", + uniqueObjPath.c_str()); + objFile.clear_error(); + return LDPS_ERR; + } + objFile.keep(); lto_codegen_dispose(cg); Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=111651&r1=111650&r2=111651&view=diff ============================================================================== --- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original) +++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Fri Aug 20 11:59:15 2010 @@ -236,13 +236,16 @@ // Create the output file. std::string ErrorInfo; - raw_fd_ostream Out(FileName.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary); - if (!ErrorInfo.empty()) + tool_output_file Out(FileName.c_str(), ErrorInfo, + raw_fd_ostream::F_Binary); + if (!ErrorInfo.empty()) { PrintAndExit(ErrorInfo, M); + return; + } // Write it out WriteBitcodeToFile(M, Out); + Out.keep(); } /// GenerateAssembly - generates a native assembly language source file from the @@ -425,7 +428,7 @@ // Output the script to start the program... std::string ErrorInfo; - raw_fd_ostream Out2(OutputFilename.c_str(), ErrorInfo); + tool_output_file Out2(OutputFilename.c_str(), ErrorInfo); if (!ErrorInfo.empty()) PrintAndExit(ErrorInfo, M); @@ -466,6 +469,7 @@ Out2 << " -load=" << FullLibraryPath.str() << " \\\n"; } Out2 << " " << BitcodeOutputFilename << " ${1+\"$@\"}\n"; + Out2.keep(); } // BuildLinkItems -- This function generates a LinkItemList for the LinkItems Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=111651&r1=111650&r2=111651&view=diff ============================================================================== --- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original) +++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Fri Aug 20 11:59:15 2010 @@ -155,8 +155,8 @@ // create output file std::string ErrInfo; - raw_fd_ostream Out(path, ErrInfo, - raw_fd_ostream::F_Binary); + tool_output_file Out(path, ErrInfo, + raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) { errMsg = "could not open bitcode file for writing: "; errMsg += path; @@ -174,6 +174,7 @@ return true; } + Out.keep(); return false; } @@ -189,11 +190,17 @@ // generate assembly code bool genResult = false; { - raw_fd_ostream asmFD(uniqueAsmPath.c_str(), errMsg); - formatted_raw_ostream asmFile(asmFD); + tool_output_file asmFD(uniqueAsmPath.c_str(), errMsg); + formatted_tool_output_file asmFile(asmFD); if (!errMsg.empty()) return NULL; genResult = this->generateAssemblyCode(asmFile, errMsg); + asmFile.close(); + if (asmFile.has_error()) { + asmFile.clear_error(); + return NULL; + } + asmFile.keep(); } if ( genResult ) { uniqueAsmPath.eraseFromDisk(); Modified: llvm/trunk/tools/opt/GraphPrinters.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=111651&r1=111650&r2=111651&view=diff ============================================================================== --- llvm/trunk/tools/opt/GraphPrinters.cpp (original) +++ llvm/trunk/tools/opt/GraphPrinters.cpp Fri Aug 20 11:59:15 2010 @@ -28,13 +28,19 @@ std::string Filename = GraphName + ".dot"; O << "Writing '" << Filename << "'..."; std::string ErrInfo; - raw_fd_ostream F(Filename.c_str(), ErrInfo); + tool_output_file F(Filename.c_str(), ErrInfo); - if (ErrInfo.empty()) + if (ErrInfo.empty()) { WriteGraph(F, GT); - else - O << " error opening file for writing!"; - O << "\n"; + F.close(); + if (!F.has_error()) { + O << "\n"; + F.keep(); + return; + } + } + F.clear_error(); + O << " error opening file for writing!\n"; } From grosbach at apple.com Fri Aug 20 12:34:23 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 20 Aug 2010 17:34:23 -0000 Subject: [llvm-commits] [llvm] r111655 - /llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h Message-ID: <20100820173423.2376F2A6C12C@llvm.org> Author: grosbach Date: Fri Aug 20 12:34:22 2010 New Revision: 111655 URL: http://llvm.org/viewvc/llvm-project?rev=111655&view=rev Log: Add explicit initializer for UseLocalStackAllocationBlock in MFI constructor Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h Modified: llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h?rev=111655&r1=111654&r2=111655&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFrameInfo.h Fri Aug 20 12:34:22 2010 @@ -235,6 +235,7 @@ LocalFrameSize = 0; LocalFrameBaseOffset = 0; LocalFrameMaxAlign = 0; + UseLocalStackAllocationBlock = false; } /// hasStackObjects - Return true if there are any stack objects in this From st at invia.fr Fri Aug 20 12:36:58 2010 From: st at invia.fr (Sylvere Teissier) Date: Fri, 20 Aug 2010 19:36:58 +0200 Subject: [llvm-commits] [llvm] r111620 - in /llvm/trunk: tools/llvmc/examples/mcc16/Hooks.cpp utils/TableGen/LLVMCConfigurationEmitter.cpp In-Reply-To: <20100820112451.2D77C2A6C12D@llvm.org> References: <20100820112451.2D77C2A6C12D@llvm.org> Message-ID: <4C6EBD3A.4050804@invia.fr> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alias generation on my gcc version is broken with errors like that: "error: explicit qualification in declaration of ?llvmc::autogenerated::Alias_Os?" Please Apply this Patch: diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 3259bd2..a287d6b 100644 - --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -262,7 +262,7 @@ struct OptionDescription { /// GenVariableName - Returns the variable name used in the /// generated C++ code. std::string GenVariableName() const - - { return "autogenerated::" + GenOptionType() + EscapeVariableName(Name); } + { return GenOptionType() + EscapeVariableName(Name); } /// GenPlainVariableName - Returns the variable name without the namespace /// prefix. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMbr06AAoJENlXRqSDmxB9jfMIAMYWNpJT/f85rFaYahY56bYq 8ekLXC1WN7JA7xdTaKxEz5nkyqNpjSrNqPzLmCiwSJQVfaAb6f8ipqBoOjsPaJT0 uhRBP7DkgSzI/XdXtRBYkFRXyQ1dyYipoG3rE/GqqR3ryka+56SUgtS0LhDzN2o1 x4wkjDJyVjmdVgITa/tqgTSkY3zhRoGoZxMCw+wJ912HkLaaRyFob06WSBsIufRx LjSLxCggNGbrbSMmyOmOZ7jzO3zRJKq+CbFcjdu9wnmPKqkzuMTnYUI4E71maHFw rGVQVtz6n8gT6FWKU/OqUd9fLivKm2gXjA+1wjicwI6rhTpp8j6IszlcfnDYLpY= =XqlJ -----END PGP SIGNATURE----- From foldr at codedgers.com Fri Aug 20 12:38:39 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 17:38:39 -0000 Subject: [llvm-commits] [llvm] r111656 - in /llvm/trunk: include/llvm/Support/PrettyStackTrace.h include/llvm/Support/Regex.h utils/FileCheck/FileCheck.cpp Message-ID: <20100820173839.2B4092A6C12C@llvm.org> Author: foldr Date: Fri Aug 20 12:38:38 2010 New Revision: 111656 URL: http://llvm.org/viewvc/llvm-project?rev=111656&view=rev Log: Trailing whitespace. Modified: llvm/trunk/include/llvm/Support/PrettyStackTrace.h llvm/trunk/include/llvm/Support/Regex.h llvm/trunk/utils/FileCheck/FileCheck.cpp Modified: llvm/trunk/include/llvm/Support/PrettyStackTrace.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PrettyStackTrace.h?rev=111656&r1=111655&r2=111656&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/PrettyStackTrace.h (original) +++ llvm/trunk/include/llvm/Support/PrettyStackTrace.h Fri Aug 20 12:38:38 2010 @@ -24,10 +24,10 @@ /// handlers which conflict with the ones installed by this module. /// Defaults to false. extern bool DisablePrettyStackTrace; - + /// PrettyStackTraceEntry - This class is used to represent a frame of the /// "pretty" stack trace that is dumped when a program crashes. You can define - /// subclasses of this and declare them on the program stack: when they are + /// subclasses of this and declare them on the program stack: when they are /// constructed and destructed, they will add their symbolic frames to a /// virtual stack trace. This gets dumped out if the program crashes. class PrettyStackTraceEntry { @@ -37,14 +37,14 @@ public: PrettyStackTraceEntry(); virtual ~PrettyStackTraceEntry(); - + /// print - Emit information about this stack frame to OS. virtual void print(raw_ostream &OS) const = 0; - + /// getNextEntry - Return the next entry in the list of frames. const PrettyStackTraceEntry *getNextEntry() const { return NextEntry; } }; - + /// PrettyStackTraceString - This object prints a specified string (which /// should not contain newlines) to the stream as the stack trace when a crash /// occurs. @@ -54,7 +54,7 @@ PrettyStackTraceString(const char *str) : Str(str) {} virtual void print(raw_ostream &OS) const; }; - + /// PrettyStackTraceProgram - This object prints a specified program arguments /// to the stream as the stack trace when a crash occurs. class PrettyStackTraceProgram : public PrettyStackTraceEntry { @@ -65,7 +65,7 @@ : ArgC(argc), ArgV(argv) {} virtual void print(raw_ostream &OS) const; }; - + } // end namespace llvm #endif Modified: llvm/trunk/include/llvm/Support/Regex.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Regex.h?rev=111656&r1=111655&r2=111656&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Regex.h (original) +++ llvm/trunk/include/llvm/Support/Regex.h Fri Aug 20 12:38:38 2010 @@ -18,7 +18,7 @@ namespace llvm { class StringRef; template class SmallVectorImpl; - + class Regex { public: enum { @@ -26,9 +26,9 @@ /// Compile for matching that ignores upper/lower case distinctions. IgnoreCase=1, /// Compile for newline-sensitive matching. With this flag '[^' bracket - /// expressions and '.' never match newline. A ^ anchor matches the - /// null string after any newline in the string in addition to its normal - /// function, and the $ anchor matches the null string before any + /// expressions and '.' never match newline. A ^ anchor matches the + /// null string after any newline in the string in addition to its normal + /// function, and the $ anchor matches the null string before any /// newline in the string in addition to its normal function. Newline=2 }; @@ -47,7 +47,7 @@ /// matches it contains. The number filled in by match will include this /// many entries plus one for the whole regex (as element 0). unsigned getNumMatches() const; - + /// matches - Match the regex against a given \arg String. /// /// \param Matches - If given, on a succesful match this will be filled in Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=111656&r1=111655&r2=111656&view=diff ============================================================================== --- llvm/trunk/utils/FileCheck/FileCheck.cpp (original) +++ llvm/trunk/utils/FileCheck/FileCheck.cpp Fri Aug 20 12:38:38 2010 @@ -49,32 +49,32 @@ class Pattern { SMLoc PatternLoc; - + /// FixedStr - If non-empty, this pattern is a fixed string match with the /// specified fixed string. StringRef FixedStr; - + /// RegEx - If non-empty, this is a regex pattern. std::string RegExStr; - + /// VariableUses - Entries in this vector map to uses of a variable in the /// pattern, e.g. "foo[[bar]]baz". In this case, the RegExStr will contain /// "foobaz" and we'll get an entry in this vector that tells us to insert the /// value of bar at offset 3. std::vector > VariableUses; - + /// VariableDefs - Entries in this vector map to definitions of a variable in /// the pattern, e.g. "foo[[bar:.*]]baz". In this case, the RegExStr will /// contain "foo(.*)baz" and VariableDefs will contain the pair "bar",1. The /// index indicates what parenthesized value captures the variable value. std::vector > VariableDefs; - + public: - + Pattern() { } - + bool ParsePattern(StringRef PatternStr, SourceMgr &SM); - + /// Match - Match the pattern string against the input buffer Buffer. This /// returns the position that is matched or npos if there is no match. If /// there is a match, the size of the matched string is returned in MatchLen. @@ -103,19 +103,19 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) { PatternLoc = SMLoc::getFromPointer(PatternStr.data()); - + // Ignore trailing whitespace. while (!PatternStr.empty() && (PatternStr.back() == ' ' || PatternStr.back() == '\t')) PatternStr = PatternStr.substr(0, PatternStr.size()-1); - + // Check that there is something on the line. if (PatternStr.empty()) { SM.PrintMessage(PatternLoc, "found empty check string with prefix '" + CheckPrefix+":'", "error"); return true; } - + // Check to see if this is a fixed string, or if it has regex pieces. if (PatternStr.size() < 2 || (PatternStr.find("{{") == StringRef::npos && @@ -123,18 +123,18 @@ FixedStr = PatternStr; return false; } - + // Paren value #0 is for the fully matched string. Any new parenthesized // values add from their. unsigned CurParen = 1; - + // Otherwise, there is at least one regex piece. Build up the regex pattern // by escaping scary characters in fixed strings, building up one big regex. while (!PatternStr.empty()) { // RegEx matches. if (PatternStr.size() >= 2 && PatternStr[0] == '{' && PatternStr[1] == '{') { - + // Otherwise, this is the start of a regex match. Scan for the }}. size_t End = PatternStr.find("}}"); if (End == StringRef::npos) { @@ -142,13 +142,13 @@ "found start of regex string with no end '}}'", "error"); return true; } - + if (AddRegExToRegEx(PatternStr.substr(2, End-2), CurParen, SM)) return true; PatternStr = PatternStr.substr(End+2); continue; } - + // Named RegEx matches. These are of two forms: [[foo:.*]] which matches .* // (or some other regex) and assigns it to the FileCheck variable 'foo'. The // second form is [[foo]] which is a reference to foo. The variable name @@ -163,14 +163,14 @@ "invalid named regex reference, no ]] found", "error"); return true; } - + StringRef MatchStr = PatternStr.substr(2, End-2); PatternStr = PatternStr.substr(End+2); - + // Get the regex name (e.g. "foo"). size_t NameEnd = MatchStr.find(':'); StringRef Name = MatchStr.substr(0, NameEnd); - + if (Name.empty()) { SM.PrintMessage(SMLoc::getFromPointer(Name.data()), "invalid name in named regex: empty name", "error"); @@ -187,31 +187,31 @@ "invalid name in named regex", "error"); return true; } - + // Name can't start with a digit. if (isdigit(Name[0])) { SM.PrintMessage(SMLoc::getFromPointer(Name.data()), "invalid name in named regex", "error"); return true; } - + // Handle [[foo]]. if (NameEnd == StringRef::npos) { VariableUses.push_back(std::make_pair(Name, RegExStr.size())); continue; } - + // Handle [[foo:.*]]. VariableDefs.push_back(std::make_pair(Name, CurParen)); RegExStr += '('; ++CurParen; - + if (AddRegExToRegEx(MatchStr.substr(NameEnd+1), CurParen, SM)) return true; RegExStr += ')'; } - + // Handle fixed string matches. // Find the end, which is the start of the next regex. size_t FixedMatchEnd = PatternStr.find("{{"); @@ -260,7 +260,7 @@ "invalid regex: " + Error, "error"); return true; } - + RegExStr += RegexStr.str(); CurParen += R.getNumMatches(); return false; @@ -278,14 +278,14 @@ } // Regex match. - + // If there are variable uses, we need to create a temporary string with the // actual value. StringRef RegExToMatch = RegExStr; std::string TmpStr; if (!VariableUses.empty()) { TmpStr = RegExStr; - + unsigned InsertOffset = 0; for (unsigned i = 0, e = VariableUses.size(); i != e; ++i) { StringMap::iterator it = @@ -297,33 +297,33 @@ // Look up the value and escape it so that we can plop it into the regex. std::string Value; AddFixedStringToRegEx(it->second, Value); - + // Plop it into the regex at the adjusted offset. TmpStr.insert(TmpStr.begin()+VariableUses[i].second+InsertOffset, Value.begin(), Value.end()); InsertOffset += Value.size(); } - + // Match the newly constructed regex. RegExToMatch = TmpStr; } - - + + SmallVector MatchInfo; if (!Regex(RegExToMatch, Regex::Newline).match(Buffer, &MatchInfo)) return StringRef::npos; - + // Successful regex match. assert(!MatchInfo.empty() && "Didn't get any match"); StringRef FullMatch = MatchInfo[0]; - + // If this defines any variables, remember their values. for (unsigned i = 0, e = VariableDefs.size(); i != e; ++i) { assert(VariableDefs[i].second < MatchInfo.size() && "Internal paren error"); VariableTable[VariableDefs[i].first] = MatchInfo[VariableDefs[i].second]; } - + MatchLen = FullMatch.size(); return FullMatch.data()-Buffer.data(); } @@ -421,19 +421,19 @@ struct CheckString { /// Pat - The pattern to match. Pattern Pat; - + /// Loc - The location in the match file that the check string was specified. SMLoc Loc; - + /// IsCheckNext - This is true if this is a CHECK-NEXT: directive (as opposed /// to a CHECK: directive. bool IsCheckNext; - + /// NotStrings - These are all of the strings that are disallowed from /// occurring between this match string and the previous one (or start of /// file). std::vector > NotStrings; - + CheckString(const Pattern &P, SMLoc L, bool isCheckNext) : Pat(P), Loc(L), IsCheckNext(isCheckNext) {} }; @@ -443,7 +443,7 @@ static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) { SmallString<128> NewFile; NewFile.reserve(MB->getBufferSize()); - + for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd(); Ptr != End; ++Ptr) { // If C is not a horizontal whitespace, skip it. @@ -451,18 +451,18 @@ NewFile.push_back(*Ptr); continue; } - + // Otherwise, add one space and advance over neighboring space. NewFile.push_back(' '); while (Ptr+1 != End && (Ptr[1] == ' ' || Ptr[1] == '\t')) ++Ptr; } - + // Free the old buffer and return a new one. MemoryBuffer *MB2 = MemoryBuffer::getMemBufferCopy(NewFile.str(), MB->getBufferIdentifier()); - + delete MB; return MB2; } @@ -477,37 +477,37 @@ MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(CheckFilename.c_str(), &ErrorStr); if (F == 0) { - errs() << "Could not open check file '" << CheckFilename << "': " + errs() << "Could not open check file '" << CheckFilename << "': " << ErrorStr << '\n'; return true; } - + // If we want to canonicalize whitespace, strip excess whitespace from the // buffer containing the CHECK lines. if (!NoCanonicalizeWhiteSpace) F = CanonicalizeInputFile(F); - + SM.AddNewSourceBuffer(F, SMLoc()); // Find all instances of CheckPrefix followed by : in the file. StringRef Buffer = F->getBuffer(); std::vector > NotMatches; - + while (1) { // See if Prefix occurs in the memory buffer. Buffer = Buffer.substr(Buffer.find(CheckPrefix)); - + // If we didn't find a match, we're done. if (Buffer.empty()) break; - + const char *CheckPrefixStart = Buffer.data(); - + // When we find a check prefix, keep track of whether we find CHECK: or // CHECK-NEXT: bool IsCheckNext = false, IsCheckNot = false; - + // Verify that the : is present after the prefix. if (Buffer[CheckPrefix.size()] == ':') { Buffer = Buffer.substr(CheckPrefix.size()+1); @@ -523,11 +523,11 @@ Buffer = Buffer.substr(1); continue; } - + // Okay, we found the prefix, yay. Remember the rest of the line, but // ignore leading and trailing whitespace. Buffer = Buffer.substr(Buffer.find_first_not_of(" \t")); - + // Scan ahead to the end of line. size_t EOL = Buffer.find_first_of("\n\r"); @@ -538,10 +538,10 @@ Pattern P; if (P.ParsePattern(Buffer.substr(0, EOL), SM)) return true; - + Buffer = Buffer.substr(EOL); - + // Verify that CHECK-NEXT lines have at least one CHECK line before them. if (IsCheckNext && CheckStrings.empty()) { SM.PrintMessage(SMLoc::getFromPointer(CheckPrefixStart), @@ -549,34 +549,34 @@ CheckPrefix+ ": line", "error"); return true; } - + // Handle CHECK-NOT. if (IsCheckNot) { NotMatches.push_back(std::make_pair(SMLoc::getFromPointer(Buffer.data()), P)); continue; } - - + + // Okay, add the string we captured to the output vector and move on. CheckStrings.push_back(CheckString(P, PatternLoc, IsCheckNext)); std::swap(NotMatches, CheckStrings.back().NotStrings); } - + if (CheckStrings.empty()) { errs() << "error: no check strings found with prefix '" << CheckPrefix << ":'\n"; return true; } - + if (!NotMatches.empty()) { errs() << "error: '" << CheckPrefix << "-NOT:' not supported after last check line.\n"; return true; } - + return false; } @@ -586,11 +586,11 @@ // Otherwise, we have an error, emit an error message. SM.PrintMessage(CheckStr.Loc, "expected string not found in input", "error"); - + // Print the "scanning from here" line. If the current position is at the // end of a line, advance to the start of the next line. Buffer = Buffer.substr(Buffer.find_first_not_of(" \t\n\r")); - + SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), "scanning from here", "note"); @@ -606,9 +606,9 @@ // Scan for newline. Range = Range.substr(Range.find_first_of("\n\r")); if (Range.empty()) return NumNewLines; - + ++NumNewLines; - + // Handle \n\r and \r\n as a single newline. if (Range.size() > 1 && (Range[1] == '\n' || Range[1] == '\r') && @@ -624,7 +624,7 @@ cl::ParseCommandLineOptions(argc, argv); SourceMgr SM; - + // Read the expected strings from the check file. std::vector CheckStrings; if (ReadCheckFile(SM, CheckStrings)) @@ -635,35 +635,35 @@ MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), &ErrorStr); if (F == 0) { - errs() << "Could not open input file '" << InputFilename << "': " + errs() << "Could not open input file '" << InputFilename << "': " << ErrorStr << '\n'; return true; } - + // Remove duplicate spaces in the input file if requested. if (!NoCanonicalizeWhiteSpace) F = CanonicalizeInputFile(F); - + SM.AddNewSourceBuffer(F, SMLoc()); - + /// VariableTable - This holds all the current filecheck variables. StringMap VariableTable; - + // Check that we have all of the expected strings, in order, in the input // file. StringRef Buffer = F->getBuffer(); - + const char *LastMatch = Buffer.data(); - + for (unsigned StrNo = 0, e = CheckStrings.size(); StrNo != e; ++StrNo) { const CheckString &CheckStr = CheckStrings[StrNo]; - + StringRef SearchFrom = Buffer; - + // Find StrNo in the file. size_t MatchLen = 0; Buffer = Buffer.substr(CheckStr.Pat.Match(Buffer, MatchLen, VariableTable)); - + // If we didn't find a match, reject the input. if (Buffer.empty()) { PrintCheckFailed(SM, CheckStr, SearchFrom, VariableTable); @@ -690,7 +690,7 @@ "previous match was here", "note"); return 1; } - + if (NumNewLines != 1) { SM.PrintMessage(CheckStr.Loc, CheckPrefix+ @@ -703,7 +703,7 @@ return 1; } } - + // If this match had "not strings", verify that they don't exist in the // skipped region. for (unsigned ChunkNo = 0, e = CheckStr.NotStrings.size(); @@ -713,20 +713,20 @@ MatchLen, VariableTable); if (Pos == StringRef::npos) continue; - + SM.PrintMessage(SMLoc::getFromPointer(LastMatch+Pos), CheckPrefix+"-NOT: string occurred!", "error"); SM.PrintMessage(CheckStr.NotStrings[ChunkNo].first, CheckPrefix+"-NOT: pattern specified here", "note"); return 1; } - + // Otherwise, everything is good. Step over the matched text and remember // the position after the match as the end of the last match. Buffer = Buffer.substr(MatchLen); LastMatch = Buffer.data(); } - + return 0; } From foldr at codedgers.com Fri Aug 20 12:38:44 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 17:38:44 -0000 Subject: [llvm-commits] [llvm] r111657 - /llvm/trunk/include/llvm/Support/Regex.h Message-ID: <20100820173845.072912A6C12D@llvm.org> Author: foldr Date: Fri Aug 20 12:38:44 2010 New Revision: 111657 URL: http://llvm.org/viewvc/llvm-project?rev=111657&view=rev Log: Add include guards to Support/Regex.h. If the omission was intentional, please add a comment. Modified: llvm/trunk/include/llvm/Support/Regex.h Modified: llvm/trunk/include/llvm/Support/Regex.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Regex.h?rev=111657&r1=111656&r2=111657&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Regex.h (original) +++ llvm/trunk/include/llvm/Support/Regex.h Fri Aug 20 12:38:44 2010 @@ -11,6 +11,9 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_SUPPORT_REGEX_H +#define LLVM_SUPPORT_REGEX_H + #include struct llvm_regex; @@ -74,3 +77,5 @@ int error; }; } + +#endif // LLVM_SUPPORT_REGEX_H From gohman at apple.com Fri Aug 20 13:03:05 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 18:03:05 -0000 Subject: [llvm-commits] [llvm] r111659 - in /llvm/trunk: lib/Analysis/DbgInfoPrinter.cpp test/DebugInfo/printdbginfo2.ll Message-ID: <20100820180305.31E702A6C12C@llvm.org> Author: djg Date: Fri Aug 20 13:03:05 2010 New Revision: 111659 URL: http://llvm.org/viewvc/llvm-project?rev=111659&view=rev Log: Convert DbgInfoPrinter to use errs() instead of outs(). Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/test/DebugInfo/printdbginfo2.ll Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=111659&r1=111658&r2=111659&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Fri Aug 20 13:03:05 2010 @@ -40,7 +40,7 @@ void printVariableDeclaration(const Value *V); public: static char ID; // Pass identification - PrintDbgInfo() : FunctionPass(ID), Out(outs()) {} + PrintDbgInfo() : FunctionPass(ID), Out(errs()) {} virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/test/DebugInfo/printdbginfo2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/printdbginfo2.ll?rev=111659&r1=111658&r2=111659&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/printdbginfo2.ll (original) +++ llvm/trunk/test/DebugInfo/printdbginfo2.ll Fri Aug 20 13:03:05 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -print-dbginfo -disable-output | FileCheck %s +; RUN: opt < %s -print-dbginfo -disable-output |& FileCheck %s ; grep {%b is variable b of type x declared at x.c:7} %t1 ; grep {%2 is variable b of type x declared at x.c:7} %t1 ; grep {@c.1442 is variable c of type int declared at x.c:4} %t1 From gohman at apple.com Fri Aug 20 13:07:37 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 18:07:37 -0000 Subject: [llvm-commits] [llvm] r111661 - in /llvm/trunk: include/llvm/LinkAllVMCore.h include/llvm/Support/SlowOperationInformer.h lib/Support/SlowOperationInformer.cpp Message-ID: <20100820180737.CBF102A6C12C@llvm.org> Author: djg Date: Fri Aug 20 13:07:37 2010 New Revision: 111661 URL: http://llvm.org/viewvc/llvm-project?rev=111661&view=rev Log: Delete SlowOperationInformer, which is no longer used. Removed: llvm/trunk/include/llvm/Support/SlowOperationInformer.h llvm/trunk/lib/Support/SlowOperationInformer.cpp Modified: llvm/trunk/include/llvm/LinkAllVMCore.h Modified: llvm/trunk/include/llvm/LinkAllVMCore.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllVMCore.h?rev=111661&r1=111660&r2=111661&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllVMCore.h (original) +++ llvm/trunk/include/llvm/LinkAllVMCore.h Fri Aug 20 13:07:37 2010 @@ -33,7 +33,6 @@ #include "llvm/System/TimeValue.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/SlowOperationInformer.h" #include namespace { Removed: llvm/trunk/include/llvm/Support/SlowOperationInformer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SlowOperationInformer.h?rev=111660&view=auto ============================================================================== --- llvm/trunk/include/llvm/Support/SlowOperationInformer.h (original) +++ llvm/trunk/include/llvm/Support/SlowOperationInformer.h (removed) @@ -1,65 +0,0 @@ -//===- llvm/Support/SlowOperationInformer.h - Keep user informed *- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines a simple object which can be used to let the user know what -// is going on when a slow operation is happening, and gives them the ability to -// cancel it. Potentially slow operations can stack allocate one of these -// objects, and periodically call the "progress" method to update the progress -// bar. If the operation takes more than 1 second to complete, the progress bar -// is automatically shown and updated. As such, the slow operation should not -// print stuff to the screen, and should not be confused if an extra line -// appears on the screen (ie, the cursor should be at the start of the line). -// -// If the user presses CTRL-C during the operation, the next invocation of the -// progress method return true indicating that the operation was cancelled. -// -// Because SlowOperationInformers fiddle around with signals, they cannot be -// nested, and interact poorly with threads. The SIGALRM handler is set back to -// SIGDFL, but the SIGINT signal handler is restored when the -// SlowOperationInformer is destroyed. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_SLOW_OPERATION_INFORMER_H -#define LLVM_SUPPORT_SLOW_OPERATION_INFORMER_H - -#include -#include -#include "llvm/System/DataTypes.h" - -namespace llvm { - class SlowOperationInformer { - std::string OperationName; - unsigned LastPrintAmount; - - SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT - void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT - public: - explicit SlowOperationInformer(const std::string &Name); - ~SlowOperationInformer(); - - /// progress - Clients should periodically call this method when they can - /// handle cancellation. The Amount variable should indicate how far - /// along the operation is, given in 1/10ths of a percent (in other words, - /// Amount should range from 0 to 1000). If the user cancels the operation, - /// this returns true, false otherwise. - bool progress(unsigned Amount); - - /// progress - Same as the method above, but this performs the division for - /// you, and helps you avoid overflow if you are dealing with largish - /// numbers. - bool progress(unsigned Current, unsigned Maximum) { - assert(Maximum != 0 && - "Shouldn't be doing work if there is nothing to do!"); - return progress(Current*uint64_t(1000UL)/Maximum); - } - }; -} // end namespace llvm - -#endif /* SLOW_OPERATION_INFORMER_H */ Removed: llvm/trunk/lib/Support/SlowOperationInformer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SlowOperationInformer.cpp?rev=111660&view=auto ============================================================================== --- llvm/trunk/lib/Support/SlowOperationInformer.cpp (original) +++ llvm/trunk/lib/Support/SlowOperationInformer.cpp (removed) @@ -1,67 +0,0 @@ -//===-- SlowOperationInformer.cpp - Keep the user informed ----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the SlowOperationInformer class for the LLVM debugger. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/SlowOperationInformer.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Alarm.h" -#include -#include -using namespace llvm; - -SlowOperationInformer::SlowOperationInformer(const std::string &Name) - : OperationName(Name), LastPrintAmount(0) { - sys::SetupAlarm(1); -} - -SlowOperationInformer::~SlowOperationInformer() { - sys::TerminateAlarm(); - if (LastPrintAmount) { - // If we have printed something, make _sure_ we print the 100% amount, and - // also print a newline. - outs() << std::string(LastPrintAmount, '\b') << "Progress " - << OperationName << ": 100% \n"; - } -} - -/// progress - Clients should periodically call this method when they are in -/// an exception-safe state. The Amount variable should indicate how far -/// along the operation is, given in 1/10ths of a percent (in other words, -/// Amount should range from 0 to 1000). -bool SlowOperationInformer::progress(unsigned Amount) { - int status = sys::AlarmStatus(); - if (status == -1) { - outs() << "\n"; - LastPrintAmount = 0; - return true; - } - - // If we haven't spent enough time in this operation to warrant displaying the - // progress bar, don't do so yet. - if (status == 0) - return false; - - // Delete whatever we printed last time. - std::string ToPrint = std::string(LastPrintAmount, '\b'); - - std::ostringstream OS; - OS << "Progress " << OperationName << ": " << Amount/10; - if (unsigned Rem = Amount % 10) - OS << "." << Rem << "%"; - else - OS << "% "; - - LastPrintAmount = OS.str().size(); - outs() << ToPrint+OS.str(); - outs().flush(); - return false; -} From foldr at codedgers.com Fri Aug 20 13:16:26 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 18:16:26 -0000 Subject: [llvm-commits] [llvm] r111662 - in /llvm/trunk: test/LLVMC/Alias.td utils/TableGen/LLVMCConfigurationEmitter.cpp Message-ID: <20100820181626.6A9A52A6C12C@llvm.org> Author: foldr Date: Fri Aug 20 13:16:26 2010 New Revision: 111662 URL: http://llvm.org/viewvc/llvm-project?rev=111662&view=rev Log: llvmc: Fix alias generation. Added: llvm/trunk/test/LLVMC/Alias.td Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Added: llvm/trunk/test/LLVMC/Alias.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/Alias.td?rev=111662&view=auto ============================================================================== --- llvm/trunk/test/LLVMC/Alias.td (added) +++ llvm/trunk/test/LLVMC/Alias.td Fri Aug 20 13:16:26 2010 @@ -0,0 +1,24 @@ +// Test alias generation. +// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t +// RUN: FileCheck -input-file %t %s +// RUN: %compile_cxx -x c++ %t +// XFAIL: vg_leak + +include "llvm/CompilerDriver/Common.td" + +def OptList : OptionList<[ + +(switch_option "dummy1", (help "none")), +// CHECK: cl::alias Alias_dummy2 +(alias_option "dummy2", "dummy1") +]>; + +def dummy_tool : Tool<[ +(command "dummy_cmd"), +(in_language "dummy_lang"), +(out_language "dummy_lang"), +(actions (case + (switch_on "dummy1"), (forward "dummy1"))) +]>; + +def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>; Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=111662&r1=111661&r2=111662&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri Aug 20 13:16:26 2010 @@ -2427,7 +2427,7 @@ const OptionDescription& val = *B; O << val.GenTypeDeclaration() << ' ' - << val.GenVariableName() + << val.GenPlainVariableName() << "(\"" << val.Name << '\"'; const OptionDescription& D = descs.FindOption(val.Help); From foldr at codedgers.com Fri Aug 20 13:17:31 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 20 Aug 2010 18:17:31 +0000 (UTC) Subject: [llvm-commits] [llvm] r111620 - in /llvm/trunk: tools/llvmc/examples/mcc16/Hooks.cpp utils/TableGen/LLVMCConfigurationEmitter.cpp References: <20100820112451.2D77C2A6C12D@llvm.org> <4C6EBD3A.4050804@invia.fr> Message-ID: Sylvere Teissier writes: > > > Alias generation on my gcc version is broken with errors like that: > > "error: explicit qualification in declaration of > ?llvmc::autogenerated::Alias_Os?" Good catch! Fixed in r111662. From gohman at apple.com Fri Aug 20 13:22:58 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 18:22:58 -0000 Subject: [llvm-commits] [llvm] r111663 - /llvm/trunk/include/llvm/Metadata.h Message-ID: <20100820182258.29CBF2A6C12E@llvm.org> Author: djg Date: Fri Aug 20 13:22:57 2010 New Revision: 111663 URL: http://llvm.org/viewvc/llvm-project?rev=111663&view=rev Log: Reword NamedMDNode's comment. Modified: llvm/trunk/include/llvm/Metadata.h Modified: llvm/trunk/include/llvm/Metadata.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=111663&r1=111662&r2=111663&view=diff ============================================================================== --- llvm/trunk/include/llvm/Metadata.h (original) +++ llvm/trunk/include/llvm/Metadata.h Fri Aug 20 13:22:57 2010 @@ -175,8 +175,9 @@ }; //===----------------------------------------------------------------------===// -/// NamedMDNode - a tuple of MDNodes. -/// NamedMDNode is always named. All NamedMDNode operand has a type of metadata. +/// NamedMDNode - a tuple of MDNodes. Despite its name, a NamedMDNode isn't +/// itself an MDNode. NamedMDNodes belong to modules, have names, and contain +/// lists of MDNodes. class NamedMDNode : public ilist_node { friend class SymbolTableListTraits; friend struct ilist_traits; From idadesub at users.sourceforge.net Fri Aug 20 13:24:36 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 18:24:36 -0000 Subject: [llvm-commits] [llvm] r111664 - /llvm/trunk/test/Bindings/Ocaml/vmcore.ml Message-ID: <20100820182436.0FD762A6C12E@llvm.org> Author: erickt Date: Fri Aug 20 13:24:35 2010 New Revision: 111664 URL: http://llvm.org/viewvc/llvm-project?rev=111664&view=rev Log: Fix vmcore.ml test. Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=111664&r1=111663&r2=111664&view=diff ============================================================================== --- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original) +++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Fri Aug 20 13:24:35 2010 @@ -436,7 +436,7 @@ * RUN: grep {const_select.*select} < %t.ll * RUN: grep {const_extractelement.*extractelement} < %t.ll * RUN: grep {const_insertelement.*insertelement} < %t.ll - * RUN: grep {const_shufflevector.*shufflevector} < %t.ll + * RUN: grep {const_shufflevector = global <4 x i32> } < %t.ll *) ignore (define_global "const_size_of" (size_of (pointer_type i8_type)) m); ignore (define_global "const_gep" (const_gep foldbomb_gv [| five |]) m); @@ -455,7 +455,8 @@ ignore (define_global "const_shufflevector" (const_shufflevector (const_vector [| zero; one |]) (const_vector [| one; zero |]) - (const_vector [| const_int i32_type 1; const_int i32_type 2 |])) m); + (const_vector [| const_int i32_type 0; const_int i32_type 1; + const_int i32_type 2; const_int i32_type 3 |])) m); group "asm"; begin let ft = function_type void_type [| i32_type; i32_type; i32_type |] in @@ -1161,13 +1162,13 @@ group "comparisons"; begin (* RUN: grep {%build_icmp_ne = icmp ne i32 %P1, %P2} < %t.ll * RUN: grep {%build_icmp_sle = icmp sle i32 %P2, %P1} < %t.ll - * RUN: grep {%build_icmp_false = fcmp false float %F1, %F2} < %t.ll - * RUN: grep {%build_icmp_true = fcmp true float %F2, %F1} < %t.ll + * RUN: grep {%build_fcmp_false = fcmp false float %F1, %F2} < %t.ll + * RUN: grep {%build_fcmp_true = fcmp true float %F2, %F1} < %t.ll *) ignore (build_icmp Icmp.Ne p1 p2 "build_icmp_ne" atentry); ignore (build_icmp Icmp.Sle p2 p1 "build_icmp_sle" atentry); - ignore (build_fcmp Fcmp.False f1 f2 "build_icmp_false" atentry); - ignore (build_fcmp Fcmp.True f2 f1 "build_icmp_true" atentry) + ignore (build_fcmp Fcmp.False f1 f2 "build_fcmp_false" atentry); + ignore (build_fcmp Fcmp.True f2 f1 "build_fcmp_true" atentry) end; group "miscellaneous"; begin From resistor at mac.com Fri Aug 20 13:24:43 2010 From: resistor at mac.com (Owen Anderson) Date: Fri, 20 Aug 2010 18:24:43 -0000 Subject: [llvm-commits] [llvm] r111665 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Message-ID: <20100820182443.4552E2A6C12E@llvm.org> Author: resistor Date: Fri Aug 20 13:24:43 2010 New Revision: 111665 URL: http://llvm.org/viewvc/llvm-project?rev=111665&view=rev Log: Re-apply r111568 with a fix for the clang self-host. Added: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=111665&r1=111664&r2=111665&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Fri Aug 20 13:24:43 2010 @@ -14,11 +14,13 @@ #include "InstCombine.h" #include "llvm/IntrinsicInst.h" #include "llvm/Analysis/Loads.h" +#include "llvm/Support/PatternMatch.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/Statistic.h" using namespace llvm; +using namespace PatternMatch; STATISTIC(NumDeadStore, "Number of dead stores eliminated"); @@ -473,6 +475,51 @@ if (SI.isVolatile()) return 0; // Don't hack volatile stores. + // Attempt to narrow sequences where we load a wide value, perform bitmasks + // that only affect the low bits of it, and then store it back. This + // typically arises from bitfield initializers in C++. + ConstantInt *CI1 =0, *CI2 = 0; + Value *Ld = 0; + if (getTargetData() && + match(SI.getValueOperand(), + m_And(m_Or(m_Value(Ld), m_ConstantInt(CI1)), m_ConstantInt(CI2))) && + isa(Ld) && + equivalentAddressValues(cast(Ld)->getPointerOperand(), Ptr)) { + APInt OrMask = CI1->getValue(); + APInt AndMask = CI2->getValue(); + + // Compute the prefix of the value that is unmodified by the bitmasking. + unsigned LeadingAndOnes = AndMask.countLeadingOnes(); + unsigned LeadingOrZeros = OrMask.countLeadingZeros(); + unsigned Prefix = std::min(LeadingAndOnes, LeadingOrZeros); + uint64_t NewWidth = AndMask.getBitWidth() - Prefix; + while (NewWidth < AndMask.getBitWidth() && + getTargetData()->isIllegalInteger(NewWidth)) + NewWidth = NextPowerOf2(NewWidth); + + // If we can find a power-of-2 prefix (and if the values we're working with + // are themselves POT widths), then we can narrow the store. We rely on + // later iterations of instcombine to propagate the demanded bits to narrow + // the other computations in the chain. + if (NewWidth < AndMask.getBitWidth() && + getTargetData()->isLegalInteger(NewWidth)) { + const Type *NewType = IntegerType::get(Ptr->getContext(), NewWidth); + const Type *NewPtrType = PointerType::getUnqual(NewType); + + Value *NewVal = Builder->CreateTrunc(SI.getValueOperand(), NewType); + Value *NewPtr = Builder->CreateBitCast(Ptr, NewPtrType); + + // On big endian targets, we need to offset from the original pointer + // in order to store to the low-bit suffix. + if (getTargetData()->isBigEndian()) { + uint64_t GEPOffset = (AndMask.getBitWidth() - NewWidth) / 8; + NewPtr = Builder->CreateConstGEP1_64(NewPtr, GEPOffset); + } + + return new StoreInst(NewVal, NewPtr); + } + } + // store X, null -> turns into 'unreachable' in SimplifyCFG if (isa(Ptr) && SI.getPointerAddressSpace() == 0) { if (!isa(Val)) { Added: llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll?rev=111665&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2010-08-19-StoreNarrowing.ll Fri Aug 20 13:24:43 2010 @@ -0,0 +1,21 @@ +; RUN: opt -S -instcombine %s | not grep and +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-apple-darwin10.0.0" + +%class.A = type { i8, [3 x i8] } + +define void @_ZN1AC2Ev(%class.A* %this) nounwind ssp align 2 { +entry: + %0 = bitcast %class.A* %this to i32* ; [#uses=5] + %1 = load i32* %0, align 4 ; [#uses=1] + %2 = and i32 %1, -8 ; [#uses=2] + store i32 %2, i32* %0, align 4 + %3 = and i32 %2, -57 ; [#uses=1] + %4 = or i32 %3, 8 ; [#uses=2] + store i32 %4, i32* %0, align 4 + %5 = and i32 %4, -65 ; [#uses=2] + store i32 %5, i32* %0, align 4 + %6 = and i32 %5, -129 ; [#uses=1] + store i32 %6, i32* %0, align 4 + ret void +} From dalej at apple.com Fri Aug 20 13:29:27 2010 From: dalej at apple.com (Dale Johannesen) Date: Fri, 20 Aug 2010 18:29:27 -0000 Subject: [llvm-commits] [llvm] r111668 - /llvm/trunk/test/FrontendC/misaligned-param.c Message-ID: <20100820182927.C67EF2A6C12C@llvm.org> Author: johannes Date: Fri Aug 20 13:29:27 2010 New Revision: 111668 URL: http://llvm.org/viewvc/llvm-project?rev=111668&view=rev Log: Don't run test on PPC darwin. Modified: llvm/trunk/test/FrontendC/misaligned-param.c Modified: llvm/trunk/test/FrontendC/misaligned-param.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/misaligned-param.c?rev=111668&r1=111667&r2=111668&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/misaligned-param.c (original) +++ llvm/trunk/test/FrontendC/misaligned-param.c Fri Aug 20 13:29:27 2010 @@ -1,7 +1,7 @@ // RUN: %llvmgcc %s -m32 -S -o - | FileCheck %s // Misaligned parameter must be memcpy'd to correctly aligned temporary. // XFAIL: * -// XTARGET: x86,i386,i686,darwin +// XTARGET: x86_64-apple-darwin,i386-apple-darwin struct s { int x; long double y; }; long double foo(struct s x, int i, struct s y) { From benny.kra at googlemail.com Fri Aug 20 13:56:46 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Fri, 20 Aug 2010 18:56:46 -0000 Subject: [llvm-commits] [llvm] r111669 - /llvm/trunk/lib/Support/CMakeLists.txt Message-ID: <20100820185646.9AE232A6C12C@llvm.org> Author: d0k Date: Fri Aug 20 13:56:46 2010 New Revision: 111669 URL: http://llvm.org/viewvc/llvm-project?rev=111669&view=rev Log: Update CMake build. Modified: llvm/trunk/lib/Support/CMakeLists.txt Modified: llvm/trunk/lib/Support/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=111669&r1=111668&r2=111669&view=diff ============================================================================== --- llvm/trunk/lib/Support/CMakeLists.txt (original) +++ llvm/trunk/lib/Support/CMakeLists.txt Fri Aug 20 13:56:46 2010 @@ -24,7 +24,6 @@ PluginLoader.cpp PrettyStackTrace.cpp Regex.cpp - SlowOperationInformer.cpp SmallPtrSet.cpp SmallVector.cpp SourceMgr.cpp From idadesub at users.sourceforge.net Fri Aug 20 14:01:24 2010 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 20 Aug 2010 12:01:24 -0700 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml In-Reply-To: References: <20100820145127.226CB2A6C12C@llvm.org> Message-ID: On Fri, Aug 20, 2010 at 9:31 AM, Erick Tryzelaar wrote: > On Fri, Aug 20, 2010 at 9:17 AM, Bob Wilson wrote: > > Oh drat, I'll investigate. I'm erickt on #llvm as well if there are > more problems. > In case you didn't see in #llvm, I've pushed out a fix for vmcore. From grosbach at apple.com Fri Aug 20 14:04:43 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 20 Aug 2010 19:04:43 -0000 Subject: [llvm-commits] [llvm] r111670 - /llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Message-ID: <20100820190443.7DAD72A6C12C@llvm.org> Author: grosbach Date: Fri Aug 20 14:04:43 2010 New Revision: 111670 URL: http://llvm.org/viewvc/llvm-project?rev=111670&view=rev Log: Add more dbg output Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111670&r1=111669&r2=111670&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Fri Aug 20 14:04:43 2010 @@ -282,6 +282,7 @@ // Modify the instruction to use the new base register rather // than the frame index operand. TRI->resolveFrameIndex(I, BaseReg, Offset); + DEBUG(dbgs() << "Resolved: " << *MI); ++NumReplacements; } From bob.wilson at apple.com Fri Aug 20 14:56:53 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 12:56:53 -0700 Subject: [llvm-commits] [llvm] r111626 - in /llvm/trunk/test/Bindings/Ocaml: analysis.ml executionengine.ml scalar_opts.ml target.ml vmcore.ml In-Reply-To: References: <20100820145127.226CB2A6C12C@llvm.org> Message-ID: <2EB936BB-2ED4-4241-B9E2-DF733C335A54@apple.com> On Aug 20, 2010, at 12:01 PM, Erick Tryzelaar wrote: > On Fri, Aug 20, 2010 at 9:31 AM, Erick Tryzelaar > wrote: >> On Fri, Aug 20, 2010 at 9:17 AM, Bob Wilson wrote: >> >> Oh drat, I'll investigate. I'm erickt on #llvm as well if there are >> more problems. >> > > In case you didn't see in #llvm, I've pushed out a fix for vmcore. The llvm-i686-linux buildbot is green! ...and there was much rejoicing Thanks again From grosbach at apple.com Fri Aug 20 15:25:31 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 20 Aug 2010 20:25:31 -0000 Subject: [llvm-commits] [llvm] r111673 - /llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Message-ID: <20100820202531.6A5AB2A6C12C@llvm.org> Author: grosbach Date: Fri Aug 20 15:25:31 2010 New Revision: 111673 URL: http://llvm.org/viewvc/llvm-project?rev=111673&view=rev Log: Downwards growing stack allocation order reverses relative offsets Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Modified: llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp?rev=111673&r1=111672&r2=111673&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp (original) +++ llvm/trunk/lib/CodeGen/LocalStackSlotAllocation.cpp Fri Aug 20 15:25:31 2010 @@ -174,6 +174,7 @@ lookupCandidateBaseReg(const SmallVector, 8> &Regs, std::pair &RegOffset, int64_t LocalFrameOffset, + bool StackGrowsDown, const MachineInstr *MI, const TargetRegisterInfo *TRI) { unsigned e = Regs.size(); @@ -182,6 +183,8 @@ // Check if the relative offset from the where the base register references // to the target address is in range for the instruction. int64_t Offset = LocalFrameOffset - RegOffset.second; + if (StackGrowsDown) + Offset = -Offset; if (TRI->isFrameOffsetLegal(MI, Offset)) return true; } @@ -199,6 +202,9 @@ MachineFrameInfo *MFI = Fn.getFrameInfo(); const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); + const TargetFrameInfo &TFI = *Fn.getTarget().getFrameInfo(); + bool StackGrowsDown = + TFI.getStackGrowthDirection() == TargetFrameInfo::StackGrowsDown; for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { @@ -245,12 +251,15 @@ // register. std::pair RegOffset; if (lookupCandidateBaseReg(BaseRegisters, RegOffset, - LocalOffsets[FrameIdx], MI, TRI)) { + LocalOffsets[FrameIdx], + StackGrowsDown, MI, TRI)) { DEBUG(dbgs() << " Reusing base register " << RegOffset.first << "\n"); // We found a register to reuse. BaseReg = RegOffset.first; Offset = LocalOffsets[FrameIdx] - RegOffset.second; + if (StackGrowsDown) + Offset = -Offset; } else { // No previously defined register was in range, so create a // new one. From daniel at zuster.org Fri Aug 20 15:54:37 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Fri, 20 Aug 2010 20:54:37 -0000 Subject: [llvm-commits] [llvm] r111676 - /llvm/trunk/lib/System/ThreadLocal.cpp Message-ID: <20100820205437.C3D862A6C12E@llvm.org> Author: ddunbar Date: Fri Aug 20 15:54:37 2010 New Revision: 111676 URL: http://llvm.org/viewvc/llvm-project?rev=111676&view=rev Log: Fix --disable-threads build, PR7949. Modified: llvm/trunk/lib/System/ThreadLocal.cpp Modified: llvm/trunk/lib/System/ThreadLocal.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/ThreadLocal.cpp?rev=111676&r1=111675&r2=111676&view=diff ============================================================================== --- llvm/trunk/lib/System/ThreadLocal.cpp (original) +++ llvm/trunk/lib/System/ThreadLocal.cpp Fri Aug 20 15:54:37 2010 @@ -27,6 +27,7 @@ ThreadLocalImpl::~ThreadLocalImpl() { } void ThreadLocalImpl::setInstance(const void* d) { data = const_cast(d);} const void* ThreadLocalImpl::getInstance() { return data; } +void ThreadLocalImpl::removeInstance() { data = 0; } } #else From clattner at apple.com Fri Aug 20 16:17:41 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Aug 2010 14:17:41 -0700 Subject: [llvm-commits] [llvm] r111661 - in /llvm/trunk: include/llvm/LinkAllVMCore.h include/llvm/Support/SlowOperationInformer.h lib/Support/SlowOperationInformer.cpp In-Reply-To: <20100820180737.CBF102A6C12C@llvm.org> References: <20100820180737.CBF102A6C12C@llvm.org> Message-ID: <24072B2E-9B36-4F60-AA6C-76EAD36A213C@apple.com> On Aug 20, 2010, at 11:07 AM, Dan Gohman wrote: > Author: djg > Date: Fri Aug 20 13:07:37 2010 > New Revision: 111661 > > URL: http://llvm.org/viewvc/llvm-project?rev=111661&view=rev > Log: > Delete SlowOperationInformer, which is no longer used. So sad, whatever will "the LLVM debugger" do? -Chris > > Removed: > llvm/trunk/include/llvm/Support/SlowOperationInformer.h > llvm/trunk/lib/Support/SlowOperationInformer.cpp > Modified: > llvm/trunk/include/llvm/LinkAllVMCore.h > > Modified: llvm/trunk/include/llvm/LinkAllVMCore.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllVMCore.h?rev=111661&r1=111660&r2=111661&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/LinkAllVMCore.h (original) > +++ llvm/trunk/include/llvm/LinkAllVMCore.h Fri Aug 20 13:07:37 2010 > @@ -33,7 +33,6 @@ > #include "llvm/System/TimeValue.h" > #include "llvm/Support/Dwarf.h" > #include "llvm/Support/MathExtras.h" > -#include "llvm/Support/SlowOperationInformer.h" > #include > > namespace { > > Removed: llvm/trunk/include/llvm/Support/SlowOperationInformer.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SlowOperationInformer.h?rev=111660&view=auto > ============================================================================== > --- llvm/trunk/include/llvm/Support/SlowOperationInformer.h (original) > +++ llvm/trunk/include/llvm/Support/SlowOperationInformer.h (removed) > @@ -1,65 +0,0 @@ > -//===- llvm/Support/SlowOperationInformer.h - Keep user informed *- C++ -*-===// > -// > -// The LLVM Compiler Infrastructure > -// > -// This file is distributed under the University of Illinois Open Source > -// License. See LICENSE.TXT for details. > -// > -//===----------------------------------------------------------------------===// > -// > -// This file defines a simple object which can be used to let the user know what > -// is going on when a slow operation is happening, and gives them the ability to > -// cancel it. Potentially slow operations can stack allocate one of these > -// objects, and periodically call the "progress" method to update the progress > -// bar. If the operation takes more than 1 second to complete, the progress bar > -// is automatically shown and updated. As such, the slow operation should not > -// print stuff to the screen, and should not be confused if an extra line > -// appears on the screen (ie, the cursor should be at the start of the line). > -// > -// If the user presses CTRL-C during the operation, the next invocation of the > -// progress method return true indicating that the operation was cancelled. > -// > -// Because SlowOperationInformers fiddle around with signals, they cannot be > -// nested, and interact poorly with threads. The SIGALRM handler is set back to > -// SIGDFL, but the SIGINT signal handler is restored when the > -// SlowOperationInformer is destroyed. > -// > -//===----------------------------------------------------------------------===// > - > -#ifndef LLVM_SUPPORT_SLOW_OPERATION_INFORMER_H > -#define LLVM_SUPPORT_SLOW_OPERATION_INFORMER_H > - > -#include > -#include > -#include "llvm/System/DataTypes.h" > - > -namespace llvm { > - class SlowOperationInformer { > - std::string OperationName; > - unsigned LastPrintAmount; > - > - SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT > - void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT > - public: > - explicit SlowOperationInformer(const std::string &Name); > - ~SlowOperationInformer(); > - > - /// progress - Clients should periodically call this method when they can > - /// handle cancellation. The Amount variable should indicate how far > - /// along the operation is, given in 1/10ths of a percent (in other words, > - /// Amount should range from 0 to 1000). If the user cancels the operation, > - /// this returns true, false otherwise. > - bool progress(unsigned Amount); > - > - /// progress - Same as the method above, but this performs the division for > - /// you, and helps you avoid overflow if you are dealing with largish > - /// numbers. > - bool progress(unsigned Current, unsigned Maximum) { > - assert(Maximum != 0 && > - "Shouldn't be doing work if there is nothing to do!"); > - return progress(Current*uint64_t(1000UL)/Maximum); > - } > - }; > -} // end namespace llvm > - > -#endif /* SLOW_OPERATION_INFORMER_H */ > > Removed: llvm/trunk/lib/Support/SlowOperationInformer.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SlowOperationInformer.cpp?rev=111660&view=auto > ============================================================================== > --- llvm/trunk/lib/Support/SlowOperationInformer.cpp (original) > +++ llvm/trunk/lib/Support/SlowOperationInformer.cpp (removed) > @@ -1,67 +0,0 @@ > -//===-- SlowOperationInformer.cpp - Keep the user informed ----------------===// > -// > -// The LLVM Compiler Infrastructure > -// > -// This file is distributed under the University of Illinois Open Source > -// License. See LICENSE.TXT for details. > -// > -//===----------------------------------------------------------------------===// > -// > -// This file implements the SlowOperationInformer class for the LLVM debugger. > -// > -//===----------------------------------------------------------------------===// > - > -#include "llvm/Support/SlowOperationInformer.h" > -#include "llvm/Support/raw_ostream.h" > -#include "llvm/System/Alarm.h" > -#include > -#include > -using namespace llvm; > - > -SlowOperationInformer::SlowOperationInformer(const std::string &Name) > - : OperationName(Name), LastPrintAmount(0) { > - sys::SetupAlarm(1); > -} > - > -SlowOperationInformer::~SlowOperationInformer() { > - sys::TerminateAlarm(); > - if (LastPrintAmount) { > - // If we have printed something, make _sure_ we print the 100% amount, and > - // also print a newline. > - outs() << std::string(LastPrintAmount, '\b') << "Progress " > - << OperationName << ": 100% \n"; > - } > -} > - > -/// progress - Clients should periodically call this method when they are in > -/// an exception-safe state. The Amount variable should indicate how far > -/// along the operation is, given in 1/10ths of a percent (in other words, > -/// Amount should range from 0 to 1000). > -bool SlowOperationInformer::progress(unsigned Amount) { > - int status = sys::AlarmStatus(); > - if (status == -1) { > - outs() << "\n"; > - LastPrintAmount = 0; > - return true; > - } > - > - // If we haven't spent enough time in this operation to warrant displaying the > - // progress bar, don't do so yet. > - if (status == 0) > - return false; > - > - // Delete whatever we printed last time. > - std::string ToPrint = std::string(LastPrintAmount, '\b'); > - > - std::ostringstream OS; > - OS << "Progress " << OperationName << ": " << Amount/10; > - if (unsigned Rem = Amount % 10) > - OS << "." << Rem << "%"; > - else > - OS << "% "; > - > - LastPrintAmount = OS.str().size(); > - outs() << ToPrint+OS.str(); > - outs().flush(); > - return false; > -} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Fri Aug 20 16:18:56 2010 From: dalej at apple.com (Dale Johannesen) Date: Fri, 20 Aug 2010 21:18:56 -0000 Subject: [llvm-commits] [llvm] r111678 - /llvm/trunk/test/FrontendC/misaligned-param.c Message-ID: <20100820211856.1EABA2A6C12E@llvm.org> Author: johannes Date: Fri Aug 20 16:18:55 2010 New Revision: 111678 URL: http://llvm.org/viewvc/llvm-project?rev=111678&view=rev Log: Test should pass on non-Darwin x86. Modified: llvm/trunk/test/FrontendC/misaligned-param.c Modified: llvm/trunk/test/FrontendC/misaligned-param.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/misaligned-param.c?rev=111678&r1=111677&r2=111678&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/misaligned-param.c (original) +++ llvm/trunk/test/FrontendC/misaligned-param.c Fri Aug 20 16:18:55 2010 @@ -1,7 +1,7 @@ // RUN: %llvmgcc %s -m32 -S -o - | FileCheck %s // Misaligned parameter must be memcpy'd to correctly aligned temporary. // XFAIL: * -// XTARGET: x86_64-apple-darwin,i386-apple-darwin +// XTARGET: i386,i686,x86_64 struct s { int x; long double y; }; long double foo(struct s x, int i, struct s y) { From clattner at apple.com Fri Aug 20 16:21:21 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Aug 2010 14:21:21 -0700 Subject: [llvm-commits] [llvm] r111440 - /llvm/trunk/test/Other/close-stderr.ll In-Reply-To: References: <20100818223557.0EB4F2A6C12C@llvm.org> Message-ID: <9F1DB816-1EC7-48E8-9159-321A89D47D06@apple.com> On Aug 19, 2010, at 6:37 PM, Daniel Dunbar wrote: > On Thu, Aug 19, 2010 at 6:25 PM, Dan Gohman wrote: >> What kind of unit test would you suggest? This kind of test >> doesn't seem to fit easily into the main harnesses. > > I may not understand what the problem was, but I thought something like: > --- > void f0() { > close(2); > llvm::errs() << "ok"; > } > -- > would be enough to reproduce the problem? No, and I don't see why a unit test is better than the existing test Dan has. -Chris From gohman at apple.com Fri Aug 20 17:02:26 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 22:02:26 -0000 Subject: [llvm-commits] [llvm] r111681 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/Metadata.h lib/Analysis/DebugInfo.cpp lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/Metadata.cpp Message-ID: <20100820220226.EB8C22A6C12C@llvm.org> Author: djg Date: Fri Aug 20 17:02:26 2010 New Revision: 111681 URL: http://llvm.org/viewvc/llvm-project?rev=111681&view=rev Log: Introduce a new temporary MDNode concept. Temporary MDNodes are not part of the IR, are not uniqued, and may be safely RAUW'd. This replaces a variety of alternate mechanisms for achieving the same effect. Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/include/llvm/Metadata.h llvm/trunk/lib/Analysis/DebugInfo.cpp llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/VMCore/Metadata.cpp Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=111681&r1=111680&r2=111681&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Fri Aug 20 17:02:26 2010 @@ -272,6 +272,10 @@ StringRef getFilename() const { return getCompileUnit().getFilename();} StringRef getDirectory() const { return getCompileUnit().getDirectory();} + /// replaceAllUsesWith - Replace all uses of debug info referenced by + /// this descriptor. + void replaceAllUsesWith(DIDescriptor &D); + /// print - print type. void print(raw_ostream &OS) const; @@ -314,10 +318,6 @@ /// dump - print derived type to dbgs() with a newline. void dump() const; - - /// replaceAllUsesWith - Replace all uses of debug info referenced by - /// this descriptor. - void replaceAllUsesWith(DIDescriptor &D); }; /// DICompositeType - This descriptor holds a type that can refer to multiple @@ -654,6 +654,9 @@ unsigned RunTimeLang = 0, MDNode *ContainingType = 0); + /// CreateTemporaryType - Create a temporary forward-declared type. + DIType CreateTemporaryType(DIDescriptor Context); + /// CreateArtificialType - Create a new DIType with "artificial" flag set. DIType CreateArtificialType(DIType Ty); Modified: llvm/trunk/include/llvm/Metadata.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=111681&r1=111680&r2=111681&view=diff ============================================================================== --- llvm/trunk/include/llvm/Metadata.h (original) +++ llvm/trunk/include/llvm/Metadata.h Fri Aug 20 17:02:26 2010 @@ -128,6 +128,16 @@ static MDNode *getIfExists(LLVMContext &Context, Value *const *Vals, unsigned NumVals); + + /// getTemporary - Return a temporary MDNode, for use in constructing + /// cyclic MDNode structures. A temporary MDNode is not uniqued, + /// may be RAUW'd, and must be manually deleted with deleteTemporary. + static MDNode *getTemporary(LLVMContext &Context, Value *const *Vals, + unsigned NumVals); + + /// deleteTemporary - Deallocate a node created by getTemporary. The + /// node must not have any users. + static void deleteTemporary(MDNode *N); /// getOperand - Return specified operand. Value *getOperand(unsigned i) const; Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=111681&r1=111680&r2=111681&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Fri Aug 20 17:02:26 2010 @@ -22,6 +22,7 @@ #include "llvm/Analysis/ValueTracking.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallString.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/raw_ostream.h" @@ -260,7 +261,7 @@ /// replaceAllUsesWith - Replace all uses of debug info referenced by /// this descriptor. -void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) { +void DIType::replaceAllUsesWith(DIDescriptor &D) { if (!DbgNode) return; @@ -274,6 +275,7 @@ const MDNode *DN = D; const Value *V = cast_or_null(DN); Node->replaceAllUsesWith(const_cast(V)); + MDNode::deleteTemporary(Node); } } @@ -934,6 +936,18 @@ } +/// CreateTemporaryType - Create a temporary forward-declared type. +DIType DIFactory::CreateTemporaryType(DIDescriptor Context) { + // Give the temporary MDNode a tag. It doesn't matter what tag we + // use here as long as DIType accepts it. + Value *Elts[] = { + GetTagConstant(DW_TAG_base_type) + }; + MDNode *Node = MDNode::getTemporary(VMContext, Elts, array_lengthof(Elts)); + return DIType(Node); +} + + /// CreateCompositeType - Create a composite type like array, struct, etc. DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context, Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=111681&r1=111680&r2=111681&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Fri Aug 20 17:02:26 2010 @@ -517,11 +517,7 @@ if (Result) return false; // Otherwise, create MDNode forward reference. - - // FIXME: This is not unique enough! - std::string FwdRefName = "llvm.mdnode.fwdref." + utostr(MID); - Value *V = MDString::get(Context, FwdRefName); - MDNode *FwdNode = MDNode::get(Context, &V, 1); + MDNode *FwdNode = MDNode::getTemporary(Context, 0, 0); ForwardRefMDNodes[MID] = std::make_pair(FwdNode, Lex.getLoc()); if (NumberedMetadata.size() <= MID) @@ -585,7 +581,9 @@ std::map, LocTy> >::iterator FI = ForwardRefMDNodes.find(MetadataID); if (FI != ForwardRefMDNodes.end()) { - FI->second.first->replaceAllUsesWith(Init); + MDNode *Temp = FI->second.first; + Temp->replaceAllUsesWith(Init); + MDNode::deleteTemporary(Temp); ForwardRefMDNodes.erase(FI); assert(NumberedMetadata[MetadataID] == Init && "Tracking VH didn't work"); Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=111681&r1=111680&r2=111681&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Aug 20 17:02:26 2010 @@ -333,9 +333,9 @@ } // If there was a forward reference to this value, replace it. - Value *PrevVal = OldV; + MDNode *PrevVal = cast(OldV); OldV->replaceAllUsesWith(V); - delete PrevVal; + MDNode::deleteTemporary(PrevVal); // Deleting PrevVal sets Idx value in MDValuePtrs to null. Set new // value for Idx. MDValuePtrs[Idx] = V; @@ -351,7 +351,7 @@ } // Create and return a placeholder, which will later be RAUW'd. - Value *V = new Argument(Type::getMetadataTy(Context)); + Value *V = MDNode::getTemporary(Context, 0, 0); MDValuePtrs[Idx] = V; return V; } Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=111681&r1=111680&r2=111681&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Fri Aug 20 17:02:26 2010 @@ -20,6 +20,7 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/SmallString.h" #include "SymbolTableListTraitsImpl.h" +#include "llvm/Support/LeakDetector.h" #include "llvm/Support/ValueHandle.h" using namespace llvm; @@ -244,6 +245,28 @@ return getMDNode(Context, Vals, NumVals, FL_Unknown, false); } +MDNode *MDNode::getTemporary(LLVMContext &Context, Value *const *Vals, + unsigned NumVals) { + MDNode *N = (MDNode *)malloc(sizeof(MDNode)+NumVals*sizeof(MDNodeOperand)); + N = new (N) MDNode(Context, Vals, NumVals, FL_No); + N->setValueSubclassData(N->getSubclassDataFromValue() | + NotUniquedBit); + LeakDetector::addGarbageObject(N); + return N; +} + +void MDNode::deleteTemporary(MDNode *N) { + assert(N->use_empty() && "Temporary MDNode has uses!"); + assert((N->getSubclassDataFromValue() & NotUniquedBit) && + "Temporary MDNode does not have NotUniquedBit set!"); + assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 && + "Temporary MDNode does has DestroyFlag set!"); + N->setValueSubclassData(N->getSubclassDataFromValue() | + DestroyFlag); + LeakDetector::removeGarbageObject(N); + delete N; +} + /// getOperand - Return specified operand. Value *MDNode::getOperand(unsigned i) const { return *getOperandPtr(const_cast(this), i); From wdietz2 at illinois.edu Fri Aug 20 17:05:21 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Fri, 20 Aug 2010 22:05:21 -0000 Subject: [llvm-commits] [poolalloc] r111683 - in /poolalloc/trunk: include/dsa/DSGraph.h lib/DSA/DSGraph.cpp Message-ID: <20100820220521.505C12A6C12C@llvm.org> Author: wdietz2 Date: Fri Aug 20 17:05:21 2010 New Revision: 111683 URL: http://llvm.org/viewvc/llvm-project?rev=111683&view=rev Log: Promote functionIsCallable to the DSGraph.h header so it can be used elsewhere. Modified: poolalloc/trunk/include/dsa/DSGraph.h poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/include/dsa/DSGraph.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSGraph.h?rev=111683&r1=111682&r2=111683&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSGraph.h (original) +++ poolalloc/trunk/include/dsa/DSGraph.h Fri Aug 20 17:05:21 2010 @@ -669,6 +669,25 @@ void destroy() { NodeMap.clear(); } }; +// +// Function: functionIsCallable() +// +// Description: +// Determine whether the specified function can be a target of the specified +// call site. We allow the user to configure what we consider to be +// uncallable at an indirect function call site. +// +// Inputs: +// CS - The call site which calls the function. +// F - The function that is potentially called by CS. +// +// Return value: +// true - The function F can be called by the call site. +// false - The function F cannot be called by the call site. +// +bool +functionIsCallable (CallSite CS, const Function* F); + } // End llvm namespace #endif Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=111683&r1=111682&r2=111683&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Fri Aug 20 17:05:21 2010 @@ -1384,7 +1384,7 @@ // true - The function F can be called by the call site. // false - The function F cannot be called by the call site. // -static bool +bool functionIsCallable (CallSite CS, const Function* F) { //Which targets do we choose? //Conservative: all of them From isanbard at gmail.com Fri Aug 20 17:05:51 2010 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 20 Aug 2010 22:05:51 -0000 Subject: [llvm-commits] [llvm] r111684 - in /llvm/trunk: docs/LangRef.html include/llvm-c/Core.h include/llvm/GlobalValue.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/CppBackend/CPPBackend.cpp lib/Target/Mangler.cpp lib/VMCore/AsmWriter.cpp lib/VMCore/Core.cpp lib/VMCore/Verifier.cpp test/Feature/linker_private_linkages.ll Message-ID: <20100820220551.858F02A6C12C@llvm.org> Author: void Date: Fri Aug 20 17:05:50 2010 New Revision: 111684 URL: http://llvm.org/viewvc/llvm-project?rev=111684&view=rev Log: Create the new linker type "linker_private_weak_def_auto". It's similar to "linker_private_weak", but it's known that the address of the object is not taken. For instance, functions that had an inline definition, but the compiler decided not to inline it. Note, unlike linker_private and linker_private_weak, linker_private_weak_def_auto may have only default visibility. The symbols are removed by the linker from the final linked image (executable or dynamic library). Modified: llvm/trunk/docs/LangRef.html llvm/trunk/include/llvm-c/Core.h llvm/trunk/include/llvm/GlobalValue.h llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/AsmParser/LLToken.h llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/Mangler.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/Core.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/test/Feature/linker_private_linkages.ll Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Fri Aug 20 17:05:50 2010 @@ -25,6 +25,7 @@
  • 'private' Linkage
  • 'linker_private' Linkage
  • 'linker_private_weak' Linkage
  • +
  • 'linker_private_weak_def_auto' Linkage
  • 'internal' Linkage
  • 'available_externally' Linkage
  • 'linkonce' Linkage
  • @@ -557,6 +558,15 @@ linker. The symbols are removed by the linker from the final linked image (executable or dynamic library). +
    linker_private_weak_def_auto
    +
    Similar to "linker_private_weak", but it's known that the address + of the object is not taken. For instance, functions that had an inline + definition, but the compiler decided not to inline it. Note, + unlike linker_private and linker_private_weak, + linker_private_weak_def_auto may have only default + visibility. The symbols are removed by the linker from the final linked + image (executable or dynamic library).
    +
    internal
    Similar to private, but the value shows as a local symbol (STB_LOCAL in the case of ELF) in the object file. This Modified: llvm/trunk/include/llvm-c/Core.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/include/llvm-c/Core.h (original) +++ llvm/trunk/include/llvm-c/Core.h Fri Aug 20 17:05:50 2010 @@ -227,7 +227,9 @@ LLVMGhostLinkage, /**< Obsolete */ LLVMCommonLinkage, /**< Tentative definitions */ LLVMLinkerPrivateLinkage, /**< Like Private, but linker removes. */ - LLVMLinkerPrivateWeakLinkage /**< Like LinkerPrivate, but is weak. */ + LLVMLinkerPrivateWeakLinkage, /**< Like LinkerPrivate, but is weak. */ + LLVMLinkerPrivateWeakDefAutoLinkage /**< Like LinkerPrivateWeak, but possibly + hidden. */ } LLVMLinkage; typedef enum { Modified: llvm/trunk/include/llvm/GlobalValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalValue.h (original) +++ llvm/trunk/include/llvm/GlobalValue.h Fri Aug 20 17:05:50 2010 @@ -41,6 +41,8 @@ PrivateLinkage, ///< Like Internal, but omit from symbol table. LinkerPrivateLinkage, ///< Like Private, but linker removes. LinkerPrivateWeakLinkage, ///< Like LinkerPrivate, but weak. + LinkerPrivateWeakDefAutoLinkage, ///< Like LinkerPrivateWeak, but possibly + /// hidden. DLLImportLinkage, ///< Function to be imported from DLL DLLExportLinkage, ///< Function to be accessible from DLL. ExternalWeakLinkage,///< ExternalWeak linkage description. @@ -137,9 +139,13 @@ static bool isLinkerPrivateWeakLinkage(LinkageTypes Linkage) { return Linkage == LinkerPrivateWeakLinkage; } + static bool isLinkerPrivateWeakDefAutoLinkage(LinkageTypes Linkage) { + return Linkage == LinkerPrivateWeakDefAutoLinkage; + } static bool isLocalLinkage(LinkageTypes Linkage) { return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage) || - isLinkerPrivateLinkage(Linkage) || isLinkerPrivateWeakLinkage(Linkage); + isLinkerPrivateLinkage(Linkage) || isLinkerPrivateWeakLinkage(Linkage) || + isLinkerPrivateWeakDefAutoLinkage(Linkage); } static bool isDLLImportLinkage(LinkageTypes Linkage) { return Linkage == DLLImportLinkage; @@ -158,24 +164,26 @@ /// by something non-equivalent at link time. For example, if a function has /// weak linkage then the code defining it may be replaced by different code. static bool mayBeOverridden(LinkageTypes Linkage) { - return (Linkage == WeakAnyLinkage || - Linkage == LinkOnceAnyLinkage || - Linkage == CommonLinkage || - Linkage == ExternalWeakLinkage || - Linkage == LinkerPrivateWeakLinkage); + return Linkage == WeakAnyLinkage || + Linkage == LinkOnceAnyLinkage || + Linkage == CommonLinkage || + Linkage == ExternalWeakLinkage || + Linkage == LinkerPrivateWeakLinkage || + Linkage == LinkerPrivateWeakDefAutoLinkage; } /// isWeakForLinker - Whether the definition of this global may be replaced at /// link time. static bool isWeakForLinker(LinkageTypes Linkage) { - return (Linkage == AvailableExternallyLinkage || - Linkage == WeakAnyLinkage || - Linkage == WeakODRLinkage || - Linkage == LinkOnceAnyLinkage || - Linkage == LinkOnceODRLinkage || - Linkage == CommonLinkage || - Linkage == ExternalWeakLinkage || - Linkage == LinkerPrivateWeakLinkage); + return Linkage == AvailableExternallyLinkage || + Linkage == WeakAnyLinkage || + Linkage == WeakODRLinkage || + Linkage == LinkOnceAnyLinkage || + Linkage == LinkOnceODRLinkage || + Linkage == CommonLinkage || + Linkage == ExternalWeakLinkage || + Linkage == LinkerPrivateWeakLinkage || + Linkage == LinkerPrivateWeakDefAutoLinkage; } bool hasExternalLinkage() const { return isExternalLinkage(Linkage); } @@ -195,6 +203,9 @@ bool hasLinkerPrivateWeakLinkage() const { return isLinkerPrivateWeakLinkage(Linkage); } + bool hasLinkerPrivateWeakDefAutoLinkage() const { + return isLinkerPrivateWeakDefAutoLinkage(Linkage); + } bool hasLocalLinkage() const { return isLocalLinkage(Linkage); } bool hasDLLImportLinkage() const { return isDLLImportLinkage(Linkage); } bool hasDLLExportLinkage() const { return isDLLExportLinkage(Linkage); } Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Fri Aug 20 17:05:50 2010 @@ -493,6 +493,7 @@ KEYWORD(private); KEYWORD(linker_private); KEYWORD(linker_private_weak); + KEYWORD(linker_private_weak_def_auto); KEYWORD(internal); KEYWORD(available_externally); KEYWORD(linkonce); Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Fri Aug 20 17:05:50 2010 @@ -199,6 +199,7 @@ case lltok::kw_private: // OptionalLinkage case lltok::kw_linker_private: // OptionalLinkage case lltok::kw_linker_private_weak: // OptionalLinkage + case lltok::kw_linker_private_weak_def_auto: // OptionalLinkage case lltok::kw_internal: // OptionalLinkage case lltok::kw_weak: // OptionalLinkage case lltok::kw_weak_odr: // OptionalLinkage @@ -623,7 +624,8 @@ Linkage != GlobalValue::InternalLinkage && Linkage != GlobalValue::PrivateLinkage && Linkage != GlobalValue::LinkerPrivateLinkage && - Linkage != GlobalValue::LinkerPrivateWeakLinkage) + Linkage != GlobalValue::LinkerPrivateWeakLinkage && + Linkage != GlobalValue::LinkerPrivateWeakDefAutoLinkage) return Error(LinkageLoc, "invalid linkage type for alias"); Constant *Aliasee; @@ -1008,6 +1010,7 @@ /// ::= 'private' /// ::= 'linker_private' /// ::= 'linker_private_weak' +/// ::= 'linker_private_weak_def_auto' /// ::= 'internal' /// ::= 'weak' /// ::= 'weak_odr' @@ -1029,6 +1032,9 @@ case lltok::kw_linker_private_weak: Res = GlobalValue::LinkerPrivateWeakLinkage; break; + case lltok::kw_linker_private_weak_def_auto: + Res = GlobalValue::LinkerPrivateWeakDefAutoLinkage; + break; case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break; case lltok::kw_weak: Res = GlobalValue::WeakAnyLinkage; break; case lltok::kw_weak_odr: Res = GlobalValue::WeakODRLinkage; break; @@ -2718,6 +2724,7 @@ case GlobalValue::PrivateLinkage: case GlobalValue::LinkerPrivateLinkage: case GlobalValue::LinkerPrivateWeakLinkage: + case GlobalValue::LinkerPrivateWeakDefAutoLinkage: case GlobalValue::InternalLinkage: case GlobalValue::AvailableExternallyLinkage: case GlobalValue::LinkOnceAnyLinkage: Modified: llvm/trunk/lib/AsmParser/LLToken.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLToken.h (original) +++ llvm/trunk/lib/AsmParser/LLToken.h Fri Aug 20 17:05:50 2010 @@ -37,7 +37,8 @@ kw_declare, kw_define, kw_global, kw_constant, - kw_private, kw_linker_private, kw_linker_private_weak, kw_internal, + kw_private, kw_linker_private, kw_linker_private_weak, + kw_linker_private_weak_def_auto, kw_internal, kw_linkonce, kw_linkonce_odr, kw_weak, kw_weak_odr, kw_appending, kw_dllimport, kw_dllexport, kw_common, kw_available_externally, kw_default, kw_hidden, kw_protected, Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Aug 20 17:05:50 2010 @@ -77,6 +77,7 @@ case 12: return GlobalValue::AvailableExternallyLinkage; case 13: return GlobalValue::LinkerPrivateLinkage; case 14: return GlobalValue::LinkerPrivateWeakLinkage; + case 15: return GlobalValue::LinkerPrivateWeakDefAutoLinkage; } } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Fri Aug 20 17:05:50 2010 @@ -299,21 +299,22 @@ static unsigned getEncodedLinkage(const GlobalValue *GV) { switch (GV->getLinkage()) { default: llvm_unreachable("Invalid linkage!"); - case GlobalValue::ExternalLinkage: return 0; - case GlobalValue::WeakAnyLinkage: return 1; - case GlobalValue::AppendingLinkage: return 2; - case GlobalValue::InternalLinkage: return 3; - case GlobalValue::LinkOnceAnyLinkage: return 4; - case GlobalValue::DLLImportLinkage: return 5; - case GlobalValue::DLLExportLinkage: return 6; - case GlobalValue::ExternalWeakLinkage: return 7; - case GlobalValue::CommonLinkage: return 8; - case GlobalValue::PrivateLinkage: return 9; - case GlobalValue::WeakODRLinkage: return 10; - case GlobalValue::LinkOnceODRLinkage: return 11; - case GlobalValue::AvailableExternallyLinkage: return 12; - case GlobalValue::LinkerPrivateLinkage: return 13; - case GlobalValue::LinkerPrivateWeakLinkage: return 14; + case GlobalValue::ExternalLinkage: return 0; + case GlobalValue::WeakAnyLinkage: return 1; + case GlobalValue::AppendingLinkage: return 2; + case GlobalValue::InternalLinkage: return 3; + case GlobalValue::LinkOnceAnyLinkage: return 4; + case GlobalValue::DLLImportLinkage: return 5; + case GlobalValue::DLLExportLinkage: return 6; + case GlobalValue::ExternalWeakLinkage: return 7; + case GlobalValue::CommonLinkage: return 8; + case GlobalValue::PrivateLinkage: return 9; + case GlobalValue::WeakODRLinkage: return 10; + case GlobalValue::LinkOnceODRLinkage: return 11; + case GlobalValue::AvailableExternallyLinkage: return 12; + case GlobalValue::LinkerPrivateLinkage: return 13; + case GlobalValue::LinkerPrivateWeakLinkage: return 14; + case GlobalValue::LinkerPrivateWeakDefAutoLinkage: return 15; } } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Aug 20 17:05:50 2010 @@ -200,11 +200,17 @@ case GlobalValue::WeakAnyLinkage: case GlobalValue::WeakODRLinkage: case GlobalValue::LinkerPrivateWeakLinkage: + case GlobalValue::LinkerPrivateWeakDefAutoLinkage: if (MAI->getWeakDefDirective() != 0) { // .globl _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global); - // .weak_definition _foo - OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefinition); + + if ((GlobalValue::LinkageTypes)Linkage != + GlobalValue::LinkerPrivateWeakDefAutoLinkage) + // .weak_definition _foo + OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefinition); + else + OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefAutoPrivate); } else if (MAI->getLinkOnceDirective() != 0) { // .globl _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global); Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Fri Aug 20 17:05:50 2010 @@ -288,6 +288,8 @@ Out << "GlobalValue::LinkerPrivateLinkage"; break; case GlobalValue::LinkerPrivateWeakLinkage: Out << "GlobalValue::LinkerPrivateWeakLinkage"; break; + case GlobalValue::LinkerPrivateWeakDefAutoLinkage: + Out << "GlobalValue::LinkerPrivateWeakDefAutoLinkage"; break; case GlobalValue::AvailableExternallyLinkage: Out << "GlobalValue::AvailableExternallyLinkage "; break; case GlobalValue::LinkOnceAnyLinkage: Modified: llvm/trunk/lib/Target/Mangler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mangler.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mangler.cpp (original) +++ llvm/trunk/lib/Target/Mangler.cpp Fri Aug 20 17:05:50 2010 @@ -180,7 +180,8 @@ ManglerPrefixTy PrefixTy = Mangler::Default; if (GV->hasPrivateLinkage() || isImplicitlyPrivate) PrefixTy = Mangler::Private; - else if (GV->hasLinkerPrivateLinkage() || GV->hasLinkerPrivateWeakLinkage()) + else if (GV->hasLinkerPrivateLinkage() || GV->hasLinkerPrivateWeakLinkage() || + GV->hasLinkerPrivateWeakDefAutoLinkage()) PrefixTy = Mangler::LinkerPrivate; // If this global has a name, handle it simply. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Fri Aug 20 17:05:50 2010 @@ -1435,6 +1435,9 @@ case GlobalValue::LinkerPrivateWeakLinkage: Out << "linker_private_weak "; break; + case GlobalValue::LinkerPrivateWeakDefAutoLinkage: + Out << "linker_private_weak_def_auto "; + break; case GlobalValue::InternalLinkage: Out << "internal "; break; case GlobalValue::LinkOnceAnyLinkage: Out << "linkonce "; break; case GlobalValue::LinkOnceODRLinkage: Out << "linkonce_odr "; break; Modified: llvm/trunk/lib/VMCore/Core.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Core.cpp (original) +++ llvm/trunk/lib/VMCore/Core.cpp Fri Aug 20 17:05:50 2010 @@ -1069,6 +1069,8 @@ return LLVMLinkerPrivateLinkage; case GlobalValue::LinkerPrivateWeakLinkage: return LLVMLinkerPrivateWeakLinkage; + case GlobalValue::LinkerPrivateWeakDefAutoLinkage: + return LLVMLinkerPrivateWeakDefAutoLinkage; case GlobalValue::DLLImportLinkage: return LLVMDLLImportLinkage; case GlobalValue::DLLExportLinkage: @@ -1122,6 +1124,9 @@ case LLVMLinkerPrivateWeakLinkage: GV->setLinkage(GlobalValue::LinkerPrivateWeakLinkage); break; + case LLVMLinkerPrivateWeakDefAutoLinkage: + GV->setLinkage(GlobalValue::LinkerPrivateWeakDefAutoLinkage); + break; case LLVMDLLImportLinkage: GV->setLinkage(GlobalValue::DLLImportLinkage); break; Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Aug 20 17:05:50 2010 @@ -446,6 +446,10 @@ Assert1(GVar && GVar->getType()->getElementType()->isArrayTy(), "Only global arrays can have appending linkage!", GVar); } + + Assert1(!GV.hasLinkerPrivateWeakDefAutoLinkage() || GV.hasDefaultVisibility(), + "linker_private_weak_def_auto can only have default visibility!", + &GV); } void Verifier::visitGlobalVariable(GlobalVariable &GV) { Modified: llvm/trunk/test/Feature/linker_private_linkages.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/linker_private_linkages.ll?rev=111684&r1=111683&r2=111684&view=diff ============================================================================== --- llvm/trunk/test/Feature/linker_private_linkages.ll (original) +++ llvm/trunk/test/Feature/linker_private_linkages.ll Fri Aug 20 17:05:50 2010 @@ -4,3 +4,4 @@ @foo = linker_private hidden global i32 0 @bar = linker_private_weak hidden global i32 0 + at qux = linker_private_weak_def_auto global i32 0 From wdietz2 at illinois.edu Fri Aug 20 17:12:02 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Fri, 20 Aug 2010 22:12:02 -0000 Subject: [llvm-commits] [poolalloc] r111685 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100820221202.2388C2A6C12C@llvm.org> Author: wdietz2 Date: Fri Aug 20 17:12:01 2010 New Revision: 111685 URL: http://llvm.org/viewvc/llvm-project?rev=111685&view=rev Log: Fix function scoping on functionIsCallable to be in the llvm namespace. Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=111685&r1=111684&r2=111685&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Fri Aug 20 17:12:01 2010 @@ -1385,7 +1385,7 @@ // false - The function F cannot be called by the call site. // bool -functionIsCallable (CallSite CS, const Function* F) { +llvm::functionIsCallable (CallSite CS, const Function* F) { //Which targets do we choose? //Conservative: all of them //Pretty Safe: same calling convention, otherwise undefined behavior From asl at math.spbu.ru Fri Aug 20 17:14:09 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Aug 2010 02:14:09 +0400 Subject: [llvm-commits] [llvm] r111684 - in /llvm/trunk: docs/LangRef.html include/llvm-c/Core.h include/llvm/GlobalValue.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Write Message-ID: > Create the new linker type "linker_private_weak_def_auto". Maybe we should put a temporary veto on adding new linkage types? Or at least such patches deserve some discussion? Why is it not possible to emulate the behavior with some current linkage type and e.g. visibility setting? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From criswell at uiuc.edu Fri Aug 20 17:27:48 2010 From: criswell at uiuc.edu (John Criswell) Date: Fri, 20 Aug 2010 22:27:48 -0000 Subject: [llvm-commits] [poolalloc] r111686 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100820222748.B138C2A6C12C@llvm.org> Author: criswell Date: Fri Aug 20 17:27:48 2010 New Revision: 111686 URL: http://llvm.org/viewvc/llvm-project?rev=111686&view=rev Log: Added explicit default initializers for command-line options. By default, filtering for indirect call targets will be enabled. Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=111686&r1=111685&r2=111686&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Fri Aug 20 17:27:48 2010 @@ -46,13 +46,16 @@ STATISTIC (NumFiltered , "Number of calls filtered"); static cl::opt noDSACallConv("dsa-no-filter-callcc", cl::desc("Don't filter call sites based on calling convention."), - cl::Hidden); + cl::Hidden, + cl::init(false)); static cl::opt noDSACallVA("dsa-no-filter-vararg", cl::desc("Don't filter call sites based on vararg presense"), - cl::Hidden); + cl::Hidden, + cl::init(false)); static cl::opt noDSACallFP("dsa-no-filter-intfp", - cl::desc("Don't filter call sites based on implicit integer to fp conversion"), - cl::Hidden); + cl::desc("Don't filter call sites based on implicit integer to FP conversion"), + cl::Hidden, + cl::init(false)); } // Determines if the DSGraph 'should' have a node for a given value. From gohman at apple.com Fri Aug 20 17:39:47 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 22:39:47 -0000 Subject: [llvm-commits] [llvm] r111687 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp Message-ID: <20100820223947.6EE352A6C12C@llvm.org> Author: djg Date: Fri Aug 20 17:39:47 2010 New Revision: 111687 URL: http://llvm.org/viewvc/llvm-project?rev=111687&view=rev Log: CreateTemporaryType doesn't needs its Context argument. Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/lib/Analysis/DebugInfo.cpp Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=111687&r1=111686&r2=111687&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Fri Aug 20 17:39:47 2010 @@ -655,7 +655,7 @@ MDNode *ContainingType = 0); /// CreateTemporaryType - Create a temporary forward-declared type. - DIType CreateTemporaryType(DIDescriptor Context); + DIType CreateTemporaryType(); /// CreateArtificialType - Create a new DIType with "artificial" flag set. DIType CreateArtificialType(DIType Ty); Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=111687&r1=111686&r2=111687&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Fri Aug 20 17:39:47 2010 @@ -937,7 +937,7 @@ /// CreateTemporaryType - Create a temporary forward-declared type. -DIType DIFactory::CreateTemporaryType(DIDescriptor Context) { +DIType DIFactory::CreateTemporaryType() { // Give the temporary MDNode a tag. It doesn't matter what tag we // use here as long as DIType accepts it. Value *Elts[] = { From gohman at apple.com Fri Aug 20 17:40:14 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 22:40:14 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111689 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <20100820224014.A27C32A6C12C@llvm.org> Author: djg Date: Fri Aug 20 17:40:14 2010 New Revision: 111689 URL: http://llvm.org/viewvc/llvm-project?rev=111689&view=rev Log: Use DIFactor::CreateTemporaryType. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=111689&r1=111688&r2=111689&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Aug 20 17:40:14 2010 @@ -772,15 +772,7 @@ // Create a place holder type first. The may be used as a context // for the argument types. - char *FwdTypeName = (char *)alloca(65); - sprintf(FwdTypeName, "fwd.type.%d", FwdTypeCount++); - llvm::DIType FwdType = - DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type, - findRegion(TYPE_CONTEXT(type)), - FwdTypeName, - getOrCreateFile(main_input_filename), - 0, 0, 0, 0, 0, - llvm::DIType(), llvm::DIArray()); + llvm::DIType FwdType = DebugFactory.CreateTemporaryType(); llvm::MDNode *FTN = FwdType; llvm::TrackingVH FwdTypeNode = FTN; TypeCache[type] = WeakVH(FwdType); @@ -826,7 +818,7 @@ // Now that we have a real decl for the struct, replace anything using the // old decl with the new one. This will recursively update the debug info. - llvm::DIDerivedType(FwdTypeNode).replaceAllUsesWith(RealType); + llvm::DIType(FwdTypeNode).replaceAllUsesWith(RealType); return RealType; } @@ -1002,19 +994,6 @@ // recursive) and replace all uses of the forward declaration with the // final definition. expanded_location Loc = GetNodeLocation(TREE_CHAIN(type), false); - // FIXME: findRegion() is not able to find context all the time. This - // means when type names in different context match then FwdDecl is - // reused because MDNodes are uniqued. To avoid this, use type context - /// also while creating FwdDecl for now. - std::string FwdName; - if (TYPE_CONTEXT(type)) { - StringRef TypeContextName = GetNodeName(TYPE_CONTEXT(type)); - if (!TypeContextName.empty()) - FwdName = TypeContextName; - } - StringRef TypeName = GetNodeName(type); - if (!TypeName.empty()) - FwdName = FwdName + TypeName.data(); unsigned SFlags = 0; if (TYPE_BLOCK_IMPL_STRUCT(type)) SFlags |= llvm::DIType::FlagAppleBlock; @@ -1029,15 +1008,7 @@ if (MDNode *TN = dyn_cast_or_null(I->second)) return DIType(TN); - llvm::DICompositeType FwdDecl = - DebugFactory.CreateCompositeType(Tag, - TyContext, - FwdName.c_str(), - getOrCreateFile(Loc.file), - Loc.line, - 0, 0, 0, SFlags | llvm::DIType::FlagFwdDecl, - llvm::DIType(), llvm::DIArray(), - RunTimeLang); + llvm::DIType FwdDecl = DebugFactory.CreateTemporaryType(); // forward declaration, if (TYPE_SIZE(type) == 0) @@ -1203,7 +1174,7 @@ // Now that we have a real decl for the struct, replace anything using the // old decl with the new one. This will recursively update the debug info. - llvm::DIDerivedType(FwdDeclNode).replaceAllUsesWith(RealDecl); + llvm::DIType(FwdDeclNode).replaceAllUsesWith(RealDecl); return RealDecl; } From gohman at apple.com Fri Aug 20 17:43:00 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 22:43:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111690 - in /llvm-gcc-4.2/trunk/gcc: llvm-debug.cpp llvm-debug.h Message-ID: <20100820224300.E74722A6C12C@llvm.org> Author: djg Date: Fri Aug 20 17:43:00 2010 New Revision: 111690 URL: http://llvm.org/viewvc/llvm-project?rev=111690&view=rev Log: FwdTypeCount is no longer used. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=111690&r1=111689&r2=111690&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Aug 20 17:43:00 2010 @@ -210,7 +210,6 @@ , PrevLineNo(0) , PrevBB(NULL) , CurrentGCCLexicalBlock(NULL) -, FwdTypeCount(0) , RegionStack() {} Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=111690&r1=111689&r2=111690&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Fri Aug 20 17:43:00 2010 @@ -67,11 +67,6 @@ // Current GCC lexical block (or enclosing FUNCTION_DECL). tree_node *CurrentGCCLexicalBlock; - // This counter counts debug info for forward referenced subroutine types. - // This counter is used to create unique name for such types so that their - // debug info (through MDNodes) is not shared accidently. - unsigned FwdTypeCount; - std::map TypeCache; // Cache of previously constructed // Types. From bruno.cardoso at gmail.com Fri Aug 20 17:55:05 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Fri, 20 Aug 2010 22:55:05 -0000 Subject: [llvm-commits] [llvm] r111691 - in /llvm/trunk: include/llvm/CodeGen/ISDOpcodes.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/X86/X86InstrFragmentsSIMD.td lib/Target/X86/X86InstrSSE.td Message-ID: <20100820225505.C49262A6C12C@llvm.org> Author: bruno Date: Fri Aug 20 17:55:05 2010 New Revision: 111691 URL: http://llvm.org/viewvc/llvm-project?rev=111691&view=rev Log: This is the first step towards refactoring the x86 vector shuffle code. The general idea here is to have a group of x86 target specific nodes which are going to be selected during lowering and then directly matched in isel. The commit includes the addition of those specific nodes and a *bunch* of patterns, and incrementally we're going to switch between them and what we have right now. Both the patterns and target specific nodes can change as we move forward with this work. Modified: llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h?rev=111691&r1=111690&r2=111691&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h Fri Aug 20 17:55:05 2010 @@ -603,7 +603,7 @@ /// which do not reference a specific memory location should be less than /// this value. Those that do must not be less than this value, and can /// be used with SelectionDAG::getMemIntrinsicNode. - static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+100; + static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+150; //===--------------------------------------------------------------------===// /// MemIndexedMode enum - This enum defines the load / store indexed Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=111691&r1=111690&r2=111691&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Aug 20 17:55:05 2010 @@ -8093,6 +8093,41 @@ case X86ISD::MUL_IMM: return "X86ISD::MUL_IMM"; case X86ISD::PTEST: return "X86ISD::PTEST"; case X86ISD::TESTP: return "X86ISD::TESTP"; + case X86ISD::PALIGN: return "X86ISD::PALIGN"; + case X86ISD::PSHUFD: return "X86ISD::PSHUFD"; + case X86ISD::PSHUFHW: return "X86ISD::PSHUFHW"; + case X86ISD::PSHUFHW_LD: return "X86ISD::PSHUFHW_LD"; + case X86ISD::PSHUFLW: return "X86ISD::PSHUFLW"; + case X86ISD::PSHUFLW_LD: return "X86ISD::PSHUFLW_LD"; + case X86ISD::SHUFPS: return "X86ISD::SHUFPS"; + case X86ISD::SHUFPD: return "X86ISD::SHUFPD"; + case X86ISD::MOVLHPS: return "X86ISD::MOVLHPS"; + case X86ISD::MOVHLPS: return "X86ISD::MOVHLPS"; + case X86ISD::MOVLHPD: return "X86ISD::MOVLHPD"; + case X86ISD::MOVHLPD: return "X86ISD::MOVHLPD"; + case X86ISD::MOVHPS: return "X86ISD::MOVHPS"; + case X86ISD::MOVLPS: return "X86ISD::MOVLPS"; + case X86ISD::MOVHPD: return "X86ISD::MOVHPD"; + case X86ISD::MOVLPD: return "X86ISD::MOVLPD"; + case X86ISD::MOVDDUP: return "X86ISD::MOVDDUP"; + case X86ISD::MOVSHDUP: return "X86ISD::MOVSHDUP"; + case X86ISD::MOVSLDUP: return "X86ISD::MOVSLDUP"; + case X86ISD::MOVSHDUP_LD: return "X86ISD::MOVSHDUP_LD"; + case X86ISD::MOVSLDUP_LD: return "X86ISD::MOVSLDUP_LD"; + case X86ISD::MOVSD: return "X86ISD::MOVSD"; + case X86ISD::MOVSS: return "X86ISD::MOVSS"; + case X86ISD::UNPCKLPS: return "X86ISD::UNPCKLPS"; + case X86ISD::UNPCKLPD: return "X86ISD::UNPCKLPD"; + case X86ISD::UNPCKHPS: return "X86ISD::UNPCKHPS"; + case X86ISD::UNPCKHPD: return "X86ISD::UNPCKHPD"; + case X86ISD::PUNPCKLBW: return "X86ISD::PUNPCKLBW"; + case X86ISD::PUNPCKLWD: return "X86ISD::PUNPCKLWD"; + case X86ISD::PUNPCKLDQ: return "X86ISD::PUNPCKLDQ"; + case X86ISD::PUNPCKLQDQ: return "X86ISD::PUNPCKLQDQ"; + case X86ISD::PUNPCKHBW: return "X86ISD::PUNPCKHBW"; + case X86ISD::PUNPCKHWD: return "X86ISD::PUNPCKHWD"; + case X86ISD::PUNPCKHDQ: return "X86ISD::PUNPCKHDQ"; + case X86ISD::PUNPCKHQDQ: return "X86ISD::PUNPCKHQDQ"; case X86ISD::VASTART_SAVE_XMM_REGS: return "X86ISD::VASTART_SAVE_XMM_REGS"; case X86ISD::MINGW_ALLOCA: return "X86ISD::MINGW_ALLOCA"; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=111691&r1=111690&r2=111691&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Fri Aug 20 17:55:05 2010 @@ -251,6 +251,43 @@ // TESTP - Vector packed fp sign bitwise comparisons TESTP, + // Several flavors of instructions with vector shuffle behaviors. + PALIGN, + PSHUFD, + PSHUFHW, + PSHUFLW, + PSHUFHW_LD, + PSHUFLW_LD, + SHUFPD, + SHUFPS, + MOVDDUP, + MOVSHDUP, + MOVSLDUP, + MOVSHDUP_LD, + MOVSLDUP_LD, + MOVLHPS, + MOVHLPS, + MOVLHPD, + MOVHLPD, + MOVHPS, + MOVHPD, + MOVLPS, + MOVLPD, + MOVSD, + MOVSS, + UNPCKLPS, + UNPCKLPD, + UNPCKHPS, + UNPCKHPD, + PUNPCKLBW, + PUNPCKLWD, + PUNPCKLDQ, + PUNPCKLQDQ, + PUNPCKHBW, + PUNPCKHWD, + PUNPCKHDQ, + PUNPCKHQDQ, + // VASTART_SAVE_XMM_REGS - Save xmm argument registers to the stack, // according to %al. An operator is needed so that this can be expanded // with control flow. Modified: llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td?rev=111691&r1=111690&r2=111691&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td Fri Aug 20 17:55:05 2010 @@ -122,6 +122,78 @@ def X86ptest : SDNode<"X86ISD::PTEST", SDTX86CmpPTest>; def X86testp : SDNode<"X86ISD::TESTP", SDTX86CmpPTest>; +// Specific shuffle nodes - At some point ISD::VECTOR_SHUFFLE will always get +// translated into one of the target nodes below during lowering. +// Note: this is a work in progress... +def SDTShuff1Op : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0,1>]>; +def SDTShuff2Op : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0,1>, + SDTCisSameAs<0,2>]>; + +def SDTShuff2OpI : SDTypeProfile<1, 2, [SDTCisVec<0>, + SDTCisSameAs<0,1>, SDTCisInt<2>]>; +def SDTShuff3OpI : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0,1>, + SDTCisSameAs<0,2>, SDTCisInt<3>]>; + +def SDTShuff1OpLd : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisPtrTy<1>]>; +def SDTShuff2OpLd : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0,1>, + SDTCisPtrTy<2>]>; + +def SDTShuff2OpLdI : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisPtrTy<1>, + SDTCisInt<2>]>; + +def X86PAlign : SDNode<"X86ISD::PALIGN", SDTShuff3OpI>; + +def X86PShufd : SDNode<"X86ISD::PSHUFD", SDTShuff2OpI>; +def X86PShufhw : SDNode<"X86ISD::PSHUFHW", SDTShuff2OpI>; +def X86PShuflw : SDNode<"X86ISD::PSHUFLW", SDTShuff2OpI>; + +def X86PShufhwLd : SDNode<"X86ISD::PSHUFHW_LD", SDTShuff2OpLdI>; +def X86PShuflwLd : SDNode<"X86ISD::PSHUFLW_LD", SDTShuff2OpLdI>; + +def X86Shufpd : SDNode<"X86ISD::SHUFPD", SDTShuff3OpI>; +def X86Shufps : SDNode<"X86ISD::SHUFPS", SDTShuff3OpI>; + +def X86Movddup : SDNode<"X86ISD::MOVDDUP", SDTShuff1Op>; +def X86Movshdup : SDNode<"X86ISD::MOVSHDUP", SDTShuff1Op>; +def X86Movsldup : SDNode<"X86ISD::MOVSLDUP", SDTShuff1Op>; + +def X86MovshdupLd : SDNode<"X86ISD::MOVSHDUP_LD", SDTShuff1OpLd, + [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; +def X86MovsldupLd : SDNode<"X86ISD::MOVSLDUP_LD", SDTShuff1OpLd, + [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; + +def X86Movsd : SDNode<"X86ISD::MOVSD", SDTShuff2Op>; +def X86Movss : SDNode<"X86ISD::MOVSS", SDTShuff2Op>; + +def X86Movlhps : SDNode<"X86ISD::MOVLHPS", SDTShuff2Op>; +def X86Movhlps : SDNode<"X86ISD::MOVHLPS", SDTShuff2Op>; +def X86Movlhpd : SDNode<"X86ISD::MOVLHPD", SDTShuff2Op>; +def X86Movhlpd : SDNode<"X86ISD::MOVHLPD", SDTShuff2Op>; + +def X86MovhpsLd : SDNode<"X86ISD::MOVHPS", SDTShuff2OpLd, + [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; +def X86MovhpdLd : SDNode<"X86ISD::MOVHPD", SDTShuff2OpLd, + [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; +def X86MovlpsLd : SDNode<"X86ISD::MOVLPS", SDTShuff2OpLd, + [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; +def X86MovlpdLd : SDNode<"X86ISD::MOVLPD", SDTShuff2OpLd, + [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; + +def X86Unpcklps : SDNode<"X86ISD::UNPCKLPS", SDTShuff2Op>; +def X86Unpcklpd : SDNode<"X86ISD::UNPCKLPD", SDTShuff2Op>; +def X86Unpckhps : SDNode<"X86ISD::UNPCKHPS", SDTShuff2Op>; +def X86Unpckhpd : SDNode<"X86ISD::UNPCKHPD", SDTShuff2Op>; + +def X86Punpcklbw : SDNode<"X86ISD::PUNPCKLBW", SDTShuff2Op>; +def X86Punpcklwd : SDNode<"X86ISD::PUNPCKLWD", SDTShuff2Op>; +def X86Punpckldq : SDNode<"X86ISD::PUNPCKLDQ", SDTShuff2Op>; +def X86Punpcklqdq : SDNode<"X86ISD::PUNPCKLQDQ", SDTShuff2Op>; + +def X86Punpckhbw : SDNode<"X86ISD::PUNPCKHBW", SDTShuff2Op>; +def X86Punpckhwd : SDNode<"X86ISD::PUNPCKHWD", SDTShuff2Op>; +def X86Punpckhdq : SDNode<"X86ISD::PUNPCKHDQ", SDTShuff2Op>; +def X86Punpckhqdq : SDNode<"X86ISD::PUNPCKHQDQ", SDTShuff2Op>; + //===----------------------------------------------------------------------===// // SSE Complex Patterns //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=111691&r1=111690&r2=111691&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Fri Aug 20 17:55:05 2010 @@ -5585,3 +5585,352 @@ VR256:$src1, (memopv8i32 addr:$src2), imm:$src3), (VPERM2F128rm VR256:$src1, addr:$src2, imm:$src3)>; +//===----------------------------------------------------------------------===// +// SSE Shuffle pattern fragments +//===----------------------------------------------------------------------===// + +// This is part of a "work in progress" refactoring. The idea is that all +// vector shuffles are going to be translated into target specific nodes and +// directly matched by the patterns below (which can be changed along the way) +// The AVX version of some but not all of them are described here, and more +// should come in a near future. + +// Shuffle with PSHUFD instruction folding loads. The first two patterns match +// SSE2 loads, which are always promoted to v2i64. The last one should match +// the SSE1 case, where the only legal load is v4f32, but there is no PSHUFD +// in SSE2, how does it ever worked? Anyway, the pattern will remain here until +// we investigate further. +def : Pat<(v4i32 (X86PShufd (bc_v4i32 (memopv2i64 addr:$src1)), + (i8 imm:$imm))), + (VPSHUFDmi addr:$src1, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4i32 (X86PShufd (bc_v4i32 (memopv2i64 addr:$src1)), + (i8 imm:$imm))), + (PSHUFDmi addr:$src1, imm:$imm)>; +def : Pat<(v4i32 (X86PShufd (bc_v4i32 (memopv4f32 addr:$src1)), + (i8 imm:$imm))), + (PSHUFDmi addr:$src1, imm:$imm)>; // FIXME: has this ever worked? + +// Shuffle with PSHUFD instruction. +def : Pat<(v4f32 (X86PShufd VR128:$src1, (i8 imm:$imm))), + (VPSHUFDri VR128:$src1, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86PShufd VR128:$src1, (i8 imm:$imm))), + (PSHUFDri VR128:$src1, imm:$imm)>; + +def : Pat<(v4i32 (X86PShufd VR128:$src1, (i8 imm:$imm))), + (VPSHUFDri VR128:$src1, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4i32 (X86PShufd VR128:$src1, (i8 imm:$imm))), + (PSHUFDri VR128:$src1, imm:$imm)>; + +// Shuffle with SHUFPD instruction. +def : Pat<(v2f64 (X86Shufps VR128:$src1, + (memopv2f64 addr:$src2), (i8 imm:$imm))), + (VSHUFPDrmi VR128:$src1, addr:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v2f64 (X86Shufps VR128:$src1, + (memopv2f64 addr:$src2), (i8 imm:$imm))), + (SHUFPDrmi VR128:$src1, addr:$src2, imm:$imm)>; + +def : Pat<(v2i64 (X86Shufpd VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (VSHUFPDrri VR128:$src1, VR128:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v2i64 (X86Shufpd VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (SHUFPDrri VR128:$src1, VR128:$src2, imm:$imm)>; + +def : Pat<(v2f64 (X86Shufpd VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (VSHUFPDrri VR128:$src1, VR128:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v2f64 (X86Shufpd VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (SHUFPDrri VR128:$src1, VR128:$src2, imm:$imm)>; + +// Shuffle with SHUFPS instruction. +def : Pat<(v4f32 (X86Shufps VR128:$src1, + (memopv4f32 addr:$src2), (i8 imm:$imm))), + (VSHUFPSrmi VR128:$src1, addr:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Shufps VR128:$src1, + (memopv4f32 addr:$src2), (i8 imm:$imm))), + (SHUFPSrmi VR128:$src1, addr:$src2, imm:$imm)>; + +def : Pat<(v4f32 (X86Shufps VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (VSHUFPSrri VR128:$src1, VR128:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Shufps VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (SHUFPSrri VR128:$src1, VR128:$src2, imm:$imm)>; + +def : Pat<(v4i32 (X86Shufps VR128:$src1, + (bc_v4i32 (memopv2i64 addr:$src2)), (i8 imm:$imm))), + (VSHUFPSrmi VR128:$src1, addr:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4i32 (X86Shufps VR128:$src1, + (bc_v4i32 (memopv2i64 addr:$src2)), (i8 imm:$imm))), + (SHUFPSrmi VR128:$src1, addr:$src2, imm:$imm)>; + +def : Pat<(v4i32 (X86Shufps VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (VSHUFPSrri VR128:$src1, VR128:$src2, imm:$imm)>, Requires<[HasAVX]>; +def : Pat<(v4i32 (X86Shufps VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (SHUFPSrri VR128:$src1, VR128:$src2, imm:$imm)>; + +// Shuffle with MOVLHPS instruction +def : Pat<(v4f32 (X86Movlhps VR128:$src1, VR128:$src2)), + (VMOVLHPSrr (v4f32 VR128:$src1), VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Movlhps VR128:$src1, VR128:$src2)), + (MOVLHPSrr (v4f32 VR128:$src1), VR128:$src2)>; + +def : Pat<(v2i64 (X86Movlhps VR128:$src1, VR128:$src2)), + (VMOVLHPSrr (v2i64 VR128:$src1), VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v2i64 (X86Movlhps VR128:$src1, VR128:$src2)), + (MOVLHPSrr (v2i64 VR128:$src1), VR128:$src2)>; + +def : Pat<(v4i32 (X86Movlhps VR128:$src1, VR128:$src2)), + (VMOVLHPSrr VR128:$src1, VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v4i32 (X86Movlhps VR128:$src1, VR128:$src2)), + (MOVLHPSrr VR128:$src1, VR128:$src2)>; + +// Shuffle with MOVHLPS instruction +def : Pat<(v4f32 (X86Movhlps VR128:$src1, VR128:$src2)), + (MOVHLPSrr VR128:$src1, VR128:$src2)>; +def : Pat<(v4i32 (X86Movhlps VR128:$src1, VR128:$src2)), + (MOVHLPSrr VR128:$src1, VR128:$src2)>; + +// Shuffle with MOVDDUP instruction +def : Pat<(X86Movddup (memopv2f64 addr:$src)), + (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>; +def : Pat<(X86Movddup (memopv2f64 addr:$src)), + (MOVDDUPrm addr:$src)>; + +def : Pat<(X86Movddup (bc_v4f32 (memopv2f64 addr:$src))), + (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>; +def : Pat<(X86Movddup (bc_v4f32 (memopv2f64 addr:$src))), + (MOVDDUPrm addr:$src)>; + +def : Pat<(X86Movddup (memopv2i64 addr:$src)), + (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>; +def : Pat<(X86Movddup (memopv2i64 addr:$src)), + (MOVDDUPrm addr:$src)>; + +def : Pat<(X86Movddup (bc_v4i32 (memopv2i64 addr:$src))), + (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>; +def : Pat<(X86Movddup (bc_v4i32 (memopv2i64 addr:$src))), + (MOVDDUPrm addr:$src)>; + +def : Pat<(X86Movddup (v2f64 (scalar_to_vector (loadf64 addr:$src)))), + (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>; +def : Pat<(X86Movddup (v2f64 (scalar_to_vector (loadf64 addr:$src)))), + (MOVDDUPrm addr:$src)>; + +def : Pat<(X86Movddup (bc_v2f64 + (v2i64 (scalar_to_vector (loadi64 addr:$src))))), + (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>; +def : Pat<(X86Movddup (bc_v2f64 + (v2i64 (scalar_to_vector (loadi64 addr:$src))))), + (MOVDDUPrm addr:$src)>; + +// Shuffle with UNPCKLPS +def : Pat<(v4f32 (X86Unpcklps VR128:$src1, (memopv4f32 addr:$src2))), + (VUNPCKLPSrm VR128:$src1, addr:$src2)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Unpcklps VR128:$src1, (memopv4f32 addr:$src2))), + (UNPCKLPSrm VR128:$src1, addr:$src2)>; + +def : Pat<(v4f32 (X86Unpcklps VR128:$src1, VR128:$src2)), + (VUNPCKLPSrr VR128:$src1, VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Unpcklps VR128:$src1, VR128:$src2)), + (UNPCKLPSrr VR128:$src1, VR128:$src2)>; + +// Shuffle with UNPCKHPS +def : Pat<(v4f32 (X86Unpckhps VR128:$src1, (memopv4f32 addr:$src2))), + (VUNPCKHPSrm VR128:$src1, addr:$src2)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Unpckhps VR128:$src1, (memopv4f32 addr:$src2))), + (UNPCKHPSrm VR128:$src1, addr:$src2)>; + +def : Pat<(v4f32 (X86Unpckhps VR128:$src1, VR128:$src2)), + (VUNPCKHPSrr VR128:$src1, VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v4f32 (X86Unpckhps VR128:$src1, VR128:$src2)), + (UNPCKHPSrr VR128:$src1, VR128:$src2)>; + +// Shuffle with UNPCKLPD +def : Pat<(v2f64 (X86Unpcklpd VR128:$src1, (memopv2f64 addr:$src2))), + (VUNPCKLPSrm VR128:$src1, addr:$src2)>, Requires<[HasAVX]>; +def : Pat<(v2f64 (X86Unpcklpd VR128:$src1, (memopv2f64 addr:$src2))), + (UNPCKLPSrm VR128:$src1, addr:$src2)>; + +def : Pat<(v2f64 (X86Unpcklpd VR128:$src1, VR128:$src2)), + (VUNPCKLPDrr VR128:$src1, VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v2f64 (X86Unpcklpd VR128:$src1, VR128:$src2)), + (UNPCKLPDrr VR128:$src1, VR128:$src2)>; + +// Shuffle with UNPCKHPD +def : Pat<(v2f64 (X86Unpckhpd VR128:$src1, (memopv2f64 addr:$src2))), + (VUNPCKLPSrm VR128:$src1, addr:$src2)>, Requires<[HasAVX]>; +def : Pat<(v2f64 (X86Unpckhpd VR128:$src1, (memopv2f64 addr:$src2))), + (UNPCKLPSrm VR128:$src1, addr:$src2)>; + +def : Pat<(v2f64 (X86Unpckhpd VR128:$src1, VR128:$src2)), + (VUNPCKHPDrr VR128:$src1, VR128:$src2)>, Requires<[HasAVX]>; +def : Pat<(v2f64 (X86Unpckhpd VR128:$src1, VR128:$src2)), + (UNPCKHPDrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKLBW +def : Pat<(v16i8 (X86Punpcklbw VR128:$src1, + (bc_v16i8 (memopv2i64 addr:$src2)))), + (PUNPCKLBWrm VR128:$src1, addr:$src2)>; +def : Pat<(v16i8 (X86Punpcklbw VR128:$src1, VR128:$src2)), + (PUNPCKLBWrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKLWD +def : Pat<(v8i16 (X86Punpcklwd VR128:$src1, + (bc_v8i16 (memopv2i64 addr:$src2)))), + (PUNPCKLWDrm VR128:$src1, addr:$src2)>; +def : Pat<(v8i16 (X86Punpcklwd VR128:$src1, VR128:$src2)), + (PUNPCKLWDrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKLDQ +def : Pat<(v4i32 (X86Punpckldq VR128:$src1, + (bc_v4i32 (memopv2i64 addr:$src2)))), + (PUNPCKLDQrm VR128:$src1, addr:$src2)>; +def : Pat<(v4i32 (X86Punpckldq VR128:$src1, VR128:$src2)), + (PUNPCKLDQrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKLQDQ +def : Pat<(v2i64 (X86Punpcklqdq VR128:$src1, (memopv2i64 addr:$src2))), + (PUNPCKLQDQrm VR128:$src1, addr:$src2)>; +def : Pat<(v2i64 (X86Punpcklqdq VR128:$src1, VR128:$src2)), + (PUNPCKLQDQrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKHBW +def : Pat<(v16i8 (X86Punpckhbw VR128:$src1, + (bc_v16i8 (memopv2i64 addr:$src2)))), + (PUNPCKHBWrm VR128:$src1, addr:$src2)>; +def : Pat<(v16i8 (X86Punpckhbw VR128:$src1, VR128:$src2)), + (PUNPCKHBWrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKHWD +def : Pat<(v8i16 (X86Punpckhwd VR128:$src1, + (bc_v8i16 (memopv2i64 addr:$src2)))), + (PUNPCKHWDrm VR128:$src1, addr:$src2)>; +def : Pat<(v8i16 (X86Punpckhwd VR128:$src1, VR128:$src2)), + (PUNPCKHWDrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKHDQ +def : Pat<(v4i32 (X86Punpckhdq VR128:$src1, + (bc_v4i32 (memopv2i64 addr:$src2)))), + (PUNPCKHDQrm VR128:$src1, addr:$src2)>; +def : Pat<(v4i32 (X86Punpckhdq VR128:$src1, VR128:$src2)), + (PUNPCKHDQrr VR128:$src1, VR128:$src2)>; + +// Shuffle with PUNPCKHQDQ +def : Pat<(v2i64 (X86Punpckhqdq VR128:$src1, (memopv2i64 addr:$src2))), + (PUNPCKHQDQrm VR128:$src1, addr:$src2)>; +def : Pat<(v2i64 (X86Punpckhqdq VR128:$src1, VR128:$src2)), + (PUNPCKHQDQrr VR128:$src1, VR128:$src2)>; + +// Shuffle with MOVHPS +def : Pat<(v4f32 (X86MovhpsLd VR128:$src1, addr:$src2)), + (MOVHPSrm VR128:$src1, addr:$src2)>; +def : Pat<(v4i32 (X86MovhpsLd VR128:$src1, addr:$src2)), + (MOVHPSrm VR128:$src1, addr:$src2)>; + +// Shuffle with MOVHPD +def : Pat<(v2f64 (X86MovhpdLd VR128:$src1, addr:$src2)), + (MOVHPDrm VR128:$src1, addr:$src2)>; + +// Shuffle with MOVLPS +def : Pat<(v4f32 (X86MovlpsLd VR128:$src1, addr:$src2)), + (MOVLPSrm VR128:$src1, addr:$src2)>; +def : Pat<(v4i32 (X86MovlpsLd VR128:$src1, addr:$src2)), + (MOVLPSrm VR128:$src1, addr:$src2)>; + +// Shuffle with MOVLPD +def : Pat<(v2f64 (X86MovlpdLd VR128:$src1, addr:$src2)), + (MOVLPDrm VR128:$src1, addr:$src2)>; +def : Pat<(v2i64 (X86MovlpdLd VR128:$src1, addr:$src2)), + (MOVLPDrm VR128:$src1, addr:$src2)>; + +// Shuffle with MOVSS +def : Pat<(v4f32 (X86Movss VR128:$src1, (scalar_to_vector FR32:$src2))), + (MOVSSrr VR128:$src1, FR32:$src2)>; +def : Pat<(v4i32 (X86Movss VR128:$src1, VR128:$src2)), + (MOVSSrr (v4i32 VR128:$src1), + (EXTRACT_SUBREG (v4i32 VR128:$src2), sub_ss))>; +def : Pat<(v4f32 (X86Movss VR128:$src1, VR128:$src2)), + (MOVSSrr (v4f32 VR128:$src1), + (EXTRACT_SUBREG (v4f32 VR128:$src2), sub_ss))>; + +// Shuffle with MOVSD +def : Pat<(v2f64 (X86Movsd VR128:$src1, (scalar_to_vector FR64:$src2))), + (MOVSDrr VR128:$src1, FR64:$src2)>; +def : Pat<(v2i64 (X86Movsd VR128:$src1, VR128:$src2)), + (MOVSDrr (v2i64 VR128:$src1), + (EXTRACT_SUBREG (v2i64 VR128:$src2), sub_sd))>; +def : Pat<(v2f64 (X86Movsd VR128:$src1, VR128:$src2)), + (MOVSDrr (v2f64 VR128:$src1), + (EXTRACT_SUBREG (v2f64 VR128:$src2), sub_sd))>; +def : Pat<(v4f32 (X86Movsd VR128:$src1, VR128:$src2)), + (MOVSDrr VR128:$src1, (EXTRACT_SUBREG VR128:$src2, sub_sd))>; +def : Pat<(v4i32 (X86Movsd VR128:$src1, VR128:$src2)), + (MOVSDrr VR128:$src1, (EXTRACT_SUBREG VR128:$src2, sub_sd))>; + +// Shuffle with MOVSHDUP +def : Pat<(v4i32 (X86Movshdup VR128:$src)), + (MOVSHDUPrr VR128:$src)>; +def : Pat<(v4i32 (X86MovshdupLd addr:$src)), + (MOVSHDUPrm addr:$src)>; + +def : Pat<(v4f32 (X86Movshdup VR128:$src)), + (MOVSHDUPrr VR128:$src)>; +def : Pat<(v4f32 (X86MovshdupLd addr:$src)), + (MOVSHDUPrm addr:$src)>; + +// Shuffle with MOVSLDUP +def : Pat<(v4i32 (X86Movsldup VR128:$src)), + (MOVSLDUPrr VR128:$src)>; +def : Pat<(v4i32 (X86MovsldupLd addr:$src)), + (MOVSLDUPrm addr:$src)>; + +def : Pat<(v4f32 (X86Movsldup VR128:$src)), + (MOVSLDUPrr VR128:$src)>; +def : Pat<(v4f32 (X86MovsldupLd addr:$src)), + (MOVSLDUPrm addr:$src)>; + +// Shuffle with PSHUFHW +def : Pat<(v8i16 (X86PShufhwLd addr:$src, (i8 imm:$imm))), + (PSHUFHWmi addr:$src, imm:$imm)>; +def : Pat<(v8i16 (X86PShufhw VR128:$src, (i8 imm:$imm))), + (PSHUFHWri VR128:$src, imm:$imm)>; + +// Shuffle with PSHUFLW +def : Pat<(v8i16 (X86PShuflwLd addr:$src, (i8 imm:$imm))), + (PSHUFLWmi addr:$src, imm:$imm)>; +def : Pat<(v8i16 (X86PShuflw VR128:$src, (i8 imm:$imm))), + (PSHUFLWri VR128:$src, imm:$imm)>; + +// Shuffle with PALIGN +def : Pat<(v1i64 (X86PAlign VR64:$src1, VR64:$src2, (i8 imm:$imm))), + (PALIGNR64rr VR64:$src2, VR64:$src1, imm:$imm)>; +def : Pat<(v2i32 (X86PAlign VR64:$src1, VR64:$src2, (i8 imm:$imm))), + (PALIGNR64rr VR64:$src2, VR64:$src1, imm:$imm)>; +def : Pat<(v4i16 (X86PAlign VR64:$src1, VR64:$src2, (i8 imm:$imm))), + (PALIGNR64rr VR64:$src2, VR64:$src1, imm:$imm)>; +def : Pat<(v8i8 (X86PAlign VR64:$src1, VR64:$src2, (i8 imm:$imm))), + (PALIGNR64rr VR64:$src2, VR64:$src1, imm:$imm)>; + +def : Pat<(v4i32 (X86PAlign VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (PALIGNR128rr VR128:$src2, VR128:$src1, imm:$imm)>; +def : Pat<(v4f32 (X86PAlign VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (PALIGNR128rr VR128:$src2, VR128:$src1, imm:$imm)>; +def : Pat<(v8i16 (X86PAlign VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (PALIGNR128rr VR128:$src2, VR128:$src1, imm:$imm)>; +def : Pat<(v16i8 (X86PAlign VR128:$src1, VR128:$src2, (i8 imm:$imm))), + (PALIGNR128rr VR128:$src2, VR128:$src1, imm:$imm)>; + +// Extra patterns to match stores +def : Pat<(store (f64 (vector_extract + (v2f64 (X86Unpckhps VR128:$src, (undef))), (iPTR 0))),addr:$dst), + (MOVHPSmr addr:$dst, VR128:$src)>; +def : Pat<(store (f64 (vector_extract + (v2f64 (X86Unpckhpd VR128:$src, (undef))), (iPTR 0))),addr:$dst), + (MOVHPDmr addr:$dst, VR128:$src)>; + +def : Pat<(store (v2f64 (X86MovlpdLd VR128:$src1, addr:$src2)),addr:$src2), + (MOVLPDmr addr:$src2, VR128:$src1)>; +def : Pat<(store (v2i64 (X86MovlpdLd VR128:$src1, addr:$src2)),addr:$src2), + (MOVLPDmr addr:$src2, VR128:$src1)>; + +def : Pat<(store (v4f32 (X86MovlpsLd VR128:$src1, addr:$src2)),addr:$src2), + (MOVLPSmr addr:$src2, VR128:$src1)>; +def : Pat<(store (v4i32 (X86MovlpsLd VR128:$src1, addr:$src2)),addr:$src2), + (MOVLPSmr addr:$src2, VR128:$src1)>; + From echristo at apple.com Fri Aug 20 18:08:36 2010 From: echristo at apple.com (Eric Christopher) Date: Fri, 20 Aug 2010 23:08:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111694 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Message-ID: <20100820230837.064822A6C12C@llvm.org> Author: echristo Date: Fri Aug 20 18:08:36 2010 New Revision: 111694 URL: http://llvm.org/viewvc/llvm-project?rev=111694&view=rev Log: Fix redefinition of Ty per C++ [stmt.select] p3. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=111694&r1=111693&r2=111694&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Fri Aug 20 18:08:36 2010 @@ -790,18 +790,18 @@ case POINTER_TYPE: case REFERENCE_TYPE: case BLOCK_POINTER_TYPE: - if (const PointerType *Ty = cast_or_null(GET_TYPE_LLVM(type))){ + if (const PointerType *PTy = cast_or_null(GET_TYPE_LLVM(type))){ // We already converted this type. If this isn't a case where we have to // reparse it, just return it. if (PointersToReresolve.empty() || PointersToReresolve.back() != type || ConvertingStruct) - return Ty; + return PTy; // Okay, we know that we're !ConvertingStruct and that type is on the end // of the vector. Remove this entry from the PointersToReresolve list and // get the pointee type. Note that this order is important in case the // pointee type uses this pointer. - assert(Ty->getElementType()->isOpaqueTy() && "Not a deferred ref!"); + assert(PTy->getElementType()->isOpaqueTy() && "Not a deferred ref!"); // We are actively resolving this pointer. We want to pop this value from // the stack, as we are no longer resolving it. However, we don't want to @@ -816,7 +816,7 @@ // Note that we know that Ty cannot be resolved or invalidated here. const Type *Actual = ConvertType(TREE_TYPE(type)); - assert(GET_TYPE_LLVM(type) == Ty && "Pointer invalidated!"); + assert(GET_TYPE_LLVM(type) == PTy && "Pointer invalidated!"); // Restore ConvertingStruct for the caller. ConvertingStruct = false; @@ -825,7 +825,7 @@ Actual = Type::getInt8Ty(Context); // void* -> sbyte* // Update the type, potentially updating TYPE_LLVM(type). - const OpaqueType *OT = cast(Ty->getElementType()); + const OpaqueType *OT = cast(PTy->getElementType()); const_cast(OT)->refineAbstractTypeTo(Actual); return GET_TYPE_LLVM(type); } else { From echristo at apple.com Fri Aug 20 18:08:57 2010 From: echristo at apple.com (Eric Christopher) Date: Fri, 20 Aug 2010 23:08:57 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r111695 - /llvm-gcc-4.2/trunk/gcc/llvm-main.cpp Message-ID: <20100820230857.7A6B82A6C12C@llvm.org> Author: echristo Date: Fri Aug 20 18:08:57 2010 New Revision: 111695 URL: http://llvm.org/viewvc/llvm-project?rev=111695&view=rev Log: Unused arg warning. Modified: llvm-gcc-4.2/trunk/gcc/llvm-main.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-main.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-main.cpp?rev=111695&r1=111694&r2=111695&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-main.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-main.cpp Fri Aug 20 18:08:57 2010 @@ -33,7 +33,7 @@ extern const char *progname; } -static void LLVMErrorHandler(void *UserData, const std::string &Message) { +static void LLVMErrorHandler(void *, const std::string &Message) { fprintf(stderr, "%s: error in backend: %s\n", progname, Message.c_str()); exit(FATAL_EXIT_CODE); } From bob.wilson at apple.com Fri Aug 20 18:22:44 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Fri, 20 Aug 2010 23:22:44 -0000 Subject: [llvm-commits] [llvm] r111696 - /llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Message-ID: <20100820232244.0D8812A6C12C@llvm.org> Author: bwilson Date: Fri Aug 20 18:22:43 2010 New Revision: 111696 URL: http://llvm.org/viewvc/llvm-project?rev=111696&view=rev Log: Replace some NEON vmovl intrinsic that I missed earlier. Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Modified: llvm/trunk/test/CodeGen/ARM/reg_sequence.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/reg_sequence.ll?rev=111696&r1=111695&r2=111696&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/reg_sequence.ll (original) +++ llvm/trunk/test/CodeGen/ARM/reg_sequence.ll Fri Aug 20 18:22:43 2010 @@ -27,10 +27,10 @@ %6 = bitcast <8 x i16> %5 to <2 x double> ; <<2 x double>> [#uses=2] %7 = extractelement <2 x double> %6, i32 0 ; [#uses=1] %8 = bitcast double %7 to <4 x i16> ; <<4 x i16>> [#uses=1] - %9 = tail call <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16> %8) ; <<4 x i32>> [#uses=1] + %9 = sext <4 x i16> %8 to <4 x i32> ; <<4 x i32>> [#uses=1] %10 = extractelement <2 x double> %6, i32 1 ; [#uses=1] %11 = bitcast double %10 to <4 x i16> ; <<4 x i16>> [#uses=1] - %12 = tail call <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16> %11) ; <<4 x i32>> [#uses=1] + %12 = sext <4 x i16> %11 to <4 x i32> ; <<4 x i32>> [#uses=1] %13 = mul <4 x i32> %1, %9 ; <<4 x i32>> [#uses=1] %14 = mul <4 x i32> %3, %12 ; <<4 x i32>> [#uses=1] %15 = tail call <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32> %13, <4 x i32> ) ; <<4 x i16>> [#uses=1] @@ -323,8 +323,6 @@ declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*) nounwind readonly -declare <4 x i32> @llvm.arm.neon.vmovls.v4i32(<4 x i16>) nounwind readnone - declare <4 x i16> @llvm.arm.neon.vshiftn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone declare void @llvm.arm.neon.vst1.v4i32(i8*, <4 x i32>) nounwind From clattner at apple.com Fri Aug 20 19:40:25 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Aug 2010 17:40:25 -0700 Subject: [llvm-commits] [llvm] r111681 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/Metadata.h lib/Analysis/DebugInfo.cpp lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/Metadata.cpp In-Reply-To: <20100820220226.EB8C22A6C12C@llvm.org> References: <20100820220226.EB8C22A6C12C@llvm.org> Message-ID: On Aug 20, 2010, at 3:02 PM, Dan Gohman wrote: > Author: djg > Date: Fri Aug 20 17:02:26 2010 > New Revision: 111681 > > URL: http://llvm.org/viewvc/llvm-project?rev=111681&view=rev > Log: > Introduce a new temporary MDNode concept. Temporary MDNodes are > not part of the IR, are not uniqued, and may be safely RAUW'd. > This replaces a variety of alternate mechanisms for achieving > the same effect. Very nice! Is it possible to make RAUW assert that the thing being replaced with is not a uniqued MDNode now? -Chris From clattner at apple.com Fri Aug 20 19:43:22 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Aug 2010 17:43:22 -0700 Subject: [llvm-commits] [llvm] r111595 - in /llvm/trunk: include/llvm/Support/FormattedStream.h include/llvm/Support/raw_ostream.h lib/Support/FormattedStream.cpp lib/Support/raw_ostream.cpp In-Reply-To: <20100820004810.878BF2A6C12C@llvm.org> References: <20100820004810.878BF2A6C12C@llvm.org> Message-ID: On Aug 19, 2010, at 5:48 PM, Dan Gohman wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=111595&view=rev > Log: > Introduce a new tool_output_file class, which extends raw_ostream with > functionality that most command-line tools need: ensuring that the > output file gets deleted if the tool is interrupted or encounters an > error. I embrace factoring out this code, but it doesn't seem like this "isa" raw_ostream. This seems like it should contain one instead. What do you think? -Chris From clattner at apple.com Fri Aug 20 19:45:43 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 20 Aug 2010 17:45:43 -0700 Subject: [llvm-commits] [llvm] r111643 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: <20100820164456.60A772A6C12C@llvm.org> References: <20100820164456.60A772A6C12C@llvm.org> Message-ID: On Aug 20, 2010, at 9:44 AM, Dan Gohman wrote: > Author: djg > Date: Fri Aug 20 11:44:56 2010 > New Revision: 111643 > > URL: http://llvm.org/viewvc/llvm-project?rev=111643&view=rev > Log: > Make outs() close its file when its stream is destructed, so that > pending output errors are detected. I don't get this. This means that any evaluation (e.g. in a library) of outs() will dramatically change the behavior of the program it is embedded into. This is non-obvious and seems really really dangerous. -Chris > > Modified: > llvm/trunk/lib/Support/raw_ostream.cpp > > Modified: llvm/trunk/lib/Support/raw_ostream.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111643&r1=111642&r2=111643&view=diff > ============================================================================== > --- llvm/trunk/lib/Support/raw_ostream.cpp (original) > +++ llvm/trunk/lib/Support/raw_ostream.cpp Fri Aug 20 11:44:56 2010 > @@ -540,14 +540,16 @@ > } > > //===----------------------------------------------------------------------===// > -// raw_stdout/err_ostream > +// outs(), errs(), nulls() > //===----------------------------------------------------------------------===// > > /// outs() - This returns a reference to a raw_ostream for standard output. > /// Use it like: outs() << "foo" << "bar"; > raw_ostream &llvm::outs() { > // Set buffer settings to model stdout behavior. > - static raw_fd_ostream S(STDOUT_FILENO, false); > + // Delete the file descriptor when the program exists, forcing error > + // detection. If you don't want this behavior, don't use outs(). > + static raw_fd_ostream S(STDOUT_FILENO, true); > return S; > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From bruno.cardoso at gmail.com Fri Aug 20 20:32:18 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Sat, 21 Aug 2010 01:32:18 -0000 Subject: [llvm-commits] [llvm] r111704 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h Message-ID: <20100821013218.7B5452A6C12C@llvm.org> Author: bruno Date: Fri Aug 20 20:32:18 2010 New Revision: 111704 URL: http://llvm.org/viewvc/llvm-project?rev=111704&view=rev Log: Prepare LowerVECTOR_SHUFFLEv8i16 to use x86 target specific nodes directly Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=111704&r1=111703&r2=111704&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Aug 20 20:32:18 2010 @@ -4151,10 +4151,10 @@ // 2. [ssse3] 1 x pshufb // 3. [ssse3] 2 x pshufb + 1 x por // 4. [all] mov + pshuflw + pshufhw + N x (pextrw + pinsrw) -static -SDValue LowerVECTOR_SHUFFLEv8i16(ShuffleVectorSDNode *SVOp, - SelectionDAG &DAG, - const X86TargetLowering &TLI) { +SDValue +X86TargetLowering::LowerVECTOR_SHUFFLEv8i16(SDValue Op, + SelectionDAG &DAG) const { + ShuffleVectorSDNode *SVOp = cast(Op); SDValue V1 = SVOp->getOperand(0); SDValue V2 = SVOp->getOperand(1); DebugLoc dl = SVOp->getDebugLoc(); @@ -4205,7 +4205,7 @@ // quads, disable the next transformation since it does not help SSSE3. bool V1Used = InputQuads[0] || InputQuads[1]; bool V2Used = InputQuads[2] || InputQuads[3]; - if (TLI.getSubtarget()->hasSSSE3()) { + if (Subtarget->hasSSSE3()) { if (InputQuads.count() == 2 && V1Used && V2Used) { BestLoQuad = InputQuads.find_first(); BestHiQuad = InputQuads.find_next(BestLoQuad); @@ -4227,6 +4227,8 @@ NewV = DAG.getVectorShuffle(MVT::v2i64, dl, DAG.getNode(ISD::BIT_CONVERT, dl, MVT::v2i64, V1), DAG.getNode(ISD::BIT_CONVERT, dl, MVT::v2i64, V2), &MaskV[0]); + if (NewV.getOpcode() == ISD::VECTOR_SHUFFLE) + NewV = LowerVECTOR_SHUFFLE(NewV, DAG); NewV = DAG.getNode(ISD::BIT_CONVERT, dl, MVT::v8i16, NewV); // Rewrite the MaskVals and assign NewV to V1 if NewV now contains all the @@ -4272,7 +4274,7 @@ // If we have SSSE3, and all words of the result are from 1 input vector, // case 2 is generated, otherwise case 3 is generated. If no SSSE3 // is present, fall back to case 4. - if (TLI.getSubtarget()->hasSSSE3()) { + if (Subtarget->hasSSSE3()) { SmallVector pshufbMask; // If we have elements from both input vectors, set the high bit of the @@ -4942,7 +4944,7 @@ // Handle v8i16 specifically since SSE can do byte extraction and insertion. if (VT == MVT::v8i16) { - SDValue NewOp = LowerVECTOR_SHUFFLEv8i16(SVOp, DAG, *this); + SDValue NewOp = LowerVECTOR_SHUFFLEv8i16(Op, DAG); if (NewOp.getNode()) return NewOp; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=111704&r1=111703&r2=111704&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Fri Aug 20 20:32:18 2010 @@ -771,6 +771,9 @@ SDValue LowerREADCYCLECOUNTER(SDValue Op, SelectionDAG &DAG) const; SDValue LowerMEMBARRIER(SDValue Op, SelectionDAG &DAG) const; + // Utility functions to help LowerVECTOR_SHUFFLE + SDValue LowerVECTOR_SHUFFLEv8i16(SDValue Op, SelectionDAG &DAG) const; + virtual SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, From gohman at apple.com Fri Aug 20 21:32:36 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 21 Aug 2010 02:32:36 -0000 Subject: [llvm-commits] [llvm] r111709 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-cmp-branch.ll Message-ID: <20100821023236.7CEA62A6C12C@llvm.org> Author: djg Date: Fri Aug 20 21:32:36 2010 New Revision: 111709 URL: http://llvm.org/viewvc/llvm-project?rev=111709&view=rev Log: Fix x86 fast-isel's cmp+branch folding to avoid folding when the comparison is in a different basic block from the branch. In such cases, the comparison's operands may not have initialized virtual registers available. Added: llvm/trunk/test/CodeGen/X86/fast-isel-cmp-branch.ll Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=111709&r1=111708&r2=111709&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Fri Aug 20 21:32:36 2010 @@ -960,9 +960,11 @@ MachineBasicBlock *TrueMBB = FuncInfo.MBBMap[BI->getSuccessor(0)]; MachineBasicBlock *FalseMBB = FuncInfo.MBBMap[BI->getSuccessor(1)]; - // Fold the common case of a conditional branch with a comparison. + // Fold the common case of a conditional branch with a comparison + // in the same block (values defined on other blocks may not have + // initialized registers). if (const CmpInst *CI = dyn_cast(BI->getCondition())) { - if (CI->hasOneUse()) { + if (CI->hasOneUse() && CI->getParent() == I->getParent()) { EVT VT = TLI.getValueType(CI->getOperand(0)->getType()); // Try to take advantage of fallthrough opportunities. Added: llvm/trunk/test/CodeGen/X86/fast-isel-cmp-branch.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-cmp-branch.ll?rev=111709&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-cmp-branch.ll (added) +++ llvm/trunk/test/CodeGen/X86/fast-isel-cmp-branch.ll Fri Aug 20 21:32:36 2010 @@ -0,0 +1,29 @@ +; RUN: llc -O0 -march=x86-64 -asm-verbose=false < %s | FileCheck %s +; rdar://8337108 + +; Fast-isel shouldn't try to look through the compare because it's in a +; different basic block, so its operands aren't necessarily exported +; for cross-block usage. + +; CHECK: movb %al, 7(%rsp) +; CHECK: callq {{_?}}bar +; CHECK: movb 7(%rsp), %al + +declare void @bar() + +define void @foo(i32 %a, i32 %b) nounwind { +entry: + %q = add i32 %a, 7 + %r = add i32 %b, 9 + %t = icmp ult i32 %q, %r + invoke void @bar() to label %next unwind label %unw +next: + br i1 %t, label %true, label %return +true: + call void @bar() + br label %return +return: + ret void +unw: + unreachable +} From gohman at apple.com Fri Aug 20 21:52:29 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 21 Aug 2010 02:52:29 -0000 Subject: [llvm-commits] [llvm] r111713 - /llvm/trunk/lib/VMCore/Metadata.cpp Message-ID: <20100821025229.7FE402A6C12C@llvm.org> Author: djg Date: Fri Aug 20 21:52:29 2010 New Revision: 111713 URL: http://llvm.org/viewvc/llvm-project?rev=111713&view=rev Log: Add an assert to MDNode::deleteTemporary check that the node being deleted is not non-temporary. Modified: llvm/trunk/lib/VMCore/Metadata.cpp Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=111713&r1=111712&r2=111713&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Fri Aug 20 21:52:29 2010 @@ -257,10 +257,12 @@ void MDNode::deleteTemporary(MDNode *N) { assert(N->use_empty() && "Temporary MDNode has uses!"); + assert(!N->getContext().pImpl->MDNodeSet.RemoveNode(N) && + "Deleting a non-temporary node!"); assert((N->getSubclassDataFromValue() & NotUniquedBit) && "Temporary MDNode does not have NotUniquedBit set!"); assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 && - "Temporary MDNode does has DestroyFlag set!"); + "Temporary MDNode has DestroyFlag set!"); N->setValueSubclassData(N->getSubclassDataFromValue() | DestroyFlag); LeakDetector::removeGarbageObject(N); From gohman at apple.com Fri Aug 20 21:53:22 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 19:53:22 -0700 Subject: [llvm-commits] [llvm] r111681 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/Metadata.h lib/Analysis/DebugInfo.cpp lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/Metadata.cpp In-Reply-To: References: <20100820220226.EB8C22A6C12C@llvm.org> Message-ID: On Aug 20, 2010, at 5:40 PM, Chris Lattner wrote: > > On Aug 20, 2010, at 3:02 PM, Dan Gohman wrote: > >> Author: djg >> Date: Fri Aug 20 17:02:26 2010 >> New Revision: 111681 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111681&view=rev >> Log: >> Introduce a new temporary MDNode concept. Temporary MDNodes are >> not part of the IR, are not uniqued, and may be safely RAUW'd. >> This replaces a variety of alternate mechanisms for achieving >> the same effect. > > Very nice! Is it possible to make RAUW assert that the thing being replaced with is not a uniqued MDNode now? It is now. Dan From gohman at apple.com Fri Aug 20 21:53:50 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 19:53:50 -0700 Subject: [llvm-commits] [llvm] r111595 - in /llvm/trunk: include/llvm/Support/FormattedStream.h include/llvm/Support/raw_ostream.h lib/Support/FormattedStream.cpp lib/Support/raw_ostream.cpp In-Reply-To: References: <20100820004810.878BF2A6C12C@llvm.org> Message-ID: <0F0409B7-C682-4B66-A9FE-EC1979A72F9F@apple.com> On Aug 20, 2010, at 5:43 PM, Chris Lattner wrote: > > On Aug 19, 2010, at 5:48 PM, Dan Gohman wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=111595&view=rev >> Log: >> Introduce a new tool_output_file class, which extends raw_ostream with >> functionality that most command-line tools need: ensuring that the >> output file gets deleted if the tool is interrupted or encounters an >> error. > > I embrace factoring out this code, but it doesn't seem like this "isa" raw_ostream. This seems like it should contain one instead. What do you think? Makes sense. I'll look into it. Dan From gohman at apple.com Fri Aug 20 22:07:20 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 20 Aug 2010 20:07:20 -0700 Subject: [llvm-commits] [llvm] r111643 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: References: <20100820164456.60A772A6C12C@llvm.org> Message-ID: <13F702D1-D977-4448-AA52-0C20C8AB4547@apple.com> On Aug 20, 2010, at 5:45 PM, Chris Lattner wrote: > > On Aug 20, 2010, at 9:44 AM, Dan Gohman wrote: > >> Author: djg >> Date: Fri Aug 20 11:44:56 2010 >> New Revision: 111643 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=111643&view=rev >> Log: >> Make outs() close its file when its stream is destructed, so that >> pending output errors are detected. > > I don't get this. This means that any evaluation (e.g. in a library) of outs() will dramatically change the behavior of the program it is embedded into. This is non-obvious and seems really really dangerous. Library code meant to be embedded as a subsystem within diverse applications shouldn't ever be even thinking about outs(). There are a few legitimate outs() uses left in the tools right now, but due to the potential for confusion, it may make sense to remove outs() altogether. Dan From bigcheesegs at gmail.com Sat Aug 21 00:58:13 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Sat, 21 Aug 2010 05:58:13 -0000 Subject: [llvm-commits] [llvm] r111728 - in /llvm/trunk: include/llvm/MC/MCObjectWriter.h include/llvm/Support/COFF.h lib/MC/WinCOFFObjectWriter.cpp lib/Target/X86/X86AsmBackend.cpp lib/Target/X86/X86MCAsmInfo.cpp Message-ID: <20100821055813.593BB2A6C12C@llvm.org> Author: mspencer Date: Sat Aug 21 00:58:13 2010 New Revision: 111728 URL: http://llvm.org/viewvc/llvm-project?rev=111728&view=rev Log: MC: Add partial x86-64 support to COFF. Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h llvm/trunk/include/llvm/Support/COFF.h llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp llvm/trunk/lib/Target/X86/X86AsmBackend.cpp llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp Modified: llvm/trunk/include/llvm/MC/MCObjectWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectWriter.h?rev=111728&r1=111727&r2=111728&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCObjectWriter.h (original) +++ llvm/trunk/include/llvm/MC/MCObjectWriter.h Sat Aug 21 00:58:13 2010 @@ -162,7 +162,7 @@ /// @} }; -MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS); +MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS, bool is64Bit); } // End llvm namespace Modified: llvm/trunk/include/llvm/Support/COFF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/COFF.h?rev=111728&r1=111727&r2=111728&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/COFF.h (original) +++ llvm/trunk/include/llvm/Support/COFF.h Sat Aug 21 00:58:13 2010 @@ -50,7 +50,7 @@ enum MachineTypes { IMAGE_FILE_MACHINE_I386 = 0x14C, - IMAGINE_FILE_MACHINE_AMD64 = 0x8664 + IMAGE_FILE_MACHINE_AMD64 = 0x8664 }; struct symbol { Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=111728&r1=111727&r2=111728&view=diff ============================================================================== --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Sat Aug 21 00:58:13 2010 @@ -33,6 +33,8 @@ #include "llvm/System/TimeValue.h" +#include "../Target/X86/X86FixupKinds.h" + #include using namespace llvm; @@ -132,7 +134,7 @@ section_map SectionMap; symbol_map SymbolMap; - WinCOFFObjectWriter(raw_ostream &OS); + WinCOFFObjectWriter(raw_ostream &OS, bool is64Bit); ~WinCOFFObjectWriter(); COFFSymbol *createSymbol(llvm::StringRef Name); @@ -271,11 +273,12 @@ //------------------------------------------------------------------------------ // WinCOFFObjectWriter class implementation -WinCOFFObjectWriter::WinCOFFObjectWriter(raw_ostream &OS) +WinCOFFObjectWriter::WinCOFFObjectWriter(raw_ostream &OS, bool is64Bit) : MCObjectWriter(OS, true) { memset(&Header, 0, sizeof(Header)); - // TODO: Move magic constant out to COFF.h - Header.Machine = 0x14C; // x86 + + is64Bit ? Header.Machine = COFF::IMAGE_FILE_MACHINE_AMD64 + : Header.Machine = COFF::IMAGE_FILE_MACHINE_I386; } WinCOFFObjectWriter::~WinCOFFObjectWriter() { @@ -587,17 +590,40 @@ Reloc.Data.VirtualAddress += Fixup.getOffset(); - switch (Fixup.getKind()) { - case FirstTargetFixupKind: // reloc_pcrel_4byte - Reloc.Data.Type = COFF::IMAGE_REL_I386_REL32; - FixedValue += 4; - break; - case FK_Data_4: - Reloc.Data.Type = COFF::IMAGE_REL_I386_DIR32; - break; - default: - llvm_unreachable("unsupported relocation type"); - } + COFF::RelocationTypeX86 Type; + + if (Header.Machine == COFF::IMAGE_FILE_MACHINE_I386) { + switch (Fixup.getKind()) { + case X86::reloc_pcrel_4byte: + Type = COFF::IMAGE_REL_I386_REL32; + FixedValue += 4; + break; + case FK_Data_4: + Type = COFF::IMAGE_REL_I386_DIR32; + break; + default: + llvm_unreachable("unsupported relocation type"); + } + } else if (Header.Machine == COFF::IMAGE_FILE_MACHINE_AMD64) { + switch (Fixup.getKind()) { + case FK_Data_8: + Type = COFF::IMAGE_REL_AMD64_ADDR64; + break; + case X86::reloc_pcrel_4byte: + case X86::reloc_riprel_4byte: + Type = COFF::IMAGE_REL_AMD64_REL32; + FixedValue += 4; + break; + case FK_Data_4: + Type = COFF::IMAGE_REL_AMD64_ADDR32; + break; + default: + llvm_unreachable("unsupported relocation type"); + } + } else + llvm_unreachable("unknown target architecture"); + + Reloc.Data.Type = Type; coff_section->Relocations.push_back(Reloc); } @@ -739,7 +765,7 @@ // WinCOFFObjectWriter factory function namespace llvm { - MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS) { - return new WinCOFFObjectWriter(OS); + MCObjectWriter *createWinCOFFObjectWriter(raw_ostream &OS, bool is64Bit) { + return new WinCOFFObjectWriter(OS, is64Bit); } } Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=111728&r1=111727&r2=111728&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Sat Aug 21 00:58:13 2010 @@ -223,14 +223,16 @@ }; class WindowsX86AsmBackend : public X86AsmBackend { + bool Is64Bit; public: - WindowsX86AsmBackend(const Target &T) - : X86AsmBackend(T) { + WindowsX86AsmBackend(const Target &T, bool is64Bit) + : X86AsmBackend(T) + , Is64Bit(is64Bit) { HasScatteredSymbols = true; } MCObjectWriter *createObjectWriter(raw_ostream &OS) const { - return createWinCOFFObjectWriter (OS); + return createWinCOFFObjectWriter(OS, Is64Bit); } bool isVirtualSection(const MCSection &Section) const { @@ -320,7 +322,7 @@ case Triple::MinGW32: case Triple::Cygwin: case Triple::Win32: - return new WindowsX86AsmBackend(T); + return new WindowsX86AsmBackend(T, false); default: return new ELFX86_32AsmBackend(T); } @@ -331,6 +333,10 @@ switch (Triple(TT).getOS()) { case Triple::Darwin: return new DarwinX86_64AsmBackend(T); + case Triple::MinGW64: + case Triple::Cygwin: + case Triple::Win32: + return new WindowsX86AsmBackend(T, true); default: return new ELFX86_64AsmBackend(T); } Modified: llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp?rev=111728&r1=111727&r2=111728&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp Sat Aug 21 00:58:13 2010 @@ -103,6 +103,9 @@ } X86MCAsmInfoCOFF::X86MCAsmInfoCOFF(const Triple &Triple) { + if (Triple.getArch() == Triple::x86_64) + GlobalPrefix = ""; + AsmTransCBE = x86_asm_table; AssemblerDialect = AsmWriterFlavor; From kennethuil at gmail.com Sat Aug 21 07:15:20 2010 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Sat, 21 Aug 2010 07:15:20 -0500 Subject: [llvm-commits] [llvm] r111595 - in /llvm/trunk: include/llvm/Support/FormattedStream.h include/llvm/Support/raw_ostream.h lib/Support/FormattedStream.cpp lib/Support/raw_ostream.cpp In-Reply-To: <20100820004810.878BF2A6C12C@llvm.org> References: <20100820004810.878BF2A6C12C@llvm.org> Message-ID: Can it be configurable? Sometimes it's helpful to see what the tool managed to output before it got an error. On Thu, Aug 19, 2010 at 7:48 PM, Dan Gohman wrote: > Author: djg > Date: Thu Aug 19 19:48:10 2010 > New Revision: 111595 > > URL: http://llvm.org/viewvc/llvm-project?rev=111595&view=rev > Log: > Introduce a new tool_output_file class, which extends raw_ostream with > functionality that most command-line tools need: ensuring that the > output file gets deleted if the tool is interrupted or encounters an > error. > > Modified: > ? ?llvm/trunk/include/llvm/Support/FormattedStream.h > ? ?llvm/trunk/include/llvm/Support/raw_ostream.h > ? ?llvm/trunk/lib/Support/FormattedStream.cpp > ? ?llvm/trunk/lib/Support/raw_ostream.cpp > > Modified: llvm/trunk/include/llvm/Support/FormattedStream.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormattedStream.h?rev=111595&r1=111594&r2=111595&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/FormattedStream.h (original) > +++ llvm/trunk/include/llvm/Support/FormattedStream.h Thu Aug 19 19:48:10 2010 > @@ -19,10 +19,14 @@ > > ?namespace llvm > ?{ > + ?class formatted_tool_output_file; > + > ? /// formatted_raw_ostream - Formatted raw_fd_ostream to handle > ? /// asm-specific constructs. > ? /// > ? class formatted_raw_ostream : public raw_ostream { > + ? ?friend class formatted_tool_output_file; > + > ? public: > ? ? /// DELETE_STREAM - Tell the destructor to delete the held stream. > ? ? /// > @@ -136,6 +140,25 @@ > ? ? } > ? }; > > + ?/// formatted_tool_output_file - This is a subclass of formatted_raw_ostream > + ?/// for use when the underlying stream is a tool_output_file. It exposes > + ?/// the keep() member function. > + ?class formatted_tool_output_file : public formatted_raw_ostream { > + ?public: > + ? ?formatted_tool_output_file(tool_output_file &Stream, bool Delete = false) > + ? ? ?: formatted_raw_ostream(Stream, Delete) {} > + > + ? ?formatted_tool_output_file() {} > + > + ? ?~formatted_tool_output_file(); > + > + ? ?void setStream(tool_output_file &Stream, bool Delete = false) { > + ? ? ?return formatted_raw_ostream::setStream(Stream, Delete); > + ? ?} > + > + ? ?void keep() { return static_cast(TheStream)->keep(); } > + ?}; > + > ?/// fouts() - This returns a reference to a formatted_raw_ostream for > ?/// standard output. ?Use it like: fouts() << "foo" << "bar"; > ?formatted_raw_ostream &fouts(); > > Modified: llvm/trunk/include/llvm/Support/raw_ostream.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=111595&r1=111594&r2=111595&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) > +++ llvm/trunk/include/llvm/Support/raw_ostream.h Thu Aug 19 19:48:10 2010 > @@ -370,10 +370,11 @@ > ? ~raw_fd_ostream(); > > ? /// close - Manually flush the stream and close the file. > + ?/// Note that this does not call fsync. > ? void close(); > > ? /// seek - Flushes the stream and repositions the underlying file descriptor > - ?/// ?positition to the offset specified from the beginning of the file. > + ?/// positition to the offset specified from the beginning of the file. > ? uint64_t seek(uint64_t off); > > ? virtual raw_ostream &changeColor(enum Colors colors, bool bold=false, > @@ -484,6 +485,25 @@ > ? ~raw_null_ostream(); > ?}; > > +/// tool_output_file - This class behaves like a raw_fd_ostream but adds a > +/// few extra features commonly needed for compiler-like tool output files: > +/// ? - The file is automatically deleted if the process is killed. > +/// ? - The file is automatically deleted when the tool_output_file > +/// ? ? object is destroyed unless the client calls keep(). > +class tool_output_file : public raw_fd_ostream { > + ?std::string Filename; > + ?bool Keep; > +public: > + ?tool_output_file(const char *filename, std::string &ErrorInfo, > + ? ? ? ? ? ? ? ? ? unsigned Flags = 0); > + > + ?~tool_output_file(); > + > + ?/// keep - Indicate that the tool's job wrt this output file has been > + ?/// successful and the file should not be deleted. > + ?void keep() { Keep = true; } > +}; > + > ?} // end llvm namespace > > ?#endif > > Modified: llvm/trunk/lib/Support/FormattedStream.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FormattedStream.cpp?rev=111595&r1=111594&r2=111595&view=diff > ============================================================================== > --- llvm/trunk/lib/Support/FormattedStream.cpp (original) > +++ llvm/trunk/lib/Support/FormattedStream.cpp Thu Aug 19 19:48:10 2010 > @@ -98,3 +98,6 @@ > ? static formatted_raw_ostream S(dbgs()); > ? return S; > ?} > + > +/// ~formatted_tool_output_file - Out-of-line destructor. > +formatted_tool_output_file::~formatted_tool_output_file() {} > > Modified: llvm/trunk/lib/Support/raw_ostream.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=111595&r1=111594&r2=111595&view=diff > ============================================================================== > --- llvm/trunk/lib/Support/raw_ostream.cpp (original) > +++ llvm/trunk/lib/Support/raw_ostream.cpp Thu Aug 19 19:48:10 2010 > @@ -19,6 +19,7 @@ > ?#include "llvm/Config/config.h" > ?#include "llvm/Support/Compiler.h" > ?#include "llvm/Support/ErrorHandling.h" > +#include "llvm/System/Signals.h" > ?#include "llvm/ADT/STLExtras.h" > ?#include > ?#include > @@ -669,3 +670,30 @@ > ?uint64_t raw_null_ostream::current_pos() const { > ? return 0; > ?} > + > +//===----------------------------------------------------------------------===// > +// ?tool_output_file > +//===----------------------------------------------------------------------===// > + > +/// SetupRemoveOnSignal - This is a helper for tool_output_file's constructor > +/// to allow the signal handlers to be installed before constructing the > +/// base class raw_fd_ostream. > +static const char *SetupRemoveOnSignal(const char *Filename) { > + ?// Arrange for the file to be deleted if the process is killed. > + ?if (strcmp(Filename, "-") != 0) > + ? ?sys::RemoveFileOnSignal(sys::Path(Filename)); > + ?return Filename; > +} > + > +tool_output_file::tool_output_file(const char *filename, std::string &ErrorInfo, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned Flags) > + ?: raw_fd_ostream(SetupRemoveOnSignal(filename), ErrorInfo, Flags), > + ? ?Filename(filename), > + ? ?Keep(!ErrorInfo.empty() /* If open fails, no cleanup is needed. */) { > +} > + > +tool_output_file::~tool_output_file() { > + ?// Delete the file if the client hasn't told us not to. > + ?if (!Keep && Filename != "-") > + ? ?sys::Path(Filename).eraseFromDisk(); > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From benny.kra at googlemail.com Sat Aug 21 10:07:23 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Sat, 21 Aug 2010 15:07:23 -0000 Subject: [llvm-commits] [llvm] r111739 - /llvm/trunk/lib/VMCore/Metadata.cpp Message-ID: <20100821150723.B301B2A6C12C@llvm.org> Author: d0k Date: Sat Aug 21 10:07:23 2010 New Revision: 111739 URL: http://llvm.org/viewvc/llvm-project?rev=111739&view=rev Log: Use MDNode::destroy(). Fixes a delete/free mismatch. Modified: llvm/trunk/lib/VMCore/Metadata.cpp Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=111739&r1=111738&r2=111739&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Sat Aug 21 10:07:23 2010 @@ -263,10 +263,8 @@ "Temporary MDNode does not have NotUniquedBit set!"); assert((N->getSubclassDataFromValue() & DestroyFlag) == 0 && "Temporary MDNode has DestroyFlag set!"); - N->setValueSubclassData(N->getSubclassDataFromValue() | - DestroyFlag); LeakDetector::removeGarbageObject(N); - delete N; + N->destroy(); } /// getOperand - Return specified operand. From asl at math.spbu.ru Sat Aug 21 12:21:11 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 21 Aug 2010 17:21:11 -0000 Subject: [llvm-commits] [llvm] r111741 - in /llvm/trunk/lib/Target/X86: X86Subtarget.cpp X86TargetMachine.cpp Message-ID: <20100821172111.B3EFB2A6C12C@llvm.org> Author: asl Date: Sat Aug 21 12:21:11 2010 New Revision: 111741 URL: http://llvm.org/viewvc/llvm-project?rev=111741&view=rev Log: Use rip-rel addressing on win64 by default. For this we just defaults to small pic code model. Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=111741&r1=111740&r2=111741&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Sat Aug 21 12:21:11 2010 @@ -73,7 +73,7 @@ if (GV->hasDefaultVisibility() && (isDecl || GV->isWeakForLinker())) return X86II::MO_GOTPCREL; - } else { + } else if (!isTargetWin64()) { assert(isTargetELF() && "Unknown rip-relative target"); // Extra load is needed for all externally visible. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=111741&r1=111740&r2=111741&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Sat Aug 21 12:21:11 2010 @@ -112,15 +112,21 @@ InstrInfo(*this), JITInfo(*this), TLInfo(*this), TSInfo(*this), ELFWriterInfo(*this) { DefRelocModel = getRelocationModel(); - + // If no relocation model was picked, default as appropriate for the target. if (getRelocationModel() == Reloc::Default) { - if (!Subtarget.isTargetDarwin()) - setRelocationModel(Reloc::Static); - else if (Subtarget.is64Bit()) + // Darwin defaults to PIC in 64 bit mode and dynamic-no-pic in 32 bit mode. + // Win64 requires rip-rel addressing, thus we force it to PIC. Otherwise we + // use static relocation model by default. + if (Subtarget.isTargetDarwin()) { + if (Subtarget.is64Bit()) + setRelocationModel(Reloc::PIC_); + else + setRelocationModel(Reloc::DynamicNoPIC); + } else if (Subtarget.isTargetWin64()) setRelocationModel(Reloc::PIC_); else - setRelocationModel(Reloc::DynamicNoPIC); + setRelocationModel(Reloc::Static); } assert(getRelocationModel() != Reloc::Default && @@ -143,29 +149,27 @@ Subtarget.isTargetDarwin() && is64Bit) setRelocationModel(Reloc::PIC_); - + // Determine the PICStyle based on the target selected. if (getRelocationModel() == Reloc::Static) { // Unless we're in PIC or DynamicNoPIC mode, set the PIC style to None. Subtarget.setPICStyle(PICStyles::None); + } else if (Subtarget.is64Bit()) { + // PIC in 64 bit mode is always rip-rel. + Subtarget.setPICStyle(PICStyles::RIPRel); } else if (Subtarget.isTargetCygMing()) { Subtarget.setPICStyle(PICStyles::None); } else if (Subtarget.isTargetDarwin()) { - if (Subtarget.is64Bit()) - Subtarget.setPICStyle(PICStyles::RIPRel); - else if (getRelocationModel() == Reloc::PIC_) + if (getRelocationModel() == Reloc::PIC_) Subtarget.setPICStyle(PICStyles::StubPIC); else { assert(getRelocationModel() == Reloc::DynamicNoPIC); Subtarget.setPICStyle(PICStyles::StubDynamicNoPIC); } } else if (Subtarget.isTargetELF()) { - if (Subtarget.is64Bit()) - Subtarget.setPICStyle(PICStyles::RIPRel); - else - Subtarget.setPICStyle(PICStyles::GOT); + Subtarget.setPICStyle(PICStyles::GOT); } - + // Finally, if we have "none" as our PIC style, force to static mode. if (Subtarget.getPICStyle() == PICStyles::None) setRelocationModel(Reloc::Static); From eli.friedman at gmail.com Sat Aug 21 15:19:51 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Sat, 21 Aug 2010 20:19:51 -0000 Subject: [llvm-commits] [llvm] r111744 - /llvm/trunk/lib/CodeGen/RegAllocFast.cpp Message-ID: <20100821201951.A6FAA2A6C12C@llvm.org> Author: efriedma Date: Sat Aug 21 15:19:51 2010 New Revision: 111744 URL: http://llvm.org/viewvc/llvm-project?rev=111744&view=rev Log: Delete dead comment. Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=111744&r1=111743&r2=111744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Sat Aug 21 15:19:51 2010 @@ -239,8 +239,7 @@ } /// spillVirtReg - This method spills the value specified by VirtReg into the -/// corresponding stack slot if needed. If isKill is set, the register is also -/// killed. +/// corresponding stack slot if needed. void RAFast::spillVirtReg(MachineBasicBlock::iterator MI, unsigned VirtReg) { assert(TargetRegisterInfo::isVirtualRegister(VirtReg) && "Spilling a physical register is illegal!"); From clattner at apple.com Sat Aug 21 17:31:18 2010 From: clattner at apple.com (Chris Lattner) Date: Sat, 21 Aug 2010 15:31:18 -0700 Subject: [llvm-commits] [llvm] r111681 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/Metadata.h lib/Analysis/DebugInfo.cpp lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/Metadata.cpp In-Reply-To: References: <20100820220226.EB8C22A6C12C@llvm.org> Message-ID: On Aug 20, 2010, at 7:53 PM, Dan Gohman wrote: > > On Aug 20, 2010, at 5:40 PM, Chris Lattner wrote: > >> >> On Aug 20, 2010, at 3:02 PM, Dan Gohman wrote: >> >>> Author: djg >>> Date: Fri Aug 20 17:02:26 2010 >>> New Revision: 111681 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=111681&view=rev >>> Log: >>> Introduce a new temporary MDNode concept. Temporary MDNodes are >>> not part of the IR, are not uniqued, and may be safely RAUW'd. >>> This replaces a variety of alternate mechanisms for achieving >>> the same effect. >> >> Very nice! Is it possible to make RAUW assert that the thing being replaced with is not a uniqued MDNode now? > > > It is now. Thanks! I actually meant Value::RAUW method though. There is no case where doing a RAUW on a uniqued node is safe. -Chris From clattner at apple.com Sat Aug 21 17:31:47 2010 From: clattner at apple.com (Chris Lattner) Date: Sat, 21 Aug 2010 15:31:47 -0700 Subject: [llvm-commits] [llvm] r111643 - /llvm/trunk/lib/Support/raw_ostream.cpp In-Reply-To: <13F702D1-D977-4448-AA52-0C20C8AB4547@apple.com> References: <20100820164456.60A772A6C12C@llvm.org> <13F702D1-D977-4448-AA52-0C20C8AB4547@apple.com> Message-ID: On Aug 20, 2010, at 8:07 PM, Dan Gohman wrote: > > On Aug 20, 2010, at 5:45 PM, Chris Lattner wrote: > >> >> On Aug 20, 2010, at 9:44 AM, Dan Gohman wrote: >> >>> Author: djg >>> Date: Fri Aug 20 11:44:56 2010 >>> New Revision: 111643 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=111643&view=rev >>> Log: >>> Make outs() close its file when its stream is destructed, so that >>> pending output errors are detected. >> >> I don't get this. This means that any evaluation (e.g. in a library) of outs() will dramatically change the behavior of the program it is embedded into. This is non-obvious and seems really really dangerous. > > Library code meant to be embedded as a subsystem within diverse applications shouldn't > ever be even thinking about outs(). There are a few legitimate outs() uses left in > the tools right now, but due to the potential for confusion, it may make sense to > remove outs() altogether. Sounds good to me, so long as raw_fd_ostream has sensible behavior when talking to "-". -Chris From rjmccall at apple.com Sat Aug 21 19:10:45 2010 From: rjmccall at apple.com (John McCall) Date: Sun, 22 Aug 2010 00:10:45 -0000 Subject: [llvm-commits] [test-suite] r111754 - in /test-suite/trunk/SingleSource/Regression/C++: pointer_method2.cpp pointer_method2.reference_output Message-ID: <20100822001045.C2F1C2A6C12C@llvm.org> Author: rjmccall Date: Sat Aug 21 19:10:45 2010 New Revision: 111754 URL: http://llvm.org/viewvc/llvm-project?rev=111754&view=rev Log: Add a regression test which covers both virtual and non-virtual calls through method pointers. Added: test-suite/trunk/SingleSource/Regression/C++/pointer_method2.cpp test-suite/trunk/SingleSource/Regression/C++/pointer_method2.reference_output Added: test-suite/trunk/SingleSource/Regression/C++/pointer_method2.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/pointer_method2.cpp?rev=111754&view=auto ============================================================================== --- test-suite/trunk/SingleSource/Regression/C++/pointer_method2.cpp (added) +++ test-suite/trunk/SingleSource/Regression/C++/pointer_method2.cpp Sat Aug 21 19:10:45 2010 @@ -0,0 +1,37 @@ +#include + +struct A { + int a; + virtual void foo() = 0; + void bar() { printf("A::bar(): a=%x\n", a); } +}; + +struct B { + int b; + virtual void foo() = 0; + void bar() { printf("B::bar(): b=%x\n", b); } +}; + +struct C : A, B { + int c; + virtual void foo() { printf("C::foo(), c=%x\n", c); } + void bar() { printf("C::bar(), c=%x\n", c); } +}; + +template void invoke(C &c, void (T::*fn)()) { + (c.*fn)(); +} + +int main() { + C c; + c.a = 0xff; + c.b = 0xf0f; + c.c = 0xf00f; + + invoke(c, &A::foo); + invoke(c, &A::bar); + invoke(c, &B::foo); + invoke(c, &B::bar); + invoke(c, &C::foo); + invoke(c, &C::bar); +} Added: test-suite/trunk/SingleSource/Regression/C++/pointer_method2.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/pointer_method2.reference_output?rev=111754&view=auto ============================================================================== --- test-suite/trunk/SingleSource/Regression/C++/pointer_method2.reference_output (added) +++ test-suite/trunk/SingleSource/Regression/C++/pointer_method2.reference_output Sat Aug 21 19:10:45 2010 @@ -0,0 +1,7 @@ +C::foo(), c=f00f +A::bar(): a=ff +C::foo(), c=f00f +B::bar(): b=f0f +C::foo(), c=f00f +C::bar(), c=f00f +exit 0 From bigcheesegs at gmail.com Sat Aug 21 20:37:15 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Sat, 21 Aug 2010 21:37:15 -0400 Subject: [llvm-commits] [PATCH] Bugpoint/Support: Fix llvm::FindExecutable not looking for files ending with .exe Message-ID: llvm::FindExecutable was used in BugPoint with exe names that did not end in .exe (which makes sense). To make this work on Windows I made Path::canExecute check to see if there's a file with .exe appended that can execute. - Michael Spencer -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-findexecutable.patch Type: application/octet-stream Size: 868 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100821/0c864b9d/attachment.obj From nicolas.geoffray at gmail.com Sun Aug 22 17:04:37 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Mon, 23 Aug 2010 00:04:37 +0200 Subject: [llvm-commits] JIT: Emitting a debug location after an instruction Message-ID: Hi, The attached patch adds a flags to TargetOptions to control when a debug location must be emitted when jitting. As of today, it could only be emitted before the instruction was emitted. Because, at runtime, when walking the call stack, return instructions point to the next instruction after the call, I would like to emit a debug information after a call instruction. I haven't found any alternative or existing approach in LLVM. Please let me know if you know one, and/or what you think about the patch. Thanks! Nicolas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100823/3adbdd25/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: jit.patch Type: application/octet-stream Size: 2295 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100823/3adbdd25/attachment.obj From isanbard at gmail.com Sun Aug 22 17:43:03 2010 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 22 Aug 2010 15:43:03 -0700 Subject: [llvm-commits] [llvm] r111684 - in /llvm/trunk: docs/LangRef.html include/llvm-c/Core.h include/llvm/GlobalValue.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Write In-Reply-To: References: Message-ID: <81607DD2-DD6C-4E14-8769-882545BFD736@gmail.com> On Aug 20, 2010, at 3:14 PM, Anton Korobeynikov wrote: >> Create the new linker type "linker_private_weak_def_auto". > Maybe we should put a temporary veto on adding new linkage types? > Or at least such patches deserve some discussion? > Why is it not possible to emulate the behavior with some current > linkage type and e.g. visibility setting? > Possibly? Though they do have differing semantics, so it could get confusing. How about this radical idea: We have a "linker_private" linkage type. Then there could be a few sub-linkage types: default, weak, weak_def_auto, some-other-crazy-sub-type, etc. Does that sound vaguely plausible? -bw From nicholas at mxc.ca Sun Aug 22 18:45:14 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Sun, 22 Aug 2010 23:45:14 -0000 Subject: [llvm-commits] [llvm] r111787 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <20100822234514.609A62A6C12C@llvm.org> Author: nicholas Date: Sun Aug 22 18:45:14 2010 New Revision: 111787 URL: http://llvm.org/viewvc/llvm-project?rev=111787&view=rev Log: Verify the predicates on icmp/fcmp. Suggested by Jeff Yasskin! Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=111787&r1=111786&r2=111787&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Sun Aug 22 18:45:14 2010 @@ -1282,28 +1282,37 @@ visitInstruction(B); } -void Verifier::visitICmpInst(ICmpInst& IC) { +void Verifier::visitICmpInst(ICmpInst &IC) { // Check that the operands are the same type - const Type* Op0Ty = IC.getOperand(0)->getType(); - const Type* Op1Ty = IC.getOperand(1)->getType(); + const Type *Op0Ty = IC.getOperand(0)->getType(); + const Type *Op1Ty = IC.getOperand(1)->getType(); Assert1(Op0Ty == Op1Ty, "Both operands to ICmp instruction are not of the same type!", &IC); // Check that the operands are the right type Assert1(Op0Ty->isIntOrIntVectorTy() || Op0Ty->isPointerTy(), "Invalid operand types for ICmp instruction", &IC); + // Check that the predicate is valid. + Assert1(IC.getPredicate() >= CmpInst::FIRST_ICMP_PREDICATE && + IC.getPredicate() <= CmpInst::LAST_ICMP_PREDICATE, + "Invalid predicate in ICmp instruction!", &IC); visitInstruction(IC); } -void Verifier::visitFCmpInst(FCmpInst& FC) { +void Verifier::visitFCmpInst(FCmpInst &FC) { // Check that the operands are the same type - const Type* Op0Ty = FC.getOperand(0)->getType(); - const Type* Op1Ty = FC.getOperand(1)->getType(); + const Type *Op0Ty = FC.getOperand(0)->getType(); + const Type *Op1Ty = FC.getOperand(1)->getType(); Assert1(Op0Ty == Op1Ty, "Both operands to FCmp instruction are not of the same type!", &FC); // Check that the operands are the right type Assert1(Op0Ty->isFPOrFPVectorTy(), "Invalid operand types for FCmp instruction", &FC); + // Check that the predicate is valid. + Assert1(FC.getPredicate() >= CmpInst::FIRST_FCMP_PREDICATE && + FC.getPredicate() <= CmpInst::LAST_FCMP_PREDICATE, + "Invalid predicate in FCmp instruction!", &FC); + visitInstruction(FC); } From sabre at nondot.org Sun Aug 22 22:12:07 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 23 Aug 2010 03:12:07 -0000 Subject: [llvm-commits] [llvm] r111791 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <20100823031207.256DA2A6C12C@llvm.org> Author: lattner Date: Sun Aug 22 22:12:06 2010 New Revision: 111791 URL: http://llvm.org/viewvc/llvm-project?rev=111791&view=rev Log: remove some dead code. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=111791&r1=111790&r2=111791&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Sun Aug 22 22:12:06 2010 @@ -152,16 +152,6 @@ FunctionToCallSitesMap[F].insert(CallSite); } - // Returns the Function of the stub if a stub was erased, or NULL if there - // was no stub. This function uses the call-site->function map to find a - // relevant function, but asserts that only stubs and not other call sites - // will be passed in. - Function *EraseStub(const MutexGuard &locked, void *Stub); - - void EraseAllCallSitesFor(const MutexGuard &locked, Function *F) { - assert(locked.holds(TheJIT->lock)); - EraseAllCallSitesForPrelocked(F); - } void EraseAllCallSitesForPrelocked(Function *F); // Erases _all_ call sites regardless of their function. This is used to @@ -223,9 +213,6 @@ /// specified GV address. void *getGlobalValueIndirectSym(GlobalValue *V, void *GVAddress); - void getRelocatableGVs(SmallVectorImpl &GVs, - SmallVectorImpl &Ptrs); - /// getGOTIndexForAddress - Return a new or existing index in the GOT for /// an address. This function only manages slots, it does not manage the /// contents of the slots or the memory associated with the GOT. @@ -398,7 +385,6 @@ /// classof - Methods for support type inquiry through isa, cast, and /// dyn_cast: /// - static inline bool classof(const JITEmitter*) { return true; } static inline bool classof(const MachineCodeEmitter*) { return true; } JITResolver &getJITResolver() { return Resolver; } @@ -480,26 +466,10 @@ if (DE.get()) DE->setModuleInfo(Info); } - void setMemoryExecutable() { - MemMgr->setMemoryExecutable(); - } - - JITMemoryManager *getMemMgr() const { return MemMgr; } - private: void *getPointerToGlobal(GlobalValue *GV, void *Reference, bool MayNeedFarStub); void *getPointerToGVIndirectSym(GlobalValue *V, void *Reference); - unsigned addSizeOfGlobal(const GlobalVariable *GV, unsigned Size); - unsigned addSizeOfGlobalsInConstantVal( - const Constant *C, unsigned Size, - SmallPtrSet &SeenGlobals, - SmallVectorImpl &Worklist); - unsigned addSizeOfGlobalsInInitializer( - const Constant *Init, unsigned Size, - SmallPtrSet &SeenGlobals, - SmallVectorImpl &Worklist); - unsigned GetSizeOfGlobalsInBytes(MachineFunction &MF); }; } @@ -507,39 +477,6 @@ JRS->EraseAllCallSitesForPrelocked(F); } -Function *JITResolverState::EraseStub(const MutexGuard &locked, void *Stub) { - CallSiteToFunctionMapTy::iterator C2F_I = - CallSiteToFunctionMap.find(Stub); - if (C2F_I == CallSiteToFunctionMap.end()) { - // Not a stub. - return NULL; - } - - StubToResolverMap->UnregisterStubResolver(Stub); - - Function *const F = C2F_I->second; -#ifndef NDEBUG - void *RealStub = FunctionToLazyStubMap.lookup(F); - assert(RealStub == Stub && - "Call-site that wasn't a stub passed in to EraseStub"); -#endif - FunctionToLazyStubMap.erase(F); - CallSiteToFunctionMap.erase(C2F_I); - - // Remove the stub from the function->call-sites map, and remove the whole - // entry from the map if that was the last call site. - FunctionToCallSitesMapTy::iterator F2C_I = FunctionToCallSitesMap.find(F); - assert(F2C_I != FunctionToCallSitesMap.end() && - "FunctionToCallSitesMap broken"); - bool Erased = F2C_I->second.erase(Stub); - (void)Erased; - assert(Erased && "FunctionToCallSitesMap broken"); - if (F2C_I->second.empty()) - FunctionToCallSitesMap.erase(F2C_I); - - return F; -} - void JITResolverState::EraseAllCallSitesForPrelocked(Function *F) { FunctionToCallSitesMapTy::iterator F2C = FunctionToCallSitesMap.find(F); if (F2C == FunctionToCallSitesMap.end()) @@ -690,28 +627,6 @@ return idx; } -void JITResolver::getRelocatableGVs(SmallVectorImpl &GVs, - SmallVectorImpl &Ptrs) { - MutexGuard locked(TheJIT->lock); - - const FunctionToLazyStubMapTy &FM = state.getFunctionToLazyStubMap(locked); - GlobalToIndirectSymMapTy &GM = state.getGlobalToIndirectSymMap(locked); - - for (FunctionToLazyStubMapTy::const_iterator i = FM.begin(), e = FM.end(); - i != e; ++i){ - Function *F = i->first; - if (F->isDeclaration() && F->hasExternalLinkage()) { - GVs.push_back(i->first); - Ptrs.push_back(i->second); - } - } - for (GlobalToIndirectSymMapTy::iterator i = GM.begin(), e = GM.end(); - i != e; ++i) { - GVs.push_back(i->first); - Ptrs.push_back(i->second); - } -} - /// JITCompilerFn - This function is called when a lazy compilation stub has /// been entered. It looks up which function this stub corresponds to, compiles /// it if necessary, then returns the resultant function pointer. @@ -859,167 +774,6 @@ return Size; } -/// addSizeOfGlobal - add the size of the global (plus any alignment padding) -/// into the running total Size. - -unsigned JITEmitter::addSizeOfGlobal(const GlobalVariable *GV, unsigned Size) { - const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)TheJIT->getTargetData()->getTypeAllocSize(ElTy); - size_t GVAlign = - (size_t)TheJIT->getTargetData()->getPreferredAlignment(GV); - DEBUG(dbgs() << "JIT: Adding in size " << GVSize << " alignment " << GVAlign); - DEBUG(GV->dump()); - // Assume code section ends with worst possible alignment, so first - // variable needs maximal padding. - if (Size==0) - Size = 1; - Size = ((Size+GVAlign-1)/GVAlign)*GVAlign; - Size += GVSize; - return Size; -} - -/// addSizeOfGlobalsInConstantVal - find any globals that we haven't seen yet -/// but are referenced from the constant; put them in SeenGlobals and the -/// Worklist, and add their size into the running total Size. - -unsigned JITEmitter::addSizeOfGlobalsInConstantVal( - const Constant *C, - unsigned Size, - SmallPtrSet &SeenGlobals, - SmallVectorImpl &Worklist) { - // If its undefined, return the garbage. - if (isa(C)) - return Size; - - // If the value is a ConstantExpr - if (const ConstantExpr *CE = dyn_cast(C)) { - Constant *Op0 = CE->getOperand(0); - switch (CE->getOpcode()) { - case Instruction::GetElementPtr: - case Instruction::Trunc: - case Instruction::ZExt: - case Instruction::SExt: - case Instruction::FPTrunc: - case Instruction::FPExt: - case Instruction::UIToFP: - case Instruction::SIToFP: - case Instruction::FPToUI: - case Instruction::FPToSI: - case Instruction::PtrToInt: - case Instruction::IntToPtr: - case Instruction::BitCast: { - Size = addSizeOfGlobalsInConstantVal(Op0, Size, SeenGlobals, Worklist); - break; - } - case Instruction::Add: - case Instruction::FAdd: - case Instruction::Sub: - case Instruction::FSub: - case Instruction::Mul: - case Instruction::FMul: - case Instruction::UDiv: - case Instruction::SDiv: - case Instruction::URem: - case Instruction::SRem: - case Instruction::And: - case Instruction::Or: - case Instruction::Xor: { - Size = addSizeOfGlobalsInConstantVal(Op0, Size, SeenGlobals, Worklist); - Size = addSizeOfGlobalsInConstantVal(CE->getOperand(1), Size, - SeenGlobals, Worklist); - break; - } - default: { - std::string msg; - raw_string_ostream Msg(msg); - Msg << "ConstantExpr not handled: " << *CE; - report_fatal_error(Msg.str()); - } - } - } - - if (C->getType()->getTypeID() == Type::PointerTyID) - if (const GlobalVariable* GV = dyn_cast(C)) - if (SeenGlobals.insert(GV)) { - Worklist.push_back(GV); - Size = addSizeOfGlobal(GV, Size); - } - - return Size; -} - -/// addSizeOfGLobalsInInitializer - handle any globals that we haven't seen yet -/// but are referenced from the given initializer. - -unsigned JITEmitter::addSizeOfGlobalsInInitializer( - const Constant *Init, - unsigned Size, - SmallPtrSet &SeenGlobals, - SmallVectorImpl &Worklist) { - if (!isa(Init) && - !isa(Init) && - !isa(Init) && - !isa(Init) && - !isa(Init) && - Init->getType()->isFirstClassType()) - Size = addSizeOfGlobalsInConstantVal(Init, Size, SeenGlobals, Worklist); - return Size; -} - -/// GetSizeOfGlobalsInBytes - walk the code for the function, looking for -/// globals; then walk the initializers of those globals looking for more. -/// If their size has not been considered yet, add it into the running total -/// Size. - -unsigned JITEmitter::GetSizeOfGlobalsInBytes(MachineFunction &MF) { - unsigned Size = 0; - SmallPtrSet SeenGlobals; - - for (MachineFunction::iterator MBB = MF.begin(), E = MF.end(); - MBB != E; ++MBB) { - for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end(); - I != E; ++I) { - const TargetInstrDesc &Desc = I->getDesc(); - const MachineInstr &MI = *I; - unsigned NumOps = Desc.getNumOperands(); - for (unsigned CurOp = 0; CurOp < NumOps; CurOp++) { - const MachineOperand &MO = MI.getOperand(CurOp); - if (MO.isGlobal()) { - const GlobalValue* V = MO.getGlobal(); - const GlobalVariable *GV = dyn_cast(V); - if (!GV) - continue; - // If seen in previous function, it will have an entry here. - if (TheJIT->getPointerToGlobalIfAvailable( - const_cast(GV))) - continue; - // If seen earlier in this function, it will have an entry here. - // FIXME: it should be possible to combine these tables, by - // assuming the addresses of the new globals in this module - // start at 0 (or something) and adjusting them after codegen - // complete. Another possibility is to grab a marker bit in GV. - if (SeenGlobals.insert(GV)) - // A variable as yet unseen. Add in its size. - Size = addSizeOfGlobal(GV, Size); - } - } - } - } - DEBUG(dbgs() << "JIT: About to look through initializers\n"); - // Look for more globals that are referenced only from initializers. - SmallVector Worklist( - SeenGlobals.begin(), SeenGlobals.end()); - while (!Worklist.empty()) { - const GlobalVariable* GV = Worklist.back(); - Worklist.pop_back(); - if (GV->hasInitializer()) - Size = addSizeOfGlobalsInInitializer(GV->getInitializer(), Size, - SeenGlobals, Worklist); - } - - return Size; -} - void JITEmitter::startFunction(MachineFunction &F) { DEBUG(dbgs() << "JIT: Starting CodeGen of Function " << F.getFunction()->getName() << "\n"); From bigcheesegs at gmail.com Sun Aug 22 23:45:37 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Mon, 23 Aug 2010 04:45:37 -0000 Subject: [llvm-commits] [llvm] r111792 - in /llvm/trunk/lib: MC/MCAsmInfoCOFF.cpp Target/X86/X86ISelLowering.cpp Message-ID: <20100823044537.51C592A6C12C@llvm.org> Author: mspencer Date: Sun Aug 22 23:45:37 2010 New Revision: 111792 URL: http://llvm.org/viewvc/llvm-project?rev=111792&view=rev Log: Workaround broken jump tables on x86-64 COFF. Modified: llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp?rev=111792&r1=111791&r2=111792&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp Sun Aug 22 23:45:37 2010 @@ -20,6 +20,7 @@ GlobalPrefix = "_"; COMMDirectiveAlignmentIsInBytes = false; HasLCOMMDirective = true; + HasSetDirective = false; HasDotTypeDotSizeDirective = false; HasSingleParameterDotFile = false; PrivateGlobalPrefix = "L"; // Prefix for private global symbols Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=111792&r1=111791&r2=111792&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Aug 22 23:45:37 2010 @@ -1029,6 +1029,12 @@ maxStoresPerMemmove = 3; // For @llvm.memmove -> sequence of stores setPrefLoopAlignment(16); benefitFromCodePlacementOpt = true; + + // FIXME: Jump tables are currently broken for 64 bit COFF. + // See PR7960. + if (Subtarget->is64Bit() && Subtarget->isTargetCOFF()) { + DisableJumpTables = true; + } }