From gaeke at cs.uiuc.edu Mon Jun 14 00:07:09 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 00:07:09 2004 Subject: [llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp Message-ID: <200406140505.AAA22612@kain.cs.uiuc.edu> Changes in directory reopt/lib/TraceToFunction: TraceToFunction.cpp updated: 1.61 -> 1.62 --- Log message: Get rid of the old TODOs... because I'm not ever going to touch them. Build the FLI map much earlier. In doing so, detect back-edge targets that are internal to the trace. (...And you thought we were doing "single entry" traces!) --- Diffs of the changes: (+6 -9) Index: reopt/lib/TraceToFunction/TraceToFunction.cpp diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.61 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.62 --- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.61 Tue Jun 8 13:54:00 2004 +++ reopt/lib/TraceToFunction/TraceToFunction.cpp Mon Jun 14 00:05:46 2004 @@ -10,13 +10,6 @@ // Repackage traces as functions, so that global (function-level) optimizations // can be applied to traces. // -// TODO (also search for FIXME in this file): -// 1) Only let things go into the LiveIn/Out sets for which we have register -// allocation information available. Otherwise abort. -// 2) Check these: -// a) Used before defined --> live-in and live-out -// b) Live in and not defined by trace --> not live out -// // Potential optimizations: // Make it possible to turn off BranchNumber...it is only useful (now) when a // human is reading the code. @@ -404,8 +397,6 @@ /// void TraceFunctionBuilder::fillInFunctionBody (Trace &T, Function *F, LiveVariableSet &So) { - buildFLIMap (T, FLIMap); - // First copy the basic blocks from the trace. cloneTraceBBsIntoFunction (TF); @@ -508,6 +499,9 @@ DEBUG (std::cerr << "buildFLIMap: identified FLI block " << i->getName() << " on edge <" << edge.first->getName () << ", " << edge.second->getName () << ">\n"); + DEBUG (if (T.contains (edge.second) && edge.second != T.getEntryBasicBlock ()) + std::cerr << "buildFLIMap: " << edge.second->getName() + << " is a back-edge target that's internal to the trace\n"); // 1. remove the block from the trace if it is in there BasicBlock *bb = i; Trace::iterator TI = std::find (T.begin (), T.end (), bb); @@ -734,6 +728,9 @@ std::string CurrentFnName = T.getFunction ()->getName (); DEBUG(std::cerr << "In buildTraceFunction() for " << CurrentFnName << "\n"); DEBUG(T.dump ()); + + // Look for FLI blocks in the trace. + buildFLIMap (T, FLIMap); // Get some information about the trace's relationship to its parent // function. From gaeke at cs.uiuc.edu Mon Jun 14 00:07:15 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 00:07:15 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Message-ID: <200406140505.AAA22605@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9TargetMachine.cpp updated: 1.113 -> 1.114 --- Log message: Make -print-machineinstrs even stronger. You get to see the final code after peepholing, and make it work the same way in the JIT as in LLC. --- Diffs of the changes: (+11 -0) Index: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp diff -u llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.113 llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.114 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.113 Thu Jun 3 00:03:01 2004 +++ llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Mon Jun 14 00:05:45 2004 @@ -179,6 +179,9 @@ if (!DisablePeephole) PM.add(createPeepholeOptsPass(*this)); + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(&std::cerr, "Final code:\n")); + if (EmitMappingInfo) { PM.add(createInternalGlobalMapperPass()); PM.add(getMappingInfoAsmPrinterPass(Out)); @@ -234,6 +237,11 @@ //PM.add(createLICMPass()); //PM.add(createGCSEPass()); + // If the user's trying to read the generated code, they'll need to see the + // transformed input. + if (PrintMachineCode) + PM.add(new PrintFunctionPass()); + // Construct and initialize the MachineFunction object for this fn. PM.add(createMachineCodeConstructionPass(TM)); @@ -251,6 +259,9 @@ if (!DisablePeephole) PM.add(createPeepholeOptsPass(TM)); + + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(&std::cerr, "Final code:\n")); } /// allocateSparcV9TargetMachine - Allocate and return a subclass of TargetMachine From gaeke at cs.uiuc.edu Mon Jun 14 01:40:02 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 01:40:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200406140633.BAA18562@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.26 -> 1.27 --- Log message: Quick hack to get this file compiling again on Mac OS X. The right thing to do is write an autoconf macro that checks whether __isnan or isnan actually works **using the C++ compiler after #include **, instead of doing it the easy way with AC_CHECK_FUNCS(). --- Diffs of the changes: (+8 -0) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.26 llvm/lib/Transforms/Utils/Local.cpp:1.27 --- llvm/lib/Transforms/Utils/Local.cpp:1.26 Sat Jun 12 20:23:56 2004 +++ llvm/lib/Transforms/Utils/Local.cpp Mon Jun 14 01:33:19 2004 @@ -20,6 +20,14 @@ #include using namespace llvm; +#if defined(__POWERPC__) && defined(__APPLE_CC__) +// FIXME: Currently it seems that isnan didn't make its way into the Apple +// C++ headers, although it IS in the C headers (which confuses autoconf +// in a big way). This is a quick fix to get things compiling, until one of +// us has time to write a more complicated autoconf test. +extern "C" int isnan (double d); +#endif + //===----------------------------------------------------------------------===// // Local constant propagation... // From gaeke at cs.uiuc.edu Mon Jun 14 01:43:02 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 01:43:02 2004 Subject: [llvm-commits] CVS: reopt/tools/ttftest/ttftest.cpp Message-ID: <200406140642.BAA19850@kain.cs.uiuc.edu> Changes in directory reopt/tools/ttftest: ttftest.cpp updated: 1.4 -> 1.5 --- Log message: Add code and a command-line option for printing out trace live-in/live-out sets. Fold a few long lines. --- Diffs of the changes: (+46 -3) Index: reopt/tools/ttftest/ttftest.cpp diff -u reopt/tools/ttftest/ttftest.cpp:1.4 reopt/tools/ttftest/ttftest.cpp:1.5 --- reopt/tools/ttftest/ttftest.cpp:1.4 Sat May 22 01:56:41 2004 +++ reopt/tools/ttftest/ttftest.cpp Mon Jun 14 01:42:38 2004 @@ -16,6 +16,7 @@ #include "llvm/Analysis/Trace.h" #include "llvm/Analysis/Verifier.h" +#include "llvm/Assembly/Writer.h" #include "llvm/Bytecode/Reader.h" #include "reopt/TraceToFunction.h" #include "llvm/Module.h" @@ -30,10 +31,14 @@ namespace { cl::opt TraceFile("trace", - cl::desc("Name of file containing trace"), cl::value_desc("traceFileName")); + cl::desc("Name of file containing trace"), + cl::value_desc("traceFileName")); cl::opt BytecodeFile("bc", - cl::desc("Name of file containing module"), cl::value_desc("bytecodeFileName")); + cl::desc("Name of file containing module"), + cl::value_desc("bytecodeFileName")); cl::opt Quiet("q", cl::desc("Be quiet"), cl::init(false)); + cl::opt PrintLiveSets("print-live", + cl::desc("Print live-in/out sets to stdout"), cl::init(false)); }; /// getBasicBlockByNum - Returns the basic block in F whose index is @@ -96,6 +101,40 @@ return bbNum; } +void printLiveSet (std::ostream &OS, const std::string Banner, + LiveVariableSet &S, TraceFunction *TF, + bool printCorrespondingValues = true) { + OS << Banner; + unsigned Count = 0; + assert (TF->MatrixFn->getParent () == TF->TraceFn->getParent ()); + Module *M = TF->MatrixFn->getParent (); + if (S.begin () == S.end ()) { + OS << "Set is empty\n\n"; + return; + } + for (LiveVariableSet::iterator i = S.begin (), e = S.end (); i != e; ++i) { + Value *MV = *i; + OS << Count << ": "; + WriteAsOperand (OS, MV, true, true, M); + if (printCorrespondingValues) { + OS << " ---> "; + WriteAsOperand (OS, TF->getCorrespondingValue (MV, true), true, + true, M); + OS << ", "; + WriteAsOperand (OS, TF->getCorrespondingValue (MV, false), true, + true, M); + } + OS << "\n"; + ++Count; + } + OS << "\n\n"; +} + +void printLiveSets (TraceFunction *TF) { + printLiveSet (std::cout, "Live-in set:\n", TF->LiveInSet, TF); + printLiveSet (std::cout, "Live-out set:\n", TF->LiveOutSet, TF); +} + int main (int argc, char **argv) { // Get command line arguments. cl::ParseCommandLineOptions(argc, argv, " trace-to-function tester\n"); @@ -128,6 +167,10 @@ exit (1); } else { if (!Quiet) { std::cerr << "Verifier passes.\n"; } - exit (0); } + + if (PrintLiveSets) + printLiveSets (TF); + + return 0; } From gaeke at cs.uiuc.edu Mon Jun 14 02:30:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 02:30:01 2004 Subject: [llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp Message-ID: <200406140729.CAA09640@kain.cs.uiuc.edu> Changes in directory reopt/lib/TraceToFunction: TraceToFunction.cpp updated: 1.62 -> 1.63 --- Log message: Get rid of the NamedFunctionTimer and don't include Support/Timer.h; there doesn't seem to be any other easy way to turn the timer off. Make getTraceLiveInSet & getTraceLiveOutSet methods of TraceFunctionBuilder. Make them take references to their respective sets and fill them in. Update the doxygen comments. Make buildFLIMap build up the set of AlternateEntryPoints that a trace exit could make us take, and make getTraceLiveOutSet fail an assertion for now, if AlternateEntryPoints has anything in it. Constify getFLIEdgeSource and getFLIEdgeTarget, and the LiveVariableSet arguments to createFunctionArgTypeVector and createLiveOutType. Update doxygen comments, wrap some long lines, and get rid of those pesky tabs. Ugh! --- Diffs of the changes: (+77 -62) Index: reopt/lib/TraceToFunction/TraceToFunction.cpp diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.62 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.63 --- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.62 Mon Jun 14 00:05:46 2004 +++ reopt/lib/TraceToFunction/TraceToFunction.cpp Mon Jun 14 02:29:06 2004 @@ -31,7 +31,6 @@ #include "Support/StringExtras.h" // for utostr() #define DEBUG_TYPE "tracetofunction" #include "Support/Debug.h" // for DEBUG() -#include "Support/Timer.h" #include namespace llvm { @@ -48,18 +47,22 @@ class TraceFunctionBuilder { BranchNumberMap BranchNumber; TraceFunction *TF; + std::set AlternateEntryPoints; + void getTraceLiveInSet (LiveVariableSet &S, Trace &T); + void getTraceLiveOutSet (LiveVariableSet &S, Trace &T); FLIMapTy FLIMap; - BasicBlock *getFLIEdgeSource (BasicBlock *BB); - BasicBlock *getFLIEdgeTarget (BasicBlock *BB); + BasicBlock *getFLIEdgeSource (BasicBlock *BB) const; + BasicBlock *getFLIEdgeTarget (BasicBlock *BB) const; void threadFLIEdges (Function *F); void buildFLIMap (Trace &T, FLIMapTy &FLIMap); - TypeVector createFunctionArgTypeVector (PointerType *ST, LiveVariableSet S); + TypeVector createFunctionArgTypeVector (PointerType *ST, + const LiveVariableSet &S); void fillInFunctionBody (Trace &T, Function *F, LiveVariableSet &So); void fixupFunctionBodyBB (Trace &T, Function *F, BasicBlock *srcB, - BasicBlock *dstB, ValueMap &O2CMap, - LiveVariableSet &So); + BasicBlock *dstB, ValueMap &O2CMap, + LiveVariableSet &So); void cloneMapDump (); public: @@ -85,11 +88,11 @@ // If any successors are on the trace, AND not the entry BB, check them too. // (Stop at entry BB because we don't want to loop if the CFG loops.) for (succ_const_iterator i = succ_begin (start), e = succ_end (start); - i != e; ++i) { + i != e; ++i) { const BasicBlock *succ = *i; if (T.contains (succ) && (T.getEntryBasicBlock () != succ) - && (!dominates (T, B1, B2, succ))) - return false; + && (!dominates (T, B1, B2, succ))) + return false; } return true; // Dominates on all successors ==> dominates here too } @@ -115,35 +118,34 @@ // Start at Block->begin() traversing next pointers; if UInst // appears BEFORE Inst in Block's InstList, return false for (BasicBlock::const_iterator bi = Block->begin (), be = Block->end (); - bi != be; ++bi) { - const Instruction *BlockInst = bi; - if (BlockInst == UInst) - return false; - else if (BlockInst == Inst) - break; + bi != be; ++bi) { + const Instruction *BlockInst = bi; + if (BlockInst == UInst) + return false; + else if (BlockInst == Inst) + break; } } else { if (!T.contains (UBlock)) - return false; + return false; else { - // If UBlock appears BEFORE Block on some path from the first - // basic block of the trace to an exit BB of the trace, return - // false. - if (!dominates (T, Block, UBlock)) - return false; + // If UBlock appears BEFORE Block on some path from the first + // basic block of the trace to an exit BB of the trace, return + // false. + if (!dominates (T, Block, UBlock)) + return false; } } } return true; } -/// getTraceLiveInSet - Return the live-in set of the trace. Any -/// variable which is used in the trace is potentially live-in, EXCEPT -/// if it's a constant or a global, OR it is defined before being used +/// getTraceLiveInSet - Initialize TF->LiveInSet with the live-in set of the +/// trace. Any variable which is used in the trace is potentially live-in, +/// EXCEPT if it's a constant or a global, OR it is defined before being used /// in the trace. /// -static LiveVariableSet getTraceLiveInSet (Trace &T) { - LiveVariableSet S; +void TraceFunctionBuilder::getTraceLiveInSet (LiveVariableSet &S, Trace &T) { for (Trace::iterator TI = T.begin (), TE = T.end (); TI != TE; ++TI) { BasicBlock *B = *TI; // B is a basic block in the trace. @@ -151,12 +153,12 @@ Instruction &I = *BI; // I is an instruction in B, which is in the trace. for (unsigned i = 0; i < I.getNumOperands (); ++i) { - Value *V = I.getOperand (i); - // V is used in the trace by instruction I. - if (!(isa (V) || isa (V) + Value *V = I.getOperand (i); + // V is used in the trace by instruction I. + if (!(isa (V) || isa (V) || isa(V))) - if (!DefinedInTraceBeforeUse (V, T)) - S.insert (V); + if (!DefinedInTraceBeforeUse (V, T)) + S.insert (V); } } } @@ -164,15 +166,14 @@ for (BasicBlock::iterator Inst = T.getEntryBasicBlock ()->begin (); PHINode *PN = dyn_cast (Inst); ++Inst) S.insert (PN); - return S; } -/// getTraceLiveOutSet - Any variable defined within the trace is +/// getTraceLiveOutSet - Initializes S with the live-out set of trace T. +/// Any variable defined within the trace is /// potentially live-out, EXCEPT if its only uses are in the trace AND /// come after the def. /// -static LiveVariableSet getTraceLiveOutSet (Trace &T) { - LiveVariableSet S; +void TraceFunctionBuilder::getTraceLiveOutSet (LiveVariableSet &S, Trace &T) { Function &F = *T.getFunction(); for (Trace::iterator TI = T.begin (), TE = T.end (); TI != TE; ++TI) { BasicBlock *B = *TI; @@ -187,7 +188,10 @@ S.insert (&I); } } - return S; + if (!AlternateEntryPoints.empty ()) { + assert (AlternateEntryPoints.empty () + && "Alternate entry points not handled yet"); + } } /// containsTraceExitingBranch - If B contains a branch instruction BI @@ -208,14 +212,16 @@ /// createLiveOutType - Given the live-out set S of a trace, create a /// pointer-to-structure type that will encapsulate all the live-outs from S. /// -static PointerType *createLiveOutType (LiveVariableSet S) { +static PointerType *createLiveOutType (const LiveVariableSet &S) { TypeVector T; unsigned Counter = 0; // For each variable in S, make a new entry in T having its type. DEBUG (std::cerr << "Live-out values:\n"); - for (LiveVariableSet::iterator I = S.begin (), E = S.end (); I != E; ++I) { + for (LiveVariableSet::const_iterator I = S.begin (), E = S.end (); I != E; + ++I) { DEBUG (WriteAsOperand (std::cerr, *I, true, true, - cast(*I)->getParent ()->getParent ()->getParent ()); + cast(*I)->getParent ()->getParent () + ->getParent ()); std::cerr << " is at position " << Counter++ << "\n"); T.push_back ((*I)->getType ()); } @@ -230,12 +236,13 @@ /// TF->LiveInToParameterMap. /// TypeVector TraceFunctionBuilder::createFunctionArgTypeVector (PointerType *PST, - LiveVariableSet S) { + const LiveVariableSet &S) { TypeVector P; P.push_back (PST); TF->LiveInToParameterMap.clear (); - for (LiveVariableSet::iterator I = S.begin (), E = S.end (); I != E; ++I) { + for (LiveVariableSet::const_iterator I = S.begin (), E = S.end (); I != E; + ++I) { Value *V = *I; P.push_back (V->getType ()); TF->LiveInToParameterMap[V] = P.size () - 1; @@ -243,7 +250,7 @@ // Print out mapping of instructions producing live-ins to arg numbers. DEBUG(std::cerr << "\nLive-in values:\n"; for (ValueToIntMap::iterator I = TF->LiveInToParameterMap.begin (), - E = TF->LiveInToParameterMap.end (); I != E; ++I) { + E = TF->LiveInToParameterMap.end (); I != E; ++I) { WriteAsOperand (std::cerr, I->first, true, true, TF->MatrixFn->getParent ()); std::cerr << " is parameter " << I->second << "\n"; @@ -396,7 +403,7 @@ /// argument. /// void TraceFunctionBuilder::fillInFunctionBody (Trace &T, Function *F, - LiveVariableSet &So) { + LiveVariableSet &So) { // First copy the basic blocks from the trace. cloneTraceBBsIntoFunction (TF); @@ -426,7 +433,8 @@ /// effect of this function, if it returns true, is to fill in the pair "edge" /// with the source and target of the back-edge. /// -static bool identifyFLIEdge (BasicBlock *BB, std::pair &edge) { +static bool identifyFLIEdge (BasicBlock *BB, + std::pair &edge) { BasicBlock::iterator i = BB->begin (); // starts with llvm_first_trigger call if (!isFirstTriggerCall (*i)) @@ -490,6 +498,8 @@ /// buildFLIMap - Removes any FLI blocks which ended up in the trace, and /// identifies the source and sink BasicBlocks of all FLI-instrumented /// back-edges. Information about FLI edges is stored in the FLIMap. +/// Information about FLI sinks that could end up in the middle of the trace +/// is stored in the AlternateEntryPoints set. /// void TraceFunctionBuilder::buildFLIMap (Trace &T, FLIMapTy &FLIMap) { Function *F = T.getFunction (); @@ -499,9 +509,11 @@ DEBUG (std::cerr << "buildFLIMap: identified FLI block " << i->getName() << " on edge <" << edge.first->getName () << ", " << edge.second->getName () << ">\n"); - DEBUG (if (T.contains (edge.second) && edge.second != T.getEntryBasicBlock ()) - std::cerr << "buildFLIMap: " << edge.second->getName() - << " is a back-edge target that's internal to the trace\n"); + if (T.contains (edge.second) && edge.second != T.getEntryBasicBlock ()) { + DEBUG (std::cerr << "buildFLIMap: " << edge.second->getName() + << " is a back-edge target that's internal to the trace\n"); + AlternateEntryPoints.insert (edge.second); + } // 1. remove the block from the trace if it is in there BasicBlock *bb = i; Trace::iterator TI = std::find (T.begin (), T.end (), bb); @@ -515,14 +527,14 @@ } } -BasicBlock *TraceFunctionBuilder::getFLIEdgeSource (BasicBlock *BB) { - FLIMapTy::iterator i = FLIMap.find (BB); +BasicBlock *TraceFunctionBuilder::getFLIEdgeSource (BasicBlock *BB) const { + FLIMapTy::const_iterator i = FLIMap.find (BB); if (i == FLIMap.end ()) return 0; return i->second.first; } -BasicBlock *TraceFunctionBuilder::getFLIEdgeTarget (BasicBlock *BB) { - FLIMapTy::iterator i = FLIMap.find (BB); +BasicBlock *TraceFunctionBuilder::getFLIEdgeTarget (BasicBlock *BB) const { + FLIMapTy::const_iterator i = FLIMap.find (BB); if (i == FLIMap.end ()) return 0; return i->second.second; } @@ -534,9 +546,10 @@ /// argument. (This is where all the magic gets done...) /// void TraceFunctionBuilder::fixupFunctionBodyBB (Trace &T, Function *F, - BasicBlock *srcB, BasicBlock *dstB, - ValueMap &O2CMap, - LiveVariableSet &So) { + BasicBlock *srcB, + BasicBlock *dstB, + ValueMap &O2CMap, + LiveVariableSet &So) { assert (T.contains (srcB) && "Source BB is not on the trace"); assert (dstB->getParent () == F && "Clone is not in the function"); @@ -702,19 +715,22 @@ } } -/// Dump out the O2CMap for the given TraceFunction to stderr. +/// cloneMapDump - Dump out the O2CMap for the given TraceFunction to stderr. /// You can call this from the debugger if you want to see the gory details, /// because it takes a really long time on big modules. /// +/// FIXME: This method should probably be a method of TraceFunction, +/// not TraceFunctionBuilder. +/// void TraceFunctionBuilder::cloneMapDump () { std::cerr << "\n; TraceFunctionBuilder Original-->Clone map follows:\n"; for (ValueMap::const_iterator i = TF->O2CMap.begin(), e = TF->O2CMap.end(); i != e; ++i) { const std::pair &elem = *i; std::cerr << "(original-value \""; - WriteAsOperand (std::cerr, i->first, true, true, TF->MatrixFn->getParent ()); + WriteAsOperand (std::cerr, i->first, true, true, TF->MatrixFn->getParent()); std::cerr << "\" maps-to \""; - WriteAsOperand (std::cerr, i->second, true, true, TF->TraceFn->getParent ()); + WriteAsOperand (std::cerr, i->second, true, true, TF->TraceFn->getParent()); std::cerr << "\")\n"; } std::cerr << "\n"; @@ -734,8 +750,8 @@ // Get some information about the trace's relationship to its parent // function. - TF->LiveInSet = getTraceLiveInSet (T); - TF->LiveOutSet = getTraceLiveOutSet (T); + getTraceLiveInSet (TF->LiveInSet, T); + getTraceLiveOutSet (TF->LiveOutSet, T); TypeVector P = createFunctionArgTypeVector (createLiveOutType (TF->LiveOutSet), TF->LiveInSet); @@ -744,8 +760,8 @@ // list P, in the same Module as the trace's parent function. std::string name (CurrentFnName + ".trace"); TF->TraceFn = new Function (FunctionType::get (Type::UIntTy, P, false), - GlobalValue::InternalLinkage, name, - T.getModule ()); + GlobalValue::InternalLinkage, name, + T.getModule ()); DEBUG(giveNamesToFunctionArgs (TF->LiveInSet, TF->TraceFn)); fillInFunctionBody (T, TF->TraceFn, TF->LiveOutSet); return TF; @@ -756,7 +772,6 @@ /// data structures. /// TraceFunction *TraceFunction::get (Trace &T) { - NamedRegionTimer X ("TraceToFunction"); TraceFunctionBuilder TTF; return TTF.buildTraceFunction (T); } From brukman at cs.uiuc.edu Mon Jun 14 10:22:03 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jun 14 10:22:03 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCReg.td Message-ID: <200406141514.KAA05729@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCReg.td updated: 1.1 -> 1.2 --- Log message: Add file comment. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Target/PowerPC/PowerPCReg.td diff -u llvm/lib/Target/PowerPC/PowerPCReg.td:1.1 llvm/lib/Target/PowerPC/PowerPCReg.td:1.2 --- llvm/lib/Target/PowerPC/PowerPCReg.td:1.1 Wed Jan 21 15:13:19 2004 +++ llvm/lib/Target/PowerPC/PowerPCReg.td Mon Jun 14 10:13:59 2004 @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // +// This file defines the PowerPC register file in Tablegen format. // //===----------------------------------------------------------------------===// From brukman at cs.uiuc.edu Mon Jun 14 11:36:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Jun 14 11:36:01 2004 Subject: [llvm-commits] CVS: llvm/utils/Burg/main.c Message-ID: <200406141630.LAA07296@zion.cs.uiuc.edu> Changes in directory llvm/utils/Burg: main.c updated: 1.2 -> 1.3 --- Log message: The correct prototype is `int atoi(CONST char*)'. Unbroke AIX build. --- Diffs of the changes: (+2 -2) Index: llvm/utils/Burg/main.c diff -u llvm/utils/Burg/main.c:1.2 llvm/utils/Burg/main.c:1.3 --- llvm/utils/Burg/main.c:1.2 Mon Jan 20 00:19:18 2003 +++ llvm/utils/Burg/main.c Mon Jun 14 11:30:05 2004 @@ -1,4 +1,4 @@ -char rcsid_main[] = "$Id: main.c,v 1.2 2003/01/20 06:19:18 lattner Exp $"; +char rcsid_main[] = "$Id: main.c,v 1.3 2004/06/14 16:30:05 brukman Exp $"; #include #include @@ -21,7 +21,7 @@ main(argc, argv) int argc; char **argv; { int i; - extern int atoi ARGS((char *)); + extern int atoi ARGS((const char *)); for (i = 1; argv[i]; i++) { char **needStr = 0; From gaeke at persephone.cs.uiuc.edu Mon Jun 14 15:55:02 2004 From: gaeke at persephone.cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 15:55:02 2004 Subject: [llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp Message-ID: <20040614205030.94D2F1703A2@persephone.cs.uiuc.edu> Changes in directory reopt/lib/TraceToFunction: TraceToFunction.cpp updated: 1.63 -> 1.64 --- Log message: Start adding support for calculating live-outs starting somewhere other than the entry BasicBlock of the Trace. DefinedInTraceBeforeUse() still doesn't really support it yet, though. --- Diffs of the changes: (+47 -37) Index: reopt/lib/TraceToFunction/TraceToFunction.cpp diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.63 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.64 --- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.63 Mon Jun 14 02:29:06 2004 +++ reopt/lib/TraceToFunction/TraceToFunction.cpp Mon Jun 14 15:50:12 2004 @@ -98,7 +98,9 @@ } } -static bool DefinedInTraceBeforeUse (Value *V, Trace &T) { +static bool DefinedInTraceBeforeUse (Value *V, Trace &T, Trace::iterator Start) { + assert (Start == T.begin () + && "FIXME: Can only start at beginning of trace for now"); Instruction *Inst = dyn_cast (V); if (!Inst) return false; @@ -140,57 +142,65 @@ return true; } -/// getTraceLiveInSet - Initialize TF->LiveInSet with the live-in set of the -/// trace. Any variable which is used in the trace is potentially live-in, -/// EXCEPT if it's a constant or a global, OR it is defined before being used -/// in the trace. -/// -void TraceFunctionBuilder::getTraceLiveInSet (LiveVariableSet &S, Trace &T) { - for (Trace::iterator TI = T.begin (), TE = T.end (); TI != TE; ++TI) { - BasicBlock *B = *TI; - // B is a basic block in the trace. - for (BasicBlock::iterator BI = B->begin (), BE = B->end (); BI != BE; ++BI){ - Instruction &I = *BI; - // I is an instruction in B, which is in the trace. - for (unsigned i = 0; i < I.getNumOperands (); ++i) { - Value *V = I.getOperand (i); - // V is used in the trace by instruction I. +/// addTraceLiveInsToSet - helper fn. for getTraceLiveInSet and +/// getTraceLiveOutSet. Adds the live-ins of T to S, assuming that +/// the trace starts at StartingFrom and ends at T.end(). +static void addTraceLiveInsToSet (LiveVariableSet &S, Trace &T, + Trace::iterator StartingFrom) { + for (Trace::iterator TI = StartingFrom, TE = T.end (); TI != TE; ++TI) + for (BasicBlock::iterator Inst = (*TI)->begin (), BE = (*TI)->end (); + Inst != BE; ++Inst) + for (unsigned i = 0; i < Inst->getNumOperands (); ++i) { + Value *V = Inst->getOperand (i); // V is used in the trace by Inst. if (!(isa (V) || isa (V) || isa(V))) - if (!DefinedInTraceBeforeUse (V, T)) + if (!DefinedInTraceBeforeUse (V, T, StartingFrom)) S.insert (V); } - } - } - // Add phis from entry BB - for (BasicBlock::iterator Inst = T.getEntryBasicBlock ()->begin (); + // Add phis from first BB + for (BasicBlock::iterator Inst = (*StartingFrom)->begin (); PHINode *PN = dyn_cast (Inst); ++Inst) S.insert (PN); } +/// getTraceLiveInSet - Initialize TF->LiveInSet with the live-in set of the +/// trace. Any variable which is used in the trace is potentially live-in, +/// EXCEPT if it's a constant or a global, OR it is defined before being used +/// in the trace. +/// +void TraceFunctionBuilder::getTraceLiveInSet (LiveVariableSet &S, Trace &T) { + addTraceLiveInsToSet (S, T, T.begin ()); +} + /// getTraceLiveOutSet - Initializes S with the live-out set of trace T. /// Any variable defined within the trace is /// potentially live-out, EXCEPT if its only uses are in the trace AND -/// come after the def. +/// come after the def. This method must also take into account side entrances +/// to the NON-traced version of the code caused by early exits that end up +/// taking back-edge branches. /// void TraceFunctionBuilder::getTraceLiveOutSet (LiveVariableSet &S, Trace &T) { - Function &F = *T.getFunction(); - for (Trace::iterator TI = T.begin (), TE = T.end (); TI != TE; ++TI) { - BasicBlock *B = *TI; - // B is a basic block in the trace. - for (BasicBlock::iterator BI = B->begin (), BE = B->end (); BI != BE; ++BI){ - Instruction &I = *BI; - Value *V = &I; - // I is an instruction in B, which is in the trace. - if (!(V->getType () == Type::VoidTy - || V->getType () == Type::LabelTy)) // No void or label Values - if (!DefinedInTraceBeforeUse (V, T)) - S.insert (&I); + // Iterate over the instructions in the trace, adding live-out values to S. + for (Trace::iterator TI = T.begin (), TE = T.end (); TI != TE; ++TI) + for (BasicBlock::iterator Inst = (*TI)->begin (), BE = (*TI)->end (); + Inst != BE; ++Inst) { + // Only consider those which produce values (not void or labels). + if (!(Inst->getType () == Type::VoidTy + || Inst->getType () == Type::LabelTy)) + if (!DefinedInTraceBeforeUse (Inst, T, StartingFrom)) + S.insert (Inst); } - } + + // If there are alternate entry points into the trace, their live-INs are + // live-OUT from the main trace. if (!AlternateEntryPoints.empty ()) { - assert (AlternateEntryPoints.empty () - && "Alternate entry points not handled yet"); + for (std::set::iterator i = AlternateEntryPoints.begin (), + e = AlternateEntryPoints.end (); i != e; ++i) { + // Find the position of the block in the trace. + Trace::iterator StartingFrom = std::find (T.begin (), T.end (), *i); + assert (StartingFrom != T.end () && "AlternateEntryPoint not on trace?!"); + addTraceLiveInsToSet (S, T, StartingFrom); + } } } From gaeke at persephone.cs.uiuc.edu Mon Jun 14 15:59:01 2004 From: gaeke at persephone.cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 15:59:01 2004 Subject: [llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp Message-ID: <20040614205455.DA63C1703BD@persephone.cs.uiuc.edu> Changes in directory reopt/lib/TraceToFunction: TraceToFunction.cpp updated: 1.64 -> 1.65 --- Log message: Expand head-of-file comment. --- Diffs of the changes: (+9 -5) Index: reopt/lib/TraceToFunction/TraceToFunction.cpp diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.64 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.65 --- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.64 Mon Jun 14 15:50:12 2004 +++ reopt/lib/TraceToFunction/TraceToFunction.cpp Mon Jun 14 15:54:45 2004 @@ -8,11 +8,15 @@ //===----------------------------------------------------------------------===// // // Repackage traces as functions, so that global (function-level) optimizations -// can be applied to traces. -// -// Potential optimizations: -// Make it possible to turn off BranchNumber...it is only useful (now) when a -// human is reading the code. +// can be applied to traces. This involves identifying and removing the +// Reoptimizer's first-level instrumentation blocks and computing the trace +// live-in and live-out sets. +// +// The output of this process is a TraceFunction, which is essentially a +// Function containing the same code as the Trace, but with some entry and exit +// fixup code added, along with links to the function that originally contained +// the trace (the MatrixFn) and information about the trace live-in/out sets, +// which values in the MatrixFn correspond to those in the TraceFn, etc. // //===----------------------------------------------------------------------===// From gaeke at persephone.cs.uiuc.edu Mon Jun 14 16:36:01 2004 From: gaeke at persephone.cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 16:36:01 2004 Subject: [llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp Message-ID: <20040614213223.836CB17042B@persephone.cs.uiuc.edu> Changes in directory reopt/lib/TraceToFunction: TraceToFunction.cpp updated: 1.65 -> 1.66 --- Log message: Fix the FIXME in DefinedInTraceBeforeUse() by letting it start to look for defs starting from any point in the trace, not just the beginning. Also fix a typo in getTraceLiveOutSet(). --- Diffs of the changes: (+6 -8) Index: reopt/lib/TraceToFunction/TraceToFunction.cpp diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.65 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.66 --- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.65 Mon Jun 14 15:54:45 2004 +++ reopt/lib/TraceToFunction/TraceToFunction.cpp Mon Jun 14 16:32:05 2004 @@ -103,20 +103,19 @@ } static bool DefinedInTraceBeforeUse (Value *V, Trace &T, Trace::iterator Start) { - assert (Start == T.begin () - && "FIXME: Can only start at beginning of trace for now"); Instruction *Inst = dyn_cast (V); if (!Inst) return false; BasicBlock *Block = Inst->getParent (); - if (!T.contains (Block)) // Is V defined in trace? + if (std::find (Start, T.end (), Block) == T.end ()) // Is V defined in trace? return false; for (Value::use_iterator ui = V->use_begin (), ue = V->use_end (); ui != ue; ++ui) { Instruction *UInst = dyn_cast (*ui); if (!UInst) // Non-Instruction Users scare me, mommy return false; - if (isa (UInst) && T.contains (UInst->getParent ())) + if (isa (UInst) + && std::find (Start, T.end (), UInst->getParent ()) != T.end ()) continue; // If a Phi node in the trace uses a value that's defined in the // trace, the def. must have originally dominated the Phi. BasicBlock *UBlock = UInst->getParent (); @@ -132,13 +131,12 @@ break; } } else { - if (!T.contains (UBlock)) - return false; + if (std::find (Start, T.end (), UBlock) == T.end ()) return false; else { // If UBlock appears BEFORE Block on some path from the first // basic block of the trace to an exit BB of the trace, return // false. - if (!dominates (T, Block, UBlock)) + if (!dominates (T, Block, UBlock, *Start)) return false; } } @@ -191,7 +189,7 @@ // Only consider those which produce values (not void or labels). if (!(Inst->getType () == Type::VoidTy || Inst->getType () == Type::LabelTy)) - if (!DefinedInTraceBeforeUse (Inst, T, StartingFrom)) + if (!DefinedInTraceBeforeUse (Inst, T, T.begin ())) S.insert (Inst); } From gaeke at cs.uiuc.edu Mon Jun 14 22:52:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 14 22:52:01 2004 Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Message-ID: <200406150351.WAA05961@kain.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: UnpackTraceFunction.cpp updated: 1.83 -> 1.84 --- Log message: If we see a CALL instruction, save the return address register --- Diffs of the changes: (+4 -1) Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.83 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.84 --- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.83 Fri Jun 11 15:54:18 2004 +++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Mon Jun 14 22:51:38 2004 @@ -75,7 +75,9 @@ for (MachineFunction::iterator fi = MF.begin (), fe = MF.end (); fi != fe; ++fi) for (MachineBasicBlock::iterator bi = fi->begin (), be = fi->end (); - bi != be; ++bi) + bi != be; ++bi) { + if (bi->getOpcode () == V9::CALL) + RegsToSave.insert (SparcV9::o7); // save return-address register for (unsigned oi = 0, oe = bi->getNumOperands (); oi != oe; ++oi) { const MachineOperand &MO = bi->getOperand (oi); if (MO.isDef ()) { @@ -91,6 +93,7 @@ } } } + } // Deal with some sparc lunacy: If any of the floatcc regs are used, then we // only put %fsr in the set, not the floatcc regs which were actually used. From gaeke at cs.uiuc.edu Tue Jun 15 04:53:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 15 04:53:01 2004 Subject: [llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp Message-ID: <200406150946.EAA08596@zion.cs.uiuc.edu> Changes in directory reopt/lib/TraceToFunction: TraceToFunction.cpp updated: 1.66 -> 1.67 --- Log message: Add more comments, and add heaps more debugging information to the live-in/out calculations. This helped a lot with the following changes, which are designed to keep us from adding tons of fallacious "live-in" variables to TraceFunctions: 1. Allow DefinedInTraceBeforeUse() to ignore off-trace users of the value it's examining. This is appropriate for live-ins, but not for live-outs! Change callers to match. 2. Rework how addTraceLiveInsToSet handles phi nodes. It must not treat them the same as other instructions -- rather, it now adds entry-BB phi nodes to the live-in set (as before, but ignoring their operands), and neglects values incoming from off-trace BBs on other phi nodes. --- Diffs of the changes: (+62 -17) Index: reopt/lib/TraceToFunction/TraceToFunction.cpp diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.66 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.67 --- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.66 Mon Jun 14 16:32:05 2004 +++ reopt/lib/TraceToFunction/TraceToFunction.cpp Tue Jun 15 04:46:02 2004 @@ -102,45 +102,70 @@ } } -static bool DefinedInTraceBeforeUse (Value *V, Trace &T, Trace::iterator Start) { +static bool DefinedInTraceBeforeUse (Value *V, Trace &T, Trace::iterator Start, bool ignoreOffTraceUsers) { Instruction *Inst = dyn_cast (V); - if (!Inst) + if (!Inst) { + DEBUG (std::cerr << "TLV: " << V->getName () << " is not defined by an Instruction!\n"); return false; + } BasicBlock *Block = Inst->getParent (); - if (std::find (Start, T.end (), Block) == T.end ()) // Is V defined in trace? - return false; + if (std::find (Start, T.end (), Block) == T.end ()) { // If V defined off-trace, + DEBUG (std::cerr << "TLV: " << V->getName () << " is defined off-trace, in block " << Block->getName () << "!\n"); + return false; // then it's not DefinedInTrace. + } + // Figure out whether all the uses of V come after its definition. for (Value::use_iterator ui = V->use_begin (), ue = V->use_end (); ui != ue; ++ui) { Instruction *UInst = dyn_cast (*ui); - if (!UInst) // Non-Instruction Users scare me, mommy + if (!UInst) { // Non-Instruction Users scare me, mommy + DEBUG (std::cerr << "TLV: " << V->getName () << " has non-Instruction User: " << UInst->getName () << "!\n"); return false; + } if (isa (UInst) - && std::find (Start, T.end (), UInst->getParent ()) != T.end ()) + && std::find (Start, T.end (), UInst->getParent ()) != T.end ()) { + DEBUG (std::cerr << "TLV: " << V->getName () << " ignoring on-trace Phi User: " << UInst->getName () << "\n"); continue; // If a Phi node in the trace uses a value that's defined in the // trace, the def. must have originally dominated the Phi. + } BasicBlock *UBlock = UInst->getParent (); if (Block == UBlock) { + DEBUG (std::cerr << "TLV: " << V->getName () << "'s User " << UInst->getName () << " is in the same BasicBlock\n"); // Start at Block->begin() traversing next pointers; if UInst // appears BEFORE Inst in Block's InstList, return false for (BasicBlock::const_iterator bi = Block->begin (), be = Block->end (); bi != be; ++bi) { const Instruction *BlockInst = bi; - if (BlockInst == UInst) + if (BlockInst == UInst) { + DEBUG (std::cerr << "TLV: " << V->getName () << " Found User" << UInst->getName () << " before Def!\n"); return false; - else if (BlockInst == Inst) + } + else if (BlockInst == Inst) { + DEBUG (std::cerr << "TLV: " << V->getName () << " Found Def before User: " << UInst->getName () << "\n"); break; + } } } else { - if (std::find (Start, T.end (), UBlock) == T.end ()) return false; + DEBUG (std::cerr << "TLV: " << V->getName () << "'s User " << UInst->getName () << " is in a different BasicBlock\n"); + if (std::find (Start, T.end (), UBlock) == T.end ()) { + if (!ignoreOffTraceUsers) { + DEBUG (std::cerr << "TLV: " << V->getName () << "'s User " << UInst->getName () << " is off-trace!\n"); + return false; + } else { + DEBUG (std::cerr << "TLV: " << V->getName () << "'s User " << UInst->getName () << " is off-trace, but we don't care\n"); + } + } else { // If UBlock appears BEFORE Block on some path from the first // basic block of the trace to an exit BB of the trace, return // false. - if (!dominates (T, Block, UBlock, *Start)) + if (!dominates (T, Block, UBlock, *Start)) { + DEBUG (std::cerr << "TLV: " << V->getName () << "'s User " << UInst->getName () << " not dominated by Def!\n"); return false; + } } } } + DEBUG (std::cerr << "TLV: " << V->getName () << " is defined in trace before any use*\n"); return true; } @@ -151,18 +176,38 @@ Trace::iterator StartingFrom) { for (Trace::iterator TI = StartingFrom, TE = T.end (); TI != TE; ++TI) for (BasicBlock::iterator Inst = (*TI)->begin (), BE = (*TI)->end (); - Inst != BE; ++Inst) + Inst != BE; ++Inst) { + if (PHINode *PN = dyn_cast (Inst)) { + if (TI == StartingFrom) { + S.insert (Inst); // Add phis from first BB + } else { + // Phi node internal to trace + DEBUG (std::cerr << "TLV: considering Phi internal to trace: " << Inst->getName () << "\n"); + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { + BasicBlock *InB = PN->getIncomingBlock (i); + if (std::find (StartingFrom, T.end (), InB) != T.end ()) { + Value *V = PN->getIncomingValue (i); + // neglect incoming phi values from off-trace + if (!(isa (V) || isa (V) + || isa(V))) { + DEBUG (std::cerr << "TLV: considering Phi source which is on-trace: " << InB->getName () << " with value " << V->getName () << "\n"); + if (!DefinedInTraceBeforeUse (V, T, StartingFrom, true)) + S.insert (V); + } + } + } + DEBUG (std::cerr << "TLV: done considering Phi internal to trace: " << Inst->getName () << "\n"); + } + continue; + } for (unsigned i = 0; i < Inst->getNumOperands (); ++i) { Value *V = Inst->getOperand (i); // V is used in the trace by Inst. if (!(isa (V) || isa (V) || isa(V))) - if (!DefinedInTraceBeforeUse (V, T, StartingFrom)) + if (!DefinedInTraceBeforeUse (V, T, StartingFrom, true)) S.insert (V); } - // Add phis from first BB - for (BasicBlock::iterator Inst = (*StartingFrom)->begin (); - PHINode *PN = dyn_cast (Inst); ++Inst) - S.insert (PN); + } } /// getTraceLiveInSet - Initialize TF->LiveInSet with the live-in set of the @@ -189,7 +234,7 @@ // Only consider those which produce values (not void or labels). if (!(Inst->getType () == Type::VoidTy || Inst->getType () == Type::LabelTy)) - if (!DefinedInTraceBeforeUse (Inst, T, T.begin ())) + if (!DefinedInTraceBeforeUse (Inst, T, T.begin (), false)) S.insert (Inst); } From gaeke at cs.uiuc.edu Tue Jun 15 13:48:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 15 13:48:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c Message-ID: <200406151841.NAA30785@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi: newvor.c updated: 1.4 -> 1.5 --- Log message: Make it link on Mac OS X, where there is no memalign. Of course, we could use valloc(), but this was just so handy... --- Diffs of the changes: (+4 -0) Index: llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c diff -u llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.4 llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.5 --- llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.4 Tue May 25 03:31:18 2004 +++ llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c Tue Jun 15 13:41:12 2004 @@ -160,6 +160,10 @@ void delete_all_edges() { next_edge= 0; avail_edge = NYL;} +#if defined(__POWERPC__) +#define MEMALIGN_IS_NOT_AVAILABLE +#endif + /* memalign() on my SGI doesn't work. Thus, I have to write my own */ void* myalign(int align_size, int alloc_size) { From lattner at cs.uiuc.edu Tue Jun 15 15:55:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 15:55:02 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp ary.cpp ary2.cpp ary3.cpp echo.cpp except.cpp fibo.cpp hash.cpp hash2.cpp heapsort.cpp lists.cpp lists1.cpp matrix.cpp methcall.cpp moments.cpp nestedloop.cpp objinst.cpp random.cpp sieve.cpp strcat.cpp Message-ID: <200406152048.PAA04400@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++: ackermann.cpp updated: 1.1 -> 1.2 ary.cpp updated: 1.2 -> 1.3 ary2.cpp updated: 1.3 -> 1.4 ary3.cpp updated: 1.1 -> 1.2 echo.cpp updated: 1.1 -> 1.2 except.cpp updated: 1.1 -> 1.2 fibo.cpp updated: 1.1 -> 1.2 hash.cpp updated: 1.1 -> 1.2 hash2.cpp updated: 1.1 -> 1.2 heapsort.cpp updated: 1.2 -> 1.3 lists.cpp updated: 1.2 -> 1.3 lists1.cpp updated: 1.3 -> 1.4 matrix.cpp updated: 1.1 -> 1.2 methcall.cpp updated: 1.1 -> 1.2 moments.cpp updated: 1.2 -> 1.3 nestedloop.cpp updated: 1.1 -> 1.2 objinst.cpp updated: 1.1 -> 1.2 random.cpp updated: 1.1 -> 1.2 sieve.cpp updated: 1.1 -> 1.2 strcat.cpp updated: 1.1 -> 1.2 --- Log message: Make tests run for a reasonable amount of time. Patch contributed by Valery Khamenya! --- Diffs of the changes: (+40 -39) Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.1 Mon Oct 6 19:57:08 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ackermann.cpp,v 1.1 2003/10/07 00:57:08 lattner Exp $ +// $Id: ackermann.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -10,7 +10,7 @@ int Ack(int M, int N) { return(M ? (Ack(M-1,N ? Ack(M,(N-1)) : 1)) : N+1); } int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 12); cout << "Ack(3," << n << "): " << Ack(3, n) << endl; return(0); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.2 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.3 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.2 Mon Oct 6 19:53:07 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ary.cpp,v 1.2 2003/10/07 00:53:07 lattner Exp $ +// $Id: ary.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -7,7 +7,7 @@ int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 1); + int i, n = ((argc == 2) ? atoi(argv[1]) : 90000000); typedef std::vector ARY; ARY x(n); ARY y(n); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary2.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.3 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.4 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.3 Thu Dec 11 11:22:38 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary2.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ary2.cpp,v 1.3 2003/12/11 17:22:38 lattner Exp $ +// $Id: ary2.cpp,v 1.4 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -7,7 +7,7 @@ int main(int argc, char *argv[]) { - int i, n = 10*((argc == 2) ? atoi(argv[1]) : 1); + int i, n = 10*((argc == 2) ? atoi(argv[1]) : 9000000); typedef std::vector ARY; ARY x(n); ARY y(n); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary3.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/ary3.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ary3.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: ary3.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -8,7 +8,7 @@ using namespace std; int main(int argc, char *argv[]) { - int i, k, n = ((argc == 2) ? atoi(argv[1]) : 1); + int i, k, n = ((argc == 2) ? atoi(argv[1]) : 1500000); typedef vector ARY; ARY x(n); ARY y(n); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/echo.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: echo.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: echo.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 100000); echo_server(n); return(0); } Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/except.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/except.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: except.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: except.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ // from Bill Lear @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) { - size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 1); + size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 100000); while (NUM--) { some_function(NUM); } Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/fibo.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.1 Mon Oct 6 19:55:47 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/fibo.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: fibo.cpp,v 1.1 2003/10/07 00:55:47 lattner Exp $ +// $Id: fibo.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -15,7 +15,7 @@ } int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 43); cout << fib(n) << endl; return(0); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: hash.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: hash.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 3500000); char buf[16]; typedef hash_map, eqstr> HM; HM X; Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash2.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/hash2.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: hash2.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: hash2.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 2000); char buf[16]; typedef hash_map, eqstr> HM; HM hash1, hash2; Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.2 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.3 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.2 Tue Dec 9 11:05:38 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: heapsort.cpp,v 1.2 2003/12/09 17:05:38 criswell Exp $ +// $Id: heapsort.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) { - int N = ((argc == 2) ? atoi(argv[1]) : 10); + int N = ((argc == 2) ? atoi(argv[1]) : 8000000); double *ary; int i; Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.2 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.3 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.2 Mon Oct 6 20:03:17 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: lists.cpp,v 1.2 2003/10/07 01:03:17 lattner Exp $ +// $Id: lists.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ // from Bill Lear @@ -46,7 +46,7 @@ } int main(int argc, char* argv[]) { - size_t ITER = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 1); + size_t ITER = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 3000); size_t result = 0; while (ITER > 0) { Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.3 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.4 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.3 Wed Dec 10 13:22:22 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: lists1.cpp,v 1.3 2003/12/10 19:22:22 lattner Exp $ +// $Id: lists1.cpp,v 1.4 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -27,7 +27,7 @@ } int main(int argc, char* argv[]) { - int N = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 1); + int N = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 10000000); list::iterator i; // create empty list B Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/matrix.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/matrix.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: matrix.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: matrix.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -48,7 +48,7 @@ } int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 1); + int i, n = ((argc == 2) ? atoi(argv[1]) : 100000); int **m1 = mkmatrix(SIZE, SIZE); int **m2 = mkmatrix(SIZE, SIZE); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/methcall.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/methcall.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: methcall.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: methcall.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ // with some help from Bill Lear @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 1000000000); bool val = true; Toggle *toggle = new Toggle(val); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/moments.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.2 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.3 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.2 Tue Apr 6 15:18:07 2004 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/moments.cpp Tue Jun 15 15:48:16 2004 @@ -65,11 +65,12 @@ T kurtosis; }; -int main() { +int main(int argc, char**argv) { + int n = ((argc == 2) ? atoi(argv[1]) : 50000000); vector v; double d; - for (unsigned i = 0; i != 500; ++i) v.push_back(i); + for (unsigned i = 0; i != n; ++i) v.push_back(i); moments m(v.begin(), v.end()); printf("n: %d\n", v.end() - v.begin()); Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: nestedloop.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: nestedloop.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -8,7 +8,7 @@ using namespace std; int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 46); int a, b, c, d, e, f, x=0; for (a=0; a @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1); + int n = ((argc == 2) ? atoi(argv[1]) : 70000000); Toggle *toggle1 = new Toggle(true); for (int i=0; i<5; i++) { Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/random.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/random.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: random.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: random.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -19,7 +19,7 @@ } int main(int argc, char *argv[]) { - int N = ((argc == 2) ? atoi(argv[1]) : 1); + int N = ((argc == 2) ? atoi(argv[1]) : 400000000); double result = 0; while (N--) { Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/sieve.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/sieve.cpp Tue Jun 15 15:48:16 2004 @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): -1); + 500); vector primes; Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/strcat.cpp diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/strcat.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/strcat.cpp:1.2 --- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/strcat.cpp:1.1 Mon Oct 6 20:11:33 2003 +++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/strcat.cpp Tue Jun 15 15:48:16 2004 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: strcat.cpp,v 1.1 2003/10/07 01:11:33 lattner Exp $ +// $Id: strcat.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ // http://www.bagley.org/~doug/shootout/ // with help from PeterB @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 1); + int i, n = ((argc == 2) ? atoi(argv[1]) : 50000000); string str; size_t capacity = 31; str.reserve(capacity); // as per C-string From lattner at cs.uiuc.edu Tue Jun 15 16:15:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:15:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200406152107.QAA05118@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.139 -> 1.140 --- Log message: Do not dereference end iterators. It's really bad for the asmwriter's health. This possibly fixes PR370: http://llvm.cs.uiuc.edu/PR370 --- Diffs of the changes: (+4 -1) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.139 llvm/lib/VMCore/AsmWriter.cpp:1.140 --- llvm/lib/VMCore/AsmWriter.cpp:1.139 Wed Jun 9 17:22:10 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Jun 15 16:07:32 2004 @@ -1324,7 +1324,10 @@ // Return the slot number as the module's contribution to // the type plane plus the index in the function's contribution // to the type plane. - return MI->second.next_slot + FVI->second; + if (MI != mMap.end()) + return MI->second.next_slot + FVI->second; + else + return FVI->second; } } } From lattner at cs.uiuc.edu Tue Jun 15 16:36:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:36:01 2004 Subject: [llvm-commits] CVS: llvm/test/Feature/intrinsics.ll Message-ID: <200406152129.QAA05420@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: intrinsics.ll updated: 1.3 -> 1.4 --- Log message: Add a nan, stop testing isnan --- Diffs of the changes: (+1 -6) Index: llvm/test/Feature/intrinsics.ll diff -u llvm/test/Feature/intrinsics.ll:1.3 llvm/test/Feature/intrinsics.ll:1.4 --- llvm/test/Feature/intrinsics.ll:1.3 Sat Jun 12 14:19:14 2004 +++ llvm/test/Feature/intrinsics.ll Tue Jun 15 16:29:01 2004 @@ -1,7 +1,4 @@ -declare bool %llvm.isnan(float) -declare bool %llvm.isnan(double) - declare bool %llvm.isunordered(float, float) declare bool %llvm.isunordered(double, double) @@ -10,9 +7,7 @@ ; Test llvm intrinsics ; void %libm() { - call bool %llvm.isnan(float 0.0) - call bool %llvm.isnan(double 10.0) call bool %llvm.isunordered(float 0.0, float 1.0) - call bool %llvm.isunordered(double 0.0, double 1.0) + call bool %llvm.isunordered(double 0.0, double double 0x7FF8000000000000) ret void } From lattner at cs.uiuc.edu Tue Jun 15 16:36:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:36:04 2004 Subject: [llvm-commits] CVS: llvm/test/Feature/intrinsics.ll Message-ID: <200406152129.QAA05436@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: intrinsics.ll updated: 1.4 -> 1.5 --- Log message: Right, stop being silly --- Diffs of the changes: (+1 -1) Index: llvm/test/Feature/intrinsics.ll diff -u llvm/test/Feature/intrinsics.ll:1.4 llvm/test/Feature/intrinsics.ll:1.5 --- llvm/test/Feature/intrinsics.ll:1.4 Tue Jun 15 16:29:01 2004 +++ llvm/test/Feature/intrinsics.ll Tue Jun 15 16:29:40 2004 @@ -8,6 +8,6 @@ ; void %libm() { call bool %llvm.isunordered(float 0.0, float 1.0) - call bool %llvm.isunordered(double 0.0, double double 0x7FF8000000000000) + call bool %llvm.isunordered(double 0.0, double 0x7FF8000000000000) ret void } From lattner at cs.uiuc.edu Tue Jun 15 16:43:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:43:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200406152136.QAA06218@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.261 -> 1.262 --- Log message: Add basic support for the isunordered intrinsic. The isnan stuff still needs to go --- Diffs of the changes: (+9 -0) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.261 llvm/lib/Target/X86/InstSelectSimple.cpp:1.262 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.261 Fri Jun 11 00:33:49 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Tue Jun 15 16:36:44 2004 @@ -1664,6 +1664,7 @@ case Intrinsic::memcpy: case Intrinsic::memset: case Intrinsic::isnan: + case Intrinsic::isunordered: case Intrinsic::readport: case Intrinsic::writeport: // We directly implement these intrinsics @@ -1742,6 +1743,14 @@ BuildMI(BB, X86::SETPr, 0, TmpReg2); return; + case Intrinsic::isunordered: + TmpReg1 = getReg(CI.getOperand(1)); + TmpReg2 = getReg(CI.getOperand(2)); + emitUCOMr(BB, BB->end(), TmpReg2, TmpReg1); + TmpReg2 = getReg(CI); + BuildMI(BB, X86::SETPr, 0, TmpReg2); + return; + case Intrinsic::memcpy: { assert(CI.getNumOperands() == 5 && "Illegal llvm.memcpy call!"); unsigned Align = 1; From lattner at cs.uiuc.edu Tue Jun 15 16:44:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:44:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200406152138.QAA06232@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.27 -> 1.28 --- Log message: Remove support for the isnan intrinsic --- Diffs of the changes: (+0 -3) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.27 llvm/lib/Transforms/Utils/Local.cpp:1.28 --- llvm/lib/Transforms/Utils/Local.cpp:1.27 Mon Jun 14 01:33:19 2004 +++ llvm/lib/Transforms/Utils/Local.cpp Tue Jun 15 16:37:54 2004 @@ -245,7 +245,6 @@ const std::string &Name = F->getName(); switch (F->getIntrinsicID()) { - case Intrinsic::isnan: return true; case Intrinsic::isunordered: return true; default: break; } @@ -274,8 +273,6 @@ if (Operands.size() == 1) { if (ConstantFP *Op = dyn_cast(Operands[0])) { double V = Op->getValue(); - if (Name == "llvm.isnan") - return ConstantBool::get(isnan(V)); else if (Name == "sin") return ConstantFP::get(Ty, sin(V)); else if (Name == "cos") From lattner at cs.uiuc.edu Tue Jun 15 16:49:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:49:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/IntrinsicLowering.cpp Message-ID: <200406152142.QAA06285@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: IntrinsicLowering.cpp updated: 1.17 -> 1.18 --- Log message: Remove isnan support, correct isunordered support --- Diffs of the changes: (+2 -10) Index: llvm/lib/VMCore/IntrinsicLowering.cpp diff -u llvm/lib/VMCore/IntrinsicLowering.cpp:1.17 llvm/lib/VMCore/IntrinsicLowering.cpp:1.18 --- llvm/lib/VMCore/IntrinsicLowering.cpp:1.17 Sat Jun 12 14:18:54 2004 +++ llvm/lib/VMCore/IntrinsicLowering.cpp Tue Jun 15 16:42:23 2004 @@ -105,8 +105,8 @@ EnsureFunctionExists(M, "memset", I->abegin(), --I->aend(), I->abegin()->getType()); break; - case Intrinsic::isnan: - EnsureFunctionExists(M, "isnan", I->abegin(), I->aend(), Type::BoolTy); + case Intrinsic::isunordered: + EnsureFunctionExists(M, "isunordered", I->abegin(), I->aend(), Type::BoolTy); break; } @@ -200,14 +200,6 @@ (*(CI->op_begin()+1))->getType(), MemsetFCache); break; } - case Intrinsic::isnan: { - // FIXME: This should force the argument to be a double. There may be - // multiple isnans for different FP arguments. - static Function *isnanFCache = 0; - ReplaceCallWith("isnan", CI, CI->op_begin()+1, CI->op_end(), - Type::BoolTy, isnanFCache); - break; - } case Intrinsic::isunordered: { static Function *isunorderedFCache = 0; ReplaceCallWith("isunordered", CI, CI->op_begin()+1, CI->op_end(), From lattner at cs.uiuc.edu Tue Jun 15 16:53:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:53:01 2004 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/compare_folding.llx Message-ID: <200406152146.QAA06350@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: compare_folding.llx updated: 1.1 -> 1.2 --- Log message: This testcase is a bit silly now, but oh well :) --- Diffs of the changes: (+2 -4) Index: llvm/test/Regression/CodeGen/X86/compare_folding.llx diff -u llvm/test/Regression/CodeGen/X86/compare_folding.llx:1.1 llvm/test/Regression/CodeGen/X86/compare_folding.llx:1.2 --- llvm/test/Regression/CodeGen/X86/compare_folding.llx:1.1 Fri Jun 11 00:30:34 2004 +++ llvm/test/Regression/CodeGen/X86/compare_folding.llx Tue Jun 15 16:46:16 2004 @@ -1,11 +1,9 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep com | wc -l > %t2 ; RUN: grep 'COM =' %s | grep -v grep | wc -l > %t1 ; RUN: diff %t1 %t2 -declare bool %llvm.isnan(double) +declare bool %llvm.isunordered(double,double) bool %test1(double %X, double %Y) { ;; Returns isunordered(X,Y) - %a = call bool %llvm.isnan(double %X) - %b = call bool %llvm.isnan(double %Y) - %COM = or bool %a, %b + %COM = call bool %llvm.isunordered(double %X, double %Y) ret bool %COM } From lattner at cs.uiuc.edu Tue Jun 15 16:55:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:55:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200406152148.QAA06708@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.262 -> 1.263 --- Log message: Remove support for llvm.isnan. Alkis wins :) --- Diffs of the changes: (+0 -50) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.262 llvm/lib/Target/X86/InstSelectSimple.cpp:1.263 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.262 Tue Jun 15 16:36:44 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Tue Jun 15 16:48:07 2004 @@ -1619,32 +1619,6 @@ doCall(ValueRecord(DestReg, CI.getType()), TheCall, Args); } -/// dyncastIsNan - Return the operand of an isnan operation if this is an isnan. -/// -static Value *dyncastIsNan(Value *V) { - if (CallInst *CI = dyn_cast(V)) - if (Function *F = CI->getCalledFunction()) - if (F->getIntrinsicID() == Intrinsic::isnan) - return CI->getOperand(1); - return 0; -} - -/// isOnlyUsedByUnorderedComparisons - Return true if this value is only used by -/// or's whos operands are all calls to the isnan predicate. -static bool isOnlyUsedByUnorderedComparisons(Value *V) { - assert(dyncastIsNan(V) && "The value isn't an isnan call!"); - - // Check all uses, which will be or's of isnans if this predicate is true. - for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E;++UI){ - Instruction *I = cast(*UI); - if (I->getOpcode() != Instruction::Or) return false; - if (I->getOperand(0) != V && !dyncastIsNan(I->getOperand(0))) return false; - if (I->getOperand(1) != V && !dyncastIsNan(I->getOperand(1))) return false; - } - - return true; -} - /// LowerUnknownIntrinsicFunctionCalls - This performs a prepass over the /// function, lowering any calls to unknown intrinsic functions into the /// equivalent LLVM code. @@ -1663,7 +1637,6 @@ case Intrinsic::frameaddress: case Intrinsic::memcpy: case Intrinsic::memset: - case Intrinsic::isnan: case Intrinsic::isunordered: case Intrinsic::readport: case Intrinsic::writeport: @@ -1734,15 +1707,6 @@ } return; - case Intrinsic::isnan: - // If this is only used by 'isunordered' style comparisons, don't emit it. - if (isOnlyUsedByUnorderedComparisons(&CI)) return; - TmpReg1 = getReg(CI.getOperand(1)); - emitUCOMr(BB, BB->end(), TmpReg1, TmpReg1); - TmpReg2 = getReg(CI); - BuildMI(BB, X86::SETPr, 0, TmpReg2); - return; - case Intrinsic::isunordered: TmpReg1 = getReg(CI.getOperand(1)); TmpReg2 = getReg(CI.getOperand(2)); @@ -2162,20 +2126,6 @@ return; } - if (Op0->getType() == Type::BoolTy) { - if (OperatorClass == 3) - // If this is an or of two isnan's, emit an FP comparison directly instead - // of or'ing two isnan's together. - if (Value *LHS = dyncastIsNan(Op0)) - if (Value *RHS = dyncastIsNan(Op1)) { - unsigned Op0Reg = getReg(RHS, MBB, IP), Op1Reg = getReg(LHS, MBB, IP); - emitUCOMr(MBB, IP, Op0Reg, Op1Reg); - BuildMI(*MBB, IP, X86::SETPr, 0, DestReg); - return; - } - - } - // sub 0, X -> neg X if (ConstantInt *CI = dyn_cast(Op0)) if (OperatorClass == 1 && CI->isNullValue()) { From lattner at cs.uiuc.edu Tue Jun 15 16:57:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:57:01 2004 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200406152150.QAA07384@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.65 -> 1.66 --- Log message: llvm.isnan is dead, long live llvm.isunordered! --- Diffs of the changes: (+1 -35) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.65 llvm/docs/LangRef.html:1.66 --- llvm/docs/LangRef.html:1.65 Sat Jun 12 20:16:15 2004 +++ llvm/docs/LangRef.html Tue Jun 15 16:50:12 2004 @@ -124,7 +124,6 @@
  • 'llvm.memcpy' Intrinsic
  • 'llvm.memmove' Intrinsic
  • 'llvm.memset' Intrinsic
  • -
  • 'llvm.isnan' Intrinsic
  • 'llvm.isunordered' Intrinsic
  • @@ -2532,39 +2531,6 @@ - -
    - -
    Syntax:
    -
    -  call bool (<float or double>)* %llvm.isnan(<float or double> Val)
    -
    - -
    Overview:
    - -

    -The 'llvm.isnan' intrinsic returns true if the specific floating point -value is a NAN. -

    - -
    Arguments:
    - -

    -The argument is a floating point number. -

    - -
    Semantics:
    - -

    -If the argument is a SNAN or QNAN, it returns true, otherwise false. -

    -
    - - - - @@ -2625,7 +2591,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/13 01:16:15 $ + Last modified: $Date: 2004/06/15 21:50:12 $ From lattner at cs.uiuc.edu Tue Jun 15 16:57:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:57:04 2004 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200406152150.QAA08056@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.199 -> 1.200 --- Log message: llvm.isnan is dead, long live llvm.isunordered! --- Diffs of the changes: (+2 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.199 llvm/docs/ReleaseNotes.html:1.200 --- llvm/docs/ReleaseNotes.html:1.199 Thu Jun 10 23:35:21 2004 +++ llvm/docs/ReleaseNotes.html Tue Jun 15 16:50:46 2004 @@ -126,7 +126,7 @@ details of the bytecode format.
  • The LLVM Bytecode file format is now being documented.
  • -
  • LLVM now provides an llvm.isnan intrinsic +
  • LLVM now provides an llvm.isunordered intrinsic for efficient implementation of unordered floating point comparisons.
  • @@ -718,7 +718,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/11 04:35:21 $ + Last modified: $Date: 2004/06/15 21:50:46 $ From lattner at cs.uiuc.edu Tue Jun 15 16:58:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:58:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200406152151.QAA08088@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.42 -> 1.43 --- Log message: isnan is dead --- Diffs of the changes: (+1 -1) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.42 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.43 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.42 Fri Jun 11 01:17:13 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue Jun 15 16:51:38 2004 @@ -649,7 +649,7 @@ // that set errno on a domain or other error. static const char *DoesntAccessMemoryTable[] = { // LLVM intrinsics: - "llvm.frameaddress", "llvm.returnaddress", "llvm.readport", "llvm.isnan", + "llvm.frameaddress", "llvm.returnaddress", "llvm.readport", "llvm.isunordered", "abs", "labs", "llabs", "imaxabs", "fabs", "fabsf", "fabsl", "trunc", "truncf", "truncl", "ldexp", From lattner at cs.uiuc.edu Tue Jun 15 16:59:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:59:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Verifier.cpp Message-ID: <200406152152.QAA08126@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.72 -> 1.73 Verifier.cpp updated: 1.110 -> 1.111 --- Log message: isnan is dead --- Diffs of the changes: (+0 -11) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.72 llvm/lib/VMCore/Function.cpp:1.73 --- llvm/lib/VMCore/Function.cpp:1.72 Sat Jun 12 14:18:54 2004 +++ llvm/lib/VMCore/Function.cpp Tue Jun 15 16:52:19 2004 @@ -223,7 +223,6 @@ if (getName() == "llvm.gcroot") return Intrinsic::gcroot; break; case 'i': - if (getName() == "llvm.isnan") return Intrinsic::isnan; if (getName() == "llvm.isunordered") return Intrinsic::isunordered; break; case 'l': Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.110 llvm/lib/VMCore/Verifier.cpp:1.111 --- llvm/lib/VMCore/Verifier.cpp:1.110 Sat Jun 12 19:55:26 2004 +++ llvm/lib/VMCore/Verifier.cpp Tue Jun 15 16:52:19 2004 @@ -688,16 +688,6 @@ break; } - case Intrinsic::isnan: - Assert1(FT->getNumParams() == 1, - "Illegal # arguments for intrinsic function!", IF); - Assert1(FT->getReturnType() == Type::BoolTy, - "Return type is not bool!", IF); - Assert1(FT->getParamType(0)->isFloatingPoint(), - "Argument is not a floating point type!", IF); - NumArgs = 1; - break; - case Intrinsic::isunordered: Assert1(FT->getNumParams() == 2, "Illegal # arguments for intrinsic function!", IF); From lattner at cs.uiuc.edu Tue Jun 15 16:59:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 15 16:59:04 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Intrinsics.h Message-ID: <200406152153.QAA08140@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Intrinsics.h updated: 1.25 -> 1.26 --- Log message: isnan is dead --- Diffs of the changes: (+1 -2) Index: llvm/include/llvm/Intrinsics.h diff -u llvm/include/llvm/Intrinsics.h:1.25 llvm/include/llvm/Intrinsics.h:1.26 --- llvm/include/llvm/Intrinsics.h:1.25 Sat Jun 12 14:18:54 2004 +++ llvm/include/llvm/Intrinsics.h Tue Jun 15 16:52:58 2004 @@ -60,8 +60,7 @@ memset, // Fill memory with a byte value // libm related functions. - isnan, // Return true if fp argument is a NAN. - isunordered, // Return true if fp arguments are unordered + isunordered, // Return true if either argument is a NaN // Input/Output intrinsics. readport, From gaeke at cs.uiuc.edu Tue Jun 15 18:16:05 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 15 18:16:05 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200406152310.SAA08697@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.28 -> 1.29 --- Log message: Um, did someone make a typo or something? --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.28 llvm/lib/Transforms/Utils/Local.cpp:1.29 --- llvm/lib/Transforms/Utils/Local.cpp:1.28 Tue Jun 15 16:37:54 2004 +++ llvm/lib/Transforms/Utils/Local.cpp Tue Jun 15 18:09:50 2004 @@ -273,7 +273,7 @@ if (Operands.size() == 1) { if (ConstantFP *Op = dyn_cast(Operands[0])) { double V = Op->getValue(); - else if (Name == "sin") + if (Name == "sin") return ConstantFP::get(Ty, sin(V)); else if (Name == "cos") return ConstantFP::get(Ty, cos(V)); From gaeke at cs.uiuc.edu Tue Jun 15 19:33:02 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 15 19:33:02 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetMachineImpls.h Message-ID: <200406160026.TAA09044@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetMachineImpls.h updated: 1.13 -> 1.14 --- Log message: I'm afraid this doesn't exist. --- Diffs of the changes: (+0 -8) Index: llvm/include/llvm/Target/TargetMachineImpls.h diff -u llvm/include/llvm/Target/TargetMachineImpls.h:1.13 llvm/include/llvm/Target/TargetMachineImpls.h:1.14 --- llvm/include/llvm/Target/TargetMachineImpls.h:1.13 Thu Mar 4 13:16:23 2004 +++ llvm/include/llvm/Target/TargetMachineImpls.h Tue Jun 15 19:26:45 2004 @@ -41,14 +41,6 @@ TargetMachine *allocateSparcV9TargetMachine(const Module &M, IntrinsicLowering *IL = 0); - // allocateSparcV8TargetMachine - Allocate and return a subclass of - // TargetMachine that implements the 32-bit Sparc backend. This takes - // ownership of the IntrinsicLowering pointer, deleting it when the target - // machine is destroyed. - // - TargetMachine *allocateSparcV8TargetMachine(const Module &M, - IntrinsicLowering *IL = 0); - // allocateX86TargetMachine - Allocate and return a subclass of TargetMachine // that implements the X86 backend. This takes ownership of the // IntrinsicLowering pointer, deleting it when the target machine is From gaeke at cs.uiuc.edu Tue Jun 15 22:03:02 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 15 22:03:02 2004 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Message-ID: <200406160256.VAA09641@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: ExternalFunctions.cpp updated: 1.75 -> 1.76 --- Log message: Add int ferror(FILE *) --- Diffs of the changes: (+8 -0) Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.75 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.76 --- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.75 Thu May 27 16:24:38 2004 +++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Tue Jun 15 21:56:40 2004 @@ -636,6 +636,14 @@ return GV; } +// int ferror (FILE *stream); +GenericValue lle_X_ferror(FunctionType *M, const vector &Args) { + assert(Args.size() == 1); + GenericValue GV; + GV.IntVal = ferror (getFILE(GVTOP(Args[0]))); + return GV; +} + // int fprintf(FILE *,sbyte *, ...) - a very rough implementation to make output // useful. GenericValue lle_X_fprintf(FunctionType *M, const vector &Args) { From lattner at cs.uiuc.edu Wed Jun 16 02:04:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 16 02:04:02 2004 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLocal.cpp Message-ID: <200406160657.BAA10753@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: RegAllocLocal.cpp updated: 1.62 -> 1.63 --- Log message: Fix a recent regression in Applications/sgefa that Alkis pointed out to me. The vector may actually be empty if the register that we are marking as recently used is not actually allocatable. This happens for physical registers that are not allocatable, like the ST(x) registers on X86. --- Diffs of the changes: (+2 -2) Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.62 llvm/lib/CodeGen/RegAllocLocal.cpp:1.63 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.62 Wed Jun 2 00:57:12 2004 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Wed Jun 16 01:57:29 2004 @@ -93,8 +93,8 @@ } void MarkPhysRegRecentlyUsed(unsigned Reg) { - assert(!PhysRegsUseOrder.empty() && "No registers used!"); - if (PhysRegsUseOrder.back() == Reg) return; // Already most recently used + if(PhysRegsUseOrder.empty() || + PhysRegsUseOrder.back() == Reg) return; // Already most recently used for (unsigned i = PhysRegsUseOrder.size(); i != 0; --i) if (areRegsEqual(Reg, PhysRegsUseOrder[i-1])) { From gaeke at cs.uiuc.edu Thu Jun 17 02:28:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 17 02:28:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200406170727.CAA17014@kain.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.60 -> 1.61 --- Log message: Fix typo in DEBUG printout. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.60 llvm/lib/Transforms/Scalar/LICM.cpp:1.61 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.60 Sun May 23 16:20:19 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Thu Jun 17 02:26:52 2004 @@ -549,7 +549,7 @@ /// that is safe to hoist, this instruction is called to do the dirty work. /// void LICM::hoist(Instruction &I) { - DEBUG(std::cerr << "LICM hoisting to" << Preheader->getName() + DEBUG(std::cerr << "LICM hoisting to " << Preheader->getName() << ": " << I); // Remove the instruction from its current basic block... but don't delete the From brukman at cs.uiuc.edu Thu Jun 17 10:47:02 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu Jun 17 10:47:02 2004 Subject: [llvm-commits] CVS: llvm/Makefile.config.in Message-ID: <200406171540.KAA08355@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.config.in updated: 1.27 -> 1.28 --- Log message: Since the Great LLVM Tool Renaming(tm), we no longer have collisions between our assembler/linker and the system equivalents. --- Diffs of the changes: (+1 -6) Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.27 llvm/Makefile.config.in:1.28 --- llvm/Makefile.config.in:1.27 Tue Jun 1 14:04:38 2004 +++ llvm/Makefile.config.in Thu Jun 17 10:39:58 2004 @@ -23,14 +23,9 @@ # Path to the C++ compiler to use. This is an optional setting, which defaults # to whatever your gmake defaults to. -# -# Under Linux, for some reason the compiler driver wants to search the PATH to -# find the system assembler, which breaks if the LLVM assembler is in our path. -# Hack it to use the assembler in /usr/bin directly. CXX = @CXX@ -# We have the same problem with the CC binary, which use used by testcases for -# native builds. +# Path to the CC binary, which use used by testcases for native builds. CC := @CC@ # Linker flags. From brukman at cs.uiuc.edu Thu Jun 17 10:56:02 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu Jun 17 10:56:02 2004 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Makefile Message-ID: <200406171549.KAA08483@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Makefile updated: 1.10 -> 1.11 --- Log message: Make header comment fit within 80 cols. --- Diffs of the changes: (+1 -1) Index: llvm/utils/TableGen/Makefile diff -u llvm/utils/TableGen/Makefile:1.10 llvm/utils/TableGen/Makefile:1.11 --- llvm/utils/TableGen/Makefile:1.10 Mon Oct 20 17:29:16 2003 +++ llvm/utils/TableGen/Makefile Thu Jun 17 10:49:36 2004 @@ -1,4 +1,4 @@ -##===- utils/TableGen/Makefile ------------------------------*- Makefile -*-===## +##===- utils/TableGen/Makefile -----------------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # From lattner at cs.uiuc.edu Thu Jun 17 13:04:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:04:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200406171757.MAA25587@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.111 -> 1.112 --- Log message: Minor cleanup --- Diffs of the changes: (+1 -1) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.111 llvm/lib/VMCore/Verifier.cpp:1.112 --- llvm/lib/VMCore/Verifier.cpp:1.111 Tue Jun 15 16:52:19 2004 +++ llvm/lib/VMCore/Verifier.cpp Thu Jun 17 12:56:54 2004 @@ -660,7 +660,7 @@ "Illegal # arguments for intrinsic function!", IF); Assert1(FT->getParamType(0)->isFirstClassType(), "First argument not a first class type!", IF); - Assert1(FT->getParamType(1)->getPrimitiveID() == Type::PointerTyID, + Assert1(isa(FT->getParamType(1)), "Second argument not a pointer!", IF); NumArgs = 2; break; From gaeke at cs.uiuc.edu Thu Jun 17 13:14:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 17 13:14:01 2004 Subject: [llvm-commits] CVS: reopt/test/run-tests Message-ID: <200406171813.NAA09235@kain.cs.uiuc.edu> Changes in directory reopt/test: run-tests updated: 1.5 -> 1.6 --- Log message: Add hash. --- Diffs of the changes: (+1 -0) Index: reopt/test/run-tests diff -u reopt/test/run-tests:1.5 reopt/test/run-tests:1.6 --- reopt/test/run-tests:1.5 Wed Jun 9 15:26:17 2004 +++ reopt/test/run-tests Thu Jun 17 13:13:20 2004 @@ -50,6 +50,7 @@ strcat) SUBDIR=SingleSource/Reoptimizer/Strcat ;; mynestedloop) SUBDIR=SingleSource/Reoptimizer/MyNestedLoop ;; fib2) SUBDIR=SingleSource/Reoptimizer/Fib2 ;; + hash) SUBDIR=SingleSource/Reoptimizer/Hash ;; mcf) SUBDIR=External/SPEC/CINT2000/181.mcf; spectest=1 ;; art) SUBDIR=External/SPEC/CFP2000/179.art; spectest=1;; From gaeke at cs.uiuc.edu Thu Jun 17 13:14:04 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 17 13:14:04 2004 Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Message-ID: <200406171813.NAA09228@kain.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: UnpackTraceFunction.cpp updated: 1.84 -> 1.85 --- Log message: Be sure to write back registers which are getting written with live-out values. --- Diffs of the changes: (+5 -0) Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.84 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.85 --- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.84 Mon Jun 14 22:51:38 2004 +++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Thu Jun 17 13:13:19 2004 @@ -307,6 +307,11 @@ assert (Target.AllocState == AllocInfo::Allocated && "Live-out values must be in regs in the matrixFn"); mvec.clear (); + if (RegsToSave.find (Target.Placement) == RegsToSave.end ()) { + DEBUG (std::cerr << "rewriteProlog: Adding live-out's matrixFn " + << RegStr (Target.Placement) << " to RegsToSave set\n"); + RegsToSave.insert (Target.Placement); + } DEBUG (std::cerr << "rewriteEpilog: copying live-out value: "; PrintValueAIs(V->getName(), Target, Source)); if (Source.AllocState == AllocInfo::NotAllocated) { From lattner at cs.uiuc.edu Thu Jun 17 13:22:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:22:01 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Type.h DerivedTypes.h Message-ID: <200406171815.NAA15507@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Type.h updated: 1.44 -> 1.45 DerivedTypes.h updated: 1.57 -> 1.58 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+25 -25) Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.44 llvm/include/llvm/Type.h:1.45 --- llvm/include/llvm/Type.h:1.44 Wed May 26 16:48:31 2004 +++ llvm/include/llvm/Type.h Thu Jun 17 13:15:25 2004 @@ -54,7 +54,7 @@ /// Note: If you add an element to this, you need to add an element to the /// Type::getPrimitiveType function, or else things will break! /// - enum PrimitiveID { + enum TypeID { VoidTyID = 0 , BoolTyID, // 0, 1: Basics... UByteTyID , SByteTyID, // 2, 3: 8 bit types... UShortTyID , ShortTyID, // 4, 5: 16 bit types... @@ -74,14 +74,14 @@ //PackedTyID , // SIMD 'packed' format... TODO //... - NumPrimitiveIDs, // Must remain as last defined ID + NumTypeIDs, // Must remain as last defined ID FirstDerivedTyID = FunctionTyID, }; private: - PrimitiveID ID; // The current base type of this type... - unsigned UID; // The unique ID number for this class - bool Abstract; // True if type contains an OpaqueType + TypeID ID; // The current base type of this type... + unsigned UID; // The unique ID number for this class + bool Abstract; // True if type contains an OpaqueType /// RefCount - This counts the number of PATypeHolders that are pointing to /// this type. When this number falls to zero, if the type is abstract and @@ -93,7 +93,7 @@ const Type *getForwardedTypeInternal() const; protected: /// ctor is protected, so only subclasses can create Type objects... - Type(const std::string &Name, PrimitiveID id); + Type(const std::string &Name, TypeID id); virtual ~Type() {} @@ -137,10 +137,10 @@ // are defined in private classes defined in Type.cpp for primitive types. // - /// getPrimitiveID - Return the base type of the type. This will return one - /// of the PrimitiveID enum elements defined above. + /// getTypeID - Return the type id for the type. This will return one + /// of the TypeID enum elements defined above. /// - inline PrimitiveID getPrimitiveID() const { return ID; } + inline TypeID getTypeID() const { return ID; } /// getUniqueID - Returns the UID of the type. This can be thought of as a /// small integer version of the pointer to the type class. Two types that @@ -259,7 +259,7 @@ // /// getPrimitiveType/getUniqueIDType - Return a type based on an identifier. - static const Type *getPrimitiveType(PrimitiveID IDNumber); + static const Type *getPrimitiveType(TypeID IDNumber); static const Type *getUniqueIDType(unsigned UID); //===--------------------------------------------------------------------===// @@ -394,7 +394,7 @@ }; template <> inline bool isa_impl(const Type &Ty) { - return Ty.getPrimitiveID() == Type::PointerTyID; + return Ty.getTypeID() == Type::PointerTyID; } } // End llvm namespace Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.57 llvm/include/llvm/DerivedTypes.h:1.58 --- llvm/include/llvm/DerivedTypes.h:1.57 Tue May 25 03:45:42 2004 +++ llvm/include/llvm/DerivedTypes.h Thu Jun 17 13:15:25 2004 @@ -35,7 +35,7 @@ mutable std::vector AbstractTypeUsers; protected: - DerivedType(PrimitiveID id) : Type("", id) {} + DerivedType(TypeID id) : Type("", id) {} ~DerivedType() { assert(AbstractTypeUsers.empty()); } @@ -149,7 +149,7 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FunctionType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == FunctionTyID; + return T->getTypeID() == FunctionTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -161,7 +161,7 @@ /// class CompositeType : public DerivedType { protected: - inline CompositeType(PrimitiveID id) : DerivedType(id) { } + inline CompositeType(TypeID id) : DerivedType(id) { } public: /// getTypeAtIndex - Given an index value into the type, return the type of @@ -173,9 +173,9 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const CompositeType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == ArrayTyID || - T->getPrimitiveID() == StructTyID || - T->getPrimitiveID() == PointerTyID; + return T->getTypeID() == ArrayTyID || + T->getTypeID() == StructTyID || + T->getTypeID() == PointerTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -230,7 +230,7 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const StructType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == StructTyID; + return T->getTypeID() == StructTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -248,7 +248,7 @@ SequentialType(const SequentialType &); // Do not implement! const SequentialType &operator=(const SequentialType &); // Do not implement! protected: - SequentialType(PrimitiveID TID, const Type *ElType) : CompositeType(TID) { + SequentialType(TypeID TID, const Type *ElType) : CompositeType(TID) { ContainedTys.reserve(1); ContainedTys.push_back(PATypeHandle(ElType, this)); } @@ -264,7 +264,7 @@ } virtual bool indexValid(const Value *V) const { const Type *Ty = V->getType(); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::IntTyID: case Type::UIntTyID: case Type::LongTyID: @@ -278,8 +278,8 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SequentialType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == ArrayTyID || - T->getPrimitiveID() == PointerTyID; + return T->getTypeID() == ArrayTyID || + T->getTypeID() == PointerTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -319,7 +319,7 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ArrayType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == ArrayTyID; + return T->getTypeID() == ArrayTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -352,7 +352,7 @@ // Implement support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const PointerType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == PointerTyID; + return T->getTypeID() == PointerTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -391,7 +391,7 @@ // Implement support for type inquiry through isa, cast, and dyn_cast: static inline bool classof(const OpaqueType *T) { return true; } static inline bool classof(const Type *T) { - return T->getPrimitiveID() == OpaqueTyID; + return T->getTypeID() == OpaqueTyID; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); From lattner at cs.uiuc.edu Thu Jun 17 13:23:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:23:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp Message-ID: <200406171816.NAA16406@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Linker.cpp updated: 1.70 -> 1.71 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+2 -2) Index: llvm/lib/Transforms/Utils/Linker.cpp diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.70 llvm/lib/Transforms/Utils/Linker.cpp:1.71 --- llvm/lib/Transforms/Utils/Linker.cpp:1.70 Tue May 25 03:51:58 2004 +++ llvm/lib/Transforms/Utils/Linker.cpp Thu Jun 17 13:16:22 2004 @@ -97,10 +97,10 @@ // Two types cannot be resolved together if they are of different primitive // type. For example, we cannot resolve an int to a float. - if (DestTyT->getPrimitiveID() != SrcTyT->getPrimitiveID()) return true; + if (DestTyT->getTypeID() != SrcTyT->getTypeID()) return true; // Otherwise, resolve the used type used by this derived type... - switch (DestTyT->getPrimitiveID()) { + switch (DestTyT->getTypeID()) { case Type::FunctionTyID: { if (cast(DestTyT)->isVarArg() != cast(SrcTyT)->isVarArg() || From lattner at cs.uiuc.edu Thu Jun 17 13:23:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:23:04 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/FunctionResolution.cpp MutateStructTypes.cpp Message-ID: <200406171816.NAA16300@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: FunctionResolution.cpp updated: 1.46 -> 1.47 MutateStructTypes.cpp updated: 1.47 -> 1.48 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+3 -3) Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.46 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.47 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.46 Sun Feb 8 22:14:01 2004 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Thu Jun 17 13:16:19 2004 @@ -79,8 +79,8 @@ if (!Old->use_empty() && !Concrete->use_empty()) for (unsigned i = 0; i < NumArguments; ++i) if (OldMT->getParamType(i) != ConcreteMT->getParamType(i)) - if (OldMT->getParamType(i)->getPrimitiveID() != - ConcreteMT->getParamType(i)->getPrimitiveID()) { + if (OldMT->getParamType(i)->getTypeID() != + ConcreteMT->getParamType(i)->getTypeID()) { std::cerr << "WARNING: Function [" << Old->getName() << "]: Parameter types conflict for: '"; WriteTypeSymbolic(std::cerr, OldMT, &M); Index: llvm/lib/Transforms/IPO/MutateStructTypes.cpp diff -u llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.47 llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.48 --- llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.47 Tue May 25 03:51:14 2004 +++ llvm/lib/Transforms/IPO/MutateStructTypes.cpp Thu Jun 17 13:16:19 2004 @@ -54,7 +54,7 @@ PATypeHolder PlaceHolder = OpaqueType::get(); TypeMap.insert(std::make_pair(Ty, PlaceHolder.get())); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::FunctionTyID: { const FunctionType *FT = cast(Ty); const Type *RetTy = ConvertType(FT->getReturnType()); From lattner at cs.uiuc.edu Thu Jun 17 13:23:07 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:23:07 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200406171816.NAA16250@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.212 -> 1.213 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() Delete two functions that are now methods on the Type class --- Diffs of the changes: (+5 -29) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.212 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.213 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.212 Wed Jun 9 21:33:20 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jun 17 13:16:02 2004 @@ -212,34 +212,10 @@ return V->hasOneUse() || isa(V); } -// getSignedIntegralType - Given an unsigned integral type, return the signed -// version of it that has the same size. -static const Type *getSignedIntegralType(const Type *Ty) { - switch (Ty->getPrimitiveID()) { - default: assert(0 && "Invalid unsigned integer type!"); abort(); - case Type::UByteTyID: return Type::SByteTy; - case Type::UShortTyID: return Type::ShortTy; - case Type::UIntTyID: return Type::IntTy; - case Type::ULongTyID: return Type::LongTy; - } -} - -// getUnsignedIntegralType - Given an signed integral type, return the unsigned -// version of it that has the same size. -static const Type *getUnsignedIntegralType(const Type *Ty) { - switch (Ty->getPrimitiveID()) { - default: assert(0 && "Invalid signed integer type!"); abort(); - case Type::SByteTyID: return Type::UByteTy; - case Type::ShortTyID: return Type::UShortTy; - case Type::IntTyID: return Type::UIntTy; - case Type::LongTyID: return Type::ULongTy; - } -} - // getPromotedType - Return the specified type promoted as it would be to pass // though a va_arg area... static const Type *getPromotedType(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::SByteTyID: case Type::ShortTyID: return Type::IntTy; case Type::UByteTyID: @@ -645,9 +621,9 @@ if (ConstantUInt *CU = dyn_cast(SI->getOperand(1))) { const Type *NewTy; if (SI->getType()->isSigned()) - NewTy = getUnsignedIntegralType(SI->getType()); + NewTy = SI->getType()->getUnsignedVersion(); else - NewTy = getSignedIntegralType(SI->getType()); + NewTy = SI->getType()->getSignedVersion(); // Check to see if we are shifting out everything but the sign bit. if (CU->getValue() == SI->getType()->getPrimitiveSize()*8-1) { // Ok, the transformation is safe. Insert a cast of the incoming @@ -814,7 +790,7 @@ Constant *Amt = ConstantUInt::get(Type::UByteTy, SCOpTy->getPrimitiveSize()*8-1); if (SCIOp0->getType()->isUnsigned()) { - const Type *NewTy = getSignedIntegralType(SCIOp0->getType()); + const Type *NewTy = SCIOp0->getType()->getSignedVersion(); SCIOp0 = InsertNewInstBefore(new CastInst(SCIOp0, NewTy, SCIOp0->getName()), I); } @@ -1593,7 +1569,7 @@ Value *X = BO->getOperand(0); // If 'X' is not signed, insert a cast now... if (!BOC->getType()->isSigned()) { - const Type *DestTy = getSignedIntegralType(BOC->getType()); + const Type *DestTy = BOC->getType()->getSignedVersion(); CastInst *NewCI = new CastInst(X,DestTy,X->getName()+".signed"); InsertNewInstBefore(NewCI, I); X = NewCI; From lattner at cs.uiuc.edu Thu Jun 17 13:24:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:24:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Printer.cpp X86RegisterInfo.cpp X86SimpInstrSelector.cpp Message-ID: <200406171817.NAA17431@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.263 -> 1.264 Printer.cpp updated: 1.99 -> 1.100 X86RegisterInfo.cpp updated: 1.82 -> 1.83 X86SimpInstrSelector.cpp updated: 1.3 -> 1.4 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+11 -11) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.263 llvm/lib/Target/X86/InstSelectSimple.cpp:1.264 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.263 Tue Jun 15 16:48:07 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Thu Jun 17 13:17:22 2004 @@ -47,7 +47,7 @@ /// size of the type, and whether or not it is floating point. /// static inline TypeClass getClass(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::SByteTyID: case Type::UByteTyID: return cByte; // Byte operands are class #0 case Type::ShortTyID: @@ -3258,7 +3258,7 @@ const Type *PromoteType = 0; unsigned PromoteOpcode = 0; unsigned RealDestReg = DestReg; - switch (SrcTy->getPrimitiveID()) { + switch (SrcTy->getTypeID()) { case Type::BoolTyID: case Type::SByteTyID: // We don't have the facilities for directly loading byte sized data from @@ -3429,7 +3429,7 @@ unsigned DestReg = getReg(I); unsigned Size; - switch (I.getArgType()->getPrimitiveID()) { + switch (I.getArgType()->getTypeID()) { default: std::cerr << I; assert(0 && "Error: bad type for va_next instruction!"); @@ -3454,7 +3454,7 @@ unsigned VAList = getReg(I.getOperand(0)); unsigned DestReg = getReg(I); - switch (I.getType()->getPrimitiveID()) { + switch (I.getType()->getTypeID()) { default: std::cerr << I; assert(0 && "Error: bad type for va_next instruction!"); Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.99 llvm/lib/Target/X86/Printer.cpp:1.100 --- llvm/lib/Target/X86/Printer.cpp:1.99 Wed Jun 2 00:55:25 2004 +++ llvm/lib/Target/X86/Printer.cpp Thu Jun 17 13:17:24 2004 @@ -285,7 +285,7 @@ // FP Constants are printed as integer constants to avoid losing // precision... double Val = CFP->getValue(); - switch (CFP->getType()->getPrimitiveID()) { + switch (CFP->getType()->getTypeID()) { default: assert(0 && "Unknown floating point type!"); case Type::FloatTyID: { union FU { // Abide by C TBAA rules @@ -310,7 +310,7 @@ const Type *type = CV->getType(); O << "\t"; - switch (type->getPrimitiveID()) { + switch (type->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: O << ".byte"; break; Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.82 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.83 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.82 Thu Jun 10 23:30:06 2004 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Thu Jun 17 13:17:25 2004 @@ -503,7 +503,7 @@ const TargetRegisterClass* X86RegisterInfo::getRegClassForType(const Type* Ty) const { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::LongTyID: case Type::ULongTyID: assert(0 && "Long values can't fit in registers!"); default: assert(0 && "Invalid type to getClass!"); Index: llvm/lib/Target/X86/X86SimpInstrSelector.cpp diff -u llvm/lib/Target/X86/X86SimpInstrSelector.cpp:1.3 llvm/lib/Target/X86/X86SimpInstrSelector.cpp:1.4 --- llvm/lib/Target/X86/X86SimpInstrSelector.cpp:1.3 Thu Jun 10 23:49:02 2004 +++ llvm/lib/Target/X86/X86SimpInstrSelector.cpp Thu Jun 17 13:17:25 2004 @@ -347,7 +347,7 @@ /// size of the type, and whether or not it is floating point. /// static inline TypeClass getClass(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::SByteTyID: case Type::UByteTyID: return cByte; // Byte operands are class #0 case Type::ShortTyID: @@ -2246,7 +2246,7 @@ const Type *PromoteType = 0; unsigned PromoteOpcode; unsigned RealDestReg = DestReg; - switch (SrcTy->getPrimitiveID()) { + switch (SrcTy->getTypeID()) { case Type::BoolTyID: case Type::SByteTyID: // We don't have the facilities for directly loading byte sized data from @@ -2418,7 +2418,7 @@ unsigned DestReg = getReg(I); unsigned Size; - switch (I.getArgType()->getPrimitiveID()) { + switch (I.getArgType()->getTypeID()) { default: std::cerr << I; assert(0 && "Error: bad type for va_next instruction!"); @@ -2443,7 +2443,7 @@ unsigned VAList = getReg(I.getOperand(0)); unsigned DestReg = getReg(I); - switch (I.getType()->getPrimitiveID()) { + switch (I.getType()->getTypeID()) { default: std::cerr << I; assert(0 && "Error: bad type for va_next instruction!"); From lattner at cs.uiuc.edu Thu Jun 17 13:24:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:24:04 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp Message-ID: <200406171817.NAA17231@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCRegisterInfo.cpp updated: 1.4 -> 1.5 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp:1.4 llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp:1.5 --- llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp:1.4 Sat Feb 14 13:49:25 2004 +++ llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp Thu Jun 17 13:17:17 2004 @@ -79,7 +79,7 @@ const TargetRegisterClass* PowerPCRegisterInfo::getRegClassForType(const Type* Ty) const { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::LongTyID: case Type::ULongTyID: assert(0 && "Long values can't fit in registers!"); default: assert(0 && "Invalid type to getClass!"); From lattner at cs.uiuc.edu Thu Jun 17 13:24:07 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:24:07 2004 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200406171816.NAA17041@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.5 -> 1.6 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+1 -1) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.5 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.6 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.5 Tue Jun 1 23:28:06 2004 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Jun 17 13:16:35 2004 @@ -31,7 +31,7 @@ /// method works on all scalar LLVM types. /// MVT::ValueType SelectionDAG::getValueType(const Type *Ty) const { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::VoidTyID: assert(0 && "Void type object in getValueType!"); default: assert(0 && "Unknown type in DAGBuilder!\n"); case Type::BoolTyID: return MVT::i1; From lattner at cs.uiuc.edu Thu Jun 17 13:25:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:25:02 2004 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp ExternalFunctions.cpp Message-ID: <200406171818.NAA18983@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.127 -> 1.128 ExternalFunctions.cpp updated: 1.76 -> 1.77 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+21 -21) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.127 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.128 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.127 Fri Apr 23 13:05:28 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Thu Jun 17 13:18:30 2004 @@ -182,7 +182,7 @@ static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(+, UByte); IMPLEMENT_BINARY_OPERATOR(+, SByte); IMPLEMENT_BINARY_OPERATOR(+, UShort); @@ -203,7 +203,7 @@ static GenericValue executeSubInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(-, UByte); IMPLEMENT_BINARY_OPERATOR(-, SByte); IMPLEMENT_BINARY_OPERATOR(-, UShort); @@ -224,7 +224,7 @@ static GenericValue executeMulInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(*, UByte); IMPLEMENT_BINARY_OPERATOR(*, SByte); IMPLEMENT_BINARY_OPERATOR(*, UShort); @@ -245,7 +245,7 @@ static GenericValue executeDivInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(/, UByte); IMPLEMENT_BINARY_OPERATOR(/, SByte); IMPLEMENT_BINARY_OPERATOR(/, UShort); @@ -266,7 +266,7 @@ static GenericValue executeRemInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(%, UByte); IMPLEMENT_BINARY_OPERATOR(%, SByte); IMPLEMENT_BINARY_OPERATOR(%, UShort); @@ -291,7 +291,7 @@ static GenericValue executeAndInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(&, Bool); IMPLEMENT_BINARY_OPERATOR(&, UByte); IMPLEMENT_BINARY_OPERATOR(&, SByte); @@ -311,7 +311,7 @@ static GenericValue executeOrInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(|, Bool); IMPLEMENT_BINARY_OPERATOR(|, UByte); IMPLEMENT_BINARY_OPERATOR(|, SByte); @@ -331,7 +331,7 @@ static GenericValue executeXorInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_BINARY_OPERATOR(^, Bool); IMPLEMENT_BINARY_OPERATOR(^, UByte); IMPLEMENT_BINARY_OPERATOR(^, SByte); @@ -363,7 +363,7 @@ static GenericValue executeSetEQInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SETCC(==, UByte); IMPLEMENT_SETCC(==, SByte); IMPLEMENT_SETCC(==, UShort); @@ -385,7 +385,7 @@ static GenericValue executeSetNEInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SETCC(!=, UByte); IMPLEMENT_SETCC(!=, SByte); IMPLEMENT_SETCC(!=, UShort); @@ -408,7 +408,7 @@ static GenericValue executeSetLEInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SETCC(<=, UByte); IMPLEMENT_SETCC(<=, SByte); IMPLEMENT_SETCC(<=, UShort); @@ -430,7 +430,7 @@ static GenericValue executeSetGEInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SETCC(>=, UByte); IMPLEMENT_SETCC(>=, SByte); IMPLEMENT_SETCC(>=, UShort); @@ -452,7 +452,7 @@ static GenericValue executeSetLTInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SETCC(<, UByte); IMPLEMENT_SETCC(<, SByte); IMPLEMENT_SETCC(<, UShort); @@ -474,7 +474,7 @@ static GenericValue executeSetGTInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SETCC(>, UByte); IMPLEMENT_SETCC(>, SByte); IMPLEMENT_SETCC(>, UShort); @@ -739,7 +739,7 @@ GenericValue IdxGV = getOperandValue(I.getOperand(), SF); uint64_t Idx; - switch (I.getOperand()->getType()->getPrimitiveID()) { + switch (I.getOperand()->getType()->getTypeID()) { default: assert(0 && "Illegal getelementptr index for sequential type!"); case Type::SByteTyID: Idx = IdxGV.SByteVal; break; case Type::ShortTyID: Idx = IdxGV.ShortVal; break; @@ -865,7 +865,7 @@ static GenericValue executeShlInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SHIFT(<<, UByte); IMPLEMENT_SHIFT(<<, SByte); IMPLEMENT_SHIFT(<<, UShort); @@ -883,7 +883,7 @@ static GenericValue executeShrInst(GenericValue Src1, GenericValue Src2, const Type *Ty) { GenericValue Dest; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_SHIFT(>>, UByte); IMPLEMENT_SHIFT(>>, SByte); IMPLEMENT_SHIFT(>>, UShort); @@ -924,7 +924,7 @@ #define IMPLEMENT_CAST_CASE_START(DESTTY, DESTCTY) \ case Type::DESTTY##TyID: \ - switch (SrcTy->getPrimitiveID()) { \ + switch (SrcTy->getTypeID()) { \ IMPLEMENT_CAST(DESTTY, DESTCTY, Bool); \ IMPLEMENT_CAST(DESTTY, DESTCTY, UByte); \ IMPLEMENT_CAST(DESTTY, DESTCTY, SByte); \ @@ -956,7 +956,7 @@ const Type *SrcTy = SrcVal->getType(); GenericValue Dest, Src = getOperandValue(SrcVal, SF); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_CAST_CASE(UByte , (unsigned char)); IMPLEMENT_CAST_CASE(SByte , ( signed char)); IMPLEMENT_CAST_CASE(UShort , (unsigned short)); @@ -1007,7 +1007,7 @@ GenericValue Src = ECStack[VAList.UIntPairVal.first] .VarArgs[VAList.UIntPairVal.second]; const Type *Ty = I.getType(); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { IMPLEMENT_VAARG(UByte); IMPLEMENT_VAARG(SByte); IMPLEMENT_VAARG(UShort); Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.76 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.77 --- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.76 Tue Jun 15 21:56:40 2004 +++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Thu Jun 17 13:18:30 2004 @@ -38,7 +38,7 @@ static Interpreter *TheInterpreter; static char getTypeID(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::VoidTyID: return 'V'; case Type::BoolTyID: return 'o'; case Type::UByteTyID: return 'B'; From lattner at cs.uiuc.edu Thu Jun 17 13:25:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:25:06 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200406171817.NAA17769@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.181 -> 1.182 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+3 -3) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.181 llvm/lib/Target/CBackend/Writer.cpp:1.182 --- llvm/lib/Target/CBackend/Writer.cpp:1.181 Wed Jun 2 18:10:26 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Thu Jun 17 13:17:37 2004 @@ -255,7 +255,7 @@ const std::string &NameSoFar, bool IgnoreName) { if (Ty->isPrimitiveType()) - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::VoidTyID: return Out << "void " << NameSoFar; case Type::BoolTyID: return Out << "bool " << NameSoFar; case Type::UByteTyID: return Out << "unsigned char " << NameSoFar; @@ -279,7 +279,7 @@ if (I != TypeNames.end()) return Out << I->second << " " << NameSoFar; } - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::FunctionTyID: { const FunctionType *MTy = cast(Ty); std::stringstream FunctionInnards; @@ -518,7 +518,7 @@ } } - switch (CPV->getType()->getPrimitiveID()) { + switch (CPV->getType()->getTypeID()) { case Type::BoolTyID: Out << (CPV == ConstantBool::False ? "0" : "1"); break; case Type::SByteTyID: From lattner at cs.uiuc.edu Thu Jun 17 13:25:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:25:09 2004 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ConstantReader.cpp Reader.cpp ReaderInternals.h Message-ID: <200406171818.NAA18032@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ConstantReader.cpp updated: 1.76 -> 1.77 Reader.cpp updated: 1.106 -> 1.107 ReaderInternals.h updated: 1.79 -> 1.80 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+6 -6) Index: llvm/lib/Bytecode/Reader/ConstantReader.cpp diff -u llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.76 llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.77 --- llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.76 Sun Apr 4 20:27:22 2004 +++ llvm/lib/Bytecode/Reader/ConstantReader.cpp Thu Jun 17 13:17:58 2004 @@ -24,7 +24,7 @@ unsigned PrimType = read_vbr_uint(Buf, EndBuf); const Type *Val = 0; - if ((Val = Type::getPrimitiveType((Type::PrimitiveID)PrimType))) + if ((Val = Type::getPrimitiveType((Type::TypeID)PrimType))) return Val; switch (PrimType) { @@ -190,7 +190,7 @@ // Ok, not an ConstantExpr. We now know how to read the given type... const Type *Ty = getType(TypeID); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: { unsigned Val = read_vbr_uint(Buf, EndBuf); if (Val != 0 && Val != 1) throw std::string("Invalid boolean value read."); Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.106 llvm/lib/Bytecode/Reader/Reader.cpp:1.107 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.106 Sun Apr 4 20:27:22 2004 +++ llvm/lib/Bytecode/Reader/Reader.cpp Thu Jun 17 13:17:58 2004 @@ -25,7 +25,7 @@ unsigned BytecodeParser::getTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); // Scan the compaction table for the type if needed. if (CompactionTable.size() > Type::TypeTyID) { @@ -56,7 +56,7 @@ //cerr << "Looking up Type ID: " << ID << "\n"; if (ID < Type::FirstDerivedTyID) - if (const Type *T = Type::getPrimitiveType((Type::PrimitiveID)ID)) + if (const Type *T = Type::getPrimitiveType((Type::TypeID)ID)) return T; // Asked for a primitive type... // Otherwise, derived types need offset... Index: llvm/lib/Bytecode/Reader/ReaderInternals.h diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.79 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.80 --- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.79 Sun Apr 4 20:27:22 2004 +++ llvm/lib/Bytecode/Reader/ReaderInternals.h Thu Jun 17 13:17:58 2004 @@ -173,7 +173,7 @@ /// fancy features are supported. const Type *getGlobalTableType(unsigned Slot) { if (Slot < Type::FirstDerivedTyID) { - const Type *Ty = Type::getPrimitiveType((Type::PrimitiveID)Slot); + const Type *Ty = Type::getPrimitiveType((Type::TypeID)Slot); assert(Ty && "Not a primitive type ID?"); return Ty; } @@ -185,7 +185,7 @@ unsigned getGlobalTableTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); TypeValuesListTy::iterator I = find(ModuleTypeValues.begin(), ModuleTypeValues.end(), Ty); if (I == ModuleTypeValues.end()) From lattner at cs.uiuc.edu Thu Jun 17 13:25:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:25:13 2004 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Analyzer/Parser.cpp Parser.h Message-ID: <200406171818.NAA18014@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Analyzer: Parser.cpp updated: 1.5 -> 1.6 Parser.h updated: 1.4 -> 1.5 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+5 -5) Index: llvm/lib/Bytecode/Analyzer/Parser.cpp diff -u llvm/lib/Bytecode/Analyzer/Parser.cpp:1.5 llvm/lib/Bytecode/Analyzer/Parser.cpp:1.6 --- llvm/lib/Bytecode/Analyzer/Parser.cpp:1.5 Thu Jun 10 16:59:20 2004 +++ llvm/lib/Bytecode/Analyzer/Parser.cpp Thu Jun 17 13:17:56 2004 @@ -145,7 +145,7 @@ //cerr << "Looking up Type ID: " << ID << "\n"; if (ID < Type::FirstDerivedTyID) - if (const Type *T = Type::getPrimitiveType((Type::PrimitiveID)ID)) + if (const Type *T = Type::getPrimitiveType((Type::TypeID)ID)) return T; // Asked for a primitive type... // Otherwise, derived types need offset... @@ -467,7 +467,7 @@ unsigned PrimType = read_vbr_uint(); const Type *Val = 0; - if ((Val = Type::getPrimitiveType((Type::PrimitiveID)PrimType))) + if ((Val = Type::getPrimitiveType((Type::TypeID)PrimType))) return Val; switch (PrimType) { @@ -615,7 +615,7 @@ // Ok, not an ConstantExpr. We now know how to read the given type... const Type *Ty = getType(TypeID); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: { unsigned Val = read_vbr_uint(); if (Val != 0 && Val != 1) Index: llvm/lib/Bytecode/Analyzer/Parser.h diff -u llvm/lib/Bytecode/Analyzer/Parser.h:1.4 llvm/lib/Bytecode/Analyzer/Parser.h:1.5 --- llvm/lib/Bytecode/Analyzer/Parser.h:1.4 Thu Jun 10 16:59:20 2004 +++ llvm/lib/Bytecode/Analyzer/Parser.h Thu Jun 17 13:17:56 2004 @@ -264,7 +264,7 @@ /// fancy features are supported. const Type *getGlobalTableType(unsigned Slot) { if (Slot < Type::FirstDerivedTyID) { - const Type *Ty = Type::getPrimitiveType((Type::PrimitiveID)Slot); + const Type *Ty = Type::getPrimitiveType((Type::TypeID)Slot); assert(Ty && "Not a primitive type ID?"); return Ty; } @@ -276,7 +276,7 @@ unsigned getGlobalTableTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) - return Ty->getPrimitiveID(); + return Ty->getTypeID(); TypeListTy::iterator I = find(ModuleTypes.begin(), ModuleTypes.end(), Ty); if (I == ModuleTypes.end()) From lattner at cs.uiuc.edu Thu Jun 17 13:25:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:25:17 2004 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/ConstantWriter.cpp InstructionWriter.cpp SlotCalculator.cpp SlotTable.cpp SlotTable.h Message-ID: <200406171818.NAA18047@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: ConstantWriter.cpp updated: 1.36 -> 1.37 InstructionWriter.cpp updated: 1.41 -> 1.42 SlotCalculator.cpp updated: 1.55 -> 1.56 SlotTable.cpp updated: 1.4 -> 1.5 SlotTable.h updated: 1.2 -> 1.3 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+17 -17) Index: llvm/lib/Bytecode/Writer/ConstantWriter.cpp diff -u llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.36 llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.37 --- llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.36 Sun Feb 8 22:37:29 2004 +++ llvm/lib/Bytecode/Writer/ConstantWriter.cpp Thu Jun 17 13:17:59 2004 @@ -20,14 +20,14 @@ using namespace llvm; void BytecodeWriter::outputType(const Type *T) { - output_vbr((unsigned)T->getPrimitiveID(), Out); + output_vbr((unsigned)T->getTypeID(), Out); // That's all there is to handling primitive types... if (T->isPrimitiveType()) { return; // We might do this if we alias a prim type: %x = type int } - switch (T->getPrimitiveID()) { // Handle derived types now. + switch (T->getTypeID()) { // Handle derived types now. case Type::FunctionTyID: { const FunctionType *MT = cast(T); int Slot = Table.getSlot(MT->getReturnType()); @@ -47,7 +47,7 @@ // Terminate list with VoidTy if we are a varargs function... if (MT->isVarArg()) - output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out); + output_vbr((unsigned)Type::VoidTyID, Out); break; } @@ -74,7 +74,7 @@ } // Terminate list with VoidTy - output_vbr((unsigned)Type::VoidTy->getPrimitiveID(), Out); + output_vbr((unsigned)Type::VoidTyID, Out); break; } @@ -124,7 +124,7 @@ output_vbr(0U, Out); // flag as not a ConstantExpr } - switch (CPV->getType()->getPrimitiveID()) { + switch (CPV->getType()->getTypeID()) { case Type::BoolTyID: // Boolean Types if (cast(CPV)->getValue()) output_vbr(1U, Out); Index: llvm/lib/Bytecode/Writer/InstructionWriter.cpp diff -u llvm/lib/Bytecode/Writer/InstructionWriter.cpp:1.41 llvm/lib/Bytecode/Writer/InstructionWriter.cpp:1.42 --- llvm/lib/Bytecode/Writer/InstructionWriter.cpp:1.41 Sun Apr 4 20:27:26 2004 +++ llvm/lib/Bytecode/Writer/InstructionWriter.cpp Thu Jun 17 13:17:59 2004 @@ -70,7 +70,7 @@ if (isa(*TI)) { unsigned IdxId; - switch (I->getOperand(Idx)->getType()->getPrimitiveID()) { + switch (I->getOperand(Idx)->getType()->getTypeID()) { default: assert(0 && "Unknown index type!"); case Type::UIntTyID: IdxId = 0; break; case Type::IntTyID: IdxId = 1; break; @@ -298,7 +298,7 @@ I != E; ++I, ++Idx) if (isa(*I)) { unsigned IdxId; - switch (GEP->getOperand(Idx)->getType()->getPrimitiveID()) { + switch (GEP->getOperand(Idx)->getType()->getTypeID()) { default: assert(0 && "Unknown index type!"); case Type::UIntTyID: IdxId = 0; break; case Type::IntTyID: IdxId = 1; break; Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.55 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.56 --- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.55 Wed May 26 02:37:11 2004 +++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Thu Jun 17 13:17:59 2004 @@ -41,8 +41,8 @@ // SC_DEBUG("Inserting primitive types:\n"); for (unsigned i = 0; i < Type::FirstDerivedTyID; ++i) { - assert(Type::getPrimitiveType((Type::PrimitiveID)i)); - insertValue(Type::getPrimitiveType((Type::PrimitiveID)i), true); + assert(Type::getPrimitiveType((Type::TypeID)i)); + insertValue(Type::getPrimitiveType((Type::TypeID)i), true); } if (M == 0) return; // Empty table... @@ -58,8 +58,8 @@ // SC_DEBUG("Inserting primitive types:\n"); for (unsigned i = 0; i < Type::FirstDerivedTyID; ++i) { - assert(Type::getPrimitiveType((Type::PrimitiveID)i)); - insertValue(Type::getPrimitiveType((Type::PrimitiveID)i), true); + assert(Type::getPrimitiveType((Type::TypeID)i)); + insertValue(Type::getPrimitiveType((Type::TypeID)i), true); } if (TheModule == 0) return; // Empty table... @@ -408,7 +408,7 @@ // Make sure to insert the null entry if the thing we are inserting is not a // null constant. - if (TyPlane.empty() && hasNullValue(V->getType()->getPrimitiveID())) { + if (TyPlane.empty() && hasNullValue(V->getType()->getTypeID())) { Value *ZeroInitializer = Constant::getNullValue(V->getType()); if (V != ZeroInitializer) { TyPlane.push_back(ZeroInitializer); @@ -435,7 +435,7 @@ // First step, insert the primitive types. CompactionTable.resize(Type::TypeTyID+1); for (unsigned i = 0; i != Type::FirstDerivedTyID; ++i) { - const Type *PrimTy = Type::getPrimitiveType((Type::PrimitiveID)i); + const Type *PrimTy = Type::getPrimitiveType((Type::TypeID)i); CompactionTable[Type::TypeTyID].push_back(PrimTy); CompactionNodeMap[PrimTy] = i; } @@ -754,7 +754,7 @@ } Ty = (unsigned)ValSlot; } else { - Ty = Typ->getPrimitiveID(); + Ty = Typ->getTypeID(); } if (Table.size() <= Ty) // Make sure we have the type plane allocated... Index: llvm/lib/Bytecode/Writer/SlotTable.cpp diff -u llvm/lib/Bytecode/Writer/SlotTable.cpp:1.4 llvm/lib/Bytecode/Writer/SlotTable.cpp:1.5 --- llvm/lib/Bytecode/Writer/SlotTable.cpp:1.4 Tue Jun 8 23:38:34 2004 +++ llvm/lib/Bytecode/Writer/SlotTable.cpp Thu Jun 17 13:17:59 2004 @@ -106,7 +106,7 @@ // and that their Primitive ID is equal to their slot # void SlotTable::insertPrimitives() { for (PlaneNum plane = 0; plane < Type::FirstDerivedTyID; ++plane) { - const Type* Ty = Type::getPrimitiveType((Type::PrimitiveID) plane); + const Type* Ty = Type::getPrimitiveType((Type::TypeID) plane); assert(Ty && "Couldn't get primitive type id"); SlotNum slot = this->insert(Ty); assert(slot == plane && "Type slot didn't match plane number"); Index: llvm/lib/Bytecode/Writer/SlotTable.h diff -u llvm/lib/Bytecode/Writer/SlotTable.h:1.2 llvm/lib/Bytecode/Writer/SlotTable.h:1.3 --- llvm/lib/Bytecode/Writer/SlotTable.h:1.2 Tue May 25 14:09:25 2004 +++ llvm/lib/Bytecode/Writer/SlotTable.h Thu Jun 17 13:17:59 2004 @@ -46,7 +46,7 @@ /// This type is used throughout the code to make it clear that an /// unsigned value refers to a type plane number and not something else. - /// @brief The type of a plane number (corresponds to Type::PrimitiveID). + /// @brief The type of a plane number (corresponds to Type::TypeID). typedef unsigned PlaneNum; /// @brief Some constants used as flags instead of actual slot numbers @@ -58,7 +58,7 @@ /// @brief A single plane of Values. Intended index is slot number. typedef std::vector ValuePlane; - /// @brief A table of Values. Intended index is Type::PrimitiveID. + /// @brief A table of Values. Intended index is Type::TypeID. typedef std::vector ValueTable; /// @brief A map of values to slot numbers. From lattner at cs.uiuc.edu Thu Jun 17 13:25:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:25:22 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp SparcV9InstrSelection.cpp SparcV9InstrSelectionSupport.h SparcV9RegInfo.cpp Message-ID: <200406171817.NAA17986@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9AsmPrinter.cpp updated: 1.114 -> 1.115 SparcV9InstrSelection.cpp updated: 1.143 -> 1.144 SparcV9InstrSelectionSupport.h updated: 1.16 -> 1.17 SparcV9RegInfo.cpp updated: 1.129 -> 1.130 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+9 -10) Index: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.114 llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.115 --- llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.114 Wed Jun 2 00:54:42 2004 +++ llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp Thu Jun 17 13:17:08 2004 @@ -85,8 +85,7 @@ inline const std::string TypeToDataDirective(const Type* type) { - switch(type->getPrimitiveID()) - { + switch(type->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: return ".byte"; case Type::UShortTyID: case Type::ShortTyID: Index: llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp diff -u llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp:1.143 llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp:1.144 --- llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp:1.143 Wed Jun 2 21:45:09 2004 +++ llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp Thu Jun 17 13:17:08 2004 @@ -650,7 +650,7 @@ if (resultType->isInteger() || isa(resultType)) { opCode = V9::SUBr; } else { - switch(resultType->getPrimitiveID()) + switch(resultType->getTypeID()) { case Type::FloatTyID: opCode = V9::FSUBS; break; case Type::DoubleTyID: opCode = V9::FSUBD; break; @@ -691,7 +691,7 @@ MachineOpCode opCode = V9::INVALID_OPCODE; Value* operand = ((InstrTreeNode*) instrNode->leftChild())->getValue(); - switch(operand->getType()->getPrimitiveID()) { + switch(operand->getType()->getTypeID()) { case Type::FloatTyID: opCode = V9::FCMPS; break; case Type::DoubleTyID: opCode = V9::FCMPD; break; default: assert(0 && "Invalid type for FCMP instruction"); break; @@ -727,7 +727,7 @@ if (resultType->isInteger()) opCode = V9::MULXr; else - switch(resultType->getPrimitiveID()) + switch(resultType->getTypeID()) { case Type::FloatTyID: opCode = V9::FMULS; break; case Type::DoubleTyID: opCode = V9::FMULD; break; @@ -946,7 +946,7 @@ if (resultType->isInteger()) opCode = resultType->isSigned()? V9::SDIVXr : V9::UDIVXr; else - switch(resultType->getPrimitiveID()) + switch(resultType->getTypeID()) { case Type::FloatTyID: opCode = V9::FDIVS; break; case Type::DoubleTyID: opCode = V9::FDIVD; break; Index: llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h diff -u llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h:1.16 llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h:1.17 --- llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h:1.16 Sun Apr 25 02:04:49 2004 +++ llvm/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h Thu Jun 17 13:17:10 2004 @@ -23,7 +23,7 @@ inline MachineOpCode ChooseLoadInstruction(const Type *DestTy) { - switch (DestTy->getPrimitiveID()) { + switch (DestTy->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: return V9::LDUBr; case Type::SByteTyID: return V9::LDSBr; @@ -46,7 +46,7 @@ inline MachineOpCode ChooseStoreInstruction(const Type *DestTy) { - switch (DestTy->getPrimitiveID()) { + switch (DestTy->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: return V9::STBr; @@ -79,7 +79,7 @@ opCode = V9::ADDr; } else - switch(resultType->getPrimitiveID()) + switch(resultType->getTypeID()) { case Type::FloatTyID: opCode = V9::FADDS; break; case Type::DoubleTyID: opCode = V9::FADDD; break; Index: llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp diff -u llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp:1.129 llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp:1.130 --- llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp:1.129 Fri Jun 4 15:51:40 2004 +++ llvm/lib/Target/SparcV9/SparcV9RegInfo.cpp Thu Jun 17 13:17:10 2004 @@ -272,7 +272,7 @@ // unsigned SparcV9RegInfo::getRegClassIDOfType(const Type *type, bool isCCReg) const { - Type::PrimitiveID ty = type->getPrimitiveID(); + Type::TypeID ty = type->getTypeID(); unsigned res; // FIXME: Comparing types like this isn't very safe... From lattner at cs.uiuc.edu Thu Jun 17 13:26:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:26:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp Message-ID: <200406171817.NAA17991@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/InstrSelection: InstrForest.cpp updated: 1.51 -> 1.52 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp diff -u llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp:1.51 llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp:1.52 --- llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp:1.51 Sat May 29 18:26:13 2004 +++ llvm/lib/Target/SparcV9/InstrSelection/InstrForest.cpp Thu Jun 17 13:17:12 2004 @@ -79,7 +79,7 @@ opLabel = opLabel + 100; // bitwise operator } else if (opLabel == Instruction::Cast) { const Type *ITy = I->getType(); - switch(ITy->getPrimitiveID()) + switch(ITy->getTypeID()) { case Type::BoolTyID: opLabel = ToBoolTy; break; case Type::UByteTyID: opLabel = ToUByteTy; break; From lattner at cs.uiuc.edu Thu Jun 17 13:26:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:26:04 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200406171819.NAA19112@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.45 -> 1.46 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.45 llvm/lib/Target/TargetData.cpp:1.46 --- llvm/lib/Target/TargetData.cpp:1.45 Wed Apr 14 16:21:56 2004 +++ llvm/lib/Target/TargetData.cpp Thu Jun 17 13:19:28 2004 @@ -150,7 +150,7 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD, uint64_t &Size, unsigned char &Alignment) { assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::VoidTyID: case Type::BoolTyID: case Type::UByteTyID: From lattner at cs.uiuc.edu Thu Jun 17 13:26:07 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:26:07 2004 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/ParserInternals.h llvmAsmParser.y Message-ID: <200406171818.NAA18062@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: ParserInternals.h updated: 1.34 -> 1.35 llvmAsmParser.y updated: 1.168 -> 1.169 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+3 -3) Index: llvm/lib/AsmParser/ParserInternals.h diff -u llvm/lib/AsmParser/ParserInternals.h:1.34 llvm/lib/AsmParser/ParserInternals.h:1.35 --- llvm/lib/AsmParser/ParserInternals.h:1.34 Tue Dec 23 14:05:15 2003 +++ llvm/lib/AsmParser/ParserInternals.h Thu Jun 17 13:18:08 2004 @@ -194,7 +194,7 @@ isa(cast(Ty)->getElementType())) Ty = cast(Ty)->getElementType(); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::LabelTyID: return ((BBPlaceHolder*)Val)->getDef(); default: return ((ValuePlaceHolder*)Val)->getDef(); } @@ -206,7 +206,7 @@ isa(cast(Ty)->getElementType())) Ty = cast(Ty)->getElementType(); - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::LabelTyID: return ((BBPlaceHolder*)Val)->getLineNum(); default: return ((ValuePlaceHolder*)Val)->getLineNum(); } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.168 llvm/lib/AsmParser/llvmAsmParser.y:1.169 --- llvm/lib/AsmParser/llvmAsmParser.y:1.168 Thu May 27 19:21:06 2004 +++ llvm/lib/AsmParser/llvmAsmParser.y Thu Jun 17 13:18:08 2004 @@ -387,7 +387,7 @@ // forward, so just create an entry to be resolved later and get to it... // Value *d = 0; - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::LabelTyID: d = new BBPlaceHolder(Ty, D); break; default: d = new ValuePlaceHolder(Ty, D); break; } From lattner at cs.uiuc.edu Thu Jun 17 13:26:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:26:11 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp ConstantFolding.cpp Constants.cpp Type.cpp Message-ID: <200406171819.NAA19097@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.140 -> 1.141 ConstantFolding.cpp updated: 1.58 -> 1.59 Constants.cpp updated: 1.90 -> 1.91 Type.cpp updated: 1.101 -> 1.102 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+24 -26) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.140 llvm/lib/VMCore/AsmWriter.cpp:1.141 --- llvm/lib/VMCore/AsmWriter.cpp:1.140 Tue Jun 15 16:07:32 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Thu Jun 17 13:18:53 2004 @@ -262,7 +262,7 @@ TypeStack.push_back(Ty); // Recursive case: Add us to the stack.. - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::FunctionTyID: { const FunctionType *FTy = cast(Ty); calcTypeName(FTy->getReturnType(), TypeStack, TypeNames, Result); Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.58 llvm/lib/VMCore/ConstantFolding.cpp:1.59 --- llvm/lib/VMCore/ConstantFolding.cpp:1.58 Sat May 29 20:19:48 2004 +++ llvm/lib/VMCore/ConstantFolding.cpp Thu Jun 17 13:18:53 2004 @@ -489,7 +489,7 @@ isa(V1) || isa(V2)) return EmptyR; - switch (V1->getType()->getPrimitiveID()) { + switch (V1->getType()->getTypeID()) { default: assert(0 && "Unknown value type for constant folding!"); case Type::BoolTyID: return BoolR; case Type::PointerTyID: return NullPointerR; @@ -564,7 +564,7 @@ ConstRules &Rules = ConstRules::get(V, V); - switch (DestTy->getPrimitiveID()) { + switch (DestTy->getTypeID()) { case Type::BoolTyID: return Rules.castToBool(V); case Type::UByteTyID: return Rules.castToUByte(V); case Type::SByteTyID: return Rules.castToSByte(V); Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.90 llvm/lib/VMCore/Constants.cpp:1.91 --- llvm/lib/VMCore/Constants.cpp:1.90 Tue Jun 8 18:21:39 2004 +++ llvm/lib/VMCore/Constants.cpp Thu Jun 17 13:18:53 2004 @@ -66,7 +66,7 @@ // Static constructor to create a '0' constant of arbitrary type... Constant *Constant::getNullValue(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: { static Constant *NullBool = ConstantBool::get(false); return NullBool; @@ -128,7 +128,7 @@ // Static constructor to create the maximum constant of an integral type... ConstantIntegral *ConstantIntegral::getMaxValue(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: return ConstantBool::True; case Type::SByteTyID: case Type::ShortTyID: @@ -152,7 +152,7 @@ // Static constructor to create the minimum constant for an integral type... ConstantIntegral *ConstantIntegral::getMinValue(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: return ConstantBool::False; case Type::SByteTyID: case Type::ShortTyID: @@ -176,7 +176,7 @@ // Static constructor to create an integral constant with all bits set ConstantIntegral *ConstantIntegral::getAllOnesValue(const Type *Ty) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: return ConstantBool::True; case Type::SByteTyID: case Type::ShortTyID: @@ -243,8 +243,7 @@ for (unsigned i = 0, e = V.size(); i != e; ++i) { assert(V[i]->getType() == T->getElementType() || (T->isAbstract() && - V[i]->getType()->getPrimitiveID() == - T->getElementType()->getPrimitiveID())); + V[i]->getType()->getTypeID() == T->getElementType()->getTypeID())); Operands.push_back(Use(V[i], this)); } } @@ -258,8 +257,7 @@ assert((V[i]->getType() == T->getElementType(i) || ((T->getElementType(i)->isAbstract() || V[i]->getType()->isAbstract()) && - T->getElementType(i)->getPrimitiveID() == - V[i]->getType()->getPrimitiveID())) && + T->getElementType(i)->getTypeID() == V[i]->getType()->getTypeID())) && "Initializer for struct element doesn't match struct element type!"); Operands.push_back(Use(V[i], this)); } @@ -433,7 +431,7 @@ // isValueValidForType implementations bool ConstantSInt::isValueValidForType(const Type *Ty, int64_t Val) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { default: return false; // These can't be represented as integers!!! // Signed types... @@ -449,7 +447,7 @@ } bool ConstantUInt::isValueValidForType(const Type *Ty, uint64_t Val) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { default: return false; // These can't be represented as integers!!! @@ -466,7 +464,7 @@ } bool ConstantFP::isValueValidForType(const Type *Ty, double Val) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { default: return false; // These can't be represented as floating point! Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.101 llvm/lib/VMCore/Type.cpp:1.102 --- llvm/lib/VMCore/Type.cpp:1.101 Fri Jun 4 15:14:29 2004 +++ llvm/lib/VMCore/Type.cpp Thu Jun 17 13:18:53 2004 @@ -42,7 +42,7 @@ static std::map ConcreteTypeDescriptions; static std::map AbstractTypeDescriptions; -Type::Type(const std::string &name, PrimitiveID id) +Type::Type(const std::string &name, TypeID id) : Value(Type::TypeTy, Value::TypeVal), RefCount(0), ForwardType(0) { if (!name.empty()) ConcreteTypeDescriptions[this] = name; @@ -64,7 +64,7 @@ return UIDMappings[UID]; } -const Type *Type::getPrimitiveType(PrimitiveID IDNumber) { +const Type *Type::getPrimitiveType(TypeID IDNumber) { switch (IDNumber) { case VoidTyID : return VoidTy; case BoolTyID : return BoolTy; @@ -93,11 +93,11 @@ if ((!isPrimitiveType() && !isa(this)) || (!isa(Ty) && !Ty->isPrimitiveType())) return false; - if (getPrimitiveID() == Ty->getPrimitiveID()) + if (getTypeID() == Ty->getTypeID()) return true; // Handles identity cast, and cast of differing pointer types // Now we know that they are two differing primitive or pointer types - switch (getPrimitiveID()) { + switch (getTypeID()) { case Type::UByteTyID: return Ty == Type::SByteTy; case Type::SByteTyID: return Ty == Type::UByteTy; case Type::UShortTyID: return Ty == Type::ShortTy; @@ -115,7 +115,7 @@ /// getUnsignedVersion - If this is an integer type, return the unsigned /// variant of this type. For example int -> uint. const Type *Type::getUnsignedVersion() const { - switch (getPrimitiveID()) { + switch (getTypeID()) { default: assert(isInteger()&&"Type::getUnsignedVersion is only valid for integers!"); case Type::UByteTyID: @@ -132,7 +132,7 @@ /// getSignedVersion - If this is an integer type, return the signed variant /// of this type. For example uint -> int. const Type *Type::getSignedVersion() const { - switch (getPrimitiveID()) { + switch (getTypeID()) { default: assert(isInteger() && "Type::getSignedVersion is only valid for integers!"); case Type::UByteTyID: @@ -152,7 +152,7 @@ // return zero if the type does not have a size or is not a primitive type. // unsigned Type::getPrimitiveSize() const { - switch (getPrimitiveID()) { + switch (getTypeID()) { #define HANDLE_PRIM_TYPE(TY,SIZE) case TY##TyID: return SIZE; #include "llvm/Type.def" default: return 0; @@ -220,7 +220,7 @@ std::string Result; TypeStack.push_back(Ty); // Add us to the stack.. - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::FunctionTyID: { const FunctionType *FTy = cast(Ty); Result = getTypeDescription(FTy->getReturnType(), TypeStack) + " ("; @@ -318,7 +318,7 @@ // type. // struct SignedIntType : public Type { - SignedIntType(const std::string &Name, PrimitiveID id) : Type(Name, id) {} + SignedIntType(const std::string &Name, TypeID id) : Type(Name, id) {} // isSigned - Return whether a numeric type is signed. virtual bool isSigned() const { return 1; } @@ -330,7 +330,7 @@ }; struct UnsignedIntType : public Type { - UnsignedIntType(const std::string &N, PrimitiveID id) : Type(N, id) {} + UnsignedIntType(const std::string &N, TypeID id) : Type(N, id) {} // isUnsigned - Return whether a numeric type is signed. virtual bool isUnsigned() const { return 1; } @@ -342,7 +342,7 @@ }; struct OtherType : public Type { - OtherType(const std::string &N, PrimitiveID id) : Type(N, id) {} + OtherType(const std::string &N, TypeID id) : Type(N, id) {} }; static struct TypeType : public Type { @@ -503,7 +503,7 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2, std::map &EqTypes) { if (Ty == Ty2) return true; - if (Ty->getPrimitiveID() != Ty2->getPrimitiveID()) return false; + if (Ty->getTypeID() != Ty2->getTypeID()) return false; if (isa(Ty)) return false; // Two unequal opaque types are never equal From lattner at cs.uiuc.edu Thu Jun 17 13:26:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:26:14 2004 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200406171818.NAA18623@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.173 -> 1.174 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+2 -2) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.173 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.174 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.173 Wed Apr 28 23:05:30 2004 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Thu Jun 17 13:18:26 2004 @@ -432,7 +432,7 @@ while (O < Offset) { assert(Offset-O < TD.getTypeSize(SubType) && "Offset out of range!"); - switch (SubType->getPrimitiveID()) { + switch (SubType->getTypeID()) { case Type::StructTyID: { const StructType *STy = cast(SubType); const StructLayout &SL = *TD.getStructLayout(STy); @@ -488,7 +488,7 @@ const Type *NextSubType = 0; unsigned NextSubTypeSize = 0; unsigned NextPadSize = 0; - switch (SubType->getPrimitiveID()) { + switch (SubType->getTypeID()) { case Type::StructTyID: { const StructType *STy = cast(SubType); const StructLayout &SL = *TD.getStructLayout(STy); From lattner at cs.uiuc.edu Thu Jun 17 13:26:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 13:26:18 2004 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200406171818.NAA18969@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.50 -> 1.51 --- Log message: Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID() --- Diffs of the changes: (+8 -8) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.50 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.51 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.50 Thu May 27 16:25:44 2004 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Thu Jun 17 13:18:28 2004 @@ -181,7 +181,7 @@ GenericValue GV = getConstantValue(Op); // Handle cast of pointer to pointer... - if (Op->getType()->getPrimitiveID() == C->getType()->getPrimitiveID()) + if (Op->getType()->getTypeID() == C->getType()->getTypeID()) return GV; // Handle a cast of pointer to any integral type... @@ -190,7 +190,7 @@ // Handle cast of integer to a pointer... if (isa(C->getType()) && Op->getType()->isIntegral()) - switch (Op->getType()->getPrimitiveID()) { + switch (Op->getType()->getTypeID()) { case Type::BoolTyID: return PTOGV((void*)(uintptr_t)GV.BoolVal); case Type::SByteTyID: return PTOGV((void*)( intptr_t)GV.SByteVal); case Type::UByteTyID: return PTOGV((void*)(uintptr_t)GV.UByteVal); @@ -221,7 +221,7 @@ abort(); } - switch (C->getType()->getPrimitiveID()) { + switch (C->getType()->getTypeID()) { #define GET_CONST_VAL(TY, CLASS) \ case Type::TY##TyID: Result.TY##Val = cast(C)->getValue(); break GET_CONST_VAL(Bool , ConstantBool); @@ -263,7 +263,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, const Type *Ty) { if (getTargetData().isLittleEndian()) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: Ptr->Untyped[0] = Val.UByteVal; break; @@ -296,7 +296,7 @@ std::cout << "Cannot store value of type " << Ty << "!\n"; } } else { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: Ptr->Untyped[0] = Val.UByteVal; break; @@ -337,7 +337,7 @@ const Type *Ty) { GenericValue Result; if (getTargetData().isLittleEndian()) { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: Result.UByteVal = Ptr->Untyped[0]; break; @@ -371,7 +371,7 @@ abort(); } } else { - switch (Ty->getPrimitiveID()) { + switch (Ty->getTypeID()) { case Type::BoolTyID: case Type::UByteTyID: case Type::SByteTyID: Result.UByteVal = Ptr->Untyped[0]; break; @@ -422,7 +422,7 @@ return; } - switch (Init->getType()->getPrimitiveID()) { + switch (Init->getType()->getTypeID()) { case Type::ArrayTyID: { const ConstantArray *CPA = cast(Init); const std::vector &Val = CPA->getValues(); From brukman at cs.uiuc.edu Thu Jun 17 16:06:04 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu Jun 17 16:06:04 2004 Subject: [llvm-commits] CVS: llvm-www/www-index.html Message-ID: <200406172058.PAA30330@zion.cs.uiuc.edu> Changes in directory llvm-www: www-index.html updated: 1.105 -> 1.106 --- Log message: No need for a definite article if there's no noun after `LLVM'. --- Diffs of the changes: (+1 -1) Index: llvm-www/www-index.html diff -u llvm-www/www-index.html:1.105 llvm-www/www-index.html:1.106 --- llvm-www/www-index.html:1.105 Wed Jun 2 13:26:38 2004 +++ llvm-www/www-index.html Thu Jun 17 15:58:35 2004 @@ -93,7 +93,7 @@
    Public LLVM Release!
    -

    Mar 19, 2004: The LLVM 1.2 is now available +

    Mar 19, 2004: LLVM 1.2 is now available for download! LLVM is publicly available under the OSI-certified University of Illinois Open-Source License. See answers to common From lattner at cs.uiuc.edu Thu Jun 17 16:28:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 16:28:03 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200406172121.QAA05795@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.29 -> 1.30 --- Log message: Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov in PR371: http://llvm.cs.uiuc.edu/PR371 --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.29 llvm/lib/Transforms/Utils/Local.cpp:1.30 --- llvm/lib/Transforms/Utils/Local.cpp:1.29 Tue Jun 15 18:09:50 2004 +++ llvm/lib/Transforms/Utils/Local.cpp Thu Jun 17 16:20:52 2004 @@ -300,7 +300,7 @@ double Op1V = Op1->getValue(), Op2V = Op2->getValue(); if (Name == "llvm.isunordered") - return ConstantBool::get(isnan(Op1V) | isnan(Op2V)); + return ConstantBool::get(std::isnan(Op1V) | std::isnan(Op2V)); else if (Name == "pow") { errno = 0; double V = pow(Op1V, Op2V); From lattner at cs.uiuc.edu Thu Jun 17 17:22:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 17:22:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200406172215.RAA08663@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.264 -> 1.265 --- Log message: Do not fold loads into instructions if it is used more than once. In particular we do not want to fold the load in cases like this: X = load = add A, X = add B, X --- Diffs of the changes: (+2 -1) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.264 llvm/lib/Target/X86/InstSelectSimple.cpp:1.265 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.264 Thu Jun 17 13:17:22 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Thu Jun 17 17:15:25 2004 @@ -1964,11 +1964,12 @@ // Special case: op Reg, load [mem] if (isa(Op0) && !isa(Op1) && Class != cLong && + Op0->hasOneUse() && isSafeToFoldLoadIntoInstruction(*cast(Op0), B)) if (!B.swapOperands()) std::swap(Op0, Op1); // Make sure any loads are in the RHS. - if (isa(Op1) && Class != cLong && + if (isa(Op1) && Class != cLong && Op1->hasOneUse() && isSafeToFoldLoadIntoInstruction(*cast(Op1), B)) { unsigned Opcode; From gaeke at cs.uiuc.edu Thu Jun 17 17:34:01 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 17 17:34:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200406172227.RAA12455@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.30 -> 1.31 --- Log message: I love the smell of a freshly broken PowerPC build in the morning. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.30 llvm/lib/Transforms/Utils/Local.cpp:1.31 --- llvm/lib/Transforms/Utils/Local.cpp:1.30 Thu Jun 17 16:20:52 2004 +++ llvm/lib/Transforms/Utils/Local.cpp Thu Jun 17 17:27:04 2004 @@ -26,6 +26,7 @@ // in a big way). This is a quick fix to get things compiling, until one of // us has time to write a more complicated autoconf test. extern "C" int isnan (double d); +namespace std { int isnan (double d) { return ::isnan (d); } } #endif //===----------------------------------------------------------------------===// From gaeke at cs.uiuc.edu Thu Jun 17 17:34:05 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 17 17:34:05 2004 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineBasicBlock.cpp MachineInstr.cpp Message-ID: <200406172227.RAA12415@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineBasicBlock.cpp updated: 1.14 -> 1.15 MachineInstr.cpp updated: 1.100 -> 1.101 --- Log message: Make debugging dumps w/ multiple MachineBBs for a given LLVM BB readable. --- Diffs of the changes: (+6 -5) Index: llvm/lib/CodeGen/MachineBasicBlock.cpp diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.14 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.15 --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.14 Wed Jun 2 00:57:12 2004 +++ llvm/lib/CodeGen/MachineBasicBlock.cpp Thu Jun 17 17:26:53 2004 @@ -101,7 +101,8 @@ } const BasicBlock *LBB = getBasicBlock(); if(LBB) - OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n"; + OS << "\n" << LBB->getName() << " (" << (const void*)this + << ", LLVM BB @" << (const void*) LBB << "):\n"; for (const_iterator I = begin(); I != end(); ++I) { OS << "\t"; I->print(OS, getParent()->getTarget()); Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.100 llvm/lib/CodeGen/MachineInstr.cpp:1.101 --- llvm/lib/CodeGen/MachineInstr.cpp:1.100 Wed Jun 2 00:57:12 2004 +++ llvm/lib/CodeGen/MachineInstr.cpp Thu Jun 17 17:26:53 2004 @@ -289,9 +289,9 @@ break; } case MachineOperand::MO_MachineBasicBlock: - OS << "bb<" + OS << "mbb<" << ((Value*)MO.getMachineBasicBlock()->getBasicBlock())->getName() - << "," << (void*)MO.getMachineBasicBlock()->getBasicBlock() << ">"; + << "," << (void*)MO.getMachineBasicBlock() << ">"; break; case MachineOperand::MO_FrameIndex: OS << ""; @@ -448,9 +448,9 @@ break; } case MachineOperand::MO_MachineBasicBlock: - OS << "bb<" + OS << "getBasicBlock())->getName() - << "," << (void*)MO.getMachineBasicBlock()->getBasicBlock() << ">"; + << "@" << (void*)MO.getMachineBasicBlock() << ">"; break; case MachineOperand::MO_FrameIndex: OS << ""; From lattner at cs.uiuc.edu Thu Jun 17 19:36:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 19:36:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200406180029.TAA23502@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.265 -> 1.266 --- Log message: Fold setcc instructions into select and branches that are not in the same BB as the setcc. --- Diffs of the changes: (+2 -4) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.265 llvm/lib/Target/X86/InstSelectSimple.cpp:1.266 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.265 Thu Jun 17 17:15:25 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Thu Jun 17 19:29:22 2004 @@ -839,16 +839,14 @@ // canFoldSetCCIntoBranchOrSelect - Return the setcc instruction if we can fold // it into the conditional branch or select instruction which is the only user // of the cc instruction. This is the case if the conditional branch is the -// only user of the setcc, and if the setcc is in the same basic block as the -// conditional branch. We also don't handle long arguments below, so we reject -// them here as well. +// only user of the setcc. We also don't handle long arguments below, so we +// reject them here as well. // static SetCondInst *canFoldSetCCIntoBranchOrSelect(Value *V) { if (SetCondInst *SCI = dyn_cast(V)) if (SCI->hasOneUse()) { Instruction *User = cast(SCI->use_back()); if ((isa(User) || isa(User)) && - SCI->getParent() == User->getParent() && (getClassB(SCI->getOperand(0)->getType()) != cLong || SCI->getOpcode() == Instruction::SetEQ || SCI->getOpcode() == Instruction::SetNE)) From lattner at cs.uiuc.edu Thu Jun 17 20:32:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 20:32:18 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200406180050.TAA26065@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.266 -> 1.267 --- Log message: Codegen sub C, X a little bit better for register pressure. Instead of mov REG, C sub REG, X generate: neg X add X, C which uses one less reg --- Diffs of the changes: (+27 -12) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.266 llvm/lib/Target/X86/InstSelectSimple.cpp:1.267 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.266 Thu Jun 17 19:29:22 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Thu Jun 17 19:50:37 2004 @@ -2125,24 +2125,39 @@ return; } - // sub 0, X -> neg X if (ConstantInt *CI = dyn_cast(Op0)) - if (OperatorClass == 1 && CI->isNullValue()) { - unsigned op1Reg = getReg(Op1, MBB, IP); + if (OperatorClass == 1) { static unsigned const NEGTab[] = { X86::NEG8r, X86::NEG16r, X86::NEG32r, 0, X86::NEG32r }; - BuildMI(*MBB, IP, NEGTab[Class], 1, DestReg).addReg(op1Reg); + + // sub 0, X -> neg X + if (CI->isNullValue()) { + unsigned op1Reg = getReg(Op1, MBB, IP); + BuildMI(*MBB, IP, NEGTab[Class], 1, DestReg).addReg(op1Reg); - if (Class == cLong) { - // We just emitted: Dl = neg Sl - // Now emit : T = addc Sh, 0 - // : Dh = neg T - unsigned T = makeAnotherReg(Type::IntTy); - BuildMI(*MBB, IP, X86::ADC32ri, 2, T).addReg(op1Reg+1).addImm(0); - BuildMI(*MBB, IP, X86::NEG32r, 1, DestReg+1).addReg(T); + if (Class == cLong) { + // We just emitted: Dl = neg Sl + // Now emit : T = addc Sh, 0 + // : Dh = neg T + unsigned T = makeAnotherReg(Type::IntTy); + BuildMI(*MBB, IP, X86::ADC32ri, 2, T).addReg(op1Reg+1).addImm(0); + BuildMI(*MBB, IP, X86::NEG32r, 1, DestReg+1).addReg(T); + } + return; + } else if (Op1->hasOneUse() && Class != cLong) { + // sub C, X -> tmp = neg X; DestReg = add tmp, C. This is better + // than copying C into a temporary register, because of register + // pressure (tmp and destreg can share a register. + static unsigned const ADDRITab[] = { + X86::ADD8ri, X86::ADD16ri, X86::ADD32ri, 0, X86::ADD32ri + }; + unsigned op1Reg = getReg(Op1, MBB, IP); + unsigned Tmp = makeAnotherReg(Op0->getType()); + BuildMI(*MBB, IP, NEGTab[Class], 1, Tmp).addReg(op1Reg); + BuildMI(*MBB, IP, ADDRITab[Class], 2, DestReg).addReg(Tmp).addImm(CI->getRawValue()); + return; } - return; } // Special case: op Reg, From lattner at cs.uiuc.edu Thu Jun 17 22:47:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 22:47:01 2004 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-06-17-UnorderedBuiltins.c Message-ID: <200406180340.WAA07267@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-06-17-UnorderedBuiltins.c added (r1.1) --- Log message: New testcase for GCC unordered comparison builtins --- Diffs of the changes: (+22 -0) Index: llvm/test/Regression/CFrontend/2004-06-17-UnorderedBuiltins.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-06-17-UnorderedBuiltins.c:1.1 *** /dev/null Thu Jun 17 22:40:06 2004 --- llvm/test/Regression/CFrontend/2004-06-17-UnorderedBuiltins.c Thu Jun 17 22:39:56 2004 *************** *** 0 **** --- 1,22 ---- + + _Bool A, B, C, D, E, F, G, H; + void TestF(float X, float Y) { + A = __builtin_isgreater(X, Y); + B = __builtin_isgreaterequal(X, Y); + C = __builtin_isless(X, Y); + D = __builtin_islessequal(X, Y); + E = __builtin_islessgreater(X, Y); + F = __builtin_isunordered(X, Y); + //G = __builtin_isordered(X, Y); // Our current snapshot of GCC doesn't include this builtin + H = __builtin_isunordered(X, Y); + } + void TestD(double X, double Y) { + A = __builtin_isgreater(X, Y); + B = __builtin_isgreaterequal(X, Y); + C = __builtin_isless(X, Y); + D = __builtin_islessequal(X, Y); + E = __builtin_islessgreater(X, Y); + F = __builtin_isunordered(X, Y); + //G = __builtin_isordered(X, Y); // Our current snapshot doesn't include this builtin. FIXME + H = __builtin_isunordered(X, Y); + } From lattner at cs.uiuc.edu Thu Jun 17 22:48:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 22:48:01 2004 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200406180347.WAA15604@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.41 -> 1.42 --- Log message: Implement support for unordered comparison expressions. This is tested by CFrontend/2004-06-17-UnorderedBuiltins.c --- Diffs of the changes: (+93 -3) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.41 llvm-gcc/gcc/llvm-expand.c:1.42 --- llvm-gcc/gcc/llvm-expand.c:1.41 Tue Jun 8 20:10:16 2004 +++ llvm-gcc/gcc/llvm-expand.c Thu Jun 17 22:47:02 2004 @@ -396,6 +396,46 @@ append_inst(Fn, I); } +/* append_llvm_isunordered_call - Emit a call to llvm.isunordered, given the two + * floating point argument sepecified. + */ +static llvm_value *append_llvm_isunordered_call(llvm_function *Fn, + llvm_value *Op1, llvm_value *Op2) { + llvm_instruction *I = llvm_instruction_new(BoolTy, "tmp", O_Call, 3); + I->Operands[1] = Op1; + I->Operands[2] = Op2; + + assert(Op1->Ty == Op2->Ty && "Not equivalent operand types!"); + if (Op1->Ty == FloatTy) { + static llvm_value *llvm_isunordered_float_fn = 0; + if (!llvm_isunordered_float_fn) { + llvm_type *FnTy = llvm_type_create_function(2, BoolTy); + FnTy->Elements[1] = FloatTy; + FnTy->Elements[2] = FloatTy; + FnTy = llvm_type_get_cannonical_function(FnTy); + llvm_isunordered_float_fn = + G2V(CreateIntrinsicFnWithType("llvm.isunordered", FnTy)); + } + + I->Operands[0] = llvm_isunordered_float_fn; + } else if (Op2->Ty == DoubleTy) { + static llvm_value *llvm_isunordered_double_fn = 0; + if (!llvm_isunordered_double_fn) { + llvm_type *FnTy = llvm_type_create_function(2, BoolTy); + FnTy->Elements[1] = DoubleTy; + FnTy->Elements[2] = DoubleTy; + FnTy = llvm_type_get_cannonical_function(FnTy); + llvm_isunordered_double_fn = + G2V(CreateIntrinsicFnWithType("llvm.isunordered", FnTy)); + } + + I->Operands[0] = llvm_isunordered_double_fn; + } else { + assert(0 && "Unknown floating point type!"); + } + + return append_inst(Fn, I); +} /* llvm_copy_aggregate - Given two pointers to structures, copy *SrcPtr into * *DestPtr, element by element. @@ -5699,6 +5739,7 @@ InitializeComplex(Fn, DestLoc, ResultR, ResultI, 0); } + /* llvm_expand_expr: generate code for computing expression EXP. If the * expression produces a scalar value (which can be held in an LLVM register), * an llvm_value* for the computed R-value is returned. The value is null if @@ -6046,8 +6087,14 @@ case TRUTH_AND_EXPR: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: /* Bit ops */ case LSHIFT_EXPR: case RSHIFT_EXPR: /* Shifts */ case LT_EXPR: case LE_EXPR: case GT_EXPR: /* Comparisons */ - case GE_EXPR: case EQ_EXPR: case NE_EXPR: { /* Comparisons */ + case GE_EXPR: case EQ_EXPR: case NE_EXPR: /* Comparisons */ + case UNLT_EXPR: case UNLE_EXPR: case UNGT_EXPR: /* unordered Comparisons */ + case UNGE_EXPR: case UNEQ_EXPR: /* unordered Comparisons */ + case ORDERED_EXPR: case UNORDERED_EXPR: /* ordered or not */ + /* case LTGT_EXPR: FIXME: When we merge in LTGT support from mainline */ + { enum InstOpcode Opcode; + int isUnordered = 0; if (llvm_type_is_composite(DestTy)) { llvm_expand_complex_binary_expr(Fn, exp, DestLoc); @@ -6117,6 +6164,14 @@ case GE_EXPR: Opcode = O_SetGE; break; case EQ_EXPR: Opcode = O_SetEQ; break; case NE_EXPR: Opcode = O_SetNE; break; + case UNLT_EXPR: Opcode = O_SetLT; break; + case UNLE_EXPR: Opcode = O_SetLE; break; + case UNGT_EXPR: Opcode = O_SetGT; break; + case UNGE_EXPR: Opcode = O_SetGE; break; + case UNEQ_EXPR: Opcode = O_SetEQ; break; + /*case LTGT_EXPR: Opcode = O_SetNE; break; FIXME when merge */ + case ORDERED_EXPR: Opcode = O_Call; break; /* SPECIAL */ + case UNORDERED_EXPR: Opcode = O_Call; break; /* SPECIAL */ case LSHIFT_EXPR: Opcode = O_Shl; break; case RSHIFT_EXPR: Opcode = O_Shr; break; default: abort(); @@ -6154,6 +6209,18 @@ case GE_EXPR: break; + case UNLT_EXPR: + case UNLE_EXPR: + case UNGT_EXPR: + case UNGE_EXPR: + case UNEQ_EXPR: + isUnordered = 1; /* These require an |isunordered */ + /* case LTGT_EXPR: FIXME WHEN MERGE */ + break; + case ORDERED_EXPR: + case UNORDERED_EXPR: + break; + default: if (Opcode < O_SetEQ && (op0->Ty->ID == PointerTyID || op1->Ty->ID == PointerTyID)) { @@ -6181,8 +6248,31 @@ if (Opcode != O_Call) Result = append_inst(Fn, create_binary_inst("tmp", Opcode, op0, op1)); - else /* Min or Max */ - Result = llvm_expand_minmaxabs_expr(Fn, exp, op0, op1); + else { + switch (TREE_CODE(exp)) { + case MIN_EXPR: case MAX_EXPR: + Result = llvm_expand_minmaxabs_expr(Fn, exp, op0, op1); + break; + case UNORDERED_EXPR: + Result = append_llvm_isunordered_call(Fn, op0, op1); + break; + case ORDERED_EXPR: + Result = append_llvm_isunordered_call(Fn, op0, op1); + Result = append_inst(Fn, create_binary_inst("tmp", O_Xor, Result, + llvm_constant_bool_true)); + break; + default: abort(); + } + } + + /* If this is an unordered comparison, 'and` in !isunordered(X, Y). */ + if (isUnordered) { + llvm_value *Tmp = append_llvm_isunordered_call(Fn, op0, op1); + Tmp = append_inst(Fn, create_binary_inst("tmp", O_Xor, Tmp, + llvm_constant_bool_true)); + Result = append_inst(Fn, create_binary_inst("tmp", O_And, Tmp, Result)); + } + break; } case ABS_EXPR: { From lattner at cs.uiuc.edu Thu Jun 17 23:14:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 23:14:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200406180407.XAA07708@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.141 -> 1.142 --- Log message: Fix printing of Argument objects, problem found by Patrick Meredith --- Diffs of the changes: (+1 -1) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.141 llvm/lib/VMCore/AsmWriter.cpp:1.142 --- llvm/lib/VMCore/AsmWriter.cpp:1.141 Thu Jun 17 13:18:53 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Thu Jun 17 23:07:20 2004 @@ -1132,7 +1132,7 @@ } void Argument::print(std::ostream &o) const { - o << getType() << ' ' << getName(); + WriteAsOperand(o, this, true, true, getParent()->getParent()); } // Value::dump - allow easy printing of Values from the debugger. From lattner at cs.uiuc.edu Thu Jun 17 23:51:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 17 23:51:01 2004 Subject: [llvm-commits] CVS: llvm-gcc/gcc/c-cppbuiltin.c Message-ID: <200406180450.XAA25098@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: c-cppbuiltin.c updated: 1.2 -> 1.3 --- Log message: Turn on extern inline functions in glibc to efficiently codegen functions like isunordered -> __builtin_isunordered -> llvm.isunordered. This is a big hammer, but I'm not sure of a better way to do it. --- Diffs of the changes: (+1 -0) Index: llvm-gcc/gcc/c-cppbuiltin.c diff -u llvm-gcc/gcc/c-cppbuiltin.c:1.2 llvm-gcc/gcc/c-cppbuiltin.c:1.3 --- llvm-gcc/gcc/c-cppbuiltin.c:1.2 Thu Jan 8 17:03:26 2004 +++ llvm-gcc/gcc/c-cppbuiltin.c Thu Jun 17 23:50:07 2004 @@ -386,6 +386,7 @@ if (EMIT_LLVM) { cpp_define(pfile, "__llvm__"); cpp_define(pfile, "__NO_MATH_INLINES"); + cpp_define(pfile, "__USE_EXTERN_INLINES"); } /* A straightforward target hook doesn't work, because of problems From lattner at cs.uiuc.edu Fri Jun 18 00:50:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 00:50:01 2004 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-06-17-UnorderedCompares.c.tr Message-ID: <200406180543.AAA08228@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-06-17-UnorderedCompares.c.tr added (r1.1) --- Log message: Test that C99 unordered comparison functions are not being turned into libc calls --- Diffs of the changes: (+21 -0) Index: llvm/test/Regression/CFrontend/2004-06-17-UnorderedCompares.c.tr diff -c /dev/null llvm/test/Regression/CFrontend/2004-06-17-UnorderedCompares.c.tr:1.1 *** /dev/null Fri Jun 18 00:43:00 2004 --- llvm/test/Regression/CFrontend/2004-06-17-UnorderedCompares.c.tr Fri Jun 18 00:42:50 2004 *************** *** 0 **** --- 1,21 ---- + // RUN: llvmgcc -xc -std=c99 %s -c -o - | llvm-dis | grep -v llvm.isunordered | not grep call + + #include + + _Bool A, B, C, D, E, F; + void TestF(float X, float Y) { + A = isgreater(X, Y); + B = isgreaterequal(X, Y); + C = isless(X, Y); + D = islessequal(X, Y); + E = islessgreater(X, Y); + F = isunordered(X, Y); + } + void TestD(double X, double Y) { + A = isgreater(X, Y); + B = isgreaterequal(X, Y); + C = isless(X, Y); + D = islessequal(X, Y); + E = islessgreater(X, Y); + F = isunordered(X, Y); + } From lattner at cs.uiuc.edu Fri Jun 18 00:58:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 00:58:03 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/FunctionResolution.cpp Message-ID: <200406180550.AAA08699@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: FunctionResolution.cpp updated: 1.47 -> 1.48 --- Log message: Do not function resolve intrinsics. This prevents warnings and possible bad things from happening due to declare bool %llvm.isunordered(double, double) declare bool %llvm.isunordered(float, float) --- Diffs of the changes: (+2 -1) Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.47 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.48 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.47 Thu Jun 17 13:16:19 2004 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Fri Jun 18 00:50:48 2004 @@ -307,7 +307,8 @@ if (F->use_empty() && F->isExternal()) { M.getFunctionList().erase(F); Changed = true; - } else if (!F->hasInternalLinkage() && !F->getName().empty()) + } else if (!F->hasInternalLinkage() && !F->getName().empty() && + !F->getIntrinsicID()) Globals[F->getName()].push_back(F); } From lattner at cs.uiuc.edu Fri Jun 18 01:14:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 01:14:02 2004 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll Message-ID: <200406180607.BAA09241@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and.ll updated: 1.18 -> 1.19 --- Log message: New test --- Diffs of the changes: (+8 -0) Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.18 llvm/test/Regression/Transforms/InstCombine/and.ll:1.19 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.18 Fri Sep 19 14:04:43 2003 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Fri Jun 18 01:07:17 2004 @@ -105,3 +105,11 @@ %C = and ubyte %B, 3 ret ubyte %C } + +sbyte %test17(sbyte %X, sbyte %Y) { ;; ~(~X & Y) --> (X | ~Y) + %B = xor sbyte %X, -1 + %C = and sbyte %B, %Y + %D = xor sbyte %C, -1 + ret sbyte %D +} + From lattner at cs.uiuc.edu Fri Jun 18 01:15:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 01:15:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200406180608.BAA09250@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.213 -> 1.214 --- Log message: Implement Transforms/InstCombine/and.ll:test17, a common case that occurs due to unordered comparison macros in math.h --- Diffs of the changes: (+15 -3) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.213 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.214 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.213 Thu Jun 17 13:16:02 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Jun 18 01:07:51 2004 @@ -1130,6 +1130,9 @@ Value *Op0NotVal = dyn_castNotVal(Op0); Value *Op1NotVal = dyn_castNotVal(Op1); + if (Op0NotVal == Op1 || Op1NotVal == Op0) // A & ~A == ~A & A == 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + // (~A & ~B) == (~(A | B)) - Demorgan's Law if (Op0NotVal && Op1NotVal && isOnlyUse(Op0) && isOnlyUse(Op1)) { Instruction *Or = BinaryOperator::createOr(Op0NotVal, Op1NotVal, @@ -1138,9 +1141,6 @@ return BinaryOperator::createNot(Or); } - if (Op0NotVal == Op1 || Op1NotVal == Op0) // A & ~A == ~A & A == 0 - return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); - // (setcc1 A, B) & (setcc2 A, B) --> (setcc3 A, B) if (SetCondInst *RHS = dyn_cast(I.getOperand(1))) if (Instruction *R = AssociativeOpt(I, FoldSetCCLogical(*this, RHS))) @@ -1271,6 +1271,18 @@ ConstantInt::get(I.getType(), 1)); return BinaryOperator::createAdd(Op0I->getOperand(1), ConstantRHS); } + + // ~(~X & Y) --> (X | ~Y) + if (Op0I->getOpcode() == Instruction::And && RHS->isAllOnesValue()) { + if (dyn_castNotVal(Op0I->getOperand(1))) Op0I->swapOperands(); + if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0))) { + Instruction *NotY = + BinaryOperator::createNot(Op0I->getOperand(1), + Op0I->getOperand(1)->getName()+".not"); + InsertNewInstBefore(NotY, I); + return BinaryOperator::createOr(Op0NotVal, NotY); + } + } if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) switch (Op0I->getOpcode()) { From lattner at cs.uiuc.edu Fri Jun 18 01:34:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 01:34:02 2004 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200406180626.BAA10063@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.200 -> 1.201 --- Log message: Calls to __builtin_isunordered and friends no longer cause llvmgcc to ICE. --- Diffs of the changes: (+8 -5) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.200 llvm/docs/ReleaseNotes.html:1.201 --- llvm/docs/ReleaseNotes.html:1.200 Tue Jun 15 16:50:46 2004 +++ llvm/docs/ReleaseNotes.html Fri Jun 18 01:26:29 2004 @@ -71,8 +71,8 @@

    This is the fourth public release of the LLVM compiler infrastructure. This release primarily improves the performance of the -code produced by all aspects of the LLVM compiler and adds some new features, though it does fix a few +code produced by all aspects of the LLVM compiler and adds many new features, and fixes a few bugs as well.

    At this time, LLVM is known to correctly compile and run all C & C++ @@ -128,6 +128,8 @@ being documented.

  • LLVM now provides an llvm.isunordered intrinsic for efficient implementation of unordered floating point comparisons.
  • +
  • The llvmgcc front-end now supports the GCC builtins for ISO C99 floating +point comparison macros (e.g., __builtin_islessequal).
  • @@ -526,8 +528,9 @@ We support all builtins which have a C language equivalent (e.g., __builtin_cos), __builtin_alloca, __builtin_types_compatible_p, __builtin_choose_expr, - __builtin_constant_p, and __builtin_expect (ignored). - + __builtin_constant_p, and __builtin_expect + (currently ignored). We also support builtins for ISO C99 floating + point comparison macros (e.g., __builtin_islessequal).

    The following extensions are known to be supported:

    @@ -718,7 +721,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/15 21:50:46 $ + Last modified: $Date: 2004/06/18 06:26:29 $ From brukman at cs.uiuc.edu Fri Jun 18 10:38:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Jun 18 10:38:01 2004 Subject: [llvm-commits] CVS: llvm/include/Config/pagesize.h Message-ID: <200406181530.KAA28669@zion.cs.uiuc.edu> Changes in directory llvm/include/Config: pagesize.h added (r1.1) --- Log message: Add a target-independent way to query page size. --- Diffs of the changes: (+49 -0) Index: llvm/include/Config/pagesize.h diff -c /dev/null llvm/include/Config/pagesize.h:1.1 *** /dev/null Fri Jun 18 10:30:35 2004 --- llvm/include/Config/pagesize.h Fri Jun 18 10:30:25 2004 *************** *** 0 **** --- 1,49 ---- + /* + * The LLVM Compiler Infrastructure + * + * This file was developed by the LLVM research group and is distributed under + * the University of Illinois Open Source License. See LICENSE.TXT for details. + * + ****************************************************************************** + * + * This header file provides a platform-independent way of quering page size. + */ + + #ifndef PAGESIZE_H + #define PAGESIZE_H + + #include "Config/unistd.h" + #include + + namespace llvm { + + /* Compatibility chart: + * + * x86/Linux: _SC_PAGESIZE, _SC_PAGE_SIZE + * MacOS X/PowerPC: v. 10.2: NBPG, + * v. 10.3: _SC_PAGESIZE + * Solaris/Sparc: _SC_PAGESIZE, _SC_PAGE_SIZE + */ + + /** + * GetPageSize - wrapper to return page size in bytes for various + * architecture/OS combinations + */ + unsigned GetPageSize() { + #ifdef _SC_PAGESIZE + return sysconf(_SC_PAGESIZE); + #elif defined(_SC_PAGE_SIZE) + return sysconf(_SC_PAGE_SIZE); + #elif defined(NBPG) + #ifndef CLSIZE + #define CLSIZE 1 + #endif + return NBPG * CLSIZE; + #else + return 4096; /* allocate 4KB as a fall-back */ + #endif + } + + } + + #endif From brukman at cs.uiuc.edu Fri Jun 18 10:41:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Jun 18 10:41:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200406181534.KAA28757@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.28 -> 1.29 --- Log message: Use the machine-independent method of querying the page size. --- Diffs of the changes: (+2 -1) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.28 llvm/lib/Support/SystemUtils.cpp:1.29 --- llvm/lib/Support/SystemUtils.cpp:1.28 Tue Jun 1 19:09:46 2004 +++ llvm/lib/Support/SystemUtils.cpp Fri Jun 18 10:34:07 2004 @@ -17,6 +17,7 @@ #include "Config/sys/types.h" #include "Config/sys/stat.h" #include "Config/fcntl.h" +#include "Config/pagesize.h" #include "Config/sys/wait.h" #include "Config/sys/mman.h" #include "Config/unistd.h" @@ -283,7 +284,7 @@ return P; #elif defined(HAVE_MMAP) - static const long pageSize = sysconf(_SC_PAGESIZE); + static const long pageSize = GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; /* FIXME: This should use the proper autoconf flags */ From brukman at cs.uiuc.edu Fri Jun 18 10:46:07 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Jun 18 10:46:07 2004 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200406181538.KAA29319@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.29 -> 1.30 --- Log message: * Fix file header and name * Order #includes alphabetically --- Diffs of the changes: (+8 -8) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.29 llvm/lib/Support/SystemUtils.cpp:1.30 --- llvm/lib/Support/SystemUtils.cpp:1.29 Fri Jun 18 10:34:07 2004 +++ llvm/lib/Support/SystemUtils.cpp Fri Jun 18 10:38:49 2004 @@ -1,4 +1,4 @@ -//===- SystemUtils.h - Utilities to do low-level system stuff --*- C++ -*--===// +//===- SystemUtils.cpp - Utilities for low-level system tasks -------------===// // // The LLVM Compiler Infrastructure // @@ -14,19 +14,19 @@ #define _POSIX_MAPPED_FILES #include "Support/SystemUtils.h" -#include "Config/sys/types.h" -#include "Config/sys/stat.h" #include "Config/fcntl.h" #include "Config/pagesize.h" -#include "Config/sys/wait.h" -#include "Config/sys/mman.h" #include "Config/unistd.h" +#include "Config/windows.h" +#include "Config/sys/mman.h" +#include "Config/sys/stat.h" +#include "Config/sys/types.h" +#include "Config/sys/wait.h" #include +#include +#include #include #include -#include -#include -#include "Config/windows.h" using namespace llvm; /// isExecutableFile - This function returns true if the filename specified From brukman at cs.uiuc.edu Fri Jun 18 11:02:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Jun 18 11:02:01 2004 Subject: [llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html Message-ID: <200406181555.KAA00698@zion.cs.uiuc.edu> Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.18 -> 1.19 --- Log message: Capitalize Cygwin. --- Diffs of the changes: (+5 -5) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.18 llvm/docs/CFEBuildInstrs.html:1.19 --- llvm/docs/CFEBuildInstrs.html:1.18 Wed Jun 2 14:27:50 2004 +++ llvm/docs/CFEBuildInstrs.html Fri Jun 18 10:54:54 2004 @@ -15,7 +15,7 @@
    1. A Cautionary Note
    2. Instructions
    3. @@ -53,12 +53,12 @@
      -

      If you are building LLVM and the C front-end under cygwin, please note that +

      If you are building LLVM and the C front-end under Cygwin, please note that the LLVM and GCC makefiles do not correctly handle spaces in paths. To deal with this issue, make sure that your LLVM and GCC source and build trees are located in a top-level directory (like /cygdrive/c/llvm and @@ -121,7 +121,7 @@ % gmake all; gmake install -

      cygwin/x86:

      +

      Cygwin/x86:

        % cd build
      @@ -302,7 +302,7 @@
       
         Brian Gaeke
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/06/02 19:27:50 $ + Last modified: $Date: 2004/06/18 15:54:54 $ From lattner at cs.uiuc.edu Fri Jun 18 13:00:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 13:00:02 2004 Subject: [llvm-commits] CVS: llvm-gcc/include/obstack.h Message-ID: <200406181752.MAA09181@zion.cs.uiuc.edu> Changes in directory llvm-gcc/include: obstack.h updated: 1.1.1.1 -> 1.2 --- Log message: Fix PR373: http://llvm.cs.uiuc.edu/PR373 by updating to a newer obstack.h from CVS. Thanks go to Vladimir Merzliakov for digging the new version up. --- Diffs of the changes: (+26 -14) Index: llvm-gcc/include/obstack.h diff -u llvm-gcc/include/obstack.h:1.1.1.1 llvm-gcc/include/obstack.h:1.2 --- llvm-gcc/include/obstack.h:1.1.1.1 Thu Jan 8 15:59:16 2004 +++ llvm-gcc/include/obstack.h Fri Jun 18 12:52:45 2004 @@ -343,7 +343,7 @@ #endif -#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar) +#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) #define obstack_blank_fast(h,n) ((h)->next_free += (n)) @@ -411,7 +411,7 @@ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, 1); \ - *(__o->next_free)++ = (datum); \ + obstack_1grow_fast (__o, datum); \ (void) 0; }) /* These assume that the obstack alignment is good enough for pointers or ints, @@ -423,19 +423,28 @@ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ - *((void **)__o->next_free)++ = ((void *)datum); \ - (void) 0; }) + obstack_ptr_grow_fast (__o, datum); }) # define obstack_int_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (int) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (int)); \ - *((int *)__o->next_free)++ = ((int)datum); \ + obstack_int_grow_fast (__o, datum); }) + +# define obstack_ptr_grow_fast(OBSTACK,aptr) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + *(const void **) __o1->next_free = (aptr); \ + __o1->next_free += sizeof (const void *); \ (void) 0; }) -# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr) -# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) +# define obstack_int_grow_fast(OBSTACK,aint) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + *(int *) __o1->next_free = (aint); \ + __o1->next_free += sizeof (int); \ + (void) 0; }) # define obstack_blank(OBSTACK,length) \ __extension__ \ @@ -443,7 +452,7 @@ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ - __o->next_free += __len; \ + obstack_blank_fast (__o, __len); \ (void) 0; }) # define obstack_alloc(OBSTACK,length) \ @@ -530,26 +539,29 @@ # define obstack_1grow(h,datum) \ ( (((h)->next_free + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), 1), 0) : 0), \ - (*((h)->next_free)++ = (datum))) + obstack_1grow_fast (h, datum)) # define obstack_ptr_grow(h,datum) \ ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ - (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum))) + obstack_ptr_grow_fast (h, datum)) # define obstack_int_grow(h,datum) \ ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ - (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum))) + obstack_int_grow_fast (h, datum)) + +# define obstack_ptr_grow_fast(h,aptr) \ + (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) -# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr) -# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) +# define obstack_int_grow_fast(h,aint) \ + (((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr)) # define obstack_blank(h,length) \ ( (h)->temp = (length), \ (((h)->chunk_limit - (h)->next_free < (h)->temp) \ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ - ((h)->next_free += (h)->temp)) + obstack_blank_fast (h, (h)->temp)) # define obstack_alloc(h,length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) From lattner at cs.uiuc.edu Fri Jun 18 13:05:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 13:05:01 2004 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200406181757.MAA09902@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.201 -> 1.202 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.201 llvm/docs/ReleaseNotes.html:1.202 --- llvm/docs/ReleaseNotes.html:1.201 Fri Jun 18 01:26:29 2004 +++ llvm/docs/ReleaseNotes.html Fri Jun 18 12:57:29 2004 @@ -188,6 +188,8 @@ work if you change PATH
    4. [llvmgcc] llvmgcc does not compile with gcc 3.4
    5. +
    6. [llvmgcc] obstack.h relies on +obsolete casts-as-lvalues GCC extension
    @@ -721,7 +723,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/18 06:26:29 $ + Last modified: $Date: 2004/06/18 17:57:29 $ From brukman at cs.uiuc.edu Fri Jun 18 13:46:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Jun 18 13:46:01 2004 Subject: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html Message-ID: <200406181839.NAA17975@zion.cs.uiuc.edu> Changes in directory llvm/docs: ProgrammersManual.html updated: 1.61 -> 1.62 --- Log message: Add link documenting shared/static library differences across platforms. --- Diffs of the changes: (+3 -4) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.61 llvm/docs/ProgrammersManual.html:1.62 --- llvm/docs/ProgrammersManual.html:1.61 Thu Jun 3 18:35:54 2004 +++ llvm/docs/ProgrammersManual.html Fri Jun 18 13:39:00 2004 @@ -222,12 +222,11 @@
    -

    LLVM is currently using CVS as its source versioning system. You may find -this reference handy:

    -
    1. CVS Branch and Tag Primer
    2. +
    3. Using +static and shared libraries across platforms
    @@ -2047,7 +2046,7 @@ Dinakar Dhurjati and Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/03 23:35:54 $ + Last modified: $Date: 2004/06/18 18:39:00 $ From lattner at cs.uiuc.edu Fri Jun 18 15:23:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 15:23:01 2004 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200406182016.PAA23472@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.57 -> 1.58 --- Log message: Add link to the CVS mirror hosted by Reid --- Diffs of the changes: (+17 -2) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.57 llvm/docs/GettingStarted.html:1.58 --- llvm/docs/GettingStarted.html:1.57 Wed Jun 2 15:37:02 2004 +++ llvm/docs/GettingStarted.html Fri Jun 18 15:15:58 2004 @@ -114,7 +114,7 @@
  • cd llvm
  • -
  • With anonymous CVS access: +
  • With anonymous CVS access (or use a mirror):
    1. cd where-you-want-llvm-to-live
    2. cvs -d @@ -463,6 +463,21 @@ + + +
      + +

      If the main CVS server is overloaded or inaccessible, you can try one of +these user-hosted mirrors:

      + + +
      + + @@ -1208,7 +1223,7 @@ Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/06/02 20:37:02 $ + Last modified: $Date: 2004/06/18 20:15:58 $ From brukman at cs.uiuc.edu Fri Jun 18 15:26:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri Jun 18 15:26:01 2004 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200406182018.PAA30343@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.58 -> 1.59 --- Log message: Fix relative link to the CVS mirrors. --- Diffs of the changes: (+4 -3) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.58 llvm/docs/GettingStarted.html:1.59 --- llvm/docs/GettingStarted.html:1.58 Fri Jun 18 15:15:58 2004 +++ llvm/docs/GettingStarted.html Fri Jun 18 15:18:31 2004 @@ -114,7 +114,7 @@
    3. cd llvm
  • -
  • With anonymous CVS access (or use a mirror): +
  • With anonymous CVS access (or use a mirror):
    1. cd where-you-want-llvm-to-live
    2. cvs -d @@ -473,7 +473,8 @@ these user-hosted mirrors:

      @@ -1223,7 +1224,7 @@ Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/06/18 20:15:58 $ + Last modified: $Date: 2004/06/18 20:18:31 $ From lattner at cs.uiuc.edu Fri Jun 18 19:56:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 19:56:01 2004 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200406190049.TAA04057@zion.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.42 -> 1.43 --- Log message: Fix PR374: http://llvm.cs.uiuc.edu/PR374 . We only want to index into arrays in this case, not arrays and structures --- Diffs of the changes: (+1 -1) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.42 llvm-gcc/gcc/llvm-expand.c:1.43 --- llvm-gcc/gcc/llvm-expand.c:1.42 Thu Jun 17 22:47:02 2004 +++ llvm-gcc/gcc/llvm-expand.c Fri Jun 18 19:49:13 2004 @@ -5268,7 +5268,7 @@ llvm_type *IntPtrTy = llvm_type_get_integer(llvm_type_get_size(VoidPtrTy)*8, 0); - if (llvm_type_is_composite(Op0Ty)) { + if (Op0Ty->ID == ArrayTyID) { llvm_value *Op0 = llvm_expand_lvalue_expr(Fn, tOp0, 0, 0); llvm_value *Op1 = llvm_expand_expr(Fn, tOp1, 0); Op1 = cast_if_type_not_equal(Fn, Op1, IntPtrTy); From lattner at cs.uiuc.edu Fri Jun 18 20:15:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 20:15:01 2004 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c Message-ID: <200406190108.UAA04128@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-06-18-VariableLengthArrayOfStructures.c added (r1.1) --- Log message: Test for PR374: http://llvm.cs.uiuc.edu/PR374 --- Diffs of the changes: (+8 -0) Index: llvm/test/Regression/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c:1.1 *** /dev/null Fri Jun 18 20:08:22 2004 --- llvm/test/Regression/CFrontend/2004-06-18-VariableLengthArrayOfStructures.c Fri Jun 18 20:08:12 2004 *************** *** 0 **** --- 1,8 ---- + + struct S { }; + + int xxxx(int a) { + struct S comps[a]; + comps[0]; + } + From lattner at cs.uiuc.edu Fri Jun 18 20:18:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 20:18:01 2004 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200406190111.UAA04834@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.202 -> 1.203 --- Log message: Bug fixed --- Diffs of the changes: (+5 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.202 llvm/docs/ReleaseNotes.html:1.203 --- llvm/docs/ReleaseNotes.html:1.202 Fri Jun 18 12:57:29 2004 +++ llvm/docs/ReleaseNotes.html Fri Jun 18 20:11:02 2004 @@ -282,7 +282,10 @@ enum type
    3. [llvmgcc] Variable length array indexing miscompiled
    4. -
    5. [llvmgcc] Errors handling function prototypes that take opaque structs by-value
    6. +
    7. [llvmgcc] Errors handling function +prototypes that take opaque structs by-value
    8. +
    9. [llvmgcc] Crash compiling variable +length array of structures
    @@ -723,7 +726,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/18 17:57:29 $ + Last modified: $Date: 2004/06/19 01:11:02 $ From lattner at cs.uiuc.edu Fri Jun 18 20:19:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 20:19:01 2004 Subject: [llvm-commits] CVS: llvm-www/releases/1.2/docs/ReleaseNotes.html Message-ID: <200406190112.UAA05514@zion.cs.uiuc.edu> Changes in directory llvm-www/releases/1.2/docs: ReleaseNotes.html updated: 1.20 -> 1.21 --- Log message: Bug found --- Diffs of the changes: (+2 -1) Index: llvm-www/releases/1.2/docs/ReleaseNotes.html diff -u llvm-www/releases/1.2/docs/ReleaseNotes.html:1.20 llvm-www/releases/1.2/docs/ReleaseNotes.html:1.21 --- llvm-www/releases/1.2/docs/ReleaseNotes.html:1.20 Thu Jun 10 23:28:46 2004 +++ llvm-www/releases/1.2/docs/ReleaseNotes.html Fri Jun 18 20:11:53 2004 @@ -394,6 +394,7 @@
  • [llvmgcc] Crash on use of undeclared enum type
  • [llvmgcc] Variable length array indexing miscompiled
  • [llvmgcc] Errors handling function prototypes that take opaque structs by-value
  • +
  • [llvmgcc] Crash compiling variable length array of structures
  • @@ -687,7 +688,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/11 04:28:46 $ + Last modified: $Date: 2004/06/19 01:11:53 $ From lattner at cs.uiuc.edu Fri Jun 18 21:10:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 21:10:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200406190202.VAA05803@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ScalarReplAggregates.cpp updated: 1.21 -> 1.22 --- Log message: Do not loop over uses as we delete them. This causes iterators to be invalidated out from under us. This bug goes back to revision 1.1: scary. --- Diffs of the changes: (+2 -3) Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.21 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.22 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.21 Sun Apr 4 20:29:05 2004 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Fri Jun 18 21:02:22 2004 @@ -171,9 +171,8 @@ // Now that we have created the alloca instructions that we want to use, // expand the getelementptr instructions to use them. // - for (Value::use_iterator I = AI->use_begin(), E = AI->use_end(); - I != E; ++I) { - Instruction *User = cast(*I); + while (!AI->use_empty()) { + Instruction *User = cast(AI->use_back()); if (GetElementPtrInst *GEPI = dyn_cast(User)) { // We now know that the GEP is of the form: GEP , 0, uint64_t Idx = cast(GEPI->getOperand(2))->getRawValue(); From lattner at cs.uiuc.edu Fri Jun 18 22:43:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 18 22:43:02 2004 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200406190335.WAA01497@zion.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.43 -> 1.44 --- Log message: Fix bug in expansion of unordered comparisons. The GCC UNLT_EXPR operation corresponds to (X < Y || isunordered(X, Y)), whereas C99's islessthan is really (X < Y && !isunordered(X, Y)). I thought that GCC followed the C99 semantics: oops. --- Diffs of the changes: (+2 -4) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.43 llvm-gcc/gcc/llvm-expand.c:1.44 --- llvm-gcc/gcc/llvm-expand.c:1.43 Fri Jun 18 19:49:13 2004 +++ llvm-gcc/gcc/llvm-expand.c Fri Jun 18 22:35:20 2004 @@ -6265,12 +6265,10 @@ } } - /* If this is an unordered comparison, 'and` in !isunordered(X, Y). */ + /* If this is an unordered comparison, 'or' in isunordered(X, Y). */ if (isUnordered) { llvm_value *Tmp = append_llvm_isunordered_call(Fn, op0, op1); - Tmp = append_inst(Fn, create_binary_inst("tmp", O_Xor, Tmp, - llvm_constant_bool_true)); - Result = append_inst(Fn, create_binary_inst("tmp", O_And, Tmp, Result)); + Result = append_inst(Fn, create_binary_inst("tmp", O_Or, Tmp, Result)); } break; From lattner at cs.uiuc.edu Sat Jun 19 02:10:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 02:10:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200406190702.CAA08576@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: SimplifyCFG.cpp updated: 1.41 -> 1.42 --- Log message: Do not sort by the address of LLVM ConstantInt* objects. This produces nondeterministic results that depend on where these objects land in memory. Instead, sort by the value of the constant, which is stable. Before this patch, the -simplifycfg pass run from two different compilers could cause different code to be generated, though it was semantically the same: @@ -12258,8 +12258,8 @@ %s_addr.1 = phi sbyte* [ %s, %entry ], [ %inc.0, %no_exit ] ; [#uses=5] %tmp.1 = load sbyte* %s_addr.1 ; [#uses=1] switch sbyte %tmp.1, label %no_exit [ - sbyte 0, label %loopexit sbyte 46, label %loopexit + sbyte 0, label %loopexit ] We need to stomp all of this stuff out. --- Diffs of the changes: (+21 -10) Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.41 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.42 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.41 Sun May 2 00:19:36 2004 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Sat Jun 19 02:02:14 2004 @@ -241,13 +241,13 @@ // GatherConstantSetEQs - Given a potentially 'or'd together collection of seteq // instructions that compare a value against a constant, return the value being // compared, and stick the constant into the Values vector. -static Value *GatherConstantSetEQs(Value *V, std::vector &Values) { +static Value *GatherConstantSetEQs(Value *V, std::vector &Values){ if (Instruction *Inst = dyn_cast(V)) if (Inst->getOpcode() == Instruction::SetEQ) { - if (Constant *C = dyn_cast(Inst->getOperand(1))) { + if (ConstantInt *C = dyn_cast(Inst->getOperand(1))) { Values.push_back(C); return Inst->getOperand(0); - } else if (Constant *C = dyn_cast(Inst->getOperand(0))) { + } else if (ConstantInt *C = dyn_cast(Inst->getOperand(0))) { Values.push_back(C); return Inst->getOperand(1); } @@ -263,20 +263,20 @@ // GatherConstantSetNEs - Given a potentially 'and'd together collection of // setne instructions that compare a value against a constant, return the value // being compared, and stick the constant into the Values vector. -static Value *GatherConstantSetNEs(Value *V, std::vector &Values) { +static Value *GatherConstantSetNEs(Value *V, std::vector &Values){ if (Instruction *Inst = dyn_cast(V)) if (Inst->getOpcode() == Instruction::SetNE) { - if (Constant *C = dyn_cast(Inst->getOperand(1))) { + if (ConstantInt *C = dyn_cast(Inst->getOperand(1))) { Values.push_back(C); return Inst->getOperand(0); - } else if (Constant *C = dyn_cast(Inst->getOperand(0))) { + } else if (ConstantInt *C = dyn_cast(Inst->getOperand(0))) { Values.push_back(C); return Inst->getOperand(1); } } else if (Inst->getOpcode() == Instruction::Cast) { // Cast of X to bool is really a comparison against zero. assert(Inst->getType() == Type::BoolTy && "Can only handle bool values!"); - Values.push_back(Constant::getNullValue(Inst->getOperand(0)->getType())); + Values.push_back(ConstantInt::get(Inst->getOperand(0)->getType(), 0)); return Inst->getOperand(0); } else if (Inst->getOpcode() == Instruction::And) { if (Value *LHS = GatherConstantSetNEs(Inst->getOperand(0), Values)) @@ -293,7 +293,7 @@ /// bunch of comparisons of one value against constants, return the value and /// the constants being compared. static bool GatherValueComparisons(Instruction *Cond, Value *&CompVal, - std::vector &Values) { + std::vector &Values) { if (Cond->getOpcode() == Instruction::Or) { CompVal = GatherConstantSetEQs(Cond, Values); @@ -533,6 +533,17 @@ return Changed; } +namespace { + /// ConstantIntOrdering - This class implements a stable ordering of constant + /// integers that does not depend on their address. This is important for + /// applications that sort ConstantInt's to ensure uniqueness. + struct ConstantIntOrdering { + bool operator()(const ConstantInt *LHS, const ConstantInt *RHS) const { + return LHS->getRawValue() < RHS->getRawValue(); + } + }; +} + // SimplifyCFG - This function is used to do simplification of a CFG. For // example, it adjusts branches to branches to eliminate the extra hop, it @@ -952,12 +963,12 @@ // If this is a bunch of seteq's or'd together, or if it's a bunch of // 'setne's and'ed together, collect them. Value *CompVal = 0; - std::vector Values; + std::vector Values; bool TrueWhenEqual = GatherValueComparisons(Cond, CompVal, Values); if (CompVal && CompVal->getType()->isInteger()) { // There might be duplicate constants in the list, which the switch // instruction can't handle, remove them now. - std::sort(Values.begin(), Values.end()); + std::sort(Values.begin(), Values.end(), ConstantIntOrdering()); Values.erase(std::unique(Values.begin(), Values.end()), Values.end()); // Figure out which block is which destination. From lattner at cs.uiuc.edu Sat Jun 19 02:48:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 02:48:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200406190740.CAA25491@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.62 -> 1.63 --- Log message: Do not let the numbering of PHI nodes placed in the function depend on non-deterministic things like the ordering of blocks in the dominance frontier of a BB. Unfortunately, I don't know of a better way to solve this problem than to explicitly sort the BB's in function-order before processing them. This is guaranteed to slow the pass down a bit, but is absolutely necessary to get usable diffs between two different tools executing the mem2reg or scalarrepl pass. Before this, bazillions of spurious diff failures occurred all over the place due to the different order of processing PHIs: - %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0 + %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0 Now, the diffs match. --- Diffs of the changes: (+36 -2) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.62 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.63 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.62 Thu Apr 8 14:59:34 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Jun 19 02:40:14 2004 @@ -131,6 +131,13 @@ // Visited - The set of basic blocks the renamer has already visited. std::set Visited; + // BasicBlockNumbering - Holds a numbering of the basic blocks in the + // function in a stable order that does not depend on their address. + std::map BasicBlockNumbering; + + // NumberedBasicBlock - Holds the inverse mapping of BasicBlockNumbering. + std::vector NumberedBasicBlock; + public: PromoteMem2Reg(const std::vector &A, DominatorTree &dt, DominanceFrontier &df, const TargetData &td) @@ -162,6 +169,7 @@ // that are live in a single basic block by the basic block they are live in. std::map > LocallyUsedAllocas; + for (unsigned AllocaNum = 0; AllocaNum != Allocas.size(); ++AllocaNum) { AllocaInst *AI = Allocas[AllocaNum]; @@ -278,11 +286,22 @@ continue; } + // If we haven't computed a numbering for the BB's in the function, do so + // now. + if (NumberedBasicBlock.empty()) { + unsigned n = 0; + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I, ++n) { + NumberedBasicBlock.push_back(I); + BasicBlockNumbering[I] = n; + } + } + // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. // unsigned CurrentVersion = 0; std::set InsertedPHINodes; + std::vector DFBlocks; while (!DefiningBlocks.empty()) { BasicBlock *BB = DefiningBlocks.back(); DefiningBlocks.pop_back(); @@ -291,10 +310,25 @@ DominanceFrontier::const_iterator it = DF.find(BB); if (it != DF.end()) { const DominanceFrontier::DomSetType &S = it->second; + + // In theory we don't need the indirection through the DFBlocks vector. + // In practice, the order of calling QueuePhiNode would depend on the + // (unspecified) ordering of basic blocks in the dominance frontier, + // which would give PHI nodes non-determinstic subscripts. Fix this by + // processing blocks in order of the occurance in the function. for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); P != PE; ++P) - if (QueuePhiNode(*P, AllocaNum, CurrentVersion, InsertedPHINodes)) - DefiningBlocks.push_back(*P); + DFBlocks.push_back(BasicBlockNumbering[*P]); + + // Sort by which the block ordering in the function. + std::sort(DFBlocks.begin(), DFBlocks.end()); + + for (unsigned i = 0, e = DFBlocks.size(); i != e; ++i) { + BasicBlock *BB = NumberedBasicBlock[DFBlocks[i]]; + if (QueuePhiNode(BB, AllocaNum, CurrentVersion, InsertedPHINodes)) + DefiningBlocks.push_back(BB); + } + DFBlocks.clear(); } } From lattner at cs.uiuc.edu Sat Jun 19 03:13:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 03:13:03 2004 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200406190806.DAA27146@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.43 -> 1.44 --- Log message: Fix a tiny bug in the -no-aa pass, in which it did not ever get a target data. This is a regression from 1.2, though noone uses -no-aa anyway --- Diffs of the changes: (+8 -9) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.43 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.44 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.43 Tue Jun 15 16:51:38 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sat Jun 19 03:05:58 2004 @@ -42,6 +42,14 @@ /// such it doesn't follow many of the rules that other alias analyses must. /// struct NoAA : public ImmutablePass, public AliasAnalysis { + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + } + + virtual void initializePass() { + TD = &getAnalysis(); + } + virtual AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { return MayAlias; @@ -61,7 +69,6 @@ virtual void deleteValue(Value *V) {} virtual void copyValue(Value *From, Value *To) {} - virtual void getAnalysisUsage(AnalysisUsage &AU) const {} }; // Register this pass... @@ -78,14 +85,6 @@ /// Because it doesn't chain to a previous alias analysis (like -no-aa), it /// derives from the NoAA class. struct BasicAliasAnalysis : public NoAA { - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - } - - virtual void initializePass() { - TD = &getAnalysis(); - } - AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); From lattner at cs.uiuc.edu Sat Jun 19 03:49:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 03:49:03 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/StableBasicBlockNumbering.h Message-ID: <200406190842.DAA00701@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: StableBasicBlockNumbering.h added (r1.1) --- Log message: Initial checkin of the StableBasicBlockNumbering, a little helper class for computing (strangely enough) a stable (determinstic) numbering for basic blocks. --- Diffs of the changes: (+70 -0) Index: llvm/include/llvm/Support/StableBasicBlockNumbering.h diff -c /dev/null llvm/include/llvm/Support/StableBasicBlockNumbering.h:1.1 *** /dev/null Sat Jun 19 03:42:10 2004 --- llvm/include/llvm/Support/StableBasicBlockNumbering.h Sat Jun 19 03:41:59 2004 *************** *** 0 **** --- 1,70 ---- + //===- StableBasicBlockNumbering.h - Provide BB identifiers -----*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This class provides a *stable* numbering of basic blocks that does not depend + // on their address in memory (which is nondeterministic). When requested, this + // class simply provides a unique ID for each basic block in the function + // specified and the inverse mapping. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_SUPPORT_STABLEBASICBLOCKNUMBERING_H + #define LLVM_SUPPORT_STABLEBASICBLOCKNUMBERING_H + + #include "llvm/Function.h" + #include + + namespace llvm { + class StableBasicBlockNumbering { + // BasicBlockNumbering - Holds a numbering of the basic blocks in the + // function in a stable order that does not depend on their address. + std::map BasicBlockNumbering; + + // NumberedBasicBlock - Holds the inverse mapping of BasicBlockNumbering. + std::vector NumberedBasicBlock; + public: + + StableBasicBlockNumbering(Function *F = 0) { + if (F) compute(*F); + } + + /// compute - If we have not computed a numbering for the function yet, do + /// so. + void compute(Function &F) { + if (NumberedBasicBlock.empty()) { + unsigned n = 0; + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I, ++n) { + NumberedBasicBlock.push_back(I); + BasicBlockNumbering[I] = n; + } + } + } + + /// getNumber - Return the ID number for the specified BasicBlock. + /// + unsigned getNumber(BasicBlock *BB) const { + std::map::const_iterator I = + BasicBlockNumbering.find(BB); + assert(I != BasicBlockNumbering.end() && + "Invalid basic block or numbering not computed!"); + return I->second; + } + + /// getBlock - Return the BasicBlock corresponding to a particular ID. + /// + BasicBlock *getBlock(unsigned N) const { + assert(N < NumberedBasicBlock.size() && + "Block ID out of range or numbering not computed!"); + return NumberedBasicBlock[N]; + } + + }; + } + + #endif From lattner at cs.uiuc.edu Sat Jun 19 03:50:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 03:50:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200406190842.DAA00872@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.63 -> 1.64 --- Log message: Change to use the StableBasicBlockNumbering class --- Diffs of the changes: (+7 -15) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.63 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.64 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.63 Sat Jun 19 02:40:14 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Jun 19 03:42:40 2004 @@ -24,6 +24,7 @@ #include "llvm/Function.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/StableBasicBlockNumbering.h" #include "Support/StringExtras.h" using namespace llvm; @@ -131,12 +132,9 @@ // Visited - The set of basic blocks the renamer has already visited. std::set Visited; - // BasicBlockNumbering - Holds a numbering of the basic blocks in the - // function in a stable order that does not depend on their address. - std::map BasicBlockNumbering; - - // NumberedBasicBlock - Holds the inverse mapping of BasicBlockNumbering. - std::vector NumberedBasicBlock; + // BBNumbers - Contains a stable numbering of basic blocks to avoid + // non-determinstic behavior. + StableBasicBlockNumbering BBNumbers; public: PromoteMem2Reg(const std::vector &A, DominatorTree &dt, @@ -288,13 +286,7 @@ // If we haven't computed a numbering for the BB's in the function, do so // now. - if (NumberedBasicBlock.empty()) { - unsigned n = 0; - for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I, ++n) { - NumberedBasicBlock.push_back(I); - BasicBlockNumbering[I] = n; - } - } + BBNumbers.compute(F); // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. @@ -318,13 +310,13 @@ // processing blocks in order of the occurance in the function. for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); P != PE; ++P) - DFBlocks.push_back(BasicBlockNumbering[*P]); + DFBlocks.push_back(BBNumbers.getNumber(*P)); // Sort by which the block ordering in the function. std::sort(DFBlocks.begin(), DFBlocks.end()); for (unsigned i = 0, e = DFBlocks.size(); i != e; ++i) { - BasicBlock *BB = NumberedBasicBlock[DFBlocks[i]]; + BasicBlock *BB = BBNumbers.getBlock(DFBlocks[i]); if (QueuePhiNode(BB, AllocaNum, CurrentVersion, InsertedPHINodes)) DefiningBlocks.push_back(BB); } From lattner at cs.uiuc.edu Sat Jun 19 04:04:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 04:04:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200406190856.DAA04349@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.61 -> 1.62 --- Log message: Fix one source of nondeterminism in the -licm pass: the hoist pass was processing blocks in whatever order they happened to end up in the dominator tree data structure. Force an ordering. --- Diffs of the changes: (+16 -2) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.61 llvm/lib/Transforms/Scalar/LICM.cpp:1.62 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.61 Thu Jun 17 02:26:52 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Sat Jun 19 03:56:43 2004 @@ -40,6 +40,7 @@ #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/StableBasicBlockNumbering.h" #include "llvm/Transforms/Utils/PromoteMemToReg.h" #include "llvm/Transforms/Utils/Local.h" #include "Support/CommandLine.h" @@ -81,6 +82,7 @@ LoopInfo *LI; // Current LoopInfo DominatorTree *DT; // Dominator Tree for the current Loop... DominanceFrontier *DF; // Current Dominance Frontier + StableBasicBlockNumbering *BBNum; // Stable IDs for basic blocks // State that is updated as we process loops bool Changed; // Set to true when we change anything. @@ -203,7 +205,7 @@ /// runOnFunction - For LICM, this simply traverses the loop structure of the /// function, hoisting expressions out of loops if possible. /// -bool LICM::runOnFunction(Function &) { +bool LICM::runOnFunction(Function &F) { Changed = false; // Get our Loop and Alias Analysis information... @@ -212,6 +214,10 @@ DF = &getAnalysis(); DT = &getAnalysis(); + // Get a stable numbering of basic blocks. + StableBasicBlockNumbering CurBBNum(&F); + BBNum = &CurBBNum; + // Hoist expressions out of all of the top-level loops. for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { AliasSetTracker AST(*AA); @@ -337,8 +343,16 @@ } const std::vector &Children = N->getChildren(); + std::vector > ChildrenWithIDs; + ChildrenWithIDs.reserve(Children.size()); + for (unsigned i = 0, e = Children.size(); i != e; ++i) { + unsigned ID = BBNum->getNumber(Children[i]->getBlock()); + ChildrenWithIDs.push_back(std::make_pair(ID, Children[i])); + } + + std::sort(ChildrenWithIDs.begin(), ChildrenWithIDs.end()); for (unsigned i = 0, e = Children.size(); i != e; ++i) - HoistRegion(Children[i]); + HoistRegion(ChildrenWithIDs[i].second); } /// canSinkOrHoistInst - Return true if the hoister and sinker can handle this From lattner at cs.uiuc.edu Sat Jun 19 13:23:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 13:23:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200406191816.NAA06058@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.64 -> 1.65 --- Log message: Fix a nasty bug, noticed by Reid --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.64 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.65 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.64 Fri Apr 23 16:29:48 2004 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Sat Jun 19 13:15:50 2004 @@ -165,7 +165,7 @@ } Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) { - Value *V = expandInTy(S->getOperand(),V->getType()->getUnsignedVersion()); + Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion()); return new CastInst(V, S->getType(), "tmp.", InsertPt); } From llvm at cs.uiuc.edu Sat Jun 19 13:31:01 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sat Jun 19 13:31:01 2004 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200406191824.NAA06131@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.203 -> 1.204 --- Log message: Add a note about GCC 3.3.2 optimization bug that causes llc to spin. --- Diffs of the changes: (+8 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.203 llvm/docs/ReleaseNotes.html:1.204 --- llvm/docs/ReleaseNotes.html:1.203 Fri Jun 18 20:11:02 2004 +++ llvm/docs/ReleaseNotes.html Sat Jun 19 13:24:05 2004 @@ -651,7 +651,13 @@
      -
    • None so far. +
    • Optimized (Release) versions of LLVM built with GCC 3.3.2 or 3.3.3 will + produce an llc tool that always enters an infinite loop due to what + appears to be an optimization bug (-O2 and -O3) in those versions of GCC. + This problem does not happen in GCC 3.3.1 nor GCC 3.4.0 nor does it happen if + you build a Debug version of LLVM. You are cautioned not to use GCC 3.3.2 or + GCC 3.3.3 to build Optimized versions of LLVM. It is unclear whether this problem + affects other backends but it is unlikely.
    @@ -726,7 +732,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/06/19 01:11:02 $ + Last modified: $Date: 2004/06/19 18:24:05 $ From lattner at cs.uiuc.edu Sat Jun 19 14:09:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 14:09:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp Message-ID: <200406191901.OAA06697@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: ExprTypeConvert.cpp updated: 1.91 -> 1.92 --- Log message: This will hopefully fix a heisenbug that Vladimir Merzliakov is running into valiantly trying to compile stuff on freebsd. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Transforms/ExprTypeConvert.cpp diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.91 llvm/lib/Transforms/ExprTypeConvert.cpp:1.92 --- llvm/lib/Transforms/ExprTypeConvert.cpp:1.91 Sun Apr 4 20:28:59 2004 +++ llvm/lib/Transforms/ExprTypeConvert.cpp Sat Jun 19 14:01:26 2004 @@ -1166,6 +1166,7 @@ while (OldPN->getNumOperands()) { BasicBlock *BB = OldPN->getIncomingBlock(0); Value *OldVal = OldPN->getIncomingValue(0); + ValueHandle OldValHandle(VMC, OldVal); OldPN->removeIncomingValue(BB, false); Value *V = ConvertExpressionToType(OldVal, NewTy, VMC, TD); NewPN->addIncoming(V, BB); From llvm at cs.uiuc.edu Sat Jun 19 14:46:00 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sat Jun 19 14:46:00 2004 Subject: [llvm-commits] CVS: llvm/test/QMTest/llvm.py Message-ID: <200406191938.OAA06913@zion.cs.uiuc.edu> Changes in directory llvm/test/QMTest: llvm.py updated: 1.27 -> 1.28 --- Log message: Added the WNOHANG flag for waitpid in ExecProgram to (hopefully) ensure that rapidly exiting child processes do not cause the parent to hang. --- Diffs of the changes: (+1 -1) Index: llvm/test/QMTest/llvm.py diff -u llvm/test/QMTest/llvm.py:1.27 llvm/test/QMTest/llvm.py:1.28 --- llvm/test/QMTest/llvm.py:1.27 Thu May 27 15:30:29 2004 +++ llvm/test/QMTest/llvm.py Sat Jun 19 14:38:38 2004 @@ -81,7 +81,7 @@ # # Wait for the child process to exit. # - (pid, status) = os.waitpid (child, 0) + (pid, status) = os.waitpid (child, os.WNOHANG ) # # Close our pipes to the child. From lattner at cs.uiuc.edu Sat Jun 19 15:12:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 15:12:02 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200406192004.PAA08066@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.55 -> 1.56 --- Log message: Print out immediate dominators in program order, not in random order based on the address of BasicBlock objects --- Diffs of the changes: (+5 -7) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.55 llvm/lib/VMCore/Dominators.cpp:1.56 --- llvm/lib/VMCore/Dominators.cpp:1.55 Fri Jun 4 19:24:59 2004 +++ llvm/lib/VMCore/Dominators.cpp Sat Jun 19 15:04:47 2004 @@ -211,15 +211,13 @@ } void ImmediateDominatorsBase::print(std::ostream &o) const { - for (const_iterator I = begin(), E = end(); I != E; ++I) { + Function *F = getRoots()[0]->getParent(); + for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) { o << " Immediate Dominator For Basic Block:"; - if (I->first) - WriteAsOperand(o, I->first, false); - else - o << " <>"; + WriteAsOperand(o, I, false); o << " is:"; - if (I->second) - WriteAsOperand(o, I->second, false); + if (BasicBlock *ID = get(I)) + WriteAsOperand(o, ID, false); else o << " <>"; o << "\n"; From lattner at cs.uiuc.edu Sat Jun 19 15:21:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 15:21:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200406192013.PAA08682@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.56 -> 1.57 --- Log message: compute dominator tree children in a deterministic order that does not depend on the address of BasicBlock objects in memory. This eliminates stuff like this: Inorder Dominator Tree: [1] %entry [2] %loopentry - [3] %loopexit [3] %no_exit - [4] %endif [4] %then + [4] %endif + [3] %loopexit [3] %return --- Diffs of the changes: (+12 -11) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.56 llvm/lib/VMCore/Dominators.cpp:1.57 --- llvm/lib/VMCore/Dominators.cpp:1.56 Sat Jun 19 15:04:47 2004 +++ llvm/lib/VMCore/Dominators.cpp Sat Jun 19 15:13:48 2004 @@ -373,19 +373,20 @@ BasicBlock *Root = Roots[0]; Nodes[Root] = RootNode = new Node(Root, 0); // Add a node for the root... + Function *F = Root->getParent(); // Loop over all of the reachable blocks in the function... - for (ImmediateDominators::const_iterator I = ID.begin(), E = ID.end(); - I != E; ++I) { - Node *&BBNode = Nodes[I->first]; - if (!BBNode) { // Haven't calculated this node yet? - // Get or calculate the node for the immediate dominator - Node *IDomNode = getNodeForBlock(I->second); - - // Add a new tree node for this BasicBlock, and link it as a child of - // IDomNode - BBNode = IDomNode->addChild(new Node(I->first, IDomNode)); + for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) + if (BasicBlock *ImmDom = ID.get(I)) { // Reachable block. + Node *&BBNode = Nodes[I]; + if (!BBNode) { // Haven't calculated this node yet? + // Get or calculate the node for the immediate dominator + Node *IDomNode = getNodeForBlock(ImmDom); + + // Add a new tree node for this BasicBlock, and link it as a child of + // IDomNode + BBNode = IDomNode->addChild(new Node(I, IDomNode)); + } } - } } static std::ostream &operator<<(std::ostream &o, From lattner at cs.uiuc.edu Sat Jun 19 15:31:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 15:31:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200406192023.PAA09788@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.62 -> 1.63 --- Log message: Now that dominator tree children are built in determinstic order, this horrible code can go away --- Diffs of the changes: (+2 -16) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.62 llvm/lib/Transforms/Scalar/LICM.cpp:1.63 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.62 Sat Jun 19 03:56:43 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Sat Jun 19 15:23:35 2004 @@ -40,7 +40,6 @@ #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Support/CFG.h" -#include "llvm/Support/StableBasicBlockNumbering.h" #include "llvm/Transforms/Utils/PromoteMemToReg.h" #include "llvm/Transforms/Utils/Local.h" #include "Support/CommandLine.h" @@ -82,7 +81,6 @@ LoopInfo *LI; // Current LoopInfo DominatorTree *DT; // Dominator Tree for the current Loop... DominanceFrontier *DF; // Current Dominance Frontier - StableBasicBlockNumbering *BBNum; // Stable IDs for basic blocks // State that is updated as we process loops bool Changed; // Set to true when we change anything. @@ -205,7 +203,7 @@ /// runOnFunction - For LICM, this simply traverses the loop structure of the /// function, hoisting expressions out of loops if possible. /// -bool LICM::runOnFunction(Function &F) { +bool LICM::runOnFunction(Function &) { Changed = false; // Get our Loop and Alias Analysis information... @@ -214,10 +212,6 @@ DF = &getAnalysis(); DT = &getAnalysis(); - // Get a stable numbering of basic blocks. - StableBasicBlockNumbering CurBBNum(&F); - BBNum = &CurBBNum; - // Hoist expressions out of all of the top-level loops. for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { AliasSetTracker AST(*AA); @@ -343,16 +337,8 @@ } const std::vector &Children = N->getChildren(); - std::vector > ChildrenWithIDs; - ChildrenWithIDs.reserve(Children.size()); - for (unsigned i = 0, e = Children.size(); i != e; ++i) { - unsigned ID = BBNum->getNumber(Children[i]->getBlock()); - ChildrenWithIDs.push_back(std::make_pair(ID, Children[i])); - } - - std::sort(ChildrenWithIDs.begin(), ChildrenWithIDs.end()); for (unsigned i = 0, e = Children.size(); i != e; ++i) - HoistRegion(ChildrenWithIDs[i].second); + HoistRegion(Children[i]); } /// canSinkOrHoistInst - Return true if the hoister and sinker can handle this From llvm at cs.uiuc.edu Sat Jun 19 15:40:01 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sat Jun 19 15:40:01 2004 Subject: [llvm-commits] CVS: llvm/utils/llvmgrep Message-ID: <200406192033.PAA10418@zion.cs.uiuc.edu> Changes in directory llvm/utils: llvmgrep added (r1.1) --- Log message: A utility to search the LLVM source tree for a grep pattern. This is a replacement for getsrcs.sh which now generates too much text to put on a Linux command line. The approach taken with llvmgrep is to execute a find command and execute a grep on each file that matches the name pattern. The arguments to this script are the same as those of egrep. Note that the -H and -n options to egrep will always be passed so that you always get the file and line number of matches. --- Diffs of the changes: (+22 -0) Index: llvm/utils/llvmgrep diff -c /dev/null llvm/utils/llvmgrep:1.1 *** /dev/null Sat Jun 19 15:33:05 2004 --- llvm/utils/llvmgrep Sat Jun 19 15:32:55 2004 *************** *** 0 **** --- 1,22 ---- + #!/bin/sh + # This is useful because it prints out all of the source files. Useful for + # greps. + PATTERN=$* + TOPDIR=`pwd | sed -e 's#(.*/llvm).*#$1#'` + if test -d "$TOPDIR" ; then + cd $TOPDIR + find docs include lib tools utils projects -type f \ + \( -path '*/doxygen/*' -o -path '*/Burg/*' \) -prune -o \ + -name '*.[cdhyl]*' \ + \! -name '*~' \ + \! -name '#*' \ + \! -name '*.ll' \ + \! -name '*.d' \ + \! -name '*.dir' \ + \! -name 'Sparc.burm.c' \ + \! -name 'llvmAsmParser.cpp' \ + \! -name 'llvmAsmParser.h' \ + \! -name 'FileParser.cpp' \ + \! -name 'FileParser.h' \ + -exec egrep -H -n $PATTERN {} \; + fi From lattner at cs.uiuc.edu Sat Jun 19 18:10:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 18:10:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/GenerateReport.pl Message-ID: <200406192302.SAA12848@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs: GenerateReport.pl updated: 1.20 -> 1.21 --- Log message: My css-fu is weak, particularly for tables. However, the sizes of the nightly tester pages are pretty outrageous. This change degrades the quality of the tables fairly substantially, but results in about 50% less HTML to load and render. If someone wants to play around with different formatting, you can easily do this by going into test/Programs/MultiSource/Benchmarks/Olden type 'make TEST=nightly report.html' As you tweak GenerateReport.pl to generate different HTML, just rerun the previous make, which will DTRT (ie, it won't rerun all of the tests, it will just regen the HTML). --- Diffs of the changes: (+2 -1) Index: llvm/test/Programs/GenerateReport.pl diff -u llvm/test/Programs/GenerateReport.pl:1.20 llvm/test/Programs/GenerateReport.pl:1.21 --- llvm/test/Programs/GenerateReport.pl:1.20 Mon Mar 29 15:14:47 2004 +++ llvm/test/Programs/GenerateReport.pl Sat Jun 19 18:02:37 2004 @@ -194,7 +194,8 @@ if ($Str eq '|') { print ""; } else { - print "
    $Str
    \n"; + #print "
    $Str
    \n"; + print "$Str\n"; }; ""; } sub printLine { From lattner at cs.uiuc.edu Sat Jun 19 18:38:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 18:38:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.Makefile TEST.nightly.report Message-ID: <200406192330.SAA13979@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.Makefile updated: 1.30 -> 1.31 TEST.nightly.report updated: 1.23 -> 1.24 --- Log message: Remove the # LLVM instructions column from the nightly tester. This is not really a useful metric, and the -instcount pass prints out TONS of gunk to the log that is useless. --- Diffs of the changes: (+0 -5) Index: llvm/test/Programs/TEST.nightly.Makefile diff -u llvm/test/Programs/TEST.nightly.Makefile:1.30 llvm/test/Programs/TEST.nightly.Makefile:1.31 --- llvm/test/Programs/TEST.nightly.Makefile:1.30 Thu Jun 3 14:45:00 2004 +++ llvm/test/Programs/TEST.nightly.Makefile Sat Jun 19 18:30:16 2004 @@ -43,10 +43,6 @@ printf "TEST-RESULT-compile: " >> $@;\ wc -c $< >> $@;\ echo >> $@;\ - $(LANALYZE) -stats -instcount $< -info-output-file=Output/$*.ic;\ - printf "TEST-RESULT-compile: " >> $@;\ - grep 'Number of instructions (of all types)$$' Output/$*.ic >> $@;\ - echo >> $@;\ else \ echo "TEST-FAIL: compile $(RELDIR)/$*" >> $@;\ fi Index: llvm/test/Programs/TEST.nightly.report diff -u llvm/test/Programs/TEST.nightly.report:1.23 llvm/test/Programs/TEST.nightly.report:1.24 --- llvm/test/Programs/TEST.nightly.report:1.23 Wed Feb 25 12:38:17 2004 +++ llvm/test/Programs/TEST.nightly.report Sat Jun 19 18:30:16 2004 @@ -62,7 +62,6 @@ # Times ["GCCAS" , "TEST-RESULT-compile: $WallTimeRE"], ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+)'], - ["Instrs" , 'TEST-RESULT-compile: *([0-9]+).*Number of inst'], ["LLC
    compile" , "TEST-RESULT-llc: $WallTimeRE"], ["LLC-LS
    compile" , "TEST-RESULT-llc-ls: $WallTimeRE"], ["JIT
    codegen" , "TEST-RESULT-jit-comptime: $WallTimeRE"], From lattner at cs.uiuc.edu Sat Jun 19 20:21:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 20:21:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200406200113.UAA30356@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: SimplifyCFG.cpp updated: 1.42 -> 1.43 --- Log message: Add some DEBUG output to the simplifycfg routines Fix another non-deterministic behavior, this one should actually speed up the code though as it was doing silly things. --- Diffs of the changes: (+13 -14) Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.42 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.43 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.42 Sat Jun 19 02:02:14 2004 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Sat Jun 19 20:13:18 2004 @@ -11,11 +11,13 @@ // //===----------------------------------------------------------------------===// +#define DEBUG_TYPE "simplifycfg" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Type.h" #include "llvm/Support/CFG.h" +#include "Support/Debug.h" #include #include #include @@ -64,19 +66,19 @@ } } - // Loop over all of the PHI nodes in the successor BB + // Loop over all of the PHI nodes in the successor BB. for (BasicBlock::iterator I = Succ->begin(); PHINode *PN = dyn_cast(I); ++I) { Value *OldVal = PN->removeIncomingValue(BB, false); assert(OldVal && "No entry in PHI for Pred BB!"); - // If this incoming value is one of the PHI nodes in BB... + // If this incoming value is one of the PHI nodes in BB, the new entries in + // the PHI node are the entries from the old PHI. if (isa(OldVal) && cast(OldVal)->getParent() == BB) { PHINode *OldValPN = cast(OldVal); - for (std::vector::const_iterator PredI = BBPreds.begin(), - End = BBPreds.end(); PredI != End; ++PredI) { - PN->addIncoming(OldValPN->getIncomingValueForBlock(*PredI), *PredI); - } + for (unsigned i = 0, e = OldValPN->getNumIncomingValues(); i != e; ++i) + PN->addIncoming(OldValPN->getIncomingValue(i), + OldValPN->getIncomingBlock(i)); } else { for (std::vector::const_iterator PredI = BBPreds.begin(), End = BBPreds.end(); PredI != End; ++PredI) { @@ -563,7 +565,7 @@ // Remove basic blocks that have no predecessors... which are unreachable. if (pred_begin(BB) == pred_end(BB) || *pred_begin(BB) == BB && ++pred_begin(BB) == pred_end(BB)) { - //cerr << "Removing BB: \n" << BB; + DEBUG(std::cerr << "Removing BB: \n" << BB); // Loop through all of our successors and make sure they know that one // of their predecessors is going away. @@ -611,7 +613,7 @@ // we cannot do this transformation! // if (!PropagatePredecessorsForPHIs(BB, Succ)) { - //cerr << "Killing Trivial BB: \n" << BB; + DEBUG(std::cerr << "Killing Trivial BB: \n" << BB); std::string OldName = BB->getName(); std::vector @@ -636,7 +638,6 @@ // this means that we should any newly added incoming edges should // use the PHI node as the value for these edges, because they are // loop back edges. - for (unsigned i = 0, e = OldSuccPreds.size(); i != e; ++i) if (OldSuccPreds[i] != BB) PN->addIncoming(PN, OldSuccPreds[i]); @@ -650,8 +651,6 @@ if (!OldName.empty() && !Succ->hasName()) // Transfer name if we can Succ->setName(OldName); - - //cerr << "Function after removal: \n" << M; return true; } } @@ -919,7 +918,7 @@ } if (OnlySucc) { - //cerr << "Merging: " << BB << "into: " << OnlyPred; + DEBUG(std::cerr << "Merging: " << BB << "into: " << OnlyPred); TerminatorInst *Term = OnlyPred->getTerminator(); // Resolve any PHI nodes at the start of the block. They are all @@ -1016,8 +1015,8 @@ // BasicBlock *IfTrue, *IfFalse; if (Value *IfCond = GetIfCondition(BB, IfTrue, IfFalse)) { - //std::cerr << "FOUND IF CONDITION! " << *IfCond << " T: " - // << IfTrue->getName() << " F: " << IfFalse->getName() << "\n"; + DEBUG(std::cerr << "FOUND IF CONDITION! " << *IfCond << " T: " + << IfTrue->getName() << " F: " << IfFalse->getName() << "\n"); // Figure out where to insert instructions as necessary. BasicBlock::iterator AfterPHIIt = BB->begin(); From lattner at cs.uiuc.edu Sat Jun 19 22:20:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 22:20:01 2004 Subject: [llvm-commits] CVS: llvm/utils/fpcmp/fpcmp.cpp Message-ID: <200406200312.WAA02935@zion.cs.uiuc.edu> Changes in directory llvm/utils/fpcmp: fpcmp.cpp updated: 1.8 -> 1.9 --- Log message: Make fpcmp handle running off of the beginning or end of the file correctly. --- Diffs of the changes: (+36 -4) Index: llvm/utils/fpcmp/fpcmp.cpp diff -u llvm/utils/fpcmp/fpcmp.cpp:1.8 llvm/utils/fpcmp/fpcmp.cpp:1.9 --- llvm/utils/fpcmp/fpcmp.cpp:1.8 Sun Jun 13 14:17:49 2004 +++ llvm/utils/fpcmp/fpcmp.cpp Sat Jun 19 22:12:18 2004 @@ -104,6 +104,23 @@ F1P = F1NumEnd; F2P = F2NumEnd; } +// PadFileIfNeeded - If the files are not identical, we will have to be doing +// numeric comparisons in here. There are bad cases involved where we (i.e., +// strtod) might run off the beginning or end of the file if it starts or ends +// with a number. Because of this, if needed, we pad the file so that it starts +// and ends with a null character. +static void PadFileIfNeeded(char *&FileStart, char *&FileEnd, char *&FP) { + if (isNumberChar(FileStart[0]) || isNumberChar(FileEnd[-1])) { + unsigned FileLen = FileEnd-FileStart; + char *NewFile = new char[FileLen+2]; + NewFile[0] = 0; // Add null padding + NewFile[FileLen+1] = 0; // Add null padding + memcpy(NewFile+1, FileStart, FileLen); + FP = NewFile+(FP-FileStart)+1; + FileStart = NewFile+1; + FileEnd = FileStart+FileLen; + } +} int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); @@ -119,9 +136,20 @@ char *File2End = File2Start+File2Len; char *F1P = File1Start; char *F2P = File2Start; + + // Scan for the end of file or first difference. + while (F1P < File1End && F2P < File2End && *F1P == *F2P) + ++F1P, ++F2P; + + // Common case: identifical files. + if (F1P == File1End && F2P == File2End) return 0; + + // If the files need padding, do so now. + PadFileIfNeeded(File1Start, File1End, F1P); + PadFileIfNeeded(File2Start, File2End, F2P); while (1) { - // Scan for the end of file or first difference. + // Scan for the end of file or next difference. while (F1P < File1End && F2P < File2End && *F1P == *F2P) ++F1P, ++F2P; @@ -140,9 +168,13 @@ // Okay, we reached the end of file. If both files are at the end, we // succeeded. - if (F1P >= File1End && F2P >= File2End) return 0; - - // Otherwise, we might have run off the end due to a number, backup and retry. + bool F1AtEnd = F1P >= File1End; + bool F2AtEnd = F2P >= File2End; + if (F1AtEnd & F2AtEnd) return 0; + + // Otherwise, we might have run off the end due to a number: backup and retry. + if (F1AtEnd && isNumberChar(F1P[-1])) --F1P; + if (F2AtEnd && isNumberChar(F2P[-1])) --F2P; F1P = BackupNumber(F1P, File1Start); F2P = BackupNumber(F2P, File2Start); From lattner at cs.uiuc.edu Sat Jun 19 23:19:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 19 23:19:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Inliner.cpp Message-ID: <200406200411.XAA09900@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Inliner.cpp updated: 1.15 -> 1.16 --- Log message: Fix the inliner to be deterministic, not letting its output depend on the relative location of Function objects in memory. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.15 llvm/lib/Transforms/IPO/Inliner.cpp:1.16 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.15 Mon May 24 01:24:46 2004 +++ llvm/lib/Transforms/IPO/Inliner.cpp Sat Jun 19 23:11:48 2004 @@ -1,4 +1,4 @@ -//===- InlineCommon.cpp - Code common to all inliners ---------------------===// +//===- Inliner.cpp - Code common to all inliners --------------------------===// // // The LLVM Compiler Infrastructure // @@ -90,9 +90,8 @@ // from inlining other functions. std::vector CallSites; - for (std::set::iterator SCCI = SCCFunctions.begin(), - E = SCCFunctions.end(); SCCI != E; ++SCCI) - if (Function *F = *SCCI) + for (unsigned i = 0, e = SCC.size(); i != e; ++i) + if (Function *F = SCC[i]->getFunction()) for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { CallSite CS = CallSite::get(I); From lattner at cs.uiuc.edu Sun Jun 20 00:10:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 00:10:02 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/InstrTypes.h Message-ID: <200406200503.AAA16070@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: InstrTypes.h updated: 1.39 -> 1.40 --- Log message: Add methods like BinaryOperator::createAdd that take an instruction to insert before. --- Diffs of the changes: (+6 -0) Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.39 llvm/include/llvm/InstrTypes.h:1.40 --- llvm/include/llvm/InstrTypes.h:1.39 Wed Jun 9 20:43:29 2004 +++ llvm/include/llvm/InstrTypes.h Sun Jun 20 00:02:56 2004 @@ -122,6 +122,12 @@ return create(Instruction::OPC, V1, V2, Name, BB);\ } #include "llvm/Instruction.def" +#define HANDLE_BINARY_INST(N, OPC, CLASS) \ + static BinaryOperator *create##OPC(Value *V1, Value *V2, \ + const std::string &Name, Instruction *I) {\ + return create(Instruction::OPC, V1, V2, Name, I);\ + } +#include "llvm/Instruction.def" /// Helper functions to construct and inspect unary operations (NEG and NOT) From lattner at cs.uiuc.edu Sun Jun 20 00:14:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 00:14:12 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200406200504.AAA16094@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.65 -> 1.66 --- Log message: Make use of BinaryOperator::create* methods to shrinkify code. --- Diffs of the changes: (+14 -21) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.65 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.66 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.65 Sat Jun 19 13:15:50 2004 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Sun Jun 20 00:04:01 2004 @@ -175,9 +175,8 @@ // Emit a bunch of add instructions for (int i = S->getNumOperands()-2; i >= 0; --i) - V = BinaryOperator::create(Instruction::Add, V, - expandInTy(S->getOperand(i), Ty), - "tmp.", InsertPt); + V = BinaryOperator::createAdd(V, expandInTy(S->getOperand(i), Ty), + "tmp.", InsertPt); return V; } @@ -187,8 +186,7 @@ const Type *Ty = S->getType(); Value *LHS = expandInTy(S->getLHS(), Ty); Value *RHS = expandInTy(S->getRHS(), Ty); - return BinaryOperator::create(Instruction::Div, LHS, RHS, "tmp.", - InsertPt); + return BinaryOperator::createDiv(LHS, RHS, "tmp.", InsertPt); } Value *visitAddRecExpr(SCEVAddRecExpr *S); @@ -211,13 +209,11 @@ // Emit a bunch of multiply instructions for (; i >= FirstOp; --i) - V = BinaryOperator::create(Instruction::Mul, V, - expandInTy(S->getOperand(i), Ty), - "tmp.", InsertPt); + V = BinaryOperator::createMul(V, expandInTy(S->getOperand(i), Ty), + "tmp.", InsertPt); // -1 * ... ---> 0 - ... if (FirstOp == 1) - V = BinaryOperator::create(Instruction::Sub, Constant::getNullValue(Ty), - V, "tmp.", InsertPt); + V = BinaryOperator::createNeg(V, "tmp.", InsertPt); return V; } @@ -236,8 +232,7 @@ Value *Rest = expandInTy(SCEVAddRecExpr::get(NewOps, L), Ty); // FIXME: look for an existing add to use. - return BinaryOperator::create(Instruction::Add, Rest, Start, "tmp.", - InsertPt); + return BinaryOperator::createAdd(Rest, Start, "tmp.", InsertPt); } // {0,+,1} --> Insert a canonical induction variable into the loop! @@ -259,9 +254,8 @@ // to the back-edge. Constant *One = Ty->isFloatingPoint() ? (Constant*)ConstantFP::get(Ty, 1.0) : ConstantInt::get(Ty, 1); - Instruction *Add = BinaryOperator::create(Instruction::Add, PN, One, - "indvar.next", - (*HPI)->getTerminator()); + Instruction *Add = BinaryOperator::createAdd(PN, One, "indvar.next", + (*HPI)->getTerminator()); pred_iterator PI = pred_begin(Header); if (*PI == L->getLoopPreheader()) @@ -275,7 +269,7 @@ if (S->getNumOperands() == 2) { // {0,+,F} --> i*F Value *F = expandInTy(S->getOperand(1), Ty); - return BinaryOperator::create(Instruction::Mul, I, F, "tmp.", InsertPt); + return BinaryOperator::createMul(I, F, "tmp.", InsertPt); } // If this is a chain of recurrences, turn it into a closed form, using the @@ -380,12 +374,11 @@ // Insert a new integer PHI node into the top of the block. PHINode *NewPhi = new PHINode(AddedVal->getType(), PN->getName()+".rec", PN); - NewPhi->addIncoming(Constant::getNullValue(NewPhi->getType()), - Preheader); + NewPhi->addIncoming(Constant::getNullValue(NewPhi->getType()), Preheader); + // Create the new add instruction. - Value *NewAdd = BinaryOperator::create(Instruction::Add, NewPhi, - AddedVal, - GEPI->getName()+".rec", GEPI); + Value *NewAdd = BinaryOperator::createAdd(NewPhi, AddedVal, + GEPI->getName()+".rec", GEPI); NewPhi->addIncoming(NewAdd, PN->getIncomingBlock(BackedgeIdx)); // Update the existing GEP to use the recurrence. From lattner at cs.uiuc.edu Sun Jun 20 01:31:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 01:31:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp Message-ID: <200406200623.BAA24901@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.18 -> 1.19 --- Log message: Do not sort SCEV objects by address: instead sort by complexity and group by address. This prevents the resultant SCEV objects from depending on where in memory other scev objects happen to live. --- Diffs of the changes: (+60 -18) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.18 llvm/lib/Analysis/ScalarEvolution.cpp:1.19 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.18 Tue Apr 27 10:12:45 2004 +++ llvm/lib/Analysis/ScalarEvolution.cpp Sun Jun 20 01:23:15 2004 @@ -107,22 +107,6 @@ //===----------------------------------------------------------------------===// // Implementation of the SCEV class. // -namespace { - /// SCEVComplexityCompare - Return true if the complexity of the LHS is less - /// than the complexity of the RHS. If the SCEVs have identical complexity, - /// order them by their addresses. This comparator is used to canonicalize - /// expressions. - struct SCEVComplexityCompare { - bool operator()(SCEV *LHS, SCEV *RHS) { - if (LHS->getSCEVType() < RHS->getSCEVType()) - return true; - if (LHS->getSCEVType() == RHS->getSCEVType()) - return LHS < RHS; - return false; - } - }; -} - SCEV::~SCEV() {} void SCEV::dump() const { print(std::cerr); @@ -339,6 +323,64 @@ WriteAsOperand(OS, V, false); } +//===----------------------------------------------------------------------===// +// SCEV Utilities +//===----------------------------------------------------------------------===// + +namespace { + /// SCEVComplexityCompare - Return true if the complexity of the LHS is less + /// than the complexity of the RHS. This comparator is used to canonicalize + /// expressions. + struct SCEVComplexityCompare { + bool operator()(SCEV *LHS, SCEV *RHS) { + return LHS->getSCEVType() < RHS->getSCEVType(); + } + }; +} + +/// GroupByComplexity - Given a list of SCEV objects, order them by their +/// complexity, and group objects of the same complexity together by value. +/// When this routine is finished, we know that any duplicates in the vector are +/// consecutive and that complexity is monotonically increasing. +/// +/// Note that we go take special precautions to ensure that we get determinstic +/// results from this routine. In other words, we don't want the results of +/// this to depend on where the addresses of various SCEV objects happened to +/// land in memory. +/// +static void GroupByComplexity(std::vector &Ops) { + if (Ops.size() < 2) return; // Noop + if (Ops.size() == 2) { + // This is the common case, which also happens to be trivially simple. + // Special case it. + if (Ops[0]->getSCEVType() > Ops[1]->getSCEVType()) + std::swap(Ops[0], Ops[1]); + return; + } + + // Do the rough sort by complexity. + std::sort(Ops.begin(), Ops.end(), SCEVComplexityCompare()); + + // Now that we are sorted by complexity, group elements of the same + // complexity. Note that this is, at worst, N^2, but the vector is likely to + // be extremely short in practice. Note that we take this approach because we + // do not want to depend on the addresses of the objects we are grouping. + for (unsigned i = 0, e = Ops.size(); i != e-1; ++i) { + SCEV *S = Ops[i]; + unsigned Complexity = S->getSCEVType(); + + // If there are any objects of the same complexity and same value as this + // one, group them. + for (unsigned j = i+1; j != e && Ops[j]->getSCEVType() == Complexity; ++j) { + if (Ops[j] == S) { // Found a duplicate. + // Move it to immediately after i'th element. + std::swap(Ops[i+1], Ops[j]); + ++i; // no need to rescan it. + } + } + } +} + //===----------------------------------------------------------------------===// @@ -509,7 +551,7 @@ if (Ops.size() == 1) return Ops[0]; // Sort by complexity, this groups all similar expression types together. - std::sort(Ops.begin(), Ops.end(), SCEVComplexityCompare()); + GroupByComplexity(Ops); // If there are any constants, fold them together. unsigned Idx = 0; @@ -737,7 +779,7 @@ assert(!Ops.empty() && "Cannot get empty mul!"); // Sort by complexity, this groups all similar expression types together. - std::sort(Ops.begin(), Ops.end(), SCEVComplexityCompare()); + GroupByComplexity(Ops); // If there are any constants, fold them together. unsigned Idx = 0; From lattner at cs.uiuc.edu Sun Jun 20 02:48:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:48:01 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/IntrinsicLowering.h Message-ID: <200406200740.CAA17943@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: IntrinsicLowering.h updated: 1.5 -> 1.6 --- Log message: Start moving IntrinsicLowering out of VMCore into libcodegen, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+8 -8) Index: llvm/include/llvm/CodeGen/IntrinsicLowering.h diff -u llvm/include/llvm/CodeGen/IntrinsicLowering.h:1.5 llvm/include/llvm/CodeGen/IntrinsicLowering.h:1.6 --- llvm/include/llvm/CodeGen/IntrinsicLowering.h:1.5 Sat May 8 23:29:49 2004 +++ llvm/include/llvm/CodeGen/IntrinsicLowering.h Sun Jun 20 02:40:46 2004 @@ -1,4 +1,4 @@ -//===-- llvm/IntrinsicLowering.h - Intrinsic Function Lowering --*- C++ -*-===// +//===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -9,15 +9,15 @@ // // This file defines the IntrinsicLowering interface. This interface allows // addition of domain-specific or front-end specific intrinsics to LLVM without -// having to modify all of the target-machines to support the new intrinsic. -// Later, as desired, code generators can incrementally add support for -// particular intrinsic functions, as desired, to generate better code. +// having to modify all of the code generators to support the new intrinsic. +// Later, as desired, targets can incrementally add support for particular +// intrinsic functions, as desired, to generate better code. // // If a code generator cannot handle or does not know about an intrinsic // function, it will use the intrinsic lowering interface to change an intrinsic // function name into a concrete function name which can be used to implement -// the functionality of the intrinsic. For example, llvm.acos can be -// implemented as a call to the math library 'acos' function if the target +// the functionality of the intrinsic. For example, llvm.memcpy can be +// implemented as a call to the math library 'memcpy' function if the target // doesn't have hardware support for the intrinsic, or if it has not yet been // implemented yet. // @@ -30,8 +30,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_INTRINSICLOWERING_H -#define LLVM_INTRINSICLOWERING_H +#ifndef LLVM_CODEGEN_INTRINSICLOWERING_H +#define LLVM_CODEGEN_INTRINSICLOWERING_H #include "llvm/Intrinsics.h" From lattner at cs.uiuc.edu Sun Jun 20 02:54:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:54:01 2004 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200406200746.CAA19438@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.51 -> 1.52 --- Log message: Move the IntrinsicLowering header into the CodeGen directory --- Diffs of the changes: (+1 -1) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.51 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.52 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.51 Thu Jun 17 13:18:28 2004 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Sun Jun 20 02:46:18 2004 @@ -17,9 +17,9 @@ #include "JIT/JIT.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/Target/TargetData.h" From lattner at cs.uiuc.edu Sun Jun 20 02:54:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:54:06 2004 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Interpreter.cpp Message-ID: <200406200746.CAA19429@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.128 -> 1.129 Interpreter.cpp updated: 1.21 -> 1.22 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+2 -2) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.128 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.129 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.128 Thu Jun 17 13:18:30 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Sun Jun 20 02:46:33 2004 @@ -16,7 +16,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" -#include "llvm/IntrinsicLowering.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "Support/Statistic.h" #include "Support/Debug.h" Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.21 llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.22 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.21 Sun Feb 8 22:13:51 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp Sun Jun 20 02:46:33 2004 @@ -14,7 +14,7 @@ //===----------------------------------------------------------------------===// #include "Interpreter.h" -#include "llvm/IntrinsicLowering.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" using namespace llvm; From lattner at cs.uiuc.edu Sun Jun 20 02:55:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:55:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp X86SimpInstrSelector.cpp Message-ID: <200406200748.CAA19486@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.267 -> 1.268 X86SimpInstrSelector.cpp updated: 1.4 -> 1.5 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+4 -3) Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.267 llvm/lib/Target/X86/InstSelectSimple.cpp:1.268 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.267 Thu Jun 17 19:50:37 2004 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sun Jun 20 02:47:25 2004 @@ -18,8 +18,8 @@ #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/Pass.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" @@ -2155,7 +2155,8 @@ unsigned op1Reg = getReg(Op1, MBB, IP); unsigned Tmp = makeAnotherReg(Op0->getType()); BuildMI(*MBB, IP, NEGTab[Class], 1, Tmp).addReg(op1Reg); - BuildMI(*MBB, IP, ADDRITab[Class], 2, DestReg).addReg(Tmp).addImm(CI->getRawValue()); + BuildMI(*MBB, IP, ADDRITab[Class], 2, + DestReg).addReg(Tmp).addImm(CI->getRawValue()); return; } } Index: llvm/lib/Target/X86/X86SimpInstrSelector.cpp diff -u llvm/lib/Target/X86/X86SimpInstrSelector.cpp:1.4 llvm/lib/Target/X86/X86SimpInstrSelector.cpp:1.5 --- llvm/lib/Target/X86/X86SimpInstrSelector.cpp:1.4 Thu Jun 17 13:17:25 2004 +++ llvm/lib/Target/X86/X86SimpInstrSelector.cpp Sun Jun 20 02:47:25 2004 @@ -18,8 +18,8 @@ #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/Pass.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" From lattner at cs.uiuc.edu Sun Jun 20 02:55:07 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:55:07 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp Message-ID: <200406200747.CAA19467@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/InstrSelection: InstrSelection.cpp updated: 1.79 -> 1.80 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp diff -u llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp:1.79 llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp:1.80 --- llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp:1.79 Tue Jun 8 13:52:46 2004 +++ llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp Sun Jun 20 02:47:36 2004 @@ -16,11 +16,11 @@ #include "llvm/CodeGen/InstrSelection.h" #include "llvm/Function.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/Pass.h" #include "llvm/CodeGen/InstrForest.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/Target/TargetMachine.h" From lattner at cs.uiuc.edu Sun Jun 20 02:55:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:55:12 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Message-ID: <200406200747.CAA19460@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9TargetMachine.cpp updated: 1.114 -> 1.115 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp diff -u llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.114 llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.115 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.114 Mon Jun 14 00:05:45 2004 +++ llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Sun Jun 20 02:47:30 2004 @@ -14,11 +14,11 @@ //===----------------------------------------------------------------------===// #include "llvm/Function.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/PassManager.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/CodeGen/InstrSelection.h" #include "llvm/CodeGen/InstrScheduling.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionInfo.h" #include "llvm/CodeGen/MachineCodeForInstruction.h" From lattner at cs.uiuc.edu Sun Jun 20 02:56:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:56:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp Message-ID: <200406200748.CAA19477@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.25 -> 1.26 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.25 llvm/lib/Target/TargetMachine.cpp:1.26 --- llvm/lib/Target/TargetMachine.cpp:1.25 Wed Jun 2 00:55:48 2004 +++ llvm/lib/Target/TargetMachine.cpp Sun Jun 20 02:47:20 2004 @@ -13,7 +13,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Type.h" -#include "llvm/IntrinsicLowering.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "Support/CommandLine.h" using namespace llvm; From lattner at cs.uiuc.edu Sun Jun 20 02:56:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:56:08 2004 Subject: [llvm-commits] CVS: llvm/utils/TableGen/SimpleInstrSelEmitter.cpp Message-ID: <200406200749.CAA20445@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: SimpleInstrSelEmitter.cpp updated: 1.2 -> 1.3 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/utils/TableGen/SimpleInstrSelEmitter.cpp diff -u llvm/utils/TableGen/SimpleInstrSelEmitter.cpp:1.2 llvm/utils/TableGen/SimpleInstrSelEmitter.cpp:1.3 --- llvm/utils/TableGen/SimpleInstrSelEmitter.cpp:1.2 Thu May 27 00:36:52 2004 +++ llvm/utils/TableGen/SimpleInstrSelEmitter.cpp Sun Jun 20 02:48:58 2004 @@ -51,8 +51,8 @@ // OS << "#include \"llvm/DerivedTypes.h\"\n"; // OS << "#include \"llvm/Function.h\"\n"; // OS << "#include \"llvm/Instructions.h\"\n"; -// OS << "#include \"llvm/IntrinsicLowering.h\"\n"; // OS << "#include \"llvm/Pass.h\"\n"; +// OS << "#include \"llvm/CodeGen/IntrinsicLowering.h\"\n"; // OS << "#include \"llvm/CodeGen/MachineConstantPool.h\"\n"; // OS << "#include \"llvm/CodeGen/MachineFrameInfo.h\"\n"; // OS << "#include \"llvm/CodeGen/MachineFunction.h\"\n"; From lattner at cs.uiuc.edu Sun Jun 20 02:56:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:56:14 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/IntrinsicLowering.cpp Message-ID: <200406200748.CAA19524@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: IntrinsicLowering.cpp updated: 1.18 -> 1.19 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/lib/VMCore/IntrinsicLowering.cpp diff -u llvm/lib/VMCore/IntrinsicLowering.cpp:1.18 llvm/lib/VMCore/IntrinsicLowering.cpp:1.19 --- llvm/lib/VMCore/IntrinsicLowering.cpp:1.18 Tue Jun 15 16:42:23 2004 +++ llvm/lib/VMCore/IntrinsicLowering.cpp Sun Jun 20 02:48:49 2004 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IntrinsicLowering.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" From lattner at cs.uiuc.edu Sun Jun 20 02:56:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:56:21 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200406200748.CAA19504@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.182 -> 1.183 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.182 llvm/lib/Target/CBackend/Writer.cpp:1.183 --- llvm/lib/Target/CBackend/Writer.cpp:1.182 Thu Jun 17 13:17:37 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Sun Jun 20 02:48:07 2004 @@ -22,10 +22,10 @@ #include "llvm/PassManager.h" #include "llvm/SymbolTable.h" #include "llvm/Intrinsics.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/Analysis/ConstantsScanner.h" #include "llvm/Analysis/FindUsedTypes.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" From lattner at cs.uiuc.edu Sun Jun 20 02:57:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:57:00 2004 Subject: [llvm-commits] CVS: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp Message-ID: <200406200749.CAA20005@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: UnixLocalInferiorProcess.cpp updated: 1.3 -> 1.4 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+1 -1) Index: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp diff -u llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.3 llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.4 --- llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.3 Wed Jan 14 15:18:03 2004 +++ llvm/lib/Debugger/UnixLocalInferiorProcess.cpp Sun Jun 20 02:48:54 2004 @@ -24,12 +24,12 @@ //===----------------------------------------------------------------------===// #include "llvm/Debugger/InferiorProcess.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/Constant.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/Type.h" #include "llvm/iOther.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "Support/FileUtilities.h" From lattner at cs.uiuc.edu Sun Jun 20 02:57:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:57:05 2004 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200406200750.CAA21011@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.56 -> 1.57 --- Log message: Move the IntrinsicLowering header into the CodeGen directory, as per PR346: http://llvm.cs.uiuc.edu/PR346 --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.56 llvm/lib/Target/X86/X86TargetMachine.cpp:1.57 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.56 Thu Jun 10 01:19:13 2004 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Sun Jun 20 02:49:54 2004 @@ -13,12 +13,12 @@ #include "X86TargetMachine.h" #include "X86.h" -#include "llvm/IntrinsicLowering.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Target/TargetMachineImpls.h" +#include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/Passes.h" +#include "llvm/Target/TargetMachineImpls.h" #include "llvm/Transforms/Scalar.h" #include "Support/CommandLine.h" #include "Support/Statistic.h" From lattner at cs.uiuc.edu Sun Jun 20 02:58:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 02:58:01 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicLowering.h Message-ID: <200406200750.CAA21842@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicLowering.h (r1.5) removed --- Log message: Header moved into the CodeGen directory --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sun Jun 20 03:01:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 03:01:01 2004 Subject: [llvm-commits] CVS: llvm/docs/ExtendingLLVM.html Message-ID: <200406200753.CAA25003@zion.cs.uiuc.edu> Changes in directory llvm/docs: ExtendingLLVM.html updated: 1.6 -> 1.7 --- Log message: Update path --- Diffs of the changes: (+3 -3) Index: llvm/docs/ExtendingLLVM.html diff -u llvm/docs/ExtendingLLVM.html:1.6 llvm/docs/ExtendingLLVM.html:1.7 --- llvm/docs/ExtendingLLVM.html:1.6 Sun May 23 16:07:26 2004 +++ llvm/docs/ExtendingLLVM.html Sun Jun 20 02:53:22 2004 @@ -90,7 +90,7 @@
  • llvm/include/llvm/Intrinsics.h: add an enum in the llvm::Intrinsic namespace
  • -
  • llvm/lib/VMCore/IntrinsicLowering.cpp: +
  • llvm/lib/CodeGen/IntrinsicLowering.cpp: implement the lowering for this intrinsic
  • llvm/lib/VMCore/Verifier.cpp: @@ -101,7 +101,7 @@ that you added.
  • llvm/lib/Analysis/BasicAliasAnalysis.cpp: If the new intrinsic does - not access memory, or does not write to memory, add it to the relevant list + not access memory or does not write to memory, add it to the relevant list of functions.
  • llvm/lib/Transforms/Utils/Local.cpp: If it is possible to constant @@ -231,7 +231,7 @@ Misha Brukman
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/05/23 21:07:26 $ + Last modified: $Date: 2004/06/20 07:53:22 $ From lattner at cs.uiuc.edu Sun Jun 20 03:07:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 03:07:01 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/IntrinsicLowering.cpp Message-ID: <200406200759.CAA27370@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: IntrinsicLowering.cpp (r1.19) removed --- Log message: IntrinsicLowering.cpp now lives in lib/CodeGen/ --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sun Jun 20 12:09:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 12:09:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp Message-ID: <200406201701.MAA12764@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.19 -> 1.20 --- Log message: Fix a bug in my change last night that caused a few test failures. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.19 llvm/lib/Analysis/ScalarEvolution.cpp:1.20 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.19 Sun Jun 20 01:23:15 2004 +++ llvm/lib/Analysis/ScalarEvolution.cpp Sun Jun 20 12:01:44 2004 @@ -365,7 +365,7 @@ // complexity. Note that this is, at worst, N^2, but the vector is likely to // be extremely short in practice. Note that we take this approach because we // do not want to depend on the addresses of the objects we are grouping. - for (unsigned i = 0, e = Ops.size(); i != e-1; ++i) { + for (unsigned i = 0, e = Ops.size(); i != e-2; ++i) { SCEV *S = Ops[i]; unsigned Complexity = S->getSCEVType(); From lattner at cs.uiuc.edu Sun Jun 20 12:37:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 12:37:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT95/099.go/Makefile Message-ID: <200406201729.MAA16237@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT95/099.go: Makefile updated: 1.2 -> 1.3 --- Log message: go REQUIRES 2 integer arguments, otherwise it does bad stuff. This is how it is supposed to be run in the train mode anyway, and fixes the crash the JIT has been seeing since forever (and makes other runtimes take more than 0.004s). --- Diffs of the changes: (+1 -0) Index: llvm/test/Programs/External/SPEC/CINT95/099.go/Makefile diff -u llvm/test/Programs/External/SPEC/CINT95/099.go/Makefile:1.2 llvm/test/Programs/External/SPEC/CINT95/099.go/Makefile:1.3 --- llvm/test/Programs/External/SPEC/CINT95/099.go/Makefile:1.2 Mon Mar 1 09:57:28 2004 +++ llvm/test/Programs/External/SPEC/CINT95/099.go/Makefile Sun Jun 20 12:29:30 2004 @@ -8,5 +8,6 @@ else STDIN_FILENAME = 2stone9.in STDOUT_FILENAME = 2stone9.out +RUN_OPTIONS = 50 9 endif include ../../Makefile.spec95 From lattner at cs.uiuc.edu Sun Jun 20 13:50:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 13:50:43 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2004-06-20-StaticBitfieldInit.c Message-ID: <200406201831.NAA04700@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/UnitTests: 2004-06-20-StaticBitfieldInit.c added (r1.1) --- Log message: New self contained testcase for PR377: http://llvm.cs.uiuc.edu/PR377 --- Diffs of the changes: (+13 -0) Index: llvm/test/Programs/SingleSource/UnitTests/2004-06-20-StaticBitfieldInit.c diff -c /dev/null llvm/test/Programs/SingleSource/UnitTests/2004-06-20-StaticBitfieldInit.c:1.1 *** /dev/null Sun Jun 20 13:31:29 2004 --- llvm/test/Programs/SingleSource/UnitTests/2004-06-20-StaticBitfieldInit.c Sun Jun 20 13:31:19 2004 *************** *** 0 **** --- 1,13 ---- + #include + + struct T { + unsigned X : 5; + unsigned Y : 6; + unsigned Z : 5; + }; + + struct T GV = { 1, 5, 1 }; + + int main() { + printf("%d %d %d\n", GV.X, GV.Y, GV.Z); + } From lattner at cs.uiuc.edu Sun Jun 20 14:08:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 14:08:03 2004 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200406201900.OAA05529@zion.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.44 -> 1.45 --- Log message: Fix PR377: http://llvm.cs.uiuc.edu/PR377 : [llvmgcc] miscompilation of staticly initialized unsigned bitfields There were two bugs in this code. First, llvm_type_get_size returns #bytes, not #bits. Second, we must use 1LL instead of 1 or else all bits get shifted out. Testcase here: SingleSource/UnitTests/2004-06-20-StaticBitfieldInit.c --- Diffs of the changes: (+3 -3) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.44 llvm-gcc/gcc/llvm-expand.c:1.45 --- llvm-gcc/gcc/llvm-expand.c:1.44 Fri Jun 18 22:35:20 2004 +++ llvm-gcc/gcc/llvm-expand.c Sun Jun 20 13:59:59 2004 @@ -3814,8 +3814,8 @@ /* If there is already a value set for this field, mask out any bits * that are part of the current field (in case the current field is - * multiply initialized to different values). The LLVM stuff should - * constant propagate these operations. + * multiply initialized to different values). LLVM will constant fold + * all of the constant expressions generated. */ if (Result[FieldIndexVal]) { long long MaskVal = ~(((1 << FieldSize)-1) << FieldOffset); @@ -3825,7 +3825,7 @@ /* If this is an unsigned type, mask off bits outside the range of the data type in question... */ if (!llvm_type_is_signed(FieldType)) - MaskVal &= (1 << llvm_type_get_size(FieldType))-1; + MaskVal &= (1LL << (llvm_type_get_size(FieldType)*8))-1; Mask = llvm_constant_new_integral(FieldType, MaskVal); Result[FieldIndexVal] = From lattner at cs.uiuc.edu Sun Jun 20 14:16:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 14:16:00 2004 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200406201909.OAA07324@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.204 -> 1.205 --- Log message: Bug fixed --- Diffs of the changes: (+2 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.204 llvm/docs/ReleaseNotes.html:1.205 --- llvm/docs/ReleaseNotes.html:1.204 Sat Jun 19 13:24:05 2004 +++ llvm/docs/ReleaseNotes.html Sun Jun 20 14:08:50 2004 @@ -278,6 +278,7 @@

    Bugs in the C/C++ front-end:

      +
    1. [llvmgcc] miscompilation of staticly initialized unsigned bitfields
    2. [llvmgcc] Crash on use of undeclared enum type
    3. [llvmgcc] Variable length array @@ -732,7 +733,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/06/19 18:24:05 $ + Last modified: $Date: 2004/06/20 19:08:50 $ From lattner at cs.uiuc.edu Sun Jun 20 14:17:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 14:17:01 2004 Subject: [llvm-commits] CVS: llvm-www/releases/1.2/docs/ReleaseNotes.html Message-ID: <200406201909.OAA08020@zion.cs.uiuc.edu> Changes in directory llvm-www/releases/1.2/docs: ReleaseNotes.html updated: 1.21 -> 1.22 --- Log message: Bug found --- Diffs of the changes: (+2 -1) Index: llvm-www/releases/1.2/docs/ReleaseNotes.html diff -u llvm-www/releases/1.2/docs/ReleaseNotes.html:1.21 llvm-www/releases/1.2/docs/ReleaseNotes.html:1.22 --- llvm-www/releases/1.2/docs/ReleaseNotes.html:1.21 Fri Jun 18 20:11:53 2004 +++ llvm-www/releases/1.2/docs/ReleaseNotes.html Sun Jun 20 14:09:20 2004 @@ -391,6 +391,7 @@ Bugs in 1.2 fixed in 1.3:
        +
      • [llvmgcc] miscompilation of staticly initialized unsigned bitfields
      • [llvmgcc] Crash on use of undeclared enum type
      • [llvmgcc] Variable length array indexing miscompiled
      • [llvmgcc] Errors handling function prototypes that take opaque structs by-value
      • @@ -688,7 +689,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/06/19 01:11:53 $ + Last modified: $Date: 2004/06/20 19:09:20 $ From llvm at cs.uiuc.edu Sun Jun 20 14:29:11 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun Jun 20 14:29:11 2004 Subject: [llvm-commits] CVS: llvm/docs/TestingGuide.html Message-ID: <200406201921.OAA08552@zion.cs.uiuc.edu> Changes in directory llvm/docs: TestingGuide.html updated: 1.8 -> 1.9 --- Log message: Added a note about requiring QMTest 2.0.3 instead of any other version. --- Diffs of the changes: (+4 -2) Index: llvm/docs/TestingGuide.html diff -u llvm/docs/TestingGuide.html:1.8 llvm/docs/TestingGuide.html:1.9 --- llvm/docs/TestingGuide.html:1.8 Sun May 23 16:07:27 2004 +++ llvm/docs/TestingGuide.html Sun Jun 20 14:21:11 2004 @@ -53,7 +53,9 @@
        QMTest
        -
        The LLVM test suite uses QMTest to organize and run tests.
        +
        The LLVM test suite uses QMTest to organize and run tests. Note: + you will need QMTest 2.0.3 to be successful. The tests do not run with + any other version.
        Python
        You will need a Python interpreter that works with QMTest. Python will @@ -379,7 +381,7 @@ John T. Criswell
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/05/23 21:07:27 $ + Last modified: $Date: 2004/06/20 19:21:11 $ From lattner at cs.uiuc.edu Sun Jun 20 15:40:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 15:40:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp Message-ID: <200406202032.PAA16312@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.20 -> 1.21 --- Log message: REALLY fix PR378: http://llvm.cs.uiuc.edu/PR378 : crash in scalar evolution analysis --- Diffs of the changes: (+1 -0) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.20 llvm/lib/Analysis/ScalarEvolution.cpp:1.21 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.20 Sun Jun 20 12:01:44 2004 +++ llvm/lib/Analysis/ScalarEvolution.cpp Sun Jun 20 15:32:16 2004 @@ -376,6 +376,7 @@ // Move it to immediately after i'th element. std::swap(Ops[i+1], Ops[j]); ++i; // no need to rescan it. + if (i == e-2) return; // Done! } } } From lattner at cs.uiuc.edu Sun Jun 20 19:16:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 20 19:16:00 2004 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Message-ID: <200406210008.TAA01412@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.6 -> 1.7 --- Log message: Make order of argument addition deterministic. In particular, the layout of ConstantInt objects in memory used to determine which order arguments were added in in some cases. --- Diffs of the changes: (+35 -10) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.6 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.7 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.6 Sun May 23 16:21:17 2004 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Sun Jun 20 19:07:58 2004 @@ -185,7 +185,7 @@ // We can only promote this argument if all of the uses are loads, or are GEP // instructions (with constant indices) that are subsequently loaded. std::vector Loads; - std::vector > GEPIndices; + std::vector > GEPIndices; for (Value::use_iterator UI = Arg->use_begin(), E = Arg->use_end(); UI != E; ++UI) if (LoadInst *LI = dyn_cast(*UI)) { @@ -200,9 +200,9 @@ return isSafeToPromoteArgument(Arg); } // Ensure that all of the indices are constants. - std::vector Operands; + std::vector Operands; for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i) - if (Constant *C = dyn_cast(GEP->getOperand(i))) + if (ConstantInt *C = dyn_cast(GEP->getOperand(i))) Operands.push_back(C); else return false; // Not a constant operand GEP! @@ -279,6 +279,29 @@ return true; } +namespace { + /// GEPIdxComparator - Provide a strong ordering for GEP indices. All Value* + /// elements are instances of ConstantInt. + /// + struct GEPIdxComparator { + bool operator()(const std::vector &LHS, + const std::vector &RHS) const { + unsigned idx = 0; + for (; idx < LHS.size() && idx < RHS.size(); ++idx) { + if (LHS[idx] != RHS[idx]) { + return cast(LHS[idx])->getRawValue() < + cast(RHS[idx])->getRawValue(); + } + } + + // Return less than if we ran out of stuff in LHS and we didn't run out of + // stuff in RHS. + return idx == LHS.size() && idx != RHS.size(); + } + }; +} + + /// DoPromotion - This method actually performs the promotion of the specified /// arguments. At this point, we know that it's safe to do so. void ArgPromotion::DoPromotion(Function *F, std::vector &Args2Prom) { @@ -289,6 +312,8 @@ const FunctionType *FTy = F->getFunctionType(); std::vector Params; + typedef std::set, GEPIdxComparator> ScalarizeTable; + // ScalarizedElements - If we are promoting a pointer that has elements // accessed out of it, keep track of which elements are accessed so that we // can add one argument for each. @@ -296,7 +321,7 @@ // Arguments that are directly loaded will have a zero element value here, to // handle cases where there are both a direct load and GEP accesses. // - std::map > > ScalarizedElements; + std::map ScalarizedElements; // OriginalLoads - Keep track of a representative load instruction from the // original function so that we can tell the alias analysis implementation @@ -311,7 +336,7 @@ } else { // Okay, this is being promoted. Check to see if there are any GEP uses // of the argument. - std::set > &ArgIndices = ScalarizedElements[I]; + ScalarizeTable &ArgIndices = ScalarizedElements[I]; for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { Instruction *User = cast(*UI); @@ -327,7 +352,7 @@ } // Add a parameter to the function for each element passed in. - for (std::set >::iterator SI = ArgIndices.begin(), + for (ScalarizeTable::iterator SI = ArgIndices.begin(), E = ArgIndices.end(); SI != E; ++SI) Params.push_back(GetElementPtrInst::getIndexedType(I->getType(), *SI)); @@ -377,8 +402,8 @@ Args.push_back(*AI); // Unmodified argument else if (!I->use_empty()) { // Non-dead argument: insert GEPs and loads as appropriate. - std::set > &ArgIndices = ScalarizedElements[I]; - for (std::set >::iterator SI = ArgIndices.begin(), + ScalarizeTable &ArgIndices = ScalarizedElements[I]; + for (ScalarizeTable::iterator SI = ArgIndices.begin(), E = ArgIndices.end(); SI != E; ++SI) { Value *V = *AI; LoadInst *OrigLoad = OriginalLoads[*SI]; @@ -446,7 +471,7 @@ // Otherwise, if we promoted this argument, then all users are load // instructions, and all loads should be using the new argument that we // added. - std::set > &ArgIndices = ScalarizedElements[I]; + ScalarizeTable &ArgIndices = ScalarizedElements[I]; while (!I->use_empty()) { if (LoadInst *LI = dyn_cast(I->use_back())) { @@ -464,7 +489,7 @@ unsigned ArgNo = 0; Function::aiterator TheArg = I2; - for (std::set >::iterator It = ArgIndices.begin(); + for (ScalarizeTable::iterator It = ArgIndices.begin(); *It != Operands; ++It, ++TheArg) { assert(It != ArgIndices.end() && "GEP not handled??"); }