[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.242 -> 1.243 --- Log message: Back out the last patch which is a nightly test killer. The assertion in getLocalSlot fires on many, many values. It broke nearly all of the dejagnu tests. Simple changes to the assertion did not fix the problem. --- Diffs of the changes: (+63 -63) AsmWriter.cpp | 126 +- 1 files changed, 63 insertions(+), 63 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.242 llvm/lib/VMCore/AsmWriter.cpp:1.243 --- llvm/lib/VMCore/AsmWriter.cpp:1.242 Wed Jan 10 01:01:46 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Wed Jan 10 03:18:16 2007 @@ -75,9 +75,9 @@ /// @{ public: /// Return the slot number of the specified value in it's type - /// plane. If something is not in the SlotMachine, return -1. - int getLocalSlot(const Value *V); - int getGlobalSlot(const GlobalValue *V); + /// plane. Its an error to ask for something not in the SlotMachine. + /// Its an error to ask for a Type* + int getSlot(const Value *V); /// @} /// @name Mutators @@ -597,20 +597,13 @@ } else { int Slot; if (Machine) { -if (const GlobalValue *GV = dyn_cast(V)) - Slot = Machine->getGlobalSlot(GV); -else - Slot = Machine->getLocalSlot(V); +Slot = Machine->getSlot(V); } else { Machine = createSlotMachine(V); -if (Machine) { - if (const GlobalValue *GV = dyn_cast(V)) -Slot = Machine->getGlobalSlot(GV); - else -Slot = Machine->getLocalSlot(V); -} else { +if (Machine) + Slot = Machine->getSlot(V); +else Slot = -1; -} delete Machine; } if (Slot != -1) @@ -1049,7 +1042,7 @@ Out << "\n" << getLLVMName(BB->getName(), false) << ':'; } else if (!BB->use_empty()) { // Don't print block # of no uses... Out << "\n; :"; -int Slot = Machine.getLocalSlot(BB); +int Slot = Machine.getSlot(BB); if (Slot != -1) Out << Slot; else @@ -1098,7 +1091,7 @@ printType(V.getType()) << '>'; if (!V.hasName()) { - int SlotNum = Machine.getLocalSlot(&V); + int SlotNum = Machine.getSlot(&V); if (SlotNum == -1) Out << ":"; else @@ -1412,7 +1405,7 @@ { } -inline void SlotMachine::initialize() { +inline void SlotMachine::initialize(void) { if (TheModule) { processModule(); TheModule = 0; ///< Prevent re-processing next time we're called. @@ -1470,7 +1463,7 @@ } /// Clean up after incorporating a function. This is the only way to get out of -/// the function incorporation state that affects get*Slot/Create*Slot. Function +/// the function incorporation state that affects getSlot/Create*Slot. Function /// incorporation state is indicated by TheFunction != 0. void SlotMachine::purgeFunction() { SC_DEBUG("begin purgeFunction!\n"); @@ -1480,57 +1473,64 @@ SC_DEBUG("end purgeFunction!\n"); } -/// getGlobalSlot - Get the slot number of a global value. -int SlotMachine::getGlobalSlot(const GlobalValue *V) { - // Check for uninitialized state and do lazy initialization. - initialize(); - - // Find the type plane in the module map - TypedPlanes::const_iterator MI = mMap.find(V->getType()); - if (MI == mMap.end()) return -1; - - // Lookup the value in the module plane's map. - ValueMap::const_iterator MVI = MI->second.map.find(V); - return MVI != MI->second.map.end() ? MVI->second : -1; -} - - -/// getLocalSlot - Get the slot number for a value that is local to a function. -int SlotMachine::getLocalSlot(const Value *V) { - assert(!isa(V) && "Can't get a constant or global slot with this!"); +/// Get the slot number for a value. This function will assert if you +/// ask for a Value that hasn't previously been inserted with Create*Slot. +int SlotMachine::getSlot(const Value *V) { + assert(V && "Can't get slot for null Value"); + assert(!isa(V) || isa(V) && +"Can't insert a non-GlobalValue Constant into SlotMachine"); - // Check for uninitialized state and do lazy initialization. - initialize(); + // Check for uninitialized state and do lazy initialization + this->initialize(); // Get the type of the value - const Type *VTy = V->getType(); + const Type* VTy = V->getType(); - TypedPlanes::const_iterator FI = fMap.find(VTy); - if (FI == fMap.end()) return -1; - - // Lookup the Value in the function and module maps. - ValueMap::const_iterator FVI = FI->second.map.find(V); + // Find the type plane in the module map TypedPlanes::const_iterator MI = mMap.find(VTy); - - // If the value doesn't exist in the function map - if (FVI == FI->second.map.end()) { -// Look up the value in the module map. -if (MI == mMap.end()) return -1; -ValueMap::const_iterator MVI = MI->second.map.find(V); -// If we didn't find it, i
Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Chris, This patch broke most tests. I reverted it so that some of the nightly testers won't get too damaged. I tried a couple things to work around the assert but it seems there are bigger issues. Revert was the only thing I could do in a timely fashion. Reid. On Wed, 2007-01-10 at 01:02 -0600, Chris Lattner wrote: > > Changes in directory llvm/lib/VMCore: > > AsmWriter.cpp updated: 1.241 -> 1.242 > --- > Log message: > > Last refactoring before PR645: http://llvm.org/PR645 : split up getSlot into > getLocalSlot and getGlobalSlot. > No functionality change. > > > --- > Diffs of the changes: (+63 -63) > > AsmWriter.cpp | 126 > +- > 1 files changed, 63 insertions(+), 63 deletions(-) > > > Index: llvm/lib/VMCore/AsmWriter.cpp > diff -u llvm/lib/VMCore/AsmWriter.cpp:1.241 > llvm/lib/VMCore/AsmWriter.cpp:1.242 > --- llvm/lib/VMCore/AsmWriter.cpp:1.241 Wed Jan 10 00:43:26 2007 > +++ llvm/lib/VMCore/AsmWriter.cpp Wed Jan 10 01:01:46 2007 > @@ -75,9 +75,9 @@ > /// @{ > public: >/// Return the slot number of the specified value in it's type > - /// plane. Its an error to ask for something not in the SlotMachine. > - /// Its an error to ask for a Type* > - int getSlot(const Value *V); > + /// plane. If something is not in the SlotMachine, return -1. > + int getLocalSlot(const Value *V); > + int getGlobalSlot(const GlobalValue *V); > > /// @} > /// @name Mutators > @@ -597,13 +597,20 @@ > } else { >int Slot; >if (Machine) { > -Slot = Machine->getSlot(V); > +if (const GlobalValue *GV = dyn_cast(V)) > + Slot = Machine->getGlobalSlot(GV); > +else > + Slot = Machine->getLocalSlot(V); >} else { > Machine = createSlotMachine(V); > -if (Machine) > - Slot = Machine->getSlot(V); > -else > +if (Machine) { > + if (const GlobalValue *GV = dyn_cast(V)) > +Slot = Machine->getGlobalSlot(GV); > + else > +Slot = Machine->getLocalSlot(V); > +} else { >Slot = -1; > +} > delete Machine; >} >if (Slot != -1) > @@ -1042,7 +1049,7 @@ > Out << "\n" << getLLVMName(BB->getName(), false) << ':'; >} else if (!BB->use_empty()) { // Don't print block # of no uses... > Out << "\n; :"; > -int Slot = Machine.getSlot(BB); > +int Slot = Machine.getLocalSlot(BB); > if (Slot != -1) >Out << Slot; > else > @@ -1091,7 +1098,7 @@ > printType(V.getType()) << '>'; > > if (!V.hasName()) { > - int SlotNum = Machine.getSlot(&V); > + int SlotNum = Machine.getLocalSlot(&V); >if (SlotNum == -1) > Out << ":"; >else > @@ -1405,7 +1412,7 @@ > { > } > > -inline void SlotMachine::initialize(void) { > +inline void SlotMachine::initialize() { >if (TheModule) { > processModule(); > TheModule = 0; ///< Prevent re-processing next time we're called. > @@ -1463,7 +1470,7 @@ > } > > /// Clean up after incorporating a function. This is the only way to get out > of > -/// the function incorporation state that affects getSlot/Create*Slot. > Function > +/// the function incorporation state that affects get*Slot/Create*Slot. > Function > /// incorporation state is indicated by TheFunction != 0. > void SlotMachine::purgeFunction() { >SC_DEBUG("begin purgeFunction!\n"); > @@ -1473,64 +1480,57 @@ >SC_DEBUG("end purgeFunction!\n"); > } > > -/// Get the slot number for a value. This function will assert if you > -/// ask for a Value that hasn't previously been inserted with Create*Slot. > -int SlotMachine::getSlot(const Value *V) { > - assert(V && "Can't get slot for null Value"); > - assert(!isa(V) || isa(V) && > -"Can't insert a non-GlobalValue Constant into SlotMachine"); > +/// getGlobalSlot - Get the slot number of a global value. > +int SlotMachine::getGlobalSlot(const GlobalValue *V) { > + // Check for uninitialized state and do lazy initialization. > + initialize(); > + > + // Find the type plane in the module map > + TypedPlanes::const_iterator MI = mMap.find(V->getType()); > + if (MI == mMap.end()) return -1; > + > + // Lookup the value in the module plane's map. > + ValueMap::const_iterator MVI = MI->second.map.find(V); > + return MVI != MI->second.map.end() ? MVI->second : -1; > +} > > - // Check for uninitialized state and do lazy initialization > - this->initialize(); > > - // Get the type of the value > - const Type* VTy = V->getType(); > +/// getLocalSlot - Get the slot number for a value that is local to a > function. > +int SlotMachine::getLocalSlot(const Value *V) { > + assert(!isa(V) && "Can't get a constant or global slot with > this!"); > > - // Find the type plane in the module map > - TypedPlanes::const_iterator MI = mMap.find(VTy); > + // Check for uninitialized state and do lazy initialization. >
[llvm-commits] CVS: llvm-test/RunSafely.sh TimedExec.sh
Changes in directory llvm-test: RunSafely.sh updated: 1.24 -> 1.25 TimedExec.sh updated: 1.4 -> 1.5 --- Log message: The proper operator for testing string equality is "=", not "==". --- Diffs of the changes: (+2 -2) RunSafely.sh |2 +- TimedExec.sh |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.24 llvm-test/RunSafely.sh:1.25 --- llvm-test/RunSafely.sh:1.24 Tue Nov 28 01:16:45 2006 +++ llvm-test/RunSafely.sh Wed Jan 10 11:51:45 2007 @@ -76,7 +76,7 @@ # necessary I/O redirection. # COMMAND="$PROGRAM $*" -if [ $SYSTEM == Darwin ]; then +if [ "$SYSTEM" = "Darwin" ]; then COMMAND="${DIR}TimedExec.sh $ULIMIT $COMMAND" fi Index: llvm-test/TimedExec.sh diff -u llvm-test/TimedExec.sh:1.4 llvm-test/TimedExec.sh:1.5 --- llvm-test/TimedExec.sh:1.4 Thu Jun 15 02:25:13 2006 +++ llvm-test/TimedExec.sh Wed Jan 10 11:51:45 2007 @@ -13,7 +13,7 @@ fi PARENT="" -if [ "$1" == "-p" ]; then +if [ "$1" = "-p" ]; then PARENT=$2; shift; shift; fi ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/SignlessTypes/ccc.c
Changes in directory llvm-test/SingleSource/UnitTests/SignlessTypes: ccc.c added (r1.1) --- Log message: A little test for parameter attributes. --- Diffs of the changes: (+54 -0) ccc.c | 54 ++ 1 files changed, 54 insertions(+) Index: llvm-test/SingleSource/UnitTests/SignlessTypes/ccc.c diff -c /dev/null llvm-test/SingleSource/UnitTests/SignlessTypes/ccc.c:1.1 *** /dev/null Wed Jan 10 11:54:12 2007 --- llvm-test/SingleSource/UnitTests/SignlessTypes/ccc.cWed Jan 10 11:54:02 2007 *** *** 0 --- 1,54 + /* + * This file is used to the C calling conventions with signless + * LLVM. Integer arguments in this convention are promoted to at + * least a 32-bit size. Consequently signed values must be + * sign extended and unsigned values must be zero extended to + * at least a 32-bit integer type. + */ + + #include + #include + + int Y = 0; + + int ubyteArg( unsigned char X) { + return X + 2 + Y; + } + + int sbyteArg( signed char X ) { + return X + 3 + Y; + } + + int ushortArg( unsigned short X ) { + return X + 4 + Y; + } + + int sshortArg( signed short X) { + return X + 5 + Y; + } + + int F1, F2, F3, F4; + + int main(int argc, char**argv) { + int TestVal; + short sh; + unsigned short ush; + + if (argc < 2) { + fprintf(stderr, "Program requires integer parameter"); + exit (1); + } + + F1 = (int)(void*)ubyteArg; + F2 = (int)(void*)sbyteArg; + F3 = (int)(void*)ushortArg; + F4 = (int)(void*)sshortArg; + + TestVal = atoi(argv[1]); + sh = (short)-1; + ush = (unsigned short) -1; + + printf("%d %hd %hu", TestVal, sh, ush); + + return TestVal; + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp PoolAllocate.cpp PoolOptimize.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.74 -> 1.75 PoolAllocate.cpp updated: 1.130 -> 1.131 PoolOptimize.cpp updated: 1.9 -> 1.10 --- Log message: Update to the new Statistic interface. --- Diffs of the changes: (+12 -14) PointerCompress.cpp |8 +++- PoolAllocate.cpp| 16 PoolOptimize.cpp|2 +- 3 files changed, 12 insertions(+), 14 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.74 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.75 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.74Wed Dec 13 23:51:07 2006 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Jan 10 12:10:32 2007 @@ -55,11 +55,9 @@ cl::desc("Enable Andrew's fixes/hacks")); - Statistic NumCompressed("pointercompress", -"Number of pools pointer compressed"); - Statistic NumNotCompressed("pointercompress", - "Number of pools not compressible"); - Statistic NumCloned("pointercompress", "Number of functions cloned"); + STATISTIC (NumCompressed, "Number of pools pointer compressed"); + STATISTIC (NumNotCompressed, "Number of pools not compressible"); + STATISTIC (NumCloned, "Number of functions cloned"); class CompressedPoolInfo; Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.130 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.131 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.130 Tue Dec 19 17:10:34 2006 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cppWed Jan 10 12:10:32 2007 @@ -58,14 +58,14 @@ RegisterPass Y("poolalloc-passing-all-pools", "Pool allocate disjoint data structures"); - Statistic NumArgsAdded("poolalloc", "Number of function arguments added"); - Statistic MaxArgsAdded("poolalloc", "Maximum function arguments added to one function"); - Statistic NumCloned ("poolalloc", "Number of functions cloned"); - Statistic NumPools("poolalloc", "Number of pools allocated"); - Statistic NumTSPools ("poolalloc", "Number of typesafe pools"); - Statistic NumPoolFree ("poolalloc", "Number of poolfree's elided"); - Statistic NumNonprofit("poolalloc", "Number of DSNodes not profitable"); - Statistic NumColocated("poolalloc", "Number of DSNodes colocated"); + STATISTIC (NumArgsAdded, "Number of function arguments added"); + STATISTIC (MaxArgsAdded, "Maximum function arguments added to one function"); + STATISTIC (NumCloned , "Number of functions cloned"); + STATISTIC (NumPools, "Number of pools allocated"); + STATISTIC (NumTSPools , "Number of typesafe pools"); + STATISTIC (NumPoolFree , "Number of poolfree's elided"); + STATISTIC (NumNonprofit, "Number of DSNodes not profitable"); + STATISTIC (NumColocated, "Number of DSNodes colocated"); const Type *VoidPtrTy; Index: llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp:1.9 llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp:1.10 --- llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp:1.9Wed Dec 13 14:06:42 2006 +++ llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cppWed Jan 10 12:10:32 2007 @@ -20,7 +20,7 @@ using namespace llvm; namespace { - Statistic NumBumpPtr("poolalloc", "Number of bump pointer pools"); + STATISTIC (NumBumpPtr, "Number of bump pointer pools"); struct PoolOptimize : public ModulePass { bool runOnModule(Module &M); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructure.cpp DataStructureOpt.cpp DataStructureStats.cpp EquivClassGraphs.cpp Local.cpp Printer
Changes in directory llvm-poolalloc/lib/DSA: BottomUpClosure.cpp updated: 1.128 -> 1.129 CallTargets.cpp updated: 1.8 -> 1.9 CompleteBottomUp.cpp updated: 1.40 -> 1.41 DataStructure.cpp updated: 1.256 -> 1.257 DataStructureOpt.cpp updated: 1.15 -> 1.16 DataStructureStats.cpp updated: 1.25 -> 1.26 EquivClassGraphs.cpp updated: 1.54 -> 1.55 Local.cpp updated: 1.164 -> 1.165 Printer.cpp updated: 1.92 -> 1.93 TopDownClosure.cpp updated: 1.96 -> 1.97 --- Log message: Update to the new Statistic interface. --- Diffs of the changes: (+30 -35) BottomUpClosure.cpp|6 +++--- CallTargets.cpp|8 CompleteBottomUp.cpp |2 +- DataStructure.cpp | 14 +++--- DataStructureOpt.cpp |6 ++ DataStructureStats.cpp | 13 + EquivClassGraphs.cpp |4 ++-- Local.cpp |6 +++--- Printer.cpp|4 ++-- TopDownClosure.cpp |2 +- 10 files changed, 30 insertions(+), 35 deletions(-) Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.128 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.129 --- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.128Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Wed Jan 10 12:10:32 2007 @@ -26,9 +26,9 @@ using namespace llvm; namespace { - Statistic MaxSCC("budatastructure", "Maximum SCC Size in Call Graph"); - Statistic NumBUInlines("budatastructures", "Number of graphs inlined"); - Statistic NumCallEdges("budatastructures", "Number of 'actual' call edges"); + STATISTIC (MaxSCC, "Maximum SCC Size in Call Graph"); + STATISTIC (NumBUInlines, "Number of graphs inlined"); + STATISTIC (NumCallEdges, "Number of 'actual' call edges"); cl::opt AddGlobals("budatastructures-annotate-calls", cl::Hidden, Index: llvm-poolalloc/lib/DSA/CallTargets.cpp diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.8 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.9 --- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.8 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/lib/DSA/CallTargets.cpp Wed Jan 10 12:10:32 2007 @@ -29,10 +29,10 @@ using namespace llvm; namespace { - Statistic DirCall("calltarget", "Number of direct calls"); - Statistic IndCall("calltarget", "Number of indirect calls"); - Statistic CompleteInd("calltarget", "Number of complete indirect calls"); - Statistic CompleteEmpty("calltarget", "Number of complete empty calls"); + STATISTIC (DirCall, "Number of direct calls"); + STATISTIC (IndCall, "Number of indirect calls"); + STATISTIC (CompleteInd, "Number of complete indirect calls"); + STATISTIC (CompleteEmpty, "Number of complete empty calls"); RegisterPass X("calltarget","Find Call Targets (uses DSA)"); } Index: llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp diff -u llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.40 llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.41 --- llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.40Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp Wed Jan 10 12:10:32 2007 @@ -26,7 +26,7 @@ namespace { RegisterPass X("cbudatastructure", "'Complete' Bottom-up Data Structure Analysis"); - Statistic NumCBUInlines("cbudatastructures", "Number of graphs inlined"); + STATISTIC (NumCBUInlines, "Number of graphs inlined"); } Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.256 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.257 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.256 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/lib/DSA/DataStructure.cppWed Jan 10 12:10:32 2007 @@ -38,14 +38,14 @@ #define COLLAPSE_ARRAYS_AGGRESSIVELY 0 namespace { - Statistic NumFolds ("dsa", "Number of nodes completely folded"); - Statistic NumCallNodesMerged("dsa", "Number of call nodes merged"); - Statistic NumNodeAllocated ("dsa", "Number of nodes allocated"); - Statistic NumDNE("dsa", "Number of nodes removed by reachability"); - Statistic NumTrivialDNE ("dsa", "Number of nodes trivially removed"); - Statistic NumTrivialGlobalDNE("dsa", "Number of globals trivially removed"); + STATISTIC (NumFolds, "Number of nodes completely folded"); + STATISTIC (NumCallNodesMerged, "Number of call nodes merged"); + STATISTIC (NumNodeAllocated , "Number of nodes allocated"); + STATISTIC (NumDNE, "Number of nodes removed by reachability"); + STATISTIC (NumTrivialDNE , "Number of nodes trivially removed"); + STATISTIC (NumTrivialGlobalDNE, "Number of globals trivially removed"); #ifdef LLVA_KERNEL - Statistic LostPools ("dsa", "Number of pools lost to DSNode Merge"); + STATISTIC (LostPools , "Number of pools lost to DSNode Merge"); #endif static cl::opt DSAFieldLimit("dsa-field-limit", cl::Hidden, Index: llvm-poolalloc/lib/DSA/DataStructureOpt.cpp diff -u llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.15 llvm-poolalloc/lib/DSA/DataStructureOpt.cp
[llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp
Changes in directory llvm/lib/System: DynamicLibrary.cpp updated: 1.18 -> 1.19 --- Log message: Allow LLI, in interpreter mode, to find stdin, stdout, and stderr. This is a bit of a hack but it lets some of the llvm-test programs run. --- Diffs of the changes: (+12 -2) DynamicLibrary.cpp | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) Index: llvm/lib/System/DynamicLibrary.cpp diff -u llvm/lib/System/DynamicLibrary.cpp:1.18 llvm/lib/System/DynamicLibrary.cpp:1.19 --- llvm/lib/System/DynamicLibrary.cpp:1.18 Wed Aug 30 15:37:06 2006 +++ llvm/lib/System/DynamicLibrary.cpp Wed Jan 10 13:50:43 2007 @@ -141,10 +141,11 @@ // important symbols are marked 'private external' which doesn't allow // SearchForAddressOfSymbol to find them. As such, we special case them here, // there is only a small handful of them. + #ifdef __APPLE__ - { #define EXPLICIT_SYMBOL(SYM) \ extern void *SYM; if (!strcmp(symbolName, #SYM)) return &SYM + { EXPLICIT_SYMBOL(__ashldi3); EXPLICIT_SYMBOL(__ashrdi3); EXPLICIT_SYMBOL(__cmpdi2); @@ -160,9 +161,18 @@ EXPLICIT_SYMBOL(__moddi3); EXPLICIT_SYMBOL(__udivdi3); EXPLICIT_SYMBOL(__umoddi3); -#undef EXPLICIT_SYMBOL } +#undef EXPLICIT_SYMBOL #endif +#define EXPLICIT_SYMBOL(SYM) \ + if (!strcmp(symbolName, #SYM)) return &SYM + // Try a few well known symbols just to give lli a shot at working. + { +EXPLICIT_SYMBOL(stdin); +EXPLICIT_SYMBOL(stdout); +EXPLICIT_SYMBOL(stderr); + } +#undef EXPLICIT_SYMBOL return 0; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/DSA/CallTargets.cpp DataStructureOpt.cpp DataStructureStats.cpp Local.cpp Makefile
Changes in directory llvm-poolalloc/lib/DSA: CallTargets.cpp updated: 1.9 -> 1.10 DataStructureOpt.cpp updated: 1.16 -> 1.17 DataStructureStats.cpp updated: 1.26 -> 1.27 Local.cpp updated: 1.165 -> 1.166 Makefile updated: 1.6 -> 1.7 --- Log message: Build a dynamically loadable library file. Update to latest and greatest LLVM API. --- Diffs of the changes: (+34 -16) CallTargets.cpp|1 + DataStructureOpt.cpp |1 + DataStructureStats.cpp |1 + Local.cpp | 44 Makefile |3 +++ 5 files changed, 34 insertions(+), 16 deletions(-) Index: llvm-poolalloc/lib/DSA/CallTargets.cpp diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.9 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.10 --- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.9 Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/CallTargets.cpp Wed Jan 10 13:59:52 2007 @@ -23,6 +23,7 @@ #include "dsa/DSGraph.h" #include "dsa/CallTargets.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/Streams.h" #include "llvm/Constants.h" #include Index: llvm-poolalloc/lib/DSA/DataStructureOpt.cpp diff -u llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.16 llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.17 --- llvm-poolalloc/lib/DSA/DataStructureOpt.cpp:1.16Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/DataStructureOpt.cpp Wed Jan 10 13:59:52 2007 @@ -19,6 +19,7 @@ #include "llvm/Constant.h" #include "llvm/Type.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Debug.h" using namespace llvm; namespace { Index: llvm-poolalloc/lib/DSA/DataStructureStats.cpp diff -u llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.26 llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.27 --- llvm-poolalloc/lib/DSA/DataStructureStats.cpp:1.26 Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/DataStructureStats.cpp Wed Jan 10 13:59:52 2007 @@ -19,6 +19,7 @@ #include "llvm/Support/InstVisitor.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Debug.h" #include using namespace llvm; Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.165 llvm-poolalloc/lib/DSA/Local.cpp:1.166 --- llvm-poolalloc/lib/DSA/Local.cpp:1.165 Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/Local.cppWed Jan 10 13:59:52 2007 @@ -171,7 +171,8 @@ void visitStoreInst(StoreInst &SI); void visitCallInst(CallInst &CI); void visitInvokeInst(InvokeInst &II); -void visitSetCondInst(SetCondInst &SCI); +void visitICmpInst(ICmpInst &I); +void visitFCmpInst(FCmpInst &I); void visitFreeInst(FreeInst &FI); void visitCastInst(CastInst &CI); void visitInstruction(Instruction &I); @@ -378,7 +379,14 @@ Dest.mergeWith(getValueDest(*SI.getOperand(2))); } -void GraphBuilder::visitSetCondInst(SetCondInst &SCI) { +void GraphBuilder::visitICmpInst(ICmpInst &SCI) { + if (!isPointerType(SCI.getOperand(0)->getType()) || + isa(SCI.getOperand(1))) return; // Only pointers + if(!IgnoreSetCC) +ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1))); +} + +void GraphBuilder::visitFCmpInst(FCmpInst &SCI) { if (!isPointerType(SCI.getOperand(0)->getType()) || isa(SCI.getOperand(1))) return; // Only pointers if(!IgnoreSetCC) @@ -481,8 +489,12 @@ I != E; ++I) if (const StructType *STy = dyn_cast(*I)) { const ConstantInt* CUI = cast(I.getOperand()); +#if 0 unsigned FieldNo = CUI->getType()->isSigned() ? CUI->getSExtValue() : CUI->getZExtValue(); +#else + int FieldNo = CUI->getSExtValue(); +#endif Offset += (unsigned)TD.getStructLayout(STy)->MemberOffsets[FieldNo]; } else if (isa(*I)) { if (!isa(I.getOperand()) || @@ -768,7 +780,7 @@ // argument node. const DSNodeHandle &EndPtrNH = getValueDest(**(CS.arg_begin()+1)); if (DSNode *End = EndPtrNH.getNode()) { -End->mergeTypeInfo(PointerType::get(Type::SByteTy), +End->mergeTypeInfo(PointerType::get(Type::Int8Ty), EndPtrNH.getOffset(), false); End->setModifiedMarker(); DSNodeHandle &Link = getLink(EndPtrNH); @@ -985,7 +997,7 @@ const DSNodeHandle &VAList = getValueDest(**AI); if (DSNode *N = VAList.getNode()) { N->setReadMarker(); -N->mergeTypeInfo(PointerType::get(Type::SByteTy), +N->mergeTypeInfo(PointerType::get(Type::Int8Ty), VAList.getOffset(), false); DSNodeHandle &VAListObjs = getLink(VAList); @@ -1133,7 +1145,7 @@ //Get the Module first Module * M = F->getParent(); //Now create a meta pool for this value, DSN Node -const Type * VoidPtrType = PointerType::get(Type::SByteTy); +const Type * VoidPtrType = PointerType::get(Type::Int8Ty); TheMetaPool = new
Re: [llvm-commits] llvm-gcc update
On Tue, 2007-01-09 at 17:38 -0800, Devang Patel wrote: > This patch synchronizes llvm-gcc with newer version of GCC 4.0 rom > Apple's GCC branch. I bootstrapped this successfully on darwin-x86 > box. If you run into any issues, let me know. Builds okay on x86-linux > > Thanks, > - > Devang > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Heuristic.cpp PointerCompress.cpp PoolAllocate.cpp PoolOptimize.cpp TransformFunctionBody.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: AccessTrace.cpp updated: 1.8 -> 1.9 Heuristic.cpp updated: 1.16 -> 1.17 PointerCompress.cpp updated: 1.75 -> 1.76 PoolAllocate.cpp updated: 1.131 -> 1.132 PoolOptimize.cpp updated: 1.10 -> 1.11 TransformFunctionBody.cpp updated: 1.60 -> 1.61 --- Log message: Updated to the latest version of LLVM: a) Updated all types to the new integer types. b) Updated to the new ICmp and FCmp instructions. --- Diffs of the changes: (+143 -103) AccessTrace.cpp |4 +- Heuristic.cpp |4 +- PointerCompress.cpp | 75 ++ PoolAllocate.cpp | 40 ++-- PoolOptimize.cpp | 57 -- TransformFunctionBody.cpp | 66 6 files changed, 143 insertions(+), 103 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp diff -u llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.8 llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.9 --- llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.8 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Wed Jan 10 14:44:31 2007 @@ -28,7 +28,7 @@ class PoolAccessTrace : public ModulePass { PoolAllocate *PoolAlloc; EquivClassGraphs *ECG; -Function *AccessTraceInitFn, *PoolAccessTraceFn; +Constant *AccessTraceInitFn, *PoolAccessTraceFn; const Type *VoidPtrTy; public: @@ -59,7 +59,7 @@ } void PoolAccessTrace::InitializeLibraryFunctions(Module &M) { - VoidPtrTy = PointerType::get(Type::SByteTy); + VoidPtrTy = PointerType::get(Type::Int8Ty); AccessTraceInitFn = M.getOrInsertFunction("poolaccesstraceinit", Type::VoidTy,NULL); Index: llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp diff -u llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.16 llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.17 --- llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.16 Wed Dec 13 23:51:07 2006 +++ llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp Wed Jan 10 14:44:31 2007 @@ -456,8 +456,8 @@ void OnlyOverheadHeuristic::HackFunctionBody(Function &F, std::map &PDs) { - Function *PoolInit = PA->PoolInit; - Function *PoolDestroy = PA->PoolDestroy; + Constant *PoolInit = PA->PoolInit; + Constant *PoolDestroy = PA->PoolDestroy; Value *NullPD = getDynamicallyNullPool(F.front().begin()); for (std::map::iterator PDI = PDs.begin(), Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.75 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.76 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.75Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Jan 10 14:44:31 2007 @@ -34,8 +34,8 @@ using namespace llvm; /// MEMUINTTYPE - This is the actual type we are compressing to. This is really -/// only capable of being UIntTy, except when we are doing tests for 16-bit -/// integers, when it's UShortTy. +/// only capable of being Int32Ty, except when we are doing tests for 16-bit +/// integers, when it's Int16Ty. static const Type *MEMUINTTYPE; /// SCALARUINTTYPE - We keep scalars the same size as the machine word on the @@ -115,7 +115,7 @@ std::map CompressedGlobalPools; public: -Function *PoolInitPC, *PoolDestroyPC, *PoolAllocPC; +Constant *PoolInitPC, *PoolDestroyPC, *PoolAllocPC; typedef std::map PoolInfoMap; /// NoArgFunctionsCalled - When we are walking the call graph, keep track of @@ -284,7 +284,7 @@ assert(PoolBase == 0 && "Mixing and matching optimized vs not!"); // Get the pool base pointer. -Constant *Zero = Constant::getNullValue(Type::UIntTy); +Constant *Zero = Constant::getNullValue(Type::Int32Ty); Value *BasePtrPtr = new GetElementPtrInst(getPoolDesc(), Zero, Zero, "poolbaseptrptr", &I); return new LoadInst(BasePtrPtr, "poolbaseptr", &I); @@ -295,7 +295,7 @@ isa(PoolDesc))) { BasicBlock::iterator IP = I.getParent()->getParent()->begin()->begin(); while (isa(IP)) ++IP; - Constant *Zero = Constant::getNullValue(Type::UIntTy); + Constant *Zero = Constant::getNullValue(Type::Int32Ty); Value *BasePtrPtr = new GetElementPtrInst(getPoolDesc(), Zero, Zero, "poolbaseptrptr", IP); PoolBase = new LoadInst(BasePtrPtr, "poolbaseptr", IP); @@ -515,7 +515,8 @@ void visitCastInst(CastInst &CI); void visitPHINode(PHINode &PN); void visitSelectInst(SelectInst &SI); -void visitSetCondInst(SetCondInst &SCI); +void visitICmpInst(ICmpInst &I); +void visitFCmpInst(FCmpInst &I); void visitGetElementPtrInst(GetElementPtrInst &GEPI); void visitLoa
[llvm-commits] CVS: llvm-poolalloc/include/poolalloc/PoolAllocate.h
Changes in directory llvm-poolalloc/include/poolalloc: PoolAllocate.h updated: 1.52 -> 1.53 --- Log message: Updated to new LLVM API. --- Diffs of the changes: (+3 -3) PoolAllocate.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-poolalloc/include/poolalloc/PoolAllocate.h diff -u llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.52 llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.53 --- llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.52Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/include/poolalloc/PoolAllocate.h Wed Jan 10 14:45:21 2007 @@ -131,10 +131,10 @@ #ifdef SAFECODE ConvertUnsafeAllocas *CUAPass; #endif - Function *PoolInit, *PoolDestroy, *PoolAlloc, *PoolRealloc, *PoolMemAlign; - Function *PoolFree; + Constant *PoolInit, *PoolDestroy, *PoolAlloc, *PoolRealloc, *PoolMemAlign; + Constant *PoolFree; #if defined(SAFECODE) || defined(BOUNDS_CHECK) - Function *PoolRegister; + Constant *PoolRegister; #endif static const Type *PoolDescPtrTy; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.113 -> 1.114 --- Log message: Robustify assingPassManager() for Module, Function and Basic Block Passes. Robustify PMStack.push() Add dump() routine to print PMStack. --- Diffs of the changes: (+73 -37) PassManager.cpp | 110 +--- 1 files changed, 73 insertions(+), 37 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.113 llvm/lib/VMCore/PassManager.cpp:1.114 --- llvm/lib/VMCore/PassManager.cpp:1.113 Mon Jan 8 13:29:38 2007 +++ llvm/lib/VMCore/PassManager.cpp Wed Jan 10 18:19:00 2007 @@ -1616,14 +1616,39 @@ } // Push PM on the stack and set its top level manager. -void PMStack::push(PMDataManager *PM) { +void PMStack::push(Pass *P) { - PMDataManager *Top = this->top(); + PMDataManager *Top = NULL; + PMDataManager *PM = dynamic_cast(P); + assert (PM && "Unable to push. Pass Manager expected"); - // Inherit top level manager - PMTopLevelManager *TPM = Top->getTopLevelManager(); - PM->setTopLevelManager(TPM); - TPM->addIndirectPassManager(PM); + if (this->empty()) { +Top = PM; + } + else { +Top = this->top(); +PMTopLevelManager *TPM = Top->getTopLevelManager(); + +assert (TPM && "Unable to find top level manager"); +TPM->addIndirectPassManager(PM); +PM->setTopLevelManager(TPM); + } + + AnalysisResolver *AR = new AnalysisResolver(*Top); + P->setResolver(AR); + + S.push_back(PM); +} + +// Dump content of the pass manager stack. +void PMStack::dump() { + for(std::deque::iterator I = S.begin(), +E = S.end(); I != E; ++I) { +Pass *P = dynamic_cast(*I); +printf ("%s ", P->getPassName()); + } + if (!S.empty()) +printf ("\n"); } // Walk Pass Manager stack and set LastUse markers if any @@ -1662,7 +1687,6 @@ } assert(MPP && "Unable to find Module Pass Manager"); - MPP->addPassToManager(this); } @@ -1672,34 +1696,42 @@ FPPassManager *FPP = NULL; - // Find Module Pass Manager + // Find Module Pass Manager (TODO : Or Call Graph Pass Manager) while(!PMS.empty()) { FPP = dynamic_cast(PMS.top()); -if (FPP || dynamic_cast(PMS.top())) - break;// Found it or it is not here +if (FPP) + break;// Found Function Pass Manager +else if (dynamic_cast(PMS.top())) + PMS.pop();// Pop Basic Block Pass Manager +// TODO : else if Pop Loop Pass Manager else - PMS.pop();// Pop children pass managers + break;// PMS.top() is either Module Pass Manager or Call Graph +// Pass Manager } + // Create new Function Pass Manager if (!FPP) { -/// Create new Function Pass Manager - -/// Function Pass Manager does not live by itself assert(!PMS.empty() && "Unable to create Function Pass Manager"); - PMDataManager *PMD = PMS.top(); - -/// PMD should be either Module Pass Manager or Call Graph Pass Manager -assert(dynamic_cast(PMD) && - "Unable to create Function Pass Manager"); +// [1] Create new Function Pass Manager FPP = new FPPassManager(PMD->getDepth() + 1); -PMD->addPassToManager(FPP, false); + +// [2] Set up new manager's top level manager +PMTopLevelManager *TPM = PMD->getTopLevelManager(); +TPM->addIndirectPassManager(FPP); + +// [3] Assign manager to manage this new manager. This may create +// and push new managers into PMS +Pass *P = dynamic_cast(FPP); +P->assignPassManager(PMS); + +// [4] Push new manager into PMS PMS.push(FPP); } - + // Assign FPP as the manager of this pass. FPP->addPassToManager(this); } @@ -1709,33 +1741,37 @@ BBPassManager *BBP = NULL; - // Find Module Pass Manager - while(!PMS.empty()) { - + // Basic Pass Manager is a leaf pass manager. It does not handle + // any other pass manager. + if (!PMS.empty()) { BBP = dynamic_cast(PMS.top()); -if (BBP || dynamic_cast(PMS.top())) - break;// Found it or it is not here -else - PMS.pop();// Pop children pass managers } - if (!BBP) { -/// Create new BasicBlock Pass Manager + // If leaf manager is not Basic Block Pass manager then create new + // basic Block Pass manager. -/// BasicBlock Pass Manager does not live by itself + if (!BBP) { assert(!PMS.empty() && "Unable to create BasicBlock Pass Manager"); - PMDataManager *PMD = PMS.top(); - -/// PMD should be Function Pass Manager -assert(dynamic_cast(PMD) && - "Unable to create BasicBlock Pass Manager"); +// [1] Create new Basic Block Manager BBP = new BBPassManager(PMD->getDepth() + 1); -PMD->addPassToManager(BBP, false); + +// [2] Set up new manager's top level manager +// Basic Block Pass Manager does not live by itself +PMTopLevelManager *TPM = PMD->getTopLevelManager(); +TPM->addIndirectPassManager(BBP
[llvm-commits] CVS: llvm/include/llvm/Pass.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.71 -> 1.72 --- Log message: Robustify assingPassManager() for Module, Function and Basic Block Passes. Robustify PMStack.push() Add dump() routine to print PMStack. --- Diffs of the changes: (+4 -2) Pass.h |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.71 llvm/include/llvm/Pass.h:1.72 --- llvm/include/llvm/Pass.h:1.71 Mon Jan 8 13:29:38 2007 +++ llvm/include/llvm/Pass.hWed Jan 10 18:19:00 2007 @@ -52,6 +52,7 @@ class ModulePassManager; class PMStack; class AnalysisResolver; +class PMDataManager; // AnalysisID - Use the PassInfo to identify a pass... typedef const PassInfo* AnalysisID; @@ -106,6 +107,7 @@ void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); } void dump() const; // dump - call print(std::cerr, 0); + virtual void assignPassManager(PMStack &PMS) {} // Access AnalysisResolver inline void setResolver(AnalysisResolver *AR) { Resolver = AR; } inline AnalysisResolver *getResolver() { return Resolver; } @@ -329,7 +331,6 @@ /// /// PMStack is just a wrapper around standard deque that overrides pop() and /// push() methods. -class PMDataManager; class PMStack { public: typedef std::deque::reverse_iterator iterator; @@ -340,9 +341,10 @@ void pop(); inline PMDataManager *top() { return S.back(); } - void push(PMDataManager *PM); + void push(Pass *P); inline bool empty() { return S.empty(); } + void dump(); private: std::deque S; }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.125 -> 1.126 --- Log message: Implement better constant folding of unordered FCMP predicates. --- Diffs of the changes: (+27 -7) ConstantFolding.cpp | 34 +++--- 1 files changed, 27 insertions(+), 7 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.125 llvm/lib/VMCore/ConstantFolding.cpp:1.126 --- llvm/lib/VMCore/ConstantFolding.cpp:1.125 Wed Jan 3 20:13:20 2007 +++ llvm/lib/VMCore/ConstantFolding.cpp Wed Jan 10 18:25:45 2007 @@ -1110,18 +1110,38 @@ case FCmpInst::FCMP_FALSE: return ConstantBool::getFalse(); case FCmpInst::FCMP_TRUE: return ConstantBool::getTrue(); case FCmpInst::FCMP_UNO: -case FCmpInst::FCMP_ORD: break; // Can't fold these + return ConstantBool::get(C1Val != C1Val || C2Val != C2Val); +case FCmpInst::FCMP_ORD: + return ConstantBool::get(C1Val == C1Val && C2Val == C2Val); case FCmpInst::FCMP_UEQ: + if (C1Val != C1Val || C2Val != C2Val) +return ConstantBool::getTrue(); + /* FALL THROUGH */ case FCmpInst::FCMP_OEQ: return ConstantBool::get(C1Val == C2Val); -case FCmpInst::FCMP_ONE: -case FCmpInst::FCMP_UNE: return ConstantBool::get(C1Val != C2Val); -case FCmpInst::FCMP_OLT: -case FCmpInst::FCMP_ULT: return ConstantBool::get(C1Val < C2Val); +case FCmpInst::FCMP_UNE: + if (C1Val != C1Val || C2Val != C2Val) +return ConstantBool::getTrue(); + /* FALL THROUGH */ +case FCmpInst::FCMP_ONE: return ConstantBool::get(C1Val != C2Val); +case FCmpInst::FCMP_ULT: + if (C1Val != C1Val || C2Val != C2Val) +return ConstantBool::getTrue(); + /* FALL THROUGH */ +case FCmpInst::FCMP_OLT: return ConstantBool::get(C1Val < C2Val); case FCmpInst::FCMP_UGT: + if (C1Val != C1Val || C2Val != C2Val) +return ConstantBool::getTrue(); + /* FALL THROUGH */ case FCmpInst::FCMP_OGT: return ConstantBool::get(C1Val > C2Val); -case FCmpInst::FCMP_OLE: -case FCmpInst::FCMP_ULE: return ConstantBool::get(C1Val <= C2Val); +case FCmpInst::FCMP_ULE: + if (C1Val != C1Val || C2Val != C2Val) +return ConstantBool::getTrue(); + /* FALL THROUGH */ +case FCmpInst::FCMP_OLE: return ConstantBool::get(C1Val <= C2Val); case FCmpInst::FCMP_UGE: + if (C1Val != C1Val || C2Val != C2Val) +return ConstantBool::getTrue(); + /* FALL THROUGH */ case FCmpInst::FCMP_OGE: return ConstantBool::get(C1Val >= C2Val); } } else if (const ConstantPacked *CP1 = dyn_cast(C1)) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp
Changes in directory llvm/lib/System: DynamicLibrary.cpp updated: 1.19 -> 1.20 --- Log message: Avoid taking the address of a macro by checking to see if stdin is defined or not. This allows DynamicLibrary.cpp to compile on Darwin. --- Diffs of the changes: (+4 -0) DynamicLibrary.cpp |4 1 files changed, 4 insertions(+) Index: llvm/lib/System/DynamicLibrary.cpp diff -u llvm/lib/System/DynamicLibrary.cpp:1.19 llvm/lib/System/DynamicLibrary.cpp:1.20 --- llvm/lib/System/DynamicLibrary.cpp:1.19 Wed Jan 10 13:50:43 2007 +++ llvm/lib/System/DynamicLibrary.cpp Wed Jan 10 18:35:10 2007 @@ -167,10 +167,14 @@ #define EXPLICIT_SYMBOL(SYM) \ if (!strcmp(symbolName, #SYM)) return &SYM // Try a few well known symbols just to give lli a shot at working. + // Note that on some systems stdin, etc. are macros so we have to + // avoid attempting to take the address of a macro :) { +#ifndef stdin EXPLICIT_SYMBOL(stdin); EXPLICIT_SYMBOL(stdout); EXPLICIT_SYMBOL(stderr); +#endif } #undef EXPLICIT_SYMBOL ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp
Very Timely. grr. Cheers, -- Jim On 10-Jan-07, at 8:35 PM, Reid Spencer wrote: > > > Changes in directory llvm/lib/System: > > DynamicLibrary.cpp updated: 1.19 -> 1.20 > --- > Log message: > > Avoid taking the address of a macro by checking to see if stdin is > defined > or not. This allows DynamicLibrary.cpp to compile on Darwin. > > > --- > Diffs of the changes: (+4 -0) > > DynamicLibrary.cpp |4 > 1 files changed, 4 insertions(+) > > > Index: llvm/lib/System/DynamicLibrary.cpp > diff -u llvm/lib/System/DynamicLibrary.cpp:1.19 llvm/lib/System/ > DynamicLibrary.cpp:1.20 > --- llvm/lib/System/DynamicLibrary.cpp:1.19 Wed Jan 10 13:50:43 2007 > +++ llvm/lib/System/DynamicLibrary.cppWed Jan 10 18:35:10 2007 > @@ -167,10 +167,14 @@ > #define EXPLICIT_SYMBOL(SYM) \ > if (!strcmp(symbolName, #SYM)) return &SYM >// Try a few well known symbols just to give lli a shot at working. > + // Note that on some systems stdin, etc. are macros so we have to > + // avoid attempting to take the address of a macro :) >{ > +#ifndef stdin > EXPLICIT_SYMBOL(stdin); > EXPLICIT_SYMBOL(stdout); > EXPLICIT_SYMBOL(stderr); > +#endif >} > #undef EXPLICIT_SYMBOL > > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Pass.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.72 -> 1.73 --- Log message: Add PassManagerType enum. --- Diffs of the changes: (+12 -0) Pass.h | 12 1 files changed, 12 insertions(+) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.72 llvm/include/llvm/Pass.h:1.73 --- llvm/include/llvm/Pass.h:1.72 Wed Jan 10 18:19:00 2007 +++ llvm/include/llvm/Pass.hWed Jan 10 19:10:24 2007 @@ -323,6 +323,18 @@ virtual void assignPassManager(PMStack &PMS); }; +/// Different types of internal pass managers. External pass managers +/// (PassManager and FunctionPassManager) are not represented here. +/// Ordering of pass manager types is important here. +enum PassManagerType { + PMT_Unknown = 0, + PMT_ModulePassManager = 1, /// MPPassManager + PMT_CallGraphPassManager, /// CGPassManager + PMT_FunctionPassManager, /// FPPassManager + PMT_LoopPassManager, /// LPPassManager + PMT_BasicBlockPassManager /// BBPassManager +}; + /// PMStack /// Top level pass manager (see PasManager.cpp) maintains active Pass Managers /// using PMStack. Each Pass implements assignPassManager() to connect itself ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.114 -> 1.115 --- Log message: Add PassManagerType enum. --- Diffs of the changes: (+12 -0) PassManager.cpp | 12 1 files changed, 12 insertions(+) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.114 llvm/lib/VMCore/PassManager.cpp:1.115 --- llvm/lib/VMCore/PassManager.cpp:1.114 Wed Jan 10 18:19:00 2007 +++ llvm/lib/VMCore/PassManager.cpp Wed Jan 10 19:10:25 2007 @@ -291,6 +291,10 @@ return PassVector.size(); } + virtual PassManagerType getPassManagerType() { +assert ( 0 && "Invalid use of getPassManagerType"); +return PMT_Unknown; + } protected: // If a FunctionPass F is the last user of ModulePass info M @@ -359,6 +363,10 @@ BasicBlockPass *BP = static_cast(PassVector[N]); return BP; } + + virtual PassManagerType getPassManagerType() { +return PMT_BasicBlockPassManager; + } }; //===--===// @@ -413,6 +421,9 @@ return FP; } + virtual PassManagerType getPassManagerType() { +return PMT_FunctionPassManager; + } private: // Active Pass Manager BBPassManager *activeBBPassManager; @@ -529,6 +540,7 @@ return MP; } + virtual PassManagerType getPassManagerType() { return PMT_ModulePassManager; } private: // Active Pass Manager FPPassManager *activeFunctionPassManager; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll
Changes in directory llvm/test/Regression/Transforms/PredicateSimplifier: 2007-01-04-SelectSwitch.ll added (r1.1) --- Log message: New predicate simplifier! Please do not enable, there is still some known miscompile problem. --- Diffs of the changes: (+19 -0) 2007-01-04-SelectSwitch.ll | 19 +++ 1 files changed, 19 insertions(+) Index: llvm/test/Regression/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll diff -c /dev/null llvm/test/Regression/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll:1.1 *** /dev/null Wed Jan 10 20:32:48 2007 --- llvm/test/Regression/Transforms/PredicateSimplifier/2007-01-04-SelectSwitch.ll Wed Jan 10 20:32:38 2007 *** *** 0 --- 1,19 + ; RUN: llvm-upgrade < %s | llvm-as | opt -predsimplify -disable-output + + void %ercMarkCurrMBConcealed(int %comp) { + entry: + %tmp5 = icmp slt int %comp, 0 ; [#uses=2] + %comp_addr.0 = select bool %tmp5, int 0, int %comp ; [#uses=1] + switch int %comp_addr.0, label %return [ +int 0, label %bb + ] + + bb: ; preds = %entry + br bool %tmp5, label %bb87.bb97_crit_edge.critedge, label %return + + bb87.bb97_crit_edge.critedge: ; preds = %bb + ret void + + return: ; preds = %bb, %entry + ret void + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Changes in directory llvm/lib/Transforms/Scalar: PredicateSimplifier.cpp updated: 1.41 -> 1.42 --- Log message: Quiet compiler warning. The only reason the function is marked virtual is so that it can be called from inside a debugger. --- Diffs of the changes: (+2 -0) PredicateSimplifier.cpp |2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.41 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.42 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.41 Wed Jan 10 20:32:38 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Wed Jan 10 20:38:21 2007 @@ -247,6 +247,7 @@ private: #ifndef NDEBUG public: + virtual ~Node() {} virtual void dump() const { dump(*cerr.stream()); } @@ -638,6 +639,7 @@ } #ifndef NDEBUG +virtual ~InequalityGraph() {} virtual void dump() { dump(*cerr.stream()); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.243 -> 1.244 --- Log message: Recommit my previous patch with a bugfix: printInfoComment works on both local and global values. --- Diffs of the changes: (+67 -63) AsmWriter.cpp | 130 +- 1 files changed, 67 insertions(+), 63 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.243 llvm/lib/VMCore/AsmWriter.cpp:1.244 --- llvm/lib/VMCore/AsmWriter.cpp:1.243 Wed Jan 10 03:18:16 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Wed Jan 10 21:54:27 2007 @@ -75,9 +75,9 @@ /// @{ public: /// Return the slot number of the specified value in it's type - /// plane. Its an error to ask for something not in the SlotMachine. - /// Its an error to ask for a Type* - int getSlot(const Value *V); + /// plane. If something is not in the SlotMachine, return -1. + int getLocalSlot(const Value *V); + int getGlobalSlot(const GlobalValue *V); /// @} /// @name Mutators @@ -597,13 +597,20 @@ } else { int Slot; if (Machine) { -Slot = Machine->getSlot(V); +if (const GlobalValue *GV = dyn_cast(V)) + Slot = Machine->getGlobalSlot(GV); +else + Slot = Machine->getLocalSlot(V); } else { Machine = createSlotMachine(V); -if (Machine) - Slot = Machine->getSlot(V); -else +if (Machine) { + if (const GlobalValue *GV = dyn_cast(V)) +Slot = Machine->getGlobalSlot(GV); + else +Slot = Machine->getLocalSlot(V); +} else { Slot = -1; +} delete Machine; } if (Slot != -1) @@ -1042,7 +1049,7 @@ Out << "\n" << getLLVMName(BB->getName(), false) << ':'; } else if (!BB->use_empty()) { // Don't print block # of no uses... Out << "\n; :"; -int Slot = Machine.getSlot(BB); +int Slot = Machine.getLocalSlot(BB); if (Slot != -1) Out << Slot; else @@ -1091,7 +1098,11 @@ printType(V.getType()) << '>'; if (!V.hasName()) { - int SlotNum = Machine.getSlot(&V); + int SlotNum; + if (const GlobalValue *GV = dyn_cast(&V)) +SlotNum = Machine.getGlobalSlot(GV); + else +SlotNum = Machine.getLocalSlot(&V); if (SlotNum == -1) Out << ":"; else @@ -1405,7 +1416,7 @@ { } -inline void SlotMachine::initialize(void) { +inline void SlotMachine::initialize() { if (TheModule) { processModule(); TheModule = 0; ///< Prevent re-processing next time we're called. @@ -1463,7 +1474,7 @@ } /// Clean up after incorporating a function. This is the only way to get out of -/// the function incorporation state that affects getSlot/Create*Slot. Function +/// the function incorporation state that affects get*Slot/Create*Slot. Function /// incorporation state is indicated by TheFunction != 0. void SlotMachine::purgeFunction() { SC_DEBUG("begin purgeFunction!\n"); @@ -1473,64 +1484,57 @@ SC_DEBUG("end purgeFunction!\n"); } -/// Get the slot number for a value. This function will assert if you -/// ask for a Value that hasn't previously been inserted with Create*Slot. -int SlotMachine::getSlot(const Value *V) { - assert(V && "Can't get slot for null Value"); - assert(!isa(V) || isa(V) && -"Can't insert a non-GlobalValue Constant into SlotMachine"); +/// getGlobalSlot - Get the slot number of a global value. +int SlotMachine::getGlobalSlot(const GlobalValue *V) { + // Check for uninitialized state and do lazy initialization. + initialize(); + + // Find the type plane in the module map + TypedPlanes::const_iterator MI = mMap.find(V->getType()); + if (MI == mMap.end()) return -1; + + // Lookup the value in the module plane's map. + ValueMap::const_iterator MVI = MI->second.map.find(V); + return MVI != MI->second.map.end() ? MVI->second : -1; +} - // Check for uninitialized state and do lazy initialization - this->initialize(); - // Get the type of the value - const Type* VTy = V->getType(); +/// getLocalSlot - Get the slot number for a value that is local to a function. +int SlotMachine::getLocalSlot(const Value *V) { + assert(!isa(V) && "Can't get a constant or global slot with this!"); - // Find the type plane in the module map - TypedPlanes::const_iterator MI = mMap.find(VTy); + // Check for uninitialized state and do lazy initialization. + initialize(); - if (TheFunction) { -// Lookup the type in the function map too -TypedPlanes::const_iterator FI = fMap.find(VTy); -// If there is a corresponding type plane in the function map -if (FI != fMap.end()) { - // Lookup the Value in the function map - ValueMap::const_iterator FVI = FI->second.map.find(V); - // If the value doesn't exist in the function map - if (FVI == FI->second.map.end()) { -// Look up the value in the module map. -if (MI == mMap.en
Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
On Jan 10, 2007, at 1:20 AM, Reid Spencer wrote: > Chris, > > This patch broke most tests. I reverted it so that some of the nightly > testers won't get too damaged. I tried a couple things to work around > the assert but it seems there are bigger issues. Revert was the only > thing I could do in a timely fashion. No problem, thanks a lot for catching this! I committed the fixed patch, -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.244 -> 1.245 --- Log message: simplify some logic further --- Diffs of the changes: (+2 -11) AsmWriter.cpp | 13 ++--- 1 files changed, 2 insertions(+), 11 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.244 llvm/lib/VMCore/AsmWriter.cpp:1.245 --- llvm/lib/VMCore/AsmWriter.cpp:1.244 Wed Jan 10 21:54:27 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Wed Jan 10 22:30:21 2007 @@ -1516,17 +1516,8 @@ ValueMap::const_iterator FVI = FI->second.map.find(V); TypedPlanes::const_iterator MI = mMap.find(VTy); - // If the value doesn't exist in the function map - if (FVI == FI->second.map.end()) { -// Look up the value in the module map. -if (MI == mMap.end()) return -1; -ValueMap::const_iterator MVI = MI->second.map.find(V); -// If we didn't find it, it wasn't inserted -if (MVI == MI->second.map.end()) return -1; -assert(MVI != MI->second.map.end() && "Value not found"); -// We found it only at the module level -return MVI->second; - } + // If the value doesn't exist in the function map, it is a + if (FVI == FI->second.map.end()) return -1; // Return the slot number as the module's contribution to // the type plane plus the index in the function's contribution ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/mkpatch
Changes in directory llvm/utils: mkpatch updated: 1.2 -> 1.3 --- Log message: Put in some needed \ at the end of lines!!! --- Diffs of the changes: (+1 -1) mkpatch |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/mkpatch diff -u llvm/utils/mkpatch:1.2 llvm/utils/mkpatch:1.3 --- llvm/utils/mkpatch:1.2 Sat Nov 18 12:30:18 2006 +++ llvm/utils/mkpatch Thu Jan 11 00:51:56 2007 @@ -29,7 +29,7 @@ echo "mkpatch: Removing cruft from the patch file" sed "$NAME".patch.raw -e '/^[?] .*/d' -e '/^cvs diff: Diffing/d' | awk '\ BEGIN { deleting = 0; } \ -/^Index: .*[.]cvs$/ { deleting = 1; fname=substr($0,7); +/^Index: .*[.]cvs$/ { deleting = 1; fname=substr($0,7); \ print "Skipping: ", fname > "/dev/stderr"; } \ /^Index:.*/ && !/^Index: .*[.]cvs$/ { deleting = 0; } \ { if (! deleting) { print; } } \ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.245 -> 1.246 --- Log message: Shut up a warning about signed/unsigned. --- Diffs of the changes: (+1 -1) AsmWriter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.245 llvm/lib/VMCore/AsmWriter.cpp:1.246 --- llvm/lib/VMCore/AsmWriter.cpp:1.245 Wed Jan 10 22:30:21 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Thu Jan 11 01:58:19 2007 @@ -1495,7 +1495,7 @@ // Lookup the value in the module plane's map. ValueMap::const_iterator MVI = MI->second.map.find(V); - return MVI != MI->second.map.end() ? MVI->second : -1; + return MVI != MI->second.map.end() ? int(MVI->second) : -1; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits