From lattner at cs.uiuc.edu Mon Jun 16 07:00:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:00:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/GCSE/RLE-Preserve.ll Message-ID: <200306161159.GAA11550@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/GCSE: RLE-Preserve.ll updated: 1.2 -> 1.3 --- Log message: Fix testcase to work with store forwarding --- Diffs of the changes: Index: llvm/test/Regression/Transforms/GCSE/RLE-Preserve.ll diff -u llvm/test/Regression/Transforms/GCSE/RLE-Preserve.ll:1.2 llvm/test/Regression/Transforms/GCSE/RLE-Preserve.ll:1.3 --- llvm/test/Regression/Transforms/GCSE/RLE-Preserve.ll:1.2 Fri Aug 30 15:18:09 2002 +++ llvm/test/Regression/Transforms/GCSE/RLE-Preserve.ll Mon Jun 16 06:59:34 2003 @@ -1,27 +1,24 @@ ; This testcase ensures that redundant loads are preserved when they are not ; allowed to be eliminated. -; RUN: as < %s | dis > Output/%s.before -; RUN: as < %s | opt -load-vn -gcse | dis > Output/%s.after -; RUN: echo some output -; RUN: diff Output/%s.before Output/%s.after +; RUN: as < %s | opt -load-vn -gcse | dis | grep sub ; -int "test1"(int* %P) { +int %test1(int* %P) { %A = load int* %P - store int 1, int * %P + store int 1, int* %P %B = load int* %P - %C = add int %A, %B + %C = sub int %A, %B ret int %C } -int "test2"(int* %P) { +int %test2(int* %P) { %A = load int* %P br label %BB2 BB2: - store int 5, int * %P + store int 5, int* %P br label %BB3 BB3: %B = load int* %P - %C = add int %A, %B + %C = sub int %A, %B ret int %C } From lattner at cs.uiuc.edu Mon Jun 16 07:01:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:01:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile Message-ID: <200306161200.HAA11585@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/186.crafty: Makefile updated: 1.2 -> 1.3 --- Log message: Use an explicit source file list to avoid picking up extra stuff --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile:1.2 llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile:1.3 --- llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile:1.2 Sat May 31 18:17:17 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile Mon Jun 16 07:00:46 2003 @@ -3,4 +3,6 @@ STDIN_FILENAME = crafty.in STDOUT_FILENAME = crafty.out CPPFLAGS = -DSPEC_CPU2000 -DLINUX_i386 +Source := attacks.c draw.c enprise.c init.c iterate.c make.c nexte.c output.c preeval.c resign.c searchr.c swap.c utility.c boolean.c drawn.c evaluate.c input.c lookup.c movgen.c nextr.c phase.c quiesce.c root.c setboard.c time.c validate.c edit.c history.c interupt.c main.c next.c option.c ponder.c repeat.c search.c store.c unmake.c valid.c + include ../../Makefile.spec From lattner at cs.uiuc.edu Mon Jun 16 07:02:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:02:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile Message-ID: <200306161201.HAA11617@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/300.twolf: Makefile updated: 1.1 -> 1.2 --- Log message: Fix bug in runargs --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile:1.1 llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile:1.2 --- llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile:1.1 Thu May 22 12:29:25 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile Mon Jun 16 07:01:12 2003 @@ -1,6 +1,6 @@ LEVEL = ../../../../../.. LDFLAGS = -lm -RUN_OPTIONS = test.net +RUN_OPTIONS = test STDOUT_FILENAME := test.net.stdout include ../../Makefile.spec From lattner at cs.uiuc.edu Mon Jun 16 07:04:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:04:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegInfo.cpp Message-ID: <200306161203.HAA11651@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcRegInfo.cpp updated: 1.98 -> 1.99 --- Log message: Fix invalid number of arguments problem --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcRegInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.98 llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.99 --- llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.98 Fri Jun 6 04:52:23 2003 +++ llvm/lib/Target/Sparc/SparcRegInfo.cpp Mon Jun 16 07:03:00 2003 @@ -1086,7 +1086,7 @@ // Use DestReg+1 to get the name "%ccr" instead of "%xcc" for WRCCR assert(getRegType(SrcReg) == IntRegType && "Can only copy CC reg to/from integer reg"); - MI = BuildMI(V9::WRCCRr, 2).addMReg(SrcReg) + MI = BuildMI(V9::WRCCRr, 3).addMReg(SrcReg) .addMReg(SparcIntRegClass::g0).addMReg(DestReg+1, MOTy::Def); } break; @@ -1214,7 +1214,7 @@ cpMem2RegMI(mvec, SrcPtrReg, Offset, scratchReg, IntRegType); // Use DestReg+1 to get the name "%ccr" instead of "%xcc" for WRCCR - MI = BuildMI(V9::WRCCRr, 2).addMReg(scratchReg) + MI = BuildMI(V9::WRCCRr, 3).addMReg(scratchReg) .addMReg(SparcIntRegClass::g0).addMReg(DestReg+1,MOTy::Def); break; From lattner at cs.uiuc.edu Mon Jun 16 07:05:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:05:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadArgElim/ Message-ID: <200306161204.HAA11683@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadArgElim: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Regression/Transforms/DeadArgElim added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Mon Jun 16 07:06:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:06:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll Message-ID: <200306161205.HAA11779@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DSAnalysis: physicalsubtype.ll added (r1.1) --- Log message: New testcases for bugs and the new DAE pass --- Diffs of the changes: Index: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll diff -c /dev/null llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,14 ---- + ; A test for "physical subtyping" used in some C programs... + ; + %ST = type { int, int* } ; "Subtype" + %DT = type { int, int*, int } ; "derived type" + + int %test(%DT* %DT) { + %DTp = getelementptr %DT* %DT, long 0, ubyte 0 + %A = load int* %DTp + %ST = cast %DT* %DT to %ST* + %STp = getelementptr %ST* %ST, long 0, ubyte 0 + %B = load int* %STp + %C = sub int %A, %B ; A & B are equal, %C = 0 + ret int %C + } From lattner at cs.uiuc.edu Mon Jun 16 07:06:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:06:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/CBackend/2003-06-11-HexConstant.ll 2003-06-11-LiteralStringProblem.ll Message-ID: <200306161205.HAA11765@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CBackend: 2003-06-11-HexConstant.ll added (r1.1) 2003-06-11-LiteralStringProblem.ll added (r1.1) --- Log message: New testcases for bugs and the new DAE pass --- Diffs of the changes: Index: llvm/test/Regression/CBackend/2003-06-11-HexConstant.ll diff -c /dev/null llvm/test/Regression/CBackend/2003-06-11-HexConstant.ll:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/CBackend/2003-06-11-HexConstant.ll Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,3 ---- + ; Make sure hex constant does not continue into a valid hexadecimal letter/number + %version = global [3 x sbyte] c"\001\00" + Index: llvm/test/Regression/CBackend/2003-06-11-LiteralStringProblem.ll diff -c /dev/null llvm/test/Regression/CBackend/2003-06-11-LiteralStringProblem.ll:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/CBackend/2003-06-11-LiteralStringProblem.ll Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,3 ---- + + %version = global [3 x sbyte] c"1\00\00" + From lattner at cs.uiuc.edu Mon Jun 16 07:06:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:06:04 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp 2003-06-08-VirtualFunctions.cpp 2003-06-13-Crasher.cpp Message-ID: <200306161205.HAA11756@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-08-BaseType.cpp added (r1.1) 2003-06-08-VirtualFunctions.cpp added (r1.1) 2003-06-13-Crasher.cpp added (r1.1) --- Log message: New testcases for bugs and the new DAE pass --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,17 ---- + + + struct foo { + int y; + foo(); + }; + + struct bar : public foo { + //int x; + bar(); + }; + + //int bar::X() { return 0; } + + bar::bar() { + + } Index: llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,23 ---- + + + struct foo { + int y; + foo(); + virtual int T() = 0; + }; + + struct bar : public foo { + //int x; + bar(); + int T() {} + }; + + //int bar::X() { return 0; } + + foo::foo() : y(4) { + + } + + bar::bar() { + + } Index: llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,8 ---- + void bar(); + + void foo() { + struct TEST { + ~TEST() { bar(); } + } TESTOBJ; + + } From lattner at cs.uiuc.edu Mon Jun 16 07:06:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:06:05 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ADCE/2003-06-11-InvalidCFG.ll Message-ID: <200306161205.HAA11772@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ADCE: 2003-06-11-InvalidCFG.ll added (r1.1) --- Log message: New testcases for bugs and the new DAE pass --- Diffs of the changes: Index: llvm/test/Regression/Transforms/ADCE/2003-06-11-InvalidCFG.ll diff -c /dev/null llvm/test/Regression/Transforms/ADCE/2003-06-11-InvalidCFG.ll:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/Transforms/ADCE/2003-06-11-InvalidCFG.ll Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,28 ---- + ; RUN: as < %s | opt -adce -disable-output + %G = external global int* + + implementation ; Functions: + + declare void %Fn(int*) + + int %main(int %argc.1, sbyte** %argv.1) { + entry: ; No predecessors! + br label %endif.42 + + endif.42: ; preds = %entry, %shortcirc_done.12, %then.66, %endif.42 + br bool false, label %endif.65, label %endif.42 + + then.66: ; preds = %shortcirc_done.12 + call void %Fn( int* %tmp.2846) + br label %endif.42 + + endif.65: ; preds = %endif.42 + %tmp.2846 = load int** %G + br bool false, label %shortcirc_next.12, label %shortcirc_done.12 + + shortcirc_next.12: ; preds = %endif.65 + br label %shortcirc_done.12 + + shortcirc_done.12: ; preds = %endif.65, %shortcirc_next.12 + br bool false, label %then.66, label %endif.42 + } From lattner at cs.uiuc.edu Mon Jun 16 07:06:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:06:06 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadArgElim/Makefile basictest.ll Message-ID: <200306161205.HAA11788@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadArgElim: Makefile added (r1.1) basictest.ll added (r1.1) --- Log message: New testcases for bugs and the new DAE pass --- Diffs of the changes: Index: llvm/test/Regression/Transforms/DeadArgElim/Makefile diff -c /dev/null llvm/test/Regression/Transforms/DeadArgElim/Makefile:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/Transforms/DeadArgElim/Makefile Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,10 ---- + + LEVEL = ../../../.. + include $(LEVEL)/test/Makefile.tests + + TESTS := $(wildcard *.ll) + + all:: $(addprefix Output/, $(TESTS:%.ll=%.ll.out)) + + Output/%.ll.out: %.ll Output/.dir $(LOPT) + -$(TESTRUNR) $< Index: llvm/test/Regression/Transforms/DeadArgElim/basictest.ll diff -c /dev/null llvm/test/Regression/Transforms/DeadArgElim/basictest.ll:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/Transforms/DeadArgElim/basictest.ll Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,27 ---- + ; RUN: if as < %s | opt -load ~/llvm/lib/Debug/libhello.so -deadargelim | dis | grep DEADARG + ; RUN: then exit 1 + ; RUN: else exit 0 + ; RUN: fi + + implementation + + ; test - an obviously dead argument + internal int %test(int %v, int %DEADARG1, int* %p) { + store int %v, int* %p + ret int %v + } + + ; hardertest - an argument which is only used by a call of a function with a + ; dead argument. + internal int %hardertest(int %DEADARG2) { + %p = alloca int + %V = call int %test(int 5, int %DEADARG2, int* %p) + ret int %V + } + + ; evenhardertest - recursive dead argument... + internal void %evenhardertest(int %DEADARG3) { + call void %evenhardertest(int %DEADARG3) + ret void + } + From lattner at cs.uiuc.edu Mon Jun 16 07:06:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:06:08 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll Message-ID: <200306161205.HAA11795@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/GCSE: 2003-06-13-LoadStoreEliminate.ll added (r1.1) --- Log message: New testcases for bugs and the new DAE pass --- Diffs of the changes: Index: llvm/test/Regression/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll diff -c /dev/null llvm/test/Regression/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll:1.1 *** /dev/null Mon Jun 16 07:05:48 2003 --- llvm/test/Regression/Transforms/GCSE/2003-06-13-LoadStoreEliminate.ll Mon Jun 16 07:05:38 2003 *************** *** 0 **** --- 1,14 ---- + ; This testcase shows a bug where an common subexpression exists, but there + ; is no shared dominator block that the expression can be hoisted out to. + ; + ; RUN: if as < %s | opt -load-vn -gcse | dis | grep load + ; RUN: then exit 1 + ; RUN: else exit 0 + ; RUN: fi + + int %test(int* %P) { + store int 5, int* %P + %Z = load int* %P + ret int %Z + } + From lattner at cs.uiuc.edu Mon Jun 16 07:07:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:07:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoadValueNumbering.cpp Message-ID: <200306161206.HAA11825@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoadValueNumbering.cpp updated: 1.2 -> 1.3 --- Log message: Implement forwarding from stores to loads of must-aliased pointers. This implements: GCSE/2003-06-13-LoadStoreEliminate.ll --- Diffs of the changes: Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.2 llvm/lib/Analysis/LoadValueNumbering.cpp:1.3 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.2 Wed Feb 26 13:27:35 2003 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Mon Jun 16 07:06:41 2003 @@ -24,7 +24,7 @@ #include namespace { - // FIXME: This should not be a functionpass. + // FIXME: This should not be a FunctionPass. struct LoadVN : public FunctionPass, public ValueNumbering { /// Pass Implementation stuff. This doesn't do any analysis. @@ -51,6 +51,8 @@ /// bool haveEqualValueNumber(LoadInst *LI, LoadInst *LI2, AliasAnalysis &AA, DominatorSet &DomSetInfo) const; + bool haveEqualValueNumber(LoadInst *LI, StoreInst *SI, AliasAnalysis &AA, + DominatorSet &DomSetInfo) const; }; // Register this pass... @@ -83,13 +85,13 @@ std::vector &RetVals) const { if (LoadInst *LI = dyn_cast(V)) { - // If we have a load instruction, find all of the load instructions that use - // the same source operand. We implement this recursively, because there - // could be a load of a load of a load that are all identical. We are - // guaranteed that this cannot be an infinite recursion because load - // instructions would have to pass through a PHI node in order for there to - // be a cycle. The PHI node would be handled by the else case here, - // breaking the infinite recursion. + // If we have a load instruction, find all of the load and store + // instructions that use the same source operand. We implement this + // recursively, because there could be a load of a load of a load that are + // all identical. We are guaranteed that this cannot be an infinite + // recursion because load instructions would have to pass through a PHI node + // in order for there to be a cycle. The PHI node would be handled by the + // else case here, breaking the infinite recursion. // std::vector PointerSources; getEqualNumberNodes(LI->getOperand(0), PointerSources); @@ -98,30 +100,40 @@ Function *F = LI->getParent()->getParent(); // Now that we know the set of equivalent source pointers for the load - // instruction, look to see if there are any load candiates that are - // identical. + // instruction, look to see if there are any load or store candiates that + // are identical. // std::vector CandidateLoads; + std::vector CandidateStores; + while (!PointerSources.empty()) { Value *Source = PointerSources.back(); PointerSources.pop_back(); // Get a source pointer... for (Value::use_iterator UI = Source->use_begin(), UE = Source->use_end(); UI != UE; ++UI) - if (LoadInst *Cand = dyn_cast(*UI)) // Is a load of source? + if (LoadInst *Cand = dyn_cast(*UI)) {// Is a load of source? if (Cand->getParent()->getParent() == F && // In the same function? Cand != LI) // Not LI itself? CandidateLoads.push_back(Cand); // Got one... + } else if (StoreInst *Cand = dyn_cast(*UI)) { + if (Cand->getParent()->getParent() == F && + Cand->getOperand(1) == Source) // It's a store THROUGH the ptr... + CandidateStores.push_back(Cand); + } } // Remove duplicates from the CandidateLoads list because alias analysis // processing may be somewhat expensive and we don't want to do more work // than neccesary. // + unsigned OldSize = CandidateLoads.size(); std::sort(CandidateLoads.begin(), CandidateLoads.end()); CandidateLoads.erase(std::unique(CandidateLoads.begin(), CandidateLoads.end()), CandidateLoads.end()); + // FIXME: REMOVE THIS SORTING AND UNIQUING IF IT CAN'T HAPPEN + assert(CandidateLoads.size() == OldSize && "Shrunk the candloads list?"); // Get Alias Analysis... AliasAnalysis &AA = getAnalysis(); @@ -133,9 +145,11 @@ for (unsigned i = 0, e = CandidateLoads.size(); i != e; ++i) if (haveEqualValueNumber(LI, CandidateLoads[i], AA, DomSetInfo)) RetVals.push_back(CandidateLoads[i]); - + for (unsigned i = 0, e = CandidateStores.size(); i != e; ++i) + if (haveEqualValueNumber(LI, CandidateStores[i], AA, DomSetInfo)) + RetVals.push_back(CandidateStores[i]->getOperand(0)); + } else { - // Make sure passmanager doesn't try to fulfill our request with ourself! assert(&getAnalysis() != (ValueNumbering*)this && "getAnalysis() returned this!"); @@ -215,7 +229,7 @@ return true; } else { // Make sure that there are no store instructions between L1 and the end of - // it's basic block... + // its basic block... // if (AA.canInstructionRangeModify(*L1, *BB1->getTerminator(), LoadAddress, LoadSize)) @@ -225,6 +239,74 @@ // and the second load instruction... // if (AA.canInstructionRangeModify(BB2->front(), *L2, LoadAddress, LoadSize)) + return false; // Cannot eliminate load + + // Do a depth first traversal of the inverse CFG starting at L2's block, + // looking for L1's block. The inverse CFG is made up of the predecessor + // nodes of a block... so all of the edges in the graph are "backward". + // + std::set VisitedSet; + for (pred_iterator PI = pred_begin(BB2), PE = pred_end(BB2); PI != PE; ++PI) + if (CheckForInvalidatingInst(*PI, BB1, LoadAddress, LoadSize, AA, + VisitedSet)) + return false; + + // If we passed all of these checks then we are sure that the two loads + // produce the same value. + return true; + } +} + + +/// haveEqualValueNumber - Given a load instruction and a store instruction, +/// determine if the stored value reaches the loaded value unambiguously on +/// every execution of the program. This uses the AliasAnalysis implementation +/// to invalidate the stored value when stores or function calls occur that +/// could modify the value produced by the load. +/// +bool LoadVN::haveEqualValueNumber(LoadInst *Load, StoreInst *Store, + AliasAnalysis &AA, + DominatorSet &DomSetInfo) const { + // If the store does not dominate the load, we cannot do anything... + if (!DomSetInfo.dominates(Store, Load)) + return false; + + BasicBlock *BB1 = Store->getParent(), *BB2 = Load->getParent(); + Value *LoadAddress = Load->getOperand(0); + + assert(LoadAddress->getType() == Store->getOperand(1)->getType() && + "How could the same source pointer return different types?"); + + // Find out how many bytes of memory are loaded by the load instruction... + unsigned LoadSize = getAnalysis().getTypeSize(Load->getType()); + + // Compute a basic block iterator pointing to the instruction after the store. + BasicBlock::iterator StoreIt = Store; ++StoreIt; + + // Check to see if the intervening instructions between the two store and load + // include a store or call... + // + if (BB1 == BB2) { // In same basic block? + // In this degenerate case, no checking of global basic blocks has to occur + // just check the instructions BETWEEN Store & Load... + // + if (AA.canInstructionRangeModify(*StoreIt, *Load, LoadAddress, LoadSize)) + return false; // Cannot eliminate load + + // No instructions invalidate the stored value, they produce the same value! + return true; + } else { + // Make sure that there are no store instructions between the Store and the + // end of its basic block... + // + if (AA.canInstructionRangeModify(*StoreIt, *BB1->getTerminator(), + LoadAddress, LoadSize)) + return false; // Cannot eliminate load + + // Make sure that there are no store instructions between the start of BB2 + // and the second load instruction... + // + if (AA.canInstructionRangeModify(BB2->front(), *Load, LoadAddress,LoadSize)) return false; // Cannot eliminate load // Do a depth first traversal of the inverse CFG starting at L2's block, From lattner at cs.uiuc.edu Mon Jun 16 07:08:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:08:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200306161207.HAA11855@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.98 -> 1.99 --- Log message: Remove bogus assertion: a node with no referrers could be collapsed if field-sensitivity was disabled --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.98 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.99 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.98 Tue May 20 13:45:31 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Mon Jun 16 07:07:39 2003 @@ -107,8 +107,6 @@ /// single byte with a single TypeEntry of "void". /// void DSNode::foldNodeCompletely() { - assert(!hasNoReferrers() && - "Why would we collapse a node with no referrers?"); if (isNodeCompletelyFolded()) return; // If this node is already folded... ++NumFolds; From lattner at cs.uiuc.edu Mon Jun 16 07:09:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:09:05 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Message-ID: <200306161208.HAA11885@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.52 -> 1.53 --- Log message: Nodes get forwarded when they are collapsed currently. --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.52 llvm/lib/Analysis/DataStructure/Local.cpp:1.53 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.52 Mon Mar 3 11:13:31 2003 +++ llvm/lib/Analysis/DataStructure/Local.cpp Mon Jun 16 07:08:18 2003 @@ -110,8 +110,11 @@ /// DSNode *createNode(DSNode::NodeTy NodeType, const Type *Ty = 0) { DSNode *N = new DSNode(NodeType, Ty, &G); // Create the node - if (DisableFieldSensitivity) + if (DisableFieldSensitivity) { N->foldNodeCompletely(); + if (DSNode *FN = N->getForwardNode()) + N = FN; + } return N; } From lattner at cs.uiuc.edu Mon Jun 16 07:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:10:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200306161209.HAA11915@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.92 -> 1.93 --- Log message: Fix bug: CBackend/2003-06-11-HexConstant.ll Fix bug: CBackend/2003-06-11-LiteralStringProblem.ll --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.92 llvm/lib/CWriter/Writer.cpp:1.93 --- llvm/lib/CWriter/Writer.cpp:1.92 Fri Jun 6 02:10:24 2003 +++ llvm/lib/CWriter/Writer.cpp Mon Jun 16 07:09:09 2003 @@ -285,24 +285,35 @@ bool isString = (ETy == Type::SByteTy || ETy == Type::UByteTy); // Make sure the last character is a null char, as automatically added by C - if (CPA->getNumOperands() == 0 || - !cast(*(CPA->op_end()-1))->isNullValue()) + if (isString && (CPA->getNumOperands() == 0 || + !cast(*(CPA->op_end()-1))->isNullValue())) isString = false; if (isString) { Out << "\""; + // Keep track of whether the last number was a hexadecimal escape + bool LastWasHex = false; + // Do not include the last character, which we know is null for (unsigned i = 0, e = CPA->getNumOperands()-1; i != e; ++i) { unsigned char C = (ETy == Type::SByteTy) ? (unsigned char)cast(CPA->getOperand(i))->getValue() : (unsigned char)cast(CPA->getOperand(i))->getValue(); - if (isprint(C)) { + // Print it out literally if it is a printable character. The only thing + // to be careful about is when the last letter output was a hex escape + // code, in which case we have to be careful not to print out hex digits + // explicitly (the C compiler things it is a continuation of the previous + // character, arg...) + // + if (isprint(C) && (!LastWasHex || !isxdigit(C))) { + LastWasHex = false; if (C == '"' || C == '\\') Out << "\\" << C; else Out << C; } else { + LastWasHex = false; switch (C) { case '\n': Out << "\\n"; break; case '\t': Out << "\\t"; break; @@ -313,8 +324,9 @@ case '\'': Out << "\\\'"; break; default: Out << "\\x"; - Out << ( C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A'); - Out << ((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A'); + Out << (char)(( C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A')); + Out << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A')); + LastWasHex = true; break; } } From lattner at cs.uiuc.edu Mon Jun 16 07:11:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:11:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200306161210.HAA11949@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.53 -> 1.54 --- Log message: Fix bug: ADCE/2003-06-11-InvalidCFG.ll This was because we were deleting large chunks of functions without an exit block, because the post-dominance information was not useful. This broke crafty and twolf. --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.53 llvm/lib/Transforms/Scalar/ADCE.cpp:1.54 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.53 Thu May 22 17:00:06 2003 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Mon Jun 16 07:10:45 2003 @@ -166,6 +166,16 @@ } } + // Check to ensure we have an exit node for this CFG. If we don't, we won't + // have any post-dominance information, thus we cannot perform our + // transformations safely. + // + PostDominatorTree &DT = getAnalysis(); + if (DT[&Func->getEntryNode()] == 0) { + WorkList.clear(); + return MadeChanges; + } + DEBUG(std::cerr << "Processing work list\n"); // AliveBlocks - Set of basic blocks that we know have instructions that are @@ -208,19 +218,18 @@ DEBUG( std::cerr << "Current Function: X = Live\n"; - for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I) + for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I){ + std::cerr << I->getName() << ":\t" + << (AliveBlocks.count(I) ? "LIVE\n" : "DEAD\n"); for (BasicBlock::iterator BI = I->begin(), BE = I->end(); BI != BE; ++BI){ if (LiveSet.count(BI)) std::cerr << "X "; std::cerr << *BI; } - ); + }); // Find the first postdominator of the entry node that is alive. Make it the // new entry node... // - PostDominatorTree &DT = getAnalysis(); - - if (AliveBlocks.size() == Func->size()) { // No dead blocks? for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I) // Loop over all of the instructions in the function, telling dead From lattner at cs.uiuc.edu Mon Jun 16 07:12:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:12:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200306161211.HAA11979@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.44 -> 1.45 --- Log message: Fix bug: Linker/2003-06-02-TypeResolveProblem2.ll --- Diffs of the changes: Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.44 llvm/lib/VMCore/Constants.cpp:1.45 --- llvm/lib/VMCore/Constants.cpp:1.44 Mon Jun 2 12:42:47 2003 +++ llvm/lib/VMCore/Constants.cpp Mon Jun 16 07:11:33 2003 @@ -225,7 +225,9 @@ "Invalid initializer vector for constant structure"); Operands.reserve(V.size()); for (unsigned i = 0, e = V.size(); i != e; ++i) { - assert(V[i]->getType() == ETypes[i] && + assert((V[i]->getType() == ETypes[i] || + (ETypes[i]->isAbstract() && + ETypes[i]->getPrimitiveID()==V[i]->getType()->getPrimitiveID())) && "Initializer for struct element doesn't match struct element type!"); Operands.push_back(Use(V[i], this)); } @@ -563,9 +565,11 @@ std::vector C; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) C.push_back(cast(getOperand(i))); - replaceAllUsesWith(ConstantArray::get(cast(NewTy), - C)); - destroyConstant(); // This constant is now dead, destroy it. + Constant *New = ConstantArray::get(cast(NewTy), C); + if (New != this) { + replaceAllUsesWith(New); + destroyConstant(); // This constant is now dead, destroy it. + } } @@ -633,9 +637,11 @@ std::vector C; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) C.push_back(cast(getOperand(i))); - replaceAllUsesWith(ConstantStruct::get(cast(NewTy), - C)); - destroyConstant(); // This constant is now dead, destroy it. + Constant *New = ConstantStruct::get(cast(NewTy), C); + if (New != this) { + replaceAllUsesWith(New); + destroyConstant(); // This constant is now dead, destroy it. + } } @@ -672,10 +678,13 @@ if (OldTy == NewTy) return; // Make everyone now use a constant of the new type... - replaceAllUsesWith(ConstantPointerNull::get(cast(NewTy))); + Constant *New = ConstantPointerNull::get(cast(NewTy)); + if (New != this) { + replaceAllUsesWith(New); - // This constant is now dead, destroy it. - destroyConstant(); + // This constant is now dead, destroy it. + destroyConstant(); + } } @@ -806,13 +815,14 @@ // ::get methods intuit the type of the result based on the types of the // operands. The operand types may not have had their types resolved yet. // + Constant *New; if (getOpcode() == Instruction::Cast) { - replaceAllUsesWith(getCast(getOperand(0), NewTy)); + New = getCast(getOperand(0), NewTy); } else if (getOpcode() >= Instruction::BinaryOpsBegin && getOpcode() < Instruction::BinaryOpsEnd) { - replaceAllUsesWith(get(getOpcode(), getOperand(0), getOperand(0))); + New = get(getOpcode(), getOperand(0), getOperand(0)); } else if (getOpcode() == Instruction::Shl || getOpcode() ==Instruction::Shr){ - replaceAllUsesWith(getShift(getOpcode(), getOperand(0), getOperand(0))); + New = getShift(getOpcode(), getOperand(0), getOperand(0)); } else { assert(getOpcode() == Instruction::GetElementPtr); @@ -820,10 +830,12 @@ std::vector C; for (unsigned i = 1, e = getNumOperands(); i != e; ++i) C.push_back(cast(getOperand(i))); - replaceAllUsesWith(ConstantExpr::getGetElementPtr(getOperand(0), - C)); + New = ConstantExpr::getGetElementPtr(getOperand(0), C); + } + if (New != this) { + replaceAllUsesWith(New); + destroyConstant(); // This constant is now dead, destroy it. } - destroyConstant(); // This constant is now dead, destroy it. } From lattner at cs.uiuc.edu Mon Jun 16 07:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:15:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/Makefile Message-ID: <200306161214.HAA12043@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000: Makefile updated: 1.1 -> 1.2 --- Log message: Add support for -disabled directories --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/Makefile:1.1 llvm/test/Programs/External/SPEC/CINT2000/Makefile:1.2 --- llvm/test/Programs/External/SPEC/CINT2000/Makefile:1.1 Wed May 14 18:20:55 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/Makefile Mon Jun 16 07:13:57 2003 @@ -1,3 +1,4 @@ LEVEL = ../../../../.. -DIRS := $(sort $(filter-out CVS/, $(wildcard */))) +DIRS := $(filter-out %-disabled/, $(sort $(filter-out CVS/, $(wildcard */)))) + include ${LEVEL}/test/Makefile.tests From lattner at cs.uiuc.edu Mon Jun 16 07:15:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:15:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Sandbox.sh Message-ID: <200306161214.HAA12058@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Sandbox.sh updated: 1.2 -> 1.3 --- Log message: Add newline at EOF --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Sandbox.sh diff -u llvm/test/Programs/External/SPEC/Sandbox.sh:1.2 llvm/test/Programs/External/SPEC/Sandbox.sh:1.3 --- llvm/test/Programs/External/SPEC/Sandbox.sh:1.2 Sun Jun 1 21:32:57 2003 +++ llvm/test/Programs/External/SPEC/Sandbox.sh Mon Jun 16 07:14:46 2003 @@ -29,4 +29,5 @@ $* # This script is always successful... -exit 0 \ No newline at end of file +exit 0 + From lattner at cs.uiuc.edu Mon Jun 16 07:17:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:17:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Makefile.spec Message-ID: <200306161216.HAA12085@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Makefile.spec updated: 1.9 -> 1.10 --- Log message: Allow individual BMs to define source, add 'bytecode' target --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Makefile.spec diff -u llvm/test/Programs/External/SPEC/Makefile.spec:1.9 llvm/test/Programs/External/SPEC/Makefile.spec:1.10 --- llvm/test/Programs/External/SPEC/Makefile.spec:1.9 Wed Jun 4 09:24:58 2003 +++ llvm/test/Programs/External/SPEC/Makefile.spec Mon Jun 16 07:15:52 2003 @@ -31,7 +31,9 @@ SPEC_BENCH_DIR := $(SPEC_ROOT)/$(SPEC_SUBDIR) PROG := $(BENCH_NAME) -Source := $(wildcard $(SPEC_BENCH_DIR)/src/*.c $(SPEC_BENCH_DIR)/src/*.cc) \ +ifndef Source +Source := $(wildcard $(SPEC_BENCH_DIR)/src/*.c $(SPEC_BENCH_DIR)/src/*.cc) +endif # Disable the default Output/%.out-* targets... PROGRAMS_HAVE_CUSTOM_RUN_RULES := 1 @@ -105,3 +107,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + +# Pseudo target to build just the bytecode file. +bytecode: Output/$(PROG).llvm.bc + From lattner at cs.uiuc.edu Mon Jun 16 07:18:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:18:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/IPO.h Message-ID: <200306161217.HAA12115@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: IPO.h updated: 1.16 -> 1.17 --- Log message: Add prototype for the new DAE pass --- Diffs of the changes: Index: llvm/include/llvm/Transforms/IPO.h diff -u llvm/include/llvm/Transforms/IPO.h:1.16 llvm/include/llvm/Transforms/IPO.h:1.17 --- llvm/include/llvm/Transforms/IPO.h:1.16 Mon Feb 3 13:08:33 2003 +++ llvm/include/llvm/Transforms/IPO.h Mon Jun 16 07:16:52 2003 @@ -68,6 +68,12 @@ // Pass *createInternalizePass(); +//===----------------------------------------------------------------------===// +// createDeadArgEliminationPass - This pass removes arguments from functions +// which are not used by the body of the function. +// +Pass *createDeadArgEliminationPass(); + //===----------------------------------------------------------------------===// // These passes are wrappers that can do a few simple structure mutation From lattner at cs.uiuc.edu Mon Jun 16 07:22:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:22:00 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200306161221.HAA13113@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.93 -> 1.94 --- Log message: Fix typeo --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.93 llvm/lib/CWriter/Writer.cpp:1.94 --- llvm/lib/CWriter/Writer.cpp:1.93 Mon Jun 16 07:09:09 2003 +++ llvm/lib/CWriter/Writer.cpp Mon Jun 16 07:21:19 2003 @@ -303,8 +303,8 @@ // Print it out literally if it is a printable character. The only thing // to be careful about is when the last letter output was a hex escape // code, in which case we have to be careful not to print out hex digits - // explicitly (the C compiler things it is a continuation of the previous - // character, arg...) + // explicitly (the C compiler thinks it is a continuation of the previous + // character, sheesh...) // if (isprint(C) && (!LastWasHex || !isxdigit(C))) { LastWasHex = false; From lattner at cs.uiuc.edu Mon Jun 16 07:24:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:24:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp Message-ID: <200306161223.HAA13190@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-13-Crasher.cpp updated: 1.1 -> 1.2 --- Log message: Fix link problem --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp diff -u llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.1 llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.2 --- llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.1 Mon Jun 16 07:05:38 2003 +++ llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp Mon Jun 16 07:23:27 2003 @@ -6,3 +6,5 @@ } TESTOBJ; } + +int main() { return 0; } From lattner at cs.uiuc.edu Mon Jun 16 07:26:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:26:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp 2003-06-08-VirtualFunctions.cpp Message-ID: <200306161225.HAA13251@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-08-BaseType.cpp updated: 1.1 -> 1.2 2003-06-08-VirtualFunctions.cpp updated: 1.1 -> 1.2 --- Log message: Fix link errors by adding main's --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp diff -u llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.1 llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.2 --- llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.1 Mon Jun 16 07:05:38 2003 +++ llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp Mon Jun 16 07:25:11 2003 @@ -15,3 +15,5 @@ bar::bar() { } + +int main() { return 0; } Index: llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp diff -u llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp:1.1 llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp:1.2 --- llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp:1.1 Mon Jun 16 07:05:38 2003 +++ llvm/test/Regression/C++Frontend/2003-06-08-VirtualFunctions.cpp Mon Jun 16 07:25:11 2003 @@ -7,17 +7,10 @@ }; struct bar : public foo { - //int x; bar(); int T() {} }; -//int bar::X() { return 0; } - -foo::foo() : y(4) { - -} - -bar::bar() { - -} +foo::foo() : y(4) { } +bar::bar() { } +int main() { return 0; } From lattner at cs.uiuc.edu Mon Jun 16 07:28:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 07:28:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp 2003-06-13-Crasher.cpp Message-ID: <200306161227.HAA13352@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-08-BaseType.cpp updated: 1.2 -> 1.3 2003-06-13-Crasher.cpp updated: 1.2 -> 1.3 --- Log message: Fix final linking errors --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp diff -u llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.2 llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.3 --- llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp:1.2 Mon Jun 16 07:25:11 2003 +++ llvm/test/Regression/C++Frontend/2003-06-08-BaseType.cpp Mon Jun 16 07:27:12 2003 @@ -10,10 +10,7 @@ bar(); }; -//int bar::X() { return 0; } - -bar::bar() { - -} +bar::bar() { } +foo::foo() { } int main() { return 0; } Index: llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp diff -u llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.2 llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.3 --- llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp:1.2 Mon Jun 16 07:23:27 2003 +++ llvm/test/Regression/C++Frontend/2003-06-13-Crasher.cpp Mon Jun 16 07:27:12 2003 @@ -1,4 +1,4 @@ -void bar(); +void bar(){} void foo() { struct TEST { From lattner at cs.uiuc.edu Mon Jun 16 08:17:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 08:17:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-16-VolatileError.c Message-ID: <200306161316.IAA17137@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-16-VolatileError.c added (r1.1) --- Log message: New testcase identified by joel --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-16-VolatileError.c diff -c /dev/null llvm/test/Regression/C++Frontend/2003-06-16-VolatileError.c:1.1 *** /dev/null Mon Jun 16 08:16:30 2003 --- llvm/test/Regression/C++Frontend/2003-06-16-VolatileError.c Mon Jun 16 08:16:20 2003 *************** *** 0 **** --- 1,5 ---- + /* This crashes the CFE. */ + extern int volatile test; + int volatile test = 0; + + int main() { return 0; } From lattner at cs.uiuc.edu Mon Jun 16 08:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 08:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c Message-ID: <200306161334.IAA18131@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-16-InvalidInitializer.c added (r1.1) --- Log message: New testcase identified by joel --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c diff -c /dev/null llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c:1.1 *** /dev/null Mon Jun 16 08:34:09 2003 --- llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c Mon Jun 16 08:33:59 2003 *************** *** 0 **** --- 1,7 ---- + typedef struct { + char *auth_pwfile; + } auth_config_rec; + + void *Ptr = &((auth_config_rec*)0)->auth_pwfile; + + int main() { return 0; } From lattner at cs.uiuc.edu Mon Jun 16 09:05:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 09:05:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c Message-ID: <200306161404.JAA19798@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-06-16-InvalidInitializer.c updated: 1.1 -> 1.2 --- Log message: Minor tweak to make testcase less simple --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c diff -u llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c:1.1 llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c:1.2 --- llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c:1.1 Mon Jun 16 08:33:59 2003 +++ llvm/test/Regression/C++Frontend/2003-06-16-InvalidInitializer.c Mon Jun 16 09:04:18 2003 @@ -1,7 +1,8 @@ typedef struct { char *auth_pwfile; + int x; } auth_config_rec; -void *Ptr = &((auth_config_rec*)0)->auth_pwfile; +void *Ptr = &((auth_config_rec*)0)->x; int main() { return 0; } From lattner at cs.uiuc.edu Mon Jun 16 10:32:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:32:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInternals.h Message-ID: <200306161531.KAA25727@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInternals.h updated: 1.89 -> 1.90 --- Log message: move contents of include/llvm/Reoptimizer/Mapping/FInfo.h into here, it is sparc internal --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInternals.h diff -u llvm/lib/Target/Sparc/SparcInternals.h:1.89 llvm/lib/Target/Sparc/SparcInternals.h:1.90 --- llvm/lib/Target/Sparc/SparcInternals.h:1.89 Sat May 31 02:30:29 2003 +++ llvm/lib/Target/Sparc/SparcInternals.h Mon Jun 16 10:31:09 2003 @@ -727,4 +727,6 @@ int64_t GetConstantValueAsSignedInt(const Value *V, bool &isValidConstant); +Pass *getFunctionInfo(std::ostream &out); + #endif From lattner at cs.uiuc.edu Mon Jun 16 10:33:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:33:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/FunctionInfo.cpp Sparc.cpp Message-ID: <200306161532.KAA25742@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: FunctionInfo.cpp updated: 1.4 -> 1.5 Sparc.cpp updated: 1.67 -> 1.68 --- Log message: Rename FInfo.cpp to FunctionInfo.cpp, eliminate FInfo.h --- Diffs of the changes: Index: llvm/lib/Target/Sparc/FunctionInfo.cpp diff -u llvm/lib/Target/Sparc/FunctionInfo.cpp:1.4 llvm/lib/Target/Sparc/FunctionInfo.cpp:1.5 --- llvm/lib/Target/Sparc/FunctionInfo.cpp:1.4 Wed Jun 4 17:07:12 2003 +++ llvm/lib/Target/Sparc/FunctionInfo.cpp Mon Jun 16 10:31:52 2003 @@ -1,4 +1,4 @@ -//===-- FInfo.cpp --------------------------------------------*- C++ -*-===//// +//===-- FunctionInfo.cpp ----------------------------------------*- C++ -*-===// // // This file contains a pass, FunctionInfo, used by LLC's SPARC back-end // which writes out two tables used by the Reoptimizer. These tables, @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Reoptimizer/Mapping/FInfo.h" +#include "SparcInternals.h" #include "llvm/Pass.h" #include "llvm/Module.h" Index: llvm/lib/Target/Sparc/Sparc.cpp diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.67 llvm/lib/Target/Sparc/Sparc.cpp:1.68 --- llvm/lib/Target/Sparc/Sparc.cpp:1.67 Fri Jun 6 02:11:16 2003 +++ llvm/lib/Target/Sparc/Sparc.cpp Mon Jun 16 10:31:52 2003 @@ -20,9 +20,7 @@ #include "llvm/CodeGen/RegisterAllocation.h" #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/Reoptimizer/Mapping/MappingInfo.h" -#include "llvm/Reoptimizer/Mapping/FInfo.h" #include "Support/CommandLine.h" -using std::cerr; static const unsigned ImplicitRegUseList[] = { 0 }; /* not used yet */ // Build the MachineInstruction Description Array... From lattner at cs.uiuc.edu Mon Jun 16 10:33:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:33:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Reoptimizer/Mapping/FInfo.h Message-ID: <200306161532.KAA25752@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Reoptimizer/Mapping: FInfo.h (r1.1) removed --- Log message: Remove obsolete file --- Diffs of the changes: From lattner at cs.uiuc.edu Mon Jun 16 10:52:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Makefile.singlesrc Message-ID: <200306161551.KAA27610@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource: Makefile.singlesrc updated: 1.19 -> 1.20 --- Log message: Add LOC counting support for .cpp files --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Makefile.singlesrc diff -u llvm/test/Programs/SingleSource/Makefile.singlesrc:1.19 llvm/test/Programs/SingleSource/Makefile.singlesrc:1.20 --- llvm/test/Programs/SingleSource/Makefile.singlesrc:1.19 Sat May 17 17:32:15 2003 +++ llvm/test/Programs/SingleSource/Makefile.singlesrc Mon Jun 16 10:50:51 2003 @@ -27,6 +27,8 @@ Output/%.LOC.txt: %.c cat $< | wc -l > $@ +Output/%.LOC.txt: %.cpp + cat $< | wc -l > $@ endif # FIXME: LIBS should be specified, not hardcoded to -lm From lattner at cs.uiuc.edu Mon Jun 16 10:52:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-health/Makefile Message-ID: <200306161551.KAA27657@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-health: Makefile updated: 1.8 -> 1.9 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-health/Makefile diff -u llvm/test/Programs/MultiSource/Olden-health/Makefile:1.8 llvm/test/Programs/MultiSource/Olden-health/Makefile:1.9 --- llvm/test/Programs/MultiSource/Olden-health/Makefile:1.8 Tue Jan 22 09:59:44 2002 +++ llvm/test/Programs/MultiSource/Olden-health/Makefile Mon Jun 16 10:51:25 2003 @@ -3,5 +3,7 @@ PROG = health CPPFLAGS = -DTORONTO LDFLAGS = -lm +RUN_OPTIONS = 10 40 1 + include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:52:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:05 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-mst/Makefile Message-ID: <200306161551.KAA27664@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-mst: Makefile updated: 1.7 -> 1.8 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-mst/Makefile diff -u llvm/test/Programs/MultiSource/Olden-mst/Makefile:1.7 llvm/test/Programs/MultiSource/Olden-mst/Makefile:1.8 --- llvm/test/Programs/MultiSource/Olden-mst/Makefile:1.7 Wed Jan 23 14:34:17 2002 +++ llvm/test/Programs/MultiSource/Olden-mst/Makefile Mon Jun 16 10:51:26 2003 @@ -3,5 +3,6 @@ PROG = mst CPPFLAGS = -DTORONTO LDFLAGS = +RUN_OPTIONS = 3000 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:52:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:06 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-perimeter/Makefile Message-ID: <200306161551.KAA27671@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-perimeter: Makefile updated: 1.5 -> 1.6 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-perimeter/Makefile diff -u llvm/test/Programs/MultiSource/Olden-perimeter/Makefile:1.5 llvm/test/Programs/MultiSource/Olden-perimeter/Makefile:1.6 --- llvm/test/Programs/MultiSource/Olden-perimeter/Makefile:1.5 Tue Jan 22 09:58:56 2002 +++ llvm/test/Programs/MultiSource/Olden-perimeter/Makefile Mon Jun 16 10:51:27 2003 @@ -3,5 +3,6 @@ PROG = perimeter CPPFLAGS = -DTORONTO LDFLAGS = +RUN_OPTIONS = 11 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:52:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:08 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-treeadd/Makefile Message-ID: <200306161551.KAA27678@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-treeadd: Makefile updated: 1.6 -> 1.7 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-treeadd/Makefile diff -u llvm/test/Programs/MultiSource/Olden-treeadd/Makefile:1.6 llvm/test/Programs/MultiSource/Olden-treeadd/Makefile:1.7 --- llvm/test/Programs/MultiSource/Olden-treeadd/Makefile:1.6 Tue Jan 22 10:50:03 2002 +++ llvm/test/Programs/MultiSource/Olden-treeadd/Makefile Mon Jun 16 10:51:28 2003 @@ -3,5 +3,6 @@ PROG = treeadd CPPFLAGS = -DTORONTO LDFLAGS = +RUN_OPTIONS = 22 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:52:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:09 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-tsp/Makefile Message-ID: <200306161551.KAA27685@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-tsp: Makefile updated: 1.2 -> 1.3 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-tsp/Makefile diff -u llvm/test/Programs/MultiSource/Olden-tsp/Makefile:1.2 llvm/test/Programs/MultiSource/Olden-tsp/Makefile:1.3 --- llvm/test/Programs/MultiSource/Olden-tsp/Makefile:1.2 Tue Jan 22 10:50:02 2002 +++ llvm/test/Programs/MultiSource/Olden-tsp/Makefile Mon Jun 16 10:51:30 2003 @@ -3,5 +3,6 @@ PROG = tsp CPPFLAGS = -DTORONTO LDFLAGS = -lm +RUN_OPTIONS = 1024000 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:52:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:11 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-voronoi/Makefile Message-ID: <200306161551.KAA27692@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-voronoi: Makefile updated: 1.4 -> 1.5 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-voronoi/Makefile diff -u llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.4 llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.5 --- llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.4 Mon May 12 15:08:22 2003 +++ llvm/test/Programs/MultiSource/Olden-voronoi/Makefile Mon Jun 16 10:51:31 2003 @@ -4,6 +4,7 @@ INCLUDES = defines.h CPPFLAGS = -DTORONTO LDFLAGS = -lm +RUN_OPTIONS = 802400 20 0 7 # This program is adversely effected by the underlying precision of the machine PROGRAM_IS_NONDETERMINISTIC = 1 From lattner at cs.uiuc.edu Mon Jun 16 10:52:13 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:13 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile Message-ID: <200306161551.KAA27699@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-anagram: Makefile updated: 1.1 -> 1.2 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile diff -u llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile:1.1 llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile:1.2 --- llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile:1.1 Fri Feb 14 13:57:02 2003 +++ llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile Mon Jun 16 10:51:33 2003 @@ -1,6 +1,8 @@ LEVEL=../../../.. PROG=anagram #OBJS = anagram.o +RUN_OPTIONS = words +STDIN_FILENAME = input.OUT include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:52:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:52:15 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile Message-ID: <200306161551.KAA27706@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-ks: Makefile updated: 1.1 -> 1.2 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile diff -u llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile:1.1 llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile:1.2 --- llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile:1.1 Tue Nov 5 12:50:15 2002 +++ llvm/test/Programs/MultiSource/Ptrdist-ks/Makefile Mon Jun 16 10:51:34 2003 @@ -1,7 +1,7 @@ LEVEL = ../../../.. PROG=ks #OBJS = KS-1.o KS-2.o -RUN_OPTIONS += KL-2.in +RUN_OPTIONS += KL-4.in include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:53:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:53:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-bisort/Makefile Message-ID: <200306161552.KAA27720@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-bisort: Makefile updated: 1.1 -> 1.2 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-bisort/Makefile diff -u llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.1 llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.2 --- llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.1 Thu Feb 14 10:22:40 2002 +++ llvm/test/Programs/MultiSource/Olden-bisort/Makefile Mon Jun 16 10:51:22 2003 @@ -3,5 +3,6 @@ PROG = bisort CPPFLAGS = -DTORONTO LDFLAGS = -lm +RUN_OPTIONS = 7000000 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:53:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:53:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.jit.report Message-ID: <200306161552.KAA27732@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.jit.report updated: 1.1 -> 1.2 --- Log message: Add #MCInstrs column --- Diffs of the changes: Index: llvm/test/Programs/TEST.jit.report diff -u llvm/test/Programs/TEST.jit.report:1.1 llvm/test/Programs/TEST.jit.report:1.2 --- llvm/test/Programs/TEST.jit.report:1.1 Fri Jan 17 17:25:24 2003 +++ llvm/test/Programs/TEST.jit.report Mon Jun 16 10:52:02 2003 @@ -28,6 +28,7 @@ [], # Sizes ["MCSize" , '([0-9]+).*Number of bytes of machine code compiled'], + ["#MCInsts", '([0-9]+).*Number of machine instructions emitted'], ["#Glob" , '([0-9]+).*Number of bytes of global vars'], [], # Number of transformations From lattner at cs.uiuc.edu Mon Jun 16 10:53:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:53:05 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.jit.Makefile Message-ID: <200306161552.KAA27743@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.jit.Makefile updated: 1.3 -> 1.4 --- Log message: Refactor argument --- Diffs of the changes: Index: llvm/test/Programs/TEST.jit.Makefile diff -u llvm/test/Programs/TEST.jit.Makefile:1.3 llvm/test/Programs/TEST.jit.Makefile:1.4 --- llvm/test/Programs/TEST.jit.Makefile:1.3 Tue Jan 21 10:33:08 2003 +++ llvm/test/Programs/TEST.jit.Makefile Mon Jun 16 10:52:21 2003 @@ -6,14 +6,15 @@ # ##===----------------------------------------------------------------------===## -JIT_OPTS = -stats -time-passes +JIT_OPTS = -force-interpreter=false -stats -time-passes CURDIR := $(shell cd .; pwd) PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/ RELDIR := $(subst $(PROGDIR),,$(CURDIR)) $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ Output/%.$(TEST).report.txt: Output/%.llvm.bc $(LLI) - -(time -p $(LLI) -force-interpreter=false $(JIT_OPTS) $< > /dev/null) > $@ 2>&1 + -(time -p $(LLI) $(JIT_OPTS) $< $(RUN_OPTIONS) > /dev/null \ + < $(STDIN_FILENAME)) > $@ 2>&1 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ test.$(TEST).%: Output/%.$(TEST).report.txt From lattner at cs.uiuc.edu Mon Jun 16 10:53:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:53:08 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-bh/Makefile Message-ID: <200306161552.KAA27713@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-bh: Makefile updated: 1.6 -> 1.7 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-bh/Makefile diff -u llvm/test/Programs/MultiSource/Olden-bh/Makefile:1.6 llvm/test/Programs/MultiSource/Olden-bh/Makefile:1.7 --- llvm/test/Programs/MultiSource/Olden-bh/Makefile:1.6 Wed Jan 23 13:56:08 2002 +++ llvm/test/Programs/MultiSource/Olden-bh/Makefile Mon Jun 16 10:51:21 2003 @@ -3,5 +3,6 @@ PROG = bh CPPFLAGS = -DTORONTO LDFLAGS = -lm +RUN_OPTIONS = 50000 30 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:53:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:53:09 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-em3d/Makefile Message-ID: <200306161552.KAA27725@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-em3d: Makefile updated: 1.2 -> 1.3 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-em3d/Makefile diff -u llvm/test/Programs/MultiSource/Olden-em3d/Makefile:1.2 llvm/test/Programs/MultiSource/Olden-em3d/Makefile:1.3 --- llvm/test/Programs/MultiSource/Olden-em3d/Makefile:1.2 Tue Jan 22 10:50:04 2002 +++ llvm/test/Programs/MultiSource/Olden-em3d/Makefile Mon Jun 16 10:51:24 2003 @@ -3,5 +3,6 @@ PROG = em3d CPPFLAGS = -DTORONTO LDFLAGS = +RUN_OPTIONS = 1024 1000 125 include ../Makefile.multisrc From lattner at cs.uiuc.edu Mon Jun 16 10:54:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 10:54:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200306161553.KAA27754@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.55 -> 1.56 --- Log message: If CBE is enabled, but CBE_diffs are not, build the .cbe file AS WELL AS the .cbe.c file --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.55 llvm/test/Programs/Makefile.programs:1.56 --- llvm/test/Programs/Makefile.programs:1.55 Wed Jun 4 09:24:52 2003 +++ llvm/test/Programs/Makefile.programs Mon Jun 16 10:53:01 2003 @@ -87,8 +87,8 @@ BYTECODE := $(addsuffix .llvm.bc, $(PREFIXED_PROGRAMS_TO_TEST)) # Generated code for llc (which does not require the target platform) -LLCCODEGEN := $(addsuffix .llc.s, $(PREFIXED_PROGRAMS_TO_TEST)) -CBECODEGEN := $(addsuffix .cbe.c, $(PREFIXED_PROGRAMS_TO_TEST)) +LLCCODEGEN := $(addsuffix .llc, $(PREFIXED_PROGRAMS_TO_TEST)) +CBECODEGEN := $(addsuffix .cbe, $(PREFIXED_PROGRAMS_TO_TEST)) LLCTRACECODEGEN := $(addsuffix .trace.llc.s, $(PREFIXED_PROGRAMS_TO_TEST)) CBETRACECODEGEN := $(addsuffix .trace.cbe.c, $(PREFIXED_PROGRAMS_TO_TEST)) From lattner at cs.uiuc.edu Mon Jun 16 11:01:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 11:01:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.Makefile TEST.nightly.report Message-ID: <200306161600.LAA27797@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.Makefile updated: 1.12 -> 1.13 TEST.nightly.report updated: 1.3 -> 1.4 --- Log message: Remove the interpreter from the nightly tests, it's just too slow --- Diffs of the changes: Index: llvm/test/Programs/TEST.nightly.Makefile diff -u llvm/test/Programs/TEST.nightly.Makefile:1.12 llvm/test/Programs/TEST.nightly.Makefile:1.13 --- llvm/test/Programs/TEST.nightly.Makefile:1.12 Wed May 14 14:53:40 2003 +++ llvm/test/Programs/TEST.nightly.Makefile Mon Jun 16 11:00:45 2003 @@ -9,7 +9,7 @@ PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/ RELDIR := $(subst $(PROGDIR),,$(CURDIR)) -REPORTS_TO_GEN := compile llc cbe lli jit +REPORTS_TO_GEN := compile llc cbe jit REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN)) TIMEOPT = -time-passes -stats -info-output-file=$@.info @@ -68,23 +68,6 @@ else \ echo "TEST-FAIL: cbe $(RELDIR)/$*" >> $@;\ fi - -# LLI tests -$(PROGRAMS_TO_TEST:%=Output/%.nightly.lli.report.txt): \ -Output/%.nightly.lli.report.txt: Output/%.llvm.bc Output/%.exe-lli $(LLI) - -head -n 100 Output/$*.exe-lli > $@ - @if test -e Output/$*.exe-lli; then \ - echo "TEST-PASS: lli $(RELDIR)/$*" >> $@;\ - echo -n "TEST-RESULT-lli-time: " >> $@;\ - grep "^real" $(INFO_PREFIX)lli.time >> $@;\ - echo >> $@;\ - echo -n "TEST-RESULT-lli-dyninst: " >> $@;\ - grep "Number of dynamic inst" $(INFO_PREFIX)lli.info >> $@;\ - echo >> $@;\ - else \ - echo "TEST-FAIL: lli $(RELDIR)/$*" >> $@;\ - fi - -rm -f $(INFO_PREFIX)lli.info # JIT tests $(PROGRAMS_TO_TEST:%=Output/%.nightly.jit.report.txt): \ Index: llvm/test/Programs/TEST.nightly.report diff -u llvm/test/Programs/TEST.nightly.report:1.3 llvm/test/Programs/TEST.nightly.report:1.4 --- llvm/test/Programs/TEST.nightly.report:1.3 Fri May 9 15:43:49 2003 +++ llvm/test/Programs/TEST.nightly.report Mon Jun 16 11:00:45 2003 @@ -24,9 +24,6 @@ ["LLC" , "TEST-RESULT-llc: $WallTimeRE"], ["CBE" , 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)'], [], - ["LLI" , 'TEST-RESULT-lli-time: real\s*([.0-9m]+)'], - ["DynInstrs", 'TEST-RESULT-lli-dyninst: *([0-9]+).*Number of dynamic inst'], - [], ["JIT" , 'TEST-RESULT-jit-time: real\s*([.0-9m]+)'], ["MachCode" , 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code'], ["CompTime" , "TEST-RESULT-jit-comptime: $WallTimeRE"] From criswell at choi.cs.uiuc.edu Mon Jun 16 14:15:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Mon Jun 16 14:15:01 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200306161914.h5GJEgG10406@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.88 -> 1.89 --- Log message: Modified the environment variables that determine where things are located to do the following: 1) Determine their default values without $HOME 2) Configure the default values as full absolute pathnames. This should help fix the nightly test builds. --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.88 llvm/Makefile.common:1.89 --- llvm/Makefile.common:1.88 Wed Jun 11 08:55:26 2003 +++ llvm/Makefile.common Mon Jun 16 14:14:31 2003 @@ -72,7 +72,7 @@ # Set the source root directory. # ifndef BUILD_SRC_ROOT -BUILD_SRC_ROOT = $(BUILD_SRC_DIR)/$(LEVEL) +BUILD_SRC_ROOT = $(shell cd $(BUILD_SRC_DIR)/$(LEVEL); pwd) endif # @@ -83,7 +83,7 @@ ifeq ($(OBJ_ROOT),.) BUILD_OBJ_DIR = $(shell pwd) else -BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(HOME)%,%,$(shell cd $(BUILD_SRC_DIR); pwd)) +BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_DIR); pwd)) endif endif @@ -94,7 +94,7 @@ ifeq ($(OBJ_ROOT),.) BUILD_OBJ_ROOT = $(shell cd $(LEVEL); pwd) else -BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(HOME)%,%,$(shell cd $(LEVEL); pwd)) +BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_ROOT); pwd)) endif endif From criswell at choi.cs.uiuc.edu Mon Jun 16 14:17:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Mon Jun 16 14:17:01 2003 Subject: [llvm-commits] CVS: llvm/test/Makefile.tests Message-ID: <200306161916.h5GJGgS10428@choi.cs.uiuc.edu> Changes in directory llvm/test: Makefile.tests updated: 1.62 -> 1.63 --- Log message: Reconfigured the TOOLS variable so that it points to the current set of tools built by the LLVM build. Added a path for use with the TestRunner.sh script so that it can always find the LLVM tools without having the user place them in his or her path. --- Diffs of the changes: Index: llvm/test/Makefile.tests diff -u llvm/test/Makefile.tests:1.62 llvm/test/Makefile.tests:1.63 --- llvm/test/Makefile.tests:1.62 Wed Jun 11 08:56:55 2003 +++ llvm/test/Makefile.tests Mon Jun 16 14:16:32 2003 @@ -30,11 +30,7 @@ .PRECIOUS: Output/%.llvm.bc .PRECIOUS: Output/%.llvm -ifdef ENABLE_OPTIMIZED -TOOLS = $(BUILD_OBJ_ROOT)/tools/Release -else -TOOLS = $(BUILD_OBJ_ROOT)/tools/Debug -endif +TOOLS = $(LLVMTOOLCURRENT) # LLVM Tool Definitions... # @@ -57,7 +53,7 @@ LCXXFLAGS += -O2 -Wall LLCFLAGS = FAILURE = $(LEVEL)/test/Failure.sh -TESTRUNR = $(LEVEL)/test/TestRunner.sh +TESTRUNR = PATH=$(LLVMTOOLCURRENT) $(LEVEL)/test/TestRunner.sh # Native Tool Definitions NATGCC = $(CC) From gaeke at cs.uiuc.edu Mon Jun 16 16:16:00 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 16:16:00 2003 Subject: [llvm-commits] CVS: llvm/include/Support/DataTypes.h Message-ID: <200306162115.QAA32424@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: DataTypes.h updated: 1.8 -> 1.9 --- Log message: This version supports FreeBSD. --- Diffs of the changes: Index: llvm/include/Support/DataTypes.h diff -u llvm/include/Support/DataTypes.h:1.8 llvm/include/Support/DataTypes.h:1.9 --- llvm/include/Support/DataTypes.h:1.8 Wed Jun 11 14:44:48 2003 +++ llvm/include/Support/DataTypes.h Mon Jun 16 16:14:57 2003 @@ -4,10 +4,10 @@ // This file is important because different host OS's define different macros, // which makes portability tough. This file exports the following definitions: // -// ENDIAN_LITTLE : is #define'd if the host is little endian -// int64_t : is a typedef for the signed 64 bit system type -// uint64_t : is a typedef for the unsigned 64 bit system type -// INT64_MAX : is a #define specifying the max value for int64_t's +// LITTLE_ENDIAN: is #define'd if the host is little endian +// int64_t : is a typedef for the signed 64 bit system type +// uint64_t : is a typedef for the unsigned 64 bit system type +// INT64_MAX : is a #define specifying the max value for int64_t's // // No library is required when using these functinons. // @@ -29,9 +29,24 @@ # else # undef LITTLE_ENDIAN # endif -#else -# if (BSD >= 199103) -# include +#endif + +#ifdef __FreeBSD__ +# include +# if _BYTE_ORDER == _LITTLE_ENDIAN +# ifndef LITTLE_ENDIAN +# define LITTLE_ENDIAN 1 +# endif +# ifdef BIG_ENDIAN +# undef BIG_ENDIAN +# endif +# else +# ifndef BIG_ENDIAN +# define BIG_ENDIAN 1 +# endif +# ifdef LITTLE_ENDIAN +# undef LITTLE_ENDIAN +# endif # endif #endif @@ -44,26 +59,11 @@ # endif #endif -// -// Convert the information from the header files into our own local -// endian macros. We do this because various strange systems define both -// BIG_ENDIAN and LITTLE_ENDIAN, and we don't want to conflict with them. -// -// Don't worry; once we introduce autoconf, this will look a lot nicer. -// -#ifdef LITTLE_ENDIAN -#define ENDIAN_LITTLE -#endif - -#ifdef BIG_ENDIAN -#define ENDIAN_BIG -#endif - -#if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG)) -#error "Cannot define both ENDIAN_LITTLE and ENDIAN_BIG!" +#if (defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)) +#error "Cannot define both LITTLE_ENDIAN and BIG_ENDIAN!" #endif -#if (!defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG)) || !defined(INT64_MAX) +#if (!defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)) || !defined(INT64_MAX) #error "include/Support/DataTypes.h could not determine endianness!" #endif From gaeke at cs.uiuc.edu Mon Jun 16 16:19:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 16:19:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/DataTypes.h Message-ID: <200306162118.QAA32450@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: DataTypes.h updated: 1.9 -> 1.10 --- Log message: Whoops. I didn't mean to step on John's changes. --- Diffs of the changes: Index: llvm/include/Support/DataTypes.h diff -u llvm/include/Support/DataTypes.h:1.9 llvm/include/Support/DataTypes.h:1.10 --- llvm/include/Support/DataTypes.h:1.9 Mon Jun 16 16:14:57 2003 +++ llvm/include/Support/DataTypes.h Mon Jun 16 16:18:20 2003 @@ -4,10 +4,10 @@ // This file is important because different host OS's define different macros, // which makes portability tough. This file exports the following definitions: // -// LITTLE_ENDIAN: is #define'd if the host is little endian -// int64_t : is a typedef for the signed 64 bit system type -// uint64_t : is a typedef for the unsigned 64 bit system type -// INT64_MAX : is a #define specifying the max value for int64_t's +// ENDIAN_LITTLE : is #define'd if the host is little endian +// int64_t : is a typedef for the signed 64 bit system type +// uint64_t : is a typedef for the unsigned 64 bit system type +// INT64_MAX : is a #define specifying the max value for int64_t's // // No library is required when using these functinons. // @@ -59,11 +59,26 @@ # endif #endif -#if (defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)) -#error "Cannot define both LITTLE_ENDIAN and BIG_ENDIAN!" +// +// Convert the information from the header files into our own local +// endian macros. We do this because various strange systems define both +// BIG_ENDIAN and LITTLE_ENDIAN, and we don't want to conflict with them. +// +// Don't worry; once we introduce autoconf, this will look a lot nicer. +// +#ifdef LITTLE_ENDIAN +#define ENDIAN_LITTLE +#endif + +#ifdef BIG_ENDIAN +#define ENDIAN_BIG +#endif + +#if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG)) +#error "Cannot define both ENDIAN_LITTLE and ENDIAN_BIG!" #endif -#if (!defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)) || !defined(INT64_MAX) +#if (!defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG)) || !defined(INT64_MAX) #error "include/Support/DataTypes.h could not determine endianness!" #endif From gaeke at cs.uiuc.edu Mon Jun 16 16:55:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 16:55:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Alloca.h Message-ID: <200306162154.QAA19054@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: Alloca.h added (r1.1) --- Log message: Isolate machine-dependent use of in "Support/Alloca.h", so that we can easily change its use to be conditional on the result of an autoconf test later. --- Diffs of the changes: Index: llvm/include/Support/Alloca.h diff -c /dev/null llvm/include/Support/Alloca.h:1.1 *** /dev/null Mon Jun 16 16:54:06 2003 --- llvm/include/Support/Alloca.h Mon Jun 16 16:53:55 2003 *************** *** 0 **** --- 1,30 ---- + //===-- include/Support/Alloca.h - Support for alloca header -----*- C++ -*--=// + // + // Some platforms do not have alloca.h; others do. You can include this + // file instead of and it will include on the platforms + // that require you to do so to use alloca(). + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_SUPPORT_ALLOCA_H + #define LLVM_SUPPORT_ALLOCA_H + + // TODO: Determine HAVE_ALLOCA_H based on autoconf results. + // The following method is too brittle. + #if defined(HAVE_ALLOCA_H) + #undef HAVE_ALLOCA_H + #endif + + #if defined(__linux__) + #define HAVE_ALLOCA_H 1 + #elif defined(__sparc__) + #define HAVE_ALLOCA_H 1 + #elif defined(__FreeBSD__) + // not defined here + #endif + + #if HAVE_ALLOCA_H + #include + #endif + + #endif /* LLVM_SUPPORT_ALLOCA_H */ From gaeke at cs.uiuc.edu Mon Jun 16 16:55:04 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 16:55:04 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp Message-ID: <200306162154.QAA19062@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSelection: InstrForest.cpp updated: 1.40 -> 1.41 --- Log message: Isolate machine-dependent use of in "Support/Alloca.h", so that we can easily change its use to be conditional on the result of an autoconf test later. --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp diff -u llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.40 llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.41 --- llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.40 Sat Aug 24 16:02:09 2002 +++ llvm/lib/CodeGen/InstrSelection/InstrForest.cpp Mon Jun 16 16:53:59 2003 @@ -21,7 +21,7 @@ #include "llvm/Type.h" #include "llvm/CodeGen/MachineInstr.h" #include "Support/STLExtras.h" -#include +#include "Support/Alloca.h" using std::cerr; using std::vector; From gaeke at cs.uiuc.edu Mon Jun 16 16:55:06 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 16:55:06 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200306162154.QAA19069@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.28 -> 1.29 --- Log message: Isolate machine-dependent use of in "Support/Alloca.h", so that we can easily change its use to be conditional on the result of an autoconf test later. --- Diffs of the changes: Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.28 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.29 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.28 Fri Jun 6 13:25:33 2003 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Mon Jun 16 16:54:00 2003 @@ -13,7 +13,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Value.h" #include "Support/Statistic.h" -#include +#include "Support/Alloca.h" namespace { Statistic<> From gaeke at cs.uiuc.edu Mon Jun 16 16:55:08 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 16:55:08 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/SystemUtils.cpp Message-ID: <200306162154.QAA19077@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: SystemUtils.cpp updated: 1.3 -> 1.4 --- Log message: Isolate machine-dependent use of in "Support/Alloca.h", so that we can easily change its use to be conditional on the result of an autoconf test later. --- Diffs of the changes: Index: llvm/tools/bugpoint/SystemUtils.cpp diff -u llvm/tools/bugpoint/SystemUtils.cpp:1.3 llvm/tools/bugpoint/SystemUtils.cpp:1.4 --- llvm/tools/bugpoint/SystemUtils.cpp:1.3 Wed Jan 29 12:15:34 2003 +++ llvm/tools/bugpoint/SystemUtils.cpp Mon Jun 16 16:54:01 2003 @@ -10,7 +10,7 @@ #include #include #include -#include +#include "Support/Alloca.h" #include #include #include From gaeke at cs.uiuc.edu Mon Jun 16 17:03:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 17:03:01 2003 Subject: [llvm-commits] CVS: llvm/Makefile.FreeBSD Message-ID: <200306162202.RAA19135@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.FreeBSD added (r1.1) --- Log message: Basically this is the same as Makefile.Linux, at least for now. --- Diffs of the changes: Index: llvm/Makefile.FreeBSD diff -c /dev/null llvm/Makefile.FreeBSD:1.1 *** /dev/null Mon Jun 16 17:02:06 2003 --- llvm/Makefile.FreeBSD Mon Jun 16 17:01:55 2003 *************** *** 0 **** --- 1,43 ---- + #=-- Makefile.FreeBSD - FreeBSD specific makefile options ---*- makefile -*--==# + # + # This file is included by all other files, through Makefile.common, but only + # when compiling on a FreeBSD based platform. + # + #===-----------------------------------------------------------------------====# + + # Set the architecture so that x86 platform dependant code is compmiled + ARCH := x86 + + # MakeSharedObjectOption - This option is passed to the linker by + # Makefile.common when compiling a shared object. + # + MakeSharedObjectOption := -shared + + # PLATFORMLINKOPTS - On FreeBSD, we must specify this linker option so that all + # symbols are exported by tools for runtime use by dlsym. + # + PLATFORMLINKOPTS := -Wl,--export-dynamic + + # PLATFORMSTRIPOPTS - Command to pass to the link phase to cause symbols to be + # stripped from the resultant binary. + PLATFORMSTRIPOPTS := -Wl,-x + + # Path to location for LLVM front-end for this architecture. This setting may + # be overriden by the Makefile.config option, and should not override it if set. + # (Using Linux GCC front-end for now.) + # + LLVMGCCARCH := i686-pc-linux-gnu/3.4-llvm + ifndef LLVMGCCDIR + LLVMGCCDIR := /home/vadve/lattner/local/x86/llvm-gcc/ + endif + + # For now we disable running LLC output, because LLC does not generate x86 code + # LLC itself can be run so disable the diffs, not LLC itself. + # + DISABLE_LLC_DIFFS := 1 + + # This platform has a JIT compiler! FIXME: This should be changed to be an + # option printed by LLI itself at some point. + # + TARGET_HAS_JIT := 1 + From lattner at cs.uiuc.edu Mon Jun 16 17:19:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 17:19:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp Message-ID: <200306162218.RAA12262@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSelection: InstrForest.cpp updated: 1.41 -> 1.42 --- Log message: Remove two using decls Remove usage of alloca --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp diff -u llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.41 llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.42 --- llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.41 Mon Jun 16 16:53:59 2003 +++ llvm/lib/CodeGen/InstrSelection/InstrForest.cpp Mon Jun 16 17:18:28 2003 @@ -21,9 +21,6 @@ #include "llvm/Type.h" #include "llvm/CodeGen/MachineInstr.h" #include "Support/STLExtras.h" -#include "Support/Alloca.h" -using std::cerr; -using std::vector; //------------------------------------------------------------------------ // class InstrTreeNode @@ -117,9 +114,9 @@ InstructionNode::dumpNode(int indent) const { for (int i=0; i < indent; i++) - cerr << " "; - cerr << getInstruction()->getOpcodeName() - << " [label " << getOpLabel() << "]" << "\n"; + std::cerr << " "; + std::cerr << getInstruction()->getOpcodeName() + << " [label " << getOpLabel() << "]" << "\n"; } @@ -127,9 +124,9 @@ VRegListNode::dumpNode(int indent) const { for (int i=0; i < indent; i++) - cerr << " "; + std::cerr << " "; - cerr << "List" << "\n"; + std::cerr << "List" << "\n"; } @@ -137,29 +134,29 @@ VRegNode::dumpNode(int indent) const { for (int i=0; i < indent; i++) - cerr << " "; + std::cerr << " "; - cerr << "VReg " << getValue() << "\t(type " - << (int) getValue()->getValueType() << ")" << "\n"; + std::cerr << "VReg " << getValue() << "\t(type " + << (int) getValue()->getValueType() << ")" << "\n"; } void ConstantNode::dumpNode(int indent) const { for (int i=0; i < indent; i++) - cerr << " "; + std::cerr << " "; - cerr << "Constant " << getValue() << "\t(type " - << (int) getValue()->getValueType() << ")" << "\n"; + std::cerr << "Constant " << getValue() << "\t(type " + << (int) getValue()->getValueType() << ")" << "\n"; } void LabelNode::dumpNode(int indent) const { for (int i=0; i < indent; i++) - cerr << " "; + std::cerr << " "; - cerr << "Label " << getValue() << "\n"; + std::cerr << "Label " << getValue() << "\n"; } //------------------------------------------------------------------------ @@ -258,8 +255,7 @@ // if a fixed array is too small. // int numChildren = 0; - InstrTreeNode **childArray = - (InstrTreeNode **)alloca(instr->getNumOperands()*sizeof(InstrTreeNode *)); + std::vector childArray(instr->getNumOperands()); // // Walk the operands of the instruction From lattner at cs.uiuc.edu Mon Jun 16 17:23:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 17:23:00 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/SystemUtils.cpp Message-ID: <200306162222.RAA13152@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: SystemUtils.cpp updated: 1.4 -> 1.5 --- Log message: Remove usage of alloca --- Diffs of the changes: Index: llvm/tools/bugpoint/SystemUtils.cpp diff -u llvm/tools/bugpoint/SystemUtils.cpp:1.4 llvm/tools/bugpoint/SystemUtils.cpp:1.5 --- llvm/tools/bugpoint/SystemUtils.cpp:1.4 Mon Jun 16 16:54:01 2003 +++ llvm/tools/bugpoint/SystemUtils.cpp Mon Jun 16 17:22:11 2003 @@ -10,7 +10,7 @@ #include #include #include -#include "Support/Alloca.h" +#include #include #include #include @@ -33,13 +33,13 @@ return FilenameBase; // Couldn't open the file? Use it! // Create a pattern for mkstemp... - char *FNBuffer = (char*)alloca(FilenameBase.size()+8); - strcpy(FNBuffer, FilenameBase.c_str()); - strcpy(FNBuffer+FilenameBase.size(), "-XXXXXX"); + std::vector FNBuffer(FilenameBase.size()+8); + strcpy(&FNBuffer[0], FilenameBase.c_str()); + strcpy(&FNBuffer[FilenameBase.size()], "-XXXXXX"); // Agree on a temporary file name to use.... int TempFD; - if ((TempFD = mkstemp(FNBuffer)) == -1) { + if ((TempFD = mkstemp(&FNBuffer[0])) == -1) { std::cerr << "bugpoint: ERROR: Cannot create temporary file in the current " << " directory!\n"; exit(1); @@ -48,7 +48,7 @@ // We don't need to hold the temp file descriptor... we will trust that noone // will overwrite/delete the file while we are working on it... close(TempFD); - return FNBuffer; + return std::string(&FNBuffer[0]); } /// isExecutableFile - This function returns true if the filename specified From lattner at cs.uiuc.edu Mon Jun 16 17:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 17:30:01 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/SystemUtils.cpp Message-ID: <200306162229.RAA14517@apoc.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: SystemUtils.cpp updated: 1.5 -> 1.6 --- Log message: Actually, change it to use explicit new/delete, which is more likely to be optimized INTO an alloca --- Diffs of the changes: Index: llvm/tools/bugpoint/SystemUtils.cpp diff -u llvm/tools/bugpoint/SystemUtils.cpp:1.5 llvm/tools/bugpoint/SystemUtils.cpp:1.6 --- llvm/tools/bugpoint/SystemUtils.cpp:1.5 Mon Jun 16 17:22:11 2003 +++ llvm/tools/bugpoint/SystemUtils.cpp Mon Jun 16 17:28:50 2003 @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -33,13 +32,13 @@ return FilenameBase; // Couldn't open the file? Use it! // Create a pattern for mkstemp... - std::vector FNBuffer(FilenameBase.size()+8); - strcpy(&FNBuffer[0], FilenameBase.c_str()); - strcpy(&FNBuffer[FilenameBase.size()], "-XXXXXX"); + char *FNBuffer = new char[FilenameBase.size()+8]; + strcpy(FNBuffer, FilenameBase.c_str()); + strcpy(FNBuffer+FilenameBase.size(), "-XXXXXX"); // Agree on a temporary file name to use.... int TempFD; - if ((TempFD = mkstemp(&FNBuffer[0])) == -1) { + if ((TempFD = mkstemp(FNBuffer)) == -1) { std::cerr << "bugpoint: ERROR: Cannot create temporary file in the current " << " directory!\n"; exit(1); @@ -48,7 +47,9 @@ // We don't need to hold the temp file descriptor... we will trust that noone // will overwrite/delete the file while we are working on it... close(TempFD); - return std::string(&FNBuffer[0]); + std::string Result(FNBuffer); + delete[] FNBuffer; + return Result; } /// isExecutableFile - This function returns true if the filename specified From lattner at cs.uiuc.edu Mon Jun 16 17:30:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 17:30:04 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp Message-ID: <200306162229.RAA14544@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/InstrSelection: InstrForest.cpp updated: 1.42 -> 1.43 --- Log message: Actually, change it to use explicit new/delete, which is more likely to be optimized INTO an alloca --- Diffs of the changes: Index: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp diff -u llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.42 llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.43 --- llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.42 Mon Jun 16 17:18:28 2003 +++ llvm/lib/CodeGen/InstrSelection/InstrForest.cpp Mon Jun 16 17:29:09 2003 @@ -255,7 +255,7 @@ // if a fixed array is too small. // int numChildren = 0; - std::vector childArray(instr->getNumOperands()); + InstrTreeNode** childArray = new InstrTreeNode*[instr->getNumOperands()]; // // Walk the operands of the instruction @@ -362,6 +362,7 @@ assert(n == 1); setRightChild(parent, childArray[numChildren - 1]); } - + + delete [] childArray; return treeNode; } From gaeke at cs.uiuc.edu Mon Jun 16 18:58:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 18:58:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200306162357.SAA09469@zion.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.94 -> 1.95 --- Log message: Don't include alloca.h on FreeBSD. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.94 llvm/lib/CWriter/Writer.cpp:1.95 --- llvm/lib/CWriter/Writer.cpp:1.94 Mon Jun 16 07:21:19 2003 +++ llvm/lib/CWriter/Writer.cpp Mon Jun 16 18:57:13 2003 @@ -528,7 +528,9 @@ << "extern void *__builtin_alloca(unsigned long);\n" << "#define alloca(x) __builtin_alloca(x)\n" << "#else\n" + << "#ifndef __FreeBSD__\n" << "#include \n" + << "#endif\n" << "#endif\n\n"; } From lattner at cs.uiuc.edu Mon Jun 16 19:05:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 19:05:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-05-21-UnionBitfields.c Message-ID: <200306170004.TAA16760@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-05-21-UnionBitfields.c updated: 1.1 -> 1.2 --- Log message: Arg, sparc doesn't have correct things in math.h! --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-05-21-UnionBitfields.c diff -u llvm/test/Regression/C++Frontend/2003-05-21-UnionBitfields.c:1.1 llvm/test/Regression/C++Frontend/2003-05-21-UnionBitfields.c:1.2 --- llvm/test/Regression/C++Frontend/2003-05-21-UnionBitfields.c:1.1 Wed May 21 18:01:50 2003 +++ llvm/test/Regression/C++Frontend/2003-05-21-UnionBitfields.c Mon Jun 16 19:03:56 2003 @@ -17,6 +17,6 @@ } int main() { - printf("%d %d\n", target_isinf(1234.42), target_isinf(INFINITY)); + printf("%d %d\n", target_isinf(1234.42), target_isinf(1.0/1.0e-1000)); return 0; } From lattner at cs.uiuc.edu Mon Jun 16 19:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 19:25:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200306170024.TAA18114@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.56 -> 1.57 --- Log message: Last patch accidentially forced the compilation of the .llc file, instead of just the .llc.s file. This doesn't work on X86. --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.56 llvm/test/Programs/Makefile.programs:1.57 --- llvm/test/Programs/Makefile.programs:1.56 Mon Jun 16 10:53:01 2003 +++ llvm/test/Programs/Makefile.programs Mon Jun 16 19:24:12 2003 @@ -87,7 +87,7 @@ BYTECODE := $(addsuffix .llvm.bc, $(PREFIXED_PROGRAMS_TO_TEST)) # Generated code for llc (which does not require the target platform) -LLCCODEGEN := $(addsuffix .llc, $(PREFIXED_PROGRAMS_TO_TEST)) +LLCCODEGEN := $(addsuffix .llc.s, $(PREFIXED_PROGRAMS_TO_TEST)) CBECODEGEN := $(addsuffix .cbe, $(PREFIXED_PROGRAMS_TO_TEST)) LLCTRACECODEGEN := $(addsuffix .trace.llc.s, $(PREFIXED_PROGRAMS_TO_TEST)) CBETRACECODEGEN := $(addsuffix .trace.cbe.c, $(PREFIXED_PROGRAMS_TO_TEST)) From lattner at cs.uiuc.edu Mon Jun 16 19:28:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 19:28:00 2003 Subject: [llvm-commits] CVS: llvm/test/Makefile.tests Message-ID: <200306170027.TAA21403@apoc.cs.uiuc.edu> Changes in directory llvm/test: Makefile.tests updated: 1.63 -> 1.64 --- Log message: Just _EXTEND_ the current path. Don't replace it. Replacing it makes it impossible for scripts to find user tools like sed. --- Diffs of the changes: Index: llvm/test/Makefile.tests diff -u llvm/test/Makefile.tests:1.63 llvm/test/Makefile.tests:1.64 --- llvm/test/Makefile.tests:1.63 Mon Jun 16 14:16:32 2003 +++ llvm/test/Makefile.tests Mon Jun 16 19:27:43 2003 @@ -53,7 +53,7 @@ LCXXFLAGS += -O2 -Wall LLCFLAGS = FAILURE = $(LEVEL)/test/Failure.sh -TESTRUNR = PATH=$(LLVMTOOLCURRENT) $(LEVEL)/test/TestRunner.sh +TESTRUNR = PATH=$(PATH):$(LLVMTOOLCURRENT) $(LEVEL)/test/TestRunner.sh # Native Tool Definitions NATGCC = $(CC) From gaeke at cs.uiuc.edu Mon Jun 16 19:37:00 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon Jun 16 19:37:00 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Alloca.h BitSetVector.h CommandLine.h DataTypes.h DepthFirstIterator.h EquivalenceClasses.h GraphTraits.h HashExtras.h LeakDetector.h MathExtras.h NonCopyable.h PostOrderIterator.h STLExtras.h SetOperations.h StringExtras.h TarjanSCCIterator.h Tree.h TypeInfo.h hash_map hash_set ilist iterator slist Message-ID: <200306170036.TAA04441@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: Alloca.h updated: 1.1 -> 1.2 BitSetVector.h updated: 1.5 -> 1.6 CommandLine.h updated: 1.12 -> 1.13 DataTypes.h updated: 1.10 -> 1.11 DepthFirstIterator.h updated: 1.4 -> 1.5 EquivalenceClasses.h updated: 1.2 -> 1.3 GraphTraits.h updated: 1.2 -> 1.3 HashExtras.h updated: 1.5 -> 1.6 LeakDetector.h updated: 1.1 -> 1.2 MathExtras.h updated: 1.5 -> 1.6 NonCopyable.h updated: 1.2 -> 1.3 PostOrderIterator.h updated: 1.8 -> 1.9 STLExtras.h updated: 1.5 -> 1.6 SetOperations.h updated: 1.1 -> 1.2 StringExtras.h updated: 1.3 -> 1.4 TarjanSCCIterator.h updated: 1.5 -> 1.6 Tree.h updated: 1.3 -> 1.4 TypeInfo.h updated: 1.1 -> 1.2 hash_map updated: 1.6 -> 1.7 hash_set updated: 1.6 -> 1.7 ilist updated: 1.6 -> 1.7 iterator updated: 1.2 -> 1.3 slist updated: 1.2 -> 1.3 --- Log message: Regularize the names of #include-guards. --- Diffs of the changes: Index: llvm/include/Support/Alloca.h diff -u llvm/include/Support/Alloca.h:1.1 llvm/include/Support/Alloca.h:1.2 --- llvm/include/Support/Alloca.h:1.1 Mon Jun 16 16:53:55 2003 +++ llvm/include/Support/Alloca.h Mon Jun 16 19:35:55 2003 @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_ALLOCA_H -#define LLVM_SUPPORT_ALLOCA_H +#ifndef SUPPORT_ALLOCA_H +#define SUPPORT_ALLOCA_H // TODO: Determine HAVE_ALLOCA_H based on autoconf results. // The following method is too brittle. @@ -27,4 +27,4 @@ #include #endif -#endif /* LLVM_SUPPORT_ALLOCA_H */ +#endif /* SUPPORT_ALLOCA_H */ Index: llvm/include/Support/BitSetVector.h diff -u llvm/include/Support/BitSetVector.h:1.5 llvm/include/Support/BitSetVector.h:1.6 --- llvm/include/Support/BitSetVector.h:1.5 Wed Jun 11 09:01:21 2003 +++ llvm/include/Support/BitSetVector.h Mon Jun 16 19:35:55 2003 @@ -23,8 +23,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_BITVECTORSET_H -#define LLVM_SUPPORT_BITVECTORSET_H +#ifndef SUPPORT_BITSETVECTOR_H +#define SUPPORT_BITSETVECTOR_H #include #include Index: llvm/include/Support/CommandLine.h diff -u llvm/include/Support/CommandLine.h:1.12 llvm/include/Support/CommandLine.h:1.13 --- llvm/include/Support/CommandLine.h:1.12 Wed Jun 11 09:01:21 2003 +++ llvm/include/Support/CommandLine.h Mon Jun 16 19:35:55 2003 @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_COMMANDLINE_H -#define LLVM_SUPPORT_COMMANDLINE_H +#ifndef SUPPORT_COMMANDLINE_H +#define SUPPORT_COMMANDLINE_H #include #include Index: llvm/include/Support/DataTypes.h diff -u llvm/include/Support/DataTypes.h:1.10 llvm/include/Support/DataTypes.h:1.11 --- llvm/include/Support/DataTypes.h:1.10 Mon Jun 16 16:18:20 2003 +++ llvm/include/Support/DataTypes.h Mon Jun 16 19:35:55 2003 @@ -16,8 +16,8 @@ // TODO: This file sucks. Not only does it not work, but this stuff should be // autoconfiscated anyways. Major FIXME -#ifndef LLVM_SUPPORT_DATATYPES_H -#define LLVM_SUPPORT_DATATYPES_H +#ifndef SUPPORT_DATATYPES_H +#define SUPPORT_DATATYPES_H #define __STDC_LIMIT_MACROS 1 #include @@ -82,4 +82,4 @@ #error "include/Support/DataTypes.h could not determine endianness!" #endif -#endif /* LLVM_SUPPORT_DATATYPES_H */ +#endif /* SUPPORT_DATATYPES_H */ Index: llvm/include/Support/DepthFirstIterator.h diff -u llvm/include/Support/DepthFirstIterator.h:1.4 llvm/include/Support/DepthFirstIterator.h:1.5 --- llvm/include/Support/DepthFirstIterator.h:1.4 Sun Oct 27 20:11:16 2002 +++ llvm/include/Support/DepthFirstIterator.h Mon Jun 16 19:35:55 2003 @@ -5,8 +5,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_DEPTH_FIRST_ITERATOR_H -#define LLVM_SUPPORT_DEPTH_FIRST_ITERATOR_H +#ifndef SUPPORT_DEPTHFIRSTITERATOR_H +#define SUPPORT_DEPTHFIRSTITERATOR_H #include "Support/GraphTraits.h" #include "Support/iterator" Index: llvm/include/Support/EquivalenceClasses.h diff -u llvm/include/Support/EquivalenceClasses.h:1.2 llvm/include/Support/EquivalenceClasses.h:1.3 --- llvm/include/Support/EquivalenceClasses.h:1.2 Wed Jun 4 03:00:05 2003 +++ llvm/include/Support/EquivalenceClasses.h Mon Jun 16 19:35:55 2003 @@ -8,8 +8,8 @@ // //===------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_EQUIVALENCE_CLASSES_H -#define LLVM_SUPPORT_EQUIVALENCE_CLASSES_H +#ifndef SUPPORT_EQUIVALENCECLASSES_H +#define SUPPORT_EQUIVALENCECLASSES_H #include #include Index: llvm/include/Support/GraphTraits.h diff -u llvm/include/Support/GraphTraits.h:1.2 llvm/include/Support/GraphTraits.h:1.3 --- llvm/include/Support/GraphTraits.h:1.2 Sun Oct 13 12:12:05 2002 +++ llvm/include/Support/GraphTraits.h Mon Jun 16 19:35:55 2003 @@ -8,8 +8,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_GRAPH_TRAITS_H -#define LLVM_SUPPORT_GRAPH_TRAITS_H +#ifndef SUPPORT_GRAPHTRAITS_H +#define SUPPORT_GRAPHTRAITS_H // GraphTraits - This class should be specialized by different graph types... // which is why the default version is empty. Index: llvm/include/Support/HashExtras.h diff -u llvm/include/Support/HashExtras.h:1.5 llvm/include/Support/HashExtras.h:1.6 --- llvm/include/Support/HashExtras.h:1.5 Sun Oct 27 20:11:16 2002 +++ llvm/include/Support/HashExtras.h Mon Jun 16 19:35:55 2003 @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_HASHEXTRAS_H -#define LLVM_SUPPORT_HASHEXTRAS_H +#ifndef SUPPORT_HASHEXTRAS_H +#define SUPPORT_HASHEXTRAS_H #include #include "Support/hash_map" Index: llvm/include/Support/LeakDetector.h diff -u llvm/include/Support/LeakDetector.h:1.1 llvm/include/Support/LeakDetector.h:1.2 --- llvm/include/Support/LeakDetector.h:1.1 Sun Sep 8 13:51:12 2002 +++ llvm/include/Support/LeakDetector.h Mon Jun 16 19:35:55 2003 @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_LEAK_DETECTOR_H -#define SUPPORT_LEAK_DETECTOR_H +#ifndef SUPPORT_LEAKDETECTOR_H +#define SUPPORT_LEAKDETECTOR_H #include class Value; Index: llvm/include/Support/MathExtras.h diff -u llvm/include/Support/MathExtras.h:1.5 llvm/include/Support/MathExtras.h:1.6 --- llvm/include/Support/MathExtras.h:1.5 Sun Oct 27 20:11:16 2002 +++ llvm/include/Support/MathExtras.h Mon Jun 16 19:35:55 2003 @@ -4,8 +4,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_MATH_EXTRAS_H -#define SUPPORT_MATH_EXTRAS_H +#ifndef SUPPORT_MATHEXTRAS_H +#define SUPPORT_MATHEXTRAS_H #include "Support/DataTypes.h" Index: llvm/include/Support/NonCopyable.h diff -u llvm/include/Support/NonCopyable.h:1.2 llvm/include/Support/NonCopyable.h:1.3 --- llvm/include/Support/NonCopyable.h:1.2 Tue Jun 3 10:30:48 2003 +++ llvm/include/Support/NonCopyable.h Mon Jun 16 19:35:55 2003 @@ -9,8 +9,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_NONCOPYABLE_H -#define LLVM_SUPPORT_NONCOPYABLE_H +#ifndef SUPPORT_NONCOPYABLE_H +#define SUPPORT_NONCOPYABLE_H class NonCopyable { // Disable the copy constructor and the assignment operator Index: llvm/include/Support/PostOrderIterator.h diff -u llvm/include/Support/PostOrderIterator.h:1.8 llvm/include/Support/PostOrderIterator.h:1.9 --- llvm/include/Support/PostOrderIterator.h:1.8 Fri Mar 21 15:40:39 2003 +++ llvm/include/Support/PostOrderIterator.h Mon Jun 16 19:35:55 2003 @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_POSTORDER_ITERATOR_H -#define LLVM_SUPPORT_POSTORDER_ITERATOR_H +#ifndef SUPPORT_POSTORDERITERATOR_H +#define SUPPORT_POSTORDERITERATOR_H #include "Support/GraphTraits.h" #include "Support/iterator" Index: llvm/include/Support/STLExtras.h diff -u llvm/include/Support/STLExtras.h:1.5 llvm/include/Support/STLExtras.h:1.6 --- llvm/include/Support/STLExtras.h:1.5 Sun Oct 27 13:16:27 2002 +++ llvm/include/Support/STLExtras.h Mon Jun 16 19:35:55 2003 @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_STL_EXTRAS_H -#define LLVM_SUPPORT_STL_EXTRAS_H +#ifndef SUPPORT_STLEXTRAS_H +#define SUPPORT_STLEXTRAS_H #include #include "Support/iterator" Index: llvm/include/Support/SetOperations.h diff -u llvm/include/Support/SetOperations.h:1.1 llvm/include/Support/SetOperations.h:1.2 --- llvm/include/Support/SetOperations.h:1.1 Mon Feb 4 21:35:10 2002 +++ llvm/include/Support/SetOperations.h Mon Jun 16 19:35:55 2003 @@ -5,8 +5,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_SET_OPERATIONS_H -#define LLVM_SUPPORT_SET_OPERATIONS_H +#ifndef SUPPORT_SETOPERATIONS_H +#define SUPPORT_SETOPERATIONS_H // set_union(A, B) - Compute A := A u B, return whether A changed. // Index: llvm/include/Support/StringExtras.h diff -u llvm/include/Support/StringExtras.h:1.3 llvm/include/Support/StringExtras.h:1.4 --- llvm/include/Support/StringExtras.h:1.3 Sun Apr 7 03:36:19 2002 +++ llvm/include/Support/StringExtras.h Mon Jun 16 19:35:55 2003 @@ -4,8 +4,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_STRING_EXTRAS_H -#define SUPPORT_STRING_EXTRAS_H +#ifndef SUPPORT_STRINGEXTRAS_H +#define SUPPORT_STRINGEXTRAS_H #include "Support/DataTypes.h" #include Index: llvm/include/Support/TarjanSCCIterator.h diff -u llvm/include/Support/TarjanSCCIterator.h:1.5 llvm/include/Support/TarjanSCCIterator.h:1.6 --- llvm/include/Support/TarjanSCCIterator.h:1.5 Wed Jun 11 09:01:21 2003 +++ llvm/include/Support/TarjanSCCIterator.h Mon Jun 16 19:35:55 2003 @@ -11,8 +11,8 @@ // (NOTE: This requires some simple wrappers and is not supported yet.) //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_TARJANSCC_ITERATOR_H -#define LLVM_SUPPORT_TARJANSCC_ITERATOR_H +#ifndef SUPPORT_TARJANSCCITERATOR_H +#define SUPPORT_TARJANSCCITERATOR_H #include "Support/GraphTraits.h" #include Index: llvm/include/Support/Tree.h diff -u llvm/include/Support/Tree.h:1.3 llvm/include/Support/Tree.h:1.4 --- llvm/include/Support/Tree.h:1.3 Wed Jun 11 09:01:21 2003 +++ llvm/include/Support/Tree.h Mon Jun 16 19:35:55 2003 @@ -5,8 +5,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_TREE_H -#define LLVM_SUPPORT_TREE_H +#ifndef SUPPORT_TREE_H +#define SUPPORT_TREE_H #include Index: llvm/include/Support/TypeInfo.h diff -u llvm/include/Support/TypeInfo.h:1.1 llvm/include/Support/TypeInfo.h:1.2 --- llvm/include/Support/TypeInfo.h:1.1 Tue Jul 23 12:56:53 2002 +++ llvm/include/Support/TypeInfo.h Mon Jun 16 19:35:55 2003 @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_TYPEINFO_H -#define LLVM_SUPPORT_TYPEINFO_H +#ifndef SUPPORT_TYPEINFO_H +#define SUPPORT_TYPEINFO_H #include Index: llvm/include/Support/hash_map diff -u llvm/include/Support/hash_map:1.6 llvm/include/Support/hash_map:1.7 --- llvm/include/Support/hash_map:1.6 Fri Jan 31 22:14:28 2003 +++ llvm/include/Support/hash_map Mon Jun 16 19:35:55 2003 @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_HASHMAP_H -#define SUPPORT_HASHMAP_H +#ifndef SUPPORT_HASH_MAP +#define SUPPORT_HASH_MAP // Compiler Support Matrix // Index: llvm/include/Support/hash_set diff -u llvm/include/Support/hash_set:1.6 llvm/include/Support/hash_set:1.7 --- llvm/include/Support/hash_set:1.6 Fri Nov 8 08:07:33 2002 +++ llvm/include/Support/hash_set Mon Jun 16 19:35:55 2003 @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_HASHSET_H -#define SUPPORT_HASHSET_H +#ifndef SUPPORT_HASH_SET +#define SUPPORT_HASH_SET // Compiler Support Matrix // Index: llvm/include/Support/ilist diff -u llvm/include/Support/ilist:1.6 llvm/include/Support/ilist:1.7 --- llvm/include/Support/ilist:1.6 Wed Apr 23 11:17:53 2003 +++ llvm/include/Support/ilist Mon Jun 16 19:35:55 2003 @@ -28,8 +28,8 @@ // //===----------------------------------------------------------------------===// -#ifndef INCLUDED_SUPPORT_ILIST -#define INCLUDED_SUPPORT_ILIST +#ifndef SUPPORT_ILIST +#define SUPPORT_ILIST #include #include Index: llvm/include/Support/iterator diff -u llvm/include/Support/iterator:1.2 llvm/include/Support/iterator:1.3 --- llvm/include/Support/iterator:1.2 Wed Jul 24 17:07:13 2002 +++ llvm/include/Support/iterator Mon Jun 16 19:35:55 2003 @@ -16,8 +16,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_ITERATOR_H -#define SUPPORT_ITERATOR_H +#ifndef SUPPORT_ITERATOR +#define SUPPORT_ITERATOR #include Index: llvm/include/Support/slist diff -u llvm/include/Support/slist:1.2 llvm/include/Support/slist:1.3 --- llvm/include/Support/slist:1.2 Sun Feb 23 22:40:35 2003 +++ llvm/include/Support/slist Mon Jun 16 19:35:55 2003 @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_SLIST_H -#define SUPPORT_SLIST_H +#ifndef SUPPORT_SLIST +#define SUPPORT_SLIST // Compiler Support Matrix // From lattner at cs.uiuc.edu Mon Jun 16 22:58:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 22:58:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/GCSE.cpp Message-ID: <200306170357.WAA28893@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: GCSE.cpp updated: 1.27 -> 1.28 --- Log message: Don't corrupt memory when removing an instruction from the program, but not the worklist --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/GCSE.cpp diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.27 llvm/lib/Transforms/Scalar/GCSE.cpp:1.28 --- llvm/lib/Transforms/Scalar/GCSE.cpp:1.27 Fri Jan 31 22:50:59 2003 +++ llvm/lib/Transforms/Scalar/GCSE.cpp Mon Jun 16 22:57:18 2003 @@ -120,6 +120,7 @@ // Erase the instruction from the program. I->getParent()->getInstList().erase(I); + WorkList.erase(I); } return true; From lattner at cs.uiuc.edu Mon Jun 16 23:40:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Jun 16 23:40:02 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200306170439.XAA31445@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.95 -> 1.96 --- Log message: Fairly major change: emit fixed sized allocas in the entry block as a variable, instead of a variable pointer and an alloca. All accesses to the variable then use the address-of operator to access it. This plays better with the internal GCC code generation phases, which bail early on functions which contain allocas. It also makes the code a bit easier to read. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.95 llvm/lib/CWriter/Writer.cpp:1.96 --- llvm/lib/CWriter/Writer.cpp:1.95 Mon Jun 16 18:57:13 2003 +++ llvm/lib/CWriter/Writer.cpp Mon Jun 16 23:39:14 2003 @@ -97,6 +97,20 @@ return I.getParent() == cast(I.use_back())->getParent(); } + // isDirectAlloca - Define fixed sized allocas in the entry block as direct + // variables which are accessed with the & operator. This causes GCC to + // generate significantly better code than to emit alloca calls directly. + // + static const AllocaInst *isDirectAlloca(const Value *V) { + const AllocaInst *AI = dyn_cast(V); + if (!AI) return false; + if (AI->isArrayAllocation()) + return 0; // FIXME: we can also inline fixed size array allocas! + if (AI->getParent() != &AI->getParent()->getParent()->getEntryNode()) + return 0; + return AI; + } + // Instruction visitation functions friend class InstVisitor; @@ -463,7 +477,7 @@ void CWriter::writeOperandInternal(Value *Operand) { if (Instruction *I = dyn_cast(Operand)) - if (isInlinableInst(*I)) { + if (isInlinableInst(*I) && !isDirectAlloca(I)) { // Should we inline this instruction to build a tree? Out << "("; visit(*I); @@ -483,12 +497,12 @@ } void CWriter::writeOperand(Value *Operand) { - if (isa(Operand)) + if (isa(Operand) || isDirectAlloca(Operand)) Out << "(&"; // Global variables are references as their addresses by llvm writeOperandInternal(Operand); - if (isa(Operand)) + if (isa(Operand) || isDirectAlloca(Operand)) Out << ")"; } @@ -792,11 +806,15 @@ // print local variable information for the function for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) - if ((*I)->getType() != Type::VoidTy && !isInlinableInst(**I)) { + if (const AllocaInst *AI = isDirectAlloca(*I)) { + Out << " "; + printType(Out, AI->getAllocatedType(), getValueName(AI)); + Out << "; /* Address exposed local */\n"; + } else if ((*I)->getType() != Type::VoidTy && !isInlinableInst(**I)) { Out << " "; printType(Out, (*I)->getType(), getValueName(*I)); Out << ";\n"; - + if (isa(*I)) { // Print out PHI node temporaries as well... Out << " "; printType(Out, (*I)->getType(), getValueName(*I)+"__PHI_TEMPORARY"); @@ -856,7 +874,7 @@ // Output all of the instructions in the basic block... for (BasicBlock::iterator II = BB->begin(), E = --BB->end(); II != E; ++II){ - if (!isInlinableInst(*II)) { + if (!isInlinableInst(*II) && !isDirectAlloca(II)) { if (II->getType() != Type::VoidTy) outputLValue(II); else @@ -1132,6 +1150,8 @@ } else if (ConstantPointerRef *CPR = dyn_cast(Ptr)) { HasImplicitAddress = true; Ptr = CPR->getValue(); // Get to the global... + } else if (isDirectAlloca(Ptr)) { + HasImplicitAddress = true; } if (I == E) { From lattner at cs.uiuc.edu Tue Jun 17 08:22:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 08:22:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Assembler/2003-06-17-InvokeDisassemble.llx Message-ID: <200306171321.IAA01063@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Assembler: 2003-06-17-InvokeDisassemble.llx added (r1.1) --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Assembler/2003-06-17-InvokeDisassemble.llx diff -c /dev/null llvm/test/Regression/Assembler/2003-06-17-InvokeDisassemble.llx:1.1 *** /dev/null Tue Jun 17 08:21:23 2003 --- llvm/test/Regression/Assembler/2003-06-17-InvokeDisassemble.llx Tue Jun 17 08:21:13 2003 *************** *** 0 **** --- 1,6 ---- + ; RUN: as < %s | dis + void %test() { + invoke void %test() to label %Next except label %Next + Next: + ret void + } From lattner at cs.uiuc.edu Tue Jun 17 08:32:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 08:32:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReadInst.cpp Message-ID: <200306171331.IAA01491@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReadInst.cpp updated: 1.42 -> 1.43 --- Log message: Fix bug: Assembler/2003-06-17-InvokeDisassemble.llx "yes, invoke instructions can have just three arguments" --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReadInst.cpp diff -u llvm/lib/Bytecode/Reader/ReadInst.cpp:1.42 llvm/lib/Bytecode/Reader/ReadInst.cpp:1.43 --- llvm/lib/Bytecode/Reader/ReadInst.cpp:1.42 Thu May 22 13:08:30 2003 +++ llvm/lib/Bytecode/Reader/ReadInst.cpp Tue Jun 17 08:31:10 2003 @@ -302,16 +302,19 @@ if (Raw.NumOperands < 3) return true; Normal = cast(getValue(Type::LabelTy, Raw.Arg2)); - Except = cast(getValue(Type::LabelTy, args[0])); + if (Raw.NumOperands == 3) + Except = cast(getValue(Type::LabelTy, Raw.Arg3)); + else { + Except = cast(getValue(Type::LabelTy, args[0])); - FunctionType::ParamTypes::const_iterator It = PL.begin(); - for (unsigned i = 1; i < args.size(); i++) { - if (It == PL.end()) return true; - // TODO: Check getValue for null! - Params.push_back(getValue(*It++, args[i])); + FunctionType::ParamTypes::const_iterator It = PL.begin(); + for (unsigned i = 1; i < args.size(); i++) { + if (It == PL.end()) return true; + // TODO: Check getValue for null! + Params.push_back(getValue(*It++, args[i])); + } + if (It != PL.end()) return true; } - - if (It != PL.end()) return true; } else { if (args.size() < 4) return true; @@ -326,7 +329,8 @@ } } - delete Raw.VarArgs; + if (Raw.NumOperands > 3) + delete Raw.VarArgs; Res = new InvokeInst(M, Normal, Except, Params); return false; } From lattner at cs.uiuc.edu Tue Jun 17 09:31:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 09:31:00 2003 Subject: [llvm-commits] CVS: llvm/utils/Burg/Makefile Message-ID: <200306171430.JAA01692@apoc.cs.uiuc.edu> Changes in directory llvm/utils/Burg: Makefile updated: 1.13 -> 1.14 --- Log message: Fix misspelling of ExtraSources, hopefully to unbreak the nightly tester Remove evil rcs tag :) --- Diffs of the changes: Index: llvm/utils/Burg/Makefile diff -u llvm/utils/Burg/Makefile:1.13 llvm/utils/Burg/Makefile:1.14 --- llvm/utils/Burg/Makefile:1.13 Wed Jun 11 08:57:48 2003 +++ llvm/utils/Burg/Makefile Tue Jun 17 09:30:21 2003 @@ -1,7 +1,6 @@ -# $Id: Makefile,v 1.13 2003/06/11 13:57:48 criswell Exp $ LEVEL = ../.. TOOLNAME = burg -EXTRASOURCES = gram.tab.c +ExtraSource = gram.tab.c include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Tue Jun 17 10:08:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:08:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisCounter.cpp Message-ID: <200306171507.KAA20630@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysisCounter.cpp updated: 1.3 -> 1.4 --- Log message: Avoid divide by zero errors --- Diffs of the changes: Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.3 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.4 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.3 Wed Feb 26 13:27:05 2003 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue Jun 17 10:07:20 2003 @@ -32,23 +32,27 @@ << "\n===== Alias Analysis Counter Report =====\n" << " Analysis counted: " << Name << "\n" << " " << AASum << " Total Alias Queries Performed\n"; - printLine("no alias", No, AASum); - printLine("may alias", May, AASum); - printLine("must alias", Must, AASum); - std::cerr - << " Alias Analysis Counter Summary: " << No*100/AASum << "%/" - << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n"; + if (AASum) { + printLine("no alias", No, AASum); + printLine("may alias", May, AASum); + printLine("must alias", Must, AASum); + std::cerr + << " Alias Analysis Counter Summary: " << No*100/AASum << "%/" + << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n"; + } std::cerr << " " << MRSum << " Total Mod/Ref Queries Performed\n"; - printLine("no mod/ref", NoMR, MRSum); - printLine("ref", JustRef, MRSum); - printLine("mod", JustMod, MRSum); - printLine("mod/ref", MR, MRSum); - std::cerr - << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/" - << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/" - << MR*100/MRSum <<"%\n\n"; + if (MRSum) { + printLine("no mod/ref", NoMR, MRSum); + printLine("ref", JustRef, MRSum); + printLine("mod", JustMod, MRSum); + printLine("mod/ref", MR, MRSum); + std::cerr + << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/" + << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/" + << MR*100/MRSum <<"%\n\n"; + } } } From lattner at cs.uiuc.edu Tue Jun 17 10:17:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:17:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/BasicAA/featuretest.ll Message-ID: <200306171516.KAA21122@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/BasicAA: featuretest.ll updated: 1.6 -> 1.7 --- Log message: Add new testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/BasicAA/featuretest.ll diff -u llvm/test/Regression/Transforms/BasicAA/featuretest.ll:1.6 llvm/test/Regression/Transforms/BasicAA/featuretest.ll:1.7 --- llvm/test/Regression/Transforms/BasicAA/featuretest.ll:1.6 Wed Feb 26 16:01:58 2003 +++ llvm/test/Regression/Transforms/BasicAA/featuretest.ll Tue Jun 17 10:16:35 2003 @@ -6,6 +6,10 @@ ; RUN: else exit 0 ; RUN: fi +%Global = external global { int } + +implementation + ; Array test: Test that operations on one local array do not invalidate ; operations on another array. Important for scientific codes. @@ -71,4 +75,14 @@ %C = getelementptr sbyte* %B, long 4 %Y = load sbyte* %C ret int 8 +} + +; Test that we can disambiguate globals reached through constantexpr geps +int %constexpr_test() { + %X = alloca int + %Y = load int* %X + store int 5, int* getelementptr ({ int }* %Global, long 0, ubyte 0) + %REMOVE = load int* %X + %retval = sub int %Y, %REMOVE + ret int %retval } From lattner at cs.uiuc.edu Tue Jun 17 10:26:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200306171525.KAA21929@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.10 -> 1.11 --- Log message: Implement handling of constantexprs for disambiguation. This implements BasicAA/featuretest.ll:constexpr_test --- Diffs of the changes: Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.10 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.11 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.10 Mon Jun 2 00:42:39 2003 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue Jun 17 10:25:37 2003 @@ -69,6 +69,12 @@ if (const Instruction *I = dyn_cast(V)) { if (isa(I) || isa(I)) return getUnderlyingObject(I->getOperand(0)); + } else if (const ConstantExpr *CE = dyn_cast(V)) { + if (CE->getOpcode() == Instruction::Cast || + CE->getOpcode() == Instruction::GetElementPtr) + return getUnderlyingObject(CE->getOperand(0)); + } else if (const ConstantPointerRef *CPR = dyn_cast(V)) { + return CPR->getValue(); } return 0; } From lattner at cs.uiuc.edu Tue Jun 17 10:33:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:33:00 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/JIT.cpp Message-ID: <200306171532.KAA21999@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: JIT.cpp updated: 1.7 -> 1.8 --- Log message: #ifdef out code that only applies when the HOSTARCH = sparc --- Diffs of the changes: Index: llvm/tools/lli/JIT/JIT.cpp diff -u llvm/tools/lli/JIT/JIT.cpp:1.7 llvm/tools/lli/JIT/JIT.cpp:1.8 --- llvm/tools/lli/JIT/JIT.cpp:1.7 Fri Jun 6 01:59:55 2003 +++ llvm/tools/lli/JIT/JIT.cpp Tue Jun 17 10:32:38 2003 @@ -27,7 +27,6 @@ #else ""; #endif - } /// createJIT - Create an return a new JIT compiler if there is one available @@ -44,8 +43,10 @@ // our X86 machines are much faster at recompiling LLVM and linking lli. if (Arch == "x86") { TargetMachineAllocator = allocateX86TargetMachine; +#if defined(sparc) || defined(__sparc__) || defined(__sparcv9) } else if (Arch == "sparc") { TargetMachineAllocator = allocateSparcTargetMachine; +#endif } if (TargetMachineAllocator) { @@ -68,6 +69,7 @@ setupPassManager(); +#if defined(sparc) || defined(__sparc__) || defined(__sparcv9) // THIS GOES BEYOND UGLY HACKS if (TM.getName() == "UltraSparc-Native") { extern Pass *createPreSelectionPass(TargetMachine &TM); @@ -77,6 +79,7 @@ PM.add(createPreSelectionPass(TM)); PM.run(*M); } +#endif emitGlobals(); } From lattner at cs.uiuc.edu Tue Jun 17 10:44:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:44:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306171543.KAA22412@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.24 -> 1.25 --- Log message: Use more structured command line option processing --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.24 llvm/tools/lli/Makefile:1.25 --- llvm/tools/lli/Makefile:1.24 Tue May 27 16:42:05 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 10:43:10 2003 @@ -2,25 +2,9 @@ TOOLNAME = lli PARALLEL_DIRS = Interpreter JIT -# FIXME: This enables testing the Sparc JIT on x86. -# Perhaps in the future this should be a ./configure option. - -# Generic JIT libraries -JITLIBS = lli-jit codegen -ARCHLIBS = - -# What the X86 JIT requires -JITLIBS += x86 -ARCHLIBS += - -# What the Sparc JIT requires -JITLIBS += sparc -ARCHLIBS = sched livevar instrument.a profpaths transformutils.a \ - bcwriter transforms.a ipo.a ipa.a datastructure.a regalloc \ - mapping select postopts.a preopts - -USEDLIBS = lli-interpreter $(JITLIBS) bcreader vmcore scalaropts \ - analysis.a support.a target.a $(ARCHLIBS) +JITLIBS = lli-jit codegen x86 +USEDLIBS = lli-interpreter $(JITLIBS) bcreader vmcore scalaropts.a \ + analysis.a support.a target.a # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From lattner at cs.uiuc.edu Tue Jun 17 10:44:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:44:04 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/JIT.cpp Message-ID: <200306171543.KAA22419@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: JIT.cpp updated: 1.8 -> 1.9 --- Log message: Use more structured command line option processing --- Diffs of the changes: Index: llvm/tools/lli/JIT/JIT.cpp diff -u llvm/tools/lli/JIT/JIT.cpp:1.8 llvm/tools/lli/JIT/JIT.cpp:1.9 --- llvm/tools/lli/JIT/JIT.cpp:1.8 Tue Jun 17 10:32:38 2003 +++ llvm/tools/lli/JIT/JIT.cpp Tue Jun 17 10:43:13 2003 @@ -15,18 +15,23 @@ #include "llvm/PassManager.h" namespace { - cl::opt - Arch("march", cl::desc("Architecture: `x86' or `sparc'"), cl::Prefix, - cl::value_desc("machine architecture")); - - static std::string DefaultArch = + enum ArchName { nojit, x86, sparc }; + + cl::opt + Arch("march", cl::desc("Architecture to JIT to:"), cl::Prefix, + cl::values(clEnumVal(x86, " IA-32 (pentium and above)"), +#if defined(sparc) || defined(__sparc__) || defined(__sparcv9) + clEnumVal(sparc, " Sparc-V9"), +#endif + 0), #if defined(i386) || defined(__i386__) || defined(__x86__) - "x86"; + cl::init(x86) #elif defined(sparc) || defined(__sparc__) || defined(__sparcv9) - "sparc"; + cl::init(sparc) #else - ""; + cl::init(nojit) #endif + ); } /// createJIT - Create an return a new JIT compiler if there is one available @@ -35,30 +40,31 @@ ExecutionEngine *ExecutionEngine::createJIT(Module *M, unsigned Config) { TargetMachine* (*TargetMachineAllocator)(unsigned) = 0; - if (Arch == "") - Arch = DefaultArch; // Allow a command-line switch to override what *should* be the default target // machine for this platform. This allows for debugging a Sparc JIT on X86 -- // our X86 machines are much faster at recompiling LLVM and linking lli. - if (Arch == "x86") { + switch (Arch) { + case x86: TargetMachineAllocator = allocateX86TargetMachine; + break; #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) - } else if (Arch == "sparc") { + case sparc: TargetMachineAllocator = allocateSparcTargetMachine; + break; #endif - } - - if (TargetMachineAllocator) { - // Allocate a target... - TargetMachine *Target = (*TargetMachineAllocator)(Config); - assert(Target && "Could not allocate target machine!"); - - // Create the virtual machine object... - return new VM(M, Target); - } else { + default: + assert(0 && "-march flag not supported on this host!"); + case nojit: return 0; } + + // Allocate a target... + TargetMachine *Target = (*TargetMachineAllocator)(Config); + assert(Target && "Could not allocate target machine!"); + + // Create the virtual machine object... + return new VM(M, Target); } VM::VM(Module *M, TargetMachine *tm) : ExecutionEngine(M), TM(*tm) { From lattner at cs.uiuc.edu Tue Jun 17 10:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:47:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306171546.KAA22582@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.25 -> 1.26 --- Log message: Whoops, didn't mean to check that in :( --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.25 llvm/tools/lli/Makefile:1.26 --- llvm/tools/lli/Makefile:1.25 Tue Jun 17 10:43:10 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 10:46:34 2003 @@ -2,9 +2,25 @@ TOOLNAME = lli PARALLEL_DIRS = Interpreter JIT -JITLIBS = lli-jit codegen x86 -USEDLIBS = lli-interpreter $(JITLIBS) bcreader vmcore scalaropts.a \ - analysis.a support.a target.a +# FIXME: This enables testing the Sparc JIT on x86. +# Perhaps in the future this should be a ./configure option. + +# Generic JIT libraries +JITLIBS = lli-jit codegen +ARCHLIBS = + +# What the X86 JIT requires +JITLIBS += x86 +ARCHLIBS += + +# What the Sparc JIT requires +JITLIBS += sparc +ARCHLIBS = sched livevar instrument.a profpaths transformutils.a \ + bcwriter transforms.a ipo.a ipa.a datastructure.a regalloc \ + mapping select postopts.a preopts + +USEDLIBS = lli-interpreter $(JITLIBS) bcreader vmcore scalaropts \ + analysis.a support.a target.a $(ARCHLIBS) # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From lattner at cs.uiuc.edu Tue Jun 17 10:56:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:56:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306171555.KAA23887@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.26 -> 1.27 --- Log message: Do not link in the Sparc JIT when building on X86. Eventually the sparc will not link in the X86 JIT either, but this makes testing easier. For some reason, the sparc JIT was breaking the X86 JIT when it was linked in. :( --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.26 llvm/tools/lli/Makefile:1.27 --- llvm/tools/lli/Makefile:1.26 Tue Jun 17 10:46:34 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 10:54:52 2003 @@ -2,25 +2,25 @@ TOOLNAME = lli PARALLEL_DIRS = Interpreter JIT -# FIXME: This enables testing the Sparc JIT on x86. -# Perhaps in the future this should be a ./configure option. - # Generic JIT libraries JITLIBS = lli-jit codegen ARCHLIBS = # What the X86 JIT requires JITLIBS += x86 -ARCHLIBS += +# X86 doesn't require any ARCHLIBS # What the Sparc JIT requires +ifeq ($(ARCH),Sparc) JITLIBS += sparc ARCHLIBS = sched livevar instrument.a profpaths transformutils.a \ bcwriter transforms.a ipo.a ipa.a datastructure.a regalloc \ mapping select postopts.a preopts -USEDLIBS = lli-interpreter $(JITLIBS) bcreader vmcore scalaropts \ - analysis.a support.a target.a $(ARCHLIBS) +endif + +USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) bcreader vmcore scalaropts.a \ + analysis.a support.a target.a # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From lattner at cs.uiuc.edu Tue Jun 17 10:56:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 10:56:04 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/JIT.cpp Message-ID: <200306171555.KAA23892@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: JIT.cpp updated: 1.9 -> 1.10 --- Log message: Apparently "sparc" is a macro on sparcs. Ugh. :) --- Diffs of the changes: Index: llvm/tools/lli/JIT/JIT.cpp diff -u llvm/tools/lli/JIT/JIT.cpp:1.9 llvm/tools/lli/JIT/JIT.cpp:1.10 --- llvm/tools/lli/JIT/JIT.cpp:1.9 Tue Jun 17 10:43:13 2003 +++ llvm/tools/lli/JIT/JIT.cpp Tue Jun 17 10:54:02 2003 @@ -15,19 +15,19 @@ #include "llvm/PassManager.h" namespace { - enum ArchName { nojit, x86, sparc }; + enum ArchName { nojit, x86, Sparc }; cl::opt Arch("march", cl::desc("Architecture to JIT to:"), cl::Prefix, cl::values(clEnumVal(x86, " IA-32 (pentium and above)"), #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) - clEnumVal(sparc, " Sparc-V9"), + clEnumValN(Sparc, "sparc", " Sparc-V9"), #endif 0), #if defined(i386) || defined(__i386__) || defined(__x86__) cl::init(x86) #elif defined(sparc) || defined(__sparc__) || defined(__sparcv9) - cl::init(sparc) + cl::init(Sparc) #else cl::init(nojit) #endif @@ -49,7 +49,7 @@ TargetMachineAllocator = allocateX86TargetMachine; break; #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) - case sparc: + case Sparc: TargetMachineAllocator = allocateSparcTargetMachine; break; #endif From lattner at cs.uiuc.edu Tue Jun 17 12:54:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 12:54:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306171753.MAA05215@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.27 -> 1.28 --- Log message: Make sure to get the value of ARCH before we use it --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.27 llvm/tools/lli/Makefile:1.28 --- llvm/tools/lli/Makefile:1.27 Tue Jun 17 10:54:52 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 12:53:35 2003 @@ -2,6 +2,9 @@ TOOLNAME = lli PARALLEL_DIRS = Interpreter JIT +# Get the config name... +include $(LEVEL)/Makefile.config + # Generic JIT libraries JITLIBS = lli-jit codegen ARCHLIBS = @@ -9,6 +12,8 @@ # What the X86 JIT requires JITLIBS += x86 # X86 doesn't require any ARCHLIBS + + # What the Sparc JIT requires ifeq ($(ARCH),Sparc) From lattner at cs.uiuc.edu Tue Jun 17 13:21:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 13:21:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306171820.NAA05456@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.28 -> 1.29 --- Log message: The never-ending odyssey trying to get sparc to link --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.28 llvm/tools/lli/Makefile:1.29 --- llvm/tools/lli/Makefile:1.28 Tue Jun 17 12:53:35 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 13:19:52 2003 @@ -3,7 +3,7 @@ PARALLEL_DIRS = Interpreter JIT # Get the config name... -include $(LEVEL)/Makefile.config +include $(LEVEL)/Makefile.$(shell uname) # Generic JIT libraries JITLIBS = lli-jit codegen From lattner at cs.uiuc.edu Tue Jun 17 14:16:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 14:16:02 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306171915.OAA07885@apoc.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.29 -> 1.30 --- Log message: Life is too short. Link in too much stuff on Linux to make building on sun easier --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.29 llvm/tools/lli/Makefile:1.30 --- llvm/tools/lli/Makefile:1.29 Tue Jun 17 13:19:52 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 14:14:59 2003 @@ -18,14 +18,13 @@ # What the Sparc JIT requires ifeq ($(ARCH),Sparc) JITLIBS += sparc -ARCHLIBS = sched livevar instrument.a profpaths transformutils.a \ +ARCHLIBS = sched livevar instrument.a profpaths \ bcwriter transforms.a ipo.a ipa.a datastructure.a regalloc \ mapping select postopts.a preopts - endif -USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) bcreader vmcore scalaropts.a \ - analysis.a support.a target.a +USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ + transformutils.a bcreader vmcore support.a target.a # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From lattner at cs.uiuc.edu Tue Jun 17 14:51:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 14:51:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h Message-ID: <200306171950.OAA08632@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CallSite.h updated: 1.1 -> 1.2 --- Log message: Make CallSite's default constructable, copyable, and assignable (explicitly) --- Diffs of the changes: Index: llvm/include/llvm/Support/CallSite.h diff -u llvm/include/llvm/Support/CallSite.h:1.1 llvm/include/llvm/Support/CallSite.h:1.2 --- llvm/include/llvm/Support/CallSite.h:1.1 Mon Feb 24 14:35:45 2003 +++ llvm/include/llvm/Support/CallSite.h Tue Jun 17 14:50:28 2003 @@ -16,8 +16,11 @@ class CallSite { Instruction *I; public: + CallSite() : I(0) {} CallSite(CallInst *CI) : I((Instruction*)CI) {} CallSite(InvokeInst *II) : I((Instruction*)II) {} + CallSite(const CallSite &CS) : I(CS.I) {} + CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; } /// getCalledValue - Return the pointer to function that is being called... /// From gaeke at cs.uiuc.edu Tue Jun 17 14:55:04 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 14:55:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200306171954.OAA08632@neo.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.18 -> 1.19 --- Log message: Put ifdefs around use of malloc.h/mallinfo, which isn't available on FreeBSD. --- Diffs of the changes: Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.18 llvm/lib/Support/Timer.cpp:1.19 --- llvm/lib/Support/Timer.cpp:1.18 Fri Jun 6 17:13:01 2003 +++ llvm/lib/Support/Timer.cpp Tue Jun 17 14:54:00 2003 @@ -10,7 +10,9 @@ #include #include #include +#ifndef __FreeBSD__ #include +#endif // __FreeBSD__ #include #include #include @@ -75,12 +77,13 @@ } static long getMemUsage() { +#ifndef __FreeBSD__ if (TrackSpace) { struct mallinfo MI = mallinfo(); return MI.uordblks/*+MI.hblkhd*/; - } else { - return 0; } +#endif // __FreeBSD__ + return 0; } struct TimeRecord { From gaeke at cs.uiuc.edu Tue Jun 17 15:00:02 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:00:02 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Interpreter/ExternalFunctions.cpp Message-ID: <200306171959.OAA08820@neo.cs.uiuc.edu> Changes in directory llvm/tools/lli/Interpreter: ExternalFunctions.cpp updated: 1.52 -> 1.53 --- Log message: Use std::isnan instead of isnan. Brought back to you from the future, by the reconciliation of the C++ and C99 standards. Someday. --- Diffs of the changes: Index: llvm/tools/lli/Interpreter/ExternalFunctions.cpp diff -u llvm/tools/lli/Interpreter/ExternalFunctions.cpp:1.52 llvm/tools/lli/Interpreter/ExternalFunctions.cpp:1.53 --- llvm/tools/lli/Interpreter/ExternalFunctions.cpp:1.52 Wed May 14 09:21:30 2003 +++ llvm/tools/lli/Interpreter/ExternalFunctions.cpp Tue Jun 17 14:59:17 2003 @@ -221,7 +221,7 @@ GenericValue lle_X_isnan(FunctionType *F, const vector &Args) { assert(Args.size() == 1); GenericValue GV; - GV.IntVal = isnan(Args[0].DoubleVal); + GV.IntVal = std::isnan(Args[0].DoubleVal); return GV; } From gaeke at cs.uiuc.edu Tue Jun 17 15:09:04 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:09:04 2003 Subject: [llvm-commits] CVS: llvm/Makefile.FreeBSD Makefile.Linux Makefile.SunOS Message-ID: <200306172008.PAA09017@neo.cs.uiuc.edu> Changes in directory llvm: Makefile.FreeBSD updated: 1.1 -> 1.2 Makefile.Linux updated: 1.10 -> 1.11 Makefile.SunOS updated: 1.9 -> 1.10 --- Log message: Add variable named PLATFORMLIBDL to control OS-specific usage of libdl. --- Diffs of the changes: Index: llvm/Makefile.FreeBSD diff -u llvm/Makefile.FreeBSD:1.1 llvm/Makefile.FreeBSD:1.2 --- llvm/Makefile.FreeBSD:1.1 Mon Jun 16 17:01:55 2003 +++ llvm/Makefile.FreeBSD Tue Jun 17 15:08:02 2003 @@ -22,6 +22,9 @@ # stripped from the resultant binary. PLATFORMSTRIPOPTS := -Wl,-x +# PLATFORMLIBDL - FreeBSD does not have libdl; dlsym() is in libc. +PLATFORMLIBDL := + # Path to location for LLVM front-end for this architecture. This setting may # be overriden by the Makefile.config option, and should not override it if set. # (Using Linux GCC front-end for now.) Index: llvm/Makefile.Linux diff -u llvm/Makefile.Linux:1.10 llvm/Makefile.Linux:1.11 --- llvm/Makefile.Linux:1.10 Sun May 25 11:52:41 2003 +++ llvm/Makefile.Linux Tue Jun 17 15:08:02 2003 @@ -22,6 +22,9 @@ # stripped from the resultant binary. PLATFORMSTRIPOPTS := -Wl,-x +# PLATFORMLIBDL - Library that supports dlsym() et al. +PLATFORMLIBDL := -ldl + # Path to location for LLVM front-end for this architecture. This setting may # be overriden by the Makefile.config option, and should not override it if set. # Index: llvm/Makefile.SunOS diff -u llvm/Makefile.SunOS:1.9 llvm/Makefile.SunOS:1.10 --- llvm/Makefile.SunOS:1.9 Sun May 25 11:52:41 2003 +++ llvm/Makefile.SunOS Tue Jun 17 15:08:02 2003 @@ -24,6 +24,9 @@ # PLATFORMSTRIPOPTS := +# PLATFORMLIBDL - Library that supports dlsym() et al. +PLATFORMLIBDL := -ldl + # Path to location for LLVM front-end for this architecture. This setting may # be overriden by the Makefile.config option, and should not override it if set. # From gaeke at cs.uiuc.edu Tue Jun 17 15:10:02 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:10:02 2003 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile Message-ID: <200306172009.PAA09062@neo.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile updated: 1.18 -> 1.19 --- Log message: Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where it is needed. --- Diffs of the changes: Index: llvm/tools/analyze/Makefile diff -u llvm/tools/analyze/Makefile:1.18 llvm/tools/analyze/Makefile:1.19 --- llvm/tools/analyze/Makefile:1.18 Mon Mar 31 11:30:35 2003 +++ llvm/tools/analyze/Makefile Tue Jun 17 15:09:18 2003 @@ -2,7 +2,7 @@ TOOLNAME = analyze USEDLIBS = asmparser bcreader scalaropts.a transforms.a analysis ipa \ datastructure target.a transformutils.a scalaropts.a vmcore support -TOOLLINKOPTS = -ldl +TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From gaeke at cs.uiuc.edu Tue Jun 17 15:10:06 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:10:06 2003 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile Message-ID: <200306172009.PAA09076@neo.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.35 -> 1.36 --- Log message: Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where it is needed. --- Diffs of the changes: Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.35 llvm/tools/llc/Makefile:1.36 --- llvm/tools/llc/Makefile:1.35 Tue May 27 16:23:02 2003 +++ llvm/tools/llc/Makefile Tue Jun 17 15:09:18 2003 @@ -18,7 +18,7 @@ bcwriter \ vmcore \ support -TOOLLINKOPTS = -ldl +TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From gaeke at cs.uiuc.edu Tue Jun 17 15:10:10 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:10:10 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200306172009.PAA09081@neo.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.30 -> 1.31 --- Log message: Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where it is needed. --- Diffs of the changes: Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.30 llvm/tools/lli/Makefile:1.31 --- llvm/tools/lli/Makefile:1.30 Tue Jun 17 14:14:59 2003 +++ llvm/tools/lli/Makefile Tue Jun 17 15:09:18 2003 @@ -29,6 +29,6 @@ # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. # -TOOLLINKOPTS = -ldl +TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From gaeke at cs.uiuc.edu Tue Jun 17 15:10:13 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:10:13 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile Message-ID: <200306172009.PAA09069@neo.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.3 -> 1.4 --- Log message: Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where it is needed. --- Diffs of the changes: Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.3 llvm/tools/bugpoint/Makefile:1.4 --- llvm/tools/bugpoint/Makefile:1.3 Tue Jan 14 15:30:30 2003 +++ llvm/tools/bugpoint/Makefile Tue Jun 17 15:09:18 2003 @@ -8,6 +8,6 @@ USEDLIBS = ipo scalaropts analysis $(OPTLIBS) $(ANALIBS) \ transformutils asmparser bcreader bcwriter vmcore support -TOOLLINKOPTS = -ldl +TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From gaeke at cs.uiuc.edu Tue Jun 17 15:10:17 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 15:10:17 2003 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile Message-ID: <200306172009.PAA09086@neo.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.39 -> 1.40 --- Log message: Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where it is needed. --- Diffs of the changes: Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.39 llvm/tools/opt/Makefile:1.40 --- llvm/tools/opt/Makefile:1.39 Wed Apr 16 17:55:55 2003 +++ llvm/tools/opt/Makefile Tue Jun 17 15:09:18 2003 @@ -6,6 +6,6 @@ ipo ipa.a datastructure transforms target.a analysis \ transformutils vmcore support -TOOLLINKOPTS = -ldl +TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Tue Jun 17 15:56:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 15:56:02 2003 Subject: [llvm-commits] CVS: llvm/test/Feature/Makefile Message-ID: <200306172055.PAA12238@apoc.cs.uiuc.edu> Changes in directory llvm/test/Feature: Makefile updated: 1.6 -> 1.7 --- Log message: Fix to mesh with Johns recent changes --- Diffs of the changes: Index: llvm/test/Feature/Makefile diff -u llvm/test/Feature/Makefile:1.6 llvm/test/Feature/Makefile:1.7 --- llvm/test/Feature/Makefile:1.6 Wed Aug 21 18:52:15 2002 +++ llvm/test/Feature/Makefile Tue Jun 17 15:55:04 2003 @@ -24,10 +24,10 @@ testcbe : $(OTESTS:%.ll=%.tc) Output/%.asmdis: % $(LAS) $(LDIS) Output/.dir - @./TestAsmDisasm.sh $< $(TOOLDEBUG) $(LIBDEBUG) + @./TestAsmDisasm.sh $< $(LLVMTOOLCURRENT) $(LIBDEBUG) Output/%.opt: % $(LAS) $(LDIS) $(LOPT) Output/.dir - @./TestOptimizer.sh $< $(TOOLDEBUG) $(LIBDEBUG) + @./TestOptimizer.sh $< $(LLVMTOOLCURRENT) $(LIBDEBUG) Output/%.tc: Output/%.bc $(LDIS) @echo "======== Generating C code for $<" From lattner at cs.uiuc.edu Tue Jun 17 16:46:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 16:46:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h Message-ID: <200306172145.QAA15886@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CallSite.h updated: 1.2 -> 1.3 --- Log message: Add accessor --- Diffs of the changes: Index: llvm/include/llvm/Support/CallSite.h diff -u llvm/include/llvm/Support/CallSite.h:1.2 llvm/include/llvm/Support/CallSite.h:1.3 --- llvm/include/llvm/Support/CallSite.h:1.2 Tue Jun 17 14:50:28 2003 +++ llvm/include/llvm/Support/CallSite.h Tue Jun 17 16:44:31 2003 @@ -22,6 +22,9 @@ CallSite(const CallSite &CS) : I(CS.I) {} CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; } + /// getInstruction - Return the instruction this call site corresponds to + Instruction *getInstruction() const { return I; } + /// getCalledValue - Return the pointer to function that is being called... /// Value *getCalledValue() const { return I->getOperand(0); } From lattner at cs.uiuc.edu Tue Jun 17 16:46:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 16:46:06 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h Message-ID: <200306172145.QAA15881@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CallSite.h updated: 1.3 -> 1.4 --- Log message: Make sure accessor is properly doxygenized. It wants two lines --- Diffs of the changes: Index: llvm/include/llvm/Support/CallSite.h diff -u llvm/include/llvm/Support/CallSite.h:1.3 llvm/include/llvm/Support/CallSite.h:1.4 --- llvm/include/llvm/Support/CallSite.h:1.3 Tue Jun 17 16:44:31 2003 +++ llvm/include/llvm/Support/CallSite.h Tue Jun 17 16:44:51 2003 @@ -23,6 +23,7 @@ CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; } /// getInstruction - Return the instruction this call site corresponds to + /// Instruction *getInstruction() const { return I; } /// getCalledValue - Return the pointer to function that is being called... From lattner at cs.uiuc.edu Tue Jun 17 17:17:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 17:17:00 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/User.h Message-ID: <200306172216.RAA20294@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: User.h updated: 1.18 -> 1.19 --- Log message: Add new op_erase method --- Diffs of the changes: Index: llvm/include/llvm/User.h diff -u llvm/include/llvm/User.h:1.18 llvm/include/llvm/User.h:1.19 --- llvm/include/llvm/User.h:1.18 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/User.h Tue Jun 17 17:15:55 2003 @@ -49,6 +49,11 @@ inline op_iterator op_end() { return Operands.end(); } inline const_op_iterator op_end() const { return Operands.end(); } + /// op_erase - This method is used to remove one of the arguments from the + /// operands list. Only use this if you know what you are doing. + /// + op_iterator op_erase(op_iterator I) { return Operands.erase(I); } + // dropAllReferences() - This function is in charge of "letting go" of all // objects that this User refers to. This allows one to // 'delete' a whole class at a time, even though there may be circular From lattner at cs.uiuc.edu Tue Jun 17 17:18:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 17:18:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h Message-ID: <200306172217.RAA20320@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CallSite.h updated: 1.4 -> 1.5 --- Log message: * Add new CallSite::get factory method * add new setCalledFunction method * FIX arg_end method which was horribly broken! --- Diffs of the changes: Index: llvm/include/llvm/Support/CallSite.h diff -u llvm/include/llvm/Support/CallSite.h:1.4 llvm/include/llvm/Support/CallSite.h:1.5 --- llvm/include/llvm/Support/CallSite.h:1.4 Tue Jun 17 16:44:51 2003 +++ llvm/include/llvm/Support/CallSite.h Tue Jun 17 17:16:59 2003 @@ -22,6 +22,21 @@ CallSite(const CallSite &CS) : I(CS.I) {} CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; } + /// CallSite::get - This static method is sort of like a constructor. It will + /// create an appropriate call site for a Call or Invoke instruction, but it + /// can also create a null initialized CallSite object for something which is + /// NOT a call site. + /// + static CallSite get(Value *V) { + if (Instruction *I = dyn_cast(V)) { + if (I->getOpcode() == Instruction::Call) + return CallSite((CallInst*)I); + else if (I->getOpcode() == Instruction::Invoke) + return CallSite((InvokeInst*)I); + } + return CallSite(); + } + /// getInstruction - Return the instruction this call site corresponds to /// Instruction *getInstruction() const { return I; } @@ -37,6 +52,12 @@ return dyn_cast(getCalledValue()); } + /// setCalledFunction - Set the callee to the specied value... + /// + void setCalledFunction(Value *V) { + I->setOperand(0, V); + } + /// arg_iterator - The type of iterator to use when looping over actual /// arguments at this call site... typedef User::op_iterator arg_iterator; @@ -50,7 +71,7 @@ else return I->op_begin()+3; // Skip Function, BB, BB } - arg_iterator arg_end() const { return I->op_begin(); } + arg_iterator arg_end() const { return I->op_end(); } }; #endif From lattner at cs.uiuc.edu Tue Jun 17 17:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 17:22:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200306172221.RAA20629@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: DeadArgumentElimination.cpp added (r1.1) --- Log message: Initial checkin of DAE pass --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -c /dev/null llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.1 *** /dev/null Tue Jun 17 17:21:15 2003 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jun 17 17:21:05 2003 *************** *** 0 **** --- 1,304 ---- + //===-- DeadArgumentElimination.cpp - Eliminate dead arguments ------------===// + // + // This pass deletes dead arguments from internal functions. Dead argument + // elimination removes arguments which are directly dead, as well as arguments + // only passed into function calls as dead arguments of other functions. + // + // This pass is often useful as a cleanup pass to run after aggressive + // interprocedural passes, which add possibly-dead arguments. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Transforms/IPO.h" + #include "llvm/Module.h" + #include "llvm/Pass.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Constant.h" + #include "llvm/iOther.h" + #include "llvm/iTerminators.h" + #include "llvm/Support/CallSite.h" + #include "Support/Statistic.h" + #include "Support/iterator" + #include + + namespace { + Statistic<> NumArgumentsEliminated("deadargelim", "Number of args removed"); + + struct DAE : public Pass { + bool run(Module &M); + }; + RegisterOpt X("deadargelim", "Dead Argument Elimination"); + } + + // createDeadArgEliminationPass - This pass removes arguments from functions + // which are not used by the body of the function. + // + Pass *createDeadArgEliminationPass() { return new DAE(); } + + + // FunctionArgumentsIntrinsicallyAlive - Return true if the arguments of the + // specified function are intrinsically alive. + // + // We consider arguments of non-internal functions to be intrinsically alive as + // well as arguments to functions which have their "address taken". + // + static bool FunctionArgumentsIntrinsicallyAlive(const Function &F) { + if (!F.hasInternalLinkage()) return true; + + for (Value::use_const_iterator I = F.use_begin(), E = F.use_end(); I!=E; ++I){ + // If this use is anything other than a call site, the function is alive. + CallSite CS = CallSite::get(const_cast(*I)); + if (!CS.getInstruction()) return true; // Not a valid call site? + + // If the function is PASSED IN as an argument, its address has been taken + for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; + ++AI) + if (AI->get() == &F) return true; + } + return false; + } + + namespace { + enum ArgumentLiveness { Alive, MaybeLive, Dead }; + } + + // getArgumentLiveness - Inspect an argument, determining if is known Alive + // (used in a computation), MaybeLive (only passed as an argument to a call), or + // Dead (not used). + static ArgumentLiveness getArgumentLiveness(const Argument &A) { + if (A.use_empty()) return Dead; // First check, directly dead? + + // Scan through all of the uses, looking for non-argument passing uses. + for (Value::use_const_iterator I = A.use_begin(), E = A.use_end(); I!=E;++I) { + CallSite CS = CallSite::get(const_cast(*I)); + if (!CS.getInstruction()) { + // If its used by something that is not a call or invoke, it's alive! + return Alive; + } + // If it's an indirect call, mark it alive... + Function *Callee = CS.getCalledFunction(); + if (!Callee) return Alive; + + // FIXME: check to see if it's passed through a va_arg area + } + + return MaybeLive; // It must be used, but only as argument to a function + } + + // isMaybeLiveArgumentNowAlive - Check to see if Arg is alive. At this point, + // we know that the only uses of Arg are to be passed in as an argument to a + // function call. Check to see if the formal argument passed in is in the + // LiveArguments set. If so, return true. + // + static bool isMaybeLiveArgumentNowAlive(Argument *Arg, + const std::set &LiveArguments) { + for (Value::use_iterator I = Arg->use_begin(), E = Arg->use_end(); I!=E; ++I){ + CallSite CS = CallSite::get(*I); + + // We know that this can only be used for direct calls... + Function *Callee = cast(CS.getCalledValue()); + + // Loop over all of the arguments (because Arg may be passed into the call + // multiple times) and check to see if any are now alive... + CallSite::arg_iterator CSAI = CS.arg_begin(); + for (Function::aiterator AI = Callee->abegin(), E = Callee->aend(); + AI != E; ++AI, ++CSAI) + // If this is the argument we are looking for, check to see if it's alive + if (*CSAI == Arg && LiveArguments.count(AI)) + return true; + } + return false; + } + + // MarkArgumentLive - The MaybeLive argument 'Arg' is now known to be alive. + // Mark it live in the specified sets and recursively mark arguments in callers + // live that are needed to pass in a value. + // + static void MarkArgumentLive(Argument *Arg, + std::set &MaybeLiveArguments, + std::set &LiveArguments, + const std::multimap &CallSites) { + DEBUG(std::cerr << " MaybeLive argument now live: " << Arg->getName()<<"\n"); + assert(MaybeLiveArguments.count(Arg) && !LiveArguments.count(Arg) && + "Arg not MaybeLive?"); + MaybeLiveArguments.erase(Arg); + LiveArguments.insert(Arg); + + // Loop over all of the call sites of the function, making any arguments + // passed in to provide a value for this argument live as necessary. + // + Function *Fn = Arg->getParent(); + unsigned ArgNo = std::distance(Fn->abegin(), Function::aiterator(Arg)); + + std::multimap::const_iterator I = + CallSites.lower_bound(Fn); + for (; I != CallSites.end() && I->first == Fn; ++I) { + const CallSite &CS = I->second; + if (Argument *ActualArg = dyn_cast(*(CS.arg_begin()+ArgNo))) + if (MaybeLiveArguments.count(ActualArg)) + MarkArgumentLive(ActualArg, MaybeLiveArguments, LiveArguments, + CallSites); + } + } + + // RemoveDeadArgumentsFromFunction - We know that F has dead arguments, as + // specified by the DeadArguments list. Transform the function and all of the + // callees of the function to not have these arguments. + // + static void RemoveDeadArgumentsFromFunction(Function *F, + std::set &DeadArguments){ + // Start by computing a new prototype for the function, which is the same as + // the old function, but has fewer arguments. + const FunctionType *FTy = F->getFunctionType(); + std::vector Params; + + for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I) + if (!DeadArguments.count(I)) + Params.push_back(I->getType()); + + FunctionType *NFTy = FunctionType::get(FTy->getReturnType(), Params, + FTy->isVarArg()); + + // Create the new function body and insert it into the module... + Function *NF = new Function(NFTy, Function::InternalLinkage, F->getName()); + F->getParent()->getFunctionList().insert(F, NF); + + // Loop over all of the callers of the function, transforming the call sites + // to pass in a smaller number of arguments into the new function. + // + while (!F->use_empty()) { + CallSite CS = CallSite::get(F->use_back()); + Instruction *Call = CS.getInstruction(); + CS.setCalledFunction(NF); // Reduce the uses count of F + + // Loop over the operands, deleting dead ones... + CallSite::arg_iterator AI = CS.arg_begin(); + for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I) + if (DeadArguments.count(I)) { // Remove operands for dead arguments + AI = Call->op_erase(AI); + } else { + ++AI; // Leave live operands alone... + } + } + + // Since we have now created the new function, splice the body of the old + // function right into the new function, leaving the old rotting hulk of the + // function empty. + NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList()); + + // Loop over the argument list, transfering uses of the old arguments over to + // the new arguments, also transfering over the names as well. While we're at + // it, remove the dead arguments from the DeadArguments list. + // + for (Function::aiterator I = F->abegin(), E = F->aend(), I2 = NF->abegin(); + I != E; ++I) + if (!DeadArguments.count(I)) { + // If this is a live argument, move the name and users over to the new + // version. + I->replaceAllUsesWith(I2); + I2->setName(I->getName()); + ++I2; + } else { + // If this argument is dead, replace any uses of it with null constants + // (these are guaranteed to only be operands to call instructions which + // will later be simplified). + I->replaceAllUsesWith(Constant::getNullValue(I->getType())); + DeadArguments.erase(I); + } + + // Now that the old function is dead, delete it. + F->getParent()->getFunctionList().erase(F); + } + + bool DAE::run(Module &M) { + // First phase: loop through the module, determining which arguments are live. + // We assume all arguments are dead unless proven otherwise (allowing us to + // determing that dead arguments passed into recursive functions are dead). + // + std::set LiveArguments, MaybeLiveArguments, DeadArguments; + std::multimap CallSites; + + DEBUG(std::cerr << "DAE - Determining liveness\n"); + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { + Function &Fn = *I; + // If the function is intrinsically alive, just mark the arguments alive. + if (FunctionArgumentsIntrinsicallyAlive(Fn)) { + for (Function::aiterator AI = Fn.abegin(), E = Fn.aend(); AI != E; ++AI) + LiveArguments.insert(AI); + DEBUG(std::cerr << " Args intrinsically live for fn: " << Fn.getName() + << "\n"); + } else { + DEBUG(std::cerr << " Inspecting args for fn: " << Fn.getName() << "\n"); + + // If it is not intrinsically alive, we know that all users of the + // function are call sites. Mark all of the arguments live which are + // directly used, and keep track of all of the call sites of this function + // if there are any arguments we assume that are dead. + // + bool AnyMaybeLiveArgs = false; + for (Function::aiterator AI = Fn.abegin(), E = Fn.aend(); AI != E; ++AI) + switch (getArgumentLiveness(*AI)) { + case Alive: + DEBUG(std::cerr << " Arg live by use: " << AI->getName() << "\n"); + LiveArguments.insert(AI); + break; + case Dead: + DEBUG(std::cerr << " Arg definately dead: " <getName()<<"\n"); + DeadArguments.insert(AI); + break; + case MaybeLive: + DEBUG(std::cerr << " Arg only passed to calls: " + << AI->getName() << "\n"); + AnyMaybeLiveArgs = true; + MaybeLiveArguments.insert(AI); + break; + } + + // If there are any "MaybeLive" arguments, we need to check callees of + // this function when/if they become alive. Record which functions are + // callees... + if (AnyMaybeLiveArgs) + for (Value::use_iterator I = Fn.use_begin(), E = Fn.use_end(); + I != E; ++I) + CallSites.insert(std::make_pair(&Fn, CallSite::get(*I))); + } + } + + // Now we loop over all of the MaybeLive arguments, promoting them to be live + // arguments if one of the calls that uses the arguments to the calls they are + // passed into requires them to be live. Of course this could make other + // arguments live, so process callers recursively. + // + // Because elements can be removed from the MaybeLiveArguments list, copy it + // to a temporary vector. + // + std::vector TmpArgList(MaybeLiveArguments.begin(), + MaybeLiveArguments.end()); + for (unsigned i = 0, e = TmpArgList.size(); i != e; ++i) { + Argument *MLA = TmpArgList[i]; + if (MaybeLiveArguments.count(MLA) && + isMaybeLiveArgumentNowAlive(MLA, LiveArguments)) { + MarkArgumentLive(MLA, MaybeLiveArguments, LiveArguments, CallSites); + } + } + + // Recover memory early... + CallSites.clear(); + + // At this point, we know that all arguments in DeadArguments and + // MaybeLiveArguments are dead. If the two sets are empty, there is nothing + // to do. + if (MaybeLiveArguments.empty() && DeadArguments.empty()) + return false; + + // Otherwise, compact into one set, and start eliminating the arguments from + // the functions. + DeadArguments.insert(MaybeLiveArguments.begin(), MaybeLiveArguments.end()); + MaybeLiveArguments.clear(); + + NumArgumentsEliminated += DeadArguments.size(); + while (!DeadArguments.empty()) + RemoveDeadArgumentsFromFunction((*DeadArguments.begin())->getParent(), + DeadArguments); + return true; + } From lattner at cs.uiuc.edu Tue Jun 17 17:23:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Jun 17 17:23:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadArgElim/basictest.ll Message-ID: <200306172222.RAA21282@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadArgElim: basictest.ll updated: 1.1 -> 1.2 --- Log message: Make testcase more interesting, remove absolute path from -load line --- Diffs of the changes: Index: llvm/test/Regression/Transforms/DeadArgElim/basictest.ll diff -u llvm/test/Regression/Transforms/DeadArgElim/basictest.ll:1.1 llvm/test/Regression/Transforms/DeadArgElim/basictest.ll:1.2 --- llvm/test/Regression/Transforms/DeadArgElim/basictest.ll:1.1 Mon Jun 16 07:05:38 2003 +++ llvm/test/Regression/Transforms/DeadArgElim/basictest.ll Tue Jun 17 17:21:55 2003 @@ -1,4 +1,4 @@ -; RUN: if as < %s | opt -load ~/llvm/lib/Debug/libhello.so -deadargelim | dis | grep DEADARG +; RUN: if as < %s | opt -deadargelim | dis | grep DEADARG ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi @@ -25,3 +25,16 @@ ret void } +internal void %needarg(int %TEST) { + call int %needarg2(int %TEST) + ret void +} + +internal int %needarg2(int %TEST) { + ret int %TEST +} + +internal void %needarg3(int %TEST3) { + call void %needarg(int %TEST3) + ret void +} From gaeke at cs.uiuc.edu Tue Jun 17 18:15:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 18:15:01 2003 Subject: [llvm-commits] CVS: llvm/tools/lli/JIT/Emitter.cpp Message-ID: <200306172314.SAA09585@neo.cs.uiuc.edu> Changes in directory llvm/tools/lli/JIT: Emitter.cpp updated: 1.14 -> 1.15 --- Log message: Add #ifdef hack for MAP_ANONYMOUS being spelled MAP_ANON on some platforms. (We're already talking about autoconf'ing this, so I'm assuming this hack will be short-lived...I just don't want it to get lost in my working files.) --- Diffs of the changes: Index: llvm/tools/lli/JIT/Emitter.cpp diff -u llvm/tools/lli/JIT/Emitter.cpp:1.14 llvm/tools/lli/JIT/Emitter.cpp:1.15 --- llvm/tools/lli/JIT/Emitter.cpp:1.14 Sun Jun 8 01:43:57 2003 +++ llvm/tools/lli/JIT/Emitter.cpp Tue Jun 17 18:14:06 2003 @@ -73,6 +73,9 @@ static const long pageSize = sysconf(_SC_PAGESIZE); #if defined(i386) || defined(__i386__) || defined(__x86__) +#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) +# define MAP_ANONYMOUS MAP_ANON +#endif pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); /* fd = 0 */ #elif defined(sparc) || defined(__sparc__) || defined(__sparcv9) From gaeke at cs.uiuc.edu Tue Jun 17 18:56:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 18:56:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200306172355.SAA26865@zion.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.96 -> 1.97 --- Log message: lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here into a new function FPCSafeToPrint(), and use it in printConstant() and printFunction() to decide whether we should output ConstantFPs as floating-point constants or as references to stack-allocated variables. lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.96 llvm/lib/CWriter/Writer.cpp:1.97 --- llvm/lib/CWriter/Writer.cpp:1.96 Mon Jun 16 23:39:14 2003 +++ llvm/lib/CWriter/Writer.cpp Tue Jun 17 18:55:31 2003 @@ -360,6 +360,27 @@ } } +/// FPCSafeToPrint - Returns true if we may assume that CFP may be +/// written out textually as a double (rather than as a reference to a +/// stack-allocated variable). We decide this by converting CFP to a +/// string and back into a double, and then checking whether the +/// conversion results in a bit-equal double to the original value of +/// CFP. This depends on us and the target C compiler agreeing on the +/// conversion process (which is pretty likely since we only deal in +/// IEEE FP.) This is adapted from similar code in +/// lib/VMCore/AsmWriter.cpp:WriteConstantInt(). +static bool FPCSafeToPrint (const ConstantFP *CFP) { + std::string StrVal = ftostr(CFP->getValue()); + // Check to make sure that the stringized number is not some string like + // "Inf" or NaN, that atof will accept, but the lexer will not. Check that + // the string matches the "[-+]?[0-9]" regex. + if ((StrVal[0] >= '0' && StrVal[0] <= '9') || + ((StrVal[0] == '-' || StrVal[0] == '+') && + (StrVal[1] >= '0' && StrVal[1] <= '9'))) + // Reparse stringized version! + return (atof(StrVal.c_str()) == CFP->getValue()); + return false; +} // printConstant - The LLVM Constant to C Constant converter. void CWriter::printConstant(Constant *CPV) { @@ -435,7 +456,11 @@ Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double") << "*)&FloatConstant" << I->second << ")"; } else { - Out << FPC->getValue(); + if (FPCSafeToPrint (FPC)) { + Out << ftostr (FPC->getValue ()); + } else { + Out << FPC->getValue(); // Who knows? Give it our best shot... + } } break; } @@ -795,7 +820,6 @@ } - void CWriter::printFunction(Function *F) { if (F->isExternal()) return; @@ -826,12 +850,14 @@ // Scan the function for floating point constants. If any FP constant is used // in the function, we want to redirect it here so that we do not depend on - // the precision of the printed form. + // the precision of the printed form, unless the printed form preserves + // precision. // unsigned FPCounter = 0; for (constant_iterator I = constant_begin(F), E = constant_end(F); I != E;++I) if (const ConstantFP *FPC = dyn_cast(*I)) - if (FPConstantMap.find(FPC) == FPConstantMap.end()) { + if ((!FPCSafeToPrint(FPC)) // Do not put in FPConstantMap if safe. + && (FPConstantMap.find(FPC) == FPConstantMap.end())) { double Val = FPC->getValue(); FPConstantMap[FPC] = FPCounter; // Number the FP constants From gaeke at cs.uiuc.edu Tue Jun 17 18:56:05 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Jun 17 18:56:05 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200306172355.SAA26872@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.88 -> 1.89 --- Log message: lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here into a new function FPCSafeToPrint(), and use it in printConstant() and printFunction() to decide whether we should output ConstantFPs as floating-point constants or as references to stack-allocated variables. lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above. --- Diffs of the changes: Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.88 llvm/lib/VMCore/AsmWriter.cpp:1.89 --- llvm/lib/VMCore/AsmWriter.cpp:1.88 Sat May 31 22:45:51 2003 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Jun 17 18:55:35 2003 @@ -234,7 +234,7 @@ // if ((StrVal[0] >= '0' && StrVal[0] <= '9') || ((StrVal[0] == '-' || StrVal[0] == '+') && - (StrVal[0] >= '0' && StrVal[0] <= '9'))) + (StrVal[1] >= '0' && StrVal[1] <= '9'))) // Reparse stringized version! if (atof(StrVal.c_str()) == CFP->getValue()) { Out << StrVal; return; From lattner at cs.uiuc.edu Wed Jun 18 09:50:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 09:50:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-health/Makefile Message-ID: <200306181449.JAA07985@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-health: Makefile updated: 1.9 -> 1.10 --- Log message: Reduce memory consumption of testcase --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-health/Makefile diff -u llvm/test/Programs/MultiSource/Olden-health/Makefile:1.9 llvm/test/Programs/MultiSource/Olden-health/Makefile:1.10 --- llvm/test/Programs/MultiSource/Olden-health/Makefile:1.9 Mon Jun 16 10:51:25 2003 +++ llvm/test/Programs/MultiSource/Olden-health/Makefile Wed Jun 18 09:48:48 2003 @@ -3,7 +3,6 @@ PROG = health CPPFLAGS = -DTORONTO LDFLAGS = -lm -RUN_OPTIONS = 10 40 1 - +RUN_OPTIONS = 9 20 1 include ../Makefile.multisrc From lattner at cs.uiuc.edu Wed Jun 18 10:06:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 10:06:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-bh/newbh.c Message-ID: <200306181505.KAA09747@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-bh: newbh.c updated: 1.6 -> 1.7 --- Log message: Remove undefined behavior from the benchmark --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-bh/newbh.c diff -u llvm/test/Programs/MultiSource/Olden-bh/newbh.c:1.6 llvm/test/Programs/MultiSource/Olden-bh/newbh.c:1.7 --- llvm/test/Programs/MultiSource/Olden-bh/newbh.c:1.6 Tue May 21 16:40:15 2002 +++ llvm/test/Programs/MultiSource/Olden-bh/newbh.c Wed Jun 18 10:05:32 2003 @@ -999,22 +999,28 @@ xsc = (pos[0] - t->rmin[0]) / rsize; /* scale to range [0,1) */ if (0.0 <= xsc && xsc < 1.0) /* within unit interval? */ ic.xp[0] = floor(IMAX * xsc); /* then integerize */ - else /* out of range */ + else { /* out of range */ ic.inb = FALSE; /* then remember that */ + ic.xp[0] = 0; + } xsc = (pos[1] - t->rmin[1]) / rsize; /* scale to range [0,1) */ if (0.0 <= xsc && xsc < 1.0) /* within unit interval? */ ic.xp[1] = floor(IMAX * xsc); /* then integerize */ - else /* out of range */ + else { /* out of range */ ic.inb = FALSE; /* then remember that */ + ic.xp[1] = 0; + } xsc = (pos[2] - t->rmin[2]) / rsize; /* scale to range [0,1) */ if (0.0 <= xsc && xsc < 1.0) /* within unit interval? */ ic.xp[2] = floor(IMAX * xsc); /* then integerize */ - else /* out of range */ + else { /* out of range */ ic.inb = FALSE; /* then remember that */ + ic.xp[2] = 0; + } /*chatting("Returning %d:%d:%d, ic.inb=%d\n",ic.xp[0],ic.xp[1],ic.xp[2],ic.inb);*/ From lattner at cs.uiuc.edu Wed Jun 18 10:10:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 10:10:08 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstr.def Message-ID: <200306181509.KAA09867@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInstr.def updated: 1.20 -> 1.21 --- Log message: These instructions really take three operands. This fixes some assertions --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInstr.def diff -u llvm/lib/Target/Sparc/SparcInstr.def:1.20 llvm/lib/Target/Sparc/SparcInstr.def:1.21 --- llvm/lib/Target/Sparc/SparcInstr.def:1.20 Fri Jun 6 04:52:23 2003 +++ llvm/lib/Target/Sparc/SparcInstr.def Wed Jun 18 10:09:02 2003 @@ -526,8 +526,8 @@ // Read and Write CCR register from/to an int reg I(RDCCR, "rd", 2, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) -I(WRCCRr, "wr", 2, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) -I(WRCCRi, "wr", 2, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) +I(WRCCRr, "wr", 3, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) +I(WRCCRi, "wr", 3, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) // Synthetic phi operation for near-SSA form of machine code // Number of operands is variable, indicated by -1. Result is the first op. From lattner at cs.uiuc.edu Wed Jun 18 10:42:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 10:42:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/RunSafely.sh Message-ID: <200306181541.KAA11269@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: RunSafely.sh updated: 1.5 -> 1.6 --- Log message: Capture the stderr output of the program as well as the stdout --- Diffs of the changes: Index: llvm/test/Programs/RunSafely.sh diff -u llvm/test/Programs/RunSafely.sh:1.5 llvm/test/Programs/RunSafely.sh:1.6 --- llvm/test/Programs/RunSafely.sh:1.5 Sat May 31 18:16:10 2003 +++ llvm/test/Programs/RunSafely.sh Wed Jun 18 10:41:02 2003 @@ -25,7 +25,7 @@ ulimit -t $ULIMIT rm -f core core.* ulimit -c unlimited -(time -p $PROGRAM $* > $OUTFILE < $INFILE) 2> $OUTFILE.time +(time -p $PROGRAM $* 2> $OUTFILE > $OUTFILE < $INFILE) 2> $OUTFILE.time if ls | egrep "^core" > /dev/null then corefile=`ls core* | head -1` From lattner at cs.uiuc.edu Wed Jun 18 10:53:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 10:53:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-bisort/Makefile Message-ID: <200306181552.KAA13441@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-bisort: Makefile updated: 1.2 -> 1.3 --- Log message: Trim back execution time --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-bisort/Makefile diff -u llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.2 llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.3 --- llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.2 Mon Jun 16 10:51:22 2003 +++ llvm/test/Programs/MultiSource/Olden-bisort/Makefile Wed Jun 18 10:52:22 2003 @@ -3,6 +3,6 @@ PROG = bisort CPPFLAGS = -DTORONTO LDFLAGS = -lm -RUN_OPTIONS = 7000000 +RUN_OPTIONS = 700000 include ../Makefile.multisrc From lattner at cs.uiuc.edu Wed Jun 18 11:19:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 11:19:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-voronoi/Makefile Message-ID: <200306181618.LAA26948@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-voronoi: Makefile updated: 1.5 -> 1.6 --- Log message: Trim back program size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-voronoi/Makefile diff -u llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.5 llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.6 --- llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.5 Mon Jun 16 10:51:31 2003 +++ llvm/test/Programs/MultiSource/Olden-voronoi/Makefile Wed Jun 18 11:18:31 2003 @@ -4,7 +4,7 @@ INCLUDES = defines.h CPPFLAGS = -DTORONTO LDFLAGS = -lm -RUN_OPTIONS = 802400 20 0 7 +#RUN_OPTIONS = 802400 20 0 7 # This program is adversely effected by the underlying precision of the machine PROGRAM_IS_NONDETERMINISTIC = 1 From lattner at cs.uiuc.edu Wed Jun 18 11:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 11:27:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200306181626.LAA30742@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: DeadArgumentElimination.cpp updated: 1.1 -> 1.2 --- Log message: Handle arguments passed in through the va_arg area --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.1 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.2 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.1 Tue Jun 17 17:21:05 2003 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed Jun 18 11:25:51 2003 @@ -79,7 +79,13 @@ Function *Callee = CS.getCalledFunction(); if (!Callee) return Alive; - // FIXME: check to see if it's passed through a va_arg area + // Check to see if it's passed through a va_arg area: if so, we cannot + // remove it. + unsigned NumFixedArgs = Callee->getFunctionType()->getNumParams(); + for (CallSite::arg_iterator AI = CS.arg_begin()+NumFixedArgs; + AI != CS.arg_end(); ++AI) + if (AI->get() == &A) // If passed through va_arg area, we cannot remove it + return Alive; } return MaybeLive; // It must be used, but only as argument to a function From lattner at cs.uiuc.edu Wed Jun 18 11:30:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 11:30:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200306181629.LAA32677@apoc.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.33 -> 1.34 --- Log message: Add new DAE pass to gccld. It does not add cause any regressions in the test-suite --- Diffs of the changes: Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.33 llvm/tools/gccld/gccld.cpp:1.34 --- llvm/tools/gccld/gccld.cpp:1.33 Thu May 29 10:13:15 2003 +++ llvm/tools/gccld/gccld.cpp Wed Jun 18 11:29:02 2003 @@ -396,6 +396,10 @@ Passes.add(createInternalizePass()); } + // Remove unused arguments from functions... + // + Passes.add(createDeadArgEliminationPass()); + // Now that we have optimized the program, discard unreachable functions... // Passes.add(createGlobalDCEPass()); From lattner at cs.uiuc.edu Wed Jun 18 13:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 13:27:01 2003 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200306181826.NAA07037@apoc.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.12 -> 1.13 --- Log message: Fix breakage due to John's recent changes --- Diffs of the changes: Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.12 llvm/utils/NightlyTest.pl:1.13 --- llvm/utils/NightlyTest.pl:1.12 Sun May 11 10:23:10 2003 +++ llvm/utils/NightlyTest.pl Wed Jun 18 13:26:22 2003 @@ -155,9 +155,9 @@ if (!$NOCHECKOUT) { # Change the Makefile.config to build into the local directory... rename "Makefile.config", "Makefile.config.orig"; - system "sed '/^LLVM_OBJ_DIR/d' < Makefile.config.orig > Makefile.config"; + system "sed '/^OBJ_ROOT/d' < Makefile.config.orig > Makefile.config"; system "echo >> Makefile.config"; - system "echo 'LLVM_OBJ_DIR := .' >> Makefile.config"; + system "echo 'OBJ_ROOT := .' >> Makefile.config"; # Change the Makefile.config to not strip executables... system "echo 'KEEP_SYMBOLS := 1' >> Makefile.config"; From lattner at cs.uiuc.edu Wed Jun 18 13:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 13:47:01 2003 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200306181846.NAA14528@apoc.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.73 -> 1.74 --- Log message: Reindent code to match the rest of the file --- Diffs of the changes: Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.73 llvm/tools/llc/llc.cpp:1.74 --- llvm/tools/llc/llc.cpp:1.73 Thu Jun 5 15:51:10 2003 +++ llvm/tools/llc/llc.cpp Wed Jun 18 13:46:08 2003 @@ -134,8 +134,28 @@ // Figure out where we are going to send the output... std::ostream *Out = 0; - if (OutputFilename != "") - { // Specified an output filename? + if (OutputFilename != "") { + // Specified an output filename? + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str()); + + // Make sure that the Out file gets unlink'd from the disk if we get a + // SIGINT + RemoveFileOnSignal(OutputFilename); + } else { + if (InputFilename == "-") { + OutputFilename = "-"; + Out = &std::cout; + } else { + std::string OutputFilename = GetFileNameRoot(InputFilename); + OutputFilename += ".s"; + if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! std::cerr << argv[0] << ": error opening '" << OutputFilename @@ -143,47 +163,19 @@ << "Use -f command line argument to force output\n"; return 1; } + Out = new std::ofstream(OutputFilename.c_str()); - + if (!Out->good()) { + std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + delete Out; + return 1; + } + // Make sure that the Out file gets unlink'd from the disk if we get a // SIGINT RemoveFileOnSignal(OutputFilename); } - else - { - if (InputFilename == "-") - { - OutputFilename = "-"; - Out = &std::cout; - } - else - { - std::string OutputFilename = GetFileNameRoot(InputFilename); - OutputFilename += ".s"; - - if (!Force && std::ifstream(OutputFilename.c_str())) - { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; - return 1; - } - - Out = new std::ofstream(OutputFilename.c_str()); - if (!Out->good()) - { - std::cerr << argv[0] << ": error opening " << OutputFilename - << "!\n"; - delete Out; - return 1; - } - - // Make sure that the Out file gets unlink'd from the disk if we get a - // SIGINT - RemoveFileOnSignal(OutputFilename); - } - } + } // Ask the target to add backend passes as neccesary if (Target.addPassesToEmitAssembly(Passes, *Out)) { From lattner at cs.uiuc.edu Wed Jun 18 14:21:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 14:21:01 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200306181920.OAA18788@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.89 -> 1.90 --- Log message: Remove extra line --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.89 llvm/Makefile.common:1.90 --- llvm/Makefile.common:1.89 Mon Jun 16 14:14:31 2003 +++ llvm/Makefile.common Wed Jun 18 14:20:11 2003 @@ -38,7 +38,6 @@ # LEVEL should be set to the top of LLVM source tree # LLVM_LIB_DIR should be set to the top of the LLVM build tree # -# #===-----------------------------------------------------------------------==== # Configuration file to set paths specific to local installation of LLVM From lattner at cs.uiuc.edu Wed Jun 18 14:23:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 14:23:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200306181922.OAA19630@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.47 -> 1.48 --- Log message: Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'. --- Diffs of the changes: Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.47 llvm/lib/VMCore/Type.cpp:1.48 --- llvm/lib/VMCore/Type.cpp:1.47 Thu May 22 16:31:52 2003 +++ llvm/lib/VMCore/Type.cpp Wed Jun 18 14:22:28 2003 @@ -216,11 +216,11 @@ FunctionType::FunctionType(const Type *Result, const std::vector &Params, bool IsVarArgs) : DerivedType(FunctionTyID), - ResultType(PATypeHandle(Result, this)), + ResultType(PATypeHandle(Result, this)), isVarArgs(IsVarArgs) { ParamTys.reserve(Params.size()); for (unsigned i = 0; i < Params.size(); ++i) - ParamTys.push_back(PATypeHandle(Params[i], this)); + ParamTys.push_back(PATypeHandle(Params[i], this)); setDerivedTypeProperties(); } @@ -230,7 +230,7 @@ ETypes.reserve(Types.size()); for (unsigned i = 0; i < Types.size(); ++i) { assert(Types[i] != Type::VoidTy && "Void type in method prototype!!"); - ETypes.push_back(PATypeHandle(Types[i], this)); + ETypes.push_back(PATypeHandle(Types[i], this)); } setDerivedTypeProperties(); } @@ -427,20 +427,20 @@ // template class TypeMap : public AbstractTypeUser { - typedef std::map > MapTy; + typedef std::map MapTy; MapTy Map; public: ~TypeMap() { print("ON EXIT"); } inline TypeClass *get(const ValType &V) { - typename std::map >::iterator I + typename std::map::iterator I = Map.find(V); // TODO: FIXME: When Types are not CONST. return (I != Map.end()) ? (TypeClass*)I->second.get() : 0; } inline void add(const ValType &V, TypeClass *T) { - Map.insert(std::make_pair(V, PATypeHandle(T, this))); + Map.insert(std::make_pair(V, PATypeHandle(T, this))); print("add"); } @@ -521,7 +521,7 @@ TypeMap &Table = MyTable; // Copy MyTable reference ValType Tmp(*(ValType*)this); // Copy this. - PATypeHandle OldType(Table.get(*(ValType*)this), this); + PATypeHandle OldType(Table.get(*(ValType*)this), this); Table.remove(*(ValType*)this); // Destroy's this! // Refine temporary to new state... @@ -546,8 +546,8 @@ // FunctionValType - Define a class to hold the key that goes into the TypeMap // class FunctionValType : public ValTypeBase { - PATypeHandle RetTy; - std::vector > ArgTypes; + PATypeHandle RetTy; + std::vector ArgTypes; bool isVarArg; public: FunctionValType(const Type *ret, const std::vector &args, @@ -555,7 +555,7 @@ : ValTypeBase(Tab), RetTy(ret, this), isVarArg(IVA) { for (unsigned i = 0; i < args.size(); ++i) - ArgTypes.push_back(PATypeHandle(args[i], this)); + ArgTypes.push_back(PATypeHandle(args[i], this)); } // We *MUST* have an explicit copy ctor so that the TypeHandles think that @@ -566,7 +566,7 @@ isVarArg(MVT.isVarArg) { ArgTypes.reserve(MVT.ArgTypes.size()); for (unsigned i = 0; i < MVT.ArgTypes.size(); ++i) - ArgTypes.push_back(PATypeHandle(MVT.ArgTypes[i], this)); + ArgTypes.push_back(PATypeHandle(MVT.ArgTypes[i], this)); } // Subclass should override this... to update self as usual @@ -615,7 +615,7 @@ // Array Type Factory... // class ArrayValType : public ValTypeBase { - PATypeHandle ValTy; + PATypeHandle ValTy; unsigned Size; public: ArrayValType(const Type *val, int sz, TypeMap &Tab) @@ -671,14 +671,14 @@ // StructValType - Define a class to hold the key that goes into the TypeMap // class StructValType : public ValTypeBase { - std::vector > ElTypes; + std::vector ElTypes; public: StructValType(const std::vector &args, TypeMap &Tab) : ValTypeBase(Tab) { ElTypes.reserve(args.size()); for (unsigned i = 0, e = args.size(); i != e; ++i) - ElTypes.push_back(PATypeHandle(args[i], this)); + ElTypes.push_back(PATypeHandle(args[i], this)); } // We *MUST* have an explicit copy ctor so that the TypeHandles think that @@ -688,7 +688,7 @@ : ValTypeBase(SVT){ ElTypes.reserve(SVT.ElTypes.size()); for (unsigned i = 0, e = SVT.ElTypes.size(); i != e; ++i) - ElTypes.push_back(PATypeHandle(SVT.ElTypes[i], this)); + ElTypes.push_back(PATypeHandle(SVT.ElTypes[i], this)); } // Subclass should override this... to update self as usual @@ -731,7 +731,7 @@ // PointerValType - Define a class to hold the key that goes into the TypeMap // class PointerValType : public ValTypeBase { - PATypeHandle ValTy; + PATypeHandle ValTy; public: PointerValType(const Type *val, TypeMap &Tab) : ValTypeBase(Tab), ValTy(val, this) {} From lattner at cs.uiuc.edu Wed Jun 18 14:23:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 14:23:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReadConst.cpp ReaderInternals.h Message-ID: <200306181922.OAA19649@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReadConst.cpp updated: 1.46 -> 1.47 ReaderInternals.h updated: 1.37 -> 1.38 --- Log message: Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'. --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReadConst.cpp diff -u llvm/lib/Bytecode/Reader/ReadConst.cpp:1.46 llvm/lib/Bytecode/Reader/ReadConst.cpp:1.47 --- llvm/lib/Bytecode/Reader/ReadConst.cpp:1.46 Thu May 22 13:08:30 2003 +++ llvm/lib/Bytecode/Reader/ReadConst.cpp Wed Jun 18 14:22:30 2003 @@ -139,7 +139,7 @@ // Insert a bunch of opaque types to be resolved later... for (unsigned i = 0; i < NumEntries; ++i) - Tab.push_back(PATypeHandle(OpaqueType::get(), this)); + Tab.push_back(PATypeHandle(OpaqueType::get(), this)); // Loop through reading all of the types. Forward types will make use of the // opaque types just inserted. Index: llvm/lib/Bytecode/Reader/ReaderInternals.h diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.37 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.38 --- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.37 Thu May 22 13:26:48 2003 +++ llvm/lib/Bytecode/Reader/ReaderInternals.h Wed Jun 18 14:22:30 2003 @@ -104,7 +104,7 @@ // TypesLoaded - This vector mirrors the Values[TypeTyID] plane. It is used // to deal with forward references to types. // - typedef std::vector > TypeValuesListTy; + typedef std::vector TypeValuesListTy; TypeValuesListTy ModuleTypeValues; TypeValuesListTy FunctionTypeValues; From lattner at cs.uiuc.edu Wed Jun 18 14:23:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 14:23:08 2003 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200306181922.OAA19656@apoc.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.113 -> 1.114 --- Log message: Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'. --- Diffs of the changes: Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.113 llvm/lib/AsmParser/llvmAsmParser.y:1.114 --- llvm/lib/AsmParser/llvmAsmParser.y:1.113 Wed May 21 12:48:56 2003 +++ llvm/lib/AsmParser/llvmAsmParser.y Wed Jun 18 14:22:32 2003 @@ -816,7 +816,7 @@ | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? std::vector Params; mapto($3->begin(), $3->end(), std::back_inserter(Params), - std::mem_fun_ref(&PATypeHandle::get)); + std::mem_fun_ref(&PATypeHandle::get)); bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); @@ -831,7 +831,7 @@ | '{' TypeListI '}' { // Structure type? std::vector Elements; mapto($2->begin(), $2->end(), std::back_inserter(Elements), - std::mem_fun_ref(&PATypeHandle::get)); + std::mem_fun_ref(&PATypeHandle::get)); $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete $2; From lattner at cs.uiuc.edu Wed Jun 18 14:23:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 14:23:12 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h DerivedTypes.h Value.h Message-ID: <200306181922.OAA19717@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.6 -> 1.7 DerivedTypes.h updated: 1.29 -> 1.30 Value.h updated: 1.40 -> 1.41 --- Log message: Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'. --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.6 llvm/include/llvm/AbstractTypeUser.h:1.7 --- llvm/include/llvm/AbstractTypeUser.h:1.6 Tue Jan 14 15:29:52 2003 +++ llvm/include/llvm/AbstractTypeUser.h Wed Jun 18 14:22:33 2003 @@ -58,9 +58,8 @@ // example. This class is a simple class used to keep the use list of abstract // types up-to-date. // -template class PATypeHandle { - const TypeSubClass *Ty; + const Type *Ty; AbstractTypeUser * const User; // These functions are defined at the bottom of Type.h. See the comment there @@ -69,7 +68,7 @@ inline void removeUser(); public: // ctor - Add use to type if abstract. Note that Ty must not be null - inline PATypeHandle(const TypeSubClass *ty, AbstractTypeUser *user) + inline PATypeHandle(const Type *ty, AbstractTypeUser *user) : Ty(ty), User(user) { addUser(); } @@ -83,11 +82,11 @@ inline ~PATypeHandle() { removeUser(); } // Automatic casting operator so that the handle may be used naturally - inline operator const TypeSubClass *() const { return Ty; } - inline const TypeSubClass *get() const { return Ty; } + inline operator const Type *() const { return Ty; } + inline const Type *get() const { return Ty; } // operator= - Allow assignment to handle - inline const TypeSubClass *operator=(const TypeSubClass *ty) { + inline const Type *operator=(const Type *ty) { if (Ty != ty) { // Ensure we don't accidentally drop last ref to Ty removeUser(); Ty = ty; @@ -97,16 +96,16 @@ } // operator= - Allow assignment to handle - inline const TypeSubClass *operator=(const PATypeHandle &T) { + inline const Type *operator=(const PATypeHandle &T) { return operator=(T.Ty); } - inline bool operator==(const TypeSubClass *ty) { + inline bool operator==(const Type *ty) { return Ty == ty; } // operator-> - Allow user to dereference handle naturally... - inline const TypeSubClass *operator->() const { return Ty; } + inline const Type *operator->() const { return Ty; } // removeUserFromConcrete - This function should be called when the User is // notified that our type is refined... and the type is being refined to @@ -122,10 +121,10 @@ // as both a handle (as above) and an AbstractTypeUser. It uses the callback to // keep its pointer member updated to the current version of the type. // -struct PATypeHolder : public AbstractTypeUser, public PATypeHandle { - inline PATypeHolder(const Type *ty) : PATypeHandle(ty, this) {} +struct PATypeHolder : public AbstractTypeUser, public PATypeHandle { + inline PATypeHolder(const Type *ty) : PATypeHandle(ty, this) {} inline PATypeHolder(const PATypeHolder &T) - : AbstractTypeUser(T), PATypeHandle(T, this) {} + : AbstractTypeUser(T), PATypeHandle(T, this) {} // refineAbstractType - All we do is update our PATypeHandle member to point // to the new type. @@ -138,20 +137,20 @@ removeUserFromConcrete(); if ((const Type*)OldTy != NewTy) - PATypeHandle::operator=(NewTy); + PATypeHandle::operator=(NewTy); } // operator= - Allow assignment to handle inline const Type *operator=(const Type *ty) { - return PATypeHandle::operator=(ty); + return PATypeHandle::operator=(ty); } // operator= - Allow assignment to handle - inline const Type *operator=(const PATypeHandle &T) { - return PATypeHandle::operator=(T); + inline const Type *operator=(const PATypeHandle &T) { + return PATypeHandle::operator=(T); } inline const Type *operator=(const PATypeHolder &H) { - return PATypeHandle::operator=(H); + return PATypeHandle::operator=(H); } void dump() const; Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.29 llvm/include/llvm/DerivedTypes.h:1.30 --- llvm/include/llvm/DerivedTypes.h:1.29 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/DerivedTypes.h Wed Jun 18 14:22:36 2003 @@ -86,9 +86,9 @@ class FunctionType : public DerivedType { public: - typedef std::vector > ParamTypes; + typedef std::vector ParamTypes; private: - PATypeHandle ResultType; + PATypeHandle ResultType; ParamTypes ParamTys; bool isVarArgs; @@ -181,7 +181,7 @@ class StructType : public CompositeType { public: - typedef std::vector > ElementTypes; + typedef std::vector ElementTypes; private: ElementTypes ETypes; // Element types of struct @@ -245,10 +245,10 @@ SequentialType(const SequentialType &); // Do not implement! const SequentialType &operator=(const SequentialType &); // Do not implement! protected: - PATypeHandle ElementType; + PATypeHandle ElementType; SequentialType(PrimitiveID TID, const Type *ElType) - : CompositeType(TID), ElementType(PATypeHandle(ElType, this)) { + : CompositeType(TID), ElementType(PATypeHandle(ElType, this)) { } public: @@ -390,18 +390,17 @@ // contains an AbstractTypeUser instance, so there is no good way to factor out // the code. Hence this bit of uglyness. // -template void PATypeHandle::addUser() { +inline void PATypeHandle::addUser() { assert(Ty && "Type Handle has a null type!"); if (Ty->isAbstract()) cast(Ty)->addAbstractTypeUser(User); } -template void PATypeHandle::removeUser() { +inline void PATypeHandle::removeUser() { if (Ty->isAbstract()) cast(Ty)->removeAbstractTypeUser(User); } -template -void PATypeHandle::removeUserFromConcrete() { +inline void PATypeHandle::removeUserFromConcrete() { if (!Ty->isAbstract()) cast(Ty)->removeAbstractTypeUser(User); } Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.40 llvm/include/llvm/Value.h:1.41 --- llvm/include/llvm/Value.h:1.40 Tue Jan 14 15:29:58 2003 +++ llvm/include/llvm/Value.h Wed Jun 18 14:22:36 2003 @@ -50,7 +50,7 @@ private: std::vector Uses; std::string Name; - PATypeHandle Ty; + PATypeHandle Ty; ValueTy VTy; void operator=(const Value &); // Do not implement From lattner at cs.uiuc.edu Wed Jun 18 14:40:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 14:40:04 2003 Subject: [llvm-commits] CVS: llvm/test/Makefile.tests Message-ID: <200306181939.OAA28187@apoc.cs.uiuc.edu> Changes in directory llvm/test: Makefile.tests updated: 1.64 -> 1.65 --- Log message: Move llvm tools to the start of the testrunner path, which allows the llvm 'as' tool to be found in preference to the system 'as' tool. --- Diffs of the changes: Index: llvm/test/Makefile.tests diff -u llvm/test/Makefile.tests:1.64 llvm/test/Makefile.tests:1.65 --- llvm/test/Makefile.tests:1.64 Mon Jun 16 19:27:43 2003 +++ llvm/test/Makefile.tests Wed Jun 18 14:39:06 2003 @@ -53,7 +53,7 @@ LCXXFLAGS += -O2 -Wall LLCFLAGS = FAILURE = $(LEVEL)/test/Failure.sh -TESTRUNR = PATH=$(PATH):$(LLVMTOOLCURRENT) $(LEVEL)/test/TestRunner.sh +TESTRUNR = PATH=$(LLVMTOOLCURRENT):$(PATH) $(LEVEL)/test/TestRunner.sh # Native Tool Definitions NATGCC = $(CC) From gaeke at cs.uiuc.edu Wed Jun 18 16:15:02 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Wed Jun 18 16:15:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/Sparc.cpp Message-ID: <200306182114.QAA27892@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: Sparc.cpp updated: 1.68 -> 1.69 --- Log message: lib/Target/Sparc/Sparc.cpp: Move LowerAllocations, PrintFunction, and SymbolStripping passes, and the corresponding -disable-strip and -d options, over here to the SPARC target-specific bits of llc. Rename -d to -dump-asm. tools/llc/Makefile: Reindent. Add x86 library so that llc compiles again. tools/llc/llc.cpp: Remove support for running arbitrary optimization passes. Use opt instead. Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted above. Allow user to select a backend (x86 or SPARC); default to guessing from the endianness/pointer size of the input bytecode file. Fix typos. Delete empty .s file and exit with error status if target does not support static compilation. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/Sparc.cpp diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.68 llvm/lib/Target/Sparc/Sparc.cpp:1.69 --- llvm/lib/Target/Sparc/Sparc.cpp:1.68 Mon Jun 16 10:31:52 2003 +++ llvm/lib/Target/Sparc/Sparc.cpp Wed Jun 18 16:14:21 2003 @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/Reoptimizer/Mapping/MappingInfo.h" #include "Support/CommandLine.h" +#include "llvm/Assembly/PrintModulePass.h" static const unsigned ImplicitRegUseList[] = { 0 }; /* not used yet */ // Build the MachineInstruction Description Array... @@ -46,6 +47,14 @@ static cl::opt DisablePeephole("nopeephole", cl::desc("Disable peephole optimization pass")); +static cl::opt +DisableStrip("disable-strip", + cl::desc("Do not strip the LLVM bytecode included in the executable")); + +static cl::opt +DumpAsm("dump-asm", cl::desc("Print bytecode before native code generation"), + cl::Hidden); + //---------------------------------------------------------------------------- // allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine // that implements the Sparc backend. (the llvm/CodeGen/Sparc.h interface) @@ -141,9 +150,21 @@ // bool UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out) { + // The following 3 passes used to be inserted specially by llc. + // Replace malloc and free instructions with library calls. + PM.add(createLowerAllocationsPass()); + + // If LLVM dumping after transformations is requested, add it to the pipeline + if (DumpAsm) + PM.add(new PrintFunctionPass("Code after xformations: \n", &std::cerr)); + + // Strip all of the symbols from the bytecode so that it will be smaller... + if (!DisableStrip) + PM.add(createSymbolStrippingPass()); + // FIXME: implement the switch instruction in the instruction selector. PM.add(createLowerSwitchPass()); - + // Construct and initialize the MachineFunction object for this fn. PM.add(createMachineCodeConstructionPass(*this)); From gaeke at cs.uiuc.edu Wed Jun 18 16:15:07 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Wed Jun 18 16:15:07 2003 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile llc.cpp Message-ID: <200306182114.QAA27901@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.36 -> 1.37 llc.cpp updated: 1.74 -> 1.75 --- Log message: lib/Target/Sparc/Sparc.cpp: Move LowerAllocations, PrintFunction, and SymbolStripping passes, and the corresponding -disable-strip and -d options, over here to the SPARC target-specific bits of llc. Rename -d to -dump-asm. tools/llc/Makefile: Reindent. Add x86 library so that llc compiles again. tools/llc/llc.cpp: Remove support for running arbitrary optimization passes. Use opt instead. Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted above. Allow user to select a backend (x86 or SPARC); default to guessing from the endianness/pointer size of the input bytecode file. Fix typos. Delete empty .s file and exit with error status if target does not support static compilation. --- Diffs of the changes: Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.36 llvm/tools/llc/Makefile:1.37 --- llvm/tools/llc/Makefile:1.36 Tue Jun 17 15:09:18 2003 +++ llvm/tools/llc/Makefile Wed Jun 18 16:14:23 2003 @@ -2,6 +2,7 @@ TOOLNAME = llc USEDLIBS = mapping \ sparc \ + x86 \ regalloc \ sched \ select \ @@ -11,11 +12,11 @@ target.a \ livevar \ transforms.a \ - scalaropts.a \ + scalaropts.a \ analysis.a \ transformutils.a \ bcreader \ - bcwriter \ + bcwriter \ vmcore \ support TOOLLINKOPTS = $(PLATFORMLIBDL) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.74 llvm/tools/llc/llc.cpp:1.75 --- llvm/tools/llc/llc.cpp:1.74 Wed Jun 18 13:46:08 2003 +++ llvm/tools/llc/llc.cpp Wed Jun 18 16:14:23 2003 @@ -8,31 +8,19 @@ #include "llvm/Target/TargetMachineImpls.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/Scalar.h" -#include "llvm/Assembly/PrintModulePass.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Pass.h" -#include "llvm/Support/PassNameParser.h" #include "Support/CommandLine.h" #include "Support/Signals.h" #include #include +#include //------------------------------------------------------------------------------ // Option declarations for LLC. //------------------------------------------------------------------------------ -// Make all registered optimization passes available to llc. These passes -// will all be run before the simplification and lowering steps used by the -// back-end code generator, and will be run in the order specified on the -// command line. The OptimizationList is automatically populated with -// registered Passes by the PassNameParser. -// -static cl::list > -OptimizationList(cl::desc("Optimizations available:")); - - // General options for llc. Other pass-specific options are specified // within the corresponding llc passes, and target-specific options // and back-end code generation options are specified with the target machine. @@ -45,13 +33,14 @@ static cl::opt Force("f", cl::desc("Overwrite output files")); -static cl::opt -DisableStrip("disable-strip", - cl::desc("Do not strip the LLVM bytecode included in the executable")); - -static cl::opt -DumpAsm("d", cl::desc("Print bytecode before native code generation"), - cl::Hidden); +enum ArchName { noarch, x86, Sparc }; + +static cl::opt +Arch("march", cl::desc("Architecture to generate assembly for:"), cl::Prefix, + cl::values(clEnumVal(x86, " IA-32 (Pentium and above)"), + clEnumValN(Sparc, "sparc", " SPARC V9"), + 0), + cl::init(noarch)); // GetFileNameRoot - Helper function to get the basename of a filename... static inline std::string @@ -80,14 +69,6 @@ { cl::ParseCommandLineOptions(argc, argv, " llvm system compiler\n"); - // Allocate a target... in the future this will be controllable on the - // command line. - std::auto_ptr target(allocateSparcTargetMachine()); - assert(target.get() && "Could not allocate target machine!"); - - TargetMachine &Target = *target.get(); - const TargetData &TD = Target.getTargetData(); - // Load the module to be compiled... std::auto_ptr M(ParseBytecodeFile(InputFilename)); if (M.get() == 0) @@ -95,6 +76,38 @@ std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; return 1; } + Module &mod = *M.get(); + + // Allocate target machine. First, check whether the user has + // explicitly specified an architecture to compile for. + unsigned Config = (mod.isLittleEndian() ? TM::LittleEndian : TM::BigEndian) | + (mod.has32BitPointers() ? TM::PtrSize32 : TM::PtrSize64); + TargetMachine* (*TargetMachineAllocator)(unsigned) = 0; + switch (Arch) { + case x86: + TargetMachineAllocator = allocateX86TargetMachine; + break; + case Sparc: + TargetMachineAllocator = allocateSparcTargetMachine; + break; + default: + // Decide what the default target machine should be, by looking at + // the module. This heuristic (ILP32, LE -> IA32; LP64, BE -> + // SPARCV9) is kind of gross, but it will work until we have more + // sophisticated target information to work from. + if (mod.isLittleEndian() && mod.has32BitPointers()) { + TargetMachineAllocator = allocateX86TargetMachine; + } else if (mod.isBigEndian() && mod.has64BitPointers()) { + TargetMachineAllocator = allocateSparcTargetMachine; + } else { + assert(0 && "You must specify -march; I could not guess the default"); + } + break; + } + std::auto_ptr target((*TargetMachineAllocator)(Config)); + assert(target.get() && "Could not allocate target machine!"); + TargetMachine &Target = *target.get(); + const TargetData &TD = Target.getTargetData(); // Build up all of the passes that we want to do to the module... PassManager Passes; @@ -102,36 +115,6 @@ Passes.add(new TargetData("llc", TD.isLittleEndian(), TD.getPointerSize(), TD.getPointerAlignment(), TD.getDoubleAlignment())); - // Create a new optimization pass for each one specified on the command line - // Deal specially with tracing passes, which must be run differently than opt. - // - for (unsigned i = 0; i < OptimizationList.size(); ++i) { - const PassInfo *Opt = OptimizationList[i]; - - // handle other passes as normal optimization passes - if (Opt->getNormalCtor()) - Passes.add(Opt->getNormalCtor()()); - else if (Opt->getTargetCtor()) - Passes.add(Opt->getTargetCtor()(Target)); - else - std::cerr << argv[0] << ": cannot create pass: " - << Opt->getPassName() << "\n"; - } - - // Replace malloc and free instructions with library calls. - // Do this after tracing until lli implements these lib calls. - // For now, it will emulate malloc and free internally. - // FIXME: This is sparc specific! - Passes.add(createLowerAllocationsPass()); - - // If LLVM dumping after transformations is requested, add it to the pipeline - if (DumpAsm) - Passes.add(new PrintFunctionPass("Code after xformations: \n", &std::cerr)); - - // Strip all of the symbols from the bytecode so that it will be smaller... - if (!DisableStrip) - Passes.add(createSymbolStrippingPass()); - // Figure out where we are going to send the output... std::ostream *Out = 0; if (OutputFilename != "") { @@ -153,7 +136,7 @@ OutputFilename = "-"; Out = &std::cout; } else { - std::string OutputFilename = GetFileNameRoot(InputFilename); + OutputFilename = GetFileNameRoot(InputFilename); OutputFilename += ".s"; if (!Force && std::ifstream(OutputFilename.c_str())) { @@ -177,10 +160,14 @@ } } - // Ask the target to add backend passes as neccesary + // Ask the target to add backend passes as necessary if (Target.addPassesToEmitAssembly(Passes, *Out)) { std::cerr << argv[0] << ": target '" << Target.getName() - << " does not support static compilation!\n"; + << "' does not support static compilation!\n"; + if (Out != &std::cout) delete Out; + // And the Out file is empty and useless, so remove it now. + std::remove(OutputFilename.c_str()); + return 1; } else { // Run our queue of passes all at once now, efficiently. Passes.run(*M.get()); From lattner at cs.uiuc.edu Wed Jun 18 16:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 16:29:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/LangRef.html Message-ID: <200306182128.QAA07317@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: LangRef.html updated: 1.23 -> 1.24 --- Log message: fix incorrect anchor --- Diffs of the changes: Index: llvm/www/docs/LangRef.html diff -u llvm/www/docs/LangRef.html:1.23 llvm/www/docs/LangRef.html:1.24 --- llvm/www/docs/LangRef.html:1.23 Thu May 8 10:55:44 2003 +++ llvm/www/docs/LangRef.html Wed Jun 18 16:28:11 2003 @@ -295,7 +295,7 @@ - + @@ -1810,7 +1810,7 @@
Chris Lattner
-Last modified: Thu May 8 10:48:46 CDT 2003 +Last modified: Wed Jun 18 16:27:39 CDT 2003 From lattner at cs.uiuc.edu Wed Jun 18 16:32:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 16:32:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/LangRef.html Message-ID: <200306182131.QAA07376@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: LangRef.html updated: 1.24 -> 1.25 --- Log message: Diversify examples --- Diffs of the changes: Index: llvm/www/docs/LangRef.html diff -u llvm/www/docs/LangRef.html:1.24 llvm/www/docs/LangRef.html:1.25 --- llvm/www/docs/LangRef.html:1.24 Wed Jun 18 16:28:11 2003 +++ llvm/www/docs/LangRef.html Wed Jun 18 16:30:51 2003 @@ -1193,9 +1193,10 @@
Example:
   <result> = shr int 4, ubyte %var   ; yields {int}:result = 4 >> %var
-  <result> = shr int 4, ubyte 1      ; yields {int}:result = 2
+  <result> = shr uint 4, ubyte 1     ; yields {uint}:result = 2
   <result> = shr int 4, ubyte 2      ; yields {int}:result = 1
-  <result> = shr int 4, ubyte 3      ; yields {int}:result = 0
+  <result> = shr sbyte 4, ubyte 3    ; yields {sbyte}:result = 0
+  <result> = shr sbyte -2, ubyte 1   ; yields {sbyte}:result = -1
 
@@ -1810,7 +1811,7 @@
Chris Lattner
-Last modified: Wed Jun 18 16:27:39 CDT 2003 +Last modified: Wed Jun 18 16:29:55 CDT 2003 From gaeke at cs.uiuc.edu Wed Jun 18 16:44:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Wed Jun 18 16:44:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp X86TargetMachine.h Message-ID: <200306182143.QAA04210@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.17 -> 1.18 X86TargetMachine.h updated: 1.9 -> 1.10 --- Log message: lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version (non-working) of llc guts for X86, and add a prototype for it. --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.17 llvm/lib/Target/X86/X86TargetMachine.cpp:1.18 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.17 Sat Apr 26 15:11:04 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Wed Jun 18 16:43:21 2003 @@ -41,6 +41,19 @@ FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) { } +// llc backend for x86 +bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM, + std::ostream &Out) { + PM.add(createLowerSwitchPass()); + PM.add(createSimpleX86InstructionSelector(*this)); + PM.add(createLocalRegisterAllocator()); + PM.add(createX86FloatingPointStackifierPass()); + PM.add(createPrologEpilogCodeInserter()); + PM.add(createX86PeepholeOptimizerPass()); + PM.add(createX86CodePrinterPass(Out)); + return false; // success! +} + /// addPassesToJITCompile - Add passes to the specified pass manager to /// implement a fast dynamic compiler for this target. Return true if this is /// not supported for this target. Index: llvm/lib/Target/X86/X86TargetMachine.h diff -u llvm/lib/Target/X86/X86TargetMachine.h:1.9 llvm/lib/Target/X86/X86TargetMachine.h:1.10 --- llvm/lib/Target/X86/X86TargetMachine.h:1.9 Sat Dec 28 21:13:05 2002 +++ llvm/lib/Target/X86/X86TargetMachine.h Wed Jun 18 16:43:21 2003 @@ -42,6 +42,8 @@ /// virtual bool addPassesToEmitMachineCode(PassManager &PM, MachineCodeEmitter &MCE); + + virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); }; #endif From gaeke at cs.uiuc.edu Wed Jun 18 16:44:05 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Wed Jun 18 16:44:05 2003 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200306182143.QAA04220@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.75 -> 1.76 --- Log message: tools/llc/llc.cpp: Make "-o -" work. --- Diffs of the changes: Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.75 llvm/tools/llc/llc.cpp:1.76 --- llvm/tools/llc/llc.cpp:1.75 Wed Jun 18 16:14:23 2003 +++ llvm/tools/llc/llc.cpp Wed Jun 18 16:43:33 2003 @@ -118,19 +118,23 @@ // Figure out where we are going to send the output... std::ostream *Out = 0; if (OutputFilename != "") { - // Specified an output filename? - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; - return 1; - } - Out = new std::ofstream(OutputFilename.c_str()); + if (OutputFilename != "-") { + // Specified an output filename? + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str()); - // Make sure that the Out file gets unlink'd from the disk if we get a - // SIGINT - RemoveFileOnSignal(OutputFilename); + // Make sure that the Out file gets unlink'd from the disk if we get a + // SIGINT + RemoveFileOnSignal(OutputFilename); + } else { + Out = &std::cout; + } } else { if (InputFilename == "-") { OutputFilename = "-"; From lattner at cs.uiuc.edu Wed Jun 18 17:49:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Jun 18 17:49:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/call.ll Message-ID: <200306182248.RAA09358@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: call.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/call.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/call.ll:1.1 *** /dev/null Wed Jun 18 17:48:24 2003 --- llvm/test/Regression/Transforms/InstCombine/call.ll Wed Jun 18 17:48:11 2003 *************** *** 0 **** --- 1,59 ---- + ; RUN: if as < %s | opt -instcombine -die | dis | grep call | grep cast + ; RUN: then exit 1 + ; RUN: else exit 0 + ; RUN: fi + + implementation + + ; Simple case, argument translatable without changing the value + declare void %test1a(sbyte *%A) + void %test1(int *%A) { + call void(int*)* cast (void(sbyte*)* %test1a to void(int*)*)(int* %A) + ret void + } + + ; More complex case, translate argument because of resolution. This is safe + ; because we have the body of the function + void %test2a(sbyte %A) { ret void } + int %test2(int %A) { + call void(int)* cast (void(sbyte)* %test2a to void(int)*)(int %A) + ret int %A + } + + ; Resolving this should insert a cast from sbyte to int, following the C + ; promotion rules. + declare void %test3a(sbyte %A, ...) + void %test3(sbyte %A, sbyte %B) { + call void(sbyte, sbyte)* cast (void(sbyte,...)* %test3a to void(sbyte,sbyte)*)(sbyte %A, sbyte %B) + ret void + } + + ; test conversion of return value... + sbyte %test4a() { ret sbyte 0 } + int %test4() { + %X = call int()* cast (sbyte()* %test4a to int()*)() + ret int %X + } + + ; test conversion of return value... no value conversion occurs so we can do + ; this with just a prototype... + declare uint %test5a() + int %test5() { + %X = call int()* cast (uint()* %test5a to int()*)() + ret int %X + } + + ; test addition of new arguments... + declare int %test6a(int %X) + int %test6() { + %X = call int()* cast (int(int)* %test6a to int()*)() + ret int %X + } + + ; test removal of arguments, only can happen with a function body + void %test7a() { ret void } + void %test7() { + call void(int)* cast (void()* %test7a to void(int)*)(int 5) + ret void + } + From lattner at cs.uiuc.edu Thu Jun 19 12:00:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 12:00:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/FunctionResolution.cpp Message-ID: <200306191659.LAA01599@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: FunctionResolution.cpp updated: 1.31 -> 1.32 --- Log message: Remove a bunch of complicated code. The functionality is implemented in instcombine instead --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.31 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.32 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.31 Sat May 31 16:57:06 2003 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Thu Jun 19 11:59:19 2003 @@ -36,94 +36,6 @@ return new FunctionResolvingPass(); } -// ConvertCallTo - Convert a call to a varargs function with no arg types -// specified to a concrete nonvarargs function. -// -static void ConvertCallTo(CallInst *CI, Function *Dest) { - const FunctionType::ParamTypes &ParamTys = - Dest->getFunctionType()->getParamTypes(); - BasicBlock *BB = CI->getParent(); - - // Keep an iterator to where we want to insert cast instructions if the - // argument types don't agree. - // - unsigned NumArgsToCopy = CI->getNumOperands()-1; - if (NumArgsToCopy != ParamTys.size() && - !(NumArgsToCopy > ParamTys.size() && - Dest->getFunctionType()->isVarArg())) { - std::cerr << "WARNING: Call arguments do not match expected number of" - << " parameters.\n"; - std::cerr << "WARNING: In function '" - << CI->getParent()->getParent()->getName() << "': call: " << *CI; - std::cerr << "Function resolved to: "; - WriteAsOperand(std::cerr, Dest); - std::cerr << "\n"; - if (NumArgsToCopy > ParamTys.size()) - NumArgsToCopy = ParamTys.size(); - } - - std::vector Params; - - // Convert all of the call arguments over... inserting cast instructions if - // the types are not compatible. - for (unsigned i = 1; i <= NumArgsToCopy; ++i) { - Value *V = CI->getOperand(i); - - if (i-1 < ParamTys.size() && V->getType() != ParamTys[i-1]) { - // Must insert a cast... - V = new CastInst(V, ParamTys[i-1], "argcast", CI); - } - - Params.push_back(V); - } - - // If the function takes extra parameters that are not being passed in, pass - // null values in now... - for (unsigned i = NumArgsToCopy; i < ParamTys.size(); ++i) - Params.push_back(Constant::getNullValue(ParamTys[i])); - - // Replace the old call instruction with a new call instruction that calls - // the real function. - // - Instruction *NewCall = new CallInst(Dest, Params, "", CI); - std::string Name = CI->getName(); CI->setName(""); - - // Transfer the name over... - if (NewCall->getType() != Type::VoidTy) - NewCall->setName(Name); - - // Replace uses of the old instruction with the appropriate values... - // - if (NewCall->getType() == CI->getType()) { - CI->replaceAllUsesWith(NewCall); - NewCall->setName(Name); - - } else if (NewCall->getType() == Type::VoidTy) { - // Resolved function does not return a value but the prototype does. This - // often occurs because undefined functions default to returning integers. - // Just replace uses of the call (which are broken anyway) with dummy - // values. - CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); - } else if (CI->getType() == Type::VoidTy) { - // If we are gaining a new return value, we don't have to do anything - // special here, because it will automatically be ignored. - } else { - // Insert a cast instruction to convert the return value of the function - // into it's new type. Of course we only need to do this if the return - // value of the function is actually USED. - // - if (!CI->use_empty()) { - // Insert the new cast instruction... - CastInst *NewCast = new CastInst(NewCall, CI->getType(), Name, CI); - CI->replaceAllUsesWith(NewCast); - } - } - - // The old instruction is no longer needed, destroy it! - BB->getInstList().erase(CI); -} - - static bool ResolveFunctions(Module &M, std::vector &Globals, Function *Concrete) { bool Changed = false; @@ -168,36 +80,12 @@ // functions and that the Old function has no varargs fns specified. In // otherwords it's just (...) // - for (unsigned i = 0; i < Old->use_size(); ) { - User *U = *(Old->use_begin()+i); - if (CastInst *CI = dyn_cast(U)) { - // Convert casts directly - assert(CI->getOperand(0) == Old); - CI->setOperand(0, Concrete); - Changed = true; - ++NumResolved; - } else if (CallInst *CI = dyn_cast(U)) { - // Can only fix up calls TO the argument, not args passed in. - if (CI->getCalledValue() == Old) { - ConvertCallTo(CI, Concrete); - Changed = true; - ++NumResolved; - } else { - ++i; - } - } else { - ++i; - } - } - - // If there are any more uses that we could not resolve, force them to use - // a casted pointer now. - if (!Old->use_empty()) { - NumResolved += Old->use_size(); - Constant *NewCPR = ConstantPointerRef::get(Concrete); - Old->replaceAllUsesWith(ConstantExpr::getCast(NewCPR, Old->getType())); - Changed = true; - } + Value *Replacement = Concrete; + if (Concrete->getType() != Old->getType()) + Replacement = ConstantExpr::getCast(ConstantPointerRef::get(Concrete), + Old->getType()); + NumResolved += Old->use_size(); + Old->replaceAllUsesWith(Replacement); // Since there are no uses of Old anymore, remove it from the module. M.getFunctionList().erase(Old); From lattner at cs.uiuc.edu Thu Jun 19 12:01:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 12:01:03 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200306191700.MAA01675@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.89 -> 1.90 --- Log message: Implement the functionality of InstCombine/call.ll --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.89 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.90 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.89 Thu Jun 5 15:12:51 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jun 19 12:00:31 2003 @@ -24,6 +24,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Support/InstIterator.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Support/CallSite.h" #include "Support/Statistic.h" #include @@ -73,6 +74,8 @@ Instruction *visitSetCondInst(BinaryOperator &I); Instruction *visitShiftInst(ShiftInst &I); Instruction *visitCastInst(CastInst &CI); + Instruction *visitCallInst(CallInst &CI); + Instruction *visitInvokeInst(InvokeInst &II); Instruction *visitPHINode(PHINode &PN); Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP); Instruction *visitAllocationInst(AllocationInst &AI); @@ -81,6 +84,9 @@ // visitInstruction - Specify what to return for unhandled instructions... Instruction *visitInstruction(Instruction &I) { return 0; } + private: + bool transformConstExprCastCall(CallSite CS); + // InsertNewInstBefore - insert an instruction New before instruction Old // in the program. Add the new instruction to the worklist. // @@ -107,7 +113,6 @@ // SimplifyCommutative - This performs a few simplifications for commutative // operators... bool SimplifyCommutative(BinaryOperator &I); - }; RegisterOpt X("instcombine", "Combine redundant instructions"); @@ -927,6 +932,145 @@ return 0; } + +// CallInst simplification +// +Instruction *InstCombiner::visitCallInst(CallInst &CI) { + if (transformConstExprCastCall(&CI)) return 0; + return 0; +} + +// InvokeInst simplification +// +Instruction *InstCombiner::visitInvokeInst(InvokeInst &II) { + if (transformConstExprCastCall(&II)) return 0; + return 0; +} + +// 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()) { + case Type::SByteTyID: + case Type::ShortTyID: return Type::IntTy; + case Type::UByteTyID: + case Type::UShortTyID: return Type::UIntTy; + case Type::FloatTyID: return Type::DoubleTy; + default: return Ty; + } +} + +// transformConstExprCastCall - If the callee is a constexpr cast of a function, +// attempt to move the cast to the arguments of the call/invoke. +// +bool InstCombiner::transformConstExprCastCall(CallSite CS) { + if (!isa(CS.getCalledValue())) return false; + ConstantExpr *CE = cast(CS.getCalledValue()); + if (CE->getOpcode() != Instruction::Cast || + !isa(CE->getOperand(0))) + return false; + ConstantPointerRef *CPR = cast(CE->getOperand(0)); + if (!isa(CPR->getValue())) return false; + Function *Callee = cast(CPR->getValue()); + Instruction *Caller = CS.getInstruction(); + + // Okay, this is a cast from a function to a different type. Unless doing so + // would cause a type conversion of one of our arguments, change this call to + // be a direct call with arguments casted to the appropriate types. + // + const FunctionType *FT = Callee->getFunctionType(); + const Type *OldRetTy = Caller->getType(); + + if (Callee->isExternal() && + !OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType())) + return false; // Cannot transform this return value... + + unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin()); + unsigned NumCommonArgs = std::min(FT->getNumParams(), NumActualArgs); + + CallSite::arg_iterator AI = CS.arg_begin(); + for (unsigned i = 0, e = NumCommonArgs; i != e; ++i, ++AI) { + const Type *ParamTy = FT->getParamType(i); + bool isConvertible = (*AI)->getType()->isLosslesslyConvertibleTo(ParamTy); + if (Callee->isExternal() && !isConvertible) return false; + } + + if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() && + Callee->isExternal()) + return false; // Do not delete arguments unless we have a function body... + + // Okay, we decided that this is a safe thing to do: go ahead and start + // inserting cast instructions as necessary... + std::vector Args; + Args.reserve(NumActualArgs); + + AI = CS.arg_begin(); + for (unsigned i = 0; i != NumCommonArgs; ++i, ++AI) { + const Type *ParamTy = FT->getParamType(i); + if ((*AI)->getType() == ParamTy) { + Args.push_back(*AI); + } else { + Instruction *Cast = new CastInst(*AI, ParamTy, "tmp"); + InsertNewInstBefore(Cast, *Caller); + Args.push_back(Cast); + } + } + + // If the function takes more arguments than the call was taking, add them + // now... + for (unsigned i = NumCommonArgs; i != FT->getNumParams(); ++i) + Args.push_back(Constant::getNullValue(FT->getParamType(i))); + + // If we are removing arguments to the function, emit an obnoxious warning... + if (FT->getNumParams() < NumActualArgs) + if (!FT->isVarArg()) { + std::cerr << "WARNING: While resolving call to function '" + << Callee->getName() << "' arguments were dropped!\n"; + } else { + // Add all of the arguments in their promoted form to the arg list... + for (unsigned i = FT->getNumParams(); i != NumActualArgs; ++i, ++AI) { + const Type *PTy = getPromotedType((*AI)->getType()); + if (PTy != (*AI)->getType()) { + // Must promote to pass through va_arg area! + Instruction *Cast = new CastInst(*AI, PTy, "tmp"); + InsertNewInstBefore(Cast, *Caller); + Args.push_back(Cast); + } else { + Args.push_back(*AI); + } + } + } + + if (FT->getReturnType() == Type::VoidTy) + Caller->setName(""); // Void type should not have a name... + + Instruction *NC; + if (InvokeInst *II = dyn_cast(Caller)) { + NC = new InvokeInst(Callee, II->getNormalDest(), II->getExceptionalDest(), + Args, Caller->getName(), Caller); + } else { + NC = new CallInst(Callee, Args, Caller->getName(), Caller); + } + + // Insert a cast of the return type as necessary... + Value *NV = NC; + if (Caller->getType() != NV->getType() && !Caller->use_empty()) { + if (NV->getType() != Type::VoidTy) { + NV = NC = new CastInst(NC, Caller->getType(), "tmp"); + InsertNewInstBefore(NC, *Caller); + AddUsesToWorkList(*Caller); + } else { + NV = Constant::getNullValue(Caller->getType()); + } + } + + if (Caller->getType() != Type::VoidTy && !Caller->use_empty()) + Caller->replaceAllUsesWith(NV); + Caller->getParent()->getInstList().erase(Caller); + removeFromWorkList(Caller); + return true; +} + // PHINode simplification From lattner at cs.uiuc.edu Thu Jun 19 12:03:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 12:03:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/FunctionResolve/2002-11-09-ExternFn.ll basictest.ll retmismatch1.ll retmismatch2.ll Message-ID: <200306191702.MAA02360@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/FunctionResolve: 2002-11-09-ExternFn.ll updated: 1.1 -> 1.2 basictest.ll updated: 1.1 -> 1.2 retmismatch1.ll updated: 1.2 -> 1.3 retmismatch2.ll updated: 1.2 -> 1.3 --- Log message: The actual nicification of calls is now implemented in instcombine, not in funcresolve --- Diffs of the changes: Index: llvm/test/Regression/Transforms/FunctionResolve/2002-11-09-ExternFn.ll diff -u llvm/test/Regression/Transforms/FunctionResolve/2002-11-09-ExternFn.ll:1.1 llvm/test/Regression/Transforms/FunctionResolve/2002-11-09-ExternFn.ll:1.2 --- llvm/test/Regression/Transforms/FunctionResolve/2002-11-09-ExternFn.ll:1.1 Sat Nov 9 21:35:43 2002 +++ llvm/test/Regression/Transforms/FunctionResolve/2002-11-09-ExternFn.ll Thu Jun 19 12:02:06 2003 @@ -3,7 +3,7 @@ ; RUN: else exit 1 # Make sure opt doesn't abort! ; RUN: fi ; -; RUN: if as < %s | opt -funcresolve | dis | grep '\.\.\.' +; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi Index: llvm/test/Regression/Transforms/FunctionResolve/basictest.ll diff -u llvm/test/Regression/Transforms/FunctionResolve/basictest.ll:1.1 llvm/test/Regression/Transforms/FunctionResolve/basictest.ll:1.2 --- llvm/test/Regression/Transforms/FunctionResolve/basictest.ll:1.1 Fri May 24 16:27:40 2002 +++ llvm/test/Regression/Transforms/FunctionResolve/basictest.ll Thu Jun 19 12:02:06 2003 @@ -1,4 +1,4 @@ -; RUN: if as < %s | opt -funcresolve | dis | grep '\.\.\.' | grep call +; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi Index: llvm/test/Regression/Transforms/FunctionResolve/retmismatch1.ll diff -u llvm/test/Regression/Transforms/FunctionResolve/retmismatch1.ll:1.2 llvm/test/Regression/Transforms/FunctionResolve/retmismatch1.ll:1.3 --- llvm/test/Regression/Transforms/FunctionResolve/retmismatch1.ll:1.2 Wed Oct 9 15:36:54 2002 +++ llvm/test/Regression/Transforms/FunctionResolve/retmismatch1.ll Thu Jun 19 12:02:06 2003 @@ -5,7 +5,7 @@ ; RUN: else exit 1 # Make sure opt doesn't abort! ; RUN: fi ; -; RUN: if as < %s | opt -funcresolve | dis | grep '\.\.\.' | grep call +; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi Index: llvm/test/Regression/Transforms/FunctionResolve/retmismatch2.ll diff -u llvm/test/Regression/Transforms/FunctionResolve/retmismatch2.ll:1.2 llvm/test/Regression/Transforms/FunctionResolve/retmismatch2.ll:1.3 --- llvm/test/Regression/Transforms/FunctionResolve/retmismatch2.ll:1.2 Wed Oct 9 15:36:54 2002 +++ llvm/test/Regression/Transforms/FunctionResolve/retmismatch2.ll Thu Jun 19 12:02:06 2003 @@ -6,7 +6,7 @@ ; RUN: else exit 1 # Make sure opt doesn't abort! ; RUN: fi ; -; RUN: if as < %s | opt -funcresolve | dis | grep '\.\.\.' | grep call +; RUN: if as < %s | opt -funcresolve -instcombine | dis | grep '\.\.\.' | grep call ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi From lattner at cs.uiuc.edu Thu Jun 19 12:04:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 12:04:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/iTerminators.h Message-ID: <200306191703.MAA02374@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: iTerminators.h updated: 1.27 -> 1.28 --- Log message: Update comments --- Diffs of the changes: Index: llvm/include/llvm/iTerminators.h diff -u llvm/include/llvm/iTerminators.h:1.27 llvm/include/llvm/iTerminators.h:1.28 --- llvm/include/llvm/iTerminators.h:1.27 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/iTerminators.h Thu Jun 19 12:03:00 2003 @@ -14,8 +14,8 @@ #include "llvm/InstrTypes.h" //===--------------------------------------------------------------------------- -// ReturnInst - Return a value (possibly void), from a method. Execution does -// not continue in this method any longer. +// ReturnInst - Return a value (possibly void), from a function. Execution does +// not continue in this function any longer. // class ReturnInst : public TerminatorInst { ReturnInst(const ReturnInst &RI) : TerminatorInst(Instruction::Ret) { @@ -194,7 +194,7 @@ class InvokeInst : public TerminatorInst { InvokeInst(const InvokeInst &BI); public: - InvokeInst(Value *Meth, BasicBlock *IfNormal, BasicBlock *IfException, + InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, const std::vector &Params, const std::string &Name = "", Instruction *InsertBefore = 0); @@ -212,7 +212,7 @@ return dyn_cast(Operands[0].get()); } - // getCalledValue - Get a pointer to a method that is invoked by this inst. + // getCalledValue - Get a pointer to a function that is invoked by this inst. inline const Value *getCalledValue() const { return Operands[0]; } inline Value *getCalledValue() { return Operands[0]; } From lattner at cs.uiuc.edu Thu Jun 19 12:04:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 12:04:06 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/Makefile Message-ID: <200306191703.MAA02385@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000: Makefile updated: 1.2 -> 1.3 --- Log message: Switch to building dirs in parallel, not serial --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/Makefile:1.2 llvm/test/Programs/External/SPEC/CINT2000/Makefile:1.3 --- llvm/test/Programs/External/SPEC/CINT2000/Makefile:1.2 Mon Jun 16 07:13:57 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/Makefile Thu Jun 19 12:03:22 2003 @@ -1,4 +1,4 @@ LEVEL = ../../../../.. -DIRS := $(filter-out %-disabled/, $(sort $(filter-out CVS/, $(wildcard */)))) +PARALLEL_DIRS := $(filter-out %-disabled/, $(sort $(filter-out CVS/, $(wildcard */)))) include ${LEVEL}/test/Makefile.tests From lattner at cs.uiuc.edu Thu Jun 19 12:05:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 12:05:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200306191704.MAA02396@apoc.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.34 -> 1.35 --- Log message: Funcresolve no longer performs nicification of resolved functions instcombine does this --- Diffs of the changes: Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.34 llvm/tools/gccld/gccld.cpp:1.35 --- llvm/tools/gccld/gccld.cpp:1.34 Wed Jun 18 11:29:02 2003 +++ llvm/tools/gccld/gccld.cpp Thu Jun 19 12:03:51 2003 @@ -404,6 +404,11 @@ // Passes.add(createGlobalDCEPass()); + // The FuncResolve pass may leave cruft around if functions were prototyped + // differently than they were defined. Remove this cruft. + // + Passes.add(createInstructionCombiningPass()); + // Add the pass that writes bytecode to the output file... std::string RealBytecodeOutput = OutputFilename; if (!LinkAsLibrary) RealBytecodeOutput += ".bc"; From lattner at cs.uiuc.edu Thu Jun 19 13:43:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 13:43:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp Message-ID: <200306191842.NAA05674@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.41 -> 1.42 --- Log message: Remove usage of sys/unistd.h --- Diffs of the changes: Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.41 llvm/lib/VMCore/Pass.cpp:1.42 --- llvm/lib/VMCore/Pass.cpp:1.41 Fri Mar 21 15:41:02 2003 +++ llvm/lib/VMCore/Pass.cpp Thu Jun 19 13:41:54 2003 @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include // IncludeFile - Stub function used to help linking out. From lattner at cs.uiuc.edu Thu Jun 19 13:43:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 13:43:06 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200306191842.NAA05686@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.19 -> 1.20 --- Log message: Remove usage of sys/unistd.h --- Diffs of the changes: Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.19 llvm/lib/Support/Timer.cpp:1.20 --- llvm/lib/Support/Timer.cpp:1.19 Tue Jun 17 14:54:00 2003 +++ llvm/lib/Support/Timer.cpp Thu Jun 19 13:42:09 2003 @@ -8,7 +8,6 @@ #include "Support/CommandLine.h" #include #include -#include #include #ifndef __FreeBSD__ #include From gaeke at cs.uiuc.edu Thu Jun 19 14:33:00 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 19 14:33:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp Message-ID: <200306191932.OAA13888@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.35 -> 1.36 --- Log message: Add Initialization and Finalization methods for the Printer pass, to print various things on a module-by-module basis (currently, only the former is used). Don't print < > around names. The assembler can't take it. Print pseudoinstructions only as comments. The poor little assembler can't take that, either. --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.35 llvm/lib/Target/X86/Printer.cpp:1.36 --- llvm/lib/Target/X86/Printer.cpp:1.35 Mon May 26 19:03:17 2003 +++ llvm/lib/Target/X86/Printer.cpp Thu Jun 19 14:32:32 2003 @@ -27,6 +27,10 @@ void printConstantPool(MachineConstantPool *MCP, const TargetData &TD); bool runOnMachineFunction(MachineFunction &F); + + bool doInitialization(Module &M); + bool doFinalization(Module &M); + }; } @@ -123,13 +127,13 @@ O << (int)MO.getImmedValue(); return; case MachineOperand::MO_PCRelativeDisp: - O << "<" << MO.getVRegValue()->getName() << ">"; + O << MO.getVRegValue()->getName(); return; case MachineOperand::MO_GlobalAddress: - O << "<" << MO.getGlobal()->getName() << ">"; + O << MO.getGlobal()->getName(); return; case MachineOperand::MO_ExternalSymbol: - O << "<" << MO.getSymbolName() << ">"; + O << MO.getSymbolName(); return; default: O << ""; return; @@ -208,6 +212,10 @@ switch (Desc.TSFlags & X86II::FormMask) { case X86II::Pseudo: + // Print pseudo-instructions as comments; either they should have been + // turned into real instructions by now, or they don't need to be + // seen by the assembler (e.g., IMPLICIT_USEs.) + O << "# "; if (Opcode == X86::PHI) { printOp(O, MI->getOperand(0), RI); O << " = phi "; @@ -457,3 +465,18 @@ O << "\tUNKNOWN FORM:\t\t-"; MI->print(O, TM); break; } } + +bool Printer::doInitialization(Module &M) +{ + // Tell gas we are outputting Intel syntax (not AT&T syntax) assembly, + // with no % decorations on register names. + O << "\t.intel_syntax noprefix\n"; + return false; // success +} + +bool Printer::doFinalization(Module &M) +{ + // FIXME: We may have to print out constants here. + return false; // success +} + From gaeke at cs.uiuc.edu Thu Jun 19 14:35:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 19 14:35:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.def Message-ID: <200306191934.OAA13931@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.def updated: 1.57 -> 1.58 --- Log message: Rename many instructions to their Intel asm-compatible names. This involves removing the [bwl] suffixes from instruction names, as well as some other distinguishing marks (32/64/80 on fp insns, _i suffixes, etc.) Lowercase all instr. names as well for consistency's sake. --- Diffs of the changes: Index: llvm/lib/Target/X86/X86InstrInfo.def diff -u llvm/lib/Target/X86/X86InstrInfo.def:1.57 llvm/lib/Target/X86/X86InstrInfo.def:1.58 --- llvm/lib/Target/X86/X86InstrInfo.def:1.57 Thu Jun 5 14:30:30 2003 +++ llvm/lib/Target/X86/X86InstrInfo.def Thu Jun 19 14:34:44 2003 @@ -260,12 +260,12 @@ // Integer comparisons -I(CMPrr8 , "cmpb", 0x38, 0, X86II::Void | X86II::MRMDestReg , NoIR, NoIR) // compare R8,R8 -I(CMPrr16 , "cmpw", 0x39, 0, X86II::Void | X86II::MRMDestReg | X86II::OpSize, NoIR, NoIR) // compare R16,R16 -I(CMPrr32 , "cmpl", 0x39, 0, X86II::Void | X86II::MRMDestReg , NoIR, NoIR) // compare R32,R32 -I(CMPri8 , "cmpb", 0x80, 0, X86II::Void | X86II::MRMS7r | X86II::Arg8 , NoIR, NoIR) // compare R8, imm8 -I(CMPri16 , "cmpw", 0x81, 0, X86II::Void | X86II::MRMS7r | X86II::Arg16 | X86II::OpSize, NoIR, NoIR) // compare R8, imm8 -I(CMPri32 , "cmpl", 0x81, 0, X86II::Void | X86II::MRMS7r | X86II::Arg32 , NoIR, NoIR) // compare R8, imm8 +I(CMPrr8 , "cmp", 0x38, 0, X86II::Void | X86II::MRMDestReg , NoIR, NoIR) // compare R8,R8 +I(CMPrr16 , "cmp", 0x39, 0, X86II::Void | X86II::MRMDestReg | X86II::OpSize, NoIR, NoIR) // compare R16,R16 +I(CMPrr32 , "cmp", 0x39, 0, X86II::Void | X86II::MRMDestReg , NoIR, NoIR) // compare R32,R32 +I(CMPri8 , "cmp", 0x80, 0, X86II::Void | X86II::MRMS7r | X86II::Arg8 , NoIR, NoIR) // compare R8, imm8 +I(CMPri16 , "cmp", 0x81, 0, X86II::Void | X86II::MRMS7r | X86II::Arg16 | X86II::OpSize, NoIR, NoIR) // compare R8, imm8 +I(CMPri32 , "cmp", 0x81, 0, X86II::Void | X86II::MRMS7r | X86II::Arg32 , NoIR, NoIR) // compare R8, imm8 // Sign extenders (first 3 are good for DIV/IDIV; the others are more general) I(CBW , "cbw", 0x98, 0, X86II::Void | X86II::RawFrm | X86II::OpSize, O_AL, O_AH) // AX = signext(AL) @@ -288,71 +288,71 @@ // FIXME: These need to indicate mod/ref sets for FP regs... & FP 'TOP' // Floating point pseudo instructions... -I(FpMOV , "FMOV" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // f1 = fmov f2 -I(FpADD , "FADD" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fadd f2, f3 -I(FpSUB , "FSUB" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fsub f2, f3 -I(FpMUL , "FMUL" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fmul f2, f3 -I(FpDIV , "FDIV" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fdiv f2, f3 -I(FpUCOM , "FUCOM", 0, M_PSEUDO_FLAG, X86II::Void | X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // FPSW = fucom f1, f2 +I(FpMOV , "fmov" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // f1 = fmov f2 +I(FpADD , "fadd" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fadd f2, f3 +I(FpSUB , "fsub" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fsub f2, f3 +I(FpMUL , "fmul" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fmul f2, f3 +I(FpDIV , "fdiv" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fdiv f2, f3 +I(FpUCOM , "fucom", 0, M_PSEUDO_FLAG, X86II::Void | X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // FPSW = fucom f1, f2 -I(FpGETRESULT , "FGETRESULT",0, M_PSEUDO_FLAG, X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // FPR = ST(0) -I(FpSETRESULT , "FSETRESULT",0, M_PSEUDO_FLAG | M_TERMINATOR_FLAG, X86II::Void | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // ST(0) = FPR +I(FpGETRESULT , "fgetresult",0, M_PSEUDO_FLAG, X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // FPR = ST(0) +I(FpSETRESULT , "fsetresult",0, M_PSEUDO_FLAG | M_TERMINATOR_FLAG, X86II::Void | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // ST(0) = FPR // Floating point loads & stores... PREFIX ARGTYPE ENCODING FP INST TYPE REF MOD -I(FLDr32 , "fld32", 0xD9, 0, X86II::ArgF32 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load float -I(FLDr64 , "fld64", 0xDD, 0, X86II::ArgF64 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load double -I(FLDr80 , "fld80", 0xDB, 0, X86II::ArgF80 | X86II::MRMS5m | X86II::ZeroArgFP, NoIR, NoIR) // load extended +I(FLDr32 , "fld", 0xD9, 0, X86II::ArgF32 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load float +I(FLDr64 , "fld", 0xDD, 0, X86II::ArgF64 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load double +I(FLDr80 , "fld", 0xDB, 0, X86II::ArgF80 | X86II::MRMS5m | X86II::ZeroArgFP, NoIR, NoIR) // load extended I(FLDrr , "fld" , 0xC0, 0, X86II::D9 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // push(ST(i)) -I(FILDr16 , "fild16", 0xDF, 0, X86II::Arg16 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load signed short -I(FILDr32 , "fild32", 0xDB, 0, X86II::Arg32 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load signed int -I(FILDr64 , "fild64", 0xDF, 0, X86II::Arg64 | X86II::MRMS5m | X86II::ZeroArgFP, NoIR, NoIR) // load signed long +I(FILDr16 , "fild", 0xDF, 0, X86II::Arg16 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load signed short +I(FILDr32 , "fild", 0xDB, 0, X86II::Arg32 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load signed int +I(FILDr64 , "fild", 0xDF, 0, X86II::Arg64 | X86II::MRMS5m | X86II::ZeroArgFP, NoIR, NoIR) // load signed long -I(FSTr32 , "fst32", 0xD9, 0, X86II::Void | X86II::ArgF32 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store float -I(FSTr64 , "fst64", 0xDD, 0, X86II::Void | X86II::ArgF64 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store double -I(FSTPr32 , "fst32p", 0xD9, 0, X86II::Void | X86II::ArgF32 | X86II::MRMS3m , NoIR, NoIR) // store float, pop -I(FSTPr64 , "fst64p", 0xDD, 0, X86II::Void | X86II::ArgF64 | X86II::MRMS3m , NoIR, NoIR) // store double, pop -I(FSTPr80 , "fst80p", 0xDB, 0, X86II::Void | X86II::ArgF80 | X86II::MRMS7m | X86II::OneArgFP , NoIR, NoIR) // store extended, pop +I(FSTr32 , "fst", 0xD9, 0, X86II::Void | X86II::ArgF32 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store float +I(FSTr64 , "fst", 0xDD, 0, X86II::Void | X86II::ArgF64 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store double +I(FSTPr32 , "fstp", 0xD9, 0, X86II::Void | X86II::ArgF32 | X86II::MRMS3m , NoIR, NoIR) // store float, pop +I(FSTPr64 , "fstp", 0xDD, 0, X86II::Void | X86II::ArgF64 | X86II::MRMS3m , NoIR, NoIR) // store double, pop +I(FSTPr80 , "fstp", 0xDB, 0, X86II::Void | X86II::ArgF80 | X86II::MRMS7m | X86II::OneArgFP , NoIR, NoIR) // store extended, pop I(FSTrr , "fst" , 0xD0, 0, X86II::DD | X86II::Void | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) I(FSTPrr , "fstp" , 0xD8, 0, X86II::DD | X86II::Void | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0), pop -I(FISTr16 , "fist16", 0xDF, 0, X86II::Void | X86II::Arg16 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store signed short -I(FISTr32 , "fist32", 0xDB, 0, X86II::Void | X86II::Arg32 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store signed int -I(FISTPr16 , "fist16p", 0xDF, 0, X86II::Void | X86II::Arg16 | X86II::MRMS3m , NoIR, NoIR) // store short, pop -I(FISTPr32 , "fist32p", 0xDB, 0, X86II::Void | X86II::Arg32 | X86II::MRMS3m , NoIR, NoIR) // store int, pop -I(FISTPr64 , "fist64p", 0xDF, 0, X86II::Void | X86II::Arg64 | X86II::MRMS7m | X86II::OneArgFP , NoIR, NoIR) // store long, pop +I(FISTr16 , "fist", 0xDF, 0, X86II::Void | X86II::Arg16 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store signed short +I(FISTr32 , "fist", 0xDB, 0, X86II::Void | X86II::Arg32 | X86II::MRMS2m | X86II::OneArgFP , NoIR, NoIR) // store signed int +I(FISTPr16 , "fistp", 0xDF, 0, X86II::Void | X86II::Arg16 | X86II::MRMS3m , NoIR, NoIR) // store short, pop +I(FISTPr32 , "fistp", 0xDB, 0, X86II::Void | X86II::Arg32 | X86II::MRMS3m , NoIR, NoIR) // store int, pop +I(FISTPr64 , "fistp", 0xDF, 0, X86II::Void | X86II::Arg64 | X86II::MRMS7m | X86II::OneArgFP , NoIR, NoIR) // store long, pop I(FXCH , "fxch" , 0xC8, 0, X86II::D9 | X86II::Void | X86II::ArgF80 | X86II::AddRegFrm , O_ST0, O_ST0) // fxch ST(i), ST(0) // Floating point constant loads... -I(FLD0 , "fld0" , 0xEE, 0, X86II::D9 | X86II::ArgF80 | X86II::RawFrm | X86II::ZeroArgFP, NoIR, NoIR) // load +0.0 +I(FLD0 , "fldz" , 0xEE, 0, X86II::D9 | X86II::ArgF80 | X86II::RawFrm | X86II::ZeroArgFP, NoIR, NoIR) // load +0.0 I(FLD1 , "fld1" , 0xE8, 0, X86II::D9 | X86II::ArgF80 | X86II::RawFrm | X86II::ZeroArgFP, NoIR, NoIR) // load +1.0 // Binary arithmetic operations... -I(FADDST0r , "fadd_0", 0xC0, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) + ST(i) -I(FADDrST0 , "fadd_i", 0xC0, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) + ST(0) -I(FADDPrST0 , "faddp_i", 0xC0, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) + ST(0), pop - -I(FSUBRST0r , "fsubr_0" , 0xE8, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(i) - ST(0) -I(FSUBrST0 , "fsub_i" , 0xE8, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) - ST(0) -I(FSUBPrST0 , "fsubp_i" , 0xE8, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) - ST(0), pop - -I(FSUBST0r , "fsub_0" , 0xE0, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) - ST(i) -I(FSUBRrST0 , "fsubr_i" , 0xE0, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) - ST(i) -I(FSUBRPrST0 , "fsubrp_i", 0xE0, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) - ST(i), pop - -I(FMULST0r , "fmul_0", 0xC8, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) * ST(i) -I(FMULrST0 , "fmul_i", 0xC8, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) * ST(0) -I(FMULPrST0 , "fmulp_i", 0xC8, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) * ST(0), pop - -I(FDIVRST0r , "fdivr_0" , 0xF8, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(i) / ST(0) -I(FDIVrST0 , "fdiv_i" , 0xF8, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) / ST(0) -I(FDIVPrST0 , "fdivp_i" , 0xF8, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) / ST(0), pop - -I(FDIVST0r , "fdiv_0" , 0xF0, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) / ST(i) -I(FDIVRrST0 , "fdivr_i" , 0xF0, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) / ST(i) -I(FDIVRPrST0 , "fdivrp_i", 0xF0, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) / ST(i), pop +I(FADDST0r , "fadd", 0xC0, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) + ST(i) +I(FADDrST0 , "fadd", 0xC0, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) + ST(0) +I(FADDPrST0 , "faddp", 0xC0, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) + ST(0), pop + +I(FSUBRST0r , "fsubr" , 0xE8, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(i) - ST(0) +I(FSUBrST0 , "fsub" , 0xE8, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) - ST(0) +I(FSUBPrST0 , "fsubp" , 0xE8, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) - ST(0), pop + +I(FSUBST0r , "fsub" , 0xE0, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) - ST(i) +I(FSUBRrST0 , "fsubr" , 0xE0, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) - ST(i) +I(FSUBRPrST0 , "fsubrp", 0xE0, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) - ST(i), pop + +I(FMULST0r , "fmul", 0xC8, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) * ST(i) +I(FMULrST0 , "fmul", 0xC8, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) * ST(0) +I(FMULPrST0 , "fmulp", 0xC8, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) * ST(0), pop + +I(FDIVRST0r , "fdivr" , 0xF8, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(i) / ST(0) +I(FDIVrST0 , "fdiv" , 0xF8, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) / ST(0) +I(FDIVPrST0 , "fdivp" , 0xF8, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(i) / ST(0), pop + +I(FDIVST0r , "fdiv" , 0xF0, 0, X86II::D8 | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(0) = ST(0) / ST(i) +I(FDIVRrST0 , "fdivr" , 0xF0, 0, X86II::DC | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) / ST(i) +I(FDIVRPrST0 , "fdivrp", 0xF0, 0, X86II::DE | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // ST(i) = ST(0) / ST(i), pop // Floating point compares I(FUCOMr , "fucom" , 0xE0, 0, X86II::DD | X86II::Void | X86II::ArgF80 | X86II::AddRegFrm , NoIR, NoIR) // FPSW = compare ST(0) with ST(i) From gaeke at cs.uiuc.edu Thu Jun 19 14:42:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 19 14:42:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.def Message-ID: <200306191941.OAA23242@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.def updated: 1.58 -> 1.59 --- Log message: RECAPITALIZE all the names of pseudo-instructions, and add a comment explaining the convention. :-) --- Diffs of the changes: Index: llvm/lib/Target/X86/X86InstrInfo.def diff -u llvm/lib/Target/X86/X86InstrInfo.def:1.58 llvm/lib/Target/X86/X86InstrInfo.def:1.59 --- llvm/lib/Target/X86/X86InstrInfo.def:1.58 Thu Jun 19 14:34:44 2003 +++ llvm/lib/Target/X86/X86InstrInfo.def Thu Jun 19 14:41:13 2003 @@ -48,7 +48,10 @@ // Arguments to be passed into the I macro // #1: Enum name - This ends up being the opcode symbol in the X86 namespace -// #2: Opcode name, as used by the gnu assembler +// #2: Opcode name, as used by the Intel assembler. This should be in +// ALL CAPS for pseudo-instructions (which the assembler should never +// see), or all lowercase for real instructions (which the assembler +// should see). // #3: The base opcode for the instruction // #4: Instruction Flags - This should be a field or'd together that contains // constants from the TargetInstrInfo.h file. @@ -60,7 +63,7 @@ // // The first instruction must always be the PHI instruction: -I(PHI , "phi", 0, 0, X86II::Pseudo , NoIR, NoIR) +I(PHI , "PHI", 0, 0, X86II::Pseudo , NoIR, NoIR) // The second instruction must always be the noop instruction: I(NOOP , "nop", 0x90, 0, X86II::RawFrm | X86II::Void, NoIR, NoIR) // nop @@ -72,18 +75,18 @@ // instruction turns into a noop, but if the frame pointer is retained, this // turns into a 'sub ESP, '. // -I(ADJCALLSTACKDOWN, "adjcallstackdown", 0, 0, X86II::Pseudo, NoIR, NoIR) +I(ADJCALLSTACKDOWN, "ADJCALLSTACKDOWN", 0, 0, X86II::Pseudo, NoIR, NoIR) // This instruction is used to mark readjustment of the stack after a function // call. If the frame pointer is retained, this becomes a 'add ESP, ' // instruction after the call. -I(ADJCALLSTACKUP , "adjcallstackup" , 0, 0, X86II::Pseudo, NoIR, NoIR) +I(ADJCALLSTACKUP , "ADJCALLSTACKUP" , 0, 0, X86II::Pseudo, NoIR, NoIR) // This pseudo-instruction is used to record implicit uses of physical registers // at the end of the function. This ensures that bad things aren't done to // registes that are live on exit from the function (for example, EAX). // -I(IMPLICIT_USE, "implicit_use", 0, 0, X86II::Pseudo, NoIR, NoIR) +I(IMPLICIT_USE, "IMPLICIT_USE", 0, 0, X86II::Pseudo, NoIR, NoIR) // Flow control instructions @@ -288,15 +291,15 @@ // FIXME: These need to indicate mod/ref sets for FP regs... & FP 'TOP' // Floating point pseudo instructions... -I(FpMOV , "fmov" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // f1 = fmov f2 -I(FpADD , "fadd" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fadd f2, f3 -I(FpSUB , "fsub" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fsub f2, f3 -I(FpMUL , "fmul" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fmul f2, f3 -I(FpDIV , "fdiv" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fdiv f2, f3 -I(FpUCOM , "fucom", 0, M_PSEUDO_FLAG, X86II::Void | X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // FPSW = fucom f1, f2 +I(FpMOV , "FMOV" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // f1 = fmov f2 +I(FpADD , "FADD" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fadd f2, f3 +I(FpSUB , "FSUB" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fsub f2, f3 +I(FpMUL , "FMUL" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fmul f2, f3 +I(FpDIV , "FDIV" , 0, M_PSEUDO_FLAG, X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // f1 = fdiv f2, f3 +I(FpUCOM , "FUCOM", 0, M_PSEUDO_FLAG, X86II::Void | X86II::ArgF80 | X86II::Pseudo | X86II::TwoArgFP , NoIR, NoIR) // FPSW = fucom f1, f2 -I(FpGETRESULT , "fgetresult",0, M_PSEUDO_FLAG, X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // FPR = ST(0) -I(FpSETRESULT , "fsetresult",0, M_PSEUDO_FLAG | M_TERMINATOR_FLAG, X86II::Void | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // ST(0) = FPR +I(FpGETRESULT , "FGETRESULT",0, M_PSEUDO_FLAG, X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // FPR = ST(0) +I(FpSETRESULT , "FSETRESULT",0, M_PSEUDO_FLAG | M_TERMINATOR_FLAG, X86II::Void | X86II::Pseudo | X86II::SpecialFP, NoIR, NoIR) // ST(0) = FPR // Floating point loads & stores... PREFIX ARGTYPE ENCODING FP INST TYPE REF MOD I(FLDr32 , "fld", 0xD9, 0, X86II::ArgF32 | X86II::MRMS0m | X86II::ZeroArgFP, NoIR, NoIR) // load float From gaeke at cs.uiuc.edu Thu Jun 19 14:59:02 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu Jun 19 14:59:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp Message-ID: <200306191958.OAA00558@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Printer.cpp updated: 1.36 -> 1.37 --- Log message: Fix output bug: Intel asm comment character is #, not ;. --- Diffs of the changes: Index: llvm/lib/Target/X86/Printer.cpp diff -u llvm/lib/Target/X86/Printer.cpp:1.36 llvm/lib/Target/X86/Printer.cpp:1.37 --- llvm/lib/Target/X86/Printer.cpp:1.36 Thu Jun 19 14:32:32 2003 +++ llvm/lib/Target/X86/Printer.cpp Thu Jun 19 14:58:32 2003 @@ -52,7 +52,7 @@ for (unsigned i = 0, e = CP.size(); i != e; ++i) { O << "\t.section .rodata\n"; O << "\t.align " << (unsigned)TD.getTypeAlignment(CP[i]->getType()) << "\n"; - O << ".CPI" << i+ConstIdx << ":\t\t\t\t\t;" << *CP[i] << "\n"; + O << ".CPI" << i+ConstIdx << ":\t\t\t\t\t#" << *CP[i] << "\n"; O << "\t*Constant output not implemented yet!*\n\n"; } ConstIdx += CP.size(); // Don't recycle constant pool index numbers From lattner at cs.uiuc.edu Thu Jun 19 16:15:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 16:15:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSGraph.h DSGraphTraits.h DSNode.h Message-ID: <200306192114.QAA16742@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSGraph.h updated: 1.48 -> 1.49 DSGraphTraits.h updated: 1.14 -> 1.15 DSNode.h updated: 1.24 -> 1.25 --- Log message: Lots of changes to make the NodeType field private to DSNode. Add new MultiObject flag --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSGraph.h diff -u llvm/include/llvm/Analysis/DSGraph.h:1.48 llvm/include/llvm/Analysis/DSGraph.h:1.49 --- llvm/include/llvm/Analysis/DSGraph.h:1.48 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/DSGraph.h Thu Jun 19 16:14:22 2003 @@ -137,9 +137,9 @@ /// maskNodeTypes - Apply a mask to all of the node types in the graph. This /// is useful for clearing out markers like Incomplete. /// - void maskNodeTypes(unsigned char Mask) { + void maskNodeTypes(unsigned Mask) { for (unsigned i = 0, e = Nodes.size(); i != e; ++i) - Nodes[i]->NodeType &= Mask; + Nodes[i]->maskNodeTypes(Mask); } void maskIncompleteMarkers() { maskNodeTypes(~DSNode::Incomplete); } Index: llvm/include/llvm/Analysis/DSGraphTraits.h diff -u llvm/include/llvm/Analysis/DSGraphTraits.h:1.14 llvm/include/llvm/Analysis/DSGraphTraits.h:1.15 --- llvm/include/llvm/Analysis/DSGraphTraits.h:1.14 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/DSGraphTraits.h Thu Jun 19 16:14:22 2003 @@ -28,7 +28,7 @@ DSNodeIterator(NodeTy *N, bool) : Node(N) { // Create end iterator Offset = N->getNumLinks() << DS::PointerShift; if (Offset == 0 && Node->getForwardNode() && - (Node->NodeType & DSNode::DEAD)) // Model Forward link + Node->isDeadNode()) // Model Forward link Offset += DS::PointerSize; } public: @@ -47,7 +47,7 @@ } pointer operator*() const { - if (Node->NodeType & DSNode::DEAD) + if (Node->isDeadNode()) return Node->getForwardNode(); else return Node->getLink(Offset).getNode(); Index: llvm/include/llvm/Analysis/DSNode.h diff -u llvm/include/llvm/Analysis/DSNode.h:1.24 llvm/include/llvm/Analysis/DSNode.h:1.25 --- llvm/include/llvm/Analysis/DSNode.h:1.24 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/DSNode.h Thu Jun 19 16:14:22 2003 @@ -69,24 +69,28 @@ GlobalNode = 1 << 2, // This node was allocated by a global var decl UnknownNode = 1 << 3, // This node points to unknown allocated memory Incomplete = 1 << 4, // This node may not be complete + Modified = 1 << 5, // This node is modified in this context Read = 1 << 6, // This node is read in this context + Array = 1 << 7, // This node is treated like an array -#if 1 - DEAD = 1 << 8, // This node is dead and should not be pointed to -#endif + MultiObject = 1 << 8, // This node represents > 1 object (may alias) + //#ifndef NDEBUG + DEAD = 1 << 9, // This node is dead and should not be pointed to + //#endif Composition = AllocaNode | HeapNode | GlobalNode | UnknownNode, }; /// NodeType - A union of the above bits. "Shadow" nodes do not add any flags /// to the nodes in the data structure graph, so it is possible to have nodes - /// with a value of 0 for their NodeType. Scalar and Alloca markers go away - /// when function graphs are inlined. + /// with a value of 0 for their NodeType. /// +private: unsigned short NodeType; +public: - DSNode(unsigned NodeTy, const Type *T, DSGraph *G); + DSNode(const Type *T, DSGraph *G); DSNode(const DSNode &, DSGraph *G); ~DSNode() { @@ -122,14 +126,6 @@ /// return the number of nodes forwarding over the node! unsigned getNumReferrers() const { return NumReferrers; } - /// isModified - Return true if this node may be modified in this context - /// - bool isModified() const { return (NodeType & Modified) != 0; } - - /// isRead - Return true if this node may be read in this context - /// - bool isRead() const { return (NodeType & Read) != 0; } - DSGraph *getParentGraph() const { return ParentGraph; } void setParentGraph(DSGraph *G) { ParentGraph = G; } @@ -234,7 +230,43 @@ /// void addGlobal(GlobalValue *GV); const std::vector &getGlobals() const { return Globals; } - std::vector &getGlobals() { return Globals; } + + /// maskNodeTypes - Apply a mask to the node types bitfield. + /// + void maskNodeTypes(unsigned Mask) { + NodeType &= Mask; + } + + /// getNodeFlags - Return all of the flags set on the node. If the DEAD flag + /// is set, hide it from the caller. + unsigned getNodeFlags() const { return NodeType & ~DEAD; } + + bool isAllocaNode() const { return NodeType & AllocaNode; } + bool isHeapNode() const { return NodeType & HeapNode; } + bool isGlobalNode() const { return NodeType & GlobalNode; } + bool isUnknownNode() const { return NodeType & UnknownNode; } + + bool isModified() const { return NodeType & Modified; } + bool isRead() const { return NodeType & Read; } + + bool isIncomplete() const { return NodeType & Incomplete; } + bool isMultiObject() const { return NodeType & MultiObject; } + bool isDeadNode() const { return NodeType & DEAD; } + + DSNode *setAllocaNodeMarker() { return setCompositionMarker(AllocaNode); } + DSNode *setHeapNodeMarker() { return setCompositionMarker(HeapNode); } + DSNode *setGlobalNodeMarker() { return setCompositionMarker(GlobalNode); } + DSNode *setUnknownNodeMarker() { return setCompositionMarker(UnknownNode); } + + DSNode *setIncompleteMarker() { NodeType |= Incomplete; return this; } + DSNode *setModifiedMarker() { NodeType |= Modified; return this; } + DSNode *setReadMarker() { NodeType |= Read; return this; } + + void makeNodeDead() { + Globals.clear(); + assert(hasNoReferrers() && "Dead node shouldn't have refs!"); + NodeType = DEAD; + } /// forwardNode - Mark this node as being obsolete, and all references to it /// should be forwarded to the specified node and offset. @@ -265,6 +297,12 @@ private: friend class DSNodeHandle; + DSNode *setCompositionMarker(unsigned Marker) { + if (NodeType & Composition) Marker |= MultiObject; + NodeType |= Marker; + return this; + } + // static mergeNodes - Helper for mergeWith() static void MergeNodes(DSNodeHandle& CurNodeH, DSNodeHandle& NH); }; @@ -295,7 +333,6 @@ } } assert(!N || ((N->NodeType & DSNode::DEAD) == 0)); - assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) || !N->ForwardNH.isNull()) && "Node handle offset out of range!"); } From lattner at cs.uiuc.edu Thu Jun 19 16:16:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 16:16:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp DataStructure.cpp DataStructureAA.cpp Local.cpp Printer.cpp Message-ID: <200306192115.QAA16772@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: BottomUpClosure.cpp updated: 1.52 -> 1.53 DataStructure.cpp updated: 1.99 -> 1.100 DataStructureAA.cpp updated: 1.3 -> 1.4 Local.cpp updated: 1.53 -> 1.54 Printer.cpp updated: 1.51 -> 1.52 --- Log message: * Changes to make NodeType be private to DSNode. * Add new MultiObject flag to DSNode which keeps track of whether or not multiple objects have been merged into the node, allowing must-alias info to be tracked. --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.52 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.53 --- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.52 Wed Feb 5 15:59:56 2003 +++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Thu Jun 19 16:15:10 2003 @@ -33,7 +33,7 @@ // if the call sites are not external. // static inline bool isCompleteNode(DSNode *N) { - if (N->NodeType & DSNode::Incomplete) return false; + if (N->isIncomplete()) return false; const std::vector &Callees = N->getGlobals(); for (unsigned i = 0, e = Callees.size(); i != e; ++i) if (Callees[i]->isExternal()) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.99 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.100 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.99 Mon Jun 16 07:07:39 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Thu Jun 19 16:15:11 2003 @@ -49,8 +49,8 @@ // DSNode Implementation //===----------------------------------------------------------------------===// -DSNode::DSNode(unsigned NT, const Type *T, DSGraph *G) - : NumReferrers(0), Size(0), ParentGraph(G), Ty(Type::VoidTy), NodeType(NT) { +DSNode::DSNode(const Type *T, DSGraph *G) + : NumReferrers(0), Size(0), ParentGraph(G), Ty(Type::VoidTy), NodeType(0) { // Add the type entry if it is specified... if (T) mergeTypeInfo(T, 0); G->getNodes().push_back(this); @@ -68,6 +68,12 @@ Ty == Type::VoidTy && (Size == 0 || (NodeType & DSNode::Array))) && "Node not OK!"); + + // Check to ensure that the multiobject constraints are met... + unsigned Comp = NodeType & DSNode::Composition; + assert((NodeType & DSNode::MultiObject) || + Comp == 0 || Comp == DSNode::AllocaNode || Comp == DSNode::HeapNode || + Comp == DSNode::GlobalNode || Comp == DSNode::UnknownNode); } /// forwardNode - Mark this node as being obsolete, and all references to it @@ -97,6 +103,8 @@ if (I == Globals.end() || *I != GV) { //assert(GV->getType()->getElementType() == Ty); Globals.insert(I, GV); + if (NodeType & DSNode::Composition) + NodeType |= DSNode::MultiObject; NodeType |= GlobalNode; } } @@ -112,7 +120,8 @@ ++NumFolds; // Create the node we are going to forward to... - DSNode *DestNode = new DSNode(NodeType|DSNode::Array, 0, ParentGraph); + DSNode *DestNode = new DSNode(0, ParentGraph); + DestNode->NodeType = NodeType|DSNode::Array; DestNode->Ty = Type::VoidTy; DestNode->Size = 1; DestNode->Globals.swap(Globals); @@ -446,7 +455,7 @@ // Merge the type entries of the two nodes together... if (NH.getNode()->Ty != Type::VoidTy) CurNodeH.getNode()->mergeTypeInfo(NH.getNode()->Ty, NOffset); - assert((CurNodeH.getNode()->NodeType & DSNode::DEAD) == 0); + assert(!CurNodeH.getNode()->isDeadNode()); // If we are merging a node with a completely folded node, then both nodes are // now completely folded. @@ -471,12 +480,17 @@ DSNode *N = NH.getNode(); if (CurNodeH.getNode() == N || N == 0) return; - assert((CurNodeH.getNode()->NodeType & DSNode::DEAD) == 0); + assert(!CurNodeH.getNode()->isDeadNode()); - // Start forwarding to the new node! + // Merge the NodeType information... + if ((CurNodeH.getNode()->NodeType & DSNode::Composition) != 0 && + (N->NodeType & DSNode::Composition) != 0) + N->NodeType |= DSNode::MultiObject; // Multiple composition -> multiobject CurNodeH.getNode()->NodeType |= N->NodeType; + + // Start forwarding to the new node! N->forwardNode(CurNodeH.getNode(), NOffset); - assert((CurNodeH.getNode()->NodeType & DSNode::DEAD) == 0); + assert(!CurNodeH.getNode()->isDeadNode()); // Make all of the outgoing links of N now be outgoing links of CurNodeH. // @@ -522,8 +536,7 @@ if (N == 0 || (N == this && NH.getOffset() == Offset)) return; // Noop - assert((N->NodeType & DSNode::DEAD) == 0); - assert((NodeType & DSNode::DEAD) == 0); + assert(!N->isDeadNode() && !isDeadNode()); assert(!hasNoReferrers() && "Should not try to fold a useless node!"); if (N == this) { @@ -630,13 +643,13 @@ Nodes.reserve(FN+G.Nodes.size()); // Remove alloca or mod/ref bits as specified... - unsigned clearBits = (CloneFlags & StripAllocaBit ? DSNode::AllocaNode : 0) - | (CloneFlags & StripModRefBits ? (DSNode::Modified | DSNode::Read) : 0); - clearBits |= DSNode::DEAD; // Clear dead flag... + unsigned BitsToClear =((CloneFlags & StripAllocaBit) ? DSNode::AllocaNode : 0) + | ((CloneFlags & StripModRefBits) ? (DSNode::Modified | DSNode::Read) : 0); + BitsToClear |= DSNode::DEAD; // Clear dead flag... for (unsigned i = 0, e = G.Nodes.size(); i != e; ++i) { DSNode *Old = G.Nodes[i]; DSNode *New = new DSNode(*Old, this); - New->NodeType &= ~clearBits; + New->maskNodeTypes(~BitsToClear); OldNodeMap[Old] = New; } @@ -743,16 +756,16 @@ // markIncompleteNodes - Mark the specified node as having contents that are not // known with the current analysis we have performed. Because a node makes all -// of the nodes it can reach imcomplete if the node itself is incomplete, we +// of the nodes it can reach incomplete if the node itself is incomplete, we // must recursively traverse the data structure graph, marking all reachable // nodes as incomplete. // static void markIncompleteNode(DSNode *N) { // Stop recursion if no node, or if node already marked... - if (N == 0 || (N->NodeType & DSNode::Incomplete)) return; + if (N == 0 || (N->isIncomplete())) return; // Actually mark the node - N->NodeType |= DSNode::Incomplete; + N->setIncompleteMarker(); // Recusively process children... for (unsigned i = 0, e = N->getSize(); i < e; i += DS::PointerSize) @@ -798,14 +811,15 @@ // Mark all global nodes as incomplete... if ((Flags & DSGraph::IgnoreGlobals) == 0) for (unsigned i = 0, e = Nodes.size(); i != e; ++i) - if (Nodes[i]->NodeType & DSNode::GlobalNode && Nodes[i]->getNumLinks()) + if (Nodes[i]->isGlobalNode() && Nodes[i]->getNumLinks()) markIncompleteNode(Nodes[i]); } static inline void killIfUselessEdge(DSNodeHandle &Edge) { if (DSNode *N = Edge.getNode()) // Is there an edge? if (N->getNumReferrers() == 1) // Does it point to a lonely node? - if ((N->NodeType & ~DSNode::Incomplete) == 0 && // No interesting info? + // No interesting info? + if ((N->getNodeFlags() & ~DSNode::Incomplete) == 0 && N->getType() == Type::VoidTy && !N->isNodeCompletelyFolded()) Edge.setNode(0); // Kill the edge! } @@ -835,7 +849,7 @@ // If the Callee is a useless edge, this must be an unreachable call site, // eliminate it. if (CS.isIndirectCall() && CS.getCalleeNode()->getNumReferrers() == 1 && - CS.getCalleeNode()->NodeType == 0) { // No useful info? + CS.getCalleeNode()->getNodeFlags() == 0) { // No useful info? std::cerr << "WARNING: Useless call site found??\n"; CS.swap(Calls.back()); Calls.pop_back(); @@ -914,8 +928,7 @@ for (unsigned i = 0; i != Nodes.size(); ++i) { DSNode *Node = Nodes[i]; - if (!(Node->NodeType & ~(DSNode::Composition | DSNode::Array | - DSNode::DEAD))) { + if (!Node->isIncomplete() && !Node->isModified() && !Node->isRead()) { // This is a useless node if it has no mod/ref info (checked above), // outgoing edges (which it cannot, as it is not modified in this // context), and it has no incoming edges. If it is a global node it may @@ -923,7 +936,7 @@ // scalar map, so we check those now. // if (Node->getNumReferrers() == Node->getGlobals().size()) { - std::vector &Globals = Node->getGlobals(); + const std::vector &Globals = Node->getGlobals(); // Loop through and make sure all of the globals are referring directly // to the node... @@ -932,20 +945,16 @@ assert(N == Node && "ScalarMap doesn't match globals list!"); } - // Make sure numreferrers still agrees, if so, the node is truely dead. + // Make sure NumReferrers still agrees, if so, the node is truly dead. if (Node->getNumReferrers() == Globals.size()) { for (unsigned j = 0, e = Globals.size(); j != e; ++j) ScalarMap.erase(Globals[j]); - - Globals.clear(); - assert(Node->hasNoReferrers() && "Shouldn't have refs now!"); - - Node->NodeType = DSNode::DEAD; + Node->makeNodeDead(); } } } - if ((Node->NodeType & ~DSNode::DEAD) == 0 && Node->hasNoReferrers()) { + if (Node->getNodeFlags() == 0 && Node->hasNoReferrers()) { // This node is dead! delete Node; // Free memory... Nodes[i--] = Nodes.back(); @@ -1055,7 +1064,7 @@ // these, prune the scalar pointing to it. // DSNode *N = I->second.getNode(); - if (N->NodeType == DSNode::UnknownNode && !isa(I->first)) { + if (N->isUnknownNode() && !isa(I->first)) { ScalarMap.erase(I++); } else { I->second.getNode()->markReachableNodes(Alive); @@ -1128,7 +1137,7 @@ GlobalsGraph->Nodes.push_back(N); // Move node to globals graph N->setParentGraph(GlobalsGraph); } else { // Otherwise, delete the node - assert(((N->NodeType & DSNode::GlobalNode) == 0 || + assert((!N->isGlobalNode() || (Flags & DSGraph::RemoveUnreachableGlobals)) && "Killing a global?"); //std::cerr << "[" << i+1 << "/" << DeadNodes.size() @@ -1189,7 +1198,7 @@ assert(I->second.getNode() && "Null node in scalarmap!"); AssertNodeInGraph(I->second.getNode()); if (GlobalValue *GV = dyn_cast(I->first)) { - assert((I->second.getNode()->NodeType & DSNode::GlobalNode) && + assert(I->second.getNode()->isGlobalNode() && "Global points to node, but node isn't global?"); AssertNodeContainsGlobal(I->second.getNode(), GV); } Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.3 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.4 --- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.3 Wed Feb 26 13:29:36 2003 +++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Thu Jun 19 16:15:11 2003 @@ -68,15 +68,12 @@ // alias - This is the only method here that does anything interesting... AliasAnalysis::AliasResult DSAA::alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { - // FIXME: This should handle the Size argument as well! + if (V1 == V2) return MustAlias; + const Function *F1 = getValueFunction(V1); const Function *F2 = getValueFunction(V2); assert((!F1 || !F2 || F1 == F2) && "Alias query for 2 different functions?"); - - // FIXME: This can return must alias if querying a DSNode for a global value - // where the node has only the G composition bit set, and only one entry in - // the globals list... if (F2) F1 = F2; if (F1) { // Get the graph for a function... @@ -88,17 +85,33 @@ hash_map::iterator J = GSM.find((Value*)V2); if (J != GSM.end()) { assert(J->second.getNode() && "Scalar map points to null node?"); - if (I->second.getNode() != J->second.getNode()) { - // Return noalias if one of the nodes is complete... - if ((~I->second.getNode()->NodeType | ~J->second.getNode()->NodeType) - & DSNode::Incomplete) - return NoAlias; - // both are incomplete, they may alias... - } else { - // Both point to the same node, see if they point to different - // offsets... FIXME: This needs to know the size of the alias query - if (I->second.getOffset() != J->second.getOffset()) - return NoAlias; + + DSNode *N1 = I->second.getNode(), *N2 = J->second.getNode(); + unsigned O1 = I->second.getOffset(), O2 = J->second.getOffset(); + + // We can only make a judgement of one of the nodes is complete... + if (!N1->isIncomplete() || !N2->isIncomplete()) { + if (N1 != N2) + return NoAlias; // Completely different nodes. + + // Both point to the same node and same offset, and there is only one + // physical memory object represented in the node, return must alias. + if (O1 == O2 && !N1->isMultiObject()) + return MustAlias; // Exactly the same object & offset + + // See if they point to different offsets... if so, we may be able to + // determine that they do not alias... + if (O1 != O2) { + if (O2 < O1) { // Ensure that O1 <= O2 + std::swap(V1, V2); + std::swap(O1, O2); + std::swap(V1Size, V2Size); + } + + // FIXME: This is not correct because we do not handle array + // indexing correctly with this check! + //if (O1+V1Size <= O2) return NoAlias; + } } } } Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.53 llvm/lib/Analysis/DataStructure/Local.cpp:1.54 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.53 Mon Jun 16 07:08:18 2003 +++ llvm/lib/Analysis/DataStructure/Local.cpp Thu Jun 19 16:15:11 2003 @@ -86,9 +86,9 @@ private: // Visitor functions, used to handle each instruction type we encounter... friend class InstVisitor; - void visitMallocInst(MallocInst &MI) { handleAlloc(MI, DSNode::HeapNode); } - void visitAllocaInst(AllocaInst &AI) { handleAlloc(AI, DSNode::AllocaNode);} - void handleAlloc(AllocationInst &AI, DSNode::NodeTy NT); + void visitMallocInst(MallocInst &MI) { handleAlloc(MI, true); } + void visitAllocaInst(AllocaInst &AI) { handleAlloc(AI, false); } + void handleAlloc(AllocationInst &AI, bool isHeap); void visitPHINode(PHINode &PN); @@ -108,8 +108,8 @@ /// createNode - Create a new DSNode, ensuring that it is properly added to /// the graph. /// - DSNode *createNode(DSNode::NodeTy NodeType, const Type *Ty = 0) { - DSNode *N = new DSNode(NodeType, Ty, &G); // Create the node + DSNode *createNode(const Type *Ty = 0) { + DSNode *N = new DSNode(Ty, &G); // Create the node if (DisableFieldSensitivity) { N->foldNodeCompletely(); if (DSNode *FN = N->getForwardNode()) @@ -194,7 +194,7 @@ NH = I->second; } else { // This returns a conservative unknown node for any unhandled ConstExpr - return NH = createNode(DSNode::UnknownNode); + return NH = createNode()->setUnknownNodeMarker(); } if (NH.getNode() == 0) { // (getelementptr null, X) returns null ScalarMap.erase(V); @@ -204,7 +204,7 @@ } else if (ConstantIntegral *CI = dyn_cast(C)) { // Random constants are unknown mem - return NH = createNode(DSNode::UnknownNode); + return NH = createNode()->setUnknownNodeMarker(); } else { assert(0 && "Unknown constant type!"); } @@ -213,11 +213,11 @@ DSNode *N; if (GlobalValue *GV = dyn_cast(V)) { // Create a new global node for this global variable... - N = createNode(DSNode::GlobalNode, GV->getType()->getElementType()); + N = createNode(GV->getType()->getElementType()); N->addGlobal(GV); } else { // Otherwise just create a shadow node - N = createNode(DSNode::ShadowNode); + N = createNode(); } NH.setNode(N); // Remember that we are pointing to it... @@ -237,7 +237,7 @@ DSNodeHandle &Link = Node.getLink(LinkNo); if (!Link.getNode()) { // If the link hasn't been created yet, make and return a new shadow node - Link = createNode(DSNode::ShadowNode); + Link = createNode(); } return Link; } @@ -263,8 +263,13 @@ /// Alloca & Malloc instruction implementation - Simply create a new memory /// object, pointing the scalar to it. /// -void GraphBuilder::handleAlloc(AllocationInst &AI, DSNode::NodeTy NodeType) { - setDestTo(AI, createNode(NodeType)); +void GraphBuilder::handleAlloc(AllocationInst &AI, bool isHeap) { + DSNode *N = createNode(); + if (isHeap) + N->setHeapNodeMarker(); + else + N->setAllocaNodeMarker(); + setDestTo(AI, N); } // PHINode - Make the scalar for the PHI node point to all of the things the @@ -368,7 +373,7 @@ if (Ptr.getNode() == 0) return; // Make that the node is read from... - Ptr.getNode()->NodeType |= DSNode::Read; + Ptr.getNode()->setReadMarker(); // Ensure a typerecord exists... Ptr.getNode()->mergeTypeInfo(LI.getType(), Ptr.getOffset(), false); @@ -383,7 +388,7 @@ if (Dest.getNode() == 0) return; // Mark that the node is written to... - Dest.getNode()->NodeType |= DSNode::Modified; + Dest.getNode()->setModifiedMarker(); // Ensure a typerecord exists... Dest.getNode()->mergeTypeInfo(StoredTy, Dest.getOffset()); @@ -426,8 +431,9 @@ void GraphBuilder::visitFreeInst(FreeInst &FI) { // Mark that the node is written to... - getValueDest(*FI.getOperand(0)).getNode()->NodeType - |= DSNode::Modified | DSNode::HeapNode; + DSNode *N = getValueDest(*FI.getOperand(0)).getNode(); + N->setModifiedMarker(); + N->setHeapNodeMarker(); } /// Handle casts... @@ -441,7 +447,7 @@ // to track the fact that the node points to SOMETHING, just something we // don't know about. Make an "Unknown" node. // - setDestTo(CI, createNode(DSNode::UnknownNode)); + setDestTo(CI, createNode()->setUnknownNodeMarker()); } } @@ -458,7 +464,7 @@ CurNode.mergeWith(getValueDest(**I)); if (CurNode.getNode()) - CurNode.getNode()->NodeType |= DSNode::UnknownNode; + CurNode.getNode()->setUnknownNodeMarker(); } Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.51 llvm/lib/Analysis/DataStructure/Printer.cpp:1.52 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.51 Fri Feb 14 14:25:47 2003 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Thu Jun 19 16:15:11 2003 @@ -38,16 +38,19 @@ if (N->isArray()) OS << " array"; } - if (N->NodeType) { + if (unsigned NodeType = N->getNodeFlags()) { OS << ": "; - if (N->NodeType & DSNode::AllocaNode ) OS << "S"; - if (N->NodeType & DSNode::HeapNode ) OS << "H"; - if (N->NodeType & DSNode::GlobalNode ) OS << "G"; - if (N->NodeType & DSNode::UnknownNode) OS << "U"; - if (N->NodeType & DSNode::Incomplete ) OS << "I"; - if (N->NodeType & DSNode::Modified ) OS << "M"; - if (N->NodeType & DSNode::Read ) OS << "R"; - if (N->NodeType & DSNode::DEAD ) OS << ""; + if (NodeType & DSNode::AllocaNode ) OS << "S"; + if (NodeType & DSNode::HeapNode ) OS << "H"; + if (NodeType & DSNode::GlobalNode ) OS << "G"; + if (NodeType & DSNode::UnknownNode) OS << "U"; + if (NodeType & DSNode::Incomplete ) OS << "I"; + if (NodeType & DSNode::Modified ) OS << "M"; + if (NodeType & DSNode::Read ) OS << "R"; + if (NodeType & DSNode::MultiObject) OS << "m"; +#ifndef NDEBUG + if (NodeType & DSNode::DEAD ) OS << ""; +#endif OS << "\n"; } From lattner at cs.uiuc.edu Thu Jun 19 16:16:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jun 19 16:16:06 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/PoolAllocate.cpp Message-ID: <200306192115.QAA16784@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: PoolAllocate.cpp updated: 1.8 -> 1.9 --- Log message: Changes to privatize NodeType --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/PoolAllocate.cpp diff -u llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.8 llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.9 --- llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.8 Sat Jun 7 15:29:58 2003 +++ llvm/lib/Transforms/IPO/PoolAllocate.cpp Thu Jun 19 16:15:26 2003 @@ -82,9 +82,9 @@ CSE = callSites.end(); CSI != CSE ; ++CSI) { if (CSI->isIndirectCall()) { DSNode *DSN = CSI->getCalleeNode(); - if (DSN->NodeType == DSNode::Incomplete) + if (DSN->isIncomplete()) std::cerr << "Incomplete node " << CSI->getCallInst(); - // assert(DSN->NodeType == DSNode::GlobalNode); + // assert(DSN->isGlobalNode()); std::vector &Callees = DSN->getGlobals(); if (Callees.size() > 0) { Function *firstCalledF = dyn_cast(*Callees.begin()); @@ -229,13 +229,13 @@ // Mark globals and incomplete nodes as live... (this handles arguments) if (F.getName() != "main") for (unsigned i = 0, e = Nodes.size(); i != e; ++i) - if (Nodes[i]->NodeType & (DSNode::GlobalNode | DSNode::Incomplete) && - Nodes[i]->NodeType & (DSNode::HeapNode)) + if ((Nodes[i]->isGlobalNode() || Nodes[i]->isIncomplete()) && + Nodes[i]->isHeapNode()) Nodes[i]->markReachableNodes(MarkedNodes); // Marked the returned node as alive... if (DSNode *RetNode = G.getRetNode().getNode()) - if (RetNode->NodeType & DSNode::HeapNode) + if (RetNode->isHeapNode()) RetNode->markReachableNodes(MarkedNodes); if (MarkedNodes.empty()) // We don't need to clone the function if there @@ -411,7 +411,7 @@ // ones to the NodesToPA vector. std::vector NodesToPA; for (unsigned i = 0, e = Nodes.size(); i != e; ++i) - if (Nodes[i]->NodeType & DSNode::HeapNode && // Pick nodes with heap elems + if (Nodes[i]->isHeapNode() && // Pick nodes with heap elems !MarkedNodes.count(Nodes[i])) // Can't be marked NodesToPA.push_back(Nodes[i]); From vadve at cs.uiuc.edu Fri Jun 20 06:33:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Fri Jun 20 06:33:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstr.def Message-ID: <200306201132.GAA07005@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInstr.def updated: 1.21 -> 1.22 --- Log message: RDCCR defines arg. #1, not arg. #2. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInstr.def diff -u llvm/lib/Target/Sparc/SparcInstr.def:1.21 llvm/lib/Target/Sparc/SparcInstr.def:1.22 --- llvm/lib/Target/Sparc/SparcInstr.def:1.21 Wed Jun 18 10:09:02 2003 +++ llvm/lib/Target/Sparc/SparcInstr.def Fri Jun 20 06:32:11 2003 @@ -525,7 +525,7 @@ I(RESTOREi, "restore", 3, 2, B12, true , 0, 1, SPARC_SINGLE, M_INT_FLAG | M_ARITH_FLAG) // Read and Write CCR register from/to an int reg -I(RDCCR, "rd", 2, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) +I(RDCCR, "rd", 2, 1, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) I(WRCCRr, "wr", 3, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) I(WRCCRi, "wr", 3, 2, 0, false, 0, 1, SPARC_SINGLE, M_INT_FLAG | M_CC_FLAG) From lattner at cs.uiuc.edu Fri Jun 20 09:38:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 09:38:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/PoolAllocate.cpp Message-ID: <200306201437.JAA26365@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: PoolAllocate.cpp updated: 1.9 -> 1.10 --- Log message: Fix the build. :( --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/PoolAllocate.cpp diff -u llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.9 llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.10 --- llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.9 Thu Jun 19 16:15:26 2003 +++ llvm/lib/Transforms/IPO/PoolAllocate.cpp Fri Jun 20 09:36:52 2003 @@ -85,7 +85,7 @@ if (DSN->isIncomplete()) std::cerr << "Incomplete node " << CSI->getCallInst(); // assert(DSN->isGlobalNode()); - std::vector &Callees = DSN->getGlobals(); + const std::vector &Callees = DSN->getGlobals(); if (Callees.size() > 0) { Function *firstCalledF = dyn_cast(*Callees.begin()); FuncECs.addElement(firstCalledF); @@ -93,7 +93,7 @@ (&CSI->getCallInst(), firstCalledF)); if (Callees.size() > 1) { - for (std::vector::iterator CalleesI = + for (std::vector::const_iterator CalleesI = Callees.begin()+1, CalleesE = Callees.end(); CalleesI != CalleesE; ++CalleesI) { Function *calledF = dyn_cast(*CalleesI); @@ -577,7 +577,7 @@ if (!DSN) { return 0; } - std::vector &Callees = DSN->getGlobals(); + const std::vector &Callees = DSN->getGlobals(); if (Callees.size() > 0) { Function *calledF = dyn_cast(*Callees.begin()); assert(PAInfo.FuncECs.findClass(calledF) && "should exist in some eq. class"); From lattner at cs.uiuc.edu Fri Jun 20 10:43:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 10:43:02 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200306201542.KAA23655@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.90 -> 1.91 --- Log message: Fix problem building optmized build --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.90 llvm/Makefile.common:1.91 --- llvm/Makefile.common:1.90 Wed Jun 18 14:20:11 2003 +++ llvm/Makefile.common Fri Jun 20 10:41:57 2003 @@ -465,7 +465,7 @@ LLVM_LIBS_OPTIONS_P := $(patsubst %.o, $(LLVMLIBPROFILESOURCE)/%.o,$(LLVM_LIBS_OPTIONS)) LIB_OPTS_G := $(LLVM_LIBS_OPTIONS_G) $(PROJ_LIBS_OPTIONS_G) -LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O) $(PROJ_LIBS_OPTIONS_P) +LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O) $(PROJ_LIBS_OPTIONS_O) LIB_OPTS_P := $(LLVM_LIBS_OPTIONS_P) $(PROJ_LIBS_OPTIONS_P) # USED_LIB_PATHS - Compute the path of the libraries used so that tools are From lattner at cs.uiuc.edu Fri Jun 20 10:50:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 10:50:03 2003 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200306201549.KAA25231@apoc.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.76 -> 1.77 --- Log message: Minor cleanups --- Diffs of the changes: Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.76 llvm/tools/llc/llc.cpp:1.77 --- llvm/tools/llc/llc.cpp:1.76 Wed Jun 18 16:43:33 2003 +++ llvm/tools/llc/llc.cpp Fri Jun 20 10:49:04 2003 @@ -1,6 +1,6 @@ -//===-- llc.cpp - Implement the LLVM Compiler -----------------------------===// +//===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===// // -// This is the llc compiler driver. +// This is the llc code generator. // //===----------------------------------------------------------------------===// @@ -15,11 +15,6 @@ #include "Support/Signals.h" #include #include -#include - -//------------------------------------------------------------------------------ -// Option declarations for LLC. -//------------------------------------------------------------------------------ // General options for llc. Other pass-specific options are specified // within the corresponding llc passes, and target-specific options @@ -58,29 +53,22 @@ } -//===---------------------------------------------------------------------===// -// Function main() -// -// Entry point for the llc compiler. -//===---------------------------------------------------------------------===// - -int -main(int argc, char **argv) -{ +// main - Entry point for the llc compiler. +// +int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv, " llvm system compiler\n"); // Load the module to be compiled... std::auto_ptr M(ParseBytecodeFile(InputFilename)); - if (M.get() == 0) - { - std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; - return 1; - } + if (M.get() == 0) { + std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; + return 1; + } Module &mod = *M.get(); // Allocate target machine. First, check whether the user has // explicitly specified an architecture to compile for. - unsigned Config = (mod.isLittleEndian() ? TM::LittleEndian : TM::BigEndian) | + unsigned Config = (mod.isLittleEndian() ? TM::LittleEndian : TM::BigEndian)| (mod.has32BitPointers() ? TM::PtrSize32 : TM::PtrSize64); TargetMachine* (*TargetMachineAllocator)(unsigned) = 0; switch (Arch) { From criswell at choi.cs.uiuc.edu Fri Jun 20 11:15:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Fri Jun 20 11:15:01 2003 Subject: [llvm-commits] CVS: llvm/test/Feature/TestOptimizer.sh Message-ID: <200306201614.h5KGEx604719@choi.cs.uiuc.edu> Changes in directory llvm/test/Feature: TestOptimizer.sh updated: 1.16 -> 1.17 --- Log message: The modifications to LD_LIBRARY_PATH now add the specified paths to the beginning of LD_LIBRARY_PATH as opposed to simply replacing it. This allows users to use LD_LIBRARY_PATH when running tests (useful for when they have installed their own version of GCC). --- Diffs of the changes: Index: llvm/test/Feature/TestOptimizer.sh diff -u llvm/test/Feature/TestOptimizer.sh:1.16 llvm/test/Feature/TestOptimizer.sh:1.17 --- llvm/test/Feature/TestOptimizer.sh:1.16 Fri Aug 16 14:34:33 2002 +++ llvm/test/Feature/TestOptimizer.sh Fri Jun 20 11:14:49 2003 @@ -1,5 +1,16 @@ #!/bin/sh -LD_LIBRARY_PATH=$3 + +# +# Split the current LD_LIBRARY_PATH into two separate components. +# +FirstLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f1` +SecondLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f2` + +# +# Now create a new LD_LIBRARY_PATH with our command line options as +# the first section. +# +LD_LIBRARY_PATH="$3:${FirstLDP}\;${SecondLDP}" export LD_LIBRARY_PATH AS=$2/as From criswell at choi.cs.uiuc.edu Fri Jun 20 11:16:02 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Fri Jun 20 11:16:02 2003 Subject: [llvm-commits] CVS: llvm/test/Feature/TestAsmDisasm.sh Message-ID: <200306201615.h5KGF7T04726@choi.cs.uiuc.edu> Changes in directory llvm/test/Feature: TestAsmDisasm.sh updated: 1.9 -> 1.10 --- Log message: The modifications to LD_LIBRARY_PATH now add the specified paths to the beginning of LD_LIBRARY_PATH as opposed to simply replacing it. This allows users to use LD_LIBRARY_PATH when running tests (useful for when they have installed their own version of GCC). --- Diffs of the changes: Index: llvm/test/Feature/TestAsmDisasm.sh diff -u llvm/test/Feature/TestAsmDisasm.sh:1.9 llvm/test/Feature/TestAsmDisasm.sh:1.10 --- llvm/test/Feature/TestAsmDisasm.sh:1.9 Thu Aug 15 14:49:06 2002 +++ llvm/test/Feature/TestAsmDisasm.sh Fri Jun 20 11:14:27 2003 @@ -4,7 +4,17 @@ rm -f test.bc.temp[12] -LD_LIBRARY_PATH=$3 +# +# Split the current LD_LIBRARY_PATH into two separate components. +# +FirstLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f1` +SecondLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f2` + +# +# Now create a new LD_LIBRARY_PATH with our command line options as +# the first section. +# +LD_LIBRARY_PATH="$3:${FirstLDP}\;${SecondLDP}" export LD_LIBRARY_PATH AS=$2/as From lattner at cs.uiuc.edu Fri Jun 20 11:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 11:45:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Makefile.multisrc Message-ID: <200306201644.LAA05438@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource: Makefile.multisrc updated: 1.31 -> 1.32 --- Log message: Add support for wc'ing tests not in the source tree --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Makefile.multisrc diff -u llvm/test/Programs/MultiSource/Makefile.multisrc:1.31 llvm/test/Programs/MultiSource/Makefile.multisrc:1.32 --- llvm/test/Programs/MultiSource/Makefile.multisrc:1.31 Mon Jun 2 00:49:11 2003 +++ llvm/test/Programs/MultiSource/Makefile.multisrc Fri Jun 20 11:43:52 2003 @@ -58,8 +58,9 @@ Output/%.linked.rll: $(LObjects) $(LLINK) $(LOPT) $(LDIS) $(LLINK) -f $(LObjects) | $(LOPT) -funcresolve -deadtypeelim -q | $(LDIS) > $@ -Output/%.LOC.txt: $(Source) - cat $(Source) $(wildcard *.h) | wc -l > $@ +$(PROGRAMS_TO_TEST:%=Output/%.LOC.txt): \ +Output/%.LOC.txt: $(addprefix $(SourceDir), $(Source)) + cat $(addprefix $(SourceDir), $(Source)) $(wildcard $(SourceDir)/*.h) | wc -l > $@ endif From lattner at cs.uiuc.edu Fri Jun 20 11:53:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 11:53:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200306201652.LAA06209@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.57 -> 1.58 --- Log message: Add a top level "bytecode" target --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.57 llvm/test/Programs/Makefile.programs:1.58 --- llvm/test/Programs/Makefile.programs:1.57 Mon Jun 16 19:24:12 2003 +++ llvm/test/Programs/Makefile.programs Fri Jun 20 11:52:01 2003 @@ -366,6 +366,9 @@ cp $< $@ endif +# Pseudo target to build just the bytecode file. +bytecode: Output/$(PROG).llvm.bc + # Support for the TEST= option... when TEST= is specified on the command line, # the default target is the test target. Here we dispatch to a specific set of From lattner at cs.uiuc.edu Fri Jun 20 11:55:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 11:55:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Sandbox.sh Message-ID: <200306201654.LAA06955@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Sandbox.sh updated: 1.3 -> 1.4 --- Log message: Add support for the .time files --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Sandbox.sh diff -u llvm/test/Programs/External/SPEC/Sandbox.sh:1.3 llvm/test/Programs/External/SPEC/Sandbox.sh:1.4 --- llvm/test/Programs/External/SPEC/Sandbox.sh:1.3 Mon Jun 16 07:14:46 2003 +++ llvm/test/Programs/External/SPEC/Sandbox.sh Fri Jun 20 11:54:32 2003 @@ -28,6 +28,8 @@ echo Running: $* $* +cp $(OUTPUT_FILE).time ../../${OUTPUTFILE}.time + # This script is always successful... exit 0 From lattner at cs.uiuc.edu Fri Jun 20 12:03:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 12:03:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Sandbox.sh Message-ID: <200306201702.MAA07313@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Sandbox.sh updated: 1.4 -> 1.5 --- Log message: Fix parens --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Sandbox.sh diff -u llvm/test/Programs/External/SPEC/Sandbox.sh:1.4 llvm/test/Programs/External/SPEC/Sandbox.sh:1.5 --- llvm/test/Programs/External/SPEC/Sandbox.sh:1.4 Fri Jun 20 11:54:32 2003 +++ llvm/test/Programs/External/SPEC/Sandbox.sh Fri Jun 20 12:02:01 2003 @@ -28,7 +28,7 @@ echo Running: $* $* -cp $(OUTPUT_FILE).time ../../${OUTPUTFILE}.time +cp $OUTPUT_FILE.time ../../$OUTPUTFILE.time # This script is always successful... exit 0 From criswell at choi.cs.uiuc.edu Fri Jun 20 13:36:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Fri Jun 20 13:36:01 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200306201835.h5KIZn520232@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.91 -> 1.92 --- Log message: Added a hack that takes the path relative to the home directory into account if a home directory is provided by the environment. --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.91 llvm/Makefile.common:1.92 --- llvm/Makefile.common:1.91 Fri Jun 20 10:41:57 2003 +++ llvm/Makefile.common Fri Jun 20 13:35:39 2003 @@ -75,6 +75,18 @@ endif # +# Now for a hack: +# If we have a home directory, append our offset from it to OBJ_ROOT. +# This will "emulate" the previous behavior while not breaking builds +# in which there is no home directory. +# +ifdef HOME +OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(HOME)%,%,$(BUILD_SRC_ROOT)) +else +OBJ_ROOT := $(OBJ_ROOT)/$(shell basename $(BUILD_SRC_ROOT)) +endif + +# # Set the object build directory. Its location depends upon the source path # and where object files should go. # @@ -82,7 +94,7 @@ ifeq ($(OBJ_ROOT),.) BUILD_OBJ_DIR = $(shell pwd) else -BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_DIR); pwd)) +BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(shell cd $(BUILD_SRC_DIR); pwd)) endif endif @@ -93,7 +105,7 @@ ifeq ($(OBJ_ROOT),.) BUILD_OBJ_ROOT = $(shell cd $(LEVEL); pwd) else -BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_ROOT); pwd)) +BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(shell cd $(BUILD_SRC_ROOT); pwd)) endif endif @@ -132,6 +144,14 @@ # Default rule for test. It ensures everything has a test rule test:: + +prdirs:: + echo "LLVM Source Root : $(LLVM_SRC_ROOT)"; \ + echo "LLVM Object Root : $(LLVM_OBJ_ROOT)"; \ + echo "Build Source Root : $(BUILD_SRC_ROOT)"; \ + echo "Build Source Directory : $(BUILD_SRC_DIR)"; \ + echo "Build Object Root : $(BUILD_OBJ_ROOT)"; \ + echo "Build Object Directory : $(BUILD_OBJ_DIR)"; #-------------------------------------------------------------------- # Variables derived from configuration options... From lattner at cs.uiuc.edu Fri Jun 20 14:01:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 14:01:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200306201900.OAA22016@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.58 -> 1.59 --- Log message: Minor nonfunctional change --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.58 llvm/test/Programs/Makefile.programs:1.59 --- llvm/test/Programs/Makefile.programs:1.58 Fri Jun 20 11:52:01 2003 +++ llvm/test/Programs/Makefile.programs Fri Jun 20 14:00:42 2003 @@ -256,7 +256,7 @@ # EXTRA_LLI_OPTS is used by the nightly tester to add arguments to invocations # of the JIT and LLI in order to get timing info and statistics. -EXTRA_LLI_OPTS := +EXTRA_LLI_OPTS = LLI_OPTS = -q -abort-on-exception -force-interpreter=true $(EXTRA_LLI_OPTS) JIT_OPTS = -force-interpreter=false $(EXTRA_LLI_OPTS) From lattner at cs.uiuc.edu Fri Jun 20 14:01:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 14:01:07 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile Message-ID: <200306201900.OAA21631@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/186.crafty: Makefile updated: 1.3 -> 1.4 --- Log message: Add correct path information to source files --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile:1.3 llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile:1.4 --- llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile:1.3 Mon Jun 16 07:00:46 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/186.crafty/Makefile Fri Jun 20 14:00:11 2003 @@ -3,6 +3,6 @@ STDIN_FILENAME = crafty.in STDOUT_FILENAME = crafty.out CPPFLAGS = -DSPEC_CPU2000 -DLINUX_i386 -Source := attacks.c draw.c enprise.c init.c iterate.c make.c nexte.c output.c preeval.c resign.c searchr.c swap.c utility.c boolean.c drawn.c evaluate.c input.c lookup.c movgen.c nextr.c phase.c quiesce.c root.c setboard.c time.c validate.c edit.c history.c interupt.c main.c next.c option.c ponder.c repeat.c search.c store.c unmake.c valid.c +Source = $(addprefix $(SPEC_BENCH_DIR)/src/, attacks.c draw.c enprise.c init.c iterate.c make.c nexte.c output.c preeval.c resign.c searchr.c swap.c utility.c boolean.c drawn.c evaluate.c input.c lookup.c movgen.c nextr.c phase.c quiesce.c root.c setboard.c time.c validate.c edit.c history.c interupt.c main.c next.c option.c ponder.c repeat.c search.c store.c unmake.c valid.c) include ../../Makefile.spec From lattner at cs.uiuc.edu Fri Jun 20 14:02:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 14:02:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Makefile.multisrc Message-ID: <200306201901.OAA22027@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource: Makefile.multisrc updated: 1.32 -> 1.33 --- Log message: Revert previous change, the test I was looking at had sources set wrong --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Makefile.multisrc diff -u llvm/test/Programs/MultiSource/Makefile.multisrc:1.32 llvm/test/Programs/MultiSource/Makefile.multisrc:1.33 --- llvm/test/Programs/MultiSource/Makefile.multisrc:1.32 Fri Jun 20 11:43:52 2003 +++ llvm/test/Programs/MultiSource/Makefile.multisrc Fri Jun 20 14:01:07 2003 @@ -59,8 +59,8 @@ $(LLINK) -f $(LObjects) | $(LOPT) -funcresolve -deadtypeelim -q | $(LDIS) > $@ $(PROGRAMS_TO_TEST:%=Output/%.LOC.txt): \ -Output/%.LOC.txt: $(addprefix $(SourceDir), $(Source)) - cat $(addprefix $(SourceDir), $(Source)) $(wildcard $(SourceDir)/*.h) | wc -l > $@ +Output/%.LOC.txt: $(Source) + cat $(Source) $(wildcard $(SourceDir)/*.h) | wc -l > $@ endif From lattner at cs.uiuc.edu Fri Jun 20 15:21:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 15:21:02 2003 Subject: [llvm-commits] CVS: llvm/www/www-index.html Message-ID: <200306202020.PAA21505@tank.cs.uiuc.edu> Changes in directory llvm/www: www-index.html updated: 1.39 -> 1.40 --- Log message: Add note that we have an X86 JIT --- Diffs of the changes: Index: llvm/www/www-index.html diff -u llvm/www/www-index.html:1.39 llvm/www/www-index.html:1.40 --- llvm/www/www-index.html:1.39 Fri Jun 6 13:29:01 2003 +++ llvm/www/www-index.html Fri Jun 20 15:20:21 2003 @@ -43,42 +43,38 @@
signed sbyte, short, int, long, float, double
unsignedubyte, ushort, uint, ulong
integerubyte, sbyte, ushort, short, uint, int, ulong, long
integerubyte, sbyte, ushort, short, uint, int, ulong, long
integralbool, ubyte, sbyte, ushort, short, uint, int, ulong, long
floating pointfloat, double
first classbool, ubyte, sbyte, ushort, short,
uint, int, ulong, long, float, double, pointer
Low Level Virtual Machine (LLVM) is:
  1. - A compilation strategy - Fundamentally, - LLVM is a compilation strategy designed - to enable effective program optimization - across the entire lifetime of a program. - LLVM supports effective optimization at - compile time, link-time (particularly - interprocedural), run-time and offline - (i.e., after software is installed), - while maintaining compatibility with - existing build scripts.

  2. + A compilation strategy - Fundamentally, LLVM is a + compilation strategy designed to enable effective + program optimization across the entire lifetime of a + program. LLVM supports effective optimization at + compile time, link-time (particularly interprocedural), + run-time and offline (i.e., after software is + installed), while maintaining compatibility with + existing build scripts.

    +

  3. A virtual - instruction set - LLVM is a - low-level object code representation that - uses simple RISC-like instructions, but - provides high-level type and dataflow - (SSA) information about operands. This - combination enables sophisticated - transformations on object code, while - remaining light-weight enough to be - attached to the executable. This - combination is key to allowing link-time, - run-time, and offline transformations.

  4. + instruction set - LLVM is a low-level object + code representation that uses simple RISC-like + instructions, but provides high-level type and dataflow + (SSA) information about operands. This combination + enables sophisticated transformations on object code, + while remaining light-weight enough to be attached to + the executable. This combination is key to allowing + link-time, run-time, and offline + transformations.

    +

  5. A compiler - infrastructure - LLVM - is also a collection of source code that - implements the language and compilation - strategy. The primary components of the - LLVM infrastructure are a GCC-based C - front-end, a link-time optimization - framework with a growing set of global - and interprocedural analyses and - transformations, and back ends for the - SPARC v9 architecture and for C. See - "Current - Projects" for information about - other components under development.

  6. + infrastructure - LLVM is also a collection of source + code that implements the language and compilation + strategy. The primary components of the LLVM + infrastructure are a GCC-based C front-end, a link-time + optimization framework with a growing set of global and + interprocedural analyses and transformations, static + back-ends for the SPARC v9 architecture and for C, and a + Just-In-Time compiler for X86 processors. See "Current Projects" for + information about other components under + development.

LLVM is a product of the Lifelong From lattner at cs.uiuc.edu Fri Jun 20 15:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 15:29:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Sandbox.sh Message-ID: <200306202028.PAA13504@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Sandbox.sh updated: 1.5 -> 1.6 --- Log message: FINALLY FIX THE STUPID PROBLEM with copying input for 197.parser! yaay! --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Sandbox.sh diff -u llvm/test/Programs/External/SPEC/Sandbox.sh:1.5 llvm/test/Programs/External/SPEC/Sandbox.sh:1.6 --- llvm/test/Programs/External/SPEC/Sandbox.sh:1.5 Fri Jun 20 12:02:01 2003 +++ llvm/test/Programs/External/SPEC/Sandbox.sh Fri Jun 20 15:28:30 2003 @@ -22,13 +22,13 @@ cp -r $INPUT_DIR/* . # If there is an "all" input directory, take it as well... -cp -r $INPUT_DIR/../../all/input/* . 2&>1 > /dev/null +cp -r $INPUT_DIR/../../all/input/* . 2>&1 > /dev/null # Run the program now... echo Running: $* $* -cp $OUTPUT_FILE.time ../../$OUTPUTFILE.time +cp $OUTPUT_FILE.time ../../$OUTPUT_FILE.time # This script is always successful... exit 0 From lattner at cs.uiuc.edu Fri Jun 20 15:43:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 15:43:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Makefile.spec Sandbox.sh Message-ID: <200306202042.PAA17379@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Makefile.spec updated: 1.10 -> 1.11 Sandbox.sh updated: 1.6 -> 1.7 --- Log message: * Add support for LARGE_PROBLEM_SIZE (autoselect train inputs) * Add support for .time files --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Makefile.spec diff -u llvm/test/Programs/External/SPEC/Makefile.spec:1.10 llvm/test/Programs/External/SPEC/Makefile.spec:1.11 --- llvm/test/Programs/External/SPEC/Makefile.spec:1.10 Mon Jun 16 07:15:52 2003 +++ llvm/test/Programs/External/SPEC/Makefile.spec Fri Jun 20 15:42:46 2003 @@ -7,7 +7,11 @@ include $(LEVEL)/Makefile.config # RUN_TYPE - Either ref, test, or train. May be specified on the command line. +ifdef LARGE_PROBLEM_SIZE +RUN_TYPE := train +else RUN_TYPE := test +endif ## Information the test should have provided... ifndef STDOUT_FILENAME @@ -41,9 +45,6 @@ include $(LEVEL)/test/Programs/MultiSource/Makefile.multisrc -# Pseudo target to build just the bytecode file. -bytecode: Output/$(PROG).llvm.bc - LCCFLAGS := -DSPEC_CPU2000 -O2 CFLAGS := -DSPEC_CPU2000 -O2 @@ -65,6 +66,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -cp Output/nat-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time $(PROGRAMS_TO_TEST:%=Output/%.out-lli): \ Output/%.out-lli: Output/%.llvm.bc $(LLI) @@ -72,6 +74,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ $(LLI) $(LLI_OPTS) ../../$< $(RUN_OPTIONS) -(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -cp Output/lli-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time $(PROGRAMS_TO_TEST:%=Output/%.out-jit): \ Output/%.out-jit: Output/%.llvm.bc $(LLI) @@ -79,6 +82,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ $(LLI) $(JIT_OPTS) ../../$< $(RUN_OPTIONS) -(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -cp Output/jit-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \ Output/%.out-llc: Output/%.llc @@ -86,6 +90,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \ Output/%.out-cbe: Output/%.cbe @@ -93,6 +98,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time $(PROGRAMS_TO_TEST:%=Output/%.trace-out-llc): \ Output/%.trace-out-llc: Output/%.trace.llc @@ -100,6 +106,7 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time $(PROGRAMS_TO_TEST:%=Output/%.trace-out-cbe): \ Output/%.trace-out-cbe: Output/%.trace.cbe @@ -107,7 +114,4 @@ ../../$(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../../$< $(RUN_OPTIONS) -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ - -# Pseudo target to build just the bytecode file. -bytecode: Output/$(PROG).llvm.bc - + -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time Index: llvm/test/Programs/External/SPEC/Sandbox.sh diff -u llvm/test/Programs/External/SPEC/Sandbox.sh:1.6 llvm/test/Programs/External/SPEC/Sandbox.sh:1.7 --- llvm/test/Programs/External/SPEC/Sandbox.sh:1.6 Fri Jun 20 15:28:30 2003 +++ llvm/test/Programs/External/SPEC/Sandbox.sh Fri Jun 20 15:42:46 2003 @@ -28,8 +28,6 @@ echo Running: $* $* -cp $OUTPUT_FILE.time ../../$OUTPUT_FILE.time - # This script is always successful... exit 0 From lattner at cs.uiuc.edu Fri Jun 20 16:23:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 16:23:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b Message-ID: <200306202122.QAA19726@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-bc: primes.b updated: 1.2 -> 1.3 --- Log message: Increase problem size --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b diff -u llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b:1.2 llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b:1.3 --- llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b:1.2 Fri Jun 6 23:37:58 2003 +++ llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b Fri Jun 20 16:21:58 2003 @@ -1,7 +1,7 @@ /* An example that finds all primes between 2 and limit. */ - limit = 1500000; + limit = 2047; /* auto prime[], num, p, root, i */ @@ -11,7 +11,8 @@ if (limit >= 2) print "prime 1 = 2\n" if (limit >= 3) print "prime 2 = 3\n"; scale = 0; - +for (timeloop = 0; timeloop < 50; timeloop += 1) { + num = 2; for ( p=5; p <= limit; p += 2) { root = sqrt(p); isprime = 1; @@ -27,4 +28,4 @@ print "prime ", num, " = ", p, "\n" } } - +} From criswell at choi.cs.uiuc.edu Fri Jun 20 16:26:01 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Fri Jun 20 16:26:01 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200306202125.h5KLP4A16754@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.common added (r1.93) --- Log message: Reverted back to revision 1.91. --- Diffs of the changes: Index: llvm/Makefile.common diff -c /dev/null llvm/Makefile.common:1.1 *** /dev/null Fri Jun 20 16:25:04 2003 --- llvm/Makefile.common Wed Jun 6 15:29:01 2001 *************** *** 0 **** --- 1,170 ---- + # Makefile.common + # + # This file is included by all of the LLVM makefiles. This file defines common + # rules to do things like compile a .cpp file or generate dependancy info. + # These are platform dependant, so this is the file used to specify these + # system dependant operations. + # + # The following functionality may be set by setting incoming variables: + # + # 1. LEVEL - The level of the current subdirectory from the top of the + # MagicStats view. This level should be expressed as a path, for + # example, ../.. for two levels deep. + # + # 2. DIRS - A list of subdirectories to be built. Fake targets are set up + # so that each of the targets "all", "install", and "clean" each build. + # the subdirectories before the local target. + # + # 3. Source - If specified, this sets the source code filenames. If this + # is not set, it defaults to be all of the .cpp, .c, .y, and .l files + # in the current directory. + # + + # Default Rule: + all :: + + # Default for install is to at least build everything... + install :: + + #-------------------------------------------------------------------- + # Installation configuration options... + #-------------------------------------------------------------------- + + #BinInstDir=/usr/local/bin + #LibInstDir=/usrl/local/lib/xxx + #DocInstDir=/usr/doc/xxx + + #--------------------------------------------------------- + # Compilation options... + #--------------------------------------------------------- + + # Add -L options to the link command lines... + LibPathsO = -L $(LEVEL)/lib/VMCore/Release \ + -L $(LEVEL)/lib/Assembly/Parser/Release \ + -L $(LEVEL)/lib/Assembly/Writer/Release \ + -L $(LEVEL)/lib/Analysis/Release \ + -L $(LEVEL)/lib/Bytecode/Writer/Release \ + -L $(LEVEL)/lib/Bytecode/Reader/Release \ + -L $(LEVEL)/lib/Optimizations/Release + + LibPathsG = $(LibPathsO:Release=Debug) + + # Enable this for profiling support with 'gprof' + #Prof = -pg + + # TODO: Get rid of exceptions! : -fno-exceptions -fno-rtti + CompileCommonOpts = $(Prof) -Wall -Winline -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include + + # Compile a file, don't link... + Compile = $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts) + CompileG = $(Compile) -g -D_DEBUG + # Add This for DebugMalloc: -fno-defer-pop + CompileO = $(Compile) -O3 -DNDEBUG -finline-functions -felide-constructors -fnonnull-objects -freg-struct-return -fshort-enums + + # Link final executable + Link = $(CXX) $(Prof) + LinkG = $(Link) -g $(LibPathsG) + LinkO = $(Link) -O3 $(LibPathsO) + + # Create a .so file from a .cpp file... + #MakeSO = $(CXX) -shared $(Prof) + MakeSO = $(CXX) -G $(Prof) + MakeSOG = $(MakeSO) -g + MakeSOO = $(MakeSO) -O3 + + # Create dependancy file from CPP file, send to stdout. + Depend = $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS) + + # Archive a bunch of .o files into a .a file... + AR = ar cq + + #---------------------------------------------------------- + + # Source includes all of the cpp files, and objects are derived from the + # source files... + ifndef Source + Source = $(wildcard *.cpp *.c *.y *.l) + endif + Objs = $(sort $(addsuffix .o,$(basename $(Source)))) + ObjectsO = $(addprefix Release/,$(Objs)) + ObjectsG = $(addprefix Debug/,$(Objs)) + + #--------------------------------------------------------- + # Handle the DIRS option + #--------------------------------------------------------- + + ifdef DIRS # Only do this if we're using DIRS! + + all :: $(addsuffix /.makeall , $(DIRS)) + install :: $(addsuffix /.makeinstall, $(DIRS)) + clean :: $(addsuffix /.makeclean , $(DIRS)) + + %/.makeall %/.makeclean %/.makeinstall: + cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@) + endif + + #--------------------------------------------------------- + # Handle the LIBRARYNAME option - used when building libs... + #--------------------------------------------------------- + + ifdef LIBRARYNAME + LIBNAME_O := Release/lib$(LIBRARYNAME).so + LIBNAME_G := Debug/lib$(LIBRARYNAME).so + + all:: $(LIBNAME_G) + #$(LIBNAME_O) + # TODO: Enable optimized builds + + $(LIBNAME_O): $(ObjectsO) $(LibSubDirs) Release/.dir + @echo ======= Linking $(LIBRARYNAME) release library ======= + $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts) + + $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) Debug/.dir + @echo ======= Linking $(LIBRARYNAME) debug library ======= + $(MakeSOG) -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts) + + endif + + + #--------------------------------------------------------- + + # Create dependacies for the cpp files... + Depend/%.d: %.cpp Depend/.dir + $(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@ + + # Create .o files in the ObjectFiles directory from the .cpp files... + Release/%.o: %.cpp Release/.dir Depend/.dir + $(CompileO) $< -o $@ + + Debug/%.o: %.cpp Debug/.dir Depend/.dir + $(CompileG) $< -o $@ + + # Create a .cpp source file from a flex input file... this uses sed to cut down + # on the warnings emited by GCC... + %.cpp: %.l + flex -t $< | sed '/^find_rule/d' | sed 's/void yyunput/inline void yyunput/' | sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' > $@ + + # Rule for building the bison parsers... + + %.cpp %.h : %.y + bison -d -p $(<:%Parser.y=%) $(basename $@).y + mv -f $(basename $@).tab.c $(basename $@).cpp + mv -f $(basename $@).tab.h $(basename $@).h + + # To create the directories... + %/.dir: + mkdir -p $(@D) + @date > $@ + + # Clean does not remove the output files... just the temporaries + clean:: + rm -rf Debug Release Depend + rm -f core *.o *.d *.so *~ *.flc + + # If dependancies were generated for the file that included this file, + # include the dependancies now... + # + SourceDepend = $(addsuffix .d,$(addprefix Depend/,$(basename $(Source)))) + ifneq ($(SourceDepend),) + include $(SourceDepend) + endif From lattner at cs.uiuc.edu Fri Jun 20 16:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 16:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b Message-ID: <200306202129.QAA27191@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-bc: primes.b updated: 1.3 -> 1.4 --- Log message: Make it take time like the other ptrdist bms --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b diff -u llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b:1.3 llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b:1.4 --- llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b:1.3 Fri Jun 20 16:21:58 2003 +++ llvm/test/Programs/MultiSource/Ptrdist-bc/primes.b Fri Jun 20 16:29:19 2003 @@ -11,7 +11,7 @@ if (limit >= 2) print "prime 1 = 2\n" if (limit >= 3) print "prime 2 = 3\n"; scale = 0; -for (timeloop = 0; timeloop < 50; timeloop += 1) { +for (timeloop = 0; timeloop < 30; timeloop += 1) { num = 2; for ( p=5; p <= limit; p += 2) { root = sqrt(p); From criswell at choi.cs.uiuc.edu Fri Jun 20 16:38:00 2003 From: criswell at choi.cs.uiuc.edu (John Criswell) Date: Fri Jun 20 16:38:00 2003 Subject: [llvm-commits] CVS: llvm/test/Feature/Makefile Message-ID: <200306202137.h5KLbgn16834@choi.cs.uiuc.edu> Changes in directory llvm/test/Feature: Makefile updated: 1.7 -> 1.8 --- Log message: Updated to the new Makefile.common. --- Diffs of the changes: Index: llvm/test/Feature/Makefile diff -u llvm/test/Feature/Makefile:1.7 llvm/test/Feature/Makefile:1.8 --- llvm/test/Feature/Makefile:1.7 Tue Jun 17 15:55:04 2003 +++ llvm/test/Feature/Makefile Fri Jun 20 16:37:31 2003 @@ -24,10 +24,10 @@ testcbe : $(OTESTS:%.ll=%.tc) Output/%.asmdis: % $(LAS) $(LDIS) Output/.dir - @./TestAsmDisasm.sh $< $(LLVMTOOLCURRENT) $(LIBDEBUG) + @./TestAsmDisasm.sh $< $(LLVMTOOLCURRENT) $(LLVMLIBCURRENTSOURCE) Output/%.opt: % $(LAS) $(LDIS) $(LOPT) Output/.dir - @./TestOptimizer.sh $< $(LLVMTOOLCURRENT) $(LIBDEBUG) + @./TestOptimizer.sh $< $(LLVMTOOLCURRENT) $(LLVMLIBCURRENTSOURCE) Output/%.tc: Output/%.bc $(LDIS) @echo "======== Generating C code for $<" From lattner at cs.uiuc.edu Fri Jun 20 18:02:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:02:01 2003 Subject: [llvm-commits] CVS: llvm/test/Feature/Makefile TestAsmDisasm.sh TestOptimizer.sh Message-ID: <200306202301.SAA16402@apoc.cs.uiuc.edu> Changes in directory llvm/test/Feature: Makefile updated: 1.8 -> 1.9 TestAsmDisasm.sh updated: 1.10 -> 1.11 TestOptimizer.sh updated: 1.17 -> 1.18 --- Log message: Remove obsolete support for LD_LIBRARY_PATH --- Diffs of the changes: Index: llvm/test/Feature/Makefile diff -u llvm/test/Feature/Makefile:1.8 llvm/test/Feature/Makefile:1.9 --- llvm/test/Feature/Makefile:1.8 Fri Jun 20 16:37:31 2003 +++ llvm/test/Feature/Makefile Fri Jun 20 18:01:23 2003 @@ -24,10 +24,10 @@ testcbe : $(OTESTS:%.ll=%.tc) Output/%.asmdis: % $(LAS) $(LDIS) Output/.dir - @./TestAsmDisasm.sh $< $(LLVMTOOLCURRENT) $(LLVMLIBCURRENTSOURCE) + @./TestAsmDisasm.sh $< $(LLVMTOOLCURRENT) Output/%.opt: % $(LAS) $(LDIS) $(LOPT) Output/.dir - @./TestOptimizer.sh $< $(LLVMTOOLCURRENT) $(LLVMLIBCURRENTSOURCE) + @./TestOptimizer.sh $< $(LLVMTOOLCURRENT) Output/%.tc: Output/%.bc $(LDIS) @echo "======== Generating C code for $<" Index: llvm/test/Feature/TestAsmDisasm.sh diff -u llvm/test/Feature/TestAsmDisasm.sh:1.10 llvm/test/Feature/TestAsmDisasm.sh:1.11 --- llvm/test/Feature/TestAsmDisasm.sh:1.10 Fri Jun 20 11:14:27 2003 +++ llvm/test/Feature/TestAsmDisasm.sh Fri Jun 20 18:01:23 2003 @@ -4,19 +4,6 @@ rm -f test.bc.temp[12] -# -# Split the current LD_LIBRARY_PATH into two separate components. -# -FirstLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f1` -SecondLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f2` - -# -# Now create a new LD_LIBRARY_PATH with our command line options as -# the first section. -# -LD_LIBRARY_PATH="$3:${FirstLDP}\;${SecondLDP}" -export LD_LIBRARY_PATH - AS=$2/as DIS=$2/dis Index: llvm/test/Feature/TestOptimizer.sh diff -u llvm/test/Feature/TestOptimizer.sh:1.17 llvm/test/Feature/TestOptimizer.sh:1.18 --- llvm/test/Feature/TestOptimizer.sh:1.17 Fri Jun 20 11:14:49 2003 +++ llvm/test/Feature/TestOptimizer.sh Fri Jun 20 18:01:23 2003 @@ -1,18 +1,5 @@ #!/bin/sh -# -# Split the current LD_LIBRARY_PATH into two separate components. -# -FirstLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f1` -SecondLDP=`echo $LD_LIBRARY_PATH | cut -d\; -f2` - -# -# Now create a new LD_LIBRARY_PATH with our command line options as -# the first section. -# -LD_LIBRARY_PATH="$3:${FirstLDP}\;${SecondLDP}" -export LD_LIBRARY_PATH - AS=$2/as DIS=$2/dis OPT=$2/opt From lattner at cs.uiuc.edu Fri Jun 20 18:03:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:03:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/175.vpr/Makefile Message-ID: <200306202302.SAA16424@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/175.vpr: Makefile updated: 1.1 -> 1.2 --- Log message: I don't know how vpr built before, but now it requires this... --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/175.vpr/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/175.vpr/Makefile:1.1 llvm/test/Programs/External/SPEC/CINT2000/175.vpr/Makefile:1.2 --- llvm/test/Programs/External/SPEC/CINT2000/175.vpr/Makefile:1.1 Thu May 15 10:42:32 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/175.vpr/Makefile Fri Jun 20 18:02:13 2003 @@ -2,4 +2,5 @@ LDFLAGS = -lm RUN_OPTIONS = net.in arch.in place.out dum.out -nodisp -place_only -init_t 5 -exit_t 0.005 -alpha_t 0.9412 -inner_num 2 STDOUT_FILENAME := place_log.out +CPPFLAGS := -DNO_GRAPHICS include ../../Makefile.spec From lattner at cs.uiuc.edu Fri Jun 20 18:03:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:03:06 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/GenerateReport.pl Message-ID: <200306202302.SAA16413@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: GenerateReport.pl updated: 1.9 -> 1.10 --- Log message: Add support for sorting numerically, not textually --- Diffs of the changes: Index: llvm/test/Programs/GenerateReport.pl diff -u llvm/test/Programs/GenerateReport.pl:1.9 llvm/test/Programs/GenerateReport.pl:1.10 --- llvm/test/Programs/GenerateReport.pl:1.9 Tue Feb 18 14:40:45 2003 +++ llvm/test/Programs/GenerateReport.pl Fri Jun 20 18:01:51 2003 @@ -37,6 +37,7 @@ # The column to sort by, to be overridden as neccesary by the report description my $SortCol = 0; my $SortReverse = 0; +my $SortNumeric = 0; # Sort numerically or textually? # Helper functions which may be called by the report description files... sub SumCols { @@ -114,7 +115,11 @@ # # Sort table now... # - at Values = sort { $a->[$SortCol] cmp $b->[$SortCol] } @Values; +if ($SortNumeric) { + @Values = sort { $a->[$SortCol] <=> $b->[$SortCol] } @Values; +} else { + @Values = sort { $a->[$SortCol] cmp $b->[$SortCol] } @Values; +} @Values = reverse @Values if ($SortReverse); # From lattner at cs.uiuc.edu Fri Jun 20 18:04:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:04:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-voronoi/Makefile Message-ID: <200306202303.SAA16480@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-voronoi: Makefile updated: 1.6 -> 1.7 --- Log message: Add optional larger inputs with the LARGE_PROBLEM_SIZE variable --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-voronoi/Makefile diff -u llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.6 llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.7 --- llvm/test/Programs/MultiSource/Olden-voronoi/Makefile:1.6 Wed Jun 18 11:18:31 2003 +++ llvm/test/Programs/MultiSource/Olden-voronoi/Makefile Fri Jun 20 18:03:23 2003 @@ -4,7 +4,9 @@ INCLUDES = defines.h CPPFLAGS = -DTORONTO LDFLAGS = -lm -#RUN_OPTIONS = 802400 20 0 7 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 802400 20 0 7 +endif # This program is adversely effected by the underlying precision of the machine PROGRAM_IS_NONDETERMINISTIC = 1 From lattner at cs.uiuc.edu Fri Jun 20 18:04:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:04:07 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-health/Makefile Message-ID: <200306202303.SAA16473@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-health: Makefile updated: 1.10 -> 1.11 --- Log message: Add optional larger inputs with the LARGE_PROBLEM_SIZE variable --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-health/Makefile diff -u llvm/test/Programs/MultiSource/Olden-health/Makefile:1.10 llvm/test/Programs/MultiSource/Olden-health/Makefile:1.11 --- llvm/test/Programs/MultiSource/Olden-health/Makefile:1.10 Wed Jun 18 09:48:48 2003 +++ llvm/test/Programs/MultiSource/Olden-health/Makefile Fri Jun 20 18:03:22 2003 @@ -3,6 +3,10 @@ PROG = health CPPFLAGS = -DTORONTO LDFLAGS = -lm +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 10 40 1 +else RUN_OPTIONS = 9 20 1 +endif include ../Makefile.multisrc From lattner at cs.uiuc.edu Fri Jun 20 18:04:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:04:12 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-bisort/Makefile Message-ID: <200306202303.SAA16466@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-bisort: Makefile updated: 1.3 -> 1.4 --- Log message: Add optional larger inputs with the LARGE_PROBLEM_SIZE variable --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-bisort/Makefile diff -u llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.3 llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.4 --- llvm/test/Programs/MultiSource/Olden-bisort/Makefile:1.3 Wed Jun 18 10:52:22 2003 +++ llvm/test/Programs/MultiSource/Olden-bisort/Makefile Fri Jun 20 18:03:21 2003 @@ -3,6 +3,11 @@ PROG = bisort CPPFLAGS = -DTORONTO LDFLAGS = -lm + +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 7000000 +else RUN_OPTIONS = 700000 +endif include ../Makefile.multisrc From lattner at cs.uiuc.edu Fri Jun 20 18:04:18 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:04:18 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-yacr2/main.c Message-ID: <200306202303.SAA16439@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-yacr2: main.c updated: 1.1 -> 1.2 --- Log message: Increase execution time --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Ptrdist-yacr2/main.c diff -u llvm/test/Programs/MultiSource/Ptrdist-yacr2/main.c:1.1 llvm/test/Programs/MultiSource/Ptrdist-yacr2/main.c:1.2 --- llvm/test/Programs/MultiSource/Ptrdist-yacr2/main.c:1.1 Tue Nov 5 12:51:50 2002 +++ llvm/test/Programs/MultiSource/Ptrdist-yacr2/main.c Fri Jun 20 18:02:55 2003 @@ -41,6 +41,8 @@ ulong net; ulong insert; int netsLeft; +int TIMELOOP; +for (TIMELOOP = 0; TIMELOOP < 20; ++TIMELOOP) { Option(argc, argv); @@ -138,5 +140,6 @@ PrintDerefStats(stderr); PrintHeapSize(stderr); #endif /* PLUS_STATS */ +} exit(0); } From lattner at cs.uiuc.edu Fri Jun 20 18:04:24 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:04:24 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Olden-bh/Makefile Message-ID: <200306202303.SAA16459@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Olden-bh: Makefile updated: 1.7 -> 1.8 --- Log message: Add optional larger inputs with the LARGE_PROBLEM_SIZE variable --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Olden-bh/Makefile diff -u llvm/test/Programs/MultiSource/Olden-bh/Makefile:1.7 llvm/test/Programs/MultiSource/Olden-bh/Makefile:1.8 --- llvm/test/Programs/MultiSource/Olden-bh/Makefile:1.7 Mon Jun 16 10:51:21 2003 +++ llvm/test/Programs/MultiSource/Olden-bh/Makefile Fri Jun 20 18:03:19 2003 @@ -3,6 +3,8 @@ PROG = bh CPPFLAGS = -DTORONTO LDFLAGS = -lm +ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = 50000 30 +endif include ../Makefile.multisrc From lattner at cs.uiuc.edu Fri Jun 20 18:07:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:07:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.micro.Makefile TEST.micro.report Message-ID: <200306202306.SAA16517@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.micro.Makefile added (r1.1) TEST.micro.report added (r1.1) --- Log message: add scripts used to generate numbers for the MICRO paper --- Diffs of the changes: Index: llvm/test/Programs/TEST.micro.Makefile diff -c /dev/null llvm/test/Programs/TEST.micro.Makefile:1.1 *** /dev/null Fri Jun 20 18:06:12 2003 --- llvm/test/Programs/TEST.micro.Makefile Fri Jun 20 18:06:02 2003 *************** *** 0 **** --- 1,40 ---- + ##===- test/Programs/TEST.jit.Makefile ---------------------*- Makefile -*-===## + # + # This test tries running the Just-In-Time compiler on all of the programs to + # see which ones work and which ones don't. It provides a report to tabulate + # this nicely and provides some simple statistics. + # + ##===----------------------------------------------------------------------===## + + #JIT_OPTS = -force-interpreter=false -stats -time-passes + CURDIR := $(shell cd .; pwd) + PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/ + RELDIR := $(subst $(PROGDIR),,$(CURDIR)) + + TIMEOPT = -time-passes -stats -info-output-file=$(CURDIR)/$@.info + EXTRA_LLI_OPTS = $(TIMEOPT) + + $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ + Output/%.$(TEST).report.txt: Output/%.llvm.bc Output/%.LOC.txt Output/%.out-nat Output/%.out-jit $(LLI) $(LOPT) + @echo -n "LOC: " > $@ + @cat Output/$*.LOC.txt >> $@ + @echo -n "LLC SIZE: " >> $@ + #- at wc -c Output/$*.llc >> $@ + @echo >> $@ + @echo -n "NAT TIME: " >> $@ + - at grep real Output/$*.out-nat.time >> $@ + @echo -n "JIT TIME: " >> $@ + - at grep real Output/$*.out-jit.time >> $@ + @cat Output/$*.out-jit.info >> $@ + $(LOPT) -strip -stats -o /dev/null -f $< >> $@ 2>&1 + + $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ + test.$(TEST).%: Output/%.$(TEST).report.txt + @echo "---------------------------------------------------------------" + @echo ">>> ========= '$(RELDIR)/$*' Program" + @echo "---------------------------------------------------------------" + @cat $< + + # Define REPORT_DEPENDENCIES so that the report is regenerated if lli changes + # + REPORT_DEPENDENCIES := $(LLI) $(LOPT) Index: llvm/test/Programs/TEST.micro.report diff -c /dev/null llvm/test/Programs/TEST.micro.report:1.1 *** /dev/null Fri Jun 20 18:06:12 2003 --- llvm/test/Programs/TEST.micro.report Fri Jun 20 18:06:02 2003 *************** *** 0 **** --- 1,146 ---- + ##=== TEST.jit.report - Report description for jit tests -------*- perl -*-===## + # + # This file defines a report to be generated for the jit test. + # + # This report should be generated with the following command: + # gmake ENABLE_OPTIMIZED=1 TEST=micro RUNTIMELIMIT=120 LARGE_PROBLEM_SIZE=1 CFLAGS=-O3 + # + ##===----------------------------------------------------------------------===## + + # Sort by name + $SortCol = 4; + + ## Sort in descending order + $SortReverse = 1; + $SortNumeric = 1; + + # Helper function + sub Ratio { + my ($Cols, $Col) = @_; + if ($Cols->[$Col-1] ne "*" and + $Cols->[$Col-1] != "0") { + return 0 if ($Cols->[$Col-2] eq "*"); + return $Cols->[$Col-2]/$Cols->[$Col-1]; + } else { + return "n/a"; + } + } + sub InvRatio { + my ($Cols, $Col) = @_; + if ($Cols->[$Col-2] ne "*" and + $Cols->[$Col-2] != "0") { + return $Cols->[$Col-1]/$Cols->[$Col-2]; + } else { + return "n/a"; + } + } + + sub LLVMRatio { + my ($Cols, $Col) = @_; + if ($Cols->[5] ne "*") { + return $Cols->[5]*1733333333/$Cols->[10]; + } else { + return "n/a"; + } + } + + sub FormatSize { + my $Size = shift; + return "*" if ($Size eq "*"); + if ($Size > 10*1024*1024) { + return (int $Size*10 / (1024*1024))/10 . "MB"; + } elsif ($Size > 10*1024) { + return sprintf("%2.1f", $Size / 1024) . "KB"; + } else { + return $Size . "B"; + } + } + + sub FormatSizeKB { + my $Size = shift; + return "*" if ($Size eq "*"); + return sprintf("%2.1f", $Size / 1024); + } + + sub FormatRatio { + return sprintf("%0.2f", shift); + } + sub FormatRatio2 { + return sprintf("%0.3f", shift); + } + + @LatexColumns = (1, 15, 12, # LOC, LLC Size, BytecodeSize + 10, 9, 11, # #LLVM Insts, # MachineInsts, Ratio + 5, 4, 6); # JIT Time, Nat Run Time, Ratio + + # Specify how to format columns nicely for printing... + %LatexColumnFormat = ( + 6 => \&FormatRatio2, + 11 => \&FormatRatio, + 12 => \&FormatSizeKB, + 15 => \&FormatSizeKB, + ); + + # For latex output, limit benchmarks and rename as appropriate + @LatexRowMapOrder = ( + 'treeadd' => 'Olden-treeadd', + 'bisort' => 'Olden-bisort', + 'mst' => 'Olden-mst', + 'perimeter' => 'Olden-perimeter', + 'health' => 'Olden-health', + 'tsp' => 'Olden-tsp', + 'power' => 'Olden-power', + 'em3d' => 'Olden-em3d', + 'voronoi' => 'Olden-voronoi', + 'bh' => 'Olden-bh', + '-' => '-', + 'anagram' => 'ptrdist-anagram', + 'ks' => 'ptrdist-ks', + 'ft' => 'ptrdist-ft', + 'yacr2' => 'ptrdist-yacr2', + 'bc' => 'ptrdist-bc', + '-' => '-', + '181.mcf' => '181.mcf', + '256.bzip2' => '256.bzip2', + '164.gzip' => '164.gzip', + '197.parser' => '197.parser', + '175.vpr' => '175.vpr', + '186.crafty' => '186.crafty', + '255.vortex' => '255.vortex', + # '-' => '-', + # 'sgefa' => 'sgefa', + # 'sim' => 'sim', + # 'burg' => 'burg', + # 'fhourstones' => 'fhourstones', + # 'optimizer-eval' => 'optimizer-eval', + # 'flops' => 'flops', + # 'llu' => 'llubenchmark' + ); + + + # These are the columns for the report. The first entry is the header for the + # column, the second is the regex to use to match the value. Empty list create + # seperators, and closures may be put in for custom processing. + ( + # Name + ["Name:" , '\'.*/([^\']+)\' Program'], + ["LOC:" , 'LOC: *([0-9]+)'], + [], + # Times + ["Total" , 'JIT TIME: real ([0-9.]+)'], + ["NatTotal", 'NAT TIME: real ([0-9.]+)'], + ["CodeGen", 'Total Execution Time: ([0-9.]+)'], + ["CodeGenRatio", \&InvRatio], + [], + # Sizes + ["MCSize" , '([0-9]+).*Number of bytes of machine code compiled'], + ["#MCInsts" , '([0-9]+).*Number of machine instructions emitted'], + ["LLVMInsts", '([0-9]+).*Number of instructions'], + ["mc/LLVM ratio", \&Ratio], + ["BytcdSize", '([0-9]+).*Number of bytecode bytes written'], + [], + ["Cycle/LLVM", \&LLVMRatio], + ["LLC Size", 'LLC SIZE: *([0-9]+)'], + # Number of transformations + [] + ); From lattner at cs.uiuc.edu Fri Jun 20 18:16:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:16:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcV9.td Message-ID: <200306202315.SAA16584@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcV9.td updated: 1.20 -> 1.21 --- Log message: Some preprocessors doen't support // comments and get confused --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcV9.td diff -u llvm/lib/Target/Sparc/SparcV9.td:1.20 llvm/lib/Target/Sparc/SparcV9.td:1.21 --- llvm/lib/Target/Sparc/SparcV9.td:1.20 Fri Jun 6 04:52:23 2003 +++ llvm/lib/Target/Sparc/SparcV9.td Fri Jun 20 18:14:50 2003 @@ -121,7 +121,7 @@ #endif // Section A.6: Branch on Integer condition codes (Bicc) - p146 -#if 0 // instead of using deprecated version, use the predicted version below +#if 0 /* instead of using deprecated version, use the predicted version below */ set isDeprecated = 1 in { set op2 = 0b010 in { def BA : F2_2<0b1000, "ba">; // Branch always From lattner at cs.uiuc.edu Fri Jun 20 18:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:25:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Burg/Makefile.burg Message-ID: <200306202324.SAA16683@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Burg: Makefile.burg (r1.1) removed --- Log message: Remove obsolete file --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Jun 20 18:32:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:32:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.report Message-ID: <200306202331.SAA25475@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.report updated: 1.4 -> 1.5 --- Log message: add native execution time to the table --- Diffs of the changes: Index: llvm/test/Programs/TEST.nightly.report diff -u llvm/test/Programs/TEST.nightly.report:1.4 llvm/test/Programs/TEST.nightly.report:1.5 --- llvm/test/Programs/TEST.nightly.report:1.4 Mon Jun 16 11:00:45 2003 +++ llvm/test/Programs/TEST.nightly.report Fri Jun 20 18:31:42 2003 @@ -21,6 +21,7 @@ ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+).*Number of bytecode bytes'], ["Instrs" , 'TEST-RESULT-compile: *([0-9]+).*Number of inst'], [], + ["NAT" , "TEST-RESULT-nat-time: $WallTimeRE"], ["LLC" , "TEST-RESULT-llc: $WallTimeRE"], ["CBE" , 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)'], [], From lattner at cs.uiuc.edu Fri Jun 20 18:32:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:32:06 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile Message-ID: <200306202331.SAA25456@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile updated: 1.14 -> 1.15 --- Log message: Run external tests by default also --- Diffs of the changes: Index: llvm/test/Programs/Makefile diff -u llvm/test/Programs/Makefile:1.14 llvm/test/Programs/Makefile:1.15 --- llvm/test/Programs/Makefile:1.14 Fri May 9 17:24:32 2003 +++ llvm/test/Programs/Makefile Fri Jun 20 18:30:54 2003 @@ -6,8 +6,7 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. -PARALLEL_DIRS = SingleSource MultiSource - #NoSource +PARALLEL_DIRS = SingleSource MultiSource External include ${LEVEL}/test/Makefile.tests From lattner at cs.uiuc.edu Fri Jun 20 18:33:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:33:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.Makefile Message-ID: <200306202332.SAA25484@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.Makefile updated: 1.13 -> 1.14 --- Log message: Add native execution time to the table --- Diffs of the changes: Index: llvm/test/Programs/TEST.nightly.Makefile diff -u llvm/test/Programs/TEST.nightly.Makefile:1.13 llvm/test/Programs/TEST.nightly.Makefile:1.14 --- llvm/test/Programs/TEST.nightly.Makefile:1.13 Mon Jun 16 11:00:45 2003 +++ llvm/test/Programs/TEST.nightly.Makefile Fri Jun 20 18:31:28 2003 @@ -8,8 +8,9 @@ CURDIR := $(shell cd .; pwd) PROGDIR := $(shell cd $(LEVEL)/test/Programs; pwd)/ RELDIR := $(subst $(PROGDIR),,$(CURDIR)) +CFLAGS := -O3 -REPORTS_TO_GEN := compile llc cbe jit +REPORTS_TO_GEN := compile nat llc cbe jit REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN)) TIMEOPT = -time-passes -stats -info-output-file=$@.info @@ -37,6 +38,12 @@ echo "TEST-FAIL: compile $(RELDIR)/$*" >> $@;\ fi -rm -f $@.info + +# NAT tests +$(PROGRAMS_TO_TEST:%=Output/%.nightly.nat.report.txt): \ +Output/%.nightly.nat.report.txt: Output/%.out-nat + echo -n "TEST-RESULT-nat-time: " >> $@ + -grep "^real" Output/$*.out-nat.time >> $@ # LLC tests $(PROGRAMS_TO_TEST:%=Output/%.nightly.llc.report.txt): \ From lattner at cs.uiuc.edu Fri Jun 20 18:34:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:34:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/Makefile.spec Message-ID: <200306202332.SAA25498@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC: Makefile.spec updated: 1.11 -> 1.12 --- Log message: Set CPPFLAGS not CFLAGS --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/Makefile.spec diff -u llvm/test/Programs/External/SPEC/Makefile.spec:1.11 llvm/test/Programs/External/SPEC/Makefile.spec:1.12 --- llvm/test/Programs/External/SPEC/Makefile.spec:1.11 Fri Jun 20 15:42:46 2003 +++ llvm/test/Programs/External/SPEC/Makefile.spec Fri Jun 20 18:32:02 2003 @@ -45,9 +45,7 @@ include $(LEVEL)/test/Programs/MultiSource/Makefile.multisrc -LCCFLAGS := -DSPEC_CPU2000 -O2 -CFLAGS := -DSPEC_CPU2000 -O2 - +CPPFLAGS += -DSPEC_CPU2000 SPEC_SANDBOX := $(LEVEL)/test/Programs/External/SPEC/Sandbox.sh # Information about testing the program... From lattner at cs.uiuc.edu Fri Jun 20 18:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Burg/Makefile Message-ID: <200306202333.SAA25510@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Burg: Makefile updated: 1.4 -> 1.5 --- Log message: Test should not set cflags --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Burg/Makefile diff -u llvm/test/Programs/MultiSource/Burg/Makefile:1.4 llvm/test/Programs/MultiSource/Burg/Makefile:1.5 --- llvm/test/Programs/MultiSource/Burg/Makefile:1.4 Wed Jun 11 08:55:44 2003 +++ llvm/test/Programs/MultiSource/Burg/Makefile Fri Jun 20 18:33:19 2003 @@ -2,7 +2,6 @@ PROG = burg CPPFLAGS = -DDEBUG -CFLAGS = -g LDFLAGS = ExtraSource := y.tab.c From lattner at cs.uiuc.edu Fri Jun 20 18:42:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:42:00 2003 Subject: [llvm-commits] CVS: llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html Message-ID: <200306202341.SAA00258@tank.cs.uiuc.edu> Changes in directory llvm/www/pubs: 2002-08-09-LLVMCompilationStrategy.html updated: 1.1 -> 1.2 --- Log message: Add an update about the state of the C frontend --- Diffs of the changes: Index: llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html diff -u llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html:1.1 llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html:1.2 --- llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html:1.1 Mon May 19 10:32:47 2003 +++ llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html Fri Jun 20 18:40:49 2003 @@ -35,6 +35,21 @@ Technical Report #UIUCDCS-R-2002-2292, Computer Science Dept., Univ. of Illinois, Aug. 2002. +

Update:

+
    + Since this document has been published, one significant change has been + made to LLVM: The GCC C front-end described in the document has been + completely rewritten from scratch. The new C front-end is based on the + mainline GCC CVS tree (what will become GCC 3.4), and expands type-safe LLVM + code from the GCC AST representation, instead of from the untyped GCC RTL + representation.

    + + This change dramatically improved the quality of code generated and the + stability of the system as a whole.

    +

+ + +

Download:

  • The LLVM Instruction Set and Compilation Strategy (PS) From lattner at cs.uiuc.edu Fri Jun 20 18:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Jun 20 18:47:01 2003 Subject: [llvm-commits] CVS: llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html Message-ID: <200306202346.SAA00340@tank.cs.uiuc.edu> Changes in directory llvm/www/pubs: 2002-08-09-LLVMCompilationStrategy.html updated: 1.2 -> 1.3 --- Log message: Fix grammar --- Diffs of the changes: Index: llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html diff -u llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html:1.2 llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html:1.3 --- llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html:1.2 Fri Jun 20 18:40:49 2003 +++ llvm/www/pubs/2002-08-09-LLVMCompilationStrategy.html Fri Jun 20 18:46:07 2003 @@ -37,12 +37,11 @@

    Update:

      - Since this document has been published, one significant change has been - made to LLVM: The GCC C front-end described in the document has been - completely rewritten from scratch. The new C front-end is based on the - mainline GCC CVS tree (what will become GCC 3.4), and expands type-safe LLVM - code from the GCC AST representation, instead of from the untyped GCC RTL - representation.

      + Since this document was published, one significant change has been made + to LLVM: the GCC C front-end described in the document has been completely + rewritten from scratch. The new C front-end is based on the mainline GCC CVS + tree (what will become GCC 3.4), and expands type-safe LLVM code from the GCC + AST representation, instead of from the untyped GCC RTL representation.

      This change dramatically improved the quality of code generated and the stability of the system as a whole.

      From lattner at cs.uiuc.edu Sat Jun 21 11:02:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 11:02:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200306211601.LAA02398@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.106 -> 1.107 --- Log message: Generate code for LONG indexes to getelementptr instructions more efficiently --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.106 llvm/lib/Target/X86/InstSelectSimple.cpp:1.107 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.106 Thu Jun 5 14:30:30 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sat Jun 21 11:01:24 2003 @@ -1580,9 +1580,26 @@ /// visitCastInst - Here we have various kinds of copying with or without /// sign extension going on. void ISel::visitCastInst(CastInst &CI) { + Value *Op = CI.getOperand(0); + // If this is a cast from a 32-bit integer to a Long type, and the only uses + // of the case are GEP instructions, then the cast does not need to be + // generated explicitly, it will be folded into the GEP. + if (CI.getType() == Type::LongTy && + (Op->getType() == Type::IntTy || Op->getType() == Type::UIntTy)) { + bool AllUsesAreGEPs = true; + for (Value::use_iterator I = CI.use_begin(), E = CI.use_end(); I != E; ++I) + if (!isa(*I)) { + AllUsesAreGEPs = false; + break; + } + + // No need to codegen this cast if all users are getelementptr instrs... + if (AllUsesAreGEPs) return; + } + unsigned DestReg = getReg(CI); MachineBasicBlock::iterator MI = BB->end(); - emitCastOperation(BB, MI, CI.getOperand(0), CI.getType(), DestReg); + emitCastOperation(BB, MI, Op, CI.getType(), DestReg); } /// emitCastOperation - Common code shared between visitCastInst and @@ -1936,6 +1953,13 @@ // indices, we may not know its actual value at code-generation // time. assert(idx->getType() == Type::LongTy && "Bad GEP array index!"); + + // Most GEP instructions use a [cast (int/uint) to LongTy] as their + // operand on X86. Handle this case directly now... + if (CastInst *CI = dyn_cast(idx)) + if (CI->getOperand(0)->getType() == Type::IntTy || + CI->getOperand(0)->getType() == Type::UIntTy) + idx = CI->getOperand(0); // We want to add BaseReg to(idxReg * sizeof ElementType). First, we // must find the size of the pointed-to type (Not coincidentally, the next From lattner at cs.uiuc.edu Sat Jun 21 12:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 12:15:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.def Message-ID: <200306211714.MAA05937@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.def updated: 1.59 -> 1.60 --- Log message: Add IMULr16 & IMULr32 instructions --- Diffs of the changes: Index: llvm/lib/Target/X86/X86InstrInfo.def diff -u llvm/lib/Target/X86/X86InstrInfo.def:1.59 llvm/lib/Target/X86/X86InstrInfo.def:1.60 --- llvm/lib/Target/X86/X86InstrInfo.def:1.59 Thu Jun 19 14:41:13 2003 +++ llvm/lib/Target/X86/X86InstrInfo.def Sat Jun 21 12:13:35 2003 @@ -166,22 +166,24 @@ I(MULr8 , "mul", 0xF6, 0, X86II::MRMS4r | X86II::Void, O_AL, O_AX) // AX = AL*R8 I(MULr16 , "mul", 0xF7, 0, X86II::MRMS4r | X86II::Void | // DX:AX= AX*R16 - X86II::OpSize, O_AX, T_AXDX) + X86II::OpSize, O_AX, T_AXDX) I(MULr32 , "mul", 0xF7, 0, X86II::MRMS4r | X86II::Void, O_EAX, T_EAXEDX) // ED:EA= EA*R32 +I(IMULr16 , "imul", 0xAF, M_2_ADDR_FLAG, X86II::MRMSrcReg | X86II::TB | // R16 *= R16 + X86II::OpSize, NoIR, NoIR) +I(IMULr32 , "imul", 0xAF, M_2_ADDR_FLAG, X86II::MRMSrcReg | X86II::TB, NoIR, NoIR) // R32 *= R32 + // unsigned division/remainder I(DIVr8 , "div", 0xF6, 0, X86II::MRMS6r | X86II::Void, O_AX, O_AX) // AX/r8= AL&AH I(DIVr16 , "div", 0xF7, 0, X86II::MRMS6r | X86II::Void | // ED:EA/r16=AX&DX - X86II::OpSize, T_AXDX, T_AXDX) -I(DIVr32 , "div", 0xF7, 0, X86II::MRMS6r | X86II::Void, T_EAXEDX, - T_EAXEDX) // ED:EA/r32=EA&ED + X86II::OpSize, T_AXDX, T_AXDX) +I(DIVr32 , "div", 0xF7, 0, X86II::MRMS6r | X86II::Void, T_EAXEDX,T_EAXEDX)// ED:EA/r32=EA&ED // signed division/remainder I(IDIVr8 , "idiv", 0xF6, 0, X86II::MRMS7r | X86II::Void, O_AX, O_AX) // AX/r8= AL&AH I(IDIVr16 , "idiv", 0xF7, 0, X86II::MRMS7r | X86II::Void | // DA/r16=AX&DX - X86II::OpSize, T_AXDX, T_AXDX) -I(IDIVr32 , "idiv", 0xF7, 0, X86II::MRMS7r | X86II::Void, T_EAXEDX, - T_EAXEDX) // DA/r32=EAX&DX + X86II::OpSize, T_AXDX, T_AXDX) +I(IDIVr32 , "idiv", 0xF7, 0, X86II::MRMS7r | X86II::Void, T_EAXEDX,T_EAXEDX)// DA/r32=EAX&DX // Logical operators I(ANDrr8 , "and", 0x20, M_2_ADDR_FLAG, X86II::MRMDestReg, NoIR, NoIR) // R8 &= R8 From lattner at cs.uiuc.edu Sat Jun 21 12:18:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 12:18:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200306211717.MAA08662@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.107 -> 1.108 --- Log message: For 16 and 32-bit multiplies, use the IMUL instruction instead of the MUL instruction. This allows us to not force the use of the EAX/AX registers! --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.107 llvm/lib/Target/X86/InstSelectSimple.cpp:1.108 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.107 Sat Jun 21 11:01:24 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sat Jun 21 12:16:58 2003 @@ -1069,8 +1069,6 @@ /// registers op0Reg and op1Reg, and put the result in DestReg. The type of the /// result should be given as DestTy. /// -/// FIXME: doMultiply should use one of the two address IMUL instructions! -/// void ISel::doMultiply(MachineBasicBlock *MBB, MachineBasicBlock::iterator &MBBI, unsigned DestReg, const Type *DestTy, unsigned op0Reg, unsigned op1Reg) { @@ -1079,28 +1077,20 @@ case cFP: // Floating point multiply BMI(BB, MBBI, X86::FpMUL, 2, DestReg).addReg(op0Reg).addReg(op1Reg); return; + case cInt: + case cShort: + BMI(BB, MBBI, Class == cInt ? X86::IMULr32 : X86::IMULr16, 2, DestReg) + .addReg(op0Reg).addReg(op1Reg); + return; + case cByte: + // Must use the MUL instruction, which forces use of AL... + BMI(MBB, MBBI, X86::MOVrr8, 1, X86::AL).addReg(op0Reg); + BMI(MBB, MBBI, X86::MULr8, 1).addReg(op1Reg); + BMI(MBB, MBBI, X86::MOVrr8, 1, DestReg).addReg(X86::AL); + return; default: case cLong: assert(0 && "doMultiply cannot operate on LONG values!"); - case cByte: - case cShort: - case cInt: // Small integerals, handled below... - break; } - - static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX }; - static const unsigned MulOpcode[]={ X86::MULr8 , X86::MULr16 , X86::MULr32 }; - static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 }; - unsigned Reg = Regs[Class]; - - // Emit a MOV to put the first operand into the appropriately-sized - // subreg of EAX. - BMI(MBB, MBBI, MovOpcode[Class], 1, Reg).addReg(op0Reg); - - // Emit the appropriate multiply instruction. - BMI(MBB, MBBI, MulOpcode[Class], 1).addReg(op1Reg); - - // Emit another MOV to put the result into the destination register. - BMI(MBB, MBBI, MovOpcode[Class], 1, DestReg).addReg(Reg); } /// visitMul - Multiplies are not simple binary operators because they must deal From lattner at cs.uiuc.edu Sat Jun 21 13:16:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 13:16:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200306211815.NAA31707@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.108 -> 1.109 --- Log message: Minor simplification to 64-bit instsel --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.108 llvm/lib/Target/X86/InstSelectSimple.cpp:1.109 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.108 Sat Jun 21 12:16:58 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sat Jun 21 13:15:27 2003 @@ -1116,16 +1116,16 @@ BuildMI(BB, X86::MOVrr32, 1, OverflowReg).addReg(X86::EDX); // AL*BL >> 32 MachineBasicBlock::iterator MBBI = BB->end(); - unsigned AHBLReg = makeAnotherReg(Type::UIntTy); - doMultiply(BB, MBBI, AHBLReg, Type::UIntTy, Op0Reg+1, Op1Reg); // AH*BL + unsigned AHBLReg = makeAnotherReg(Type::UIntTy); // AH*BL + BMI(BB, MBBI, X86::IMULr32, 2, AHBLReg).addReg(Op0Reg+1).addReg(Op1Reg); unsigned AHBLplusOverflowReg = makeAnotherReg(Type::UIntTy); BuildMI(BB, X86::ADDrr32, 2, // AH*BL+(AL*BL >> 32) AHBLplusOverflowReg).addReg(AHBLReg).addReg(OverflowReg); MBBI = BB->end(); - unsigned ALBHReg = makeAnotherReg(Type::UIntTy); - doMultiply(BB, MBBI, ALBHReg, Type::UIntTy, Op0Reg, Op1Reg+1); // AL*BH + unsigned ALBHReg = makeAnotherReg(Type::UIntTy); // AL*BH + BMI(BB, MBBI, X86::IMULr32, 2, ALBHReg).addReg(Op0Reg).addReg(Op1Reg+1); BuildMI(BB, X86::ADDrr32, 2, // AL*BH + AH*BL + (AL*BL >> 32) DestReg+1).addReg(AHBLplusOverflowReg).addReg(ALBHReg); From lattner at cs.uiuc.edu Sat Jun 21 15:07:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 15:07:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.report Message-ID: <200306212006.PAA31714@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.report updated: 1.5 -> 1.6 --- Log message: Fix the 'nat' column of the nightly tester --- Diffs of the changes: Index: llvm/test/Programs/TEST.nightly.report diff -u llvm/test/Programs/TEST.nightly.report:1.5 llvm/test/Programs/TEST.nightly.report:1.6 --- llvm/test/Programs/TEST.nightly.report:1.5 Fri Jun 20 18:31:42 2003 +++ llvm/test/Programs/TEST.nightly.report Sat Jun 21 15:06:00 2003 @@ -21,7 +21,7 @@ ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+).*Number of bytecode bytes'], ["Instrs" , 'TEST-RESULT-compile: *([0-9]+).*Number of inst'], [], - ["NAT" , "TEST-RESULT-nat-time: $WallTimeRE"], + ["NAT" , 'TEST-RESULT-nat-time: real\s*([.0-9m]+)'], ["LLC" , "TEST-RESULT-llc: $WallTimeRE"], ["CBE" , 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)'], [], From lattner at cs.uiuc.edu Sat Jun 21 15:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 15:10:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.report Message-ID: <200306212009.PAA31746@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.report updated: 1.6 -> 1.7 --- Log message: Reorganize columns --- Diffs of the changes: Index: llvm/test/Programs/TEST.nightly.report diff -u llvm/test/Programs/TEST.nightly.report:1.6 llvm/test/Programs/TEST.nightly.report:1.7 --- llvm/test/Programs/TEST.nightly.report:1.6 Sat Jun 21 15:06:00 2003 +++ llvm/test/Programs/TEST.nightly.report Sat Jun 21 15:09:13 2003 @@ -20,12 +20,12 @@ ["GCCAS" , "TEST-RESULT-compile: $WallTimeRE"], ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+).*Number of bytecode bytes'], ["Instrs" , 'TEST-RESULT-compile: *([0-9]+).*Number of inst'], + ["LLC" , "TEST-RESULT-llc: $WallTimeRE"], [], ["NAT" , 'TEST-RESULT-nat-time: real\s*([.0-9m]+)'], - ["LLC" , "TEST-RESULT-llc: $WallTimeRE"], ["CBE" , 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)'], - [], ["JIT" , 'TEST-RESULT-jit-time: real\s*([.0-9m]+)'], + [], ["MachCode" , 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code'], ["CompTime" , "TEST-RESULT-jit-comptime: $WallTimeRE"] ); From lattner at cs.uiuc.edu Sat Jun 21 15:10:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 15:10:07 2003 Subject: [llvm-commits] CVS: llvm/utils/NightlyTestTemplate.html Message-ID: <200306212009.PAA31737@apoc.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTestTemplate.html updated: 1.7 -> 1.8 --- Log message: update documentation about columns --- Diffs of the changes: Index: llvm/utils/NightlyTestTemplate.html diff -u llvm/utils/NightlyTestTemplate.html:1.7 llvm/utils/NightlyTestTemplate.html:1.8 --- llvm/utils/NightlyTestTemplate.html:1.7 Sat May 10 15:54:55 2003 +++ llvm/utils/NightlyTestTemplate.html Sat Jun 21 15:09:01 2003 @@ -126,15 +126,11 @@

    • Bytecode - The size of the bytecode for the program
    • Instrs - The number of LLVM instructions in the compiled bytecode -
    • LLC - The time taken compile with the Sparc Backend. Note - that this justs tests to see if the backend runs successfully, not if the - generated code works. +
    • LLC - The time taken compile with LLC (the static X86 backend) +
    • NAT - The time taken to execute the program when compiled + with GCC -O3.
    • CBE - The time taken to execute the program after compilation through the C Backend. If the diff fails, this a *. -
    • LLI - How long does the program take to execute in - LLI's interpreter (note that this is capped to ~300s). -
    • DynInstrs - How many dynamic instructions are executed - by the interpreter, if it finishes.
    • JIT - How long does the program take to execute in the Just-In-Time compiler.
    • MachCode - The number of bytes of machine code From lattner at cs.uiuc.edu Sat Jun 21 16:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 16:47:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandLine.html Message-ID: <200306212146.QAA06131@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: CommandLine.html updated: 1.9 -> 1.10 --- Log message: Clarify that variables must be global --- Diffs of the changes: Index: llvm/www/docs/CommandLine.html diff -u llvm/www/docs/CommandLine.html:1.9 llvm/www/docs/CommandLine.html:1.10 --- llvm/www/docs/CommandLine.html:1.9 Mon Jun 2 23:40:06 2003 +++ llvm/www/docs/CommandLine.html Sat Jun 21 16:45:56 2003 @@ -94,8 +94,9 @@
    • Speed: The CommandLine library is very quick and uses little resources. The parsing time of the library is directly proportional to the number of arguments parsed, not the the number of options recognized. Additionally, command line -argument values are captured transparently into user defined variables, which -can be accessed like any other variable (and with the same performance).

      +argument values are captured transparently into user defined global variables, +which can be accessed like any other variable (and with the same +performance).

    • Type Safe: As a user of CommandLine, you don't have to worry about remembering the type of arguments that you want (is it an int? a string? a @@ -183,24 +184,24 @@ Now that you are ready to support command line arguments, we need to tell the system which ones we want, and what type of argument they are. The CommandLine -library uses a declarative syntax to model cammand line arguments with the -variable declarations that capture the parsed values. This means that for every -command line option that you would like to support, there should be a variable -declaration to capture the result. For example, in a compiler, we would like to -support the unix standard '-o <filename>' option to specify where -to put the output. With the CommandLine library, this is represented like -this:

      +library uses a declarative syntax to model command line arguments with the +global variable declarations that capture the parsed values. This means that +for every command line option that you would like to support, there should be a +global variable declaration to capture the result. For example, in a compiler, +we would like to support the unix standard '-o <filename>' option +to specify where to put the output. With the CommandLine library, this is +represented like this:

      
       cl::opt<string> OutputFilename("o", cl::desc("Specify output filename"), cl::value_desc("filename"));
       

      -This declares a variable "OutputFilename" that is used to capture the -result of the "o" argument (first parameter). We specify that this is -a simple scalar option by using the "cl::opt" -template (as opposed to the "cl::list -template), and tell the CommandLine library that the data type that we are -parsing is a string.

      +This declares a global variable "OutputFilename" that is used to +capture the result of the "o" argument (first parameter). We specify +that this is a simple scalar option by using the "cl::opt" template (as opposed to the "cl::list template), and tell the CommandLine library +that the data type that we are parsing is a string.

      The second and third parameters (which are optional) are used to specify what to output for the "--help" option. In this case, we get a line that looks @@ -1495,7 +1496,7 @@

      Chris Lattner
      -Last modified: Mon Jun 2 23:39:44 CDT 2003 +Last modified: Sat Jun 21 16:45:29 CDT 2003 From lattner at cs.uiuc.edu Sat Jun 21 18:00:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 18:00:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/getelementptr.ll Message-ID: <200306212259.RAA04508@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: getelementptr.ll updated: 1.8 -> 1.9 --- Log message: Add testcase for reason that typesafety of power is being broken --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/getelementptr.ll diff -u llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.8 llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.9 --- llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.8 Wed Mar 5 16:32:48 2003 +++ llvm/test/Regression/Transforms/InstCombine/getelementptr.ll Sat Jun 21 17:59:39 2003 @@ -48,3 +48,9 @@ %B = getelementptr int* %A, long %D ret int* %B } + +sbyte* %foo8([10 x int]* %X) { + %A = getelementptr [10 x int]* %X, long 0, long 0 ;; Fold into the cast. + %B = cast int* %A to sbyte* + ret sbyte * %B +} From lattner at cs.uiuc.edu Sat Jun 21 18:13:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 18:13:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200306212312.SAA05151@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.90 -> 1.91 --- Log message: Instcombine cast (getelementptr Ptr, 0, 0, 0) to ... into: cast Ptr to ... This fixes type safety problems in a variety of benchmarks that were confusing DSA. --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.90 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.91 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.90 Thu Jun 19 12:00:31 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Jun 21 18:12:02 2003 @@ -930,6 +930,23 @@ } } + // If casting the result of a getelementptr instruction with no offset, turn + // this into a cast of the original pointer! + // + if (GetElementPtrInst *GEP = dyn_cast(CI.getOperand(0))) { + bool AllZeroOperands = true; + for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i) + if (!isa(GEP->getOperand(i)) || + !cast(GEP->getOperand(i))->isNullValue()) { + AllZeroOperands = false; + break; + } + if (AllZeroOperands) { + CI.setOperand(0, GEP->getOperand(0)); + return &CI; + } + } + return 0; } From lattner at cs.uiuc.edu Sat Jun 21 21:39:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 21:39:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.nightly.Makefile Message-ID: <200306220238.VAA06166@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.nightly.Makefile updated: 1.14 -> 1.15 --- Log message: Make spec tests work, which run in a different directory --- Diffs of the changes: Index: llvm/test/Programs/TEST.nightly.Makefile diff -u llvm/test/Programs/TEST.nightly.Makefile:1.14 llvm/test/Programs/TEST.nightly.Makefile:1.15 --- llvm/test/Programs/TEST.nightly.Makefile:1.14 Fri Jun 20 18:31:28 2003 +++ llvm/test/Programs/TEST.nightly.Makefile Sat Jun 21 21:38:29 2003 @@ -13,7 +13,7 @@ REPORTS_TO_GEN := compile nat llc cbe jit REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN)) -TIMEOPT = -time-passes -stats -info-output-file=$@.info +TIMEOPT = -time-passes -stats -info-output-file=$(CURDIR)/$@.info EXTRA_LLI_OPTS = $(TIMEOPT) INFO_PREFIX = Output/$*.*- From lattner at cs.uiuc.edu Sat Jun 21 22:04:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:04:00 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSNode.h Message-ID: <200306220303.WAA07181@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSNode.h updated: 1.25 -> 1.26 --- Log message: Remove support for the MultiObject flag, which was just fundamentally broken --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSNode.h diff -u llvm/include/llvm/Analysis/DSNode.h:1.25 llvm/include/llvm/Analysis/DSNode.h:1.26 --- llvm/include/llvm/Analysis/DSNode.h:1.25 Thu Jun 19 16:14:22 2003 +++ llvm/include/llvm/Analysis/DSNode.h Sat Jun 21 22:03:24 2003 @@ -7,9 +7,6 @@ #ifndef LLVM_ANALYSIS_DSNODE_H #define LLVM_ANALYSIS_DSNODE_H -#include - -#include "llvm/Analysis/DSSupport.h" template class DSNodeIterator; // Data structure graph traversal iterator @@ -74,9 +71,8 @@ Read = 1 << 6, // This node is read in this context Array = 1 << 7, // This node is treated like an array - MultiObject = 1 << 8, // This node represents > 1 object (may alias) //#ifndef NDEBUG - DEAD = 1 << 9, // This node is dead and should not be pointed to + DEAD = 1 << 8, // This node is dead and should not be pointed to //#endif Composition = AllocaNode | HeapNode | GlobalNode | UnknownNode, @@ -250,13 +246,12 @@ bool isRead() const { return NodeType & Read; } bool isIncomplete() const { return NodeType & Incomplete; } - bool isMultiObject() const { return NodeType & MultiObject; } bool isDeadNode() const { return NodeType & DEAD; } - DSNode *setAllocaNodeMarker() { return setCompositionMarker(AllocaNode); } - DSNode *setHeapNodeMarker() { return setCompositionMarker(HeapNode); } - DSNode *setGlobalNodeMarker() { return setCompositionMarker(GlobalNode); } - DSNode *setUnknownNodeMarker() { return setCompositionMarker(UnknownNode); } + DSNode *setAllocaNodeMarker() { NodeType |= AllocaNode; return this; } + DSNode *setHeapNodeMarker() { NodeType |= HeapNode; return this; } + DSNode *setGlobalNodeMarker() { NodeType |= GlobalNode; return this; } + DSNode *setUnknownNodeMarker() { NodeType |= UnknownNode; return this; } DSNode *setIncompleteMarker() { NodeType |= Incomplete; return this; } DSNode *setModifiedMarker() { NodeType |= Modified; return this; } @@ -296,12 +291,6 @@ private: friend class DSNodeHandle; - - DSNode *setCompositionMarker(unsigned Marker) { - if (NodeType & Composition) Marker |= MultiObject; - NodeType |= Marker; - return this; - } // static mergeNodes - Helper for mergeWith() static void MergeNodes(DSNodeHandle& CurNodeH, DSNodeHandle& NH); From lattner at cs.uiuc.edu Sat Jun 21 22:05:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:05:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp DataStructureAA.cpp Printer.cpp TopDownClosure.cpp Message-ID: <200306220304.WAA07715@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.100 -> 1.101 DataStructureAA.cpp updated: 1.4 -> 1.5 Printer.cpp updated: 1.52 -> 1.53 TopDownClosure.cpp updated: 1.40 -> 1.41 --- Log message: Remove support for the MultiObject flag, which was fundamentally broken --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.100 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.101 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.100 Thu Jun 19 16:15:11 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Sat Jun 21 22:03:52 2003 @@ -68,12 +68,6 @@ Ty == Type::VoidTy && (Size == 0 || (NodeType & DSNode::Array))) && "Node not OK!"); - - // Check to ensure that the multiobject constraints are met... - unsigned Comp = NodeType & DSNode::Composition; - assert((NodeType & DSNode::MultiObject) || - Comp == 0 || Comp == DSNode::AllocaNode || Comp == DSNode::HeapNode || - Comp == DSNode::GlobalNode || Comp == DSNode::UnknownNode); } /// forwardNode - Mark this node as being obsolete, and all references to it @@ -103,8 +97,6 @@ if (I == Globals.end() || *I != GV) { //assert(GV->getType()->getElementType() == Ty); Globals.insert(I, GV); - if (NodeType & DSNode::Composition) - NodeType |= DSNode::MultiObject; NodeType |= GlobalNode; } } @@ -483,9 +475,6 @@ assert(!CurNodeH.getNode()->isDeadNode()); // Merge the NodeType information... - if ((CurNodeH.getNode()->NodeType & DSNode::Composition) != 0 && - (N->NodeType & DSNode::Composition) != 0) - N->NodeType |= DSNode::MultiObject; // Multiple composition -> multiobject CurNodeH.getNode()->NodeType |= N->NodeType; // Start forwarding to the new node! Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.4 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.5 --- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.4 Thu Jun 19 16:15:11 2003 +++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Sat Jun 21 22:03:52 2003 @@ -96,8 +96,8 @@ // Both point to the same node and same offset, and there is only one // physical memory object represented in the node, return must alias. - if (O1 == O2 && !N1->isMultiObject()) - return MustAlias; // Exactly the same object & offset + //if (O1 == O2 && !N1->isMultiObject()) + // return MustAlias; // Exactly the same object & offset // See if they point to different offsets... if so, we may be able to // determine that they do not alias... Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.52 llvm/lib/Analysis/DataStructure/Printer.cpp:1.53 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.52 Thu Jun 19 16:15:11 2003 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Sat Jun 21 22:03:52 2003 @@ -47,7 +47,6 @@ if (NodeType & DSNode::Incomplete ) OS << "I"; if (NodeType & DSNode::Modified ) OS << "M"; if (NodeType & DSNode::Read ) OS << "R"; - if (NodeType & DSNode::MultiObject) OS << "m"; #ifndef NDEBUG if (NodeType & DSNode::DEAD ) OS << ""; #endif Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.40 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.41 --- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.40 Tue Feb 11 17:11:44 2003 +++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Sat Jun 21 22:03:52 2003 @@ -45,6 +45,7 @@ // has no way to extend the lifetime of the pass, which screws up ds-aa. // void TDDataStructures::releaseMyMemory() { + return; for (hash_map::iterator I = DSInfo.begin(), E = DSInfo.end(); I != E; ++I) delete I->second; From lattner at cs.uiuc.edu Sat Jun 21 22:06:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:06:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h CallGraph.h ConstantsScanner.h DSGraph.h DSGraphTraits.h DSSupport.h DataStructure.h DependenceGraph.h Dominators.h IPModRef.h InstForest.h IntervalIterator.h MemoryDepAnalysis.h PgmDependenceGraph.h Message-ID: <200306220305.WAA09014@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.5 -> 1.6 CallGraph.h updated: 1.27 -> 1.28 ConstantsScanner.h updated: 1.10 -> 1.11 DSGraph.h updated: 1.49 -> 1.50 DSGraphTraits.h updated: 1.15 -> 1.16 DSSupport.h updated: 1.16 -> 1.17 DataStructure.h updated: 1.63 -> 1.64 DependenceGraph.h updated: 1.4 -> 1.5 Dominators.h updated: 1.33 -> 1.34 IPModRef.h updated: 1.10 -> 1.11 InstForest.h updated: 1.17 -> 1.18 IntervalIterator.h updated: 1.11 -> 1.12 MemoryDepAnalysis.h updated: 1.2 -> 1.3 PgmDependenceGraph.h updated: 1.2 -> 1.3 --- Log message: Remove a ton of extraneous #includes --- Diffs of the changes: Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.5 llvm/include/llvm/Analysis/AliasSetTracker.h:1.6 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.5 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Sat Jun 21 22:05:45 2003 @@ -10,8 +10,6 @@ #ifndef LLVM_ANALYSIS_ALIASSETTRACKER_H #define LLVM_ANALYSIS_ALIASSETTRACKER_H -#include - #include "llvm/Support/CallSite.h" #include "Support/iterator" #include "Support/hash_map" Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.27 llvm/include/llvm/Analysis/CallGraph.h:1.28 --- llvm/include/llvm/Analysis/CallGraph.h:1.27 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/CallGraph.h Sat Jun 21 22:05:45 2003 @@ -41,8 +41,6 @@ #ifndef LLVM_ANALYSIS_CALLGRAPH_H #define LLVM_ANALYSIS_CALLGRAPH_H -#include - #include "Support/GraphTraits.h" #include "Support/STLExtras.h" #include "llvm/Pass.h" Index: llvm/include/llvm/Analysis/ConstantsScanner.h diff -u llvm/include/llvm/Analysis/ConstantsScanner.h:1.10 llvm/include/llvm/Analysis/ConstantsScanner.h:1.11 --- llvm/include/llvm/Analysis/ConstantsScanner.h:1.10 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/ConstantsScanner.h Sat Jun 21 22:05:45 2003 @@ -9,8 +9,6 @@ #ifndef LLVM_ANALYSIS_CONSTANTSSCANNER_H #define LLVM_ANALYSIS_CONSTANTSSCANNER_H -#include - #include "llvm/Support/InstIterator.h" #include "llvm/Instruction.h" #include "Support/iterator" Index: llvm/include/llvm/Analysis/DSGraph.h diff -u llvm/include/llvm/Analysis/DSGraph.h:1.49 llvm/include/llvm/Analysis/DSGraph.h:1.50 --- llvm/include/llvm/Analysis/DSGraph.h:1.49 Thu Jun 19 16:14:22 2003 +++ llvm/include/llvm/Analysis/DSGraph.h Sat Jun 21 22:05:45 2003 @@ -7,8 +7,6 @@ #ifndef LLVM_ANALYSIS_DSGRAPH_H #define LLVM_ANALYSIS_DSGRAPH_H -#include - #include "llvm/Analysis/DSNode.h" //===----------------------------------------------------------------------===// Index: llvm/include/llvm/Analysis/DSGraphTraits.h diff -u llvm/include/llvm/Analysis/DSGraphTraits.h:1.15 llvm/include/llvm/Analysis/DSGraphTraits.h:1.16 --- llvm/include/llvm/Analysis/DSGraphTraits.h:1.15 Thu Jun 19 16:14:22 2003 +++ llvm/include/llvm/Analysis/DSGraphTraits.h Sat Jun 21 22:05:45 2003 @@ -9,8 +9,6 @@ #ifndef LLVM_ANALYSIS_DSGRAPHTRAITS_H #define LLVM_ANALYSIS_DSGRAPHTRAITS_H -#include - #include "llvm/Analysis/DSGraph.h" #include "Support/GraphTraits.h" #include "Support/iterator" Index: llvm/include/llvm/Analysis/DSSupport.h diff -u llvm/include/llvm/Analysis/DSSupport.h:1.16 llvm/include/llvm/Analysis/DSSupport.h:1.17 --- llvm/include/llvm/Analysis/DSSupport.h:1.16 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/DSSupport.h Sat Jun 21 22:05:45 2003 @@ -7,11 +7,10 @@ #ifndef LLVM_ANALYSIS_DSSUPPORT_H #define LLVM_ANALYSIS_DSSUPPORT_H -#include - #include #include #include +#include #include "Support/HashExtras.h" #include "Support/hash_set" Index: llvm/include/llvm/Analysis/DataStructure.h diff -u llvm/include/llvm/Analysis/DataStructure.h:1.63 llvm/include/llvm/Analysis/DataStructure.h:1.64 --- llvm/include/llvm/Analysis/DataStructure.h:1.63 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/DataStructure.h Sat Jun 21 22:05:45 2003 @@ -7,8 +7,6 @@ #ifndef LLVM_ANALYSIS_DATA_STRUCTURE_H #define LLVM_ANALYSIS_DATA_STRUCTURE_H -#include - #include "llvm/Pass.h" #include "Support/HashExtras.h" #include "Support/hash_set" Index: llvm/include/llvm/Analysis/DependenceGraph.h diff -u llvm/include/llvm/Analysis/DependenceGraph.h:1.4 llvm/include/llvm/Analysis/DependenceGraph.h:1.5 --- llvm/include/llvm/Analysis/DependenceGraph.h:1.4 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/DependenceGraph.h Sat Jun 21 22:05:45 2003 @@ -14,7 +14,6 @@ // //===----------------------------------------------------------------------===// - #ifndef LLVM_ANALYSIS_DEPENDENCEGRAPH_H #define LLVM_ANALYSIS_DEPENDENCEGRAPH_H @@ -22,7 +21,6 @@ #include #include #include - #include class Instruction; Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.33 llvm/include/llvm/Analysis/Dominators.h:1.34 --- llvm/include/llvm/Analysis/Dominators.h:1.33 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/Dominators.h Sat Jun 21 22:05:45 2003 @@ -20,7 +20,6 @@ #include "llvm/Pass.h" #include -#include class Instruction; template struct GraphTraits; Index: llvm/include/llvm/Analysis/IPModRef.h diff -u llvm/include/llvm/Analysis/IPModRef.h:1.10 llvm/include/llvm/Analysis/IPModRef.h:1.11 --- llvm/include/llvm/Analysis/IPModRef.h:1.10 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/IPModRef.h Sat Jun 21 22:05:45 2003 @@ -39,8 +39,6 @@ #ifndef LLVM_ANALYSIS_IPMODREF_H #define LLVM_ANALYSIS_IPMODREF_H -#include - #include "llvm/Pass.h" #include "Support/BitSetVector.h" #include "Support/hash_map" Index: llvm/include/llvm/Analysis/InstForest.h diff -u llvm/include/llvm/Analysis/InstForest.h:1.17 llvm/include/llvm/Analysis/InstForest.h:1.18 --- llvm/include/llvm/Analysis/InstForest.h:1.17 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/InstForest.h Sat Jun 21 22:05:45 2003 @@ -14,12 +14,9 @@ #ifndef LLVM_ANALYSIS_INSTFOREST_H #define LLVM_ANALYSIS_INSTFOREST_H -#include "llvm/Instruction.h" -#include "llvm/BasicBlock.h" #include "llvm/Function.h" #include "Support/Tree.h" #include -#include template class InstTreeNode; template class InstForest; Index: llvm/include/llvm/Analysis/IntervalIterator.h diff -u llvm/include/llvm/Analysis/IntervalIterator.h:1.11 llvm/include/llvm/Analysis/IntervalIterator.h:1.12 --- llvm/include/llvm/Analysis/IntervalIterator.h:1.11 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/IntervalIterator.h Sat Jun 21 22:05:45 2003 @@ -28,12 +28,10 @@ #include "llvm/Analysis/IntervalPartition.h" #include "llvm/Function.h" -#include "llvm/BasicBlock.h" #include "llvm/Support/CFG.h" #include #include #include -#include // getNodeHeader - Given a source graph node and the source graph, return the // BasicBlock that is the header node. This is the opposite of Index: llvm/include/llvm/Analysis/MemoryDepAnalysis.h diff -u llvm/include/llvm/Analysis/MemoryDepAnalysis.h:1.2 llvm/include/llvm/Analysis/MemoryDepAnalysis.h:1.3 --- llvm/include/llvm/Analysis/MemoryDepAnalysis.h:1.2 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/MemoryDepAnalysis.h Sat Jun 21 22:05:45 2003 @@ -7,6 +7,7 @@ // // The result of this pass is a DependenceGraph for each function // representing the memory-based data dependences between instructions. +// //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_MEMORYDEPANALYSIS_H @@ -17,16 +18,10 @@ #include "llvm/Analysis/DataStructure.h" #include "llvm/Pass.h" #include "Support/TarjanSCCIterator.h" -#include "Support/NonCopyable.h" #include "Support/hash_map" -#include - class Instruction; -class Function; -class DSGraph; class ModRefTable; - ///--------------------------------------------------------------------------- /// class MemoryDepGraph: Index: llvm/include/llvm/Analysis/PgmDependenceGraph.h diff -u llvm/include/llvm/Analysis/PgmDependenceGraph.h:1.2 llvm/include/llvm/Analysis/PgmDependenceGraph.h:1.3 --- llvm/include/llvm/Analysis/PgmDependenceGraph.h:1.2 Wed Jun 11 09:01:29 2003 +++ llvm/include/llvm/Analysis/PgmDependenceGraph.h Sat Jun 21 22:05:45 2003 @@ -26,6 +26,7 @@ // // class PgmDependenceGraph -- Interface to obtain PDGIterators for each // instruction. +// //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_PGMDEPENDENCEGRAPH_H @@ -35,15 +36,9 @@ #include "llvm/Analysis/MemoryDepAnalysis.h" /* #include "llvm/Analysis/PostDominators.h" -- see below */ #include "llvm/Instruction.h" -#include "llvm/Value.h" #include "llvm/Pass.h" -#include "Support/NonCopyable.h" #include -#include - -class Instruction; -class Function; class DSGraph; class DependenceGraph; class PgmDependenceGraph; From lattner at cs.uiuc.edu Sat Jun 21 22:06:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:06:07 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSNode.h Message-ID: <200306220305.WAA08313@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSNode.h updated: 1.26 -> 1.27 --- Log message: Whoops, accidentally lost a #include --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSNode.h diff -u llvm/include/llvm/Analysis/DSNode.h:1.26 llvm/include/llvm/Analysis/DSNode.h:1.27 --- llvm/include/llvm/Analysis/DSNode.h:1.26 Sat Jun 21 22:03:24 2003 +++ llvm/include/llvm/Analysis/DSNode.h Sat Jun 21 22:04:58 2003 @@ -7,6 +7,8 @@ #ifndef LLVM_ANALYSIS_DSNODE_H #define LLVM_ANALYSIS_DSNODE_H +#include "llvm/Analysis/DSSupport.h" + template class DSNodeIterator; // Data structure graph traversal iterator From lattner at cs.uiuc.edu Sat Jun 21 22:07:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:07:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h TargetSchedInfo.h Message-ID: <200306220306.WAA09329@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.16 -> 1.17 TargetSchedInfo.h updated: 1.17 -> 1.18 --- Log message: Remove a ton of extraneous #includes --- Diffs of the changes: Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.16 llvm/include/llvm/Target/MRegisterInfo.h:1.17 --- llvm/include/llvm/Target/MRegisterInfo.h:1.16 Sun Jan 12 18:19:44 2003 +++ llvm/include/llvm/Target/MRegisterInfo.h Sat Jun 21 22:06:38 2003 @@ -10,7 +10,6 @@ #define LLVM_TARGET_MREGISTERINFO_H #include "llvm/CodeGen/MachineBasicBlock.h" -#include class Type; class MachineFunction; Index: llvm/include/llvm/Target/TargetSchedInfo.h diff -u llvm/include/llvm/Target/TargetSchedInfo.h:1.17 llvm/include/llvm/Target/TargetSchedInfo.h:1.18 --- llvm/include/llvm/Target/TargetSchedInfo.h:1.17 Wed Jun 11 09:01:36 2003 +++ llvm/include/llvm/Target/TargetSchedInfo.h Sat Jun 21 22:06:38 2003 @@ -10,7 +10,6 @@ #include "llvm/Target/TargetInstrInfo.h" #include "Support/hash_map" #include -#include typedef long long cycles_t; static const cycles_t HUGE_LATENCY = ~((long long) 1 << (sizeof(cycles_t)-2)); From lattner at cs.uiuc.edu Sat Jun 21 22:07:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:07:08 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/IGNode.h InstrForest.h InstrSelection.h LiveRange.h LiveVariables.h MachineCodeForInstruction.h MachineInstr.h MachineInstrAnnot.h SSARegMap.h Message-ID: <200306220306.WAA09264@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: IGNode.h updated: 1.12 -> 1.13 InstrForest.h updated: 1.26 -> 1.27 InstrSelection.h updated: 1.23 -> 1.24 LiveRange.h updated: 1.19 -> 1.20 LiveVariables.h updated: 1.5 -> 1.6 MachineCodeForInstruction.h updated: 1.9 -> 1.10 MachineInstr.h updated: 1.103 -> 1.104 MachineInstrAnnot.h updated: 1.9 -> 1.10 SSARegMap.h updated: 1.4 -> 1.5 --- Log message: Remove a ton of extraneous #includes --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/IGNode.h diff -u llvm/include/llvm/CodeGen/IGNode.h:1.12 llvm/include/llvm/CodeGen/IGNode.h:1.13 --- llvm/include/llvm/CodeGen/IGNode.h:1.12 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/IGNode.h Sat Jun 21 22:06:13 2003 @@ -26,7 +26,6 @@ #define IG_NODE_H #include "llvm/CodeGen/LiveRange.h" -#include class RegClass; //---------------------------------------------------------------------------- Index: llvm/include/llvm/CodeGen/InstrForest.h diff -u llvm/include/llvm/CodeGen/InstrForest.h:1.26 llvm/include/llvm/CodeGen/InstrForest.h:1.27 --- llvm/include/llvm/CodeGen/InstrForest.h:1.26 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/InstrForest.h Sat Jun 21 22:06:13 2003 @@ -21,10 +21,8 @@ #include "llvm/Instruction.h" #include "Support/HashExtras.h" -#include class Constant; -class BasicBlock; class Function; class InstrTreeNode; class InstrForest; Index: llvm/include/llvm/CodeGen/InstrSelection.h diff -u llvm/include/llvm/CodeGen/InstrSelection.h:1.23 llvm/include/llvm/CodeGen/InstrSelection.h:1.24 --- llvm/include/llvm/CodeGen/InstrSelection.h:1.23 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/InstrSelection.h Sat Jun 21 22:06:13 2003 @@ -8,7 +8,6 @@ #define LLVM_CODEGEN_INSTR_SELECTION_H #include "llvm/Instruction.h" -#include class Function; class InstrForest; class MachineInstr; Index: llvm/include/llvm/CodeGen/LiveRange.h diff -u llvm/include/llvm/CodeGen/LiveRange.h:1.19 llvm/include/llvm/CodeGen/LiveRange.h:1.20 --- llvm/include/llvm/CodeGen/LiveRange.h:1.19 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/LiveRange.h Sat Jun 21 22:06:13 2003 @@ -1,4 +1,4 @@ -//===-- LiveRange.h - Store info about a live range --------------*- C++ -*--=// +//===-- LiveRange.h - Store info about a live range -------------*- C++ -*-===// // // Implements a live range using a ValueSet. A LiveRange is a simple set // of Values. @@ -14,11 +14,8 @@ #include "llvm/CodeGen/ValueSet.h" #include "llvm/Value.h" -#include - class RegClass; class IGNode; -class Type; class LiveRange : public ValueSet { RegClass *MyRegClass; // register classs (e.g., int, FP) for this LR Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.5 llvm/include/llvm/CodeGen/LiveVariables.h:1.6 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.5 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/LiveVariables.h Sat Jun 21 22:06:13 2003 @@ -24,7 +24,6 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include -#include class MRegisterInfo; Index: llvm/include/llvm/CodeGen/MachineCodeForInstruction.h diff -u llvm/include/llvm/CodeGen/MachineCodeForInstruction.h:1.9 llvm/include/llvm/CodeGen/MachineCodeForInstruction.h:1.10 --- llvm/include/llvm/CodeGen/MachineCodeForInstruction.h:1.9 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/MachineCodeForInstruction.h Sat Jun 21 22:06:13 2003 @@ -20,7 +20,6 @@ #include "Support/Annotation.h" #include -#include class MachineInstr; class Instruction; Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.103 llvm/include/llvm/CodeGen/MachineInstr.h:1.104 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.103 Wed Jun 11 09:01:30 2003 +++ llvm/include/llvm/CodeGen/MachineInstr.h Sat Jun 21 22:06:13 2003 @@ -13,7 +13,6 @@ #include "Support/Annotation.h" #include "Support/iterator" #include -#include class Value; class Function; Index: llvm/include/llvm/CodeGen/MachineInstrAnnot.h diff -u llvm/include/llvm/CodeGen/MachineInstrAnnot.h:1.9 llvm/include/llvm/CodeGen/MachineInstrAnnot.h:1.10 --- llvm/include/llvm/CodeGen/MachineInstrAnnot.h:1.9 Wed Jun 11 09:01:31 2003 +++ llvm/include/llvm/CodeGen/MachineInstrAnnot.h Sat Jun 21 22:06:13 2003 @@ -10,8 +10,6 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Target/TargetRegInfo.h" -#include - class Value; class TmpInstruction; class CallInst; Index: llvm/include/llvm/CodeGen/SSARegMap.h diff -u llvm/include/llvm/CodeGen/SSARegMap.h:1.4 llvm/include/llvm/CodeGen/SSARegMap.h:1.5 --- llvm/include/llvm/CodeGen/SSARegMap.h:1.4 Wed Jun 11 09:01:31 2003 +++ llvm/include/llvm/CodeGen/SSARegMap.h Sat Jun 21 22:06:13 2003 @@ -11,9 +11,6 @@ #define LLVM_CODEGEN_SSAREGMAP_H #include "llvm/Target/MRegisterInfo.h" - -#include - class TargetRegisterClass; class SSARegMap { From lattner at cs.uiuc.edu Sat Jun 21 22:08:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:08:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CFG.h InstVisitor.h PassNameParser.h Message-ID: <200306220307.WAA09511@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CFG.h updated: 1.11 -> 1.12 InstVisitor.h updated: 1.17 -> 1.18 PassNameParser.h updated: 1.6 -> 1.7 --- Log message: Remove a ton of extraneous #includes --- Diffs of the changes: Index: llvm/include/llvm/Support/CFG.h diff -u llvm/include/llvm/Support/CFG.h:1.11 llvm/include/llvm/Support/CFG.h:1.12 --- llvm/include/llvm/Support/CFG.h:1.11 Wed Jun 11 09:01:35 2003 +++ llvm/include/llvm/Support/CFG.h Sat Jun 21 22:07:01 2003 @@ -13,8 +13,6 @@ #include "llvm/InstrTypes.h" #include "Support/iterator" -#include - //===--------------------------------------------------------------------===// // BasicBlock pred_iterator definition //===--------------------------------------------------------------------===// Index: llvm/include/llvm/Support/InstVisitor.h diff -u llvm/include/llvm/Support/InstVisitor.h:1.17 llvm/include/llvm/Support/InstVisitor.h:1.18 --- llvm/include/llvm/Support/InstVisitor.h:1.17 Wed Jun 11 09:01:35 2003 +++ llvm/include/llvm/Support/InstVisitor.h Sat Jun 21 22:07:01 2003 @@ -44,7 +44,6 @@ #define LLVM_SUPPORT_INSTVISITOR_H #include "llvm/Instruction.h" -#include class Module; Index: llvm/include/llvm/Support/PassNameParser.h diff -u llvm/include/llvm/Support/PassNameParser.h:1.6 llvm/include/llvm/Support/PassNameParser.h:1.7 --- llvm/include/llvm/Support/PassNameParser.h:1.6 Wed Jun 11 09:01:35 2003 +++ llvm/include/llvm/Support/PassNameParser.h Sat Jun 21 22:07:01 2003 @@ -20,7 +20,6 @@ #include "llvm/Pass.h" #include #include -#include //===----------------------------------------------------------------------===// // PassNameParser class - Make use of the pass registration mechanism to From lattner at cs.uiuc.edu Sat Jun 21 22:08:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:08:07 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Constant.h ConstantHandling.h Constants.h DerivedTypes.h GlobalVariable.h Instruction.h Pass.h PassAnalysisSupport.h PassSupport.h SymbolTable.h User.h iOther.h iPHINode.h iTerminators.h Message-ID: <200306220307.WAA09590@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constant.h updated: 1.7 -> 1.8 ConstantHandling.h updated: 1.26 -> 1.27 Constants.h updated: 1.26 -> 1.27 DerivedTypes.h updated: 1.30 -> 1.31 GlobalVariable.h updated: 1.20 -> 1.21 Instruction.h updated: 1.40 -> 1.41 Pass.h updated: 1.33 -> 1.34 PassAnalysisSupport.h updated: 1.12 -> 1.13 PassSupport.h updated: 1.12 -> 1.13 SymbolTable.h updated: 1.21 -> 1.22 User.h updated: 1.19 -> 1.20 iOther.h updated: 1.35 -> 1.36 iPHINode.h updated: 1.9 -> 1.10 iTerminators.h updated: 1.28 -> 1.29 --- Log message: Remove a ton of extraneous #includes --- Diffs of the changes: Index: llvm/include/llvm/Constant.h diff -u llvm/include/llvm/Constant.h:1.7 llvm/include/llvm/Constant.h:1.8 --- llvm/include/llvm/Constant.h:1.7 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/Constant.h Sat Jun 21 22:07:32 2003 @@ -7,7 +7,6 @@ #ifndef LLVM_CONSTANT_H #define LLVM_CONSTANT_H -#include #include "llvm/User.h" class Constant : public User { Index: llvm/include/llvm/ConstantHandling.h diff -u llvm/include/llvm/ConstantHandling.h:1.26 llvm/include/llvm/ConstantHandling.h:1.27 --- llvm/include/llvm/ConstantHandling.h:1.26 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/ConstantHandling.h Sat Jun 21 22:07:32 2003 @@ -33,8 +33,6 @@ #ifndef LLVM_CONSTANTHANDLING_H #define LLVM_CONSTANTHANDLING_H -#include - #include "llvm/Constants.h" #include "llvm/Type.h" class PointerType; Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.26 llvm/include/llvm/Constants.h:1.27 --- llvm/include/llvm/Constants.h:1.26 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/Constants.h Sat Jun 21 22:07:32 2003 @@ -8,8 +8,6 @@ #ifndef LLVM_CONSTANTS_H #define LLVM_CONSTANTS_H -#include - #include "llvm/Constant.h" #include "Support/DataTypes.h" Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.30 llvm/include/llvm/DerivedTypes.h:1.31 --- llvm/include/llvm/DerivedTypes.h:1.30 Wed Jun 18 14:22:36 2003 +++ llvm/include/llvm/DerivedTypes.h Sat Jun 21 22:07:32 2003 @@ -11,8 +11,6 @@ #ifndef LLVM_DERIVED_TYPES_H #define LLVM_DERIVED_TYPES_H -#include - #include "llvm/Type.h" class DerivedType : public Type { Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.20 llvm/include/llvm/GlobalVariable.h:1.21 --- llvm/include/llvm/GlobalVariable.h:1.20 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/GlobalVariable.h Sat Jun 21 22:07:32 2003 @@ -13,8 +13,6 @@ #ifndef LLVM_GLOBAL_VARIABLE_H #define LLVM_GLOBAL_VARIABLE_H -#include - #include "llvm/GlobalValue.h" class Module; class Constant; Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.40 llvm/include/llvm/Instruction.h:1.41 --- llvm/include/llvm/Instruction.h:1.40 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/Instruction.h Sat Jun 21 22:07:32 2003 @@ -8,8 +8,6 @@ #ifndef LLVM_INSTRUCTION_H #define LLVM_INSTRUCTION_H -#include - #include "llvm/User.h" template struct ilist_traits; template - #include #include #include Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.12 llvm/include/llvm/PassAnalysisSupport.h:1.13 --- llvm/include/llvm/PassAnalysisSupport.h:1.12 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/PassAnalysisSupport.h Sat Jun 21 22:07:32 2003 @@ -14,8 +14,6 @@ // No need to include Pass.h, we are being included by it! -#include - //===----------------------------------------------------------------------===// // AnalysisUsage - Represent the analysis usage information of a pass. This // tracks analyses that the pass REQUIRES (must available when the pass runs), Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.12 llvm/include/llvm/PassSupport.h:1.13 --- llvm/include/llvm/PassSupport.h:1.12 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/PassSupport.h Sat Jun 21 22:07:32 2003 @@ -14,8 +14,6 @@ #ifndef LLVM_PASS_SUPPORT_H #define LLVM_PASS_SUPPORT_H -#include - // No need to include Pass.h, we are being included by it! class TargetMachine; Index: llvm/include/llvm/SymbolTable.h diff -u llvm/include/llvm/SymbolTable.h:1.21 llvm/include/llvm/SymbolTable.h:1.22 --- llvm/include/llvm/SymbolTable.h:1.21 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/SymbolTable.h Sat Jun 21 22:07:32 2003 @@ -16,8 +16,6 @@ #ifndef LLVM_SYMBOL_TABLE_H #define LLVM_SYMBOL_TABLE_H -#include - #include "llvm/Value.h" #include Index: llvm/include/llvm/User.h diff -u llvm/include/llvm/User.h:1.19 llvm/include/llvm/User.h:1.20 --- llvm/include/llvm/User.h:1.19 Tue Jun 17 17:15:55 2003 +++ llvm/include/llvm/User.h Sat Jun 21 22:07:32 2003 @@ -12,8 +12,6 @@ #ifndef LLVM_USER_H #define LLVM_USER_H -#include - #include "llvm/Value.h" class User : public Value { Index: llvm/include/llvm/iOther.h diff -u llvm/include/llvm/iOther.h:1.35 llvm/include/llvm/iOther.h:1.36 --- llvm/include/llvm/iOther.h:1.35 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/iOther.h Sat Jun 21 22:07:32 2003 @@ -8,8 +8,6 @@ #ifndef LLVM_IOTHER_H #define LLVM_IOTHER_H -#include - #include "llvm/InstrTypes.h" //===----------------------------------------------------------------------===// Index: llvm/include/llvm/iPHINode.h diff -u llvm/include/llvm/iPHINode.h:1.9 llvm/include/llvm/iPHINode.h:1.10 --- llvm/include/llvm/iPHINode.h:1.9 Wed Jun 11 09:01:26 2003 +++ llvm/include/llvm/iPHINode.h Sat Jun 21 22:07:32 2003 @@ -7,8 +7,6 @@ #ifndef LLVM_IPHINODE_H #define LLVM_IPHINODE_H -#include - #include "llvm/Instruction.h" class BasicBlock; Index: llvm/include/llvm/iTerminators.h diff -u llvm/include/llvm/iTerminators.h:1.28 llvm/include/llvm/iTerminators.h:1.29 --- llvm/include/llvm/iTerminators.h:1.28 Thu Jun 19 12:03:00 2003 +++ llvm/include/llvm/iTerminators.h Sat Jun 21 22:07:32 2003 @@ -9,8 +9,6 @@ #ifndef LLVM_ITERMINATORS_H #define LLVM_ITERMINATORS_H -#include - #include "llvm/InstrTypes.h" //===--------------------------------------------------------------------------- From lattner at cs.uiuc.edu Sat Jun 21 22:09:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:09:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Timer.h Tree.h TarjanSCCIterator.h CommandLine.h Message-ID: <200306220308.WAA10126@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: Timer.h updated: 1.6 -> 1.7 Tree.h updated: 1.4 -> 1.5 TarjanSCCIterator.h updated: 1.6 -> 1.7 CommandLine.h updated: 1.13 -> 1.14 --- Log message: Remove a ton of extraneous #includes --- Diffs of the changes: Index: llvm/include/Support/Timer.h diff -u llvm/include/Support/Timer.h:1.6 llvm/include/Support/Timer.h:1.7 --- llvm/include/Support/Timer.h:1.6 Wed Jun 11 09:01:21 2003 +++ llvm/include/Support/Timer.h Sat Jun 21 22:08:05 2003 @@ -28,7 +28,6 @@ #include #include #include - #include class TimerGroup; @@ -64,7 +63,7 @@ PeakMemBase = T.PeakMemBase; Name = T.Name; Started = T.Started; - assert (TG == T.TG && "Can only assign timers in the same TimerGroup!"); + assert(TG == T.TG && "Can only assign timers in the same TimerGroup!"); return *this; } Index: llvm/include/Support/Tree.h diff -u llvm/include/Support/Tree.h:1.4 llvm/include/Support/Tree.h:1.5 --- llvm/include/Support/Tree.h:1.4 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/Tree.h Sat Jun 21 22:08:05 2003 @@ -9,7 +9,6 @@ #define SUPPORT_TREE_H #include - #include template Index: llvm/include/Support/TarjanSCCIterator.h diff -u llvm/include/Support/TarjanSCCIterator.h:1.6 llvm/include/Support/TarjanSCCIterator.h:1.7 --- llvm/include/Support/TarjanSCCIterator.h:1.6 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/TarjanSCCIterator.h Sat Jun 21 22:08:05 2003 @@ -1,4 +1,4 @@ -//===-- Support/TarjanSCCIterator.h -Generic Tarjan SCC iterator -*- C++ -*--=// +//===-- Support/TarjanSCCIterator.h - Tarjan SCC iterator -------*- C++ -*-===// // // This builds on the Support/GraphTraits.h file to find the strongly // connected components (SCCs) of a graph in O(N+E) time using @@ -9,18 +9,18 @@ // // To visit S1 *before* S2, use the TarjanSCCIterator on the Inverse graph. // (NOTE: This requires some simple wrappers and is not supported yet.) +// //===----------------------------------------------------------------------===// #ifndef SUPPORT_TARJANSCCITERATOR_H #define SUPPORT_TARJANSCCITERATOR_H #include "Support/GraphTraits.h" -#include -#include +#include "Support/Statistic.h" +#include "Support/iterator" #include #include #include - #include //-------------------------------------------------------------------------- Index: llvm/include/Support/CommandLine.h diff -u llvm/include/Support/CommandLine.h:1.13 llvm/include/Support/CommandLine.h:1.14 --- llvm/include/Support/CommandLine.h:1.13 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/CommandLine.h Sat Jun 21 22:08:05 2003 @@ -18,7 +18,6 @@ #include #include #include "boost/type_traits/object_traits.hpp" - #include /// cl Namespace - This namespace contains all of the command line option From lattner at cs.uiuc.edu Sat Jun 21 22:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:10:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/BitSetVector.h Message-ID: <200306220309.WAA10851@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: BitSetVector.h updated: 1.6 -> 1.7 --- Log message: Get rid of WORDSIZE macro which can pollute untold numbers of translation units --- Diffs of the changes: Index: llvm/include/Support/BitSetVector.h diff -u llvm/include/Support/BitSetVector.h:1.6 llvm/include/Support/BitSetVector.h:1.7 --- llvm/include/Support/BitSetVector.h:1.6 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/BitSetVector.h Sat Jun 21 22:09:10 2003 @@ -9,12 +9,6 @@ // We therefore use a vector of bitsets. The maxmimum size of our sets // (i.e., the size of the universal set) can be chosen at creation time. // -// The size of each Bitset is defined by the macro WORDSIZE. -// -// NOTE: The WORDSIZE macro should be made machine-dependent, in order to use -// 64-bit words or whatever gives most efficient Bitsets on each platform. -// -// // External functions: // // bool Disjoint(const BitSetVector& set1, const BitSetVector& set2): @@ -30,15 +24,13 @@ #include #include #include - #include -#define WORDSIZE (32U) - - class BitSetVector { + enum { BITSET_WORDSIZE = sizeof(long)*8 }; + // Types used internal to the representation - typedef std::bitset bitword; + typedef std::bitset bitword; typedef bitword::reference reference; class iterator; @@ -48,11 +40,13 @@ private: // Utility functions for the representation - static unsigned NumWords(unsigned Size) { return (Size+WORDSIZE-1)/WORDSIZE;} - static unsigned LastWordSize(unsigned Size) { return Size % WORDSIZE; } + static unsigned NumWords(unsigned Size) { + return (Size+BITSET_WORDSIZE-1)/BITSET_WORDSIZE; + } + static unsigned LastWordSize(unsigned Size) { return Size % BITSET_WORDSIZE; } // Clear the unused bits in the last word. - // The unused bits are the high (WORDSIZE - LastWordSize()) bits + // The unused bits are the high (BITSET_WORDSIZE - LastWordSize()) bits void ClearUnusedBits() { unsigned long usedBits = (1U << LastWordSize(size())) - 1; bitsetVec.back() &= bitword(usedBits); @@ -91,7 +85,7 @@ } reference operator[](unsigned n) { assert(n < size() && "BitSetVector: Bit number out of range"); - unsigned ndiv = n / WORDSIZE, nmod = n % WORDSIZE; + unsigned ndiv = n / BITSET_WORDSIZE, nmod = n % BITSET_WORDSIZE; return bitsetVec[ndiv][nmod]; } iterator begin() { return iterator::begin(*this); } @@ -116,7 +110,7 @@ /// bool test(unsigned n) const { assert(n < size() && "BitSetVector: Bit number out of range"); - unsigned ndiv = n / WORDSIZE, nmod = n % WORDSIZE; + unsigned ndiv = n / BITSET_WORDSIZE, nmod = n % BITSET_WORDSIZE; return bitsetVec[ndiv].test(nmod); } bool any() const { @@ -203,13 +197,13 @@ // Increment and decrement operators (pre and post) iterator& operator++() { - if (++currentBit == WORDSIZE) + if (++currentBit == BITSET_WORDSIZE) { currentBit = 0; if (currentWord < bitvec->size()) ++currentWord; } return *this; } iterator& operator--() { if (currentBit == 0) { - currentBit = WORDSIZE-1; + currentBit = BITSET_WORDSIZE-1; currentWord = (currentWord == 0)? bitvec->size() : --currentWord; } else From lattner at cs.uiuc.edu Sat Jun 21 22:32:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Jun 21 22:32:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp Message-ID: <200306220331.WAA13689@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.109 -> 1.110 --- Log message: Do not use the inefficient, fixed function, CBW, CDQ, ... instructions --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.109 llvm/lib/Target/X86/InstSelectSimple.cpp:1.110 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.109 Sat Jun 21 13:15:27 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sat Jun 21 22:31:18 2003 @@ -1179,7 +1179,7 @@ static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX }; static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 }; - static const unsigned ExtOpcode[]={ X86::CBW , X86::CWD , X86::CDQ }; + static const unsigned SarOpcode[]={ X86::SARir8, X86::SARir16, X86::SARir32 }; static const unsigned ClrOpcode[]={ X86::XORrr8, X86::XORrr16, X86::XORrr32 }; static const unsigned ExtRegs[] ={ X86::AH , X86::DX , X86::EDX }; @@ -1197,7 +1197,9 @@ if (isSigned) { // Emit a sign extension instruction... - BuildMI(BB, ExtOpcode[Class], 0); + unsigned ShiftResult = makeAnotherReg(I.getType()); + BuildMI(BB, SarOpcode[Class], 2, ShiftResult).addReg(Op0Reg).addZImm(31); + BuildMI(BB, MovOpcode[Class], 1, ExtReg).addReg(ShiftResult); } else { // If unsigned, emit a zeroing instruction... (reg = xor reg, reg) BuildMI(BB, ClrOpcode[Class], 2, ExtReg).addReg(ExtReg).addReg(ExtReg); From lattner at cs.uiuc.edu Sun Jun 22 11:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 11:29:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/DiffOutput.sh Message-ID: <200306221628.LAA29305@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: DiffOutput.sh updated: 1.10 -> 1.11 --- Log message: Use the "fast" method of diffing so we don't get out-of-memory errors when diffing 'crafty' output. --- Diffs of the changes: Index: llvm/test/Programs/DiffOutput.sh diff -u llvm/test/Programs/DiffOutput.sh:1.10 llvm/test/Programs/DiffOutput.sh:1.11 --- llvm/test/Programs/DiffOutput.sh:1.10 Tue Jun 3 21:39:26 2003 +++ llvm/test/Programs/DiffOutput.sh Sun Jun 22 11:28:34 2003 @@ -20,7 +20,7 @@ fi # Diff the two files. -$DIFF -C 2 Output/$2.out-nat Output/$2.out-$1 > $DIFFOUTPUT || ( +$DIFF -C 2 --speed-large-files Output/$2.out-nat Output/$2.out-$1 > $DIFFOUTPUT || ( # They are different! echo "******************** TEST '$2' FAILED! ********************" echo "Execution Context Diff:" From lattner at cs.uiuc.edu Sun Jun 22 15:11:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:11:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h Message-ID: <200306222010.PAA17707@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: Scalar.h updated: 1.17 -> 1.18 --- Log message: Add prototype for tail-dup pass --- Diffs of the changes: Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.17 llvm/include/llvm/Transforms/Scalar.h:1.18 --- llvm/include/llvm/Transforms/Scalar.h:1.17 Tue May 27 10:52:45 2003 +++ llvm/include/llvm/Transforms/Scalar.h Sun Jun 22 15:10:42 2003 @@ -177,10 +177,19 @@ //===----------------------------------------------------------------------===// // +// TailDuplication - Eliminate unconditional branches through controlled code +// duplication, creating simpler CFG structures. +// +Pass *createTailDuplicationPass(); + + +//===----------------------------------------------------------------------===// +// // CFG Simplification - Merge basic blocks, eliminate unreachable blocks, // simplify terminator instructions, etc... // Pass *createCFGSimplificationPass(); + //===----------------------------------------------------------------------===// // From lattner at cs.uiuc.edu Sun Jun 22 15:11:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:11:10 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/TailDuplication.cpp Message-ID: <200306222010.PAA17696@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: TailDuplication.cpp added (r1.1) --- Log message: Initial checkin of Tail duplication pass. --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -c /dev/null llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.1 *** /dev/null Sun Jun 22 15:10:38 2003 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp Sun Jun 22 15:10:28 2003 *************** *** 0 **** --- 1,324 ---- + //===- TailDuplication.cpp - Simplify CFG through tail duplication --------===// + // + // This pass performs a limited form of tail duplication, intended to simplify + // CFGs by removing some unconditional branches. This pass is necessary to + // straighten out loops created by the C front-end, but also is capable of + // making other code nicer. After this pass is run, the CFG simplify pass + // should be run to clean up the mess. + // + // This pass could be enhanced in the future to use profile information to be + // more aggressive. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Transforms/Scalar.h" + #include "llvm/Function.h" + #include "llvm/iPHINode.h" + #include "llvm/iTerminators.h" + #include "llvm/Pass.h" + #include "llvm/Type.h" + #include "llvm/Support/CFG.h" + #include "llvm/Transforms/Utils/Local.h" + #include "Support/Statistic.h" + + namespace { + Statistic<> NumEliminated("tailduplicate", + "Number of unconditional branches eliminated"); + Statistic<> NumPHINodes("tailduplicate", "Number of phi nodes inserted"); + + class TailDup : public FunctionPass { + bool runOnFunction(Function &F); + private: + inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); + inline void eliminateUnconditionalBranch(BranchInst *BI); + inline void InsertPHINodesIfNecessary(Instruction *OrigInst, Value *NewInst, + BasicBlock *NewBlock); + inline Value *GetValueInBlock(BasicBlock *BB, Value *OrigVal, + std::map &ValueMap, + std::map &OutValueMap); + inline Value *GetValueOutBlock(BasicBlock *BB, Value *OrigVal, + std::map &ValueMap, + std::map &OutValueMap); + }; + RegisterOpt X("tailduplicate", "Tail Duplication"); + } + + Pass *createTailDuplicationPass() { return new TailDup(); } + + /// runOnFunction - Top level algorithm - Loop over each unconditional branch in + /// the function, eliminating it if it looks attractive enough. + /// + bool TailDup::runOnFunction(Function &F) { + bool Changed = false; + for (Function::iterator I = F.begin(), E = F.end(); I != E; ) + if (shouldEliminateUnconditionalBranch(I->getTerminator())) { + eliminateUnconditionalBranch(cast(I->getTerminator())); + Changed = true; + } else { + ++I; + } + return Changed; + } + + /// shouldEliminateUnconditionalBranch - Return true if this branch looks + /// attractive to eliminate. We eliminate the branch if the destination basic + /// block has <= 5 instructions in it, not counting PHI nodes. In practice, + /// since one of these is a terminator instruction, this means that we will add + /// up to 4 instructions to the new block. + /// + /// We don't count PHI nodes in the count since they will be removed when the + /// contents of the block are copied over. + /// + bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) { + BranchInst *BI = dyn_cast(TI); + if (!BI || !BI->isUnconditional()) return false; // Not an uncond branch! + + BasicBlock *Dest = BI->getSuccessor(0); + if (Dest == BI->getParent()) return false; // Do not loop infinitely! + + // Do not bother working on dead blocks... + pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest); + if (PI == PE && Dest != Dest->getParent()->begin()) + return false; // It's just a dead block, ignore it... + + // Also, do not bother with blocks with only a single predecessor: simplify + // CFG will fold these two blocks together! + ++PI; + if (PI == PE) return false; // Exactly one predecessor! + + BasicBlock::iterator I = Dest->begin(); + while (isa(*I)) ++I; + + for (unsigned Size = 0; I != Dest->end(); ++Size, ++I) + if (Size == 6) return false; // The block is too large... + return true; + } + + + /// eliminateUnconditionalBranch - Clone the instructions from the destination + /// block into the source block, eliminating the specified unconditional branch. + /// If the destination block defines values used by successors of the dest + /// block, we may need to insert PHI nodes. + /// + void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) { + BasicBlock *SourceBlock = Branch->getParent(); + BasicBlock *DestBlock = Branch->getSuccessor(0); + assert(SourceBlock != DestBlock && "Our predicate is broken!"); + + DEBUG(std::cerr << "TailDuplication[" << SourceBlock->getParent()->getName() + << "]: Eliminating branch: " << *Branch); + + // We are going to have to map operands from the original block B to the new + // copy of the block B'. If there are PHI nodes in the DestBlock, these PHI + // nodes also define part of this mapping. Loop over these PHI nodes, adding + // them to our mapping. + std::map ValueMapping; + + BasicBlock::iterator BI = DestBlock->begin(); + bool HadPHINodes = isa(BI); + for (; PHINode *PN = dyn_cast(BI); ++BI) + ValueMapping[PN] = PN->getIncomingValueForBlock(SourceBlock); + + // Clone the non-phi instructions of the dest block into the source block, + // keeping track of the mapping... + // + for (; BI != DestBlock->end(); ++BI) { + Instruction *New = BI->clone(); + New->setName(BI->getName()); + SourceBlock->getInstList().push_back(New); + ValueMapping[BI] = New; + } + + // Now that we have built the mapping information and cloned all of the + // instructions (giving us a new terminator, among other things), walk the new + // instructions, rewriting references of old instructions to use new + // instructions. + // + BI = Branch; ++BI; // Get an iterator to the first new instruction + for (; BI != SourceBlock->end(); ++BI) + for (unsigned i = 0, e = BI->getNumOperands(); i != e; ++i) + if (Value *Remapped = ValueMapping[BI->getOperand(i)]) + BI->setOperand(i, Remapped); + + // Next we check to see if any of the successors of DestBlock had PHI nodes. + // If so, we need to add entries to the PHI nodes for SourceBlock now. + for (succ_iterator SI = succ_begin(DestBlock), SE = succ_end(DestBlock); + SI != SE; ++SI) { + BasicBlock *Succ = *SI; + for (BasicBlock::iterator PNI = Succ->begin(); + PHINode *PN = dyn_cast(PNI); ++PNI) { + // Ok, we have a PHI node. Figure out what the incoming value was for the + // DestBlock. + Value *IV = PN->getIncomingValueForBlock(DestBlock); + + // Remap the value if necessary... + if (Value *MappedIV = ValueMapping[IV]) + IV = MappedIV; + PN->addIncoming(IV, SourceBlock); + } + } + + // Now that all of the instructions are correctly copied into the SourceBlock, + // we have one more minor problem: the successors of the original DestBB may + // use the values computed in DestBB either directly (if DestBB dominated the + // block), or through a PHI node. In either case, we need to insert PHI nodes + // into any successors of DestBB (which are now our successors) for each value + // that is computed in DestBB, but is used outside of it. All of these uses + // we have to rewrite with the new PHI node. + // + if (succ_begin(SourceBlock) != succ_end(SourceBlock)) // Avoid wasting time... + for (BI = DestBlock->begin(); BI != DestBlock->end(); ++BI) + if (BI->getType() != Type::VoidTy) + InsertPHINodesIfNecessary(BI, ValueMapping[BI], SourceBlock); + + // Final step: now that we have finished everything up, walk the cloned + // instructions one last time, constant propagating and DCE'ing them, because + // they may not be needed anymore. + // + BI = Branch; ++BI; // Get an iterator to the first new instruction + if (HadPHINodes) + while (BI != SourceBlock->end()) + if (!dceInstruction(BI) && !doConstantPropagation(BI)) + ++BI; + + DestBlock->removePredecessor(SourceBlock); // Remove entries in PHI nodes... + SourceBlock->getInstList().erase(Branch); // Destroy the uncond branch... + + ++NumEliminated; // We just killed a branch! + } + + /// InsertPHINodesIfNecessary - So at this point, we cloned the OrigInst + /// instruction into the NewBlock with the value of NewInst. If OrigInst was + /// used outside of its defining basic block, we need to insert a PHI nodes into + /// the successors. + /// + void TailDup::InsertPHINodesIfNecessary(Instruction *OrigInst, Value *NewInst, + BasicBlock *NewBlock) { + // Loop over all of the uses of OrigInst, rewriting them to be newly inserted + // PHI nodes, unless they are in the same basic block as OrigInst. + BasicBlock *OrigBlock = OrigInst->getParent(); + std::vector Users; + Users.reserve(OrigInst->use_size()); + for (Value::use_iterator I = OrigInst->use_begin(), E = OrigInst->use_end(); + I != E; ++I) { + Instruction *In = cast(*I); + if (In->getParent() != OrigBlock) // Don't modify uses in the orig block! + Users.push_back(In); + } + + // The common case is that the instruction is only used within the block that + // defines it. If we have this case, quick exit. + // + if (Users.empty()) return; + + // Otherwise, we have a more complex case, handle it now. This requires the + // construction of a mapping between a basic block and the value to use when + // in the scope of that basic block. This map will map to the original and + // new values when in the original or new block, but will map to inserted PHI + // nodes when in other blocks. + // + std::map ValueMap; + std::map OutValueMap; // The outgoing value map + OutValueMap[OrigBlock] = OrigInst; + OutValueMap[NewBlock ] = NewInst; // Seed the initial values... + + DEBUG(std::cerr << " ** Inserting PHI nodes for " << OrigInst); + while (!Users.empty()) { + Instruction *User = Users.back(); Users.pop_back(); + + if (PHINode *PN = dyn_cast(User)) { + // PHI nodes must be handled specially here, because their operands are + // actually defined in predecessor basic blocks, NOT in the block that the + // PHI node lives in. Note that we have already added entries to PHI nods + // which are in blocks that are immediate successors of OrigBlock, so + // don't modify them again. + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) + if (PN->getIncomingValue(i) == OrigInst && + PN->getIncomingBlock(i) != OrigBlock) { + Value *V = GetValueOutBlock(PN->getIncomingBlock(i), OrigInst, + ValueMap, OutValueMap); + PN->setIncomingValue(i, V); + } + + } else { + // Any other user of the instruction can just replace any uses with the + // new value defined in the block it resides in. + Value *V = GetValueInBlock(User->getParent(), OrigInst, ValueMap, + OutValueMap); + User->replaceUsesOfWith(OrigInst, V); + } + } + } + + /// GetValueInBlock - This is a recursive method which inserts PHI nodes into + /// the function until there is a value available in basic block BB. + /// + Value *TailDup::GetValueInBlock(BasicBlock *BB, Value *OrigVal, + std::map &ValueMap, + std::map &OutValueMap) { + Value*& BBVal = ValueMap[BB]; + if (BBVal) return BBVal; // Value already computed for this block? + + assert(pred_begin(BB) != pred_end(BB) && + "Propagating PHI nodes to unreachable blocks?"); + + // If there is no value already available in this basic block, we need to + // either reuse a value from an incoming, dominating, basic block, or we need + // to create a new PHI node to merge in different incoming values. Because we + // don't know if we're part of a loop at this point or not, we create a PHI + // node, even if we will ultimately eliminate it. + PHINode *PN = new PHINode(OrigVal->getType(), OrigVal->getName()+".pn", + BB->begin()); + BBVal = PN; // Insert this into the BBVal slot in case of cycles... + + Value*& BBOutVal = OutValueMap[BB]; + if (BBOutVal == 0) BBOutVal = PN; + + // Now that we have created the PHI node, loop over all of the predecessors of + // this block, computing an incoming value for the predecessor. + std::vector Preds(pred_begin(BB), pred_end(BB)); + for (unsigned i = 0, e = Preds.size(); i != e; ++i) + PN->addIncoming(GetValueOutBlock(Preds[i], OrigVal, ValueMap, OutValueMap), + Preds[i]); + + // The PHI node is complete. In many cases, however the PHI node was + // ultimately unnecessary: we could have just reused a dominating incoming + // value. If this is the case, nuke the PHI node and replace the map entry + // with the dominating value. + // + assert(PN->getNumIncomingValues() > 0 && "No predecessors?"); + + // Check to see if all of the elements in the PHI node are either the PHI node + // itself or ONE particular value. + unsigned i = 0; + Value *ReplVal = PN->getIncomingValue(i); + for (; ReplVal == PN && i != PN->getNumIncomingValues(); ++i) + ReplVal = PN->getIncomingValue(i); // Skip values equal to the PN + + for (; i != PN->getNumIncomingValues(); ++i) + if (PN->getIncomingValue(i) != PN && PN->getIncomingValue(i) != ReplVal) { + ReplVal = 0; + break; + } + + // Found a value to replace the PHI node with? + if (ReplVal) { + PN->replaceAllUsesWith(ReplVal); + BBVal = ReplVal; + if (BBOutVal == PN) BBOutVal = ReplVal; + BB->getInstList().erase(PN); // Erase the PHI node... + } else { + ++NumPHINodes; + } + + return BBVal; + } + + Value *TailDup::GetValueOutBlock(BasicBlock *BB, Value *OrigVal, + std::map &ValueMap, + std::map &OutValueMap) { + Value*& BBVal = OutValueMap[BB]; + if (BBVal) return BBVal; // Value already computed for this block? + + return BBVal = GetValueInBlock(BB, OrigVal, ValueMap, OutValueMap); + } From lattner at cs.uiuc.edu Sun Jun 22 15:12:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:12:01 2003 Subject: [llvm-commits] CVS: llvm/tools/gccas/gccas.cpp Message-ID: <200306222011.PAA17733@apoc.cs.uiuc.edu> Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.65 -> 1.66 --- Log message: Add tail duplication pass to the pipeline, move the verifier pass to the front Other minor reorganizations --- Diffs of the changes: Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.65 llvm/tools/gccas/gccas.cpp:1.66 --- llvm/tools/gccas/gccas.cpp:1.65 Fri May 30 14:24:06 2003 +++ llvm/tools/gccas/gccas.cpp Sun Jun 22 15:11:45 2003 @@ -60,18 +60,16 @@ void AddConfiguredTransformationPasses(PassManager &PM) { - if (Verify) PM.add(createVerifierPass()); - + PM.add(createVerifierPass()); // Verify that input is correct addPass(PM, createFunctionResolvingPass()); // Resolve (...) functions addPass(PM, createGlobalDCEPass()); // Kill unused uinit g-vars addPass(PM, createDeadTypeEliminationPass()); // Eliminate dead types addPass(PM, createConstantMergePass()); // Merge dup global constants - addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, createVerifierPass()); // Verify that input is correct - addPass(PM, createDeadInstEliminationPass()); // Remove Dead code/vars addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst addPass(PM, createInstructionCombiningPass()); // Cleanup code for raise addPass(PM, createRaisePointerReferencesPass());// Recover type information + addPass(PM, createTailDuplicationPass()); // Simplify cfg by copying code + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs addPass(PM, createInstructionCombiningPass()); // Combine silly seq's addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas addPass(PM, createPromoteMemoryToRegister()); // Promote alloca's to regs @@ -88,7 +86,7 @@ // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. addPass(PM, createInstructionCombiningPass()); - addPass(PM, createAggressiveDCEPass()); // SSA based 'Agressive DCE' + addPass(PM, createAggressiveDCEPass()); // SSA based 'Aggressive DCE' addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs } From lattner at cs.uiuc.edu Sun Jun 22 15:12:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:12:09 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.micro.Makefile TEST.micro.report Message-ID: <200306222011.PAA17722@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.micro.Makefile updated: 1.1 -> 1.2 TEST.micro.report updated: 1.1 -> 1.2 --- Log message: Fix comments --- Diffs of the changes: Index: llvm/test/Programs/TEST.micro.Makefile diff -u llvm/test/Programs/TEST.micro.Makefile:1.1 llvm/test/Programs/TEST.micro.Makefile:1.2 --- llvm/test/Programs/TEST.micro.Makefile:1.1 Fri Jun 20 18:06:02 2003 +++ llvm/test/Programs/TEST.micro.Makefile Sun Jun 22 15:11:18 2003 @@ -1,8 +1,5 @@ -##===- test/Programs/TEST.jit.Makefile ---------------------*- Makefile -*-===## +##===- test/Programs/TEST.micro.Makefile -------------------*- Makefile -*-===## # -# This test tries running the Just-In-Time compiler on all of the programs to -# see which ones work and which ones don't. It provides a report to tabulate -# this nicely and provides some simple statistics. # ##===----------------------------------------------------------------------===## Index: llvm/test/Programs/TEST.micro.report diff -u llvm/test/Programs/TEST.micro.report:1.1 llvm/test/Programs/TEST.micro.report:1.2 --- llvm/test/Programs/TEST.micro.report:1.1 Fri Jun 20 18:06:02 2003 +++ llvm/test/Programs/TEST.micro.report Sun Jun 22 15:11:18 2003 @@ -1,6 +1,6 @@ -##=== TEST.jit.report - Report description for jit tests -------*- perl -*-===## +##=== TEST.micro.report - Report for the MICRO'03 paper --------*- perl -*-===## # -# This file defines a report to be generated for the jit test. +# This file defines a report to be generated for the micro paper. # # This report should be generated with the following command: # gmake ENABLE_OPTIMIZED=1 TEST=micro RUNTIMELIMIT=120 LARGE_PROBLEM_SIZE=1 CFLAGS=-O3 From lattner at cs.uiuc.edu Sun Jun 22 15:22:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:22:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200306222021.PAA19065@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.59 -> 1.60 --- Log message: Maybe this will at least cause the OOM failure to not kill the tester --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.59 llvm/test/Programs/Makefile.programs:1.60 --- llvm/test/Programs/Makefile.programs:1.59 Fri Jun 20 14:00:42 2003 +++ llvm/test/Programs/Makefile.programs Sun Jun 22 15:21:29 2003 @@ -305,19 +305,19 @@ $(PROGRAMS_TO_TEST:%=Output/%.diff-lli): \ Output/%.diff-lli: Output/%.out-nat Output/%.out-lli - $(DIFFPROG) lli $* $(HIDEDIFF) + -$(DIFFPROG) lli $* $(HIDEDIFF) $(PROGRAMS_TO_TEST:%=Output/%.diff-jit): \ Output/%.diff-jit: Output/%.out-nat Output/%.out-jit - $(DIFFPROG) jit $* $(HIDEDIFF) + -$(DIFFPROG) jit $* $(HIDEDIFF) $(PROGRAMS_TO_TEST:%=Output/%.diff-llc): \ Output/%.diff-llc: Output/%.out-nat Output/%.out-llc - $(DIFFPROG) llc $* $(HIDEDIFF) + -$(DIFFPROG) llc $* $(HIDEDIFF) $(PROGRAMS_TO_TEST:%=Output/%.diff-cbe): \ Output/%.diff-cbe: Output/%.out-nat Output/%.out-cbe - $(DIFFPROG) cbe $* $(HIDEDIFF) + -$(DIFFPROG) cbe $* $(HIDEDIFF) ifndef DISABLE_DIFFS $(PROGRAMS_TO_TEST:%=Output/%.exe-lli): \ From lattner at cs.uiuc.edu Sun Jun 22 15:22:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:22:08 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/DiffOutput.sh Message-ID: <200306222021.PAA19054@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: DiffOutput.sh updated: 1.11 -> 1.12 --- Log message: Well the --speed-large-files option did not fix the crafty test on the nightly tester, so remove it. --- Diffs of the changes: Index: llvm/test/Programs/DiffOutput.sh diff -u llvm/test/Programs/DiffOutput.sh:1.11 llvm/test/Programs/DiffOutput.sh:1.12 --- llvm/test/Programs/DiffOutput.sh:1.11 Sun Jun 22 11:28:34 2003 +++ llvm/test/Programs/DiffOutput.sh Sun Jun 22 15:21:04 2003 @@ -20,7 +20,7 @@ fi # Diff the two files. -$DIFF -C 2 --speed-large-files Output/$2.out-nat Output/$2.out-$1 > $DIFFOUTPUT || ( +$DIFF -u Output/$2.out-nat Output/$2.out-$1 > $DIFFOUTPUT || ( # They are different! echo "******************** TEST '$2' FAILED! ********************" echo "Execution Context Diff:" From lattner at cs.uiuc.edu Sun Jun 22 15:26:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:26:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/TailDuplication.cpp Message-ID: <200306222025.PAA20949@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: TailDuplication.cpp updated: 1.1 -> 1.2 --- Log message: Test change --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Jun 22 15:26:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:26:07 2003 Subject: [llvm-commits] CVS: CVSROOT/commit-diffs.pl Message-ID: <200306222025.PAA20827@apoc.cs.uiuc.edu> Changes in directory CVSROOT: commit-diffs.pl updated: 1.34 -> 1.35 --- Log message: Attempt to have the diffs include the C function this changes are made in --- Diffs of the changes: Index: CVSROOT/commit-diffs.pl diff -u CVSROOT/commit-diffs.pl:1.34 CVSROOT/commit-diffs.pl:1.35 --- CVSROOT/commit-diffs.pl:1.34 Thu Apr 10 16:55:41 2003 +++ CVSROOT/commit-diffs.pl Sun Jun 22 15:24:56 2003 @@ -109,12 +109,12 @@ $subject .= "$m->{'filename'} "; if ($m->{'type'} eq 'add') { $msg .= "$m->{'filename'} added (r$m->{'newrev'})\n"; - $diffs .= `cvs -Qf rdiff -r0 -r1.1 $changedir/$m->{'filename'} 2> /dev/null` . "\n\n"; + $diffs .= `cvs -Qf rdiff --show-c-function -r0 -r1.1 $changedir/$m->{'filename'} 2> /dev/null` . "\n\n"; } elsif ($m->{'type'} eq 'rm') { $msg .= "$m->{'filename'} (r$m->{'oldrev'}) removed\n"; } else { $msg .= "$m->{'filename'} updated: $m->{'oldrev'} -> $m->{'newrev'}\n"; - $diffs .= `cvs -Qf rdiff -u -r $m->{'oldrev'} -r $m->{'newrev'} $changedir/$m->{'filename'} 2> /dev/null` . "\n\n"; + $diffs .= `cvs -Qf rdiff --show-c-function -u -r $m->{'oldrev'} -r $m->{'newrev'} $changedir/$m->{'filename'} 2> /dev/null` . "\n\n"; } } $msg .= "\n---\nLog message:\n\n" . join('', at logmessage); From lattner at cs.uiuc.edu Sun Jun 22 15:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:29:01 2003 Subject: [llvm-commits] CVS: CVSROOT/commit-diffs.pl Message-ID: <200306222028.PAA21544@apoc.cs.uiuc.edu> Changes in directory CVSROOT: commit-diffs.pl updated: 1.35 -> 1.36 --- Log message: Nope, I guess 'cvs rdiff' doesn't support that option, only 'cvs diff' does. :( --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Jun 22 15:31:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:31:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/TailDup/Makefile Message-ID: <200306222030.PAA21786@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/TailDup: Makefile added (r1.1) --- Log message: Initial checkin --- Diffs of the changes: Index: llvm/test/Regression/Transforms/TailDup/Makefile diff -c /dev/null llvm/test/Regression/Transforms/TailDup/Makefile:1.1 *** /dev/null Sun Jun 22 15:30:10 2003 --- llvm/test/Regression/Transforms/TailDup/Makefile Sun Jun 22 15:30:00 2003 *************** *** 0 **** --- 1,10 ---- + + LEVEL = ../../../.. + include $(LEVEL)/test/Makefile.tests + + TESTS := $(wildcard *.ll) + + all:: $(addprefix Output/, $(TESTS:%.ll=%.ll.out)) + + Output/%.ll.out: %.ll Output/.dir $(LOPT) + -$(TESTRUNR) $< From lattner at cs.uiuc.edu Sun Jun 22 15:31:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:31:08 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/TailDup/ Message-ID: <200306222030.PAA21779@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/TailDup: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Regression/Transforms/TailDup added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Jun 22 15:33:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:33:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/TailDup/PHIUpdateTest.ll basictest.ll Message-ID: <200306222032.PAA22329@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/TailDup: PHIUpdateTest.ll added (r1.1) basictest.ll added (r1.1) --- Log message: New testcases --- Diffs of the changes: Index: llvm/test/Regression/Transforms/TailDup/PHIUpdateTest.ll diff -c /dev/null llvm/test/Regression/Transforms/TailDup/PHIUpdateTest.ll:1.1 *** /dev/null Sun Jun 22 15:32:45 2003 --- llvm/test/Regression/Transforms/TailDup/PHIUpdateTest.ll Sun Jun 22 15:32:35 2003 *************** *** 0 **** --- 1,20 ---- + ; This test checks to make sure phi nodes are updated properly + ; + ; RUN: as < %s | opt -tailduplicate -disable-output + + + + int %test(bool %c, int %X, int %Y) { + br label %L + + L: + %A = add int %X, %Y + br bool %c, label %T, label %F + + F: + br bool %c, label %L, label %T + + T: + %V = phi int [%A, %L], [0, %F] + ret int %V + } Index: llvm/test/Regression/Transforms/TailDup/basictest.ll diff -c /dev/null llvm/test/Regression/Transforms/TailDup/basictest.ll:1.1 *** /dev/null Sun Jun 22 15:32:45 2003 --- llvm/test/Regression/Transforms/TailDup/basictest.ll Sun Jun 22 15:32:35 2003 *************** *** 0 **** --- 1,22 ---- + ; RUN: as < %s | opt -tailduplicate -disable-output + + declare void %__main() + + int %main() { + entry: ; No predecessors! + call void %__main( ) + br label %loopentry + + loopentry: ; preds = %entry, %no_exit + %i.0 = phi int [ %inc, %no_exit ], [ 0, %entry ] ; [#uses=2] + %tmp.1 = setle int %i.0, 99 ; [#uses=1] + br bool %tmp.1, label %no_exit, label %return + + no_exit: ; preds = %loopentry + %tmp.51 = call int %main( ) ; [#uses=0] + %inc = add int %i.0, 1 ; [#uses=1] + br label %loopentry + + return: ; preds = %loopentry + ret int %i.0 + } From lattner at cs.uiuc.edu Sun Jun 22 15:46:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:46:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll Message-ID: <200306222045.PAA22896@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2003-06-22-ConstantExprCrash.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll:1.1 *** /dev/null Sun Jun 22 15:45:51 2003 --- llvm/test/Regression/Transforms/InstCombine/2003-06-22-ConstantExprCrash.ll Sun Jun 22 15:45:39 2003 *************** *** 0 **** --- 1,12 ---- + ; This is a bug in the VMcode library, not instcombine, it's just convenient + ; to expose it here. + + ; RUN: as < %s | opt -instcombine -disable-output + + %A = global int 1 + %B = global int 2 + + bool %test() { + %C = setlt int* getelementptr (int* %A, long 1), getelementptr (int* %B, long 2) ; Will get promoted to constantexpr + ret bool %C + } From lattner at cs.uiuc.edu Sun Jun 22 15:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:47:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/TailDuplication.cpp Message-ID: <200306222046.PAA22908@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: TailDuplication.cpp updated: 1.2 -> 1.3 --- Log message: Add paranoia checking --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.2 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.3 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.2 Sun Jun 22 15:25:27 2003 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Sun Jun 22 15:46:00 2003 @@ -303,7 +303,7 @@ } // Found a value to replace the PHI node with? - if (ReplVal) { + if (ReplVal && ReplVal != PN) { PN->replaceAllUsesWith(ReplVal); BBVal = ReplVal; if (BBOutVal == PN) BBOutVal = ReplVal; From lattner at cs.uiuc.edu Sun Jun 22 15:49:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 15:49:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200306222048.PAA23186@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.45 -> 1.46 --- Log message: Fix bug: InstCombine/2003-06-22-ConstantExprCrash.ll --- Diffs of the changes: Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.45 llvm/lib/VMCore/Constants.cpp:1.46 --- llvm/lib/VMCore/Constants.cpp:1.45 Mon Jun 16 07:11:33 2003 +++ llvm/lib/VMCore/Constants.cpp Sun Jun 22 15:48:30 2003 @@ -243,8 +243,14 @@ Operands.push_back(Use(C, this)); } +static bool isSetCC(unsigned Opcode) { + return Opcode == Instruction::SetEQ || Opcode == Instruction::SetNE || + Opcode == Instruction::SetLT || Opcode == Instruction::SetGT || + Opcode == Instruction::SetLE || Opcode == Instruction::SetGE; +} + ConstantExpr::ConstantExpr(unsigned Opcode, Constant *C1, Constant *C2) - : Constant(C1->getType()), iType(Opcode) { + : Constant(isSetCC(Opcode) ? Type::BoolTy : C1->getType()), iType(Opcode) { Operands.push_back(Use(C1, this)); Operands.push_back(Use(C2, this)); } From lattner at cs.uiuc.edu Sun Jun 22 16:41:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jun 22 16:41:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-06-22-UnionCrash.c Message-ID: <200306222140.QAA27811@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-06-22-UnionCrash.c added (r1.1) --- Log message: New testcase narrowed down by Joel --- Diffs of the changes: Index: llvm/test/Regression/CFrontend/2003-06-22-UnionCrash.c diff -c /dev/null llvm/test/Regression/CFrontend/2003-06-22-UnionCrash.c:1.1 *** /dev/null Sun Jun 22 16:40:48 2003 --- llvm/test/Regression/CFrontend/2003-06-22-UnionCrash.c Sun Jun 22 16:40:38 2003 *************** *** 0 **** --- 1,11 ---- + struct Blend_Map_Entry { + union { + float Colour[5]; + double Point_Slope[2]; + } Vals; + }; + + void test(struct Blend_Map_Entry* Foo) + { + } + From vadve at cs.uiuc.edu Sun Jun 22 21:15:01 2003 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Sun Jun 22 21:15:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstrSelection.cpp Message-ID: <200306230214.VAA13920@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcInstrSelection.cpp updated: 1.102 -> 1.103 --- Log message: Add the padding needed for variable-size alloca's, which should work now. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcInstrSelection.cpp diff -u llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.102 llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.103 --- llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.102 Fri Jun 6 04:52:23 2003 +++ llvm/lib/Target/Sparc/SparcInstrSelection.cpp Sun Jun 22 21:13:57 2003 @@ -1051,19 +1051,27 @@ Value* tsizeVal = ConstantSInt::get(Type::IntTy, tsize); // Create temporary values to hold the result of MUL, SLL, SRL - // THIS CASE IS INCOMPLETE AND WILL BE FIXED SHORTLY. + // To pad `size' to next smallest multiple of 16: + // size = (size + 15) & (-16 = 0xfffffffffffffff0) + // TmpInstruction* tmpProd = new TmpInstruction(mcfi,numElementsVal, tsizeVal); - TmpInstruction* tmpSLL = new TmpInstruction(mcfi,numElementsVal, tmpProd); - TmpInstruction* tmpSRL = new TmpInstruction(mcfi,numElementsVal, tmpSLL); + TmpInstruction* tmpAdd15= new TmpInstruction(mcfi,numElementsVal, tmpProd); + TmpInstruction* tmpAndf0= new TmpInstruction(mcfi,numElementsVal, tmpAdd15); // Instruction 1: mul numElements, typeSize -> tmpProd // This will optimize the MUL as far as possible. - CreateMulInstruction(target, F, numElementsVal, tsizeVal, tmpProd,getMvec, + CreateMulInstruction(target, F, numElementsVal, tsizeVal, tmpProd, getMvec, mcfi, INVALID_MACHINE_OPCODE); - assert(0 && "Need to insert padding instructions here!"); + // Instruction 2: andn tmpProd, 0x0f -> tmpAndn + getMvec.push_back(BuildMI(V9::ADDi, 3).addReg(tmpProd).addSImm(15) + .addReg(tmpAdd15, MOTy::Def)); - totalSizeVal = tmpProd; + // Instruction 3: add tmpAndn, 0x10 -> tmpAdd16 + getMvec.push_back(BuildMI(V9::ANDi, 3).addReg(tmpAdd15).addSImm(-16) + .addReg(tmpAndf0, MOTy::Def)); + + totalSizeVal = tmpAndf0; } // Get the constant offset from SP for dynamically allocated storage