From resistor at mac.com Mon Jun 26 02:44:50 2006 From: resistor at mac.com (Owen Anderson) Date: Mon, 26 Jun 2006 02:44:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Message-ID: <200606260744.CAA04831@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnswitch.cpp updated: 1.40 -> 1.41 --- Log message: Make LoopUnswitch able to unswitch loops with live-out values by taking advantage of LCSSA. This results several times the number of unswitchings occurring on tests such and timberwolfmc, unix-tbl, and ldecod. --- Diffs of the changes: (+63 -53) LoopUnswitch.cpp | 116 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 63 insertions(+), 53 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.40 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.41 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.40 Tue Jun 13 23:46:17 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Jun 26 02:44:36 2006 @@ -208,31 +208,6 @@ return Changed; } - -/// LoopValuesUsedOutsideLoop - Return true if there are any values defined in -/// the loop that are used by instructions outside of it. -static bool LoopValuesUsedOutsideLoop(Loop *L) { - // We will be doing lots of "loop contains block" queries. Loop::contains is - // linear time, use a set to speed this up. - std::set LoopBlocks; - - for (Loop::block_iterator BB = L->block_begin(), E = L->block_end(); - BB != E; ++BB) - LoopBlocks.insert(*BB); - - for (Loop::block_iterator BB = L->block_begin(), E = L->block_end(); - BB != E; ++BB) { - for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I) - for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; - ++UI) { - BasicBlock *UserBB = cast(*UI)->getParent(); - if (!LoopBlocks.count(UserBB)) - return true; - } - } - return false; -} - /// isTrivialLoopExitBlock - Check to see if all paths from BB either: /// 1. Exit the loop with no side effects. /// 2. Branch to the latch block with no side-effects. @@ -391,17 +366,7 @@ << L->getBlocks().size() << "\n"); return false; } - - // If this loop has live-out values, we can't unswitch it. We need something - // like loop-closed SSA form in order to know how to insert PHI nodes for - // these values. - if (LoopValuesUsedOutsideLoop(L)) { - DEBUG(std::cerr << "NOT unswitching loop %" << L->getHeader()->getName() - << ", a loop value is used outside loop! Cost: " - << Cost << "\n"); - return false; - } - + // If this is a trivial condition to unswitch (which results in no code // duplication), do it now. Constant *CondVal; @@ -456,18 +421,6 @@ // If the successor only has a single pred, split the top of the successor // block. assert(SP == BB && "CFG broken"); - - // If this block has a single predecessor, remove any phi nodes. Unswitch - // expect that, after split the edges from inside the loop to the exit - // block, that there will be no phi nodes in the new exit block. Single - // entry phi nodes break this assumption. - BasicBlock::iterator I = Succ->begin(); - while (PHINode *PN = dyn_cast(I)) { - PN->replaceAllUsesWith(PN->getIncomingValue(0)); - PN->eraseFromParent(); - I = Succ->begin(); - } - return SplitBlock(Succ, Succ->begin()); } else { // Otherwise, if BB has a single successor, split it at the bottom of the @@ -616,8 +569,8 @@ ExitBlocks.erase(std::unique(ExitBlocks.begin(), ExitBlocks.end()), ExitBlocks.end()); - // Split all of the edges from inside the loop to their exit blocks. This - // unswitching trivial: no phi nodes to update. + // Split all of the edges from inside the loop to their exit blocks. Update + // the appropriate Phi nodes as we do so. unsigned NumBlocks = L->getBlocks().size(); for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) { @@ -627,8 +580,42 @@ for (unsigned j = 0, e = Preds.size(); j != e; ++j) { assert(L->contains(Preds[j]) && "All preds of loop exit blocks must be the same loop!"); - SplitEdge(Preds[j], ExitBlock); - } + BasicBlock* MiddleBlock = SplitEdge(Preds[j], ExitBlock); + BasicBlock* StartBlock = Preds[j]; + BasicBlock* EndBlock; + if (MiddleBlock->getSinglePredecessor() == ExitBlock) { + EndBlock = MiddleBlock; + MiddleBlock = EndBlock->getSinglePredecessor();; + } else { + EndBlock = ExitBlock; + } + + std::set InsertedPHIs; + PHINode* OldLCSSA = 0; + for (BasicBlock::iterator I = EndBlock->begin(); + (OldLCSSA = dyn_cast(I)); ++I) { + Value* OldValue = OldLCSSA->getIncomingValueForBlock(MiddleBlock); + PHINode* NewLCSSA = new PHINode(OldLCSSA->getType(), + OldLCSSA->getName() + ".us-lcssa", + MiddleBlock->getTerminator()); + NewLCSSA->addIncoming(OldValue, StartBlock); + OldLCSSA->setIncomingValue(OldLCSSA->getBasicBlockIndex(MiddleBlock), + NewLCSSA); + InsertedPHIs.insert(NewLCSSA); + } + + Instruction* InsertPt = EndBlock->begin(); + while (dyn_cast(InsertPt)) ++InsertPt; + for (BasicBlock::iterator I = MiddleBlock->begin(); + (OldLCSSA = dyn_cast(I)) && InsertedPHIs.count(OldLCSSA) == 0; + ++I) { + PHINode *NewLCSSA = new PHINode(OldLCSSA->getType(), + OldLCSSA->getName() + ".us-lcssa", + InsertPt); + OldLCSSA->replaceAllUsesWith(NewLCSSA); + NewLCSSA->addIncoming(OldLCSSA, MiddleBlock); + } + } } // The exit blocks may have been changed due to edge splitting, recompute. @@ -967,7 +954,30 @@ // Found a dead case value. Don't remove PHI nodes in the // successor if they become single-entry, those PHI nodes may // be in the Users list. - SI->getSuccessor(i)->removePredecessor(SI->getParent(), true); + + // FIXME: This is a hack. We need to keep the successor around + // and hooked up so as to preserve the loop structure, because + // trying to update it is complicated. So instead we preserve the + // loop structure and put the block on an dead code path. + + BasicBlock* Old = SI->getParent(); + BasicBlock* Split = SplitBlock(Old, SI); + + Instruction* OldTerm = Old->getTerminator(); + BranchInst* Branch = new BranchInst(Split, + SI->getSuccessor(i), + ConstantBool::True, + OldTerm); + + Old->getTerminator()->eraseFromParent(); + + for (BasicBlock::iterator II = SI->getSuccessor(i)->begin(), + IE = SI->getSuccessor(i)->end(); II != IE; ++II) { + if (isa(*II)) { + (*II).replaceUsesOfWith(Split, Old); + } + } + SI->removeCase(i); break; } From criswell at cs.uiuc.edu Mon Jun 26 10:56:09 2006 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 26 Jun 2006 10:56:09 -0500 Subject: [llvm-commits] CVS: CVSROOT/loginfo Message-ID: <200606261556.KAA20188@choi.cs.uiuc.edu> Changes in directory CVSROOT: loginfo updated: 1.11 -> 1.12 --- Log message: Use a local script for delivering mail since I need to send it to two email addresses. Yes, I know it's a hack. --- Diffs of the changes: (+1 -1) loginfo | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: CVSROOT/loginfo diff -u CVSROOT/loginfo:1.11 CVSROOT/loginfo:1.12 --- CVSROOT/loginfo:1.11 Thu Jun 22 11:07:42 2006 +++ CVSROOT/loginfo Mon Jun 26 10:55:56 2006 @@ -28,5 +28,5 @@ ^reopt /home/vadve/shared/PublicCVS/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu ^llva-emu /home/vadve/shared/PublicCVS/CVSROOT/commit-diffs.pl %{sVv} llvm-emu at nondot.org ^llvm-java /home/vadve/shared/PublicCVS/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu -^privbracket /home/vadve/shared/PublicCVS/CVSROOT/commit-diffs.pl %{sVv} criswell at cs.uiuc.edu +^privbracket /home/vadve/criswell/local/common/bin/commit-diffs.pl %{sVv} criswell at cs.uiuc.edu ^CVSROOT /home/vadve/shared/PublicCVS/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu From lattner at cs.uiuc.edu Mon Jun 26 13:15:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 13:15:11 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200606261815.NAA26481@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.218 -> 1.219 --- Log message: Add a make file target so the nightly tester can know what llc-beta means for a night. --- Diffs of the changes: (+3 -0) Makefile.programs | 3 +++ 1 files changed, 3 insertions(+) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.218 llvm-test/Makefile.programs:1.219 --- llvm-test/Makefile.programs:1.218 Sat Jun 24 03:43:23 2006 +++ llvm-test/Makefile.programs Mon Jun 26 13:14:59 2006 @@ -203,6 +203,9 @@ LLCBETAOPTION := -enable-sparc-v9-insts endif +print-llcbeta-option: + @echo $(LLCBETAOPTION) + # Given a version of the entire program linked together into a single unit of # raw output from the C frontend, optimize it. $(PROGRAMS_TO_TEST:%=Output/%.linked.bc): \ From lattner at cs.uiuc.edu Mon Jun 26 14:10:17 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 14:10:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200606261910.OAA32136@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.76 -> 1.77 --- Log message: random code cleanups, no functionality change --- Diffs of the changes: (+8 -9) LICM.cpp | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.76 llvm/lib/Transforms/Scalar/LICM.cpp:1.77 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.76 Sun Jan 22 17:32:06 2006 +++ llvm/lib/Transforms/Scalar/LICM.cpp Mon Jun 26 14:10:05 2006 @@ -335,7 +335,7 @@ // if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) && isSafeToExecuteUnconditionally(I)) - hoist(I); + hoist(I); } const std::vector &Children = N->getChildren(); @@ -386,8 +386,7 @@ } return isa(I) || isa(I) || isa(I) || - isa(I) || - isa(I); + isa(I) || isa(I); } /// isNotUsedInLoop - Return true if the only users of this instruction are @@ -448,11 +447,11 @@ if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[0], I.getParent())) { // Instruction is not used, just delete it. CurAST->deleteValue(&I); - I.getParent()->getInstList().erase(&I); + I.eraseFromParent(); } else { // Move the instruction to the start of the exit block, after any PHI // nodes in it. - I.getParent()->getInstList().remove(&I); + I.removeFromParent(); BasicBlock::iterator InsertPt = ExitBlocks[0]->begin(); while (isa(InsertPt)) ++InsertPt; @@ -461,7 +460,7 @@ } else if (ExitBlocks.size() == 0) { // The instruction is actually dead if there ARE NO exit blocks. CurAST->deleteValue(&I); - I.getParent()->getInstList().erase(&I); + I.eraseFromParent(); } else { // Otherwise, if we have multiple exits, use the PromoteMem2Reg function to // do all of the hard work of inserting PHI nodes as necessary. We convert @@ -526,7 +525,7 @@ // the copy. Instruction *New; if (InsertedBlocks.size() == 1) { - I.getParent()->getInstList().remove(&I); + I.removeFromParent(); ExitBlock->getInstList().insert(InsertPt, &I); New = &I; } else { @@ -546,7 +545,7 @@ // If the instruction doesn't dominate any exit blocks, it must be dead. if (InsertedBlocks.empty()) { CurAST->deleteValue(&I); - I.getParent()->getInstList().erase(&I); + I.eraseFromParent(); } // Finally, promote the fine value to SSA form. @@ -567,7 +566,7 @@ // Remove the instruction from its current basic block... but don't delete the // instruction. - I.getParent()->getInstList().remove(&I); + I.removeFromParent(); // Insert the new node in Preheader, before the terminator. Preheader->getInstList().insert(Preheader->getTerminator(), &I); From lattner at cs.uiuc.edu Mon Jun 26 14:20:37 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 14:20:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h Message-ID: <200606261920.OAA32582@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.26 -> 1.27 --- Log message: Add a new method. --- Diffs of the changes: (+7 -0) AliasSetTracker.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.26 llvm/include/llvm/Analysis/AliasSetTracker.h:1.27 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.26 Wed Nov 30 13:31:23 2005 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Mon Jun 26 14:20:25 2006 @@ -228,6 +228,13 @@ void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size, bool KnownMustAlias = false); void addCallSite(CallSite CS, AliasAnalysis &AA); + void removeCallSite(CallSite CS) { + for (unsigned i = 0, e = CallSites.size(); i != e; ++i) + if (CallSites[i].getInstruction() == CS.getInstruction()) { + CallSites[i] = CallSites.back(); + CallSites.pop_back(); + } + } void setVolatile() { Volatile = true; } /// aliasesPointer - Return true if the specified pointer "may" (or must) From lattner at cs.uiuc.edu Mon Jun 26 14:21:00 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 14:21:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200606261921.OAA32591@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.37 -> 1.38 --- Log message: Fix a stale pointer issue that caused 300.twolf to fail to build on zion last night. --- Diffs of the changes: (+11 -0) AliasSetTracker.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.37 llvm/lib/Analysis/AliasSetTracker.cpp:1.38 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.37 Tue Jan 3 00:05:22 2006 +++ llvm/lib/Analysis/AliasSetTracker.cpp Mon Jun 26 14:20:48 2006 @@ -435,6 +435,17 @@ // Notify the alias analysis implementation that this value is gone. AA.deleteValue(PtrVal); + // If this is a call instruction, remove the callsite from the appropriate + // AliasSet. + CallSite CS = CallSite::get(PtrVal); + if (CS.getInstruction()) { + Function *F = CS.getCalledFunction(); + if (!F || !AA.doesNotAccessMemory(F)) { + if (AliasSet *AS = findAliasSetForCallSite(CS)) + AS->removeCallSite(CS); + } + } + // First, look up the PointerRec for this pointer. hash_map::iterator I = PointerMap.find(PtrVal); if (I == PointerMap.end()) return; // Noop From lattner at cs.uiuc.edu Mon Jun 26 17:44:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 17:44:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td Message-ID: <200606262244.RAA02462@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.232 -> 1.233 --- Log message: remove two unused instructions. --- Diffs of the changes: (+0 -4) PPCInstrInfo.td | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.232 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.233 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.232 Tue Jun 20 18:21:20 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Mon Jun 26 17:44:13 2006 @@ -423,12 +423,8 @@ [(set GPRC:$dst, (xor GPRC:$src1,imm16ShiftedZExt:$src2))]>; def NOP : DForm_4_zero<24, (ops), "nop", IntGeneral, []>; -def CMPI : DForm_5<11, (ops CRRC:$crD, i1imm:$L, GPRC:$rA, s16imm:$imm), - "cmpi $crD, $L, $rA, $imm", IntCompare>; def CMPWI : DForm_5_ext<11, (ops CRRC:$crD, GPRC:$rA, s16imm:$imm), "cmpwi $crD, $rA, $imm", IntCompare>; -def CMPLI : DForm_6<10, (ops CRRC:$dst, i1imm:$size, GPRC:$src1, u16imm:$src2), - "cmpli $dst, $size, $src1, $src2", IntCompare>; def CMPLWI : DForm_6_ext<10, (ops CRRC:$dst, GPRC:$src1, u16imm:$src2), "cmplwi $dst, $src1, $src2", IntCompare>; } From lattner at cs.uiuc.edu Mon Jun 26 17:47:49 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 17:47:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td Message-ID: <200606262247.RAA02543@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.233 -> 1.234 --- Log message: Remove two more definitions --- Diffs of the changes: (+0 -4) PPCInstrInfo.td | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.233 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.234 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.233 Mon Jun 26 17:44:13 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Mon Jun 26 17:47:37 2006 @@ -530,10 +530,6 @@ "extsh $rA, $rS", IntGeneral, [(set GPRC:$rA, (sext_inreg GPRC:$rS, i16))]>; -def CMP : XForm_16<31, 0, (ops CRRC:$crD, i1imm:$long, GPRC:$rA, GPRC:$rB), - "cmp $crD, $long, $rA, $rB", IntCompare>; -def CMPL : XForm_16<31, 32, (ops CRRC:$crD, i1imm:$long, GPRC:$rA, GPRC:$rB), - "cmpl $crD, $long, $rA, $rB", IntCompare>; def CMPW : XForm_16_ext<31, 0, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), "cmpw $crD, $rA, $rB", IntCompare>; def CMPLW : XForm_16_ext<31, 32, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), From lattner at cs.uiuc.edu Mon Jun 26 17:48:47 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 17:48:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200606262248.RAA02604@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.191 -> 1.192 --- Log message: Improve PPC64 calling convention support --- Diffs of the changes: (+84 -37) PPCISelLowering.cpp | 121 ++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 84 insertions(+), 37 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.191 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.192 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.191 Tue Jun 20 19:34:03 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Jun 26 17:48:35 2006 @@ -733,8 +733,8 @@ Op.getOperand(1), Op.getOperand(2)); } -static SDOperand LowerFORMAL_ARGUMENTS_32(SDOperand Op, SelectionDAG &DAG, - int &VarArgsFrameIndex) { +static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG, + int &VarArgsFrameIndex) { // TODO: add description of PPC stack frame format, or at least some docs. // MachineFunction &MF = DAG.getMachineFunction(); @@ -748,10 +748,15 @@ const unsigned Num_FPR_Regs = 13; const unsigned Num_VR_Regs = 12; unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0; - static const unsigned GPR[] = { + + static const unsigned GPR_32[] = { // 32-bit registers. PPC::R3, PPC::R4, PPC::R5, PPC::R6, PPC::R7, PPC::R8, PPC::R9, PPC::R10, }; + static const unsigned GPR_64[] = { // 64-bit registers. + PPC::X3, PPC::X4, PPC::X5, PPC::X6, + PPC::X7, PPC::X8, PPC::X9, PPC::X10, + }; static const unsigned FPR[] = { PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7, PPC::F8, PPC::F9, PPC::F10, PPC::F11, PPC::F12, PPC::F13 @@ -760,6 +765,10 @@ PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8, PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13 }; + + MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + bool isPPC64 = PtrVT == MVT::i64; + const unsigned *GPR = isPPC64 ? GPR_64 : GPR_32; // Add DAG nodes to load the arguments or copy them out of registers. On // entry to a function on PPC, the arguments start at offset 24, although the @@ -771,12 +780,11 @@ unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8; unsigned CurArgOffset = ArgOffset; - switch (ObjectVT) { default: assert(0 && "Unhandled argument type!"); case MVT::i32: // All int arguments reserve stack space. - ArgOffset += 4; + ArgOffset += isPPC64 ? 8 : 4; if (GPR_idx != Num_GPR_Regs) { unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); @@ -787,6 +795,19 @@ needsLoad = true; } break; + case MVT::i64: // PPC64 + // All int arguments reserve stack space. + ArgOffset += 8; + + if (GPR_idx != Num_GPR_Regs) { + unsigned VReg = RegMap->createVirtualRegister(&PPC::G8RCRegClass); + MF.addLiveIn(GPR[GPR_idx], VReg); + ArgVal = DAG.getCopyFromReg(Root, VReg, MVT::i64); + ++GPR_idx; + } else { + needsLoad = true; + } + break; case MVT::f32: case MVT::f64: // All FP arguments reserve stack space. @@ -838,7 +859,7 @@ // slot. if (!Op.Val->hasNUsesOfValue(0, ArgNo)) { int FI = MFI->CreateFixedObject(ObjSize, CurArgOffset); - SDOperand FIN = DAG.getFrameIndex(FI, MVT::i32); + SDOperand FIN = DAG.getFrameIndex(FI, PtrVT); ArgVal = DAG.getLoad(ObjectVT, Root, FIN, DAG.getSrcValue(NULL)); } else { @@ -854,8 +875,9 @@ // the start of the first vararg value... for expansion of llvm.va_start. bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; if (isVarArg) { - VarArgsFrameIndex = MFI->CreateFixedObject(4, ArgOffset); - SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, MVT::i32); + VarArgsFrameIndex = MFI->CreateFixedObject(MVT::getSizeInBits(PtrVT)/8, + ArgOffset); + SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT); // If this function is vararg, store any remaining integer argument regs // to their spots on the stack so that they may be loaded by deferencing the // result of va_next. @@ -863,13 +885,13 @@ for (; GPR_idx != Num_GPR_Regs; ++GPR_idx) { unsigned VReg = RegMap->createVirtualRegister(&PPC::GPRCRegClass); MF.addLiveIn(GPR[GPR_idx], VReg); - SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i32); + SDOperand Val = DAG.getCopyFromReg(Root, VReg, PtrVT); SDOperand Store = DAG.getNode(ISD::STORE, MVT::Other, Val.getValue(1), Val, FIN, DAG.getSrcValue(NULL)); MemOps.push_back(Store); // Increment the address by four for the next argument to store - SDOperand PtrOff = DAG.getConstant(4, MVT::i32); - FIN = DAG.getNode(ISD::ADD, MVT::i32, FIN, PtrOff); + SDOperand PtrOff = DAG.getConstant(MVT::getSizeInBits(PtrVT)/8, PtrVT); + FIN = DAG.getNode(ISD::ADD, PtrOff.getValueType(), FIN, PtrOff); } if (!MemOps.empty()) Root = DAG.getNode(ISD::TokenFactor, MVT::Other, MemOps); @@ -883,11 +905,6 @@ return DAG.getNode(ISD::MERGE_VALUES, RetVT, ArgValues); } -static SDOperand LowerFORMAL_ARGUMENTS_64(SDOperand Op, SelectionDAG &DAG, - int &VarArgsFrameIndex) { - return LowerFORMAL_ARGUMENTS_32(Op, DAG, VarArgsFrameIndex); -} - /// isCallCompatibleAddress - Return the immediate to use if the specified /// 32-bit value is representable in the immediate field of a BxA instruction. static SDNode *isBLACompatibleAddress(SDOperand Op, SelectionDAG &DAG) { @@ -911,14 +928,19 @@ SDOperand Callee = Op.getOperand(4); unsigned NumOps = (Op.getNumOperands() - 5) / 2; + MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + bool isPPC64 = PtrVT == MVT::i64; + unsigned PtrByteSize = isPPC64 ? 8 : 4; + + // args_to_use will accumulate outgoing args for the PPCISD::CALL case in // SelectExpr to use to put the arguments in the appropriate registers. std::vector args_to_use; // Count how many bytes are to be pushed on the stack, including the linkage - // area, and parameter passing area. We start with 24 bytes, which is + // area, and parameter passing area. We start with 24/48 bytes, which is // prereserved space for [SP][CR][LR][3 x unused]. - unsigned NumBytes = 24; + unsigned NumBytes = 6*PtrByteSize; // Add up all the space actually used. for (unsigned i = 0; i != NumOps; ++i) @@ -929,29 +951,37 @@ // Because we cannot tell if this is needed on the caller side, we have to // conservatively assume that it is needed. As such, make sure we have at // least enough stack space for the caller to store the 8 GPRs. - if (NumBytes < 24+8*4) - NumBytes = 24+8*4; + if (NumBytes < 6*PtrByteSize+8*PtrByteSize) + NumBytes = 6*PtrByteSize+8*PtrByteSize; // Adjust the stack pointer for the new arguments... // These operations are automatically eliminated by the prolog/epilog pass Chain = DAG.getCALLSEQ_START(Chain, - DAG.getConstant(NumBytes, MVT::i32)); + DAG.getConstant(NumBytes, PtrVT)); // Set up a copy of the stack pointer for use loading and storing any // arguments that may not fit in the registers available for argument // passing. - SDOperand StackPtr = DAG.getRegister(PPC::R1, MVT::i32); + SDOperand StackPtr; + if (isPPC64) + StackPtr = DAG.getRegister(PPC::X1, MVT::i64); + else + StackPtr = DAG.getRegister(PPC::R1, MVT::i32); // Figure out which arguments are going to go in registers, and which in // memory. Also, if this is a vararg function, floating point operations // must be stored to our stack, and loaded into integer regs as well, if // any integer regs are available for argument passing. - unsigned ArgOffset = 24; + unsigned ArgOffset = 6*PtrByteSize; unsigned GPR_idx = 0, FPR_idx = 0, VR_idx = 0; - static const unsigned GPR[] = { + static const unsigned GPR_32[] = { // 32-bit registers. PPC::R3, PPC::R4, PPC::R5, PPC::R6, PPC::R7, PPC::R8, PPC::R9, PPC::R10, }; + static const unsigned GPR_64[] = { // 64-bit registers. + PPC::X3, PPC::X4, PPC::X5, PPC::X6, + PPC::X7, PPC::X8, PPC::X9, PPC::X10, + }; static const unsigned FPR[] = { PPC::F1, PPC::F2, PPC::F3, PPC::F4, PPC::F5, PPC::F6, PPC::F7, PPC::F8, PPC::F9, PPC::F10, PPC::F11, PPC::F12, PPC::F13 @@ -960,10 +990,12 @@ PPC::V2, PPC::V3, PPC::V4, PPC::V5, PPC::V6, PPC::V7, PPC::V8, PPC::V9, PPC::V10, PPC::V11, PPC::V12, PPC::V13 }; - const unsigned NumGPRs = sizeof(GPR)/sizeof(GPR[0]); + const unsigned NumGPRs = sizeof(GPR_32)/sizeof(GPR_32[0]); const unsigned NumFPRs = sizeof(FPR)/sizeof(FPR[0]); const unsigned NumVRs = sizeof( VR)/sizeof( VR[0]); + const unsigned *GPR = isPPC64 ? GPR_64 : GPR_32; + std::vector > RegsToPass; std::vector MemOpChains; for (unsigned i = 0; i != NumOps; ++i) { @@ -972,17 +1004,27 @@ // PtrOff will be used to store the current argument to the stack if a // register cannot be found for it. SDOperand PtrOff = DAG.getConstant(ArgOffset, StackPtr.getValueType()); - PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff); + PtrOff = DAG.getNode(ISD::ADD, PtrVT, StackPtr, PtrOff); + + // On PPC64, promote integers to 64-bit values. + if (isPPC64 && Arg.getValueType() == MVT::i32) { + unsigned ExtOp = ISD::ZERO_EXTEND; + if (cast(Op.getOperand(5+2*i+1))->getValue()) + ExtOp = ISD::SIGN_EXTEND; + Arg = DAG.getNode(ExtOp, MVT::i64, Arg); + } + switch (Arg.getValueType()) { default: assert(0 && "Unexpected ValueType for argument!"); case MVT::i32: + case MVT::i64: if (GPR_idx != NumGPRs) { RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Arg)); } else { MemOpChains.push_back(DAG.getNode(ISD::STORE, MVT::Other, Chain, Arg, PtrOff, DAG.getSrcValue(NULL))); } - ArgOffset += 4; + ArgOffset += PtrByteSize; break; case MVT::f32: case MVT::f64: @@ -997,15 +1039,15 @@ // Float varargs are always shadowed in available integer registers if (GPR_idx != NumGPRs) { - SDOperand Load = DAG.getLoad(MVT::i32, Store, PtrOff, + SDOperand Load = DAG.getLoad(PtrVT, Store, PtrOff, DAG.getSrcValue(NULL)); MemOpChains.push_back(Load.getValue(1)); RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load)); } if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64) { SDOperand ConstFour = DAG.getConstant(4, PtrOff.getValueType()); - PtrOff = DAG.getNode(ISD::ADD, MVT::i32, PtrOff, ConstFour); - SDOperand Load = DAG.getLoad(MVT::i32, Store, PtrOff, + PtrOff = DAG.getNode(ISD::ADD, PtrVT, PtrOff, ConstFour); + SDOperand Load = DAG.getLoad(PtrVT, Store, PtrOff, DAG.getSrcValue(NULL)); MemOpChains.push_back(Load.getValue(1)); RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load)); @@ -1016,14 +1058,17 @@ // GPRs. if (GPR_idx != NumGPRs) ++GPR_idx; - if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64) + if (GPR_idx != NumGPRs && Arg.getValueType() == MVT::f64 && !isPPC64) ++GPR_idx; } } else { MemOpChains.push_back(DAG.getNode(ISD::STORE, MVT::Other, Chain, Arg, PtrOff, DAG.getSrcValue(NULL))); } - ArgOffset += (Arg.getValueType() == MVT::f32) ? 4 : 8; + if (isPPC64) + ArgOffset += 8; + else + ArgOffset += Arg.getValueType() == MVT::f32 ? 4 : 8; break; case MVT::v4f32: case MVT::v4i32: @@ -1127,6 +1172,11 @@ } NodeTys.push_back(MVT::i32); break; + case MVT::i64: + Chain = DAG.getCopyFromReg(Chain, PPC::X3, MVT::i64, InFlag).getValue(1); + ResultVals.push_back(Chain.getValue(0)); + NodeTys.push_back(MVT::i64); + break; case MVT::f32: case MVT::f64: Chain = DAG.getCopyFromReg(Chain, PPC::F1, Op.Val->getValueType(0), @@ -1146,7 +1196,7 @@ } Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain, - DAG.getConstant(NumBytes, MVT::i32)); + DAG.getConstant(NumBytes, PtrVT)); NodeTys.push_back(MVT::Other); // If the function returns void, just return the chain. @@ -2136,10 +2186,7 @@ case ISD::SETCC: return LowerSETCC(Op, DAG); case ISD::VASTART: return LowerVASTART(Op, DAG, VarArgsFrameIndex); case ISD::FORMAL_ARGUMENTS: - if (getPointerTy() == MVT::i32) - return LowerFORMAL_ARGUMENTS_32(Op, DAG, VarArgsFrameIndex); - else - return LowerFORMAL_ARGUMENTS_64(Op, DAG, VarArgsFrameIndex); + return LowerFORMAL_ARGUMENTS(Op, DAG, VarArgsFrameIndex); case ISD::CALL: return LowerCALL(Op, DAG); case ISD::RET: return LowerRET(Op, DAG); From lattner at cs.uiuc.edu Mon Jun 26 18:53:22 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 18:53:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstr64Bit.td Message-ID: <200606262353.SAA02989@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.10 -> 1.11 --- Log message: Rearrange compares, add ADDI8, add sext from 32-to-64 bit register --- Diffs of the changes: (+20 -8) PPCInstr64Bit.td | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.10 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.11 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.10 Tue Jun 20 18:18:58 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Mon Jun 26 18:53:10 2006 @@ -15,6 +15,12 @@ //===----------------------------------------------------------------------===// // 64-bit operands. // +def s16imm64 : Operand { + let PrintMethod = "printS16ImmOperand"; +} +def u16imm64 : Operand { + let PrintMethod = "printU16ImmOperand"; +} def symbolHi64 : Operand { let PrintMethod = "printSymbolHi"; } @@ -121,6 +127,9 @@ def ADD8 : XOForm_1<31, 266, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), "add $rT, $rA, $rB", IntGeneral, [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>; +def ADDI8 : DForm_2<14, (ops G8RC:$rD, G8RC:$rA, s16imm64:$imm), + "addi $rD, $rA, $imm", IntGeneral, + [(set G8RC:$rD, (add G8RC:$rA, immSExt16:$imm))]>; def ADDIS8 : DForm_2<15, (ops G8RC:$rD, G8RC:$rA, symbolHi64:$imm), "addis $rD, $rA, $imm", IntGeneral, [(set G8RC:$rD, (add G8RC:$rA, imm16ShiftedSExt:$imm))]>; @@ -135,15 +144,14 @@ "mulhdu $rT, $rA, $rB", IntMulHWU, [(set G8RC:$rT, (mulhu G8RC:$rA, G8RC:$rB))]>; -def CMPDI : DForm_5_ext<11, (ops CRRC:$crD, GPRC:$rA, s16imm:$imm), - "cmpdi $crD, $rA, $imm", IntCompare>, isPPC64; - -def CMPLDI : DForm_6_ext<10, (ops CRRC:$dst, GPRC:$src1, u16imm:$src2), - "cmpldi $dst, $src1, $src2", IntCompare>, isPPC64; -def CMPD : XForm_16_ext<31, 0, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), +def CMPD : XForm_16_ext<31, 0, (ops CRRC:$crD, G8RC:$rA, G8RC:$rB), "cmpd $crD, $rA, $rB", IntCompare>, isPPC64; -def CMPLD : XForm_16_ext<31, 32, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), +def CMPLD : XForm_16_ext<31, 32, (ops CRRC:$crD, G8RC:$rA, G8RC:$rB), "cmpld $crD, $rA, $rB", IntCompare>, isPPC64; +def CMPDI : DForm_5_ext<11, (ops CRRC:$crD, G8RC:$rA, s16imm:$imm), + "cmpdi $crD, $rA, $imm", IntCompare>, isPPC64; +def CMPLDI : DForm_6_ext<10, (ops CRRC:$dst, G8RC:$src1, u16imm:$src2), + "cmpldi $dst, $src1, $src2", IntCompare>, isPPC64; def SLD : XForm_6<31, 27, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), "sld $rA, $rS, $rB", IntRotateD, @@ -161,6 +169,9 @@ def EXTSW_32 : XForm_11<31, 986, (ops GPRC:$rA, GPRC:$rS), "extsw $rA, $rS", IntGeneral, [(set GPRC:$rA, (PPCextsw_32 GPRC:$rS))]>, isPPC64; +def EXTSW_32_64 : XForm_11<31, 986, (ops G8RC:$rA, GPRC:$rS), + "extsw $rA, $rS", IntGeneral, + [(set G8RC:$rA, (sext GPRC:$rS))]>, isPPC64; def SRADI : XSForm_1<31, 413, (ops GPRC:$rA, GPRC:$rS, u6imm:$SH), "sradi $rA, $rS, $SH", IntRotateD>, isPPC64; @@ -176,6 +187,7 @@ "mulld $rT, $rA, $rB", IntMulHD, [(set G8RC:$rT, (mul G8RC:$rA, G8RC:$rB))]>, isPPC64; + let isTwoAddress = 1, isCommutable = 1 in { def RLDIMI : MDForm_1<30, 3, (ops G8RC:$rA, G8RC:$rSi, G8RC:$rS, u6imm:$SH, u6imm:$MB), @@ -192,7 +204,7 @@ (ops G8RC:$rA, G8RC:$rS, u6imm:$SH, u6imm:$ME), "rldicr $rA, $rS, $SH, $ME", IntRotateD, []>, isPPC64; -} +} // End FXU Operations. //===----------------------------------------------------------------------===// From lattner at cs.uiuc.edu Mon Jun 26 19:04:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 19:04:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCISelLowering.cpp PPCInstrInfo.td Message-ID: <200606270004.TAA03149@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.192 -> 1.193 PPCISelLowering.cpp updated: 1.192 -> 1.193 PPCInstrInfo.td updated: 1.234 -> 1.235 --- Log message: Implement a bunch of 64-bit cleanliness work. With this, treeadd builds (but doesn't work right). --- Diffs of the changes: (+198 -113) PPCISelDAGToDAG.cpp | 303 ++++++++++++++++++++++++++++++++-------------------- PPCISelLowering.cpp | 4 PPCInstrInfo.td | 4 3 files changed, 198 insertions(+), 113 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.192 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.193 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.192 Fri Jun 9 20:15:02 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Mon Jun 26 19:04:13 2006 @@ -63,6 +63,18 @@ return CurDAG->getTargetConstant(Imm, MVT::i32); } + /// getI64Imm - Return a target constant with the specified value, of type + /// i64. + inline SDOperand getI64Imm(uint64_t Imm) { + return CurDAG->getTargetConstant(Imm, MVT::i64); + } + + /// getSmallIPtrImm - Return a target constant of pointer type. + inline SDOperand getSmallIPtrImm(unsigned Imm) { + return CurDAG->getTargetConstant(Imm, PPCLowering.getPointerTy()); + } + + /// getGlobalBaseReg - insert code into the entry mbb to materialize the PIC /// base register. Return the virtual register that holds this value. SDOperand getGlobalBaseReg(); @@ -111,7 +123,7 @@ case 'o': // offsetable if (!SelectAddrImm(Op, Op0, Op1)) { Select(Op0, Op); // r+0. - Op1 = getI32Imm(0); + Op1 = getSmallIPtrImm(0); } break; case 'v': // not offsetable @@ -290,26 +302,73 @@ MachineBasicBlock &FirstMBB = BB->getParent()->front(); MachineBasicBlock::iterator MBBI = FirstMBB.begin(); SSARegMap *RegMap = BB->getParent()->getSSARegMap(); - // FIXME: when we get to LP64, we will need to create the appropriate - // type of register here. - GlobalBaseReg = RegMap->createVirtualRegister(PPC::GPRCRegisterClass); + + if (PPCLowering.getPointerTy() == MVT::i32) + GlobalBaseReg = RegMap->createVirtualRegister(PPC::GPRCRegisterClass); + else + GlobalBaseReg = RegMap->createVirtualRegister(PPC::G8RCRegisterClass); + BuildMI(FirstMBB, MBBI, PPC::MovePCtoLR, 0, PPC::LR); BuildMI(FirstMBB, MBBI, PPC::MFLR, 1, GlobalBaseReg); } - return CurDAG->getRegister(GlobalBaseReg, MVT::i32); + return CurDAG->getRegister(GlobalBaseReg, PPCLowering.getPointerTy()); } +/// isIntS16Immediate - This method tests to see if the node is either a 32-bit +/// or 64-bit immediate, and if the value can be accurately represented as a +/// sign extension from a 16-bit value. If so, this returns true and the +/// immediate. +static bool isIntS16Immediate(SDNode *N, short &Imm) { + if (N->getOpcode() != ISD::Constant) + return false; -// isIntImmediate - This method tests to see if a constant operand. -// If so Imm will receive the 32 bit value. -static bool isIntImmediate(SDNode *N, unsigned& Imm) { - if (N->getOpcode() == ISD::Constant) { + Imm = (short)cast(N)->getValue(); + if (N->getValueType(0) == MVT::i32) + return Imm == (int32_t)cast(N)->getValue(); + else + return Imm == (int64_t)cast(N)->getValue(); +} + +static bool isIntS16Immediate(SDOperand Op, short &Imm) { + return isIntS16Immediate(Op.Val, Imm); +} + + +/// isInt32Immediate - This method tests to see if the node is a 32-bit constant +/// operand. If so Imm will receive the 32-bit value. +static bool isInt32Immediate(SDNode *N, unsigned &Imm) { + if (N->getOpcode() == ISD::Constant && N->getValueType(0) == MVT::i32) { Imm = cast(N)->getValue(); return true; } return false; } +/// isInt64Immediate - This method tests to see if the node is a 64-bit constant +/// operand. If so Imm will receive the 64-bit value. +static bool isInt64Immediate(SDNode *N, uint64_t &Imm) { + if (N->getOpcode() == ISD::Constant && N->getValueType(0) == MVT::i32) { + Imm = cast(N)->getValue(); + return true; + } + return false; +} + +// isInt32Immediate - This method tests to see if a constant operand. +// If so Imm will receive the 32 bit value. +static bool isInt32Immediate(SDOperand N, unsigned &Imm) { + return isInt32Immediate(N.Val, Imm); +} + + +// isOpcWithIntImmediate - This method tests to see if the node is a specific +// opcode and that it has a immediate integer right operand. +// If so Imm will receive the 32 bit value. +static bool isOpcWithIntImmediate(SDNode *N, unsigned Opc, unsigned& Imm) { + return N->getOpcode() == Opc && isInt32Immediate(N->getOperand(1).Val, Imm); +} + + // isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s with // any number of 0s on either side. The 1s are allowed to wrap from LSB to // MSB, so 0x000FFF0, 0x0000FFFF, and 0xFF0000FF are all runs. 0x0F0F0000 is @@ -348,7 +407,7 @@ unsigned Indeterminant = ~0; // bit mask marking indeterminant results unsigned Opcode = N->getOpcode(); if (N->getNumOperands() != 2 || - !isIntImmediate(N->getOperand(1).Val, Shift) || (Shift > 31)) + !isInt32Immediate(N->getOperand(1).Val, Shift) || (Shift > 31)) return false; if (Opcode == ISD::SHL) { @@ -376,23 +435,6 @@ return false; } -// isOpcWithIntImmediate - This method tests to see if the node is a specific -// opcode and that it has a immediate integer right operand. -// If so Imm will receive the 32 bit value. -static bool isOpcWithIntImmediate(SDNode *N, unsigned Opc, unsigned& Imm) { - return N->getOpcode() == Opc && isIntImmediate(N->getOperand(1).Val, Imm); -} - -// isIntImmediate - This method tests to see if a constant operand. -// If so Imm will receive the 32 bit value. -static bool isIntImmediate(SDOperand N, unsigned& Imm) { - if (ConstantSDNode *CN = dyn_cast(N)) { - Imm = (unsigned)CN->getSignExtended(); - return true; - } - return false; -} - /// SelectBitfieldInsert - turn an or of two masked values into /// the rotate left word immediate then mask insert (rlwimi) instruction. SDNode *PPCDAGToDAGISel::SelectBitfieldInsert(SDNode *N) { @@ -440,14 +482,14 @@ bool DisjointMask = (TargetMask ^ InsertMask) == 0xFFFFFFFF; if ((Op1Opc == ISD::SHL || Op1Opc == ISD::SRL) && - isIntImmediate(Op1.getOperand(1), Value)) { + isInt32Immediate(Op1.getOperand(1), Value)) { Op1 = Op1.getOperand(0); SH = (Op1Opc == ISD::SHL) ? Value : 32 - Value; } if (Op1Opc == ISD::AND) { unsigned SHOpc = Op1.getOperand(0).getOpcode(); if ((SHOpc == ISD::SHL || SHOpc == ISD::SRL) && - isIntImmediate(Op1.getOperand(0).getOperand(1), Value)) { + isInt32Immediate(Op1.getOperand(0).getOperand(1), Value)) { Op1 = Op1.getOperand(0).getOperand(0); SH = (SHOpc == ISD::SHL) ? Value : 32 - Value; } else { @@ -475,11 +517,11 @@ return false; if (N.getOpcode() == ISD::ADD) { - unsigned imm = 0; - if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm)) { - Disp = getI32Imm(imm & 0xFFFF); + short imm = 0; + if (isIntS16Immediate(N.getOperand(1), imm)) { + Disp = getI32Imm((int)imm & 0xFFFF); if (FrameIndexSDNode *FI = dyn_cast(N.getOperand(0))) { - Base = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32); + Base = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); } else { Base = N.getOperand(0); } @@ -496,43 +538,48 @@ return true; // [&g+r] } } else if (N.getOpcode() == ISD::OR) { - unsigned imm = 0; - if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm)) { + short imm = 0; + if (isIntS16Immediate(N.getOperand(1), imm)) { // If this is an or of disjoint bitfields, we can codegen this as an add // (for better address arithmetic) if the LHS and RHS of the OR are // provably disjoint. uint64_t LHSKnownZero, LHSKnownOne; PPCLowering.ComputeMaskedBits(N.getOperand(0), ~0U, LHSKnownZero, LHSKnownOne); - if ((LHSKnownZero|~imm) == ~0U) { + if ((LHSKnownZero|~(unsigned)imm) == ~0U) { // If all of the bits are known zero on the LHS or RHS, the add won't // carry. Base = N.getOperand(0); - Disp = getI32Imm(imm & 0xFFFF); + Disp = getI32Imm((int)imm & 0xFFFF); return true; } } } else if (ConstantSDNode *CN = dyn_cast(N)) { // Loading from a constant address. - int Addr = (int)CN->getValue(); - + // If this address fits entirely in a 16-bit sext immediate field, codegen // this as "d, 0" - if (Addr == (short)Addr) { - Disp = getI32Imm(Addr); - Base = CurDAG->getRegister(PPC::R0, MVT::i32); + short Imm; + if (isIntS16Immediate(CN, Imm)) { + Disp = CurDAG->getTargetConstant(Imm, CN->getValueType(0)); + Base = CurDAG->getRegister(PPC::R0, CN->getValueType(0)); return true; } + + // FIXME: Handle small sext constant offsets in PPC64 mode also! + if (CN->getValueType(0) == MVT::i32) { + int Addr = (int)CN->getValue(); - // Otherwise, break this down into an LIS + disp. - Disp = getI32Imm((short)Addr); - Base = CurDAG->getConstant(Addr - (signed short)Addr, MVT::i32); - return true; + // Otherwise, break this down into an LIS + disp. + Disp = getI32Imm((short)Addr); + Base = CurDAG->getConstant(Addr - (signed short)Addr, MVT::i32); + return true; + } } - Disp = getI32Imm(0); + Disp = getSmallIPtrImm(0); if (FrameIndexSDNode *FI = dyn_cast(N)) - Base = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32); + Base = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); else Base = N; return true; // [r+0] @@ -543,9 +590,9 @@ /// be represented by [r+imm], which are preferred. bool PPCDAGToDAGISel::SelectAddrIdx(SDOperand N, SDOperand &Base, SDOperand &Index) { - unsigned imm = 0; + short imm = 0; if (N.getOpcode() == ISD::ADD) { - if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm)) + if (isIntS16Immediate(N.getOperand(1), imm)) return false; // r+i if (N.getOperand(1).getOpcode() == PPCISD::Lo) return false; // r+i @@ -554,7 +601,7 @@ Index = N.getOperand(1); return true; } else if (N.getOpcode() == ISD::OR) { - if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm)) + if (isIntS16Immediate(N.getOperand(1), imm)) return false; // r+i can fold it if we can. // If this is an or of disjoint bitfields, we can codegen this as an add @@ -601,7 +648,7 @@ } // Otherwise, do it the hard way, using R0 as the base register. - Base = CurDAG->getRegister(PPC::R0, MVT::i32); + Base = CurDAG->getRegister(PPC::R0, N.getValueType()); Index = N; return true; } @@ -616,12 +663,11 @@ return false; if (N.getOpcode() == ISD::ADD) { - unsigned imm = 0; - if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm) && - (imm & 3) == 0) { - Disp = getI32Imm((imm & 0xFFFF) >> 2); + short imm = 0; + if (isIntS16Immediate(N.getOperand(1), imm) && (imm & 3) == 0) { + Disp = getI32Imm(((int)imm & 0xFFFF) >> 2); if (FrameIndexSDNode *FI = dyn_cast(N.getOperand(0))) { - Base = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32); + Base = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); } else { Base = N.getOperand(0); } @@ -638,34 +684,37 @@ return true; // [&g+r] } } else if (N.getOpcode() == ISD::OR) { - unsigned imm = 0; - if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm) && - (imm & 3) == 0) { + short imm = 0; + if (isIntS16Immediate(N.getOperand(1), imm) && (imm & 3) == 0) { // If this is an or of disjoint bitfields, we can codegen this as an add // (for better address arithmetic) if the LHS and RHS of the OR are // provably disjoint. uint64_t LHSKnownZero, LHSKnownOne; PPCLowering.ComputeMaskedBits(N.getOperand(0), ~0U, LHSKnownZero, LHSKnownOne); - if ((LHSKnownZero|~imm) == ~0U) { + if ((LHSKnownZero|~(unsigned)imm) == ~0U) { // If all of the bits are known zero on the LHS or RHS, the add won't // carry. Base = N.getOperand(0); - Disp = getI32Imm((imm & 0xFFFF) >> 2); + Disp = getI32Imm(((int)imm & 0xFFFF) >> 2); return true; } } } else if (ConstantSDNode *CN = dyn_cast(N)) { // Loading from a constant address. - int Addr = (int)CN->getValue(); - if ((Addr & 3) == 0) { - // If this address fits entirely in a 16-bit sext immediate field, codegen - // this as "d, 0" - if (Addr == (short)Addr) { - Disp = getI32Imm(Addr >> 2); - Base = CurDAG->getRegister(PPC::R0, MVT::i32); - return true; - } + + // If this address fits entirely in a 14-bit sext immediate field, codegen + // this as "d, 0" + short Imm; + if (isIntS16Immediate(CN, Imm)) { + Disp = getSmallIPtrImm((unsigned short)Imm >> 2); + Base = CurDAG->getRegister(PPC::R0, CN->getValueType(0)); + return true; + } + + // FIXME: Handle small sext constant offsets in PPC64 mode also! + if (CN->getValueType(0) == MVT::i32) { + int Addr = (int)CN->getValue(); // Otherwise, break this down into an LIS + disp. Disp = getI32Imm((short)Addr >> 2); @@ -674,9 +723,9 @@ } } - Disp = getI32Imm(0); + Disp = getSmallIPtrImm(0); if (FrameIndexSDNode *FI = dyn_cast(N)) - Base = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32); + Base = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); else Base = N; return true; // [r+0] @@ -689,25 +738,47 @@ ISD::CondCode CC) { // Always select the LHS. Select(LHS, LHS); - - // Use U to determine whether the SETCC immediate range is signed or not. - if (MVT::isInteger(LHS.getValueType())) { - bool U = ISD::isUnsignedIntSetCC(CC); - unsigned Imm; - if (isIntImmediate(RHS, Imm) && - ((U && isUInt16(Imm)) || (!U && isInt16(Imm)))) - return SDOperand(CurDAG->getTargetNode(U ? PPC::CMPLWI : PPC::CMPWI, - MVT::i32, LHS, getI32Imm(Imm & 0xFFFF)), 0); - Select(RHS, RHS); - return SDOperand(CurDAG->getTargetNode(U ? PPC::CMPLW : PPC::CMPW, MVT::i32, - LHS, RHS), 0); + unsigned Opc; + + if (LHS.getValueType() == MVT::i32) { + unsigned Imm, Opc; + if (ISD::isUnsignedIntSetCC(CC)) { + if (isInt32Immediate(RHS, Imm) && isUInt16(Imm)) + return SDOperand(CurDAG->getTargetNode(PPC::CMPLWI, MVT::i32, LHS, + getI32Imm(Imm & 0xFFFF)), 0); + Opc = PPC::CMPLW; + } else { + short SImm; + if (isIntS16Immediate(RHS, SImm)) + return SDOperand(CurDAG->getTargetNode(PPC::CMPWI, MVT::i32, LHS, + getI32Imm((int)SImm & 0xFFFF)), + 0); + Opc = PPC::CMPW; + } + } else if (LHS.getValueType() == MVT::i64) { + uint64_t Imm; + unsigned Opc; + if (ISD::isUnsignedIntSetCC(CC)) { + if (isInt64Immediate(RHS.Val, Imm) && isUInt16(Imm)) + return SDOperand(CurDAG->getTargetNode(PPC::CMPLDI, MVT::i64, LHS, + getI64Imm(Imm & 0xFFFF)), 0); + Opc = PPC::CMPLD; + } else { + short SImm; + if (isIntS16Immediate(RHS, SImm)) + return SDOperand(CurDAG->getTargetNode(PPC::CMPDI, MVT::i64, LHS, + getI64Imm((int)SImm & 0xFFFF)), + 0); + Opc = PPC::CMPD; + } } else if (LHS.getValueType() == MVT::f32) { - Select(RHS, RHS); - return SDOperand(CurDAG->getTargetNode(PPC::FCMPUS, MVT::i32, LHS, RHS), 0); + Opc = PPC::FCMPUS; } else { - Select(RHS, RHS); - return SDOperand(CurDAG->getTargetNode(PPC::FCMPUD, MVT::i32, LHS, RHS), 0); + assert(LHS.getValueType() == MVT::f64 && "Unknown vt!"); + Opc = PPC::FCMPUD; } + Select(RHS, RHS); + return SDOperand(CurDAG->getTargetNode(Opc, MVT::i32, LHS, RHS), 0); } /// getBCCForSetCC - Returns the PowerPC condition branch mnemonic corresponding @@ -774,7 +845,7 @@ SDNode *N = Op.Val; unsigned Imm; ISD::CondCode CC = cast(N->getOperand(2))->get(); - if (isIntImmediate(N->getOperand(1), Imm)) { + if (isInt32Immediate(N->getOperand(1), Imm)) { // We can codegen setcc op, imm very efficiently compared to a brcond. // Check for those cases here. // setcc op, 0 @@ -901,16 +972,16 @@ case ISD::FrameIndex: { int FI = cast(N)->getIndex(); + SDOperand TFI = CurDAG->getTargetFrameIndex(FI, Op.getValueType()); + unsigned Opc = Op.getValueType() == MVT::i32 ? PPC::ADDI : PPC::ADDI8; if (N->hasOneUse()) { - Result = CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32, - CurDAG->getTargetFrameIndex(FI, MVT::i32), - getI32Imm(0)); + Result = CurDAG->SelectNodeTo(N, Opc, Op.getValueType(), TFI, + getSmallIPtrImm(0)); return; } Result = CodeGenMap[Op] = - SDOperand(CurDAG->getTargetNode(PPC::ADDI, MVT::i32, - CurDAG->getTargetFrameIndex(FI, MVT::i32), - getI32Imm(0)), 0); + SDOperand(CurDAG->getTargetNode(Opc, Op.getValueType(), TFI, + getSmallIPtrImm(0)), 0); return; } @@ -934,7 +1005,7 @@ // srl/add/sra pattern the dag combiner will generate for this as // sra/addze rather than having to handle sdiv ourselves. oh well. unsigned Imm; - if (isIntImmediate(N->getOperand(1), Imm)) { + if (isInt32Immediate(N->getOperand(1), Imm)) { SDOperand N0; Select(N0, N->getOperand(0)); if ((signed)Imm > 0 && isPowerOf2_32(Imm)) { @@ -963,8 +1034,8 @@ unsigned Imm, Imm2; // If this is an and of a value rotated between 0 and 31 bits and then and'd // with a mask, emit rlwinm - if (isIntImmediate(N->getOperand(1), Imm) && (isShiftedMask_32(Imm) || - isShiftedMask_32(~Imm))) { + if (isInt32Immediate(N->getOperand(1), Imm) && + (isShiftedMask_32(Imm) || isShiftedMask_32(~Imm))) { SDOperand Val; unsigned SH, MB, ME; if (isRotateAndMask(N->getOperand(0).Val, Imm, false, SH, MB, ME)) { @@ -985,9 +1056,9 @@ } // ISD::OR doesn't get all the bitfield insertion fun. // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) is a bitfield insert - if (isIntImmediate(N->getOperand(1), Imm) && + if (isInt32Immediate(N->getOperand(1), Imm) && N->getOperand(0).getOpcode() == ISD::OR && - isIntImmediate(N->getOperand(0).getOperand(1), Imm2)) { + isInt32Immediate(N->getOperand(0).getOperand(1), Imm2)) { unsigned MB, ME; Imm = ~(Imm^Imm2); if (isRunOfOnes(Imm, MB, ME)) { @@ -1046,12 +1117,14 @@ case ISD::SELECT_CC: { ISD::CondCode CC = cast(N->getOperand(4))->get(); - // handle the setcc cases here. select_cc lhs, 0, 1, 0, cc + // Handle the setcc cases here. select_cc lhs, 0, 1, 0, cc if (ConstantSDNode *N1C = dyn_cast(N->getOperand(1))) if (ConstantSDNode *N2C = dyn_cast(N->getOperand(2))) if (ConstantSDNode *N3C = dyn_cast(N->getOperand(3))) if (N1C->isNullValue() && N3C->isNullValue() && - N2C->getValue() == 1ULL && CC == ISD::SETNE) { + N2C->getValue() == 1ULL && CC == ISD::SETNE && + // FIXME: Implement this optzn for PPC64. + N->getValueType(0) == MVT::i32) { SDOperand LHS; Select(LHS, N->getOperand(0)); SDNode *Tmp = @@ -1068,8 +1141,10 @@ bool isFP = MVT::isFloatingPoint(N->getValueType(0)); unsigned SelectCCOp; - if (MVT::isInteger(N->getValueType(0))) - SelectCCOp = PPC::SELECT_CC_Int; + if (N->getValueType(0) == MVT::i32) + SelectCCOp = PPC::SELECT_CC_I4; + else if (N->getValueType(0) == MVT::i64) + SelectCCOp = PPC::SELECT_CC_I8; else if (N->getValueType(0) == MVT::f32) SelectCCOp = PPC::SELECT_CC_F4; else if (N->getValueType(0) == MVT::f64) @@ -1188,8 +1263,10 @@ Chain = SDOperand(ResNode, 0); InFlag = SDOperand(ResNode, 1); - SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, Chain.ResNo); - SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, InFlag.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, + Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, + InFlag.ResNo); Result = SDOperand(ResNode, N.ResNo); return; } @@ -1220,8 +1297,10 @@ Chain = SDOperand(ResNode, 0); InFlag = SDOperand(ResNode, 1); - SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, Chain.ResNo); - SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, InFlag.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, + Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, + InFlag.ResNo); Result = SDOperand(ResNode, N.ResNo); return; } @@ -1252,8 +1331,10 @@ Chain = SDOperand(ResNode, 0); InFlag = SDOperand(ResNode, 1); - SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, Chain.ResNo); - SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, InFlag.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 0, Chain.Val, + Chain.ResNo); + SelectionDAG::InsertISelMapEntry(CodeGenMap, N.Val, 1, InFlag.Val, + InFlag.ResNo); Result = SDOperand(ResNode, N.ResNo); return; } Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.192 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.193 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.192 Mon Jun 26 17:48:35 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Jun 26 19:04:13 2006 @@ -249,6 +249,7 @@ setOperationAction(ISD::BUILD_VECTOR, MVT::v4f32, Custom); } + setSetCCResultType(MVT::i32); setSetCCResultContents(ZeroOrOneSetCCResult); setStackPointerRegisterToSaveRestore(PPC::R1); @@ -2216,7 +2217,8 @@ MachineBasicBlock * PPCTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, MachineBasicBlock *BB) { - assert((MI->getOpcode() == PPC::SELECT_CC_Int || + assert((MI->getOpcode() == PPC::SELECT_CC_I4 || + MI->getOpcode() == PPC::SELECT_CC_I8 || MI->getOpcode() == PPC::SELECT_CC_F4 || MI->getOpcode() == PPC::SELECT_CC_F8 || MI->getOpcode() == PPC::SELECT_CC_VRRC) && Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.234 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.235 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.234 Mon Jun 26 17:47:37 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Mon Jun 26 19:04:13 2006 @@ -263,7 +263,9 @@ // scheduler into a branch sequence. let usesCustomDAGSchedInserter = 1, // Expanded by the scheduler. PPC970_Single = 1 in { - def SELECT_CC_Int : Pseudo<(ops GPRC:$dst, CRRC:$cond, GPRC:$T, GPRC:$F, + def SELECT_CC_I4 : Pseudo<(ops GPRC:$dst, CRRC:$cond, GPRC:$T, GPRC:$F, + i32imm:$BROPC), "; SELECT_CC PSEUDO!", []>; + def SELECT_CC_I8 : Pseudo<(ops G8RC:$dst, CRRC:$cond, G8RC:$T, G8RC:$F, i32imm:$BROPC), "; SELECT_CC PSEUDO!", []>; def SELECT_CC_F4 : Pseudo<(ops F4RC:$dst, CRRC:$cond, F4RC:$T, F4RC:$F, i32imm:$BROPC), "; SELECT_CC PSEUDO!", []>; From lattner at cs.uiuc.edu Mon Jun 26 19:10:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 19:10:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200606270010.TAA03207@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.193 -> 1.194 --- Log message: Fix variable shadowing issue --- Diffs of the changes: (+1 -2) PPCISelDAGToDAG.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.193 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.194 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.193 Mon Jun 26 19:04:13 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Mon Jun 26 19:10:13 2006 @@ -741,7 +741,7 @@ unsigned Opc; if (LHS.getValueType() == MVT::i32) { - unsigned Imm, Opc; + unsigned Imm; if (ISD::isUnsignedIntSetCC(CC)) { if (isInt32Immediate(RHS, Imm) && isUInt16(Imm)) return SDOperand(CurDAG->getTargetNode(PPC::CMPLWI, MVT::i32, LHS, @@ -757,7 +757,6 @@ } } else if (LHS.getValueType() == MVT::i64) { uint64_t Imm; - unsigned Opc; if (ISD::isUnsignedIntSetCC(CC)) { if (isInt64Immediate(RHS.Val, Imm) && isUInt16(Imm)) return SDOperand(CurDAG->getTargetNode(PPC::CMPLDI, MVT::i64, LHS, From lattner at cs.uiuc.edu Mon Jun 26 20:02:37 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 26 Jun 2006 20:02:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200606270102.UAA03554@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.180 -> 1.181 --- Log message: Print darwin stub stuff correctly in 64-bit mode. With this, treeadd works in ppc64 mode! --- Diffs of the changes: (+25 -7) PPCAsmPrinter.cpp | 32 +++++++++++++++++++++++++------- 1 files changed, 25 insertions(+), 7 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.180 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.181 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.180 Fri Jun 23 07:51:53 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Mon Jun 26 20:02:25 2006 @@ -268,13 +268,17 @@ DarwinDwarfWriter DW; - DarwinAsmPrinter(std::ostream &O, TargetMachine &TM) + DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM) : PPCAsmPrinter(O, TM), DW(O, this) { + bool isPPC64 = TM.getSubtargetImpl()->isPPC64(); CommentString = ";"; GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; // Marker for constant pool idxs ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. - Data64bitsDirective = 0; // we can't emit a 64-bit unit + if (isPPC64) + Data64bitsDirective = ".quad"; // we can't emit a 64-bit unit + else + Data64bitsDirective = 0; // we can't emit a 64-bit unit AlignmentIsInBytes = false; // Alignment is by power of 2. ConstantPoolSection = "\t.const\t"; // FIXME: Conditionalize jump table section based on PIC @@ -625,13 +629,15 @@ } } + bool isPPC64 = TD->getPointerSizeInBits() == 64; + // Output stubs for dynamically-linked functions if (TM.getRelocationModel() == Reloc::PIC) { for (std::set::iterator i = FnStubs.begin(), e = FnStubs.end(); i != e; ++i) { SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs," "pure_instructions,32", 0); - EmitAlignment(2); + EmitAlignment(4); O << "L" << *i << "$stub:\n"; O << "\t.indirect_symbol " << *i << "\n"; O << "\tmflr r0\n"; @@ -640,13 +646,19 @@ O << "\tmflr r11\n"; O << "\taddis r11,r11,ha16(L" << *i << "$lazy_ptr-L0$" << *i << ")\n"; O << "\tmtlr r0\n"; - O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr-L0$" << *i << ")(r11)\n"; + if (isPPC64) + O << "\tldu r12,lo16(L" << *i << "$lazy_ptr-L0$" << *i << ")(r11)\n"; + else + O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr-L0$" << *i << ")(r11)\n"; O << "\tmtctr r12\n"; O << "\tbctr\n"; SwitchToDataSection(".lazy_symbol_pointer", 0); O << "L" << *i << "$lazy_ptr:\n"; O << "\t.indirect_symbol " << *i << "\n"; - O << "\t.long dyld_stub_binding_helper\n"; + if (isPPC64) + O << "\t.quad dyld_stub_binding_helper\n"; + else + O << "\t.long dyld_stub_binding_helper\n"; } } else { for (std::set::iterator i = FnStubs.begin(), e = FnStubs.end(); @@ -657,13 +669,19 @@ O << "L" << *i << "$stub:\n"; O << "\t.indirect_symbol " << *i << "\n"; O << "\tlis r11,ha16(L" << *i << "$lazy_ptr)\n"; - O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr)(r11)\n"; + if (isPPC64) + O << "\tldu r12,lo16(L" << *i << "$lazy_ptr)(r11)\n"; + else + O << "\tlwzu r12,lo16(L" << *i << "$lazy_ptr)(r11)\n"; O << "\tmtctr r12\n"; O << "\tbctr\n"; SwitchToDataSection(".lazy_symbol_pointer", 0); O << "L" << *i << "$lazy_ptr:\n"; O << "\t.indirect_symbol " << *i << "\n"; - O << "\t.long dyld_stub_binding_helper\n"; + if (isPPC64) + O << "\t.quad dyld_stub_binding_helper\n"; + else + O << "\t.long dyld_stub_binding_helper\n"; } } From resistor at mac.com Mon Jun 26 21:17:20 2006 From: resistor at mac.com (Owen Anderson) Date: Mon, 26 Jun 2006 21:17:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200606270217.VAA03898@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.83 -> 1.84 --- Log message: De-pessimize the handling of LCSSA Phi nodes in IndVarSimplify. Hopefully this will make Shootout-C/nestedloop faster. --- Diffs of the changes: (+29 -15) IndVarSimplify.cpp | 44 +++++++++++++++++++++++++++++--------------- 1 files changed, 29 insertions(+), 15 deletions(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.83 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.84 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.83 Fri Jun 16 20:02:31 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Jun 26 21:17:08 2006 @@ -325,20 +325,8 @@ for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI) { Instruction *User = cast(*UI); - if (!L->contains(User->getParent())) { - // If this is a PHI node in the exit block and we're inserting, - // into the exit block, it must have a single entry. In this - // case, we can't insert the code after the PHI and have the PHI - // still use it. Instead, don't insert the the PHI. - if (PHINode *PN = dyn_cast(User)) { - // FIXME: This is a case where LCSSA pessimizes code, this - // should be fixed better. - if (PN->getNumOperands() == 2 && - PN->getParent() == BlockToInsertInto) - continue; - } + if (!L->contains(User->getParent())) ExtraLoopUsers.push_back(User); - } } if (!ExtraLoopUsers.empty()) { @@ -358,8 +346,34 @@ // Rewrite any users of the computed value outside of the loop // with the newly computed value. - for (unsigned i = 0, e = ExtraLoopUsers.size(); i != e; ++i) - ExtraLoopUsers[i]->replaceUsesOfWith(I, NewVal); + for (unsigned i = 0, e = ExtraLoopUsers.size(); i != e; ++i) { + PHINode* PN = dyn_cast(ExtraLoopUsers[i]); + if (PN && PN->getParent() == BlockToInsertInto) { + // We're dealing with an LCSSA Phi. Handle it specially. + Instruction* LCSSAInsertPt = BlockToInsertInto->begin(); + + Instruction* NewInstr = dyn_cast(NewVal); + if (Instruction* NewInstr = dyn_cast(NewVal)) + for (unsigned j = 0; j < NewInstr->getNumOperands(); ++j){ + Instruction* PredI = + dyn_cast(NewInstr->getOperand(j)); + if (PredI && L->contains(PredI->getParent())) { + PHINode* NewLCSSA = new PHINode(PredI->getType(), + PredI->getName() + ".lcssa", + LCSSAInsertPt); + NewLCSSA->addIncoming(PredI, + BlockToInsertInto->getSinglePredecessor()); + + NewInstr->replaceUsesOfWith(PredI, NewLCSSA); + } + } + + PN->replaceAllUsesWith(NewVal); + PN->eraseFromParent(); + } else { + ExtraLoopUsers[i]->replaceUsesOfWith(I, NewVal); + } + } // If this instruction is dead now, schedule it to be removed. if (I->use_empty()) From reid at x10sys.com Tue Jun 27 11:50:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 27 Jun 2006 11:50:12 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/GraphWriter.h Message-ID: <200606271650.LAA06261@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: GraphWriter.h updated: 1.26 -> 1.27 --- Log message: For PR801: http://llvm.org/PR801 : Refactor the Graph writing code to use a common implementation which is now in lib/Support/GraphWriter.cpp. This completes the PR. Patch by Anton Korobeynikov. Thanks, Anton! --- Diffs of the changes: (+58 -0) GraphWriter.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+) Index: llvm/include/llvm/Support/GraphWriter.h diff -u llvm/include/llvm/Support/GraphWriter.h:1.26 llvm/include/llvm/Support/GraphWriter.h:1.27 --- llvm/include/llvm/Support/GraphWriter.h:1.26 Fri Sep 30 19:19:21 2005 +++ llvm/include/llvm/Support/GraphWriter.h Tue Jun 27 11:49:46 2006 @@ -25,8 +25,10 @@ #include "llvm/Support/DOTGraphTraits.h" #include "llvm/ADT/GraphTraits.h" +#include "llvm/System/Path.h" #include #include +#include namespace llvm { @@ -59,6 +61,8 @@ } } +void DisplayGraph(const sys::Path& Filename); + template class GraphWriter { std::ostream &O; @@ -236,6 +240,60 @@ return O; } +template +sys::Path WriteGraph(const GraphType &G, + const std::string& Name, + const std::string& Title = "") { + sys::Path Filename = sys::Path::GetTemporaryDirectory();; + Filename.appendComponent(Name + ".dot"); + Filename.makeUnique(); + std::cerr << "Writing '" << Filename << "'... "; + + std::ofstream O(Filename.c_str()); + + if (O.good()) { + // Start the graph emission process... + GraphWriter W(O, G); + + // Output the header for the graph... + W.writeHeader(Title); + + // Emit all of the nodes in the graph... + W.writeNodes(); + + // Output any customizations on the graph + DOTGraphTraits::addCustomGraphFeatures(G, W); + + // Output the end of the graph + W.writeFooter(); + std::cerr << " done. \n"; + + O.close(); + + } else { + std::cerr << "error opening file for writing!\n"; + Filename.clear(); + } + + return Filename; +} + +/// ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, +/// then cleanup. For use from the debugger. +/// +template +void ViewGraph(const GraphType& G, + const std::string& Name, + const std::string& Title = "") { + sys::Path Filename = WriteGraph(G, Name, Title); + + if (Filename.isEmpty()) { + return; + } + + DisplayGraph(Filename); +} + } // End llvm namespace #endif From reid at x10sys.com Tue Jun 27 11:50:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 27 Jun 2006 11:50:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/CFGPrinter.cpp Message-ID: <200606271650.LAA06264@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: CFGPrinter.cpp updated: 1.15 -> 1.16 --- Log message: For PR801: http://llvm.org/PR801 : Refactor the Graph writing code to use a common implementation which is now in lib/Support/GraphWriter.cpp. This completes the PR. Patch by Anton Korobeynikov. Thanks, Anton! --- Diffs of the changes: (+1 -95) CFGPrinter.cpp | 96 --------------------------------------------------------- 1 files changed, 1 insertion(+), 95 deletions(-) Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.15 llvm/lib/Analysis/CFGPrinter.cpp:1.16 --- llvm/lib/Analysis/CFGPrinter.cpp:1.15 Mon Jun 5 10:44:46 2006 +++ llvm/lib/Analysis/CFGPrinter.cpp Tue Jun 27 11:49:46 2006 @@ -24,8 +24,6 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CFG.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" #include "llvm/Config/config.h" #include #include @@ -140,99 +138,7 @@ /// being a 'dot' and 'gv' program in your path. /// void Function::viewCFG() const { -#ifndef NDEBUG - char pathsuff[9]; - - sprintf(pathsuff, "%06u", unsigned(rand())); - - sys::Path TempDir = sys::Path::GetTemporaryDirectory(); - sys::Path Filename = TempDir; - - Filename.appendComponent("cfg" + getName() + "." + pathsuff + ".dot"); - std::cerr << "Writing '" << Filename << "'... "; - std::ofstream F(Filename.c_str()); - - if (!F.good()) { - std::cerr << " error opening file for writing!\n"; - return; - } - - WriteGraph(F, this); - F.close(); - std::cerr << "\n"; - -#if HAVE_GRAPHVIZ - sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); - std::vector args; - args.push_back(Graphviz.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'Graphviz' program... " << std::flush; - if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { - std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; - } else { - Filename.eraseFromDisk(); - return; - } -#elif (HAVE_GV && HAVE_DOT) - sys::Path PSFilename = TempDir; - PSFilename.appendComponent(std::string("cfg.tempgraph") + "." + pathsuff + ".ps"); - - sys::Path dot(LLVM_PATH_DOT); - std::vector args; - args.push_back(dot.c_str()); - args.push_back("-Tps"); - args.push_back("-Nfontname=Courier"); - args.push_back("-Gsize=7.5,10"); - args.push_back(Filename.c_str()); - args.push_back("-o"); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dot' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dot, &args[0])) { - std::cerr << "Error viewing graph: 'dot' not in path?\n"; - } else { - std::cerr << "\n"; - - sys::Path gv(LLVM_PATH_GV); - args.clear(); - args.push_back(gv.c_str()); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - sys::Program::ExecuteAndWait(gv, &args[0]); - } - Filename.eraseFromDisk(); - PSFilename.eraseFromDisk(); - return; -#elif HAVE_DOTTY - sys::Path dotty(LLVM_PATH_DOTTY); - std::vector args; - args.push_back(dotty.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dotty' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dotty, &args[0])) { - std::cerr << "Error viewing graph: 'dotty' not in path?\n"; - } else { -#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns - Filename.eraseFromDisk(); -#endif - return; - } -#endif - -#endif // NDEBUG - std::cerr << "Function::viewCFG is only available in debug builds on " - << "systems with Graphviz or gv or dotty!\n"; - -#ifndef NDEBUG - Filename.eraseFromDisk(); - TempDir.eraseFromDisk(true); -#endif + ViewGraph(this, "cfg" + getName()); } /// viewCFGOnly - This function is meant for use from the debugger. It works From reid at x10sys.com Tue Jun 27 11:50:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 27 Jun 2006 11:50:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200606271650.LAA06259@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGPrinter.cpp updated: 1.32 -> 1.33 --- Log message: For PR801: http://llvm.org/PR801 : Refactor the Graph writing code to use a common implementation which is now in lib/Support/GraphWriter.cpp. This completes the PR. Patch by Anton Korobeynikov. Thanks, Anton! --- Diffs of the changes: (+3 -91) SelectionDAGPrinter.cpp | 94 +----------------------------------------------- 1 files changed, 3 insertions(+), 91 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.32 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.33 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.32 Mon Jun 5 11:26:06 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Jun 27 11:49:46 2006 @@ -19,8 +19,6 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" #include @@ -127,95 +125,9 @@ void SelectionDAG::viewGraph() { // This code is only for debugging! #ifndef NDEBUG - char pathsuff[9]; - - sprintf(pathsuff, "%06u", unsigned(rand())); - - sys::Path TempDir = sys::Path::GetTemporaryDirectory(); - sys::Path Filename = TempDir; - Filename.appendComponent("dag." + getMachineFunction().getFunction()->getName() + "." + pathsuff + ".dot"); - std::cerr << "Writing '" << Filename.toString() << "'... "; - std::ofstream F(Filename.toString().c_str()); - - if (!F) { - std::cerr << " error opening file for writing!\n"; - return; - } - - WriteGraph(F, this); - F.close(); - std::cerr << "\n"; - -#if HAVE_GRAPHVIZ - sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); - std::vector args; - args.push_back(Graphviz.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'Graphviz' program... " << std::flush; - if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { - std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; - } else { - Filename.eraseFromDisk(); - return; - } -#elif (HAVE_GV && HAVE_DOT) - sys::Path PSFilename = TempDir; - PSFilename.appendComponent(std::string("dag.tempgraph") + "." + pathsuff + ".ps"); - - sys::Path dot(LLVM_PATH_DOT); - std::vector args; - args.push_back(dot.c_str()); - args.push_back("-Tps"); - args.push_back("-Nfontname=Courier"); - args.push_back("-Gsize=7.5,10"); - args.push_back(Filename.c_str()); - args.push_back("-o"); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dot' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dot, &args[0])) { - std::cerr << "Error viewing graph: 'dot' not in path?\n"; - } else { - std::cerr << "\n"; - - sys::Path gv(LLVM_PATH_GV); - args.clear(); - args.push_back(gv.c_str()); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - sys::Program::ExecuteAndWait(gv, &args[0]); - } - Filename.eraseFromDisk(); - PSFilename.eraseFromDisk(); - return; -#elif HAVE_DOTTY - sys::Path dotty(LLVM_PATH_DOTTY); - std::vector args; - args.push_back(dotty.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dotty' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dotty, &args[0])) { - std::cerr << "Error viewing graph: 'dotty' not in path?\n"; - } else { -#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns - Filename.eraseFromDisk(); -#endif - return; - } -#endif - -#endif // NDEBUG + ViewGraph(this, "dag." + getMachineFunction().getFunction()->getName()); +#else std::cerr << "SelectionDAG::viewGraph is only available in debug builds on " << "systems with Graphviz or gv!\n"; - -#ifndef NDEBUG - Filename.eraseFromDisk(); - TempDir.eraseFromDisk(true); -#endif +#endif // NDEBUG } From reid at x10sys.com Tue Jun 27 11:50:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 27 Jun 2006 11:50:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp Message-ID: <200606271650.LAA06263@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineFunction.cpp updated: 1.93 -> 1.94 --- Log message: For PR801: http://llvm.org/PR801 : Refactor the Graph writing code to use a common implementation which is now in lib/Support/GraphWriter.cpp. This completes the PR. Patch by Anton Korobeynikov. Thanks, Anton! --- Diffs of the changes: (+4 -92) MachineFunction.cpp | 96 ++-------------------------------------------------- 1 files changed, 4 insertions(+), 92 deletions(-) Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.93 llvm/lib/CodeGen/MachineFunction.cpp:1.94 --- llvm/lib/CodeGen/MachineFunction.cpp:1.93 Mon Jun 5 10:44:46 2006 +++ llvm/lib/CodeGen/MachineFunction.cpp Tue Jun 27 11:49:46 2006 @@ -27,8 +27,6 @@ #include "llvm/Instructions.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" #include "llvm/Config/config.h" #include #include @@ -220,97 +218,11 @@ void MachineFunction::viewCFG() const { #ifndef NDEBUG - char pathsuff[9]; - - sprintf(pathsuff, "%06u", unsigned(rand())); - - sys::Path TempDir = sys::Path::GetTemporaryDirectory(); - sys::Path Filename = TempDir; - Filename.appendComponent("mf" + getFunction()->getName() + "." + pathsuff + ".dot"); - std::cerr << "Writing '" << Filename << "'... "; - std::ofstream F(Filename.c_str()); - - if (!F) { - std::cerr << " error opening file for writing!\n"; - return; - } - - WriteGraph(F, this); - F.close(); - std::cerr << "\n"; - -#if HAVE_GRAPHVIZ - sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); - std::vector args; - args.push_back(Graphviz.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'Graphviz' program... " << std::flush; - if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { - std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; - } else { - Filename.eraseFromDisk(); - return; - } -#elif (HAVE_GV && HAVE_DOT) - sys::Path PSFilename = TempDir; - PSFilename.appendComponent(std::string("mf.tempgraph") + "." + pathsuff + ".ps"); - - sys::Path dot(LLVM_PATH_DOT); - std::vector args; - args.push_back(dot.c_str()); - args.push_back("-Tps"); - args.push_back("-Nfontname=Courier"); - args.push_back("-Gsize=7.5,10"); - args.push_back(Filename.c_str()); - args.push_back("-o"); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dot' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dot, &args[0])) { - std::cerr << "Error viewing graph: 'dot' not in path?\n"; - } else { - std::cerr << "\n"; - - sys::Path gv(LLVM_PATH_GV); - args.clear(); - args.push_back(gv.c_str()); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - sys::Program::ExecuteAndWait(gv, &args[0]); - } - Filename.eraseFromDisk(); - PSFilename.eraseFromDisk(); - return; -#elif HAVE_DOTTY - sys::Path dotty(LLVM_PATH_DOTTY); - std::vector args; - args.push_back(dotty.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dotty' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dotty, &args[0])) { - std::cerr << "Error viewing graph: 'dotty' not in path?\n"; - } else { -#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns - Filename.eraseFromDisk(); -#endif - return; - } -#endif - -#endif // NDEBUG - std::cerr << "MachineFunction::viewCFG is only available in debug builds on " + ViewGraph(this, "mf" + getFunction()->getName()); +#else + std::cerr << "SelectionDAG::viewGraph is only available in debug builds on " << "systems with Graphviz or gv!\n"; - -#ifndef NDEBUG - Filename.eraseFromDisk(); - TempDir.eraseFromDisk(true); -#endif +#endif // NDEBUG } void MachineFunction::viewCFGOnly() const From reid at x10sys.com Tue Jun 27 11:50:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 27 Jun 2006 11:50:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/GraphWriter.cpp Message-ID: <200606271650.LAA06260@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: GraphWriter.cpp added (r1.1) --- Log message: For PR801: http://llvm.org/PR801 : Refactor the Graph writing code to use a common implementation which is now in lib/Support/GraphWriter.cpp. This completes the PR. Patch by Anton Korobeynikov. Thanks, Anton! --- Diffs of the changes: (+89 -0) GraphWriter.cpp | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 89 insertions(+) Index: llvm/lib/Support/GraphWriter.cpp diff -c /dev/null llvm/lib/Support/GraphWriter.cpp:1.1 *** /dev/null Tue Jun 27 11:49:56 2006 --- llvm/lib/Support/GraphWriter.cpp Tue Jun 27 11:49:46 2006 *************** *** 0 **** --- 1,89 ---- + //===-- GraphWriter.cpp - Implements GraphWriter support routines ---------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements misc. GraphWriter support routines. + // + //===----------------------------------------------------------------------===// + + #include "llvm/System/Path.h" + #include "llvm/System/Program.h" + #include "llvm/Config/config.h" + + #include + + using namespace llvm; + + namespace llvm { + + void DisplayGraph(const sys::Path& Filename) + { + #if HAVE_GRAPHVIZ + sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); + + std::vector args; + args.push_back(Graphviz.c_str()); + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'Graphviz' program... " << std::flush; + if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { + std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; + } + #elif (HAVE_GV && HAVE_DOT) + sys::Path PSFilename = Filename; + PSFilename.appendSuffix("ps"); + + sys::Path dot(LLVM_PATH_DOT); + + std::vector args; + args.push_back(dot.c_str()); + args.push_back("-Tps"); + args.push_back("-Nfontname=Courier"); + args.push_back("-Gsize=7.5,10"); + args.push_back(Filename.c_str()); + args.push_back("-o"); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dot' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dot, &args[0])) { + std::cerr << "Error viewing graph: 'dot' not in path?\n"; + } else { + std::cerr << " done. \n"; + + sys::Path gv(LLVM_PATH_GV); + args.clear(); + args.push_back(gv.c_str()); + args.push_back(PSFilename.c_str()); + args.push_back(0); + + sys::Program::ExecuteAndWait(gv, &args[0]); + } + PSFilename.eraseFromDisk(); + #elif HAVE_DOTTY + sys::Path dotty(LLVM_PATH_DOTTY); + + std::vector args; + args.push_back(Filename.c_str()); + args.push_back(0); + + std::cerr << "Running 'dotty' program... " << std::flush; + if (sys::Program::ExecuteAndWait(dotty, &args[0])) { + std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + } else { + #ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns. + return; + #endif + } + #endif + + Filename.eraseFromDisk(); + } + + } // End llvm namespace From reid at x10sys.com Tue Jun 27 11:50:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 27 Jun 2006 11:50:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp Message-ID: <200606271650.LAA06262@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Printer.cpp updated: 1.84 -> 1.85 --- Log message: For PR801: http://llvm.org/PR801 : Refactor the Graph writing code to use a common implementation which is now in lib/Support/GraphWriter.cpp. This completes the PR. Patch by Anton Korobeynikov. Thanks, Anton! --- Diffs of the changes: (+1 -86) Printer.cpp | 87 ------------------------------------------------------------ 1 files changed, 1 insertion(+), 86 deletions(-) Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.84 llvm/lib/Analysis/DataStructure/Printer.cpp:1.85 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.84 Mon Jun 5 10:44:46 2006 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Tue Jun 27 11:49:46 2006 @@ -19,8 +19,6 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" #include "llvm/ADT/Statistic.h" #include "llvm/Config/config.h" #include @@ -259,90 +257,7 @@ /// then cleanup. For use from the debugger. /// void DSGraph::viewGraph() const { - char pathsuff[9]; - - sprintf(pathsuff, "%06u", unsigned(rand())); - - sys::Path TempDir = sys::Path::GetTemporaryDirectory(); - sys::Path Filename = TempDir; - Filename.appendComponent("ds.tempgraph." + std::string(pathsuff) + ".dot"); - std::cerr << "Writing '" << Filename << "'... "; - std::ofstream F(Filename.c_str()); - - if (!F.good()) { - std::cerr << " error opening file for writing!\n"; - return; - } - - print(F); - F.close(); - std::cerr << "\n"; - -#if HAVE_GRAPHVIZ - sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); - std::vector args; - args.push_back(Graphviz.c_str()); - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'Graphviz' program... " << std::flush; - if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { - std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; - } else { - Filename.eraseFromDisk(); - return; - } -#elif (HAVE_GV && HAVE_DOT) - sys::Path PSFilename = TempDir; - PSFilename.appendComponent(std::string("ds.tempgraph") + "." + pathsuff + ".ps"); - - sys::Path dot(LLVM_PATH_DOT); - std::vector args; - args.push_back(dot.c_str()); - args.push_back("-Tps"); - args.push_back("-Nfontname=Courier"); - args.push_back("-Gsize=7.5,10"); - args.push_back(Filename.c_str()); - args.push_back("-o"); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dot' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dot, &args[0])) { - std::cerr << "Error viewing graph: 'dot' not in path?\n"; - } else { - std::cerr << "\n"; - - sys::Path gv(LLVM_PATH_GV); - args.clear(); - args.push_back(gv.c_str()); - args.push_back(PSFilename.c_str()); - args.push_back(0); - - sys::Program::ExecuteAndWait(gv, &args[0]); - } - Filename.eraseFromDisk(); - PSFilename.eraseFromDisk(); - return; -#elif HAVE_DOTTY - sys::Path dotty(LLVM_PATH_DOTTY); - std::vector args; - args.push_back(Filename.c_str()); - args.push_back(0); - - std::cerr << "Running 'dotty' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dotty, &args[0])) { - std::cerr << "Error viewing graph: 'dotty' not in path?\n"; - } else { -#ifndef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns - Filename.eraseFromDisk(); -#endif - return; - } -#endif - - Filename.eraseFromDisk(); - TempDir.eraseFromDisk(true); + ViewGraph(this, "ds.tempgraph", "DataStructures"); } From lattner at cs.uiuc.edu Tue Jun 27 12:30:20 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 12:30:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstr64Bit.td Message-ID: <200606271730.MAA12683@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.11 -> 1.12 --- Log message: Add zextload from i32 -> i64, with this, perimeter works. --- Diffs of the changes: (+3 -0) PPCInstr64Bit.td | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.11 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.12 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.11 Mon Jun 26 18:53:10 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Jun 27 12:30:08 2006 @@ -228,6 +228,9 @@ def LDX : XForm_1<31, 21, (ops G8RC:$rD, memrr:$src), "ldx $rD, $src", LdStLD, [(set G8RC:$rD, (load xaddr:$src))]>, isPPC64; +def LWZ8 : DForm_1<32, (ops G8RC:$rD, memri:$src), + "lwz $rD, $src", LdStGeneral, + [(set G8RC:$rD, (zextload iaddr:$src, i32))]>, isPPC64; } let isStore = 1, noResults = 1, PPC970_Unit = 2 in { def STD : DSForm_2<62, 0, (ops G8RC:$rS, memrix:$dst), From lattner at cs.uiuc.edu Tue Jun 27 12:35:09 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 12:35:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200606271735.MAA13161@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.193 -> 1.194 --- Log message: Use i32 for shift amounts instead of i64. This gets bisort working. --- Diffs of the changes: (+1 -0) PPCISelLowering.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.193 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.194 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.193 Mon Jun 26 19:04:13 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jun 27 12:34:57 2006 @@ -250,6 +250,7 @@ } setSetCCResultType(MVT::i32); + setShiftAmountType(MVT::i32); setSetCCResultContents(ZeroOrOneSetCCResult); setStackPointerRegisterToSaveRestore(PPC::R1); From dpatel at apple.com Tue Jun 27 13:07:41 2006 From: dpatel at apple.com (Devang Patel) Date: Tue, 27 Jun 2006 13:07:41 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200606271807.NAA17686@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.32 -> 1.33 --- Log message: Fix cut-n-pasto in comments. --- Diffs of the changes: (+5 -6) llvm-ld.cpp | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.32 llvm/tools/llvm-ld/llvm-ld.cpp:1.33 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.32 Wed Jun 7 18:03:13 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Tue Jun 27 13:07:29 2006 @@ -218,7 +218,7 @@ /// specified bytecode file. /// /// Inputs: -/// InputFilename - The name of the output bytecode file. +/// InputFilename - The name of the input bytecode file. /// OutputFilename - The name of the file to generate. /// llc - The pathname to use for LLC. /// envp - The environment to use when running LLC. @@ -240,8 +240,7 @@ return sys::Program::ExecuteAndWait(llc,&args[0]); } -/// GenerateAssembly - generates a native assembly language source file from the -/// specified bytecode file. +/// GenerateCFile - generates a C source file from the specified bytecode file. static int GenerateCFile(const std::string &OutputFile, const std::string &InputFile, const sys::Path &llc) { @@ -257,11 +256,11 @@ return sys::Program::ExecuteAndWait(llc, &args[0]); } -/// GenerateNative - generates a native assembly language source file from the -/// specified assembly source file. +/// GenerateNative - generates a native object file from the +/// specified bytecode file. /// /// Inputs: -/// InputFilename - The name of the output bytecode file. +/// InputFilename - The name of the input bytecode file. /// OutputFilename - The name of the file to generate. /// Libraries - The list of libraries with which to link. /// LibPaths - The list of directories in which to find libraries. From lattner at cs.uiuc.edu Tue Jun 27 13:18:53 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 13:18:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp PPCCodeEmitter.cpp PPCISelLowering.cpp PPCInstr64Bit.td PPCInstrInfo.td Message-ID: <200606271818.NAA19161@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.23 -> 1.24 PPCCodeEmitter.cpp updated: 1.59 -> 1.60 PPCISelLowering.cpp updated: 1.194 -> 1.195 PPCInstr64Bit.td updated: 1.12 -> 1.13 PPCInstrInfo.td updated: 1.235 -> 1.236 --- Log message: Implement 64-bit undef, sub, shl/shr, srem/urem --- Diffs of the changes: (+23 -6) PPCBranchSelector.cpp | 3 ++- PPCCodeEmitter.cpp | 3 ++- PPCISelLowering.cpp | 2 ++ PPCInstr64Bit.td | 19 ++++++++++++++++--- PPCInstrInfo.td | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.23 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.24 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.23 Thu May 4 12:21:19 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Tue Jun 27 13:18:40 2006 @@ -52,7 +52,8 @@ // minor pessimization that saves us from having to worry about // keeping the offsets up to date later when we emit long branch glue. return 8; - case PPC::IMPLICIT_DEF_GPR: // no asm emitted + case PPC::IMPLICIT_DEF_GPRC: // no asm emitted + case PPC::IMPLICIT_DEF_G8RC: // no asm emitted case PPC::IMPLICIT_DEF_F4: // no asm emitted case PPC::IMPLICIT_DEF_F8: // no asm emitted return 0; Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.59 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.60 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.59 Wed May 3 15:30:20 2006 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Tue Jun 27 13:18:40 2006 @@ -125,7 +125,8 @@ default: MCE.emitWordBE(getBinaryCodeForInstr(*I)); break; - case PPC::IMPLICIT_DEF_GPR: + case PPC::IMPLICIT_DEF_GPRC: + case PPC::IMPLICIT_DEF_G8RC: case PPC::IMPLICIT_DEF_F8: case PPC::IMPLICIT_DEF_F4: case PPC::IMPLICIT_DEF_VRRC: Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.194 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.195 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.194 Tue Jun 27 12:34:57 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jun 27 13:18:41 2006 @@ -58,6 +58,8 @@ // PowerPC has no SREM/UREM instructions setOperationAction(ISD::SREM, MVT::i32, Expand); setOperationAction(ISD::UREM, MVT::i32, Expand); + setOperationAction(ISD::SREM, MVT::i64, Expand); + setOperationAction(ISD::UREM, MVT::i64, Expand); // We don't support sin/cos/sqrt/fmod setOperationAction(ISD::FSIN , MVT::f64, Expand); Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.12 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.13 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.12 Tue Jun 27 12:30:08 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Jun 27 13:18:41 2006 @@ -54,6 +54,14 @@ //===----------------------------------------------------------------------===// +// Pseudo instructions. +// + +def IMPLICIT_DEF_G8RC : Pseudo<(ops G8RC:$rD), "; $rD = IMPLICIT_DEF_G8RC", + [(set G8RC:$rD, (undef))]>; + + +//===----------------------------------------------------------------------===// // Fixed point instructions. // @@ -134,7 +142,12 @@ "addis $rD, $rA, $imm", IntGeneral, [(set G8RC:$rD, (add G8RC:$rA, imm16ShiftedSExt:$imm))]>; - +def SUBFIC8: DForm_2< 8, (ops G8RC:$rD, G8RC:$rA, s16imm64:$imm), + "subfic $rD, $rA, $imm", IntGeneral, + [(set G8RC:$rD, (subc immSExt16:$imm, G8RC:$rA))]>; +def SUBF8 : XOForm_1<31, 40, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "subf $rT, $rA, $rB", IntGeneral, + [(set G8RC:$rT, (sub G8RC:$rB, G8RC:$rA))]>; def MULHD : XOForm_1<31, 73, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), @@ -326,9 +339,9 @@ (OR8To4 G8RC:$in, G8RC:$in)>; // SHL/SRL -def : Pat<(shl G8RC:$in, (i64 imm:$imm)), +def : Pat<(shl G8RC:$in, (i32 imm:$imm)), (RLDICR G8RC:$in, imm:$imm, (SHL64 imm:$imm))>; -def : Pat<(srl G8RC:$in, (i64 imm:$imm)), +def : Pat<(srl G8RC:$in, (i32 imm:$imm)), (RLDICL G8RC:$in, (SRL64 imm:$imm), imm:$imm)>; // Hi and Lo for Darwin Global Addresses. Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.235 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.236 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.235 Mon Jun 26 19:04:13 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Jun 27 13:18:41 2006 @@ -252,7 +252,7 @@ def UPDATE_VRSAVE : Pseudo<(ops GPRC:$rD, GPRC:$rS), "UPDATE_VRSAVE $rD, $rS", []>; } -def IMPLICIT_DEF_GPR : Pseudo<(ops GPRC:$rD), "; $rD = IMPLICIT_DEF_GPRC", +def IMPLICIT_DEF_GPRC: Pseudo<(ops GPRC:$rD), "; $rD = IMPLICIT_DEF_GPRC", [(set GPRC:$rD, (undef))]>; def IMPLICIT_DEF_F8 : Pseudo<(ops F8RC:$rD), "; $rD = IMPLICIT_DEF_F8", [(set F8RC:$rD, (undef))]>; From lattner at cs.uiuc.edu Tue Jun 27 13:23:03 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 13:23:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstr64Bit.td Message-ID: <200606271823.NAA19953@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.13 -> 1.14 --- Log message: Fix an incorrect store pattern. This fixes em3d. --- Diffs of the changes: (+1 -1) PPCInstr64Bit.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.13 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.14 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.13 Tue Jun 27 13:18:41 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Jun 27 13:22:50 2006 @@ -251,7 +251,7 @@ [(store G8RC:$rS, ixaddr:$dst)]>, isPPC64; def STDX : XForm_8<31, 149, (ops G8RC:$rS, memrr:$dst), "stdx $rS, $dst", LdStSTD, - [(store G8RC:$rS, iaddr:$dst)]>, isPPC64, + [(store G8RC:$rS, xaddr:$dst)]>, isPPC64, PPC970_DGroup_Cracked; def STDUX : XForm_8<31, 181, (ops G8RC:$rS, memrr:$dst), "stdux $rS, $dst", LdStSTD, From lattner at cs.uiuc.edu Tue Jun 27 13:36:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 13:36:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstr64Bit.td PPCInstrInfo.td Message-ID: <200606271836.NAA21874@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.14 -> 1.15 PPCInstrInfo.td updated: 1.236 -> 1.237 --- Log message: Add 64-bit MTCTR so that indirect calls work. --- Diffs of the changes: (+6 -2) PPCInstr64Bit.td | 4 ++++ PPCInstrInfo.td | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.14 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.15 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.14 Tue Jun 27 13:22:50 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Jun 27 13:36:44 2006 @@ -60,6 +60,10 @@ def IMPLICIT_DEF_G8RC : Pseudo<(ops G8RC:$rD), "; $rD = IMPLICIT_DEF_G8RC", [(set G8RC:$rD, (undef))]>; +let Pattern = [(PPCmtctr G8RC:$rS)] in { +def MTCTR8 : XFXForm_7_ext<31, 467, 9, (ops G8RC:$rS), "mtctr $rS", SprMTSPR>, + PPC970_DGroup_First, PPC970_Unit_FXU; +} //===----------------------------------------------------------------------===// // Fixed point instructions. Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.236 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.237 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.236 Tue Jun 27 13:18:41 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Jun 27 13:36:44 2006 @@ -71,7 +71,7 @@ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeq,[SDNPHasChain]>; def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PPCCallSeq,[SDNPHasChain]>; -def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisVT<0, i32>]>; +def SDT_PPCCall : SDTypeProfile<0, -1, [SDTCisInt<0>]>; def PPCcall : SDNode<"PPCISD::CALL", SDT_PPCCall, [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>; def PPCmtctr : SDNode<"PPCISD::MTCTR", SDT_PPCCall, @@ -323,7 +323,7 @@ def BL : IForm<18, 0, 1, (ops calltarget:$func, variable_ops), "bl $func", BrB, []>; // See Pat patterns below. def BLA : IForm<18, 1, 1, (ops aaddr:$func, variable_ops), - "bla $func", BrB, [(PPCcall imm:$func)]>; + "bla $func", BrB, [(PPCcall (i32 imm:$func))]>; def BCTRL : XLForm_2_ext<19, 528, 20, 0, 1, (ops variable_ops), "bctrl", BrB, [(PPCbctrl)]>; } From lattner at cs.uiuc.edu Tue Jun 27 13:40:20 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 13:40:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200606271840.NAA22289@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.195 -> 1.196 --- Log message: PPC doesn't have bit converts to/from i64 --- Diffs of the changes: (+2 -0) PPCISelLowering.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.195 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.196 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.195 Tue Jun 27 13:18:41 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jun 27 13:40:08 2006 @@ -110,6 +110,8 @@ setOperationAction(ISD::BIT_CONVERT, MVT::f32, Expand); setOperationAction(ISD::BIT_CONVERT, MVT::i32, Expand); + setOperationAction(ISD::BIT_CONVERT, MVT::i64, Expand); + setOperationAction(ISD::BIT_CONVERT, MVT::f64, Expand); // PowerPC does not have truncstore for i1. setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote); From lattner at cs.uiuc.edu Tue Jun 27 13:56:01 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 13:56:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Message-ID: <200606271856.NAA23632@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.70 -> 1.71 --- Log message: Fix rewriting frame offsets with ixaddr instructions, which implicitly shift the offset two bits to the left. --- Diffs of the changes: (+21 -8) PPCRegisterInfo.cpp | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.70 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.71 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.70 Tue Jun 20 18:18:58 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Tue Jun 27 13:55:49 2006 @@ -390,9 +390,27 @@ // Take into account whether it's an add or mem instruction unsigned OffIdx = (i == 2) ? 1 : 2; + // Figure out if the offset in the instruction is shifted right two bits. This + // is true for instructions like "STD", which the machine implicitly adds two + // low zeros to. + bool isIXAddr = false; + switch (MI.getOpcode()) { + case PPC::LWA: + case PPC::LD: + case PPC::STD: + case PPC::STD_32: + isIXAddr = true; + break; + } + + // Now add the frame object offset to the offset from r1. - int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) + - MI.getOperand(OffIdx).getImmedValue(); + int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex); + + if (!isIXAddr) + Offset += MI.getOperand(OffIdx).getImmedValue(); + else + Offset += MI.getOperand(OffIdx).getImmedValue() << 2; // If we're not using a Frame Pointer that has been set to the value of the // SP before having the stack size subtracted from it, then add the stack size @@ -415,14 +433,9 @@ MI.getOperand(1).ChangeToRegister(MI.getOperand(i).getReg()); MI.getOperand(2).ChangeToRegister(PPC::R0); } else { - switch (MI.getOpcode()) { - case PPC::LWA: - case PPC::LD: - case PPC::STD: - case PPC::STD_32: + if (isIXAddr) { assert((Offset & 3) == 0 && "Invalid frame offset!"); Offset >>= 2; // The actual encoded value has the low two bits zero. - break; } MI.getOperand(OffIdx).ChangeToImmediate(Offset); } From lattner at cs.uiuc.edu Tue Jun 27 15:07:38 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:07:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCInstr64Bit.td PPCInstrFormats.td Message-ID: <200606272007.PAA29639@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.181 -> 1.182 PPCInstr64Bit.td updated: 1.15 -> 1.16 PPCInstrFormats.td updated: 1.76 -> 1.77 --- Log message: Add a pattern for i64 sra. Print 8-byte units with a space between the .quad and the data --- Diffs of the changes: (+7 -4) PPCAsmPrinter.cpp | 2 +- PPCInstr64Bit.td | 6 ++++-- PPCInstrFormats.td | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.181 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.182 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.181 Mon Jun 26 20:02:25 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Jun 27 15:07:26 2006 @@ -276,7 +276,7 @@ PrivateGlobalPrefix = "L"; // Marker for constant pool idxs ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. if (isPPC64) - Data64bitsDirective = ".quad"; // we can't emit a 64-bit unit + Data64bitsDirective = ".quad\t"; // we can't emit a 64-bit unit else Data64bitsDirective = 0; // we can't emit a 64-bit unit AlignmentIsInBytes = false; // Alignment is by power of 2. Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.15 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.16 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.15 Tue Jun 27 13:36:44 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Jun 27 15:07:26 2006 @@ -190,8 +190,10 @@ "extsw $rA, $rS", IntGeneral, [(set G8RC:$rA, (sext GPRC:$rS))]>, isPPC64; -def SRADI : XSForm_1<31, 413, (ops GPRC:$rA, GPRC:$rS, u6imm:$SH), - "sradi $rA, $rS, $SH", IntRotateD>, isPPC64; +def SRADI : XSForm_1<31, 413, (ops G8RC:$rA, G8RC:$rS, u6imm:$SH), + "sradi $rA, $rS, $SH", IntRotateD, + [(set G8RC:$rA, (sra G8RC:$rS, (i32 imm:$SH)))]>, isPPC64; + def DIVD : XOForm_1<31, 489, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), "divd $rT, $rA, $rB", IntDivD, [(set G8RC:$rT, (sdiv G8RC:$rA, G8RC:$rB))]>, isPPC64, Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.76 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.77 --- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.76 Tue Jun 20 18:18:58 2006 +++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Tue Jun 27 15:07:26 2006 @@ -501,13 +501,14 @@ // 1.7.10 XS-Form class XSForm_1 opcode, bits<9> xo, dag OL, string asmstr, - InstrItinClass itin> + InstrItinClass itin, list pattern> : I { bits<5> RS; bits<5> A; bits<6> SH; bit RC = 0; // set by isDOT + let Pattern = pattern; let Inst{6-10} = RS; let Inst{11-15} = A; From lattner at cs.uiuc.edu Tue Jun 27 15:15:04 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:15:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200606272015.PAA30549@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.196 -> 1.197 --- Log message: Implement 64-bit select, bswap, etc. --- Diffs of the changes: (+4 -0) PPCISelLowering.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.196 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.197 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.196 Tue Jun 27 13:40:08 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jun 27 15:14:52 2006 @@ -82,12 +82,16 @@ setOperationAction(ISD::BSWAP, MVT::i32 , Expand); setOperationAction(ISD::CTPOP, MVT::i32 , Expand); setOperationAction(ISD::CTTZ , MVT::i32 , Expand); + setOperationAction(ISD::BSWAP, MVT::i64 , Expand); + setOperationAction(ISD::CTPOP, MVT::i64 , Expand); + setOperationAction(ISD::CTTZ , MVT::i64 , Expand); // PowerPC does not have ROTR setOperationAction(ISD::ROTR, MVT::i32 , Expand); // PowerPC does not have Select setOperationAction(ISD::SELECT, MVT::i32, Expand); + setOperationAction(ISD::SELECT, MVT::i64, Expand); setOperationAction(ISD::SELECT, MVT::f32, Expand); setOperationAction(ISD::SELECT, MVT::f64, Expand); From lattner at cs.uiuc.edu Tue Jun 27 15:21:05 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:21:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200606272021.PAA31074@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.182 -> 1.183 --- Log message: Print stubs for external globals right. --- Diffs of the changes: (+5 -1) PPCAsmPrinter.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.182 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.183 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.182 Tue Jun 27 15:07:26 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Jun 27 15:20:53 2006 @@ -694,7 +694,11 @@ E = GVStubs.end(); I != E; ++I) { O << "L" << *I << "$non_lazy_ptr:\n"; O << "\t.indirect_symbol " << *I << "\n"; - O << "\t.long\t0\n"; + if (isPPC64) + O << "\t.quad\t0\n"; + else + O << "\t.long\t0\n"; + } } From evan.cheng at apple.com Tue Jun 27 15:30:40 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 27 Jun 2006 15:30:40 -0500 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200606272030.PAA31671@zion.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.110 -> 1.111 --- Log message: Fix -extraflags --- Diffs of the changes: (+1 -1) NightlyTest.pl | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.110 llvm/utils/NightlyTest.pl:1.111 --- llvm/utils/NightlyTest.pl:1.110 Tue Jun 20 13:49:13 2006 +++ llvm/utils/NightlyTest.pl Tue Jun 27 15:30:28 2006 @@ -334,7 +334,7 @@ $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; } if (/^-extraflags/) { - $PROGTESTOPTS .= " EXTRA_OPTIONS=\'$ARGV[0]\'"; shift; next; + $CONFIGUREARGS .= " --with-extra-options=\'$ARGV[0]\'"; shift; next; } if (/^-noexternals$/) { $NOEXTERNALS = 1; next; } if (/^-nodejagnu$/) { $NODEJAGNU = 1; next; } From evan.cheng at apple.com Tue Jun 27 15:34:27 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 27 Jun 2006 15:34:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td Message-ID: <200606272034.PAA31932@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.td updated: 1.276 -> 1.277 --- Log message: Remove dead code. --- Diffs of the changes: (+0 -6) X86InstrInfo.td | 6 ------ 1 files changed, 6 deletions(-) Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.276 llvm/lib/Target/X86/X86InstrInfo.td:1.277 --- llvm/lib/Target/X86/X86InstrInfo.td:1.276 Wed Jun 14 17:24:55 2006 +++ llvm/lib/Target/X86/X86InstrInfo.td Tue Jun 27 15:34:14 2006 @@ -277,12 +277,6 @@ return (int32_t)N->getValue() == (int8_t)N->getValue(); }]>; -def i16immZExt8 : PatLeaf<(i16 imm), [{ - // i16immZExt8 predicate - True if the 16-bit immediate fits in a 8-bit zero - // extended field. - return (uint16_t)N->getValue() == (uint8_t)N->getValue(); -}]>; - // Helper fragments for loads. def loadiPTR : PatFrag<(ops node:$ptr), (iPTR (load node:$ptr))>; From lattner at cs.uiuc.edu Tue Jun 27 15:35:48 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:35:48 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp ToolRunner.cpp ToolRunner.h Message-ID: <200606272035.PAA32067@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.61 -> 1.62 ToolRunner.cpp updated: 1.53 -> 1.54 ToolRunner.h updated: 1.21 -> 1.22 --- Log message: Pass -Xlinker flags to gcc when it builds the shared object. --- Diffs of the changes: (+45 -25) ExecutionDriver.cpp | 4 +-- ToolRunner.cpp | 61 ++++++++++++++++++++++++++++++++++------------------ ToolRunner.h | 5 ++-- 3 files changed, 45 insertions(+), 25 deletions(-) Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.61 llvm/tools/bugpoint/ExecutionDriver.cpp:1.62 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.61 Mon Jun 12 22:10:48 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Tue Jun 27 15:35:36 2006 @@ -288,7 +288,7 @@ std::string SharedObjectFile; if (gcc->MakeSharedObject(OutputCFile.toString(), GCC::CFile, - SharedObjectFile)) + SharedObjectFile, AdditionalLinkerArgs)) exit(1); // Remove the intermediate C file @@ -308,7 +308,7 @@ bool ProgramExitedNonzero; // Execute the program, generating an output file... - sys::Path Output (executeProgram("", BytecodeFile, SharedObject, 0, + sys::Path Output(executeProgram("", BytecodeFile, SharedObject, 0, &ProgramExitedNonzero)); // If we're checking the program exit code, assume anything nonzero is bad. Index: llvm/tools/bugpoint/ToolRunner.cpp diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.53 llvm/tools/bugpoint/ToolRunner.cpp:1.54 --- llvm/tools/bugpoint/ToolRunner.cpp:1.53 Fri Jun 9 16:31:53 2006 +++ llvm/tools/bugpoint/ToolRunner.cpp Tue Jun 27 15:35:36 2006 @@ -459,44 +459,63 @@ } int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, - std::string &OutputFile) { + std::string &OutputFile, + const std::vector &ArgsForGCC) { sys::Path uniqueFilename(InputFile+LTDL_SHLIB_EXT); uniqueFilename.makeUnique(); OutputFile = uniqueFilename.toString(); + std::vector GCCArgs; + + GCCArgs.push_back(GCCPath.c_str()); + + // Compile the C/asm file into a shared object - const char* GCCArgs[] = { - GCCPath.c_str(), - "-x", (fileType == AsmFile) ? "assembler" : "c", - "-fno-strict-aliasing", - InputFile.c_str(), // Specify the input filename... + GCCArgs.push_back("-x"); + GCCArgs.push_back(fileType == AsmFile ? "assembler" : "c"); + GCCArgs.push_back("-fno-strict-aliasing"); + GCCArgs.push_back(InputFile.c_str()); // Specify the input filename. #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) - "-G", // Compile a shared library, `-G' for Sparc + GCCArgs.push_back("-G"); // Compile a shared library, `-G' for Sparc #elif defined(__APPLE__) - "-single_module", // link all source files into a single module - "-dynamiclib", // `-dynamiclib' for MacOS X/PowerPC - "-undefined", // in data segment, rather than generating - "dynamic_lookup", // blocks. dynamic_lookup requires that you set - // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. + // link all source files into a single module in data segment, rather than + // generating blocks. dynamic_lookup requires that you set + // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. FIXME: it would be better for + // bugpoint to just pass that in the environment of GCC. + GCCArgs.push_back("-single_module"); + GCCArgs.push_back("-dynamiclib"); // `-dynamiclib' for MacOS X/PowerPC + GCCArgs.push_back("-undefined"); + GCCArgs.push_back("dynamic_lookup"); #else - "-shared", // `-shared' for Linux/X86, maybe others + GCCArgs.push_back("-shared"); // `-shared' for Linux/X86, maybe others #endif #if defined(__ia64__) || defined(__alpha__) - "-fPIC", // IA64 requires shared objs to contain PIC + GCCArgs.push_back("-fPIC"); // Requires shared objs to contain PIC #endif #ifdef __sparc__ - "-mcpu=v9", + GCCArgs.push_back("-mcpu=v9"); #endif - "-o", OutputFile.c_str(), // Output to the right filename... - "-O2", // Optimize the program a bit... - 0 - }; + GCCArgs.push_back("-o"); + GCCArgs.push_back(OutputFile.c_str()); // Output to the right filename. + GCCArgs.push_back("-O2"); // Optimize the program a bit. + + + + // Add any arguments intended for GCC. We locate them here because this is + // most likely -L and -l options that need to come before other libraries but + // after the source. Other options won't be sensitive to placement on the + // command line, so this should be safe. + for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i) + GCCArgs.push_back(ArgsForGCC[i].c_str()); + GCCArgs.push_back(0); // NULL terminator + + std::cout << "" << std::flush; - if (RunProgramWithTimeout(GCCPath, GCCArgs, sys::Path(), sys::Path(), + if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], sys::Path(), sys::Path(), sys::Path())) { - ProcessFailure(GCCPath, GCCArgs); + ProcessFailure(GCCPath, &GCCArgs[0]); return 1; } return 0; Index: llvm/tools/bugpoint/ToolRunner.h diff -u llvm/tools/bugpoint/ToolRunner.h:1.21 llvm/tools/bugpoint/ToolRunner.h:1.22 --- llvm/tools/bugpoint/ToolRunner.h:1.21 Tue Jun 6 17:30:59 2006 +++ llvm/tools/bugpoint/ToolRunner.h Tue Jun 27 15:35:36 2006 @@ -48,7 +48,7 @@ public: enum FileType { AsmFile, CFile }; - static GCC* create(const std::string &ProgramPath, std::string &Message); + static GCC *create(const std::string &ProgramPath, std::string &Message); /// ExecuteProgram - Execute the program specified by "ProgramFile" (which is /// either a .s file, or a .c file, specified by FileType), with the specified @@ -70,7 +70,8 @@ /// file or a .s file) into a shared object. /// int MakeSharedObject(const std::string &InputFile, FileType fileType, - std::string &OutputFile); + std::string &OutputFile, + const std::vector &ArgsForGCC); }; From lattner at cs.uiuc.edu Tue Jun 27 15:37:13 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:37:13 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec Message-ID: <200606272037.PAA32208@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec updated: 1.54 -> 1.55 --- Log message: Pass EXTRA_FLAGS to bugpoint. --- Diffs of the changes: (+1 -1) Makefile.spec | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/External/SPEC/Makefile.spec diff -u llvm-test/External/SPEC/Makefile.spec:1.54 llvm-test/External/SPEC/Makefile.spec:1.55 --- llvm-test/External/SPEC/Makefile.spec:1.54 Tue Jun 13 13:52:28 2006 +++ llvm-test/External/SPEC/Makefile.spec Tue Jun 27 15:37:01 2006 @@ -138,7 +138,7 @@ # Give bugpoint information about LDFLAGS to pass down to the actual link stage # of the program. -BUGPOINT_OPTIONS += $(LDFLAGS:%=-Xlinker=%) +BUGPOINT_OPTIONS += $(LDFLAGS:%=-Xlinker=%) $(EXTRA_OPTIONS:%=-Xlinker=%) # Specify stdin, reference output, and command line options for the program... From lattner at cs.uiuc.edu Tue Jun 27 15:37:13 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:37:13 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200606272037.PAA32213@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.219 -> 1.220 --- Log message: Pass EXTRA_FLAGS to bugpoint. --- Diffs of the changes: (+1 -1) Makefile.programs | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.219 llvm-test/Makefile.programs:1.220 --- llvm-test/Makefile.programs:1.219 Mon Jun 26 13:14:59 2006 +++ llvm-test/Makefile.programs Tue Jun 27 15:37:01 2006 @@ -384,7 +384,7 @@ # Give bugpoint information about LDFLAGS to pass down to the actual link stage # of the program. -BUGPOINT_OPTIONS += $(LDFLAGS:%=-Xlinker=%) +BUGPOINT_OPTIONS += $(LDFLAGS:%=-Xlinker=%) $(EXTRA_OPTIONS:%=-Xlinker=%) # Specify stdin, reference output, and command line options for the program... BUGPOINT_OPTIONS += -input=$(STDIN_FILENAME) -output=Output/$*.out-nat From lattner at cs.uiuc.edu Tue Jun 27 15:46:29 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:46:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200606272046.PAA32743@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.194 -> 1.195 --- Log message: Fix ppc64 jump tables --- Diffs of the changes: (+2 -1) PPCISelDAGToDAG.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.194 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.195 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.194 Mon Jun 26 19:10:13 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Jun 27 15:46:17 2006 @@ -1173,7 +1173,8 @@ SDOperand Chain, Target; Select(Chain, N->getOperand(0)); Select(Target,N->getOperand(1)); - Chain = SDOperand(CurDAG->getTargetNode(PPC::MTCTR, MVT::Other, Target, + unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8; + Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Target, Chain), 0); Result = CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain); return; From lattner at cs.uiuc.edu Tue Jun 27 15:58:53 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 15:58:53 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadArgElim/2006-06-27-struct-ret.ll Message-ID: <200606272058.PAA01206@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadArgElim: 2006-06-27-struct-ret.ll added (r1.1) --- Log message: testcase that crashes dead arg elim. --- Diffs of the changes: (+13 -0) 2006-06-27-struct-ret.ll | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/test/Regression/Transforms/DeadArgElim/2006-06-27-struct-ret.ll diff -c /dev/null llvm/test/Regression/Transforms/DeadArgElim/2006-06-27-struct-ret.ll:1.1 *** /dev/null Tue Jun 27 15:58:51 2006 --- llvm/test/Regression/Transforms/DeadArgElim/2006-06-27-struct-ret.ll Tue Jun 27 15:58:41 2006 *************** *** 0 **** --- 1,13 ---- + ; RUN: llvm-as < %s | opt -deadargelim -disable-output + + implementation + + internal csretcc void %build_delaunay({int}* %agg.result) { + ret void + } + + void %test() { + call csretcc void %build_delaunay({int}* null) + ret void + } + From lattner at cs.uiuc.edu Tue Jun 27 16:05:16 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 16:05:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Message-ID: <200606272105.QAA01512@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: DeadArgumentElimination.cpp updated: 1.26 -> 1.27 --- Log message: Fix Transforms/DeadArgElim/2006-06-27-struct-ret.ll. -deadargelim should not remove the struct return argument of a csret function, even if it is obviously dead. --- Diffs of the changes: (+11 -5) DeadArgumentElimination.cpp | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.26 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.27 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.26 Sun Jan 22 17:32:06 2006 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Jun 27 16:05:04 2006 @@ -19,15 +19,15 @@ #define DEBUG_TYPE "deadargelim" #include "llvm/Transforms/IPO.h" -#include "llvm/Module.h" -#include "llvm/Pass.h" -#include "llvm/DerivedTypes.h" +#include "llvm/CallingConv.h" #include "llvm/Constant.h" +#include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" +#include "llvm/Module.h" +#include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" -#include "llvm/ADT/iterator" #include #include using namespace llvm; @@ -128,7 +128,13 @@ // (used in a computation), MaybeLive (only passed as an argument to a call), or // Dead (not used). DAE::Liveness DAE::getArgumentLiveness(const Argument &A) { - if (A.use_empty()) return Dead; // First check, directly dead? + // If this is the return value of a csret function, it's not really dead. + if (A.getParent()->getCallingConv() == CallingConv::CSRet && + &*A.getParent()->arg_begin() == &A) + return Live; + + if (A.use_empty()) // First check, directly dead? + return 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) { From lattner at cs.uiuc.edu Tue Jun 27 16:09:04 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 16:09:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCInstr64Bit.td Message-ID: <200606272109.QAA01655@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.195 -> 1.196 PPCInstr64Bit.td updated: 1.16 -> 1.17 --- Log message: Don't match 64-bit bitfield inserts into rlwimi's. todo add rldimi. :) --- Diffs of the changes: (+5 -6) PPCISelDAGToDAG.cpp | 9 +++++---- PPCInstr64Bit.td | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.195 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.196 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.195 Tue Jun 27 15:46:17 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Jun 27 16:08:52 2006 @@ -1076,10 +1076,11 @@ break; } case ISD::OR: - if (SDNode *I = SelectBitfieldInsert(N)) { - Result = CodeGenMap[Op] = SDOperand(I, 0); - return; - } + if (N->getValueType(0) == MVT::i32) + if (SDNode *I = SelectBitfieldInsert(N)) { + Result = CodeGenMap[Op] = SDOperand(I, 0); + return; + } // Other cases are autogenerated. break; Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.16 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.17 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.16 Tue Jun 27 15:07:26 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Tue Jun 27 16:08:52 2006 @@ -134,8 +134,6 @@ "xoris $dst, $src1, $src2", IntGeneral, [(set G8RC:$dst, (xor G8RC:$src1, imm16ShiftedZExt:$src2))]>; - - def ADD8 : XOForm_1<31, 266, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), "add $rT, $rA, $rB", IntGeneral, [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>; From rafael.espindola at gmail.com Tue Jun 27 16:52:58 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 27 Jun 2006 16:52:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ARMInstrInfo.cpp ARMRegisterInfo.cpp Message-ID: <200606272152.QAA03708@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.12 -> 1.13 ARMInstrInfo.cpp updated: 1.2 -> 1.3 ARMRegisterInfo.cpp updated: 1.4 -> 1.5 --- Log message: handle the "mov reg1, reg2" case in isMoveInstr --- Diffs of the changes: (+20 -6) ARMISelDAGToDAG.cpp | 10 ++++++---- ARMInstrInfo.cpp | 14 +++++++++++++- ARMRegisterInfo.cpp | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.12 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.13 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.12 Mon Jun 12 07:28:08 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jun 27 16:52:45 2006 @@ -183,10 +183,12 @@ ScheduleAndEmitDAG(DAG); } -static void SelectFrameIndex(SelectionDAG *CurDAG, SDOperand &Result, SDNode *N) { +static void SelectFrameIndex(SelectionDAG *CurDAG, SDOperand &Result, SDNode *N, SDOperand Op) { int FI = cast(N)->getIndex(); - Result = CurDAG->SelectNodeTo(N, ARM::movrr, MVT::i32, - CurDAG->getTargetFrameIndex(FI, MVT::i32)); + + SDOperand TFI = CurDAG->getTargetFrameIndex(FI, Op.getValueType()); + + Result = CurDAG->SelectNodeTo(N, ARM::movri, Op.getValueType(), TFI); } void ARMDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { @@ -198,7 +200,7 @@ break; case ISD::FrameIndex: - SelectFrameIndex(CurDAG, Result, N); + SelectFrameIndex(CurDAG, Result, N, Op); break; } } Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.2 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.3 --- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.2 Mon May 22 21:48:20 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Tue Jun 27 16:52:45 2006 @@ -27,7 +27,19 @@ /// bool ARMInstrInfo::isMoveInstr(const MachineInstr &MI, unsigned &SrcReg, unsigned &DstReg) const { - return false; + MachineOpCode oc = MI.getOpcode(); + switch (oc) { + default: + return false; + case ARM::movrr: + assert(MI.getNumOperands() == 2 && + MI.getOperand(0).isRegister() && + MI.getOperand(1).isRegister() && + "Invalid ARM MOV instruction"); + SrcReg = MI.getOperand(1).getReg();; + DstReg = MI.getOperand(0).getReg();; + return true; + } } /// isLoadFromStackSlot - If the specified machine instruction is a direct Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.4 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.5 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.4 Sat Jun 17 19:08:07 2006 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Tue Jun 27 16:52:45 2006 @@ -81,7 +81,7 @@ MachineBasicBlock &MBB = *MI.getParent(); MachineFunction &MF = *MBB.getParent(); - assert (MI.getOpcode() == ARM::movrr); + assert (MI.getOpcode() == ARM::movri); unsigned FrameIdx = 1; From resistor at mac.com Tue Jun 27 17:25:11 2006 From: resistor at mac.com (Owen Anderson) Date: Tue, 27 Jun 2006 17:25:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll Message-ID: <200606272225.RAA05738@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/LoopUnswitch: 2006-06-27-DeadSwitchCase.ll added (r1.1) --- Log message: Testcase that Nate found where LoopUnswitch chokes on eliminating a dead case from a switch instruction. --- Diffs of the changes: (+31 -0) 2006-06-27-DeadSwitchCase.ll | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+) Index: llvm/test/Regression/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll diff -c /dev/null llvm/test/Regression/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll:1.1 *** /dev/null Tue Jun 27 17:25:09 2006 --- llvm/test/Regression/Transforms/LoopUnswitch/2006-06-27-DeadSwitchCase.ll Tue Jun 27 17:24:59 2006 *************** *** 0 **** --- 1,31 ---- + ; RUN: llvm-as < %s | opt -loop-unswitch -disable-output + implementation ; Functions: + + void %init_caller_save() { + entry: + br label %cond_true78 + + cond_next20: ; preds = %cond_true64 + br label %bb31 + + bb31: ; preds = %cond_true64, %cond_true64, %cond_next20 + %iftmp.29.1 = phi uint [ 0, %cond_next20 ], [ 0, %cond_true64 ], [ 0, %cond_true64 ] ; [#uses=0] + br label %bb54 + + bb54: ; preds = %cond_true78, %bb31 + br bool false, label %bb75, label %cond_true64 + + cond_true64: ; preds = %bb54 + switch int %i.0.0, label %cond_next20 [ + int 17, label %bb31 + int 18, label %bb31 + ] + + bb75: ; preds = %bb54 + %tmp74.0 = add int %i.0.0, 1 ; [#uses=1] + br label %cond_true78 + + cond_true78: ; preds = %bb75, %entry + %i.0.0 = phi int [ 0, %entry ], [ %tmp74.0, %bb75 ] ; [#uses=2] + br label %bb54 + } From resistor at mac.com Tue Jun 27 17:26:21 2006 From: resistor at mac.com (Owen Anderson) Date: Tue, 27 Jun 2006 17:26:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Message-ID: <200606272226.RAA05807@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnswitch.cpp updated: 1.41 -> 1.42 --- Log message: Fix for 2006-06-27-DeadSwitchCase.ll Be more careful when updating Phi nodes after eliminating dead switch cases. Fix proposed by Chris. --- Diffs of the changes: (+6 -5) LoopUnswitch.cpp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.41 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.42 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.41 Mon Jun 26 02:44:36 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Jun 27 17:26:09 2006 @@ -971,11 +971,12 @@ Old->getTerminator()->eraseFromParent(); - for (BasicBlock::iterator II = SI->getSuccessor(i)->begin(), - IE = SI->getSuccessor(i)->end(); II != IE; ++II) { - if (isa(*II)) { - (*II).replaceUsesOfWith(Split, Old); - } + + PHINode *PN; + for (BasicBlock::iterator II = SI->getSuccessor(i)->begin(); + (PN = dyn_cast(II)); ++II) { + Value *InVal = PN->removeIncomingValue(Split, false); + PN->addIncoming(InVal, Old); } SI->removeCase(i); From alenhar2 at cs.uiuc.edu Tue Jun 27 18:19:27 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 27 Jun 2006 18:19:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp Message-ID: <200606272319.SAA08026@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.54 -> 1.55 --- Log message: this case isn't handled --- Diffs of the changes: (+2 -0) AlphaISelLowering.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.54 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.55 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.54 Wed Jun 21 10:42:36 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Tue Jun 27 18:19:14 2006 @@ -64,6 +64,8 @@ setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote); + setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); + setOperationAction(ISD::FREM, MVT::f32, Expand); setOperationAction(ISD::FREM, MVT::f64, Expand); From lattner at cs.uiuc.edu Tue Jun 27 18:47:51 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 18:47:51 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll Message-ID: <200606272347.SAA09296@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadStoreElimination: 2006-06-27-AST-Remove.ll added (r1.1) --- Log message: New testcase, reduced by nate, which crashes DSE --- Diffs of the changes: (+1118 -0) 2006-06-27-AST-Remove.ll | 1118 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 1118 insertions(+) Index: llvm/test/Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll diff -c /dev/null llvm/test/Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll:1.1 *** /dev/null Tue Jun 27 18:47:49 2006 --- llvm/test/Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll Tue Jun 27 18:47:39 2006 *************** *** 0 **** --- 1,1118 ---- + ; RUN: llvm-as < %s | opt -globalsmodref-aa -dse -disable-output + target endian = big + target pointersize = 32 + target triple = "powerpc-apple-darwin8" + %struct.ECacheType = type { uint, uint, int } + %struct.FILE = type { ubyte*, int, int, short, short, %struct.__sbuf, int, sbyte*, int (sbyte*)*, int (sbyte*, sbyte*, int)*, long (sbyte*, long, int)*, int (sbyte*, sbyte*, int)*, %struct.__sbuf, %struct.__sFILEX*, int, [3 x ubyte], [1 x ubyte], %struct.__sbuf, int, long } + %struct.QTType = type { sbyte, sbyte, ushort, uint, uint, int } + %struct.TType = type { sbyte, sbyte, sbyte, sbyte, ushort, uint, uint, int } + %struct._RuneEntry = type { int, int, int, uint* } + %struct._RuneLocale = type { [8 x sbyte], [32 x sbyte], int (sbyte*, uint, sbyte**)*, int (int, sbyte*, uint, sbyte**)*, int, [256 x uint], [256 x int], [256 x int], %struct._RuneRange, %struct._RuneRange, %struct._RuneRange, sbyte*, int } + %struct._RuneRange = type { int, %struct._RuneEntry* } + %struct.__sFILEX = type opaque + %struct.__sbuf = type { ubyte*, int } + %struct.move_s = type { int, int, int, int, int, int } + %struct.move_x = type { int, int, int, int } + %struct.node_t = type { ubyte, ubyte, ubyte, ubyte, int, int, %struct.node_t**, %struct.node_t*, %struct.move_s } + %struct.see_data = type { int, int } + %rook_o.2925 = internal global [4 x int] [ int 12, int -12, int 1, int -1 ] ; <[4 x int]*> [#uses=0] + %bishop_o.2926 = internal global [4 x int] [ int 11, int -11, int 13, int -13 ] ; <[4 x int]*> [#uses=0] + %knight_o.2927 = internal global [8 x int] [ int 10, int -10, int 14, int -14, int 23, int -23, int 25, int -25 ] ; <[8 x int]*> [#uses=0] + %board = internal global [144 x int] zeroinitializer ; <[144 x int]*> [#uses=0] + %holding = internal global [2 x [16 x int]] zeroinitializer ; <[2 x [16 x int]]*> [#uses=0] + %hold_hash = internal global uint 0 ; [#uses=0] + %white_hand_eval = internal global int 0 ; [#uses=0] + %black_hand_eval = internal global int 0 ; [#uses=0] + %num_holding = internal global [2 x int] zeroinitializer ; <[2 x int]*> [#uses=0] + %zobrist = internal global [14 x [144 x uint]] zeroinitializer ; <[14 x [144 x uint]]*> [#uses=0] + %Variant = internal global int 0 ; [#uses=7] + %userealholdings.b = internal global bool false ; [#uses=1] + %realholdings = internal global [255 x sbyte] zeroinitializer ; <[255 x sbyte]*> [#uses=0] + %comp_color = internal global int 0 ; [#uses=0] + %C.97.3177 = internal global [13 x int] [ int 0, int 2, int 1, int 4, int 3, int 0, int 0, int 8, int 7, int 10, int 9, int 12, int 11 ] ; <[13 x int]*> [#uses=0] + %str = internal global [30 x sbyte] c"%s:%u: failed assertion `%s'\0A\00" ; <[30 x sbyte]*> [#uses=0] + %str = internal global [81 x sbyte] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/crazy.c\00" ; <[81 x sbyte]*> [#uses=0] + %str = internal global [32 x sbyte] c"piece > frame && piece < npiece\00" ; <[32 x sbyte]*> [#uses=0] + %C.101.3190 = internal global [13 x int] [ int 0, int 2, int 1, int 2, int 1, int 0, int 0, int 2, int 1, int 2, int 1, int 2, int 1 ] ; <[13 x int]*> [#uses=0] + %hand_value = internal global [13 x int] [ int 0, int 100, int -100, int 210, int -210, int 0, int 0, int 250, int -250, int 450, int -450, int 230, int -230 ] ; <[13 x int]*> [#uses=0] + %material = internal global [14 x int] zeroinitializer ; <[14 x int]*> [#uses=0] + %Material = internal global int 0 ; [#uses=0] + %str = internal global [23 x sbyte] c"holding[who][what] > 0\00" ; <[23 x sbyte]*> [#uses=0] + %str = internal global [24 x sbyte] c"holding[who][what] < 20\00" ; <[24 x sbyte]*> [#uses=0] + %fifty = internal global int 0 ; [#uses=0] + %move_number = internal global int 0 ; [#uses=1] + %ply = internal global int 0 ; [#uses=2] + %hash_history = internal global [600 x uint] zeroinitializer ; <[600 x uint]*> [#uses=1] + %hash = internal global uint 0 ; [#uses=1] + %ECacheSize.b = internal global bool false ; [#uses=1] + %ECache = internal global %struct.ECacheType* null ; <%struct.ECacheType**> [#uses=1] + %ECacheProbes = internal global uint 0 ; [#uses=1] + %ECacheHits = internal global uint 0 ; [#uses=1] + %str = internal global [34 x sbyte] c"Out of memory allocating ECache.\0A\00" ; <[34 x sbyte]*> [#uses=0] + %rankoffsets.2930 = internal global [8 x int] [ int 110, int 98, int 86, int 74, int 62, int 50, int 38, int 26 ] ; <[8 x int]*> [#uses=0] + %white_castled = internal global int 0 ; [#uses=0] + %black_castled = internal global int 0 ; [#uses=0] + %book_ply = internal global int 0 ; [#uses=0] + %bking_loc = internal global int 0 ; [#uses=1] + %wking_loc = internal global int 0 ; [#uses=1] + %white_to_move = internal global int 0 ; [#uses=3] + %moved = internal global [144 x int] zeroinitializer ; <[144 x int]*> [#uses=0] + %ep_square = internal global int 0 ; [#uses=0] + %_DefaultRuneLocale = external global %struct._RuneLocale ; <%struct._RuneLocale*> [#uses=0] + %str = internal global [3 x sbyte] c"bm\00" ; <[3 x sbyte]*> [#uses=0] + %str1 = internal global [3 x sbyte] c"am\00" ; <[3 x sbyte]*> [#uses=0] + %str1 = internal global [34 x sbyte] c"No best-move or avoid-move found!\00" ; <[34 x sbyte]*> [#uses=0] + %str = internal global [25 x sbyte] c"\0AName of EPD testsuite: \00" ; <[25 x sbyte]*> [#uses=0] + %__sF = external global [0 x %struct.FILE] ; <[0 x %struct.FILE]*> [#uses=0] + %str = internal global [21 x sbyte] c"\0ATime per move (s): \00" ; <[21 x sbyte]*> [#uses=0] + %str = internal global [2 x sbyte] c"\0A\00" ; <[2 x sbyte]*> [#uses=0] + %str2 = internal global [2 x sbyte] c"r\00" ; <[2 x sbyte]*> [#uses=0] + %root_to_move = internal global int 0 ; [#uses=1] + %forcedwin.b = internal global bool false ; [#uses=2] + %fixed_time = internal global int 0 ; [#uses=1] + %nodes = internal global int 0 ; [#uses=1] + %qnodes = internal global int 0 ; [#uses=1] + %str = internal global [29 x sbyte] c"\0ANodes: %i (%0.2f%% qnodes)\0A\00" ; <[29 x sbyte]*> [#uses=0] + %str = internal global [54 x sbyte] c"ECacheProbes : %u ECacheHits : %u HitRate : %f%%\0A\00" ; <[54 x sbyte]*> [#uses=0] + %TTStores = internal global uint 0 ; [#uses=1] + %TTProbes = internal global uint 0 ; [#uses=1] + %TTHits = internal global uint 0 ; [#uses=1] + %str = internal global [60 x sbyte] c"TTStores : %u TTProbes : %u TTHits : %u HitRate : %f%%\0A\00" ; <[60 x sbyte]*> [#uses=0] + %NTries = internal global uint 0 ; [#uses=1] + %NCuts = internal global uint 0 ; [#uses=1] + %TExt = internal global uint 0 ; [#uses=1] + %str = internal global [51 x sbyte] c"NTries : %u NCuts : %u CutRate : %f%% TExt: %u\0A\00" ; <[51 x sbyte]*> [#uses=0] + %ext_check = internal global uint 0 ; [#uses=1] + %razor_drop = internal global uint 0 ; [#uses=1] + %razor_material = internal global uint 0 ; [#uses=1] + %str = internal global [61 x sbyte] c"Check extensions: %u Razor drops : %u Razor Material : %u\0A\00" ; <[61 x sbyte]*> [#uses=0] + %FHF = internal global uint 0 ; [#uses=1] + %FH = internal global uint 0 ; [#uses=1] + %str = internal global [22 x sbyte] c"Move ordering : %f%%\0A\00" ; <[22 x sbyte]*> [#uses=0] + %maxposdiff = internal global int 0 ; [#uses=1] + %str = internal global [47 x sbyte] c"Material score: %d Eval : %d MaxPosDiff: %d\0A\00" ; <[47 x sbyte]*> [#uses=0] + %str = internal global [17 x sbyte] c"Solution found.\0A\00" ; <[17 x sbyte]*> [#uses=0] + %str3 = internal global [21 x sbyte] c"Solution not found.\0A\00" ; <[21 x sbyte]*> [#uses=0] + %str = internal global [15 x sbyte] c"Solved: %d/%d\0A\00" ; <[15 x sbyte]*> [#uses=0] + %str = internal global [9 x sbyte] c"EPD: %s\0A\00" ; <[9 x sbyte]*> [#uses=0] + %str4 = internal global [21 x sbyte] c"Searching to %d ply\0A\00" ; <[21 x sbyte]*> [#uses=0] + %maxdepth = internal global int 0 ; [#uses=0] + %std_material = internal global [14 x int] [ int 0, int 100, int -100, int 310, int -310, int 4000, int -4000, int 500, int -500, int 900, int -900, int 325, int -325, int 0 ] ; <[14 x int]*> [#uses=0] + %zh_material = internal global [14 x int] [ int 0, int 100, int -100, int 210, int -210, int 4000, int -4000, int 250, int -250, int 450, int -450, int 230, int -230, int 0 ] ; <[14 x int]*> [#uses=0] + %suicide_material = internal global [14 x int] [ int 0, int 15, int -15, int 150, int -150, int 500, int -500, int 150, int -150, int 50, int -50, int 0, int 0, int 0 ] ; <[14 x int]*> [#uses=0] + %losers_material = internal global [14 x int] [ int 0, int 80, int -80, int 320, int -320, int 1000, int -1000, int 350, int -350, int 400, int -400, int 270, int -270, int 0 ] ; <[14 x int]*> [#uses=0] + %Xfile = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %Xrank = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 1, int 1, int 1, int 1, int 1, int 1, int 1, int 0, int 0, int 0, int 0, int 2, int 2, int 2, int 2, int 2, int 2, int 2, int 2, int 0, int 0, int 0, int 0, int 3, int 3, int 3, int 3, int 3, int 3, int 3, int 3, int 0, int 0, int 0, int 0, int 4, int 4, int 4, int 4, int 4, int 4, int 4, int 4, int 0, int 0, int 0, int 0, int 5, int 5, int 5, int 5, int 5, int 5, int 5, int 5, int 0, int 0, int 0, int 0, int 6, int 6, int 6, int 6, int 6, int 6, int 6, int 6, int 0, int 0, int 0, int 0, int 7, int 7, int 7, int 7, int 7, int 7, int 7, int 7, int 0, int 0, int 0, int 0, int 8, int 8, int 8, int 8, int 8, int 8, int 8, int 8, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %Xdiagl = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 9, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 0, int 0, int 0, int 0, int 10, int 9, int 1, int 2, int 3, int 4, int 5, int 6, int 0, int 0, int 0, int 0, int 11, int 10, int 9, int 1, int 2, int 3, int 4, int 5, int 0, int 0, int 0, int 0, int 12, int 11, int 10, int 9, int 1, int 2, int 3, int 4, int 0, int 0, int 0, int 0, int 13, int 12, int 11, int 10, int 9, int 1, int 2, int 3, int 0, int 0, int 0, int 0, int 14, int 13, int 12, int 11, int 10, int 9, int 1, int 2, int 0, int 0, int 0, int 0, int 15, int 14, int 13, int 12, int 11, int 10, int 9, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, in! t 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %Xdiagr = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 15, int 14, int 13, int 12, int 11, int 10, int 9, int 1, int 0, int 0, int 0, int 0, int 14, int 13, int 12, int 11, int 10, int 9, int 1, int 2, int 0, int 0, int 0, int 0, int 13, int 12, int 11, int 10, int 9, int 1, int 2, int 3, int 0, int 0, int 0, int 0, int 12, int 11, int 10, int 9, int 1, int 2, int 3, int 4, int 0, int 0, int 0, int 0, int 11, int 10, int 9, int 1, int 2, int 3, int 4, int 5, int 0, int 0, int 0, int 0, int 10, int 9, int 1, int 2, int 3, int 4, int 5, int 6, int 0, int 0, int 0, int 0, int 9, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, in! t 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %sqcolor = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, i! nt 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %pcsqbishop = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -5, int -5, int -10, int -5, int -5, int -10, int -5, int -5, int 0, int 0, int 0, int 0, int -5, int 10, int 5, int 10, int 10, int 5, int 10, int -5, int 0, int 0, int 0, int 0, int -5, int 5, int 6, int 15, int 15, int 6, int 5, int -5, int 0, int 0, int 0, int 0, int -5, int 3, int 15, int 10, int 10, int 15, int 3, int -5, int 0, int 0, int 0, int 0, int -5, int 3, int 15, int 10, int 10, int 15, int 3, int -5, int 0, int 0, int 0, int 0, int -5, int 5, int 6, int 15, int 15, int 6, int 5, int -5, int 0, int 0, int 0, int 0, int -5, int 10, int 5, int 10, int 10, int 5, int 10, int -5, int 0, int 0, int 0, int 0, int -5, int -5, int -10, int -5, int -5, int -10, int -5, int -5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, in! t 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %black_knight = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -20, int -10, int -10, int -10, int -10, int -10, int -10, int -20, int 0, int 0, int 0, int 0, int -10, int 15, int 25, int 25, int 25, int 25, int 15, int -10, int 0, int 0, int 0, int 0, int -10, int 15, int 25, int 35, int 35, int 35, int 15, int -10, int 0, int 0, int 0, int 0, int -10, int 10, int 25, int 20, int 25, int 25, int 10, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 20, int 20, int 20, int 20, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 15, int 15, int 15, int 15, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 0, int 3, int 3, int 0, int 0, int -10, int 0, int 0, int 0, int 0, int -20, int -35, int -10, int -10, int -10, int -10, int -35, int -20, int 0, int 0, int 0, int 0, int 0! , int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %white_knight = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -20, int -35, int -10, int -10, int -10, int -10, int -35, int -20, int 0, int 0, int 0, int 0, int -10, int 0, int 0, int 3, int 3, int 0, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 15, int 15, int 15, int 15, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 20, int 20, int 20, int 20, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 10, int 25, int 20, int 25, int 25, int 10, int -10, int 0, int 0, int 0, int 0, int -10, int 15, int 25, int 35, int 35, int 35, int 15, int -10, int 0, int 0, int 0, int 0, int -10, int 15, int 25, int 25, int 25, int 25, int 15, int -10, int 0, int 0, int 0, int 0, int -20, int -10, int -10, int -10, int -10, int -10, int -10, int -20, int 0, int 0, int 0, int 0, int 0! , int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %white_pawn = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 25, int 25, int 35, int 5, int 5, int 50, int 45, int 30, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 7, int 7, int 5, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 14, int 14, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 10, int 20, int 20, int 10, int 5, int 5, int 0, int 0, int 0, int 0, int 12, int 18, int 18, int 27, int 27, int 18, int 18, int 18, int 0, int 0, int 0, int 0, int 25, int 30, int 30, int 35, int 35, int 35, int 30, int 25, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0! , int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %black_pawn = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 30, int 30, int 30, int 35, int 35, int 35, int 30, int 25, int 0, int 0, int 0, int 0, int 12, int 18, int 18, int 27, int 27, int 18, int 18, int 18, int 0, int 0, int 0, int 0, int 0, int 0, int 10, int 20, int 20, int 10, int 5, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 14, int 14, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 7, int 7, int 5, int 5, int 0, int 0, int 0, int 0, int 0, int 25, int 25, int 35, int 5, int 5, int 50, int 45, int 30, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0! , int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %white_king = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -100, int 7, int 4, int 0, int 10, int 4, int 7, int -100, int 0, int 0, int 0, int 0, int -250, int -200, int -150, int -100, int -100, int -150, int -200, int -250, int 0, int 0, int 0, int 0, int -350, int -300, int -300, int -250, int -250, int -300, int -300, int -350, int 0, int 0, int 0, int 0, int -400, int -400, int -400, int -350, int -350, int -400, int -400, int -400, int 0, int 0, int 0, int 0, int -450, int -450, int -450, int -450, int -450, int -450, int -450, int -450, int 0, int 0, int 0, int 0, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int 0, int 0, int 0, int 0, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int 0, int 0, int 0, int 0, int -500, int -500, in! t -500, int -500, int -500, int -500, int -500, int -500, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %black_king = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int 0, int 0, int 0, int 0, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int 0, int 0, int 0, int 0, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int -500, int 0, int 0, int 0, int 0, int -450, int -450, int -450, int -450, int -450, int -450, int -450, int -450, int 0, int 0, int 0, int 0, int -400, int -400, int -400, int -350, int -350, int -400, int -400, int -400, int 0, int 0, int 0, int 0, int -350, int -300, int -300, int -250, int -250, int -300, int -300, int -350, int 0, int 0, int 0, int 0, int -250, int -200, int -150, int -100, int -100, int -150, int -200, int -250, int 0, int 0, int 0, int 0, int -! 100, int 7, int 4, int 0, int 10, int 4, int 7, int -100, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %black_queen = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 5, int 5, int 5, int 10, int 10, int 5, int 5, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 3, int 3, int 3, int 3, int 3, int 0, int 0, int 0, int 0, int 0, int -30, int -30, int -30, int -30, int -30, int -30, int -30, int -30, int 0, int 0, int 0, int 0, int -60, int -40, int -40, int -60, int -60, int -40, int -40, int -60, int 0, int 0, int 0, int 0, int -40, int -40, int -40, int -40, int -40, int -40, int -40, int -40, int 0, int 0, int 0, int 0, int -15, int -15, int -15, int -10, int -10, int -15, int -15, int -15, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 7, int 10, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, ! int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %white_queen = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 7, int 10, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int -15, int -15, int -15, int -10, int -10, int -15, int -15, int -15, int 0, int 0, int 0, int 0, int -40, int -40, int -40, int -40, int -40, int -40, int -40, int -40, int 0, int 0, int 0, int 0, int -60, int -40, int -40, int -60, int -60, int -40, int -40, int -60, int 0, int 0, int 0, int 0, int -30, int -30, int -30, int -30, int -30, int -30, int -30, int -30, int 0, int 0, int 0, int 0, int 0, int 0, int 3, int 3, int 3, int 3, int 3, int 0, int 0, int 0, int 0, int 0, int 5, int 5, int 5, int 10, int 10, int 5, int 5, int 5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, ! int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %black_rook = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 10, int 15, int 20, int 25, int 25, int 20, int 15, int 10, int 0, int 0, int 0, int 0, int 0, int 10, int 15, int 20, int 20, int 15, int 10, int 0, int 0, int 0, int 0, int 0, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int 0, int 0, int 0, int 0, int -20, int -20, int -20, int -30, int -30, int -20, int -20, int -20, int 0, int 0, int 0, int 0, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int 0, int 0, int 0, int 0, int -15, int -15, int -15, int -10, int -10, int -15, int -15, int -15, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 7, int 10, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 2, int 2, int 2, int 2, int 2, int 2, int 2, int 2, int 0, int 0, int 0, int 0, int 0, int! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %white_rook = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 2, int 2, int 2, int 2, int 2, int 2, int 2, int 2, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 7, int 10, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -15, int -15, int -15, int -10, int -10, int -15, int -15, int -15, int 0, int 0, int 0, int 0, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int 0, int 0, int 0, int 0, int -20, int -20, int -20, int -30, int -30, int -20, int -20, int -20, int 0, int 0, int 0, int 0, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int -20, int 0, int 0, int 0, int 0, int 0, int 10, int 15, int 20, int 20, int 15, int 10, int 0, int 0, int 0, int 0, int 0, int 10, int 15, int 20, int 25, int 25, int 20, int 15, int 10, int 0, int 0, int 0, int 0, int 0, int! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %upscale = internal global [64 x int] [ int 26, int 27, int 28, int 29, int 30, int 31, int 32, int 33, int 38, int 39, int 40, int 41, int 42, int 43, int 44, int 45, int 50, int 51, int 52, int 53, int 54, int 55, int 56, int 57, int 62, int 63, int 64, int 65, int 66, int 67, int 68, int 69, int 74, int 75, int 76, int 77, int 78, int 79, int 80, int 81, int 86, int 87, int 88, int 89, int 90, int 91, int 92, int 93, int 98, int 99, int 100, int 101, int 102, int 103, int 104, int 105, int 110, int 111, int 112, int 113, int 114, int 115, int 116, int 117 ] ; <[64 x int]*> [#uses=0] + %pre_p_tropism = internal global [9 x int] [ int 9999, int 40, int 20, int 10, int 3, int 1, int 1, int 0, int 9999 ] ; <[9 x int]*> [#uses=0] + %pre_r_tropism = internal global [9 x int] [ int 9999, int 50, int 40, int 15, int 5, int 1, int 1, int 0, int 9999 ] ; <[9 x int]*> [#uses=0] + %pre_n_tropism = internal global [9 x int] [ int 9999, int 50, int 70, int 35, int 10, int 2, int 1, int 0, int 9999 ] ; <[9 x int]*> [#uses=0] + %pre_q_tropism = internal global [9 x int] [ int 9999, int 100, int 60, int 20, int 5, int 2, int 0, int 0, int 9999 ] ; <[9 x int]*> [#uses=0] + %pre_b_tropism = internal global [9 x int] [ int 9999, int 50, int 25, int 15, int 5, int 2, int 2, int 2, int 9999 ] ; <[9 x int]*> [#uses=0] + %rookdistance = internal global [144 x [144 x int]] zeroinitializer ; <[144 x [144 x int]]*> [#uses=0] + %distance = internal global [144 x [144 x int]] zeroinitializer ; <[144 x [144 x int]]*> [#uses=0] + %p_tropism = internal global [144 x [144 x ubyte]] zeroinitializer ; <[144 x [144 x ubyte]]*> [#uses=0] + %b_tropism = internal global [144 x [144 x ubyte]] zeroinitializer ; <[144 x [144 x ubyte]]*> [#uses=0] + %n_tropism = internal global [144 x [144 x ubyte]] zeroinitializer ; <[144 x [144 x ubyte]]*> [#uses=0] + %r_tropism = internal global [144 x [144 x ubyte]] zeroinitializer ; <[144 x [144 x ubyte]]*> [#uses=0] + %q_tropism = internal global [144 x [144 x ubyte]] zeroinitializer ; <[144 x [144 x ubyte]]*> [#uses=0] + %cfg_devscale.b = internal global bool false ; [#uses=0] + %pieces = internal global [62 x int] zeroinitializer ; <[62 x int]*> [#uses=0] + %piece_count = internal global int 0 ; [#uses=1] + %cfg_smarteval.b = internal global bool false ; [#uses=0] + %lcentral = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -20, int -15, int -15, int -15, int -15, int -15, int -15, int -20, int 0, int 0, int 0, int 0, int -15, int 0, int 3, int 5, int 5, int 3, int 0, int -15, int 0, int 0, int 0, int 0, int -15, int 0, int 15, int 15, int 15, int 15, int 0, int -15, int 0, int 0, int 0, int 0, int -15, int 0, int 15, int 30, int 30, int 15, int 0, int -15, int 0, int 0, int 0, int 0, int -15, int 0, int 15, int 30, int 30, int 15, int 0, int -15, int 0, int 0, int 0, int 0, int -15, int 0, int 15, int 15, int 15, int 15, int 0, int -15, int 0, int 0, int 0, int 0, int -15, int 0, int 3, int 5, int 5, int 3, int 0, int -15, int 0, int 0, int 0, int 0, int -20, int -15, int -15, int -15, int -15, int -15, int -15, int -20, int 0, int 0, int 0, int 0, int 0, int 0, int 0! , int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %str3 = internal global [81 x sbyte] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/leval.c\00" ; <[81 x sbyte]*> [#uses=0] + %str5 = internal global [21 x sbyte] c"(i > 0) && (i < 145)\00" ; <[21 x sbyte]*> [#uses=0] + %kingcap.b = internal global bool false ; [#uses=0] + %numb_moves = internal global int 0 ; [#uses=2] + %genfor = internal global %struct.move_s* null ; <%struct.move_s**> [#uses=0] + %captures = internal global uint 0 ; [#uses=1] + %fcaptures.b = internal global bool false ; [#uses=0] + %gfrom = internal global int 0 ; [#uses=0] + %Giveaway.b = internal global bool false ; [#uses=0] + %path_x = internal global [300 x %struct.move_x] zeroinitializer ; <[300 x %struct.move_x]*> [#uses=0] + %str7 = internal global [81 x sbyte] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/moves.c\00" ; <[81 x sbyte]*> [#uses=0] + %str8 = internal global [15 x sbyte] c"find_slot < 63\00" ; <[15 x sbyte]*> [#uses=0] + %is_promoted = internal global [62 x int] zeroinitializer ; <[62 x int]*> [#uses=0] + %squares = internal global [144 x int] zeroinitializer ; <[144 x int]*> [#uses=0] + %str = internal global [38 x sbyte] c"promoted > frame && promoted < npiece\00" ; <[38 x sbyte]*> [#uses=0] + %str1 = internal global [38 x sbyte] c"promoted < npiece && promoted > frame\00" ; <[38 x sbyte]*> [#uses=0] + %evalRoutines = internal global [7 x int (int, int)*] [ int (int, int)* %ErrorIt, int (int, int)* %Pawn, int (int, int)* %Knight, int (int, int)* %King, int (int, int)* %Rook, int (int, int)* %Queen, int (int, int)* %Bishop ] ; <[7 x int (int, int)*]*> [#uses=0] + %sbishop = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -2, int -2, int -2, int -2, int -2, int -2, int -2, int -2, int 0, int 0, int 0, int 0, int -2, int 8, int 5, int 5, int 5, int 5, int 8, int -2, int 0, int 0, int 0, int 0, int -2, int 3, int 3, int 5, int 5, int 3, int 3, int -2, int 0, int 0, int 0, int 0, int -2, int 2, int 5, int 4, int 4, int 5, int 2, int -2, int 0, int 0, int 0, int 0, int -2, int 2, int 5, int 4, int 4, int 5, int 2, int -2, int 0, int 0, int 0, int 0, int -2, int 3, int 3, int 5, int 5, int 3, int 3, int -2, int 0, int 0, int 0, int 0, int -2, int 8, int 5, int 5, int 5, int 5, int 8, int -2, int 0, int 0, int 0, int 0, int -2, int -2, int -2, int -2, int -2, int -2, int -2, int -2, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, i! nt 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %sknight = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -20, int -10, int -10, int -10, int -10, int -10, int -10, int -20, int 0, int 0, int 0, int 0, int -10, int 0, int 0, int 3, int 3, int 0, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 5, int 5, int 5, int 5, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 5, int 10, int 10, int 5, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 5, int 10, int 10, int 5, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 5, int 5, int 5, int 5, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 0, int 3, int 3, int 0, int 0, int -10, int 0, int 0, int 0, int 0, int -20, int -10, int -10, int -10, int -10, int -10, int -10, int -20, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int ! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %swhite_pawn = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 10, int 10, int 3, int 2, int 1, int 0, int 0, int 0, int 0, int 2, int 4, int 6, int 12, int 12, int 6, int 4, int 2, int 0, int 0, int 0, int 0, int 3, int 6, int 9, int 14, int 14, int 9, int 6, int 3, int 0, int 0, int 0, int 0, int 10, int 12, int 14, int 16, int 16, int 14, int 12, int 10, int 0, int 0, int 0, int 0, int 20, int 22, int 24, int 26, int 26, int 24, int 22, int 20, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %sblack_pawn = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 20, int 22, int 24, int 26, int 26, int 24, int 22, int 20, int 0, int 0, int 0, int 0, int 10, int 12, int 14, int 16, int 16, int 14, int 12, int 10, int 0, int 0, int 0, int 0, int 3, int 6, int 9, int 14, int 14, int 9, int 6, int 3, int 0, int 0, int 0, int 0, int 2, int 4, int 6, int 12, int 12, int 6, int 4, int 2, int 0, int 0, int 0, int 0, int 1, int 2, int 3, int 10, int 10, int 3, int 2, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int! 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %swhite_king = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 2, int 14, int 0, int 0, int 0, int 9, int 14, int 2, int 0, int 0, int 0, int 0, int -3, int -5, int -6, int -6, int -6, int -6, int -5, int -3, int 0, int 0, int 0, int 0, int -5, int -5, int -8, int -8, int -8, int -8, int -5, int -5, int 0, int 0, int 0, int 0, int -8, int -8, int -13, int -13, int -13, int -13, int -8, int -8, int 0, int 0, int 0, int 0, int -13, int -13, int -21, int -21, int -21, int -21, int -13, int -13, int 0, int 0, int 0, int 0, int -21, int -21, int -34, int -34, int -34, int -34, int -21, int -21, int 0, int 0, int 0, int 0, int -34, int -34, int -55, int -55, int -55, int -55, int -34, int -34, int 0, int 0, int 0, int 0, int -55, int -55, int -89, int -89, int -89, int -89, int -55, int -55, int 0, int 0, int 0, i! nt 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %sblack_king = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -55, int -55, int -89, int -89, int -89, int -89, int -55, int -55, int 0, int 0, int 0, int 0, int -34, int -34, int -55, int -55, int -55, int -55, int -34, int -34, int 0, int 0, int 0, int 0, int -21, int -21, int -34, int -34, int -34, int -34, int -21, int -21, int 0, int 0, int 0, int 0, int -13, int -13, int -21, int -21, int -21, int -21, int -13, int -13, int 0, int 0, int 0, int 0, int -8, int -8, int -13, int -13, int -13, int -13, int -8, int -8, int 0, int 0, int 0, int 0, int -5, int -5, int -8, int -8, int -8, int -8, int -5, int -5, int 0, int 0, int 0, int 0, int -3, int -5, int -6, int -6, int -6, int -6, int -5, int -3, int 0, int 0, int 0, int 0, int 2, int 14, int 0, int 0, int 0, int 9, int 14, int 2, int 0, int 0, int 0, i! nt 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %send_king = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -5, int -3, int -1, int 0, int 0, int -1, int -3, int -5, int 0, int 0, int 0, int 0, int -3, int 10, int 10, int 10, int 10, int 10, int 10, int -3, int 0, int 0, int 0, int 0, int -1, int 10, int 25, int 25, int 25, int 25, int 10, int -1, int 0, int 0, int 0, int 0, int 0, int 10, int 25, int 50, int 50, int 25, int 10, int 0, int 0, int 0, int 0, int 0, int 0, int 10, int 25, int 50, int 50, int 25, int 10, int 0, int 0, int 0, int 0, int 0, int -1, int 10, int 25, int 25, int 25, int 25, int 10, int -1, int 0, int 0, int 0, int 0, int -3, int 10, int 10, int 10, int 10, int 10, int 10, int -3, int 0, int 0, int 0, int 0, int -5, int -3, int -1, int 0, int 0, int -1, int -3, int -5, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0,! int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %srev_rank = internal global [9 x int] [ int 0, int 8, int 7, int 6, int 5, int 4, int 3, int 2, int 1 ] ; <[9 x int]*> [#uses=0] + %std_p_tropism = internal global [8 x int] [ int 9999, int 15, int 10, int 7, int 2, int 0, int 0, int 0 ] ; <[8 x int]*> [#uses=0] + %std_own_p_tropism = internal global [8 x int] [ int 9999, int 30, int 10, int 2, int 0, int 0, int 0, int 0 ] ; <[8 x int]*> [#uses=0] + %std_r_tropism = internal global [16 x int] [ int 9999, int 0, int 15, int 5, int 2, int 1, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[16 x int]*> [#uses=0] + %std_n_tropism = internal global [8 x int] [ int 9999, int 14, int 9, int 6, int 1, int 0, int 0, int 0 ] ; <[8 x int]*> [#uses=0] + %std_q_tropism = internal global [8 x int] [ int 9999, int 200, int 50, int 15, int 3, int 2, int 1, int 0 ] ; <[8 x int]*> [#uses=0] + %std_b_tropism = internal global [8 x int] [ int 9999, int 12, int 7, int 5, int 0, int 0, int 0, int 0 ] ; <[8 x int]*> [#uses=0] + %phase = internal global int 0 ; [#uses=1] + %dir.3001 = internal global [4 x int] [ int -13, int -11, int 11, int 13 ] ; <[4 x int]*> [#uses=0] + %dir.3021 = internal global [4 x int] [ int -1, int 1, int 12, int -12 ] ; <[4 x int]*> [#uses=0] + %king_locs = internal global [2 x int] zeroinitializer ; <[2 x int]*> [#uses=0] + %square_d1.3081 = internal global [2 x int] [ int 29, int 113 ] ; <[2 x int]*> [#uses=0] + %wmat = internal global int 0 ; [#uses=0] + %bmat = internal global int 0 ; [#uses=0] + %str = internal global [35 x sbyte] c"Illegal piece detected sq=%i c=%i\0A\00" ; <[35 x sbyte]*> [#uses=0] + %str10 = internal global [81 x sbyte] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/neval.c\00" ; <[81 x sbyte]*> [#uses=0] + %std_hand_value = internal global [13 x int] [ int 0, int 100, int -100, int 210, int -210, int 0, int 0, int 250, int -250, int 450, int -450, int 230, int -230 ] ; <[13 x int]*> [#uses=0] + %xb_mode = internal global int 0 ; [#uses=0] + %str = internal global [69 x sbyte] c"tellics ptell Hello! I am Sjeng and hope you enjoy playing with me.\0A\00" ; <[69 x sbyte]*> [#uses=0] + %str = internal global [76 x sbyte] c"tellics ptell For help on some commands that I understand, ptell me 'help'\0A\00" ; <[76 x sbyte]*> [#uses=0] + %str12 = internal global [3 x sbyte] c"%s\00" ; <[3 x sbyte]*> [#uses=0] + %my_partner = internal global [256 x sbyte] zeroinitializer ; <[256 x sbyte]*> [#uses=0] + %str13 = internal global [25 x sbyte] c"tellics set f5 bughouse\0A\00" ; <[25 x sbyte]*> [#uses=0] + %str = internal global [16 x sbyte] c"tellics unseek\0A\00" ; <[16 x sbyte]*> [#uses=0] + %str = internal global [20 x sbyte] c"tellics set f5 1=1\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str = internal global [80 x sbyte] c"is...uh...what did you say?\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" ; <[80 x sbyte]*> [#uses=0] + %str = internal global [5 x sbyte] c"help\00" ; <[5 x sbyte]*> [#uses=0] + %str = internal global [147 x sbyte] c"tellics ptell Commands that I understand are : sit, go, fast, slow, abort, flag, +/++/+++/-/--/---{p,n,b,r,q,d,h,trades}, x, dead, formula, help.\0A\00" ; <[147 x sbyte]*> [#uses=0] + %str = internal global [6 x sbyte] c"sorry\00" ; <[6 x sbyte]*> [#uses=0] + %str = internal global [59 x sbyte] c"tellics ptell Sorry, but I'm not playing a bughouse game.\0A\00" ; <[59 x sbyte]*> [#uses=0] + %str = internal global [4 x sbyte] c"sit\00" ; <[4 x sbyte]*> [#uses=0] + %str = internal global [56 x sbyte] c"tellics ptell Ok, I sit next move. Tell me when to go.\0A\00" ; <[56 x sbyte]*> [#uses=0] + %must_sit.b = internal global bool false ; [#uses=0] + %str114 = internal global [3 x sbyte] c"go\00" ; <[3 x sbyte]*> [#uses=0] + %str2 = internal global [5 x sbyte] c"move\00" ; <[5 x sbyte]*> [#uses=0] + %str = internal global [31 x sbyte] c"tellics ptell Ok, I'm moving.\0A\00" ; <[31 x sbyte]*> [#uses=0] + %str3 = internal global [5 x sbyte] c"fast\00" ; <[5 x sbyte]*> [#uses=0] + %str4 = internal global [5 x sbyte] c"time\00" ; <[5 x sbyte]*> [#uses=0] + %str15 = internal global [35 x sbyte] c"tellics ptell Ok, I'm going FAST!\0A\00" ; <[35 x sbyte]*> [#uses=0] + %go_fast.b = internal global bool false ; [#uses=0] + %str5 = internal global [5 x sbyte] c"slow\00" ; <[5 x sbyte]*> [#uses=0] + %str16 = internal global [36 x sbyte] c"tellics ptell Ok, moving normally.\0A\00" ; <[36 x sbyte]*> [#uses=0] + %str6 = internal global [6 x sbyte] c"abort\00" ; <[6 x sbyte]*> [#uses=0] + %str7 = internal global [35 x sbyte] c"tellics ptell Requesting abort...\0A\00" ; <[35 x sbyte]*> [#uses=0] + %str17 = internal global [15 x sbyte] c"tellics abort\0A\00" ; <[15 x sbyte]*> [#uses=0] + %str8 = internal global [5 x sbyte] c"flag\00" ; <[5 x sbyte]*> [#uses=0] + %str = internal global [27 x sbyte] c"tellics ptell Flagging...\0A\00" ; <[27 x sbyte]*> [#uses=0] + %str = internal global [14 x sbyte] c"tellics flag\0A\00" ; <[14 x sbyte]*> [#uses=0] + %str18 = internal global [2 x sbyte] c"+\00" ; <[2 x sbyte]*> [#uses=0] + %str9 = internal global [6 x sbyte] c"trade\00" ; <[6 x sbyte]*> [#uses=0] + %str10 = internal global [35 x sbyte] c"tellics ptell Ok, trading is GOOD\0A\00" ; <[35 x sbyte]*> [#uses=0] + %str11 = internal global [4 x sbyte] c"+++\00" ; <[4 x sbyte]*> [#uses=0] + %str12 = internal global [6 x sbyte] c"mates\00" ; <[6 x sbyte]*> [#uses=0] + %str13 = internal global [3 x sbyte] c"++\00" ; <[3 x sbyte]*> [#uses=0] + %str = internal global [49 x sbyte] c"is VERY good (ptell me 'x' to play normal again)\00" ; <[49 x sbyte]*> [#uses=0] + %str = internal global [44 x sbyte] c"is good (ptell me 'x' to play normal again)\00" ; <[44 x sbyte]*> [#uses=0] + %str19 = internal global [29 x sbyte] c"tellics ptell Ok, Knight %s\0A\00" ; <[29 x sbyte]*> [#uses=0] + %str14 = internal global [29 x sbyte] c"tellics ptell Ok, Bishop %s\0A\00" ; <[29 x sbyte]*> [#uses=0] + %str15 = internal global [27 x sbyte] c"tellics ptell Ok, Rook %s\0A\00" ; <[27 x sbyte]*> [#uses=0] + %str = internal global [28 x sbyte] c"tellics ptell Ok, Queen %s\0A\00" ; <[28 x sbyte]*> [#uses=0] + %str16 = internal global [27 x sbyte] c"tellics ptell Ok, Pawn %s\0A\00" ; <[27 x sbyte]*> [#uses=0] + %str17 = internal global [31 x sbyte] c"tellics ptell Ok, Diagonal %s\0A\00" ; <[31 x sbyte]*> [#uses=0] + %str18 = internal global [28 x sbyte] c"tellics ptell Ok, Heavy %s\0A\00" ; <[28 x sbyte]*> [#uses=0] + %str20 = internal global [34 x sbyte] c"tellics ptell Ok, trading is BAD\0A\00" ; <[34 x sbyte]*> [#uses=0] + %str20 = internal global [4 x sbyte] c"---\00" ; <[4 x sbyte]*> [#uses=0] + %str = internal global [53 x sbyte] c"mates you (ptell me 'x' when it no longer mates you)\00" ; <[53 x sbyte]*> [#uses=0] + %str21 = internal global [3 x sbyte] c"--\00" ; <[3 x sbyte]*> [#uses=0] + %str = internal global [52 x sbyte] c"is VERY bad (ptell me 'x' when it is no longer bad)\00" ; <[52 x sbyte]*> [#uses=0] + %str21 = internal global [47 x sbyte] c"is bad (ptell me 'x' when it is no longer bad)\00" ; <[47 x sbyte]*> [#uses=0] + %str23 = internal global [16 x sbyte] c"mate me anymore\00" ; <[16 x sbyte]*> [#uses=0] + %str24 = internal global [6 x sbyte] c"never\00" ; <[6 x sbyte]*> [#uses=0] + %str25 = internal global [5 x sbyte] c"mind\00" ; <[5 x sbyte]*> [#uses=0] + %str22 = internal global [9 x sbyte] c"ptell me\00" ; <[9 x sbyte]*> [#uses=0] + %str = internal global [55 x sbyte] c"tellics ptell Ok, reverting to STANDARD piece values!\0A\00" ; <[55 x sbyte]*> [#uses=0] + %partnerdead.b = internal global bool false ; [#uses=0] + %piecedead.b = internal global bool false ; [#uses=0] + %str = internal global [26 x sbyte] c"i'll have to sit...(dead)\00" ; <[26 x sbyte]*> [#uses=0] + %str27 = internal global [5 x sbyte] c"dead\00" ; <[5 x sbyte]*> [#uses=0] + %str28 = internal global [27 x sbyte] c"i'll have to sit...(piece)\00" ; <[27 x sbyte]*> [#uses=0] + %str29 = internal global [3 x sbyte] c"ok\00" ; <[3 x sbyte]*> [#uses=0] + %str30 = internal global [3 x sbyte] c"hi\00" ; <[3 x sbyte]*> [#uses=0] + %str31 = internal global [6 x sbyte] c"hello\00" ; <[6 x sbyte]*> [#uses=0] + %str32 = internal global [26 x sbyte] c"tellics ptell Greetings.\0A\00" ; <[26 x sbyte]*> [#uses=0] + %str = internal global [8 x sbyte] c"formula\00" ; <[8 x sbyte]*> [#uses=0] + %str = internal global [87 x sbyte] c"tellics ptell Setting formula, if you are still interrupted, complain to my operator.\0A\00" ; <[87 x sbyte]*> [#uses=0] + %str33 = internal global [59 x sbyte] c"tellics ptell Sorry, but I don't understand that command.\0A\00" ; <[59 x sbyte]*> [#uses=0] + %pawnmated.3298 = internal global int 0 ; [#uses=0] + %knightmated.3299 = internal global int 0 ; [#uses=0] + %bishopmated.3300 = internal global int 0 ; [#uses=0] + %rookmated.3301 = internal global int 0 ; [#uses=0] + %queenmated.3302 = internal global int 0 ; [#uses=0] + %str = internal global [41 x sbyte] c"tellics ptell p doesn't mate me anymore\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str34 = internal global [41 x sbyte] c"tellics ptell n doesn't mate me anymore\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str35 = internal global [41 x sbyte] c"tellics ptell b doesn't mate me anymore\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str36 = internal global [41 x sbyte] c"tellics ptell r doesn't mate me anymore\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str37 = internal global [41 x sbyte] c"tellics ptell q doesn't mate me anymore\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str38 = internal global [20 x sbyte] c"tellics ptell ---p\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str39 = internal global [20 x sbyte] c"tellics ptell ---n\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str40 = internal global [20 x sbyte] c"tellics ptell ---b\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str41 = internal global [20 x sbyte] c"tellics ptell ---r\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str42 = internal global [20 x sbyte] c"tellics ptell ---q\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str23 = internal global [17 x sbyte] c"tellics ptell x\0A\00" ; <[17 x sbyte]*> [#uses=0] + %str = internal global [18 x sbyte] c"tellics ptell go\0A\00" ; <[18 x sbyte]*> [#uses=0] + %bufftop = internal global int 0 ; [#uses=2] + %membuff = internal global ubyte* null ; [#uses=3] + %maxply = internal global int 0 ; [#uses=1] + %forwards = internal global int 0 ; [#uses=1] + %nodecount = internal global int 0 ; [#uses=1] + %frees = internal global int 0 ; [#uses=0] + %PBSize.b = internal global bool false ; [#uses=1] + %alllosers.b = internal global bool false ; [#uses=1] + %rootlosers = internal global [300 x int] zeroinitializer ; <[300 x int]*> [#uses=1] + %pn_move = internal global %struct.move_s zeroinitializer ; <%struct.move_s*> [#uses=7] + %iters = internal global int 0 ; [#uses=1] + %kibitzed.b = internal global bool false ; [#uses=0] + %str24 = internal global [28 x sbyte] c"tellics kibitz Forced win!\0A\00" ; <[28 x sbyte]*> [#uses=0] + %str25 = internal global [34 x sbyte] c"tellics kibitz Forced win! (alt)\0A\00" ; <[34 x sbyte]*> [#uses=0] + %pn_time = internal global int 0 ; [#uses=1] + %post = internal global uint 0 ; [#uses=0] + %str = internal global [94 x sbyte] c"tellics whisper proof %d, disproof %d, %d losers, highest depth %d, primary %d, secondary %d\0A\00" ; <[94 x sbyte]*> [#uses=0] + %str26 = internal global [30 x sbyte] c"tellics whisper Forced reply\0A\00" ; <[30 x sbyte]*> [#uses=0] + %str27 = internal global [60 x sbyte] c"P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d MaxDepth: %d\0A\00" ; <[60 x sbyte]*> [#uses=0] + %str = internal global [90 x sbyte] c"tellics whisper proof %d, disproof %d, %d nodes, %d forwards, %d iters, highest depth %d\0A\00" ; <[90 x sbyte]*> [#uses=0] + %str = internal global [11 x sbyte] c"Time : %f\0A\00" ; <[11 x sbyte]*> [#uses=0] + %str28 = internal global [23 x sbyte] c"This position is WON.\0A\00" ; <[23 x sbyte]*> [#uses=0] + %str29 = internal global [5 x sbyte] c"PV: \00" ; <[5 x sbyte]*> [#uses=0] + %str30 = internal global [4 x sbyte] c"%s \00" ; <[4 x sbyte]*> [#uses=0] + %str31 = internal global [2 x sbyte] c" \00" ; <[2 x sbyte]*> [#uses=0] + %str32 = internal global [41 x sbyte] c"\0Atellics kibitz Forced win in %d moves.\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str33 = internal global [20 x sbyte] c"\0A1-0 {White mates}\0A\00" ; <[20 x sbyte]*> [#uses=0] + %result = internal global int 0 ; [#uses=4] + %str1 = internal global [20 x sbyte] c"\0A0-1 {Black mates}\0A\00" ; <[20 x sbyte]*> [#uses=0] + %str35 = internal global [24 x sbyte] c"This position is LOST.\0A\00" ; <[24 x sbyte]*> [#uses=0] + %str36 = internal global [27 x sbyte] c"This position is UNKNOWN.\0A\00" ; <[27 x sbyte]*> [#uses=0] + %str37 = internal global [47 x sbyte] c"P: %d D: %d N: %d S: %d Mem: %2.2fM Iters: %d\0A\00" ; <[47 x sbyte]*> [#uses=0] + %s_threat.b = internal global bool false ; [#uses=0] + %TTSize.b = internal global bool false ; [#uses=3] + %cfg_razordrop.b = internal global bool false ; [#uses=0] + %cfg_futprune.b = internal global bool false ; [#uses=0] + %cfg_onerep.b = internal global bool false ; [#uses=0] + %setcode = internal global [30 x sbyte] zeroinitializer ; <[30 x sbyte]*> [#uses=0] + %str38 = internal global [3 x sbyte] c"%u\00" ; <[3 x sbyte]*> [#uses=0] + %searching_pv.b = internal global bool false ; [#uses=0] + %pv = internal global [300 x [300 x %struct.move_s]] zeroinitializer ; <[300 x [300 x %struct.move_s]]*> [#uses=0] + %i_depth = internal global int 0 ; [#uses=0] + %history_h = internal global [144 x [144 x uint]] zeroinitializer ; <[144 x [144 x uint]]*> [#uses=0] + %killer1 = internal global [300 x %struct.move_s] zeroinitializer ; <[300 x %struct.move_s]*> [#uses=0] + %killer2 = internal global [300 x %struct.move_s] zeroinitializer ; <[300 x %struct.move_s]*> [#uses=0] + %killer3 = internal global [300 x %struct.move_s] zeroinitializer ; <[300 x %struct.move_s]*> [#uses=0] + %rootnodecount = internal global [512 x uint] zeroinitializer ; <[512 x uint]*> [#uses=0] + %raw_nodes = internal global int 0 ; [#uses=0] + %pv_length = internal global [300 x int] zeroinitializer ; <[300 x int]*> [#uses=0] + %time_exit.b = internal global bool false ; [#uses=0] + %time_for_move = internal global int 0 ; [#uses=3] + %failed = internal global int 0 ; [#uses=0] + %extendedtime.b = internal global bool false ; [#uses=1] + %time_left = internal global int 0 ; [#uses=0] + %str39 = internal global [38 x sbyte] c"Extended from %d to %d, time left %d\0A\00" ; <[38 x sbyte]*> [#uses=0] + %checks = internal global [300 x uint] zeroinitializer ; <[300 x uint]*> [#uses=0] + %singular = internal global [300 x uint] zeroinitializer ; <[300 x uint]*> [#uses=0] + %recaps = internal global [300 x uint] zeroinitializer ; <[300 x uint]*> [#uses=0] + %ext_onerep = internal global uint 0 ; [#uses=1] + %FULL = internal global uint 0 ; [#uses=1] + %PVS = internal global uint 0 ; [#uses=1] + %PVSF = internal global uint 0 ; [#uses=1] + %killer_scores = internal global [300 x int] zeroinitializer ; <[300 x int]*> [#uses=0] + %killer_scores2 = internal global [300 x int] zeroinitializer ; <[300 x int]*> [#uses=0] + %killer_scores3 = internal global [300 x int] zeroinitializer ; <[300 x int]*> [#uses=0] + %time_failure.b = internal global bool false ; [#uses=0] + %cur_score = internal global int 0 ; [#uses=0] + %legals = internal global int 0 ; [#uses=3] + %movetotal = internal global int 0 ; [#uses=0] + %searching_move = internal global [20 x sbyte] zeroinitializer ; <[20 x sbyte]*> [#uses=0] + %is_pondering.b = internal global bool false ; [#uses=6] + %true_i_depth = internal global sbyte 0 ; [#uses=1] + %is_analyzing.b = internal global bool false ; [#uses=0] + %inc = internal global int 0 ; [#uses=1] + %time_cushion = internal global int 0 ; [#uses=2] + %str40 = internal global [16 x sbyte] c"Opening phase.\0A\00" ; <[16 x sbyte]*> [#uses=1] + %str = internal global [19 x sbyte] c"Middlegame phase.\0A\00" ; <[19 x sbyte]*> [#uses=1] + %str1 = internal global [16 x sbyte] c"Endgame phase.\0A\00" ; <[16 x sbyte]*> [#uses=1] + %str43 = internal global [20 x sbyte] c"Time for move : %d\0A\00" ; <[20 x sbyte]*> [#uses=1] + %postpv = internal global [256 x sbyte] zeroinitializer ; <[256 x sbyte]*> [#uses=0] + %str44 = internal global [49 x sbyte] c"tellics whisper %d restart(s), ended up with %s\0A\00" ; <[49 x sbyte]*> [#uses=0] + %moves_to_tc = internal global int 0 ; [#uses=0] + %str45 = internal global [27 x sbyte] c"tellics kibitz Mate in %d\0A\00" ; <[27 x sbyte]*> [#uses=0] + %str46 = internal global [52 x sbyte] c"tellics ptell Mate in %d, give him no more pieces.\0A\00" ; <[52 x sbyte]*> [#uses=0] + %tradefreely.b = internal global bool false ; [#uses=0] + %str = internal global [37 x sbyte] c"tellics ptell You can trade freely.\0A\00" ; <[37 x sbyte]*> [#uses=0] + %str47 = internal global [25 x sbyte] c"tellics ptell ---trades\0A\00" ; <[25 x sbyte]*> [#uses=0] + %str2 = internal global [49 x sbyte] c"tellics kibitz Both players dead...resigning...\0A\00" ; <[49 x sbyte]*> [#uses=0] + %str3 = internal global [16 x sbyte] c"tellics resign\0A\00" ; <[16 x sbyte]*> [#uses=0] + %str48 = internal global [81 x sbyte] c"tellics ptell I am forcedly mated (dead). Tell me 'go' to start moving into it.\0A\00" ; <[81 x sbyte]*> [#uses=0] + %str = internal global [62 x sbyte] c"tellics ptell I'll have to sit...(lose piece that mates you)\0A\00" ; <[62 x sbyte]*> [#uses=0] + %see_num_attackers = internal global [2 x int] zeroinitializer ; <[2 x int]*> [#uses=0] + %see_attackers = internal global [2 x [16 x %struct.see_data]] zeroinitializer ; <[2 x [16 x %struct.see_data]]*> [#uses=0] + %scentral = internal global [144 x int] [ int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int -20, int -10, int -10, int -10, int -10, int -10, int -10, int -20, int 0, int 0, int 0, int 0, int -10, int 0, int 3, int 5, int 5, int 3, int 0, int -10, int 0, int 0, int 0, int 0, int -10, int 2, int 15, int 15, int 15, int 15, int 2, int -10, int 0, int 0, int 0, int 0, int -10, int 7, int 15, int 25, int 25, int 15, int 7, int -10, int 0, int 0, int 0, int 0, int -10, int 7, int 15, int 25, int 25, int 15, int 7, int -10, int 0, int 0, int 0, int 0, int -10, int 2, int 15, int 15, int 15, int 15, int 2, int -10, int 0, int 0, int 0, int 0, int -10, int 0, int 3, int 5, int 5, int 3, int 0, int -10, int 0, int 0, int 0, int 0, int -20, int -10, int -10, int -10, int -10, int -10, int -10, int -20, int 0, int 0, int 0, int 0, int 0, int 0, int 0! , int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0, int 0 ] ; <[144 x int]*> [#uses=0] + %str51 = internal global [81 x sbyte] c"/Volumes/Stuff/src/speccpu2006-091-llvm/benchspec//CPU2006/458.sjeng/src/seval.c\00" ; <[81 x sbyte]*> [#uses=0] + %divider = internal global [50 x sbyte] c"-------------------------------------------------\00" ; <[50 x sbyte]*> [#uses=0] + %min_per_game = internal global int 0 ; [#uses=0] + %opp_rating = internal global int 0 ; [#uses=0] + %my_rating = internal global int 0 ; [#uses=0] + %str53 = internal global [15 x sbyte] c"SPEC Workload\0A\00" ; <[15 x sbyte]*> [#uses=0] + %opening_history = internal global [256 x sbyte] zeroinitializer ; <[256 x sbyte]*> [#uses=0] + %str60 = internal global [81 x sbyte] c"Material score: %d Eval : %d MaxPosDiff: %d White hand: %d Black hand : %d\0A\00" ; <[81 x sbyte]*> [#uses=0] + %str61 = internal global [26 x sbyte] c"Hash : %X HoldHash : %X\0A\00" ; <[26 x sbyte]*> [#uses=0] + %str62 = internal global [9 x sbyte] c"move %s\0A\00" ; <[9 x sbyte]*> [#uses=0] + %str63 = internal global [5 x sbyte] c"\0A%s\0A\00" ; <[5 x sbyte]*> [#uses=0] + %str64 = internal global [19 x sbyte] c"0-1 {Black Mates}\0A\00" ; <[19 x sbyte]*> [#uses=0] + %str1 = internal global [19 x sbyte] c"1-0 {White Mates}\0A\00" ; <[19 x sbyte]*> [#uses=0] + %str65 = internal global [27 x sbyte] c"1/2-1/2 {Fifty move rule}\0A\00" ; <[27 x sbyte]*> [#uses=0] + %str2 = internal global [29 x sbyte] c"1/2-1/2 {3 fold repetition}\0A\00" ; <[29 x sbyte]*> [#uses=0] + %str66 = internal global [16 x sbyte] c"1/2-1/2 {Draw}\0A\00" ; <[16 x sbyte]*> [#uses=0] + %str68 = internal global [8 x sbyte] c"Sjeng: \00" ; <[8 x sbyte]*> [#uses=0] + %str69 = internal global [18 x sbyte] c"Illegal move: %s\0A\00" ; <[18 x sbyte]*> [#uses=0] + %str3 = internal global [9 x sbyte] c"setboard\00" ; <[9 x sbyte]*> [#uses=0] + %str470 = internal global [5 x sbyte] c"quit\00" ; <[5 x sbyte]*> [#uses=0] + %str571 = internal global [5 x sbyte] c"exit\00" ; <[5 x sbyte]*> [#uses=0] + %str6 = internal global [8 x sbyte] c"diagram\00" ; <[8 x sbyte]*> [#uses=0] + %str7 = internal global [2 x sbyte] c"d\00" ; <[2 x sbyte]*> [#uses=0] + %str72 = internal global [6 x sbyte] c"perft\00" ; <[6 x sbyte]*> [#uses=0] + %str73 = internal global [3 x sbyte] c"%d\00" ; <[3 x sbyte]*> [#uses=0] + %str74 = internal global [28 x sbyte] c"Raw nodes for depth %d: %i\0A\00" ; <[28 x sbyte]*> [#uses=0] + %str = internal global [13 x sbyte] c"Time : %.2f\0A\00" ; <[13 x sbyte]*> [#uses=0] + %str75 = internal global [4 x sbyte] c"new\00" ; <[4 x sbyte]*> [#uses=0] + %str = internal global [40 x sbyte] c"tellics set 1 Sjeng SPEC 1.0 (SPEC/%s)\0A\00" ; <[40 x sbyte]*> [#uses=0] + %str = internal global [7 x sbyte] c"xboard\00" ; <[7 x sbyte]*> [#uses=0] + %str8 = internal global [6 x sbyte] c"nodes\00" ; <[6 x sbyte]*> [#uses=0] + %str77 = internal global [38 x sbyte] c"Number of nodes: %i (%0.2f%% qnodes)\0A\00" ; <[38 x sbyte]*> [#uses=0] + %str9 = internal global [5 x sbyte] c"post\00" ; <[5 x sbyte]*> [#uses=0] + %str10 = internal global [7 x sbyte] c"nopost\00" ; <[7 x sbyte]*> [#uses=0] + %str11 = internal global [7 x sbyte] c"random\00" ; <[7 x sbyte]*> [#uses=0] + %str12 = internal global [5 x sbyte] c"hard\00" ; <[5 x sbyte]*> [#uses=0] + %str13 = internal global [5 x sbyte] c"easy\00" ; <[5 x sbyte]*> [#uses=0] + %str14 = internal global [2 x sbyte] c"?\00" ; <[2 x sbyte]*> [#uses=0] + %str15 = internal global [6 x sbyte] c"white\00" ; <[6 x sbyte]*> [#uses=0] + %str16 = internal global [6 x sbyte] c"black\00" ; <[6 x sbyte]*> [#uses=0] + %str17 = internal global [6 x sbyte] c"force\00" ; <[6 x sbyte]*> [#uses=0] + %str18 = internal global [5 x sbyte] c"eval\00" ; <[5 x sbyte]*> [#uses=0] + %str = internal global [10 x sbyte] c"Eval: %d\0A\00" ; <[10 x sbyte]*> [#uses=0] + %str2178 = internal global [3 x sbyte] c"%i\00" ; <[3 x sbyte]*> [#uses=0] + %str22 = internal global [5 x sbyte] c"otim\00" ; <[5 x sbyte]*> [#uses=0] + %opp_time = internal global int 0 ; [#uses=0] + %str23 = internal global [6 x sbyte] c"level\00" ; <[6 x sbyte]*> [#uses=0] + %str = internal global [12 x sbyte] c"%i %i:%i %i\00" ; <[12 x sbyte]*> [#uses=0] + %sec_per_game = internal global int 0 ; [#uses=0] + %str24 = internal global [9 x sbyte] c"%i %i %i\00" ; <[9 x sbyte]*> [#uses=0] + %str25 = internal global [7 x sbyte] c"rating\00" ; <[7 x sbyte]*> [#uses=0] + %str26 = internal global [6 x sbyte] c"%i %i\00" ; <[6 x sbyte]*> [#uses=0] + %str27 = internal global [8 x sbyte] c"holding\00" ; <[8 x sbyte]*> [#uses=0] + %str28 = internal global [8 x sbyte] c"variant\00" ; <[8 x sbyte]*> [#uses=0] + %str29 = internal global [7 x sbyte] c"normal\00" ; <[7 x sbyte]*> [#uses=0] + %str79 = internal global [11 x sbyte] c"crazyhouse\00" ; <[11 x sbyte]*> [#uses=0] + %str30 = internal global [9 x sbyte] c"bughouse\00" ; <[9 x sbyte]*> [#uses=0] + %str31 = internal global [8 x sbyte] c"suicide\00" ; <[8 x sbyte]*> [#uses=0] + %str32 = internal global [9 x sbyte] c"giveaway\00" ; <[9 x sbyte]*> [#uses=0] + %str33 = internal global [7 x sbyte] c"losers\00" ; <[7 x sbyte]*> [#uses=0] + %str34 = internal global [8 x sbyte] c"analyze\00" ; <[8 x sbyte]*> [#uses=0] + %str35 = internal global [5 x sbyte] c"undo\00" ; <[5 x sbyte]*> [#uses=0] + %str36 = internal global [18 x sbyte] c"Move number : %d\0A\00" ; <[18 x sbyte]*> [#uses=0] + %str37 = internal global [7 x sbyte] c"remove\00" ; <[7 x sbyte]*> [#uses=0] + %str38 = internal global [5 x sbyte] c"edit\00" ; <[5 x sbyte]*> [#uses=0] + %str41 = internal global [2 x sbyte] c"#\00" ; <[2 x sbyte]*> [#uses=0] + %str42 = internal global [8 x sbyte] c"partner\00" ; <[8 x sbyte]*> [#uses=0] + %str43 = internal global [9 x sbyte] c"$partner\00" ; <[9 x sbyte]*> [#uses=0] + %str44 = internal global [6 x sbyte] c"ptell\00" ; <[6 x sbyte]*> [#uses=0] + %str45 = internal global [5 x sbyte] c"test\00" ; <[5 x sbyte]*> [#uses=0] + %str46 = internal global [3 x sbyte] c"st\00" ; <[3 x sbyte]*> [#uses=0] + %str47 = internal global [7 x sbyte] c"result\00" ; <[7 x sbyte]*> [#uses=0] + %str48 = internal global [6 x sbyte] c"prove\00" ; <[6 x sbyte]*> [#uses=0] + %str49 = internal global [26 x sbyte] c"\0AMax time to search (s): \00" ; <[26 x sbyte]*> [#uses=0] + %str50 = internal global [5 x sbyte] c"ping\00" ; <[5 x sbyte]*> [#uses=0] + %str51 = internal global [9 x sbyte] c"pong %d\0A\00" ; <[9 x sbyte]*> [#uses=0] + %str52 = internal global [6 x sbyte] c"fritz\00" ; <[6 x sbyte]*> [#uses=0] + %str53 = internal global [6 x sbyte] c"reset\00" ; <[6 x sbyte]*> [#uses=0] + %str54 = internal global [3 x sbyte] c"sd\00" ; <[3 x sbyte]*> [#uses=0] + %str55 = internal global [26 x sbyte] c"New max depth set to: %d\0A\00" ; <[26 x sbyte]*> [#uses=0] + %str56 = internal global [5 x sbyte] c"auto\00" ; <[5 x sbyte]*> [#uses=0] + %str57 = internal global [9 x sbyte] c"protover\00" ; <[9 x sbyte]*> [#uses=0] + %str = internal global [63 x sbyte] c"feature ping=0 setboard=1 playother=0 san=0 usermove=0 time=1\0A\00" ; <[63 x sbyte]*> [#uses=0] + %str80 = internal global [53 x sbyte] c"feature draw=0 sigint=0 sigterm=0 reuse=1 analyze=0\0A\00" ; <[53 x sbyte]*> [#uses=0] + %str = internal global [33 x sbyte] c"feature myname=\22Sjeng SPEC 1.0\22\0A\00" ; <[33 x sbyte]*> [#uses=0] + %str = internal global [71 x sbyte] c"feature variants=\22normal,bughouse,crazyhouse,suicide,giveaway,losers\22\0A\00" ; <[71 x sbyte]*> [#uses=0] + %str = internal global [46 x sbyte] c"feature colors=1 ics=0 name=0 pause=0 done=1\0A\00" ; <[46 x sbyte]*> [#uses=0] + %str58 = internal global [9 x sbyte] c"accepted\00" ; <[9 x sbyte]*> [#uses=0] + %str59 = internal global [9 x sbyte] c"rejected\00" ; <[9 x sbyte]*> [#uses=0] + %str = internal global [65 x sbyte] c"Interface does not support a required feature...expect trouble.\0A\00" ; <[65 x sbyte]*> [#uses=0] + %str61 = internal global [6 x sbyte] c"\0A%s\0A\0A\00" ; <[6 x sbyte]*> [#uses=0] + %str81 = internal global [41 x sbyte] c"diagram/d: toggle diagram display\0A\00" ; <[41 x sbyte]*> [#uses=0] + %str82 = internal global [34 x sbyte] c"exit/quit: terminate Sjeng\0A\00" ; <[34 x sbyte]*> [#uses=0] + %str62 = internal global [51 x sbyte] c"go: make Sjeng play the side to move\0A\00" ; <[51 x sbyte]*> [#uses=0] + %str83 = internal global [35 x sbyte] c"new: start a new game\0A\00" ; <[35 x sbyte]*> [#uses=0] + %str84 = internal global [55 x sbyte] c"level : the xboard style command to set time\0A\00" ; <[55 x sbyte]*> [#uses=0] + %str85 = internal global [49 x sbyte] c" should be in the form: where:\0A\00" ; <[49 x sbyte]*> [#uses=0] + %str63 = internal global [49 x sbyte] c" a -> moves to TC (0 if using an ICS style TC)\0A\00" ; <[49 x sbyte]*> [#uses=0] + %str86 = internal global [25 x sbyte] c" b -> minutes per game\0A\00" ; <[25 x sbyte]*> [#uses=0] + %str64 = internal global [29 x sbyte] c" c -> increment in seconds\0A\00" ; <[29 x sbyte]*> [#uses=0] + %str65 = internal global [55 x sbyte] c"nodes: outputs the number of nodes searched\0A\00" ; <[55 x sbyte]*> [#uses=0] + %str87 = internal global [47 x sbyte] c"perft : compute raw nodes to depth x\0A\00" ; <[47 x sbyte]*> [#uses=0] + %str = internal global [42 x sbyte] c"post: toggles thinking output\0A\00" ; <[42 x sbyte]*> [#uses=0] + %str = internal global [45 x sbyte] c"xboard: put Sjeng into xboard mode\0A\00" ; <[45 x sbyte]*> [#uses=0] + %str = internal global [39 x sbyte] c"test: run an EPD testsuite\0A\00" ; <[39 x sbyte]*> [#uses=0] + %str88 = internal global [52 x sbyte] c"speed: test movegen and evaluation speed\0A\00" ; <[52 x sbyte]*> [#uses=0] + %str89 = internal global [59 x sbyte] c"proof: try to prove or disprove the current pos\0A\00" ; <[59 x sbyte]*> [#uses=0] + %str90 = internal global [44 x sbyte] c"sd : limit thinking to depth x\0A\00" ; <[44 x sbyte]*> [#uses=0] + %str66 = internal global [51 x sbyte] c"st : limit thinking to x centiseconds\0A\00" ; <[51 x sbyte]*> [#uses=0] + %str67 = internal global [54 x sbyte] c"setboard : set board to a specified FEN string\0A\00" ; <[54 x sbyte]*> [#uses=0] + %str68 = internal global [38 x sbyte] c"undo: back up a half move\0A\00" ; <[38 x sbyte]*> [#uses=0] + %str69 = internal global [38 x sbyte] c"remove: back up a full move\0A\00" ; <[38 x sbyte]*> [#uses=0] + %str70 = internal global [42 x sbyte] c"force: disable computer moving\0A\00" ; <[42 x sbyte]*> [#uses=0] + %str71 = internal global [44 x sbyte] c"auto: computer plays both sides\0A\00" ; <[44 x sbyte]*> [#uses=0] + %DP_TTable = internal global %struct.TType* null ; <%struct.TType**> [#uses=1] + %AS_TTable = internal global %struct.TType* null ; <%struct.TType**> [#uses=1] + %QS_TTable = internal global %struct.QTType* null ; <%struct.QTType**> [#uses=1] + %str93 = internal global [38 x sbyte] c"Out of memory allocating hashtables.\0A\00" ; <[38 x sbyte]*> [#uses=0] + %type_to_char.3058 = internal global [14 x int] [ int 70, int 80, int 80, int 78, int 78, int 75, int 75, int 82, int 82, int 81, int 81, int 66, int 66, int 69 ] ; <[14 x int]*> [#uses=0] + %str94 = internal global [8 x sbyte] c"%c@%c%d\00" ; <[8 x sbyte]*> [#uses=0] + %str95 = internal global [5 x sbyte] c"%c%d\00" ; <[5 x sbyte]*> [#uses=0] + %str1 = internal global [8 x sbyte] c"%c%d=%c\00" ; <[8 x sbyte]*> [#uses=0] + %str2 = internal global [8 x sbyte] c"%cx%c%d\00" ; <[8 x sbyte]*> [#uses=0] + %str96 = internal global [11 x sbyte] c"%cx%c%d=%c\00" ; <[11 x sbyte]*> [#uses=0] + %str97 = internal global [4 x sbyte] c"O-O\00" ; <[4 x sbyte]*> [#uses=0] + %str98 = internal global [6 x sbyte] c"O-O-O\00" ; <[6 x sbyte]*> [#uses=0] + %str99 = internal global [9 x sbyte] c"%c%c%c%d\00" ; <[9 x sbyte]*> [#uses=0] + %str3100 = internal global [9 x sbyte] c"%c%d%c%d\00" ; <[9 x sbyte]*> [#uses=0] + %str101 = internal global [10 x sbyte] c"%c%cx%c%d\00" ; <[10 x sbyte]*> [#uses=0] + %str4 = internal global [10 x sbyte] c"%c%dx%c%d\00" ; <[10 x sbyte]*> [#uses=0] + %str102 = internal global [7 x sbyte] c"%c%c%d\00" ; <[7 x sbyte]*> [#uses=0] + %str5103 = internal global [5 x sbyte] c"illg\00" ; <[5 x sbyte]*> [#uses=0] + %type_to_char.3190 = internal global [14 x int] [ int 70, int 80, int 112, int 78, int 110, int 75, int 107, int 82, int 114, int 81, int 113, int 66, int 98, int 69 ] ; <[14 x int]*> [#uses=0] + %str7 = internal global [10 x sbyte] c"%c%d%c%dn\00" ; <[10 x sbyte]*> [#uses=0] + %str8 = internal global [10 x sbyte] c"%c%d%c%dr\00" ; <[10 x sbyte]*> [#uses=0] + %str9 = internal global [10 x sbyte] c"%c%d%c%db\00" ; <[10 x sbyte]*> [#uses=0] + %str10 = internal global [10 x sbyte] c"%c%d%c%dk\00" ; <[10 x sbyte]*> [#uses=0] + %str11 = internal global [10 x sbyte] c"%c%d%c%dq\00" ; <[10 x sbyte]*> [#uses=0] + %C.88.3251 = internal global [14 x sbyte*] [ sbyte* getelementptr ([3 x sbyte]* %str105, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str12106, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str13107, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str14, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str15, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str16, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str17, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str18, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str19108, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str20, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str21109, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str22, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str23, int 0, int 0), sbyte* getelementptr ([3 x sbyte]* %str24, int 0, int 0) ] ; <[14 x sbyte*]*> [#uses=0] + %str105 = internal global [3 x sbyte] c"!!\00" ; <[3 x sbyte]*> [#uses=1] + %str12106 = internal global [3 x sbyte] c" P\00" ; <[3 x sbyte]*> [#uses=1] + %str13107 = internal global [3 x sbyte] c"*P\00" ; <[3 x sbyte]*> [#uses=1] + %str14 = internal global [3 x sbyte] c" N\00" ; <[3 x sbyte]*> [#uses=1] + %str15 = internal global [3 x sbyte] c"*N\00" ; <[3 x sbyte]*> [#uses=1] + %str16 = internal global [3 x sbyte] c" K\00" ; <[3 x sbyte]*> [#uses=1] + %str17 = internal global [3 x sbyte] c"*K\00" ; <[3 x sbyte]*> [#uses=1] + %str18 = internal global [3 x sbyte] c" R\00" ; <[3 x sbyte]*> [#uses=1] + %str19108 = internal global [3 x sbyte] c"*R\00" ; <[3 x sbyte]*> [#uses=1] + %str20 = internal global [3 x sbyte] c" Q\00" ; <[3 x sbyte]*> [#uses=1] + %str21109 = internal global [3 x sbyte] c"*Q\00" ; <[3 x sbyte]*> [#uses=1] + %str22 = internal global [3 x sbyte] c" B\00" ; <[3 x sbyte]*> [#uses=1] + %str23 = internal global [3 x sbyte] c"*B\00" ; <[3 x sbyte]*> [#uses=1] + %str24 = internal global [3 x sbyte] c" \00" ; <[3 x sbyte]*> [#uses=1] + %str110 = internal global [42 x sbyte] c"+----+----+----+----+----+----+----+----+\00" ; <[42 x sbyte]*> [#uses=0] + %str25 = internal global [6 x sbyte] c" %s\0A\00" ; <[6 x sbyte]*> [#uses=0] + %str26 = internal global [5 x sbyte] c"%d |\00" ; <[5 x sbyte]*> [#uses=0] + %str27 = internal global [6 x sbyte] c" %s |\00" ; <[6 x sbyte]*> [#uses=0] + %str28 = internal global [7 x sbyte] c"\0A %s\0A\00" ; <[7 x sbyte]*> [#uses=0] + %str111 = internal global [45 x sbyte] c"\0A a b c d e f g h\0A\0A\00" ; <[45 x sbyte]*> [#uses=0] + %str29 = internal global [45 x sbyte] c"\0A h g f e d c b a\0A\0A\00" ; <[45 x sbyte]*> [#uses=0] + %str33 = internal global [2 x sbyte] c"<\00" ; <[2 x sbyte]*> [#uses=0] + %str34 = internal global [3 x sbyte] c"> \00" ; <[3 x sbyte]*> [#uses=0] + %str114 = internal global [18 x sbyte] c"%2i %7i %5i %8i \00" ; <[18 x sbyte]*> [#uses=0] + %str115 = internal global [20 x sbyte] c"%2i %c%1i.%02i %9i \00" ; <[20 x sbyte]*> [#uses=0] + %str39 = internal global [5 x sbyte] c"%s !\00" ; <[5 x sbyte]*> [#uses=0] + %str40 = internal global [6 x sbyte] c"%s !!\00" ; <[6 x sbyte]*> [#uses=0] + %str41 = internal global [6 x sbyte] c"%s ??\00" ; <[6 x sbyte]*> [#uses=0] + %str124 = internal global [71 x sbyte] c"\0ASjeng version SPEC 1.0, Copyright (C) 2000-2005 Gian-Carlo Pascutto\0A\0A\00" ; <[71 x sbyte]*> [#uses=0] + %state = internal global [625 x uint] zeroinitializer ; <[625 x uint]*> [#uses=0] + + implementation ; Functions: + + declare fastcc int %calc_attackers(int, int) + + declare fastcc uint %is_attacked(int, int) + + declare fastcc void %ProcessHoldings(sbyte*) + + declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint) + + declare sbyte* %strncpy(sbyte*, sbyte*, uint) + + declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint) + + declare void %__eprintf(sbyte*, sbyte*, uint, sbyte*) + + declare fastcc void %addHolding(int, int) + + declare fastcc void %removeHolding(int, int) + + declare fastcc void %DropremoveHolding(int, int) + + declare int %printf(sbyte*, ...) + + declare fastcc uint %is_draw() + + declare void %exit(int) + + declare fastcc void %setup_epd_line(sbyte*) + + declare int %atoi(sbyte*) + + declare fastcc void %reset_piece_square() + + declare fastcc void %initialize_hash() + + declare int %__maskrune(int, uint) + + declare fastcc void %comp_to_san(long, long, long, sbyte*) + + declare sbyte* %strstr(sbyte*, sbyte*) + + declare int %atol(sbyte*) + + declare %struct.FILE* %fopen(sbyte*, sbyte*) + + declare fastcc void %display_board(int) + + internal csretcc void %think(%struct.move_s* %agg.result) { + entry: + %output.i = alloca [8 x sbyte], align 8 ; <[8 x sbyte]*> [#uses=0] + %comp_move = alloca %struct.move_s, align 16 ; <%struct.move_s*> [#uses=7] + %temp_move = alloca %struct.move_s, align 16 ; <%struct.move_s*> [#uses=6] + %moves = alloca [512 x %struct.move_s], align 16 ; <[512 x %struct.move_s]*> [#uses=7] + %output = alloca [8 x sbyte], align 8 ; <[8 x sbyte]*> [#uses=1] + store bool false, bool* %userealholdings.b + %tmp = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0 ; <%struct.move_s*> [#uses=3] + %tmp362 = getelementptr %struct.move_s* %comp_move, int 0, uint 0 ; [#uses=0] + %tmp365 = getelementptr %struct.move_s* %comp_move, int 0, uint 1 ; [#uses=0] + %tmp368 = getelementptr %struct.move_s* %comp_move, int 0, uint 2 ; [#uses=0] + %tmp371 = getelementptr %struct.move_s* %comp_move, int 0, uint 3 ; [#uses=0] + %tmp374 = getelementptr %struct.move_s* %comp_move, int 0, uint 4 ; [#uses=0] + %tmp377 = getelementptr %struct.move_s* %comp_move, int 0, uint 5 ; [#uses=0] + %tmp = cast %struct.move_s* %comp_move to { long, long, long }* ; <{ long, long, long }*> [#uses=3] + %tmp = getelementptr { long, long, long }* %tmp, int 0, uint 0 ; [#uses=0] + %tmp829 = getelementptr { long, long, long }* %tmp, int 0, uint 1 ; [#uses=0] + %tmp832 = getelementptr { long, long, long }* %tmp, int 0, uint 2 ; [#uses=0] + %output = getelementptr [8 x sbyte]* %output, int 0, int 0 ; [#uses=0] + %tmp573 = getelementptr %struct.move_s* %temp_move, int 0, uint 0 ; [#uses=0] + %tmp576 = getelementptr %struct.move_s* %temp_move, int 0, uint 1 ; [#uses=0] + %tmp579 = getelementptr %struct.move_s* %temp_move, int 0, uint 2 ; [#uses=0] + %tmp582 = getelementptr %struct.move_s* %temp_move, int 0, uint 3 ; [#uses=0] + %tmp585 = getelementptr %struct.move_s* %temp_move, int 0, uint 4 ; [#uses=0] + %tmp588 = getelementptr %struct.move_s* %temp_move, int 0, uint 5 ; [#uses=0] + %pn_restart.0.ph = cast uint 0 to int ; [#uses=2] + %tmp21362 = seteq uint 0, 0 ; [#uses=2] + %tmp216 = cast int %pn_restart.0.ph to float ; [#uses=1] + %tmp216 = cast float %tmp216 to double ; [#uses=1] + %tmp217 = add double %tmp216, 1.000000e+00 ; [#uses=1] + %tmp835 = setgt int %pn_restart.0.ph, 9 ; [#uses=0] + store int 0, int* %nodes + store int 0, int* %qnodes + store int 1, int* %ply + store uint 0, uint* %ECacheProbes + store uint 0, uint* %ECacheHits + store uint 0, uint* %TTProbes + store uint 0, uint* %TTHits + store uint 0, uint* %TTStores + store uint 0, uint* %NCuts + store uint 0, uint* %NTries + store uint 0, uint* %TExt + store uint 0, uint* %FH + store uint 0, uint* %FHF + store uint 0, uint* %PVS + store uint 0, uint* %FULL + store uint 0, uint* %PVSF + store uint 0, uint* %ext_check + store uint 0, uint* %ext_onerep + store uint 0, uint* %razor_drop + store uint 0, uint* %razor_material + store bool false, bool* %extendedtime.b + store bool false, bool* %forcedwin.b + store int 200, int* %maxposdiff + store sbyte 0, sbyte* %true_i_depth + store int 0, int* %legals + %tmp48 = load int* %Variant ; [#uses=1] + %tmp49 = seteq int %tmp48, 4 ; [#uses=1] + %storemerge = cast bool %tmp49 to uint ; [#uses=1] + store uint %storemerge, uint* %captures + call fastcc void %gen( %struct.move_s* %tmp ) + %tmp53 = load int* %numb_moves ; [#uses=1] + %tmp.i = load int* %Variant ; [#uses=1] + %tmp.i = seteq int %tmp.i, 3 ; [#uses=1] + br bool %tmp.i, label %in_check.exit, label %cond_next.i + + cond_next.i: ; preds = %entry + %tmp2.i5 = load int* %white_to_move ; [#uses=1] + %tmp3.i = seteq int %tmp2.i5, 1 ; [#uses=0] + ret void + + in_check.exit: ; preds = %entry + %tmp7637 = setgt int %tmp53, 0 ; [#uses=1] + br bool %tmp7637, label %cond_true77, label %bb80 + + cond_true77: ; preds = %in_check.exit + %l.1.0 = cast uint 0 to int ; [#uses=2] + call fastcc void %make( %struct.move_s* %tmp, int %l.1.0 ) + %tmp61 = call fastcc uint %check_legal( %struct.move_s* %tmp, int %l.1.0, int 0 ) ; [#uses=1] + %tmp62 = seteq uint %tmp61, 0 ; [#uses=0] + ret void + + bb80: ; preds = %in_check.exit + %tmp81 = load int* %Variant ; [#uses=1] + %tmp82 = seteq int %tmp81, 4 ; [#uses=1] + br bool %tmp82, label %cond_true83, label %cond_next118 + + cond_true83: ; preds = %bb80 + %tmp84 = load int* %legals ; [#uses=1] + %tmp85 = seteq int %tmp84, 0 ; [#uses=0] + ret void + + cond_next118: ; preds = %bb80 + %tmp119 = load int* %Variant ; [#uses=1] + %tmp120 = seteq int %tmp119, 1 ; [#uses=1] + br bool %tmp120, label %cond_next176, label %cond_true121 + + cond_true121: ; preds = %cond_next118 + %tmp122.b = load bool* %is_pondering.b ; [#uses=1] + br bool %tmp122.b, label %cond_next176, label %cond_true124 + + cond_true124: ; preds = %cond_true121 + %tmp125 = load int* %legals ; [#uses=1] + %tmp126 = seteq int %tmp125, 1 ; [#uses=1] + br bool %tmp126, label %cond_true127, label %cond_next176 + + cond_true127: ; preds = %cond_true124 + %tmp128 = load int* %inc ; [#uses=1] + %tmp129 = mul int %tmp128, 100 ; [#uses=1] + %tmp130 = load int* %time_cushion ; [#uses=1] + %tmp131 = add int %tmp129, %tmp130 ; [#uses=1] + store int %tmp131, int* %time_cushion + %tmp134 = getelementptr %struct.move_s* %agg.result, int 0, uint 0 ; [#uses=1] + %tmp135 = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0, uint 0 ; [#uses=1] + %tmp136 = load int* %tmp135 ; [#uses=1] + store int %tmp136, int* %tmp134 + %tmp137 = getelementptr %struct.move_s* %agg.result, int 0, uint 1 ; [#uses=1] + %tmp138 = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0, uint 1 ; [#uses=1] + %tmp139 = load int* %tmp138 ; [#uses=1] + store int %tmp139, int* %tmp137 + %tmp140 = getelementptr %struct.move_s* %agg.result, int 0, uint 2 ; [#uses=1] + %tmp141 = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0, uint 2 ; [#uses=1] + %tmp142 = load int* %tmp141 ; [#uses=1] + store int %tmp142, int* %tmp140 + %tmp143 = getelementptr %struct.move_s* %agg.result, int 0, uint 3 ; [#uses=1] + %tmp144 = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0, uint 3 ; [#uses=1] + %tmp145 = load int* %tmp144 ; [#uses=1] + store int %tmp145, int* %tmp143 + %tmp146 = getelementptr %struct.move_s* %agg.result, int 0, uint 4 ; [#uses=1] + %tmp147 = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0, uint 4 ; [#uses=1] + %tmp148 = load int* %tmp147 ; [#uses=1] + store int %tmp148, int* %tmp146 + %tmp149 = getelementptr %struct.move_s* %agg.result, int 0, uint 5 ; [#uses=1] + %tmp150 = getelementptr [512 x %struct.move_s]* %moves, int 0, int 0, uint 5 ; [#uses=1] + %tmp151 = load int* %tmp150 ; [#uses=1] + store int %tmp151, int* %tmp149 + ret void + + cond_next176: ; preds = %cond_true124, %cond_true121, %cond_next118 + call fastcc void %check_phase( ) + %tmp177 = load int* %phase ; [#uses=1] + switch int %tmp177, label %bb187 [ + int 0, label %bb178 + int 1, label %bb180 + int 2, label %bb183 + ] + + bb178: ; preds = %cond_next176 + %tmp179 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([16 x sbyte]* %str40, int 0, uint 0) ) ; [#uses=0] + %tmp18854.b = load bool* %is_pondering.b ; [#uses=1] + br bool %tmp18854.b, label %cond_false210, label %cond_true190 + + bb180: ; preds = %cond_next176 + %tmp182 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([19 x sbyte]* %str, int 0, uint 0) ) ; [#uses=0] + %tmp18856.b = load bool* %is_pondering.b ; [#uses=0] + ret void + + bb183: ; preds = %cond_next176 + %tmp185 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([16 x sbyte]* %str1, int 0, uint 0) ) ; [#uses=0] + %tmp18858.b = load bool* %is_pondering.b ; [#uses=0] + ret void + + bb187: ; preds = %cond_next176 + %tmp188.b = load bool* %is_pondering.b ; [#uses=0] + ret void + + cond_true190: ; preds = %bb178 + %tmp191 = load int* %fixed_time ; [#uses=1] + %tmp192 = seteq int %tmp191, 0 ; [#uses=0] + ret void + + cond_false210: ; preds = %bb178 + store int 999999, int* %time_for_move + br bool %tmp21362, label %cond_true226.critedge, label %bb287.critedge + + cond_true226.critedge: ; preds = %cond_false210 + %tmp223.c = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([20 x sbyte]* %str43, int 0, uint 0), int 999999 ) ; [#uses=0] + %tmp.i = load %struct.TType** %DP_TTable ; <%struct.TType*> [#uses=1] + %tmp.i7.b = load bool* %TTSize.b ; [#uses=1] + %tmp1.i = select bool %tmp.i7.b, uint 60000000, uint 0 ; [#uses=1] + %tmp.i = getelementptr %struct.TType* %tmp.i, int 0, uint 0 ; [#uses=1] + call void %llvm.memset.i32( sbyte* %tmp.i, ubyte 0, uint %tmp1.i, uint 4 ) + %tmp2.i = load %struct.TType** %AS_TTable ; <%struct.TType*> [#uses=1] + %tmp3.i8.b = load bool* %TTSize.b ; [#uses=1] + %tmp4.i = select bool %tmp3.i8.b, uint 60000000, uint 0 ; [#uses=1] + %tmp2.i = getelementptr %struct.TType* %tmp2.i, int 0, uint 0 ; [#uses=1] + call void %llvm.memset.i32( sbyte* %tmp2.i, ubyte 0, uint %tmp4.i, uint 4 ) + %tmp.i = load %struct.QTType** %QS_TTable ; <%struct.QTType*> [#uses=1] + %tmp5.i9.b = load bool* %TTSize.b ; [#uses=1] + %tmp6.i10 = select bool %tmp5.i9.b, uint 48000000, uint 0 ; [#uses=1] + %tmp7.i = getelementptr %struct.QTType* %tmp.i, int 0, uint 0 ; [#uses=1] + call void %llvm.memset.i32( sbyte* %tmp7.i, ubyte 0, uint %tmp6.i10, uint 4 ) + %tmp.i = load %struct.ECacheType** %ECache ; <%struct.ECacheType*> [#uses=1] + %tmp.i14.b = load bool* %ECacheSize.b ; [#uses=1] + %tmp1.i16 = select bool %tmp.i14.b, uint 12000000, uint 0 ; [#uses=1] + %tmp.i17 = cast %struct.ECacheType* %tmp.i to sbyte* ; [#uses=1] + call void %llvm.memset.i32( sbyte* %tmp.i17, ubyte 0, uint %tmp1.i16, uint 4 ) + call void %llvm.memset.i32( sbyte* cast ([300 x int]* %rootlosers to sbyte*), ubyte 0, uint 1200, uint 4 ) + %tmp234.b = load bool* %is_pondering.b ; [#uses=1] + br bool %tmp234.b, label %bb263, label %cond_next238 + + cond_next238: ; preds = %cond_true226.critedge + %tmp239 = load int* %Variant ; [#uses=2] + switch int %tmp239, label %bb263 [ + int 3, label %bb249 + int 4, label %bb249 + ] + + bb249: ; preds = %cond_next238, %cond_next238 + %tmp250 = load int* %piece_count ; [#uses=1] + %tmp251 = setgt int %tmp250, 3 ; [#uses=1] + %tmp240.not = setne int %tmp239, 3 ; [#uses=1] + %brmerge = or bool %tmp251, %tmp240.not ; [#uses=1] + br bool %brmerge, label %bb260, label %bb263 + + bb260: ; preds = %bb249 + %tmp261 = load int* %time_for_move ; [#uses=1] + %tmp261 = cast int %tmp261 to float ; [#uses=1] + %tmp261 = cast float %tmp261 to double ; [#uses=1] + %tmp262 = div double %tmp261, 3.000000e+00 ; [#uses=1] + %tmp262 = cast double %tmp262 to int ; [#uses=1] + store int %tmp262, int* %pn_time + %tmp1.b.i = load bool* %PBSize.b ; [#uses=1] + %tmp1.i1 = select bool %tmp1.b.i, uint 200000, uint 0 ; [#uses=1] + %tmp.i2 = call sbyte* %calloc( uint %tmp1.i1, uint 44 ) ; [#uses=1] + %tmp.i = cast sbyte* %tmp.i2 to ubyte* ; [#uses=1] + store ubyte* %tmp.i, ubyte** %membuff + %tmp2.i3 = call sbyte* %calloc( uint 1, uint 44 ) ; [#uses=3] + %tmp2.i = cast sbyte* %tmp2.i3 to %struct.node_t* ; <%struct.node_t*> [#uses=6] + %tmp.i = getelementptr [512 x %struct.move_s]* null, int 0, int 0 ; <%struct.move_s*> [#uses=3] + call fastcc void %gen( %struct.move_s* %tmp.i ) + %tmp3.i4 = load int* %numb_moves ; [#uses=4] + %tmp3.i5 = cast int %tmp3.i4 to uint ; [#uses=0] + store bool false, bool* %alllosers.b + call void %llvm.memset.i32( sbyte* cast ([300 x int]* %rootlosers to sbyte*), ubyte 0, uint 1200, uint 4 ) + %nodesspent.i = cast [512 x int]* null to sbyte* ; [#uses=1] + call void %llvm.memset.i32( sbyte* %nodesspent.i, ubyte 0, uint 2048, uint 16 ) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 0) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 1) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 2) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 3) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 4) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 5) + %tmp.i.i = load int* %Variant ; [#uses=1] + %tmp.i.i = seteq int %tmp.i.i, 3 ; [#uses=1] + br bool %tmp.i.i, label %in_check.exit.i, label %cond_next.i.i + + cond_next.i.i: ; preds = %bb260 + %tmp2.i.i = load int* %white_to_move ; [#uses=1] + %tmp3.i.i = seteq int %tmp2.i.i, 1 ; [#uses=1] + br bool %tmp3.i.i, label %cond_true4.i.i, label %cond_false12.i.i + + cond_true4.i.i: ; preds = %cond_next.i.i + %tmp5.i.i = load int* %wking_loc ; [#uses=1] + %tmp6.i.i = call fastcc uint %is_attacked( int %tmp5.i.i, int 0 ) ; [#uses=1] + %not.tmp7.i.i = setne uint %tmp6.i.i, 0 ; [#uses=1] + %tmp217.i = cast bool %not.tmp7.i.i to int ; [#uses=1] + %tmp4219.i = setgt int %tmp3.i4, 0 ; [#uses=1] + br bool %tmp4219.i, label %cond_true43.i, label %bb46.i + + cond_false12.i.i: ; preds = %cond_next.i.i + %tmp13.i.i = load int* %bking_loc ; [#uses=1] + %tmp14.i.i = call fastcc uint %is_attacked( int %tmp13.i.i, int 1 ) ; [#uses=1] + %not.tmp15.i.i = setne uint %tmp14.i.i, 0 ; [#uses=1] + %tmp2120.i = cast bool %not.tmp15.i.i to int ; [#uses=1] + %tmp4222.i = setgt int %tmp3.i4, 0 ; [#uses=1] + br bool %tmp4222.i, label %cond_true43.i, label %bb46.i + + in_check.exit.i: ; preds = %bb260 + %tmp4224.i = setgt int %tmp3.i4, 0 ; [#uses=0] + ret void + + cond_true43.i: ; preds = %cond_false12.i.i, %cond_true4.i.i + %tmp21.0.ph.i = phi int [ %tmp217.i, %cond_true4.i.i ], [ %tmp2120.i, %cond_false12.i.i ] ; [#uses=1] + %i.0.0.i = cast uint 0 to int ; [#uses=2] + call fastcc void %make( %struct.move_s* %tmp.i, int %i.0.0.i ) + %tmp27.i = call fastcc uint %check_legal( %struct.move_s* %tmp.i, int %i.0.0.i, int %tmp21.0.ph.i ) ; [#uses=1] + %tmp.i6 = seteq uint %tmp27.i, 0 ; [#uses=0] + ret void + + bb46.i: ; preds = %cond_false12.i.i, %cond_true4.i.i + %tmp48.i = seteq int 0, 0 ; [#uses=1] + br bool %tmp48.i, label %cond_true49.i, label %cond_next53.i + + cond_true49.i: ; preds = %bb46.i + store int 0, int* %bufftop + %tmp50.i = load ubyte** %membuff ; [#uses=1] + free ubyte* %tmp50.i + free sbyte* %tmp2.i3 + ret void + + cond_next53.i: ; preds = %bb46.i + store int 1, int* %nodecount + store int 0, int* %iters + store int 0, int* %maxply + store int 0, int* %forwards + %tmp54.i = load int* %move_number ; [#uses=1] + %tmp55.i = load int* %ply ; [#uses=1] + %tmp56.i = add int %tmp54.i, -1 ; [#uses=1] + %tmp57.i = add int %tmp56.i, %tmp55.i ; [#uses=1] + %tmp58.i = load uint* %hash ; [#uses=1] + %tmp.i = getelementptr [600 x uint]* %hash_history, int 0, int %tmp57.i ; [#uses=1] + store uint %tmp58.i, uint* %tmp.i + %tmp59.i = load int* %white_to_move ; [#uses=1] + %tmp60.i = seteq int %tmp59.i, 0 ; [#uses=1] + %tmp60.i = cast bool %tmp60.i to int ; [#uses=1] + store int %tmp60.i, int* %root_to_move + %tmp.i4.i = load int* %Variant ; [#uses=2] + %tmp.i5.i = seteq int %tmp.i4.i, 3 ; [#uses=1] + br bool %tmp.i5.i, label %cond_true.i.i, label %cond_false.i.i + + cond_true.i.i: ; preds = %cond_next53.i + call fastcc void %suicide_pn_eval( %struct.node_t* %tmp2.i ) + %tmp6328.i = getelementptr %struct.node_t* %tmp2.i, int 0, uint 0 ; [#uses=1] + %tmp29.i = load ubyte* %tmp6328.i ; [#uses=1] + %tmp6430.i = seteq ubyte %tmp29.i, 1 ; [#uses=0] + ret void + + cond_false.i.i: ; preds = %cond_next53.i + %tmp2.i.i = seteq int %tmp.i4.i, 4 ; [#uses=1] + %tmp63.i = getelementptr %struct.node_t* %tmp2.i, int 0, uint 0 ; [#uses=2] + br bool %tmp2.i.i, label %cond_true3.i.i, label %cond_false5.i.i + + cond_true3.i.i: ; preds = %cond_false.i.i + call fastcc void %losers_pn_eval( %struct.node_t* %tmp2.i ) + %tmp31.i = load ubyte* %tmp63.i ; [#uses=1] + %tmp6432.i = seteq ubyte %tmp31.i, 1 ; [#uses=1] + br bool %tmp6432.i, label %bb75.i, label %cond_next67.i + + cond_false5.i.i: ; preds = %cond_false.i.i + call fastcc void %std_pn_eval( %struct.node_t* %tmp2.i ) + %tmp.i = load ubyte* %tmp63.i ; [#uses=1] + %tmp64.i = seteq ubyte %tmp.i, 1 ; [#uses=0] + ret void + + cond_next67.i: ; preds = %cond_true3.i.i + %tmp69.i = getelementptr %struct.node_t* %tmp2.i, int 0, uint 0 ; [#uses=1] + %tmp70.i = load ubyte* %tmp69.i ; [#uses=1] + %tmp71.i = seteq ubyte %tmp70.i, 0 ; [#uses=0] + ret void + + bb75.i: ; preds = %cond_true3.i.i + store int 0, int* %bufftop + %tmp76.i = load ubyte** %membuff ; [#uses=1] + free ubyte* %tmp76.i + free sbyte* %tmp2.i3 + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 0) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 1) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 2) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 3) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 4) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 5) + %tmp28869 = load int* %result ; [#uses=1] + %tmp28970 = seteq int %tmp28869, 0 ; [#uses=1] + br bool %tmp28970, label %cond_next337, label %cond_true290 + + bb263: ; preds = %bb249, %cond_next238, %cond_true226.critedge + br bool %tmp21362, label %cond_true266, label %bb287 + + cond_true266: ; preds = %bb263 + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 0) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 1) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 2) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 3) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 4) + store int 0, int* getelementptr (%struct.move_s* %pn_move, uint 0, uint 5) + %tmp28871 = load int* %result ; [#uses=1] + %tmp28972 = seteq int %tmp28871, 0 ; [#uses=0] + ret void + + bb287.critedge: ; preds = %cond_false210 + %tmp218.c = div double 1.999998e+06, %tmp217 ; [#uses=1] + %tmp218.c = cast double %tmp218.c to int ; [#uses=2] + store int %tmp218.c, int* %time_for_move + %tmp22367.c = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([20 x sbyte]* %str43, int 0, uint 0), int %tmp218.c ) ; [#uses=0] + ret void + + bb287: ; preds = %bb263 + %tmp288 = load int* %result ; [#uses=1] + %tmp289 = seteq int %tmp288, 0 ; [#uses=0] + ret void + + cond_true290: ; preds = %bb75.i + %tmp292 = load int* getelementptr (%struct.move_s* %pn_move, int 0, uint 1) ; [#uses=1] + %tmp295 = seteq int %tmp292, 0 ; [#uses=0] + ret void + + cond_next337: ; preds = %bb75.i + %tmp338.b = load bool* %forcedwin.b ; [#uses=1] + br bool %tmp338.b, label %bb348, label %cond_next342 + + cond_next342: ; preds = %cond_next337 + %tmp343 = load int* %result ; [#uses=1] + %tmp344 = seteq int %tmp343, 0 ; [#uses=0] + ret void + + bb348: ; preds = %cond_next337 + %tmp350 = load int* getelementptr (%struct.move_s* %pn_move, int 0, uint 1) ; [#uses=1] + %tmp353 = seteq int %tmp350, 0 ; [#uses=0] + ret void + } + + declare fastcc int %eval(int, int) + + declare sbyte* %fgets(sbyte*, int, %struct.FILE*) + + declare int %fclose(%struct.FILE*) + + declare fastcc int %losers_eval() + + declare fastcc int %l_bishop_mobility(int) + + declare fastcc int %l_rook_mobility(int) + + declare fastcc uint %check_legal(%struct.move_s*, int, int) + + declare fastcc void %gen(%struct.move_s*) + + declare fastcc void %push_pawn(int, uint) + + declare fastcc void %push_knighT(int) + + declare fastcc void %push_slidE(int) + + declare fastcc void %push_king(int) + + declare fastcc uint %f_in_check(%struct.move_s*, int) + + declare fastcc void %make(%struct.move_s*, int) + + declare fastcc void %add_capture(int, int, int) + + declare fastcc void %unmake(%struct.move_s*, int) + + declare int %ErrorIt(int, int) + + declare int %Pawn(int, int) + + declare int %Knight(int, int) + + declare int %King(int, int) + + declare int %Rook(int, int) + + declare int %Queen(int, int) + + declare int %Bishop(int, int) + + declare fastcc void %check_phase() + + declare fastcc int %bishop_mobility(int) + + declare fastcc int %rook_mobility(int) + + declare int %sscanf(sbyte*, sbyte*, ...) + + declare int %strncmp(sbyte*, sbyte*, uint) + + declare sbyte* %strchr(sbyte*, int) + + declare fastcc void %CheckBadFlow(uint) + + declare fastcc void %suicide_pn_eval(%struct.node_t*) + + declare fastcc void %losers_pn_eval(%struct.node_t*) + + declare fastcc void %std_pn_eval(%struct.node_t*) + + declare fastcc %struct.node_t* %select_most_proving(%struct.node_t*) + + declare fastcc void %set_proof_and_disproof_numbers(%struct.node_t*) + + declare fastcc void %StoreTT(int, int, int, int, int, int) + + declare fastcc void %develop_node(%struct.node_t*) + + declare fastcc void %update_ancestors(%struct.node_t*) + + declare sbyte* %calloc(uint, uint) + + declare fastcc void %comp_to_coord(long, long, long, sbyte*) + + declare sbyte* %strcat(sbyte*, sbyte*) + + declare int %sprintf(sbyte*, sbyte*, ...) + + declare fastcc void %order_moves(%struct.move_s*, int*, int*, int, int) + + declare fastcc int %see(int, int, int) + + declare fastcc void %perft(int) + + declare fastcc int %qsearch(int, int, int) + + declare fastcc int %allocate_time() + + declare fastcc void %QStoreTT(int, int, int, int) + + declare fastcc int %search(int, int, int, int) + + declare fastcc int %ProbeTT(int*, int, int*, int*, int*, int) + + declare csretcc void %search_root(%struct.move_s*, int, int, int) + + declare fastcc void %post_fh_thinking(int, %struct.move_s*) + + declare fastcc void %post_thinking(int) + + declare int %fprintf(%struct.FILE*, sbyte*, ...) + + declare fastcc int %s_bishop_mobility(int) + + declare fastcc int %s_rook_mobility(int) + + declare fastcc int %suicide_mid_eval() + + declare int %main(int, sbyte**) + + declare fastcc void %init_game() + + declare void %setbuf(%struct.FILE*, sbyte*) + + declare sbyte* %strcpy(sbyte*, sbyte*) + + declare int %__tolower(int) + + declare int %strcmp(sbyte*, sbyte*) + + declare void (int)* %signal(int, void (int)*) + + declare bool %llvm.isunordered.f64(double, double) + + declare fastcc void %hash_extract_pv(int, sbyte*) + + declare double %difftime(int, int) + + declare int %getc(%struct.FILE*) + + declare uint %strlen(sbyte*) + + declare uint %fwrite(sbyte*, uint, uint, %struct.FILE*) From lattner at cs.uiuc.edu Tue Jun 27 18:49:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 18:49:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200606272349.SAA09437@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.38 -> 1.39 --- Log message: Don't implement AliasSetTracker::remove in terms of deleteValue. deleteValue causes the pointer to be removed from the underlying alias analysis implementation as well. This impl of remove is also significantly faster than the old one. This fixes: Regression/Transforms/DeadStoreElimination/2006-06-27-AST-Remove.ll --- Diffs of the changes: (+22 -10) AliasSetTracker.cpp | 32 ++++++++++++++++++++++---------- 1 files changed, 22 insertions(+), 10 deletions(-) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.38 llvm/lib/Analysis/AliasSetTracker.cpp:1.39 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.38 Mon Jun 26 14:20:48 2006 +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue Jun 27 18:48:59 2006 @@ -359,16 +359,28 @@ /// remove - Remove the specified (potentially non-empty) alias set from the /// tracker. void AliasSetTracker::remove(AliasSet &AS) { - bool SetDead; - do { - AliasSet::iterator I = AS.begin(); - Value *Ptr = I.getPointer(); ++I; - - // deleteValue will delete the set automatically when the last pointer - // reference is destroyed. "Predict" when this will happen. - SetDead = I == AS.end(); - deleteValue(Ptr); // Delete all of the pointers from the set - } while (!SetDead); + // Drop all call sites. + AS.CallSites.clear(); + + // Clear the alias set. + unsigned NumRefs = 0; + while (!AS.empty()) { + AliasSet::HashNodePair *P = AS.PtrList; + + // Unlink from the list of values. + P->second.removeFromList(); + + // Remember how many references need to be dropped. + ++NumRefs; + + // Finally, remove the entry. + PointerMap.erase(P->first); + } + + // Stop using the alias set, removing it. + assert(AS.RefCount == NumRefs); + AS.RefCount = 0; + AS.removeFromTracker(*this); } bool AliasSetTracker::remove(Value *Ptr, unsigned Size) { From lattner at cs.uiuc.edu Tue Jun 27 18:56:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 27 Jun 2006 18:56:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200606272356.SAA09768@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.39 -> 1.40 --- Log message: Handle alias sets that have been unified, and thus can have other references to them. This fixes a regression in my previous checkin. --- Diffs of the changes: (+3 -3) AliasSetTracker.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.39 llvm/lib/Analysis/AliasSetTracker.cpp:1.40 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.39 Tue Jun 27 18:48:59 2006 +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue Jun 27 18:56:13 2006 @@ -378,9 +378,9 @@ } // Stop using the alias set, removing it. - assert(AS.RefCount == NumRefs); - AS.RefCount = 0; - AS.removeFromTracker(*this); + AS.RefCount -= NumRefs; + if (AS.RefCount == 0) + AS.removeFromTracker(*this); } bool AliasSetTracker::remove(Value *Ptr, unsigned Size) { From evan.cheng at apple.com Tue Jun 27 19:52:45 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 27 Jun 2006 19:52:45 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200606280052.TAA12621@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.41 -> 1.42 --- Log message: Allow EmitConstantPool to be redefined by derived classes. --- Diffs of the changes: (+1 -1) AsmPrinter.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.41 llvm/include/llvm/CodeGen/AsmPrinter.h:1.42 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.41 Fri Jun 23 07:51:53 2006 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Tue Jun 27 19:52:32 2006 @@ -265,7 +265,7 @@ /// used to print out constants which have been "spilled to memory" by /// the code generator. /// - void EmitConstantPool(MachineConstantPool *MCP); + virtual void EmitConstantPool(MachineConstantPool *MCP); /// EmitJumpTableInfo - Print assembly representations of the jump tables /// used by the current function to the current output stream. From alenhar2 at cs.uiuc.edu Tue Jun 27 20:02:05 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 27 Jun 2006 20:02:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200606280102.UAA13012@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.491 -> 1.492 --- Log message: Catch more function pointer casting problems Remove the Function pointer cast in these calls, converting it to a cast of argument. %tmp60 = tail call int cast (int (ulong)* %str to int (int)*)( int 10 ) %tmp60 = tail call int cast (int (ulong)* %str to int (int)*)( uint %tmp51 ) --- Diffs of the changes: (+9 -1) InstructionCombining.cpp | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.491 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.492 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.491 Thu Jun 15 14:07:26 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jun 27 20:01:52 2006 @@ -6048,7 +6048,15 @@ 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); + const Type *ActTy = (*AI)->getType(); + ConstantSInt* c = dyn_cast(*AI); + //Either we can cast directly, or we can upconvert the argument + bool isConvertible = ActTy->isLosslesslyConvertibleTo(ParamTy) || + (ParamTy->isIntegral() && ActTy->isIntegral() && + ParamTy->isSigned() == ActTy->isSigned() && + ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize()) || + (c && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize() && + c->getValue() > 0); if (Callee->isExternal() && !isConvertible) return false; } From alenhar2 at cs.uiuc.edu Tue Jun 27 20:14:02 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 27 Jun 2006 20:14:02 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200606280114.UAA13406@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: TransformFunctionBody.cpp updated: 1.53 -> 1.54 --- Log message: see through casts to underlying function pointers --- Diffs of the changes: (+4 -0) TransformFunctionBody.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.53 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.54 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.53 Mon Jun 19 09:55:28 2006 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Jun 27 20:13:50 2006 @@ -456,6 +456,10 @@ Function *CF = CS.getCalledFunction(); Instruction *TheCall = CS.getInstruction(); + if (ConstantExpr *CE = dyn_cast(CS.getCalledValue())) + if (CE->getOpcode() == Instruction::Cast && isa(CE->getOperand(0))) + CF = cast(CE->getOperand(0)); + // If this function is one of the memory manipulating functions built into // libc, emulate it with pool calls as appropriate. if (CF && CF->isExternal()) From alenhar2 at cs.uiuc.edu Tue Jun 27 20:16:18 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 27 Jun 2006 20:16:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Message-ID: <200606280116.UAA13504@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.151 -> 1.152 --- Log message: add some missing externals --- Diffs of the changes: (+18 -3) Local.cpp | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.151 llvm/lib/Analysis/DataStructure/Local.cpp:1.152 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.151 Tue Apr 25 14:33:23 2006 +++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Jun 27 20:16:06 2006 @@ -591,6 +591,8 @@ } } + //gets select localtime ioctl + if ((F->isExternal() && F->getName() == "calloc") || F->getName() == "posix_memalign" || F->getName() == "memalign" || F->getName() == "valloc") { @@ -627,7 +629,8 @@ F->getName() == "puts" || F->getName() == "write" || F->getName() == "open" || F->getName() == "create" || F->getName() == "truncate" || F->getName() == "chdir" || - F->getName() == "mkdir" || F->getName() == "rmdir") { + F->getName() == "mkdir" || F->getName() == "rmdir" || + F->getName() == "strlen") { // These functions read all of their pointer operands. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { @@ -636,7 +639,7 @@ N->setReadMarker(); } return; - } else if (F->getName() == "memchr") { + } else if (F->getName() == "memchr") { DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); DSNodeHandle Result = getValueDest(*CS.getInstruction()); RetNH.mergeWith(Result); @@ -644,7 +647,8 @@ N->setReadMarker(); return; } else if (F->getName() == "read" || F->getName() == "pipe" || - F->getName() == "wait" || F->getName() == "time") { + F->getName() == "wait" || F->getName() == "time" || + F->getName() == "getrusage") { // These functions write all of their pointer operands. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { @@ -1002,6 +1006,17 @@ if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) N->setReadMarker(); return; + } else if (F->getName() == "strcpy" || F->getName() == "strncpy") { + //This might be making unsafe assumptions about usage + //Merge return and first arg + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.mergeWith(getValueDest(**CS.arg_begin())); + if (DSNode *N = RetNH.getNode()) + N->setHeapNodeMarker()->setModifiedMarker(); + //and read second pointer + if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) + N->setReadMarker(); + return; } else { // Unknown function, warn if it returns a pointer type or takes a // pointer argument. From alenhar2 at cs.uiuc.edu Tue Jun 27 22:16:56 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 27 Jun 2006 22:16:56 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200606280316.WAA18622@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: TransformFunctionBody.cpp updated: 1.54 -> 1.55 --- Log message: Ignore inline asm --- Diffs of the changes: (+5 -0) TransformFunctionBody.cpp | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.54 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.55 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.54 Tue Jun 27 20:13:50 2006 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Jun 27 22:16:43 2006 @@ -460,6 +460,11 @@ if (CE->getOpcode() == Instruction::Cast && isa(CE->getOperand(0))) CF = cast(CE->getOperand(0)); + if (isa(TheCall->getOperand(0))) { + std::cerr << "INLINE ASM: ignoring. Hoping that's safe.\n"; + return; + } + // If this function is one of the memory manipulating functions built into // libc, emulate it with pool calls as appropriate. if (CF && CF->isExternal()) From evan.cheng at apple.com Wed Jun 28 02:35:53 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 02:35:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp X86AsmPrinter.h Message-ID: <200606280735.CAA17823@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.184 -> 1.185 X86AsmPrinter.h updated: 1.19 -> 1.20 --- Log message: Darwin puts float and double literal constants into literal4 and literal8 sections. --- Diffs of the changes: (+58 -0) X86AsmPrinter.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ X86AsmPrinter.h | 6 ++++++ 2 files changed, 58 insertions(+) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.184 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.185 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.184 Sun Jun 4 02:24:07 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Wed Jun 28 02:35:41 2006 @@ -222,6 +222,58 @@ return false; // success } +void X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { + if (!Subtarget->TargetType == X86Subtarget::isDarwin) { + AsmPrinter::EmitConstantPool(MCP); + return; + } + + const std::vector &CP = MCP->getConstants(); + if (CP.empty()) return; + + std::vector FloatCPs; + std::vector DoubleCPs; + std::vector OtherCPs; + // const TargetData *TD = TM.getTargetData(); + // unsigned Align = MCP->getConstantPoolAlignment(); + for (unsigned i = 0, e = CP.size(); i != e; ++i) { + MachineConstantPoolEntry CPE = CP[i]; + const Constant *CV = CPE.Val; + const Type *Ty = CV->getType(); + if (Ty->getTypeID() == Type::FloatTyID) + FloatCPs.push_back(CPE); + else if (Ty->getTypeID() == Type::DoubleTyID) + DoubleCPs.push_back(CPE); + else + OtherCPs.push_back(CPE); + } + EmitConstantPool(MCP, FloatCPs, "\t.literal4"); + EmitConstantPool(MCP, DoubleCPs, "\t.literal8"); + EmitConstantPool(MCP, OtherCPs, ConstantPoolSection); +} + +void +X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP, + std::vector &CP, + const char *Section) { + if (CP.empty()) return; + + SwitchToDataSection(Section, 0); + EmitAlignment(MCP->getConstantPoolAlignment()); + for (unsigned i = 0, e = CP.size(); i != e; ++i) { + O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' << i + << ":\t\t\t\t\t" << CommentString << " "; + WriteTypeSymbolic(O, CP[i].Val->getType(), 0) << '\n'; + EmitGlobalConstant(CP[i].Val); + if (i != e-1) { + unsigned EntSize = TM.getTargetData()->getTypeSize(CP[i].Val->getType()); + unsigned ValEnd = CP[i].Offset + EntSize; + // Emit inter-object padding for alignment. + EmitZeros(CP[i+1].Offset-ValEnd); + } + } +} + /// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code /// for a MachineFunction to the given output stream, using the given target /// machine description. Index: llvm/lib/Target/X86/X86AsmPrinter.h diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.19 llvm/lib/Target/X86/X86AsmPrinter.h:1.20 --- llvm/lib/Target/X86/X86AsmPrinter.h:1.19 Thu May 25 16:59:08 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.h Wed Jun 28 02:35:41 2006 @@ -20,6 +20,7 @@ #include "X86TargetMachine.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineDebugInfo.h" #include "llvm/ADT/Statistic.h" #include @@ -92,6 +93,11 @@ MI->getOperand(Op+3).isGlobalAddress() || MI->getOperand(Op+3).isConstantPoolIndex()); } + + virtual void EmitConstantPool(MachineConstantPool *MCP); + void EmitConstantPool(MachineConstantPool *MCP, + std::vector &CP, + const char *Section); }; } // end namespace llvm From evan.cheng at apple.com Wed Jun 28 02:55:36 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 02:55:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp X86AsmPrinter.h Message-ID: <200606280755.CAA19655@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.185 -> 1.186 X86AsmPrinter.h updated: 1.20 -> 1.21 --- Log message: Oops. Need to keep CP index. --- Diffs of the changes: (+16 -17) X86AsmPrinter.cpp | 31 +++++++++++++++---------------- X86AsmPrinter.h | 2 +- 2 files changed, 16 insertions(+), 17 deletions(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.185 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.186 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.185 Wed Jun 28 02:35:41 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Wed Jun 28 02:55:24 2006 @@ -231,21 +231,19 @@ const std::vector &CP = MCP->getConstants(); if (CP.empty()) return; - std::vector FloatCPs; - std::vector DoubleCPs; - std::vector OtherCPs; - // const TargetData *TD = TM.getTargetData(); - // unsigned Align = MCP->getConstantPoolAlignment(); + std::vector > FloatCPs; + std::vector > DoubleCPs; + std::vector > OtherCPs; for (unsigned i = 0, e = CP.size(); i != e; ++i) { MachineConstantPoolEntry CPE = CP[i]; const Constant *CV = CPE.Val; const Type *Ty = CV->getType(); if (Ty->getTypeID() == Type::FloatTyID) - FloatCPs.push_back(CPE); + FloatCPs.push_back(std::make_pair(CPE, i)); else if (Ty->getTypeID() == Type::DoubleTyID) - DoubleCPs.push_back(CPE); + DoubleCPs.push_back(std::make_pair(CPE, i)); else - OtherCPs.push_back(CPE); + OtherCPs.push_back(std::make_pair(CPE, i)); } EmitConstantPool(MCP, FloatCPs, "\t.literal4"); EmitConstantPool(MCP, DoubleCPs, "\t.literal8"); @@ -254,22 +252,23 @@ void X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP, - std::vector &CP, + std::vector > &CP, const char *Section) { if (CP.empty()) return; SwitchToDataSection(Section, 0); EmitAlignment(MCP->getConstantPoolAlignment()); for (unsigned i = 0, e = CP.size(); i != e; ++i) { - O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' << i - << ":\t\t\t\t\t" << CommentString << " "; - WriteTypeSymbolic(O, CP[i].Val->getType(), 0) << '\n'; - EmitGlobalConstant(CP[i].Val); + O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' + << CP[i].second << ":\t\t\t\t\t" << CommentString << " "; + WriteTypeSymbolic(O, CP[i].first.Val->getType(), 0) << '\n'; + EmitGlobalConstant(CP[i].first.Val); if (i != e-1) { - unsigned EntSize = TM.getTargetData()->getTypeSize(CP[i].Val->getType()); - unsigned ValEnd = CP[i].Offset + EntSize; + unsigned EntSize = + TM.getTargetData()->getTypeSize(CP[i].first.Val->getType()); + unsigned ValEnd = CP[i].first.Offset + EntSize; // Emit inter-object padding for alignment. - EmitZeros(CP[i+1].Offset-ValEnd); + EmitZeros(CP[i+1].first.Offset-ValEnd); } } } Index: llvm/lib/Target/X86/X86AsmPrinter.h diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.20 llvm/lib/Target/X86/X86AsmPrinter.h:1.21 --- llvm/lib/Target/X86/X86AsmPrinter.h:1.20 Wed Jun 28 02:35:41 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.h Wed Jun 28 02:55:24 2006 @@ -96,7 +96,7 @@ virtual void EmitConstantPool(MachineConstantPool *MCP); void EmitConstantPool(MachineConstantPool *MCP, - std::vector &CP, + std::vector > &CP, const char *Section); }; From lattner at cs.uiuc.edu Wed Jun 28 11:39:07 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 11:39:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Message-ID: <200606281639.LAA01208@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnswitch.cpp updated: 1.42 -> 1.43 --- Log message: Don't unswitch really large loops even if they are mostly filled with empty blocks. --- Diffs of the changes: (+6 -0) LoopUnswitch.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.42 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.43 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.42 Tue Jun 27 17:26:09 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Wed Jun 28 11:38:55 2006 @@ -333,6 +333,12 @@ if (IsTrivialUnswitchCondition(L, LIC)) return 0; + // If the loop is really large (over twice our threshold) don't even consider + // unswitching it. This will produce a really large loop with lots of empty + // blocks. + if (L->getBlocks().size() > 2*Threshold) + return 2*Threshold; + unsigned Cost = 0; // FIXME: this is brain dead. It should take into consideration code // shrinkage. From criswell at cs.uiuc.edu Wed Jun 28 11:36:18 2006 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 28 Jun 2006 11:36:18 -0500 Subject: [llvm-commits] CVS: llvm-www/safecode/newindex.html newsafecode.css Message-ID: <200606281636.LAA02954@choi.cs.uiuc.edu> Changes in directory llvm-www/safecode: newindex.html added (r1.1) newsafecode.css added (r1.1) --- Log message: Attempt to make a new SAFECode web page. --- Diffs of the changes: (+184 -0) newindex.html | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ newsafecode.css | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) Index: llvm-www/safecode/newindex.html diff -c /dev/null llvm-www/safecode/newindex.html:1.1 *** /dev/null Wed Jun 28 11:35:56 2006 --- llvm-www/safecode/newindex.html Wed Jun 28 11:35:46 2006 *************** *** 0 **** --- 1,92 ---- + + + + SAFE Code + + + + +
SAFECode
+ +
+ +

Static Analysis For safe Execution of Code

+ +

The purpose of the SAFECode project is to enable program safety without + runtime checks and garbage collection, through 100% or near-100% static + enforcement of program safety properties. SAFECode defines a code + representation with minimal semantic restrictions designed to enable static + enforcement of safety, using aggressive compiler techniques developed in this + project.

+ + +
+ +

Project Members

+ +

Faculty

+ + + +

Graduate Students

+ + + +

Publications

+ + + +

Funding

+ +

This project is sponsored by the NSF Embedded Systems program under award + CCR-02-09202 and in part by an NSF CAREER award, EIA-0093426 and ONR, + N0004-02-0102.

+ +

Links

+ + +
+
+ Valid CSS! + Valid HTML 4.01! + + Dinakar Dhurjati +
+ + + Index: llvm-www/safecode/newsafecode.css diff -c /dev/null llvm-www/safecode/newsafecode.css:1.1 *** /dev/null Wed Jun 28 11:36:18 2006 --- llvm-www/safecode/newsafecode.css Wed Jun 28 11:35:46 2006 *************** *** 0 **** --- 1,92 ---- + /* + * LLVM website style sheet + */ + + /* No borders on image links */ + a:link img, a:visited img { border-style: none } + + address img { float: right; width: 88px; height: 31px; } + address { clear: right; } + + /* Main website */ + .www_title { font-family: "Georgia,Palatino,Times,Roman"; + font-size: 33pt; + text-align: center;} + + .www_sidebar { text-align: center; + font-family: "Georgia,Palatino,Times,Roman"; + font-size: 12pt; + margin-left: 0em; margin-right: 0em; + padding: 0.15em 0.15em 0.15em .15em; + width: 100%; + background: url("img/lines.gif"); + border: 2px solid #cccccc } + + .www_sectiontitle, .www_subsection { + border-width: 1px; + border-style: solid none solid none; + text-align: center; + vertical-align: middle; + font-family: "Georgia,Palatino,Times,Roman"; + font-weight: bold; font-size: 18pt; + background: url("img/lines.gif"); + padding: 0.1em 0.1em 0.1em .1em; + width: 100%; + margin-bottom: 0.3em; } + + .www_subsection { width: 75%; + text-align: left; font-size: 12pt; } + + .www_subsubsection { margin: 1.0em 0.5em 0.5em 0.5em; + font-weight: bold; font-style: oblique; + border-bottom: 1px solid #999999; font-size: 12pt; + width: 75%; } + + .www_code { border: solid 1px gray; background: #eeeeee; + margin: 0 1em 0 1em; + padding: 0 1em 0 1em; + display: table; } + + .www_footer { text-align: left; padding: 0 0 0 0 } + + /* Publications */ + .pub_title { font-family: "Georgia,Palatino,Times,Roman"; + font-size: 24pt; + text-align: center } + + .pub_author { font-size: 14pt; text-align: center } + + /* Releases */ + .rel_container { text-align: center; + margin-left: 20% } + + .rel_title { text-align: center; + font-family: "Georgia,Palatino,Times,Roman"; + font-weight: bold; font-size: 28pt; + margin-bottom: 0.5em } + + + .rel_section { vertical-align: middle; + border-width: 1px; + border-style: solid none solid none; + text-align: center; + vertical-align: middle; + font-family: "Georgia,Palatino,Times,Roman"; + font-weight: bold; font-size: 18pt; + background: url("img/lines.gif"); + margin: 1em 0.5em 1em 0.5em; + padding-left: 1em; + width: 300px } + + .rel_sectiontxt { padding: 0 1em 0 1em; + margin: 1em 0.5em 1em 0.5em } + + .rel_intro, + .rel_boxtext { text-align: left; + font-family: "Georgia,Palatino,Times,Roman"; + font-size: 11pt; + padding: 0.5em 0.5em 0.5em 1.5em; + margin-left: 2em; margin-right: 3em; + width: 60%; + background: #f7f7f7; + border: 2px solid #cccccc } From lattner at cs.uiuc.edu Wed Jun 28 12:34:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 12:34:40 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-06-28-infloop.ll Message-ID: <200606281734.MAA04715@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2006-06-28-infloop.ll added (r1.1) --- Log message: Infinite loop in instcombine that nate hit. --- Diffs of the changes: (+21 -0) 2006-06-28-infloop.ll | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/2006-06-28-infloop.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-06-28-infloop.ll:1.1 *** /dev/null Wed Jun 28 12:34:38 2006 --- llvm/test/Regression/Transforms/InstCombine/2006-06-28-infloop.ll Wed Jun 28 12:34:28 2006 *************** *** 0 **** --- 1,21 ---- + ; RUN: llvm-as < %s | opt -instcombine -disable-output + target endian = big + target pointersize = 32 + target triple = "powerpc-apple-darwin8" + + implementation ; Functions: + + void %test() { + entry: + %tmp = getelementptr { long, long, long, long }* null, int 0, uint 3 + %tmp = load long* %tmp ; [#uses=1] + %tmp8 = load ulong* null ; [#uses=1] + %tmp8 = cast ulong %tmp8 to long ; [#uses=1] + %tmp9 = and long %tmp8, %tmp ; [#uses=1] + %sext = cast long %tmp9 to int ; [#uses=1] + %tmp27.i = cast int %sext to long ; [#uses=1] + tail call void %foo( uint 0, long %tmp27.i ) + unreachable + } + + declare void %foo(uint, long) From lattner at cs.uiuc.edu Wed Jun 28 12:35:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 12:35:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200606281735.MAA04754@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.492 -> 1.493 --- Log message: Fix Transforms/InstCombine/2006-06-28-infloop.ll --- Diffs of the changes: (+6 -0) InstructionCombining.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.492 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.493 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.492 Tue Jun 27 20:01:52 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jun 28 12:34:50 2006 @@ -4934,6 +4934,12 @@ // If this is a cast from the destination type, we can trivially eliminate // it, and this will remove a cast overall. if (I->getOperand(0)->getType() == Ty) { + // If the first operand is itself a cast, and is eliminable, do not count + // this as an eliminable cast. We would prefer to eliminate those two + // casts first. + if (CastInst *OpCast = dyn_cast(I->getOperand(0))) + return true; + ++NumCastsRemoved; return true; } From resistor at mac.com Wed Jun 28 12:48:03 2006 From: resistor at mac.com (Owen Anderson) Date: Wed, 28 Jun 2006 12:48:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Message-ID: <200606281748.MAA04861@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnswitch.cpp updated: 1.43 -> 1.44 --- Log message: Switch to a very conservative heuristic for determining when loop-unswitching will be profitable. This is mainly to remove some cases where excessive unswitching would result in long compile times and/or huge generated code. Once someone comes up with a better heuristic that avoids these cases, this should be switched out. --- Diffs of the changes: (+5 -5) LoopUnswitch.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.43 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.44 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.43 Wed Jun 28 11:38:55 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Wed Jun 28 12:47:50 2006 @@ -333,11 +333,11 @@ if (IsTrivialUnswitchCondition(L, LIC)) return 0; - // If the loop is really large (over twice our threshold) don't even consider - // unswitching it. This will produce a really large loop with lots of empty - // blocks. - if (L->getBlocks().size() > 2*Threshold) - return 2*Threshold; + // FIXME: This is really overly conservative. However, more liberal + // estimations have thus far resulted in excessive unswitching, which is bad + // both in compile time and in code size. This should be replaced once + // someone figures out how a good estimation. + return L->getBlocks().size(); unsigned Cost = 0; // FIXME: this is brain dead. It should take into consideration code From evan.cheng at apple.com Wed Jun 28 12:56:55 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 12:56:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <200606281756.MAA04896@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.186 -> 1.187 --- Log message: Doh. --- Diffs of the changes: (+1 -1) X86AsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.186 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.187 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.186 Wed Jun 28 02:55:24 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Wed Jun 28 12:56:43 2006 @@ -223,7 +223,7 @@ } void X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { - if (!Subtarget->TargetType == X86Subtarget::isDarwin) { + if (Subtarget->TargetType != X86Subtarget::isDarwin) { AsmPrinter::EmitConstantPool(MCP); return; } From lattner at cs.uiuc.edu Wed Jun 28 13:29:46 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 13:29:46 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll Message-ID: <200606281829.NAA05281@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/Generic: 2006-06-28-SimplifySetCCCrash.ll added (r1.1) --- Log message: Testcase that crashes the ppc backend. --- Diffs of the changes: (+281 -0) 2006-06-28-SimplifySetCCCrash.ll | 281 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 281 insertions(+) Index: llvm/test/Regression/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll:1.1 *** /dev/null Wed Jun 28 13:29:43 2006 --- llvm/test/Regression/CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll Wed Jun 28 13:29:33 2006 *************** *** 0 **** --- 1,281 ---- + ; RUN: llvm-as < %s | llc + %struct.rtunion = type { long } + %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct.rtunion] } + %ix86_cpu = external global uint ; [#uses=1] + %which_alternative = external global int ; [#uses=3] + + implementation ; Functions: + + declare fastcc int %recog() + + void %athlon_fp_unit_ready_cost() { + entry: + %tmp = setlt int 0, 0 ; [#uses=1] + br bool %tmp, label %cond_true.i, label %cond_true + + cond_true: ; preds = %entry + ret void + + cond_true.i: ; preds = %entry + %tmp8.i = tail call fastcc int %recog( ) ; [#uses=1] + switch int %tmp8.i, label %UnifiedReturnBlock [ + int -1, label %bb2063 + int 19, label %bb2035 + int 20, label %bb2035 + int 21, label %bb2035 + int 23, label %bb2035 + int 24, label %bb2035 + int 27, label %bb2035 + int 32, label %bb2035 + int 33, label %bb1994 + int 35, label %bb2035 + int 36, label %bb1994 + int 90, label %bb1948 + int 94, label %bb1948 + int 95, label %bb1948 + int 101, label %bb1648 + int 102, label %bb1648 + int 103, label %bb1648 + int 104, label %bb1648 + int 133, label %bb1419 + int 135, label %bb1238 + int 136, label %bb1238 + int 137, label %bb1238 + int 138, label %bb1238 + int 139, label %bb1201 + int 140, label %bb1201 + int 141, label %bb1154 + int 142, label %bb1126 + int 144, label %bb1201 + int 145, label %bb1126 + int 146, label %bb1201 + int 147, label %bb1126 + int 148, label %bb1201 + int 149, label %bb1126 + int 150, label %bb1201 + int 151, label %bb1126 + int 152, label %bb1096 + int 153, label %bb1096 + int 154, label %bb1096 + int 157, label %bb1096 + int 158, label %bb1096 + int 159, label %bb1096 + int 162, label %bb1096 + int 163, label %bb1096 + int 164, label %bb1096 + int 167, label %bb1201 + int 168, label %bb1201 + int 170, label %bb1201 + int 171, label %bb1201 + int 173, label %bb1201 + int 174, label %bb1201 + int 176, label %bb1201 + int 177, label %bb1201 + int 179, label %bb993 + int 180, label %bb993 + int 181, label %bb993 + int 182, label %bb993 + int 183, label %bb993 + int 184, label %bb993 + int 365, label %bb1126 + int 366, label %bb1126 + int 367, label %bb1126 + int 368, label %bb1126 + int 369, label %bb1126 + int 370, label %bb1126 + int 371, label %bb1126 + int 372, label %bb1126 + int 373, label %bb1126 + int 384, label %bb1126 + int 385, label %bb1126 + int 386, label %bb1126 + int 387, label %bb1126 + int 388, label %bb1126 + int 389, label %bb1126 + int 390, label %bb1126 + int 391, label %bb1126 + int 392, label %bb1126 + int 525, label %bb919 + int 526, label %bb839 + int 528, label %bb919 + int 529, label %bb839 + int 531, label %cond_next6.i119 + int 532, label %cond_next6.i97 + int 533, label %cond_next6.i81 + int 534, label %bb495 + int 536, label %cond_next6.i81 + int 537, label %cond_next6.i81 + int 538, label %bb396 + int 539, label %bb288 + int 541, label %bb396 + int 542, label %bb396 + int 543, label %bb396 + int 544, label %bb396 + int 545, label %bb189 + int 546, label %cond_next6.i + int 547, label %bb189 + int 548, label %cond_next6.i + int 549, label %bb189 + int 550, label %cond_next6.i + int 551, label %bb189 + int 552, label %cond_next6.i + int 553, label %bb189 + int 554, label %cond_next6.i + int 555, label %bb189 + int 556, label %cond_next6.i + int 557, label %bb189 + int 558, label %cond_next6.i + int 618, label %bb40 + int 619, label %bb18 + int 620, label %bb40 + int 621, label %bb10 + int 622, label %bb10 + ] + + bb10: ; preds = %cond_true.i, %cond_true.i + ret void + + bb18: ; preds = %cond_true.i + ret void + + bb40: ; preds = %cond_true.i, %cond_true.i + ret void + + cond_next6.i: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb189: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb288: ; preds = %cond_true.i + ret void + + bb396: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb495: ; preds = %cond_true.i + ret void + + cond_next6.i81: ; preds = %cond_true.i, %cond_true.i, %cond_true.i + ret void + + cond_next6.i97: ; preds = %cond_true.i + ret void + + cond_next6.i119: ; preds = %cond_true.i + %tmp.i126 = seteq ushort 0, 78 ; [#uses=1] + br bool %tmp.i126, label %cond_next778, label %bb802 + + cond_next778: ; preds = %cond_next6.i119 + %tmp781 = seteq uint 0, 1 ; [#uses=1] + br bool %tmp781, label %cond_next784, label %bb790 + + cond_next784: ; preds = %cond_next778 + %tmp785 = load uint* %ix86_cpu ; [#uses=1] + %tmp786 = seteq uint %tmp785, 5 ; [#uses=1] + br bool %tmp786, label %UnifiedReturnBlock, label %bb790 + + bb790: ; preds = %cond_next784, %cond_next778 + %tmp793 = seteq uint 0, 1 ; [#uses=0] + ret void + + bb802: ; preds = %cond_next6.i119 + ret void + + bb839: ; preds = %cond_true.i, %cond_true.i + ret void + + bb919: ; preds = %cond_true.i, %cond_true.i + ret void + + bb993: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb1096: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb1126: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb1154: ; preds = %cond_true.i + ret void + + bb1201: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb1238: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb1419: ; preds = %cond_true.i + ret void + + bb1648: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + %tmp1650 = load int* %which_alternative ; [#uses=1] + switch int %tmp1650, label %bb1701 [ + int 0, label %cond_next1675 + int 1, label %cond_next1675 + int 2, label %cond_next1675 + ] + + cond_next1675: ; preds = %bb1648, %bb1648, %bb1648 + ret void + + bb1701: ; preds = %bb1648 + %tmp1702 = load int* %which_alternative ; [#uses=1] + switch int %tmp1702, label %bb1808 [ + int 0, label %cond_next1727 + int 1, label %cond_next1727 + int 2, label %cond_next1727 + ] + + cond_next1727: ; preds = %bb1701, %bb1701, %bb1701 + ret void + + bb1808: ; preds = %bb1701 + %bothcond696 = or bool false, false ; [#uses=1] + br bool %bothcond696, label %bb1876, label %cond_next1834 + + cond_next1834: ; preds = %bb1808 + ret void + + bb1876: ; preds = %bb1808 + %tmp1877 = load int* %which_alternative ; [#uses=4] + %tmp1877 = cast int %tmp1877 to uint ; [#uses=1] + %bothcond699 = setlt uint %tmp1877, 2 ; [#uses=1] + %tmp1888 = seteq int %tmp1877, 2 ; [#uses=1] + %bothcond700 = or bool %bothcond699, %tmp1888 ; [#uses=1] + %bothcond700.not = xor bool %bothcond700, true ; [#uses=1] + %tmp1894 = seteq int %tmp1877, 3 ; [#uses=1] + %bothcond701 = or bool %tmp1894, %bothcond700.not ; [#uses=1] + %bothcond702 = or bool %bothcond701, false ; [#uses=1] + br bool %bothcond702, label %UnifiedReturnBlock, label %cond_next1902 + + cond_next1902: ; preds = %bb1876 + switch int %tmp1877, label %cond_next1937 [ + int 0, label %bb1918 + int 1, label %bb1918 + int 2, label %bb1918 + ] + + bb1918: ; preds = %cond_next1902, %cond_next1902, %cond_next1902 + ret void + + cond_next1937: ; preds = %cond_next1902 + ret void + + bb1948: ; preds = %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb1994: ; preds = %cond_true.i, %cond_true.i + ret void + + bb2035: ; preds = %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i, %cond_true.i + ret void + + bb2063: ; preds = %cond_true.i + ret void + + UnifiedReturnBlock: ; preds = %bb1876, %cond_next784, %cond_true.i + %UnifiedRetVal = phi int [ 100, %bb1876 ], [ 100, %cond_true.i ], [ 4, %cond_next784 ] ; [#uses=0] + ret void + } From lattner at cs.uiuc.edu Wed Jun 28 13:30:00 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 13:30:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200606281830.NAA05293@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.308 -> 1.309 --- Log message: Fix CodeGen/Generic/2006-06-28-SimplifySetCCCrash.ll --- Diffs of the changes: (+4 -6) SelectionDAG.cpp | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.308 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.309 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.308 Tue May 16 17:53:20 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Jun 28 13:29:47 2006 @@ -243,12 +243,10 @@ if (isInteger) { switch (Result) { default: break; - case ISD::SETUO: // e.g. SETUGT & SETULT - Result = ISD::SETFALSE; - break; - case ISD::SETUEQ: // e.g. SETUGE & SETULE - Result = ISD::SETEQ; - break; + case ISD::SETUO : Result = ISD::SETFALSE; break; // SETUGT & SETULT + case ISD::SETUEQ: Result = ISD::SETEQ ; break; // SETUGE & SETULE + case ISD::SETOLT: Result = ISD::SETULT ; break; // SETULT & SETNE + case ISD::SETOGT: Result = ISD::SETUGT ; break; // SETUGT & SETNE } } From alenhar2 at cs.uiuc.edu Wed Jun 28 15:07:48 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 28 Jun 2006 15:07:48 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll Message-ID: <200606282007.PAA06107@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: FunctionPointerTable-const.ll updated: 1.1 -> 1.2 --- Log message: change I flag on test --- Diffs of the changes: (+3 -1) FunctionPointerTable-const.ll | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll diff -u llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.1 llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.1 Mon Mar 21 14:18:51 2005 +++ llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll Wed Jun 28 15:07:36 2006 @@ -1,4 +1,6 @@ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHM && \ +; FIXME: this should be SHM for bu, but change it for now since besides incompleteness +; this is working +; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \ ; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM %G = internal constant [2 x int*(int*)*] [ From alenhar2 at cs.uiuc.edu Wed Jun 28 15:14:42 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 28 Jun 2006 15:14:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll constant_globals.ll Message-ID: <200606282014.PAA06311@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: GlobalsGraphFuncPtr.ll updated: 1.1 -> 1.2 constant_globals.ll updated: 1.1 -> 1.2 --- Log message: not really XFailing these, as only incompleteness is wrong in the graph --- Diffs of the changes: (+4 -2) GlobalsGraphFuncPtr.ll | 3 ++- constant_globals.ll | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll diff -u llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.1 llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.1 Fri Jul 25 15:53:58 2003 +++ llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll Wed Jun 28 15:14:30 2006 @@ -4,7 +4,8 @@ ; -- latter should remain unresolved in main() and copied to GG ; -- globals in GG pointed to by latter should be marked I, but not other nodes ; -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=KnownPtr:S,UnknownPtr:SI -dsgc-dspass=bu +; FIXME: KnownPtr should be just S. +; RUN: analyze %s -datastructure-gc -dsgc-check-flags=KnownPtr:SI,UnknownPtr:SI -dsgc-dspass=bu %Z = internal global int 0 %X = internal global int 0 Index: llvm/test/Regression/Analysis/DSGraph/constant_globals.ll diff -u llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.1 llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.1 Wed Feb 25 17:34:04 2004 +++ llvm/test/Regression/Analysis/DSGraph/constant_globals.ll Wed Jun 28 15:14:30 2006 @@ -1,4 +1,5 @@ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SM +; FIXME: A should just be SM +; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SIM ; Constant globals should not mark stuff incomplete. This should allow the ; bu pass to resolve the indirect call immediately in "test", allowing %A to ; be marked complete and the store to happen. From lattner at cs.uiuc.edu Wed Jun 28 16:38:16 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 16:38:16 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Visibility.h Message-ID: <200606282138.QAA06764@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Visibility.h added (r1.1) --- Log message: Add support for hidden visibility --- Diffs of the changes: (+23 -0) Visibility.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+) Index: llvm/include/llvm/Support/Visibility.h diff -c /dev/null llvm/include/llvm/Support/Visibility.h:1.1 *** /dev/null Wed Jun 28 16:38:14 2006 --- llvm/include/llvm/Support/Visibility.h Wed Jun 28 16:38:04 2006 *************** *** 0 **** --- 1,23 ---- + //===-- llvm/Support/Visibility.h - visibility(hidden) support --*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the VISIBILITY_HIDDEN macro, used for marking classes with + // the GCC-specific visibility("hidden") attribute. + // + //===----------------------------------------------------------------------===// + + #ifndef VISIBILITY_HIDDEN + + #if __GNUC__ >= 4 + #define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden"))) + #else + #define VISIBILITY_HIDDEN + #endif + + #endif From lattner at cs.uiuc.edu Wed Jun 28 16:39:06 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 16:39:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Constants.cpp Type.cpp Verifier.cpp Message-ID: <200606282139.QAA06835@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.88 -> 1.89 Constants.cpp updated: 1.154 -> 1.155 Type.cpp updated: 1.140 -> 1.141 Verifier.cpp updated: 1.156 -> 1.157 --- Log message: Use hidden visibility to reduce the sizes of some .o files. This chops 60K off a release llvm-dis. --- Diffs of the changes: (+47 -24) ConstantFolding.cpp | 29 +++++++++++++++++------------ Constants.cpp | 35 +++++++++++++++++++++++++---------- Type.cpp | 3 ++- Verifier.cpp | 4 +++- 4 files changed, 47 insertions(+), 24 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.88 llvm/lib/VMCore/ConstantFolding.cpp:1.89 --- llvm/lib/VMCore/ConstantFolding.cpp:1.88 Wed Jun 21 13:13:36 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Wed Jun 28 16:38:54 2006 @@ -25,12 +25,13 @@ #include "llvm/Function.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; namespace { - struct ConstRules { + struct VISIBILITY_HIDDEN ConstRules { ConstRules() {} virtual ~ConstRules() {} @@ -88,7 +89,7 @@ // namespace { template -class TemplateRules : public ConstRules { +class VISIBILITY_HIDDEN TemplateRules : public ConstRules { //===--------------------------------------------------------------------===// @@ -221,7 +222,8 @@ // EmptyRules provides a concrete base class of ConstRules that does nothing // namespace { -struct EmptyRules : public TemplateRules { +struct VISIBILITY_HIDDEN EmptyRules + : public TemplateRules { static Constant *EqualTo(const Constant *V1, const Constant *V2) { if (V1 == V2) return ConstantBool::True; return 0; @@ -238,7 +240,8 @@ // BoolRules provides a concrete base class of ConstRules for the 'bool' type. // namespace { -struct BoolRules : public TemplateRules { +struct VISIBILITY_HIDDEN BoolRules + : public TemplateRules { static Constant *LessThan(const ConstantBool *V1, const ConstantBool *V2) { return ConstantBool::get(V1->getValue() < V2->getValue()); @@ -290,8 +293,8 @@ // pointers. // namespace { -struct NullPointerRules : public TemplateRules { +struct VISIBILITY_HIDDEN NullPointerRules + : public TemplateRules { static Constant *EqualTo(const Constant *V1, const Constant *V2) { return ConstantBool::True; // Null pointers are always equal } @@ -357,7 +360,7 @@ /// ConstantPacked operands. /// namespace { -struct ConstantPackedRules +struct VISIBILITY_HIDDEN ConstantPackedRules : public TemplateRules { static Constant *Add(const ConstantPacked *V1, const ConstantPacked *V2) { @@ -417,7 +420,8 @@ /// cause for this is that one operand is a ConstantAggregateZero. /// namespace { -struct GeneralPackedRules : public TemplateRules { +struct VISIBILITY_HIDDEN GeneralPackedRules + : public TemplateRules { }; } // end anonymous namespace @@ -432,7 +436,8 @@ // namespace { template -struct DirectRules : public TemplateRules { +struct VISIBILITY_HIDDEN DirectRules + : public TemplateRules { static Constant *Add(const ConstantClass *V1, const ConstantClass *V2) { BuiltinType R = (BuiltinType)V1->getValue() + (BuiltinType)V2->getValue(); return ConstantClass::get(*Ty, R); @@ -502,7 +507,7 @@ // namespace { template -struct DirectIntRules +struct VISIBILITY_HIDDEN DirectIntRules : public DirectRules > { @@ -560,7 +565,7 @@ /// namespace { template -struct DirectFPRules +struct VISIBILITY_HIDDEN DirectFPRules : public DirectRules > { static Constant *Rem(const ConstantClass *V1, const ConstantClass *V2) { @@ -1472,7 +1477,7 @@ dyn_cast(CE->getOperand(0)->getType())) if (const ArrayType *SAT = dyn_cast(SPT->getElementType())) if (const ArrayType *CAT = - dyn_cast(cast(C->getType())->getElementType())) + dyn_cast(cast(C->getType())->getElementType())) if (CAT->getElementType() == SAT->getElementType()) return ConstantExpr::getGetElementPtr( (Constant*)CE->getOperand(0), IdxList); Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.154 llvm/lib/VMCore/Constants.cpp:1.155 --- llvm/lib/VMCore/Constants.cpp:1.154 Fri Jun 9 23:16:23 2006 +++ llvm/lib/VMCore/Constants.cpp Wed Jun 28 16:38:54 2006 @@ -20,6 +20,7 @@ #include "llvm/Module.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; @@ -308,12 +309,14 @@ /// UnaryConstantExpr - This class is private to Constants.cpp, and is used /// behind the scenes to implement unary constant exprs. -class UnaryConstantExpr : public ConstantExpr { +namespace { +class VISIBILITY_HIDDEN UnaryConstantExpr : public ConstantExpr { Use Op; public: UnaryConstantExpr(unsigned Opcode, Constant *C, const Type *Ty) : ConstantExpr(Ty, Opcode, &Op, 1), Op(C, this) {} }; +} static bool isSetCC(unsigned Opcode) { return Opcode == Instruction::SetEQ || Opcode == Instruction::SetNE || @@ -323,7 +326,8 @@ /// BinaryConstantExpr - This class is private to Constants.cpp, and is used /// behind the scenes to implement binary constant exprs. -class BinaryConstantExpr : public ConstantExpr { +namespace { +class VISIBILITY_HIDDEN BinaryConstantExpr : public ConstantExpr { Use Ops[2]; public: BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2) @@ -333,10 +337,12 @@ Ops[1].init(C2, this); } }; +} /// SelectConstantExpr - This class is private to Constants.cpp, and is used /// behind the scenes to implement select constant exprs. -class SelectConstantExpr : public ConstantExpr { +namespace { +class VISIBILITY_HIDDEN SelectConstantExpr : public ConstantExpr { Use Ops[3]; public: SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3) @@ -346,11 +352,13 @@ Ops[2].init(C3, this); } }; +} /// ExtractElementConstantExpr - This class is private to /// Constants.cpp, and is used behind the scenes to implement /// extractelement constant exprs. -class ExtractElementConstantExpr : public ConstantExpr { +namespace { +class VISIBILITY_HIDDEN ExtractElementConstantExpr : public ConstantExpr { Use Ops[2]; public: ExtractElementConstantExpr(Constant *C1, Constant *C2) @@ -360,11 +368,13 @@ Ops[1].init(C2, this); } }; +} /// InsertElementConstantExpr - This class is private to /// Constants.cpp, and is used behind the scenes to implement /// insertelement constant exprs. -class InsertElementConstantExpr : public ConstantExpr { +namespace { +class VISIBILITY_HIDDEN InsertElementConstantExpr : public ConstantExpr { Use Ops[3]; public: InsertElementConstantExpr(Constant *C1, Constant *C2, Constant *C3) @@ -375,11 +385,13 @@ Ops[2].init(C3, this); } }; +} /// ShuffleVectorConstantExpr - This class is private to /// Constants.cpp, and is used behind the scenes to implement /// shufflevector constant exprs. -class ShuffleVectorConstantExpr : public ConstantExpr { +namespace { +class VISIBILITY_HIDDEN ShuffleVectorConstantExpr : public ConstantExpr { Use Ops[3]; public: ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3) @@ -390,10 +402,12 @@ Ops[2].init(C3, this); } }; +} /// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is /// used behind the scenes to implement getelementpr constant exprs. -struct GetElementPtrConstantExpr : public ConstantExpr { +namespace { +struct VISIBILITY_HIDDEN GetElementPtrConstantExpr : public ConstantExpr { GetElementPtrConstantExpr(Constant *C, const std::vector &IdxList, const Type *DestTy) : ConstantExpr(DestTy, Instruction::GetElementPtr, @@ -406,6 +420,7 @@ delete [] OperandList; } }; +} /// ConstantExpr::get* - Return some common constants without having to /// specify the full Instruction::OPCODE identifier. @@ -541,14 +556,14 @@ // namespace llvm { template - struct ConstantCreator { + struct VISIBILITY_HIDDEN ConstantCreator { static ConstantClass *create(const TypeClass *Ty, const ValType &V) { return new ConstantClass(Ty, V); } }; template - struct ConvertConstantType { + struct VISIBILITY_HIDDEN ConvertConstantType { static void convert(ConstantClass *OldC, const TypeClass *NewTy) { assert(0 && "This type cannot be converted!\n"); abort(); @@ -559,7 +574,7 @@ namespace { template - class ValueMap : public AbstractTypeUser { + class VISIBILITY_HIDDEN ValueMap : public AbstractTypeUser { public: typedef std::pair MapKey; typedef std::map MapTy; Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.140 llvm/lib/VMCore/Type.cpp:1.141 --- llvm/lib/VMCore/Type.cpp:1.140 Sun May 28 21:34:34 2006 +++ llvm/lib/VMCore/Type.cpp Wed Jun 28 16:38:54 2006 @@ -20,6 +20,7 @@ #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; @@ -366,7 +367,7 @@ //===----------------------------------------------------------------------===// namespace { - struct PrimType : public Type { + struct VISIBILITY_HIDDEN PrimType : public Type { PrimType(const char *S, TypeID ID) : Type(S, ID) {} }; } Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.156 llvm/lib/VMCore/Verifier.cpp:1.157 --- llvm/lib/VMCore/Verifier.cpp:1.156 Fri May 19 16:25:17 2006 +++ llvm/lib/VMCore/Verifier.cpp Wed Jun 28 16:38:54 2006 @@ -57,6 +57,7 @@ #include "llvm/Support/InstVisitor.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/Visibility.h" #include #include #include @@ -65,7 +66,8 @@ namespace { // Anonymous namespace for class - struct Verifier : public FunctionPass, InstVisitor { + struct VISIBILITY_HIDDEN + Verifier : public FunctionPass, InstVisitor { bool Broken; // Is this module found to be broken? bool RealPass; // Are we not being run by a PassManager? VerifierFailureAction action; From lattner at cs.uiuc.edu Wed Jun 28 16:58:42 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 16:58:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp LegalizeDAG.cpp Message-ID: <200606282158.QAA07068@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.173 -> 1.174 LegalizeDAG.cpp updated: 1.379 -> 1.380 --- Log message: Mark these two classes as hidden, shrinking libllbmgcc.dylib by 25K --- Diffs of the changes: (+4 -2) DAGCombiner.cpp | 3 ++- LegalizeDAG.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.173 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.174 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.173 Mon Jun 12 11:06:43 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jun 28 16:58:30 2006 @@ -35,6 +35,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetLowering.h" +#include "llvm/Support/Visibility.h" #include #include #include @@ -43,7 +44,7 @@ namespace { Statistic<> NodesCombined ("dagcombiner", "Number of dag nodes combined"); - class DAGCombiner { + class VISIBILITY_HIDDEN DAGCombiner { SelectionDAG &DAG; TargetLowering &TLI; bool AfterLegalize; Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.379 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.380 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.379 Fri May 26 18:08:15 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Jun 28 16:58:30 2006 @@ -21,6 +21,7 @@ #include "llvm/Constants.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; @@ -46,7 +47,7 @@ /// will attempt merge setcc and brc instructions into brcc's. /// namespace { -class SelectionDAGLegalize { +class VISIBILITY_HIDDEN SelectionDAGLegalize { TargetLowering &TLI; SelectionDAG &DAG; From lattner at cs.uiuc.edu Wed Jun 28 17:00:48 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 17:00:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp PPCAsmPrinter.cpp Message-ID: <200606282200.RAA07174@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.196 -> 1.197 PPCAsmPrinter.cpp updated: 1.183 -> 1.184 --- Log message: shrink libllvmgcc.dylib another 25K --- Diffs of the changes: (+4 -2) PPCAsmPrinter.cpp | 3 ++- PPCISelDAGToDAG.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.196 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.197 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.196 Tue Jun 27 16:08:52 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Wed Jun 28 17:00:36 2006 @@ -28,6 +28,7 @@ #include "llvm/Intrinsics.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; @@ -39,7 +40,7 @@ /// PPCDAGToDAGISel - PPC specific code to select PPC machine /// instructions for SelectionDAG operations. /// - class PPCDAGToDAGISel : public SelectionDAGISel { + class VISIBILITY_HIDDEN PPCDAGToDAGISel : public SelectionDAGISel { PPCTargetMachine &TM; PPCTargetLowering PPCLowering; unsigned GlobalBaseReg; Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.183 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.184 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.183 Tue Jun 27 15:20:53 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Wed Jun 28 17:00:36 2006 @@ -33,6 +33,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetOptions.h" @@ -45,7 +46,7 @@ namespace { Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed"); - class PPCAsmPrinter : public AsmPrinter { + class VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter { public: std::set FnStubs, GVStubs; From lattner at cs.uiuc.edu Wed Jun 28 17:08:27 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 17:08:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LowerGC.cpp LowerInvoke.cpp LowerSwitch.cpp Mem2Reg.cpp Message-ID: <200606282208.RAA07273@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.493 -> 1.494 LowerGC.cpp updated: 1.10 -> 1.11 LowerInvoke.cpp updated: 1.36 -> 1.37 LowerSwitch.cpp updated: 1.21 -> 1.22 Mem2Reg.cpp updated: 1.17 -> 1.18 --- Log message: Shrink libllvmgcc.dylib by another 23K --- Diffs of the changes: (+12 -6) InstructionCombining.cpp | 6 ++++-- LowerGC.cpp | 3 ++- LowerInvoke.cpp | 3 ++- LowerSwitch.cpp | 3 ++- Mem2Reg.cpp | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.493 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.494 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.493 Wed Jun 28 12:34:50 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Jun 28 17:08:15 2006 @@ -48,6 +48,7 @@ #include "llvm/Support/InstVisitor.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/PatternMatch.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -62,8 +63,9 @@ Statistic<> NumDeadStore("instcombine", "Number of dead stores eliminated"); Statistic<> NumSunkInst ("instcombine", "Number of instructions sunk"); - class InstCombiner : public FunctionPass, - public InstVisitor { + class VISIBILITY_HIDDEN InstCombiner + : public FunctionPass, + public InstVisitor { // Worklist of all of the instructions that need to be simplified. std::vector WorkList; TargetData *TD; Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.10 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.11 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.10 Sat Jan 14 13:30:35 2006 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Wed Jun 28 17:08:15 2006 @@ -26,10 +26,11 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Pass.h" +#include "llvm/Support/Visibility.h" using namespace llvm; namespace { - class LowerGC : public FunctionPass { + class VISIBILITY_HIDDEN LowerGC : public FunctionPass { /// GCRootInt, GCReadInt, GCWriteInt - The function prototypes for the /// llvm.gcread/llvm.gcwrite/llvm.gcroot intrinsics. Function *GCRootInt, *GCReadInt, *GCWriteInt; Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.36 llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.37 --- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.36 Wed May 17 16:05:27 2006 +++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp Wed Jun 28 17:08:15 2006 @@ -44,6 +44,7 @@ #include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Visibility.h" #include using namespace llvm; @@ -55,7 +56,7 @@ cl::opt ExpensiveEHSupport("enable-correct-eh-support", cl::desc("Make the -lowerinvoke pass insert expensive, but correct, EH code")); - class LowerInvoke : public FunctionPass { + class VISIBILITY_HIDDEN LowerInvoke : public FunctionPass { // Used for both models. Function *WriteFn; Function *AbortFn; Index: llvm/lib/Transforms/Scalar/LowerSwitch.cpp diff -u llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.21 llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.22 --- llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.21 Wed May 17 16:05:27 2006 +++ llvm/lib/Transforms/Scalar/LowerSwitch.cpp Wed Jun 28 17:08:15 2006 @@ -20,6 +20,7 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include #include @@ -31,7 +32,7 @@ /// LowerSwitch Pass - Replace all SwitchInst instructions with chained branch /// instructions. Note that this cannot be a BasicBlock pass because it /// modifies the CFG! - class LowerSwitch : public FunctionPass { + class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass { public: virtual bool runOnFunction(Function &F); Index: llvm/lib/Transforms/Scalar/Mem2Reg.cpp diff -u llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.17 llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.18 --- llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.17 Wed May 17 16:05:27 2006 +++ llvm/lib/Transforms/Scalar/Mem2Reg.cpp Wed Jun 28 17:08:15 2006 @@ -20,12 +20,13 @@ #include "llvm/Function.h" #include "llvm/Target/TargetData.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Visibility.h" using namespace llvm; namespace { Statistic<> NumPromoted("mem2reg", "Number of alloca's promoted"); - struct PromotePass : public FunctionPass { + struct VISIBILITY_HIDDEN PromotePass : public FunctionPass { // runOnFunction - To run this pass, first we calculate the alloca // instructions that are safe for promotion, then we promote each one. // From lattner at cs.uiuc.edu Wed Jun 28 17:17:51 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 17:17:51 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp ScheduleDAGRRList.cpp ScheduleDAGSimple.cpp Message-ID: <200606282217.RAA08053@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAGList.cpp updated: 1.60 -> 1.61 ScheduleDAGRRList.cpp updated: 1.6 -> 1.7 ScheduleDAGSimple.cpp updated: 1.12 -> 1.13 --- Log message: Shave another 27K off libllvmgcc.dylib with visibility hidden --- Diffs of the changes: (+6 -3) ScheduleDAGList.cpp | 3 ++- ScheduleDAGRRList.cpp | 3 ++- ScheduleDAGSimple.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.60 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.61 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.60 Tue May 30 13:04:34 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Wed Jun 28 17:17:39 2006 @@ -26,6 +26,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include #include @@ -42,7 +43,7 @@ /// ScheduleDAGList - The actual list scheduler implementation. This supports /// top-down scheduling. /// -class ScheduleDAGList : public ScheduleDAG { +class VISIBILITY_HIDDEN ScheduleDAGList : public ScheduleDAG { private: /// AvailableQueue - The priority queue to use for the available SUnits. /// Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.6 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.7 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.6 Tue May 30 13:05:39 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Wed Jun 28 17:17:39 2006 @@ -23,6 +23,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include #include @@ -36,7 +37,7 @@ /// implementation. This supports both top-down and bottom-up scheduling. /// -class ScheduleDAGRRList : public ScheduleDAG { +class VISIBILITY_HIDDEN ScheduleDAGRRList : public ScheduleDAG { private: /// isBottomUp - This is true if the scheduling problem is bottom-up, false if /// it is top-down. Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.12 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.13 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.12 Fri May 12 01:33:48 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Wed Jun 28 17:17:39 2006 @@ -20,6 +20,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; @@ -389,7 +390,7 @@ /// /// ScheduleDAGSimple - Simple two pass scheduler. /// -class ScheduleDAGSimple : public ScheduleDAG { +class VISIBILITY_HIDDEN ScheduleDAGSimple : public ScheduleDAG { private: bool NoSched; // Just do a BFS schedule, nothing fancy bool NoItins; // Don't use itineraries? From lattner at cs.uiuc.edu Wed Jun 28 17:17:52 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 17:17:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp PrologEpilogInserter.cpp RegAllocLinearScan.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp VirtRegMap.cpp Message-ID: <200606282217.RAA08069@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineFunction.cpp updated: 1.94 -> 1.95 PrologEpilogInserter.cpp updated: 1.54 -> 1.55 RegAllocLinearScan.cpp updated: 1.123 -> 1.124 RegAllocSimple.cpp updated: 1.67 -> 1.68 TwoAddressInstructionPass.cpp updated: 1.34 -> 1.35 VirtRegMap.cpp updated: 1.66 -> 1.67 --- Log message: Shave another 27K off libllvmgcc.dylib with visibility hidden --- Diffs of the changes: (+19 -10) MachineFunction.cpp | 5 +++-- PrologEpilogInserter.cpp | 3 ++- RegAllocLinearScan.cpp | 3 ++- RegAllocSimple.cpp | 3 ++- TwoAddressInstructionPass.cpp | 4 +++- VirtRegMap.cpp | 11 +++++++---- 6 files changed, 19 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.94 llvm/lib/CodeGen/MachineFunction.cpp:1.95 --- llvm/lib/CodeGen/MachineFunction.cpp:1.94 Tue Jun 27 11:49:46 2006 +++ llvm/lib/CodeGen/MachineFunction.cpp Wed Jun 28 17:17:39 2006 @@ -27,6 +27,7 @@ #include "llvm/Instructions.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/Support/Visibility.h" #include "llvm/Config/config.h" #include #include @@ -39,7 +40,7 @@ namespace { - struct Printer : public MachineFunctionPass { + struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass { std::ostream *OS; const std::string Banner; @@ -69,7 +70,7 @@ } namespace { - struct Deleter : public MachineFunctionPass { + struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass { const char *getPassName() const { return "Machine Code Deleter"; } bool runOnMachineFunction(MachineFunction &MF) { Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.54 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.55 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.54 Fri May 12 13:02:04 2006 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Wed Jun 28 17:17:39 2006 @@ -24,10 +24,11 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Support/Visibility.h" using namespace llvm; namespace { - struct PEI : public MachineFunctionPass { + struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; } Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.123 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.124 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.123 Fri May 12 14:07:46 2006 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Wed Jun 28 17:17:39 2006 @@ -26,6 +26,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include #include #include @@ -43,7 +44,7 @@ static unsigned numIterations = 0; static unsigned numIntervals = 0; - struct RA : public MachineFunctionPass { + struct VISIBILITY_HIDDEN RA : public MachineFunctionPass { typedef std::pair IntervalPtr; typedef std::vector IntervalPtrs; private: Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.67 llvm/lib/CodeGen/RegAllocSimple.cpp:1.68 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.67 Thu May 4 12:52:23 2006 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Wed Jun 28 17:17:39 2006 @@ -23,6 +23,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -32,7 +33,7 @@ Statistic<> NumStores("ra-simple", "Number of stores added"); Statistic<> NumLoads ("ra-simple", "Number of loads added"); - class RegAllocSimple : public MachineFunctionPass { + class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass { MachineFunction *MF; const TargetMachine *TM; const MRegisterInfo *RegInfo; Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.34 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.35 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.34 Wed May 24 12:04:04 2006 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Wed Jun 28 17:17:39 2006 @@ -38,6 +38,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -51,7 +52,8 @@ Statistic<> NumConvertedTo3Addr("twoaddressinstruction", "Number of instructions promoted to 3-address"); - struct TwoAddressInstructionPass : public MachineFunctionPass { + struct VISIBILITY_HIDDEN TwoAddressInstructionPass + : public MachineFunctionPass { virtual void getAnalysisUsage(AnalysisUsage &AU) const; /// runOnMachineFunction - pass entry point Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.66 llvm/lib/CodeGen/VirtRegMap.cpp:1.67 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.66 Thu May 4 12:52:23 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Wed Jun 28 17:17:39 2006 @@ -26,6 +26,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include @@ -130,7 +131,7 @@ Spiller::~Spiller() {} namespace { - struct SimpleSpiller : public Spiller { + struct VISIBILITY_HIDDEN SimpleSpiller : public Spiller { bool runOnMachineFunction(MachineFunction& mf, VirtRegMap &VRM); }; } @@ -204,7 +205,7 @@ /// block to attempt to keep spills in registers as much as possible for /// blocks that have low register pressure (the vreg may be spilled due to /// register pressure in other blocks). - class LocalSpiller : public Spiller { + class VISIBILITY_HIDDEN LocalSpiller : public Spiller { const MRegisterInfo *MRI; const TargetInstrInfo *TII; public: @@ -240,7 +241,8 @@ /// per-stack-slot basis as the low bit in the value of the SpillSlotsAvailable /// entries. The predicate 'canClobberPhysReg()' checks this bit and /// addAvailable sets it if. -class AvailableSpills { +namespace { +class VISIBILITY_HIDDEN AvailableSpills { const MRegisterInfo *MRI; const TargetInstrInfo *TII; @@ -304,6 +306,7 @@ /// for this slot lives in (as the previous value is dead now). void ModifyStackSlot(int Slot); }; +} /// ClobberPhysRegOnly - This is called when the specified physreg changes /// value. We use this to invalidate any info about stuff we thing lives in it. @@ -379,7 +382,7 @@ /// ReuseInfo - This maintains a collection of ReuseOp's for each operand that /// is reused instead of reloaded. - class ReuseInfo { + class VISIBILITY_HIDDEN ReuseInfo { MachineInstr &MI; std::vector Reuses; public: From lattner at cs.uiuc.edu Wed Jun 28 17:57:12 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 17:57:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp LeakDetector.cpp Message-ID: <200606282257.RAA12623@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.71 -> 1.72 LeakDetector.cpp updated: 1.13 -> 1.14 --- Log message: Use hidden visibility to reduce codesize --- Diffs of the changes: (+6 -4) BasicBlock.cpp | 3 ++- LeakDetector.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.71 llvm/lib/VMCore/BasicBlock.cpp:1.72 --- llvm/lib/VMCore/BasicBlock.cpp:1.71 Tue Jun 13 23:43:14 2006 +++ llvm/lib/VMCore/BasicBlock.cpp Wed Jun 28 17:57:00 2006 @@ -17,6 +17,7 @@ #include "llvm/Type.h" #include "llvm/Support/CFG.h" #include "llvm/Support/LeakDetector.h" +#include "llvm/Support/Visibility.h" #include "SymbolTableListTraitsImpl.h" #include using namespace llvm; @@ -24,7 +25,7 @@ namespace { /// DummyInst - An instance of this class is used to mark the end of the /// instruction list. This is not a real instruction. - struct DummyInst : public Instruction { + struct VISIBILITY_HIDDEN DummyInst : public Instruction { DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd, 0, 0) { // This should not be garbage monitored. LeakDetector::removeGarbageObject(this); Index: llvm/lib/VMCore/LeakDetector.cpp diff -u llvm/lib/VMCore/LeakDetector.cpp:1.13 llvm/lib/VMCore/LeakDetector.cpp:1.14 --- llvm/lib/VMCore/LeakDetector.cpp:1.13 Thu Apr 21 18:46:51 2005 +++ llvm/lib/VMCore/LeakDetector.cpp Wed Jun 28 17:57:00 2006 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/LeakDetector.h" +#include "llvm/Support/Visibility.h" #include "llvm/Value.h" #include #include @@ -19,17 +20,17 @@ namespace { template - struct PrinterTrait { + struct VISIBILITY_HIDDEN PrinterTrait { static void print(const T* P) { std::cerr << P; } }; template<> - struct PrinterTrait { + struct VISIBILITY_HIDDEN PrinterTrait { static void print(const Value* P) { std::cerr << *P; } }; template - struct LeakDetectorImpl { + struct VISIBILITY_HIDDEN LeakDetectorImpl { LeakDetectorImpl(const char* const name) : Cache(0), Name(name) { } // Because the most common usage pattern, by far, is to add a From lattner at cs.uiuc.edu Wed Jun 28 18:17:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:17:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PHIElimination.cpp RegAllocLocal.cpp UnreachableBlockElim.cpp Message-ID: <200606282317.SAA13965@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PHIElimination.cpp updated: 1.41 -> 1.42 RegAllocLocal.cpp updated: 1.79 -> 1.80 UnreachableBlockElim.cpp updated: 1.6 -> 1.7 --- Log message: Use hidden visibility to make symbols in an anonymous namespace get dropped. This shrinks libllvmgcc.dylib another 67K --- Diffs of the changes: (+6 -3) PHIElimination.cpp | 3 ++- RegAllocLocal.cpp | 3 ++- UnreachableBlockElim.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.41 llvm/lib/CodeGen/PHIElimination.cpp:1.42 --- llvm/lib/CodeGen/PHIElimination.cpp:1.41 Wed Jan 4 01:12:21 2006 +++ llvm/lib/CodeGen/PHIElimination.cpp Wed Jun 28 18:17:23 2006 @@ -23,6 +23,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Visibility.h" #include #include using namespace llvm; @@ -31,7 +32,7 @@ Statistic<> NumAtomic("phielim", "Number of atomic phis lowered"); Statistic<> NumSimple("phielim", "Number of simple phis lowered"); - struct PNE : public MachineFunctionPass { + struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass { bool runOnMachineFunction(MachineFunction &Fn) { bool Changed = false; Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.79 llvm/lib/CodeGen/RegAllocLocal.cpp:1.80 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.79 Thu Jun 15 17:21:53 2006 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Wed Jun 28 18:17:23 2006 @@ -23,6 +23,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Statistic.h" #include @@ -34,7 +35,7 @@ Statistic<> NumLoads ("ra-local", "Number of loads added"); Statistic<> NumFolded("ra-local", "Number of loads/stores folded into " "instructions"); - class RA : public MachineFunctionPass { + class VISIBILITY_HIDDEN RA : public MachineFunctionPass { const TargetMachine *TM; MachineFunction *MF; const MRegisterInfo *RegInfo; Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.6 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.7 --- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.6 Thu Apr 21 17:33:33 2005 +++ llvm/lib/CodeGen/UnreachableBlockElim.cpp Wed Jun 28 18:17:23 2006 @@ -27,11 +27,12 @@ #include "llvm/Pass.h" #include "llvm/Type.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/DepthFirstIterator.h" using namespace llvm; namespace { - class UnreachableBlockElim : public FunctionPass { + class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass { virtual bool runOnFunction(Function &F); }; RegisterOpt From lattner at cs.uiuc.edu Wed Jun 28 18:17:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:17:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp LowerAllocations.cpp ScalarReplAggregates.cpp Message-ID: <200606282317.SAA13959@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.84 -> 1.85 LowerAllocations.cpp updated: 1.58 -> 1.59 ScalarReplAggregates.cpp updated: 1.39 -> 1.40 --- Log message: Use hidden visibility to make symbols in an anonymous namespace get dropped. This shrinks libllvmgcc.dylib another 67K --- Diffs of the changes: (+7 -4) LoopStrengthReduce.cpp | 3 ++- LowerAllocations.cpp | 3 ++- ScalarReplAggregates.cpp | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.84 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.85 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.84 Thu Jun 8 19:12:42 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed Jun 28 18:17:24 2006 @@ -31,6 +31,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/Target/TargetLowering.h" #include #include @@ -104,7 +105,7 @@ } }; - class LoopStrengthReduce : public FunctionPass { + class VISIBILITY_HIDDEN LoopStrengthReduce : public FunctionPass { LoopInfo *LI; ETForest *EF; ScalarEvolution *SE; Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.58 llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.59 --- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.58 Wed May 17 16:05:27 2006 +++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp Wed Jun 28 18:17:24 2006 @@ -21,6 +21,7 @@ #include "llvm/Pass.h" #include "llvm/ADT/Statistic.h" #include "llvm/Target/TargetData.h" +#include "llvm/Support/Visibility.h" using namespace llvm; namespace { @@ -29,7 +30,7 @@ /// LowerAllocations - Turn malloc and free instructions into %malloc and /// %free calls. /// - class LowerAllocations : public BasicBlockPass { + class VISIBILITY_HIDDEN LowerAllocations : public BasicBlockPass { Function *MallocFunc; // Functions in the module we are processing Function *FreeFunc; // Initialized by doInitialization bool LowerMallocArgToInteger; Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.39 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.40 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.39 Thu Apr 20 15:48:50 2006 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Jun 28 18:17:24 2006 @@ -28,9 +28,10 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/PromoteMemToReg.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include @@ -42,7 +43,7 @@ Statistic<> NumConverted("scalarrepl", "Number of aggregates converted to scalar"); - struct SROA : public FunctionPass { + struct VISIBILITY_HIDDEN SROA : public FunctionPass { bool runOnFunction(Function &F); bool performScalarRepl(Function &F); From lattner at cs.uiuc.edu Wed Jun 28 18:17:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:17:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LoopSimplify.cpp PromoteMemoryToRegister.cpp Message-ID: <200606282317.SAA13978@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.29 -> 1.30 LoopSimplify.cpp updated: 1.69 -> 1.70 PromoteMemoryToRegister.cpp updated: 1.83 -> 1.84 --- Log message: Use hidden visibility to make symbols in an anonymous namespace get dropped. This shrinks libllvmgcc.dylib another 67K --- Diffs of the changes: (+6 -3) BreakCriticalEdges.cpp | 3 ++- LoopSimplify.cpp | 3 ++- PromoteMemoryToRegister.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.29 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.30 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.29 Tue Jan 10 23:11:13 2006 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed Jun 28 18:17:24 2006 @@ -24,13 +24,14 @@ #include "llvm/Instructions.h" #include "llvm/Type.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" using namespace llvm; namespace { Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted"); - struct BreakCriticalEdges : public FunctionPass { + struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass { virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.69 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.70 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.69 Tue Feb 14 17:06:02 2006 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Wed Jun 28 18:17:24 2006 @@ -41,6 +41,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/Statistic.h" @@ -53,7 +54,7 @@ Statistic<> NumNested("loopsimplify", "Number of nested loops split out"); - struct LoopSimplify : public FunctionPass { + struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass { // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. AliasAnalysis *AA; Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.83 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.84 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.83 Wed Apr 26 20:14:43 2006 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Wed Jun 28 18:17:24 2006 @@ -26,6 +26,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CFG.h" #include "llvm/Support/StableBasicBlockNumbering.h" +#include "llvm/Support/Visibility.h" #include using namespace llvm; @@ -52,7 +53,7 @@ } namespace { - struct PromoteMem2Reg { + struct VISIBILITY_HIDDEN PromoteMem2Reg { /// Allocas - The alloca instructions being promoted. /// std::vector Allocas; From lattner at cs.uiuc.edu Wed Jun 28 18:17:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:17:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp SelectionDAGISel.cpp Message-ID: <200606282317.SAA13984@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAGRRList.cpp updated: 1.7 -> 1.8 SelectionDAGISel.cpp updated: 1.257 -> 1.258 --- Log message: Use hidden visibility to make symbols in an anonymous namespace get dropped. This shrinks libllvmgcc.dylib another 67K --- Diffs of the changes: (+6 -3) ScheduleDAGRRList.cpp | 6 ++++-- SelectionDAGISel.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.7 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.8 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.7 Wed Jun 28 17:17:39 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Wed Jun 28 18:17:23 2006 @@ -430,7 +430,8 @@ namespace { template - class RegReductionPriorityQueue : public SchedulingPriorityQueue { + class VISIBILITY_HIDDEN RegReductionPriorityQueue + : public SchedulingPriorityQueue { std::priority_queue, SF> Queue; public: @@ -463,7 +464,8 @@ }; template - class BURegReductionPriorityQueue : public RegReductionPriorityQueue { + class VISIBILITY_HIDDEN BURegReductionPriorityQueue + : public RegReductionPriorityQueue { // SUnits - The SUnits for the current graph. const std::vector *SUnits; Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.257 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.258 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.257 Thu Jun 15 03:11:54 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jun 28 18:17:23 2006 @@ -42,6 +42,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include #include #include @@ -101,7 +102,7 @@ /// particular value is assigned and the type information about the value. /// This is needed because values can be promoted into larger registers and /// expanded into multiple smaller registers than the value. - struct RegsForValue { + struct VISIBILITY_HIDDEN RegsForValue { /// Regs - This list hold the register (for legal and promoted values) /// or register set (for expanded values) that the value should be assigned /// to. From lattner at cs.uiuc.edu Wed Jun 28 18:17:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:17:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCBranchSelector.cpp PPCCodeEmitter.cpp Message-ID: <200606282317.SAA13992@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.184 -> 1.185 PPCBranchSelector.cpp updated: 1.24 -> 1.25 PPCCodeEmitter.cpp updated: 1.60 -> 1.61 --- Log message: Use hidden visibility to make symbols in an anonymous namespace get dropped. This shrinks libllvmgcc.dylib another 67K --- Diffs of the changes: (+7 -5) PPCAsmPrinter.cpp | 6 +++--- PPCBranchSelector.cpp | 3 ++- PPCCodeEmitter.cpp | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.184 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.185 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.184 Wed Jun 28 17:00:36 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Wed Jun 28 18:17:23 2006 @@ -241,7 +241,7 @@ /// DarwinDwarfWriter - Dwarf debug info writer customized for Darwin/Mac OS X /// - struct DarwinDwarfWriter : public DwarfWriter { + struct VISIBILITY_HIDDEN DarwinDwarfWriter : public DwarfWriter { // Ctor. DarwinDwarfWriter(std::ostream &o, AsmPrinter *ap) : DwarfWriter(o, ap) @@ -265,7 +265,7 @@ /// DarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac OS /// X - struct DarwinAsmPrinter : public PPCAsmPrinter { + struct VISIBILITY_HIDDEN DarwinAsmPrinter : public PPCAsmPrinter { DarwinDwarfWriter DW; @@ -309,7 +309,7 @@ /// AIXAsmPrinter - PowerPC assembly printer, customized for AIX /// - struct AIXAsmPrinter : public PPCAsmPrinter { + struct VISIBILITY_HIDDEN AIXAsmPrinter : public PPCAsmPrinter { /// Map for labels corresponding to global variables /// std::map GVToLabelMap; Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.24 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.25 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.24 Tue Jun 27 13:18:40 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Wed Jun 28 18:17:23 2006 @@ -19,11 +19,12 @@ #include "PPCInstrBuilder.h" #include "PPCInstrInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/Support/Visibility.h" #include using namespace llvm; namespace { - struct PPCBSel : public MachineFunctionPass { + struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { // OffsetMap - Mapping between BB and byte offset from start of function std::map OffsetMap; Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.60 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.61 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.60 Tue Jun 27 13:18:40 2006 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Wed Jun 28 18:17:23 2006 @@ -22,12 +22,13 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/Target/TargetOptions.h" #include using namespace llvm; namespace { - class PPCCodeEmitter : public MachineFunctionPass { + class VISIBILITY_HIDDEN PPCCodeEmitter : public MachineFunctionPass { TargetMachine &TM; MachineCodeEmitter &MCE; From lattner at cs.uiuc.edu Wed Jun 28 18:17:39 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:17:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp ScalarEvolution.cpp Message-ID: <200606282317.SAA13951@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.81 -> 1.82 ScalarEvolution.cpp updated: 1.48 -> 1.49 --- Log message: Use hidden visibility to make symbols in an anonymous namespace get dropped. This shrinks libllvmgcc.dylib another 67K --- Diffs of the changes: (+7 -5) BasicAliasAnalysis.cpp | 5 +++-- ScalarEvolution.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.81 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.82 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.81 Wed Jun 7 17:00:26 2006 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed Jun 28 18:17:23 2006 @@ -23,6 +23,7 @@ #include "llvm/Pass.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" +#include "llvm/Support/Visibility.h" #include using namespace llvm; @@ -32,7 +33,7 @@ /// implementations, in that it does not chain to a previous analysis. As /// such it doesn't follow many of the rules that other alias analyses must. /// - struct NoAA : public ImmutablePass, public AliasAnalysis { + struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -84,7 +85,7 @@ /// BasicAliasAnalysis - This is the default alias analysis implementation. /// Because it doesn't chain to a previous alias analysis (like -no-aa), it /// derives from the NoAA class. - struct BasicAliasAnalysis : public NoAA { + struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.48 llvm/lib/Analysis/ScalarEvolution.cpp:1.49 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.48 Wed Apr 26 13:34:07 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Wed Jun 28 18:17:23 2006 @@ -69,9 +69,10 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/InstIterator.h" -#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include #include @@ -393,7 +394,7 @@ /// SCEVComplexityCompare - Return true if the complexity of the LHS is less /// than the complexity of the RHS. This comparator is used to canonicalize /// expressions. - struct SCEVComplexityCompare { + struct VISIBILITY_HIDDEN SCEVComplexityCompare { bool operator()(SCEV *LHS, SCEV *RHS) { return LHS->getSCEVType() < RHS->getSCEVType(); } @@ -1062,7 +1063,7 @@ /// evolution code. /// namespace { - struct ScalarEvolutionsImpl { + struct VISIBILITY_HIDDEN ScalarEvolutionsImpl { /// F - The function we are analyzing. /// Function &F; From lattner at cs.uiuc.edu Wed Jun 28 18:28:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 28 Jun 2006 18:28:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86ELFWriter.cpp X86FloatingPoint.cpp X86ISelDAGToDAG.cpp Message-ID: <200606282328.SAA16061@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.109 -> 1.110 X86ELFWriter.cpp updated: 1.3 -> 1.4 X86FloatingPoint.cpp updated: 1.50 -> 1.51 X86ISelDAGToDAG.cpp updated: 1.74 -> 1.75 --- Log message: Hide x86 symbols --- Diffs of the changes: (+8 -4) X86CodeEmitter.cpp | 3 ++- X86ELFWriter.cpp | 3 ++- X86FloatingPoint.cpp | 3 ++- X86ISelDAGToDAG.cpp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.109 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.110 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.109 Wed Jun 21 19:02:55 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Wed Jun 28 18:27:49 2006 @@ -22,6 +22,7 @@ #include "llvm/CodeGen/Passes.h" #include "llvm/Function.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Visibility.h" #include "llvm/Target/TargetOptions.h" #include using namespace llvm; @@ -32,7 +33,7 @@ } namespace { - class Emitter : public MachineFunctionPass { + class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass { const X86InstrInfo *II; MachineCodeEmitter &MCE; std::vector > BBRefs; Index: llvm/lib/Target/X86/X86ELFWriter.cpp diff -u llvm/lib/Target/X86/X86ELFWriter.cpp:1.3 llvm/lib/Target/X86/X86ELFWriter.cpp:1.4 --- llvm/lib/Target/X86/X86ELFWriter.cpp:1.3 Mon Mar 13 17:20:37 2006 +++ llvm/lib/Target/X86/X86ELFWriter.cpp Wed Jun 28 18:27:49 2006 @@ -16,10 +16,11 @@ #include "X86TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/ELFWriter.h" +#include "llvm/Support/Visibility.h" using namespace llvm; namespace { - class X86ELFWriter : public ELFWriter { + class VISIBILITY_HIDDEN X86ELFWriter : public ELFWriter { public: X86ELFWriter(std::ostream &O, X86TargetMachine &TM) : ELFWriter(O, TM) { e_machine = 3; // EM_386 Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.50 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.51 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.50 Fri Feb 17 20:36:28 2006 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Wed Jun 28 18:27:49 2006 @@ -38,6 +38,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" @@ -50,7 +51,7 @@ Statistic<> NumFXCH("x86-codegen", "Number of fxch instructions inserted"); Statistic<> NumFP ("x86-codegen", "Number of floating point instructions"); - struct FPS : public MachineFunctionPass { + struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass { virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "X86 FP Stackifier"; } Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.74 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.75 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.74 Thu Jun 8 13:03:49 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Jun 28 18:27:49 2006 @@ -31,6 +31,7 @@ #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/Visibility.h" #include "llvm/ADT/Statistic.h" #include #include @@ -77,7 +78,7 @@ /// ISel - X86 specific code to select X86 machine instructions for /// SelectionDAG operations. /// - class X86DAGToDAGISel : public SelectionDAGISel { + class VISIBILITY_HIDDEN X86DAGToDAGISel : public SelectionDAGISel { /// ContainsFPCode - Every instruction we select that uses or defines a FP /// register should set this to true. bool ContainsFPCode; From evan.cheng at apple.com Wed Jun 28 19:26:22 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 19:26:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200606290026.TAA23950@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.82 -> 1.83 --- Log message: Add support to print 4-, 8-, and 16- byte constant literals in special sections. e.g. On Darwin that would be .literal4 and .literal8. --- Diffs of the changes: (+48 -10) AsmPrinter.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 48 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.82 llvm/lib/CodeGen/AsmPrinter.cpp:1.83 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.82 Thu Jun 15 14:37:14 2006 +++ llvm/lib/CodeGen/AsmPrinter.cpp Wed Jun 28 19:26:09 2006 @@ -55,6 +55,9 @@ JumpTableSection("\t.section .rodata\n"), StaticCtorsSection("\t.section .ctors,\"aw\", at progbits"), StaticDtorsSection("\t.section .dtors,\"aw\", at progbits"), + FourByteConstantSection(0), + EightByteConstantSection(0), + SixteenByteConstantSection(0), LCOMMDirective(0), COMMDirective("\t.comm\t"), COMMDirectiveTakesAlignment(true), @@ -147,19 +150,54 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { const std::vector &CP = MCP->getConstants(); if (CP.empty()) return; - - SwitchToDataSection(ConstantPoolSection, 0); - EmitAlignment(MCP->getConstantPoolAlignment()); + + // Some targets require 4-, 8-, and 16- byte constant literals to be placed + // in special sections. + std::vector > FourByteCPs; + std::vector > EightByteCPs; + std::vector > SixteenByteCPs; + std::vector > OtherCPs; + for (unsigned i = 0, e = CP.size(); i != e; ++i) { + MachineConstantPoolEntry CPE = CP[i]; + const Constant *CV = CPE.Val; + const Type *Ty = CV->getType(); + if (FourByteConstantSection && + TM.getTargetData()->getTypeSize(Ty) == 4) + FourByteCPs.push_back(std::make_pair(CPE, i)); + else if (EightByteConstantSection && + TM.getTargetData()->getTypeSize(Ty) == 8) + EightByteCPs.push_back(std::make_pair(CPE, i)); + else if (SixteenByteConstantSection && + TM.getTargetData()->getTypeSize(Ty) == 16) + SixteenByteCPs.push_back(std::make_pair(CPE, i)); + else + OtherCPs.push_back(std::make_pair(CPE, i)); + } + + unsigned Alignment = MCP->getConstantPoolAlignment(); + EmitConstantPool(Alignment, FourByteConstantSection, FourByteCPs); + EmitConstantPool(Alignment, EightByteConstantSection, EightByteCPs); + EmitConstantPool(Alignment, SixteenByteConstantSection, SixteenByteCPs); + EmitConstantPool(Alignment, ConstantPoolSection, OtherCPs); +} + +void AsmPrinter::EmitConstantPool(unsigned Alignment, const char *Section, + std::vector > &CP) { + if (CP.empty()) return; + + SwitchToDataSection(Section, 0); + EmitAlignment(Alignment); for (unsigned i = 0, e = CP.size(); i != e; ++i) { - O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' << i - << ":\t\t\t\t\t" << CommentString << " "; - WriteTypeSymbolic(O, CP[i].Val->getType(), 0) << '\n'; - EmitGlobalConstant(CP[i].Val); + O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' + << CP[i].second << ":\t\t\t\t\t" << CommentString << " "; + WriteTypeSymbolic(O, CP[i].first.Val->getType(), 0) << '\n'; + EmitGlobalConstant(CP[i].first.Val); if (i != e-1) { - unsigned EntSize = TM.getTargetData()->getTypeSize(CP[i].Val->getType()); - unsigned ValEnd = CP[i].Offset + EntSize; + unsigned EntSize = + TM.getTargetData()->getTypeSize(CP[i].first.Val->getType()); + unsigned ValEnd = CP[i].first.Offset + EntSize; // Emit inter-object padding for alignment. - EmitZeros(CP[i+1].Offset-ValEnd); + EmitZeros(CP[i+1].first.Offset-ValEnd); } } } From evan.cheng at apple.com Wed Jun 28 19:26:23 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 19:26:23 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200606290026.TAA23954@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.42 -> 1.43 --- Log message: Add support to print 4-, 8-, and 16- byte constant literals in special sections. e.g. On Darwin that would be .literal4 and .literal8. --- Diffs of the changes: (+11 -1) AsmPrinter.h | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.42 llvm/include/llvm/CodeGen/AsmPrinter.h:1.43 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.42 Tue Jun 27 19:52:32 2006 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Wed Jun 28 19:26:09 2006 @@ -24,6 +24,7 @@ class ConstantArray; class Mangler; class GlobalVariable; + class MachineConstantPoolEntry; class AsmPrinter : public MachineFunctionPass { /// FunctionNumber - This provides a unique ID for each function emitted in @@ -168,6 +169,13 @@ /// a section to emit the static destructor list. /// Defaults to "\t.section .dtors,\"aw\", at progbits". const char *StaticDtorsSection; + + /// FourByteConstantSection, EightByteConstantSection, + /// SixteenByteConstantSection - These are special sections where we place + /// 4-, 8-, and 16- byte constant literals. + const char *FourByteConstantSection; + const char *EightByteConstantSection; + const char *SixteenByteConstantSection; //===--- Global Variable Emission Directives --------------------------===// @@ -265,7 +273,7 @@ /// used to print out constants which have been "spilled to memory" by /// the code generator. /// - virtual void EmitConstantPool(MachineConstantPool *MCP); + void EmitConstantPool(MachineConstantPool *MCP); /// EmitJumpTableInfo - Print assembly representations of the jump tables /// used by the current function to the current output stream. @@ -311,6 +319,8 @@ private: void EmitXXStructorList(Constant *List); + void EmitConstantPool(unsigned Alignment, const char *Section, + std::vector > &CP); }; } From evan.cheng at apple.com Wed Jun 28 19:33:18 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 19:33:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp X86AsmPrinter.h Message-ID: <200606290033.TAA24813@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.187 -> 1.188 X86AsmPrinter.h updated: 1.21 -> 1.22 --- Log message: Move .literal4 and .literal8 support into AsmPrinter.cpp --- Diffs of the changes: (+2 -57) X86AsmPrinter.cpp | 53 ++--------------------------------------------------- X86AsmPrinter.h | 6 ------ 2 files changed, 2 insertions(+), 57 deletions(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.187 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.188 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.187 Wed Jun 28 12:56:43 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Wed Jun 28 19:33:06 2006 @@ -59,6 +59,8 @@ PrivateGlobalPrefix = "L"; // Marker for constant pool idxs ConstantPoolSection = "\t.const\n"; JumpTableSection = "\t.const\n"; // FIXME: depends on PIC mode + FourByteConstantSection = "\t.literal4\n"; + EightByteConstantSection = "\t.literal8\n"; LCOMMDirective = "\t.lcomm\t"; COMMDirectiveTakesAlignment = false; HasDotTypeDotSizeDirective = false; @@ -222,57 +224,6 @@ return false; // success } -void X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP) { - if (Subtarget->TargetType != X86Subtarget::isDarwin) { - AsmPrinter::EmitConstantPool(MCP); - return; - } - - const std::vector &CP = MCP->getConstants(); - if (CP.empty()) return; - - std::vector > FloatCPs; - std::vector > DoubleCPs; - std::vector > OtherCPs; - for (unsigned i = 0, e = CP.size(); i != e; ++i) { - MachineConstantPoolEntry CPE = CP[i]; - const Constant *CV = CPE.Val; - const Type *Ty = CV->getType(); - if (Ty->getTypeID() == Type::FloatTyID) - FloatCPs.push_back(std::make_pair(CPE, i)); - else if (Ty->getTypeID() == Type::DoubleTyID) - DoubleCPs.push_back(std::make_pair(CPE, i)); - else - OtherCPs.push_back(std::make_pair(CPE, i)); - } - EmitConstantPool(MCP, FloatCPs, "\t.literal4"); - EmitConstantPool(MCP, DoubleCPs, "\t.literal8"); - EmitConstantPool(MCP, OtherCPs, ConstantPoolSection); -} - -void -X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP, - std::vector > &CP, - const char *Section) { - if (CP.empty()) return; - - SwitchToDataSection(Section, 0); - EmitAlignment(MCP->getConstantPoolAlignment()); - for (unsigned i = 0, e = CP.size(); i != e; ++i) { - O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' - << CP[i].second << ":\t\t\t\t\t" << CommentString << " "; - WriteTypeSymbolic(O, CP[i].first.Val->getType(), 0) << '\n'; - EmitGlobalConstant(CP[i].first.Val); - if (i != e-1) { - unsigned EntSize = - TM.getTargetData()->getTypeSize(CP[i].first.Val->getType()); - unsigned ValEnd = CP[i].first.Offset + EntSize; - // Emit inter-object padding for alignment. - EmitZeros(CP[i+1].first.Offset-ValEnd); - } - } -} - /// createX86CodePrinterPass - Returns a pass that prints the X86 assembly code /// for a MachineFunction to the given output stream, using the given target /// machine description. Index: llvm/lib/Target/X86/X86AsmPrinter.h diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.21 llvm/lib/Target/X86/X86AsmPrinter.h:1.22 --- llvm/lib/Target/X86/X86AsmPrinter.h:1.21 Wed Jun 28 02:55:24 2006 +++ llvm/lib/Target/X86/X86AsmPrinter.h Wed Jun 28 19:33:06 2006 @@ -20,7 +20,6 @@ #include "X86TargetMachine.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/DwarfWriter.h" -#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineDebugInfo.h" #include "llvm/ADT/Statistic.h" #include @@ -93,11 +92,6 @@ MI->getOperand(Op+3).isGlobalAddress() || MI->getOperand(Op+3).isConstantPoolIndex()); } - - virtual void EmitConstantPool(MachineConstantPool *MCP); - void EmitConstantPool(MachineConstantPool *MCP, - std::vector > &CP, - const char *Section); }; } // end namespace llvm From evan.cheng at apple.com Wed Jun 28 19:34:35 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 19:34:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrSSE.td Message-ID: <200606290034.TAA25042@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrSSE.td updated: 1.126 -> 1.127 --- Log message: Always use xorps to clear XMM registers. --- Diffs of the changes: (+1 -1) X86InstrSSE.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86InstrSSE.td diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.126 llvm/lib/Target/X86/X86InstrSSE.td:1.127 --- llvm/lib/Target/X86/X86InstrSSE.td:1.126 Mon Jun 19 19:25:29 2006 +++ llvm/lib/Target/X86/X86InstrSSE.td Wed Jun 28 19:34:23 2006 @@ -2116,7 +2116,7 @@ "xorps $dst, $dst", [(set VR128:$dst, (v4f32 immAllZerosV))]>; def V_SET0_PD : PDI<0x57, MRMInitReg, (ops VR128:$dst), - "xorpd $dst, $dst", + "xorps $dst, $dst", [(set VR128:$dst, (v2f64 immAllZerosV))]>; def V_SETALLONES : PDI<0x76, MRMInitReg, (ops VR128:$dst), From evan.cheng at apple.com Wed Jun 28 19:37:03 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 19:37:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td X86RegisterInfo.cpp Message-ID: <200606290037.TAA25356@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.td updated: 1.277 -> 1.278 X86RegisterInfo.cpp updated: 1.158 -> 1.159 --- Log message: Add shift and rotate by 1 instructions / patterns. --- Diffs of the changes: (+128 -0) X86InstrInfo.td | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++ X86RegisterInfo.cpp | 15 ++++++ 2 files changed, 128 insertions(+) Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.277 llvm/lib/Target/X86/X86InstrInfo.td:1.278 --- llvm/lib/Target/X86/X86InstrInfo.td:1.277 Tue Jun 27 15:34:14 2006 +++ llvm/lib/Target/X86/X86InstrInfo.td Wed Jun 28 19:36:51 2006 @@ -1394,6 +1394,14 @@ [(set GR32:$dst, (shl GR32:$src1, (i8 imm:$src2)))]>; } +// Shift left by one. Not used because (add x, x) is slightly cheaper. +def SHL8r1 : I<0xD0, MRM4r, (ops GR8 :$dst, GR8 :$src1), + "shl{b} {$dst|$dst}", []>; +def SHL16r1 : I<0xD1, MRM4r, (ops GR16:$dst, GR16:$src1), + "shl{w} {$dst|$dst}", []>, OpSize; +def SHL32r1 : I<0xD1, MRM4r, (ops GR32:$dst, GR32:$src1), + "shl{l} {$dst|$dst}", []>; + let isTwoAddress = 0 in { def SHL8mCL : I<0xD2, MRM4m, (ops i8mem :$dst), "shl{b} {%cl, $dst|$dst, %CL}", @@ -1417,6 +1425,18 @@ def SHL32mi : Ii8<0xC1, MRM4m, (ops i32mem:$dst, i8imm:$src), "shl{l} {$src, $dst|$dst, $src}", [(store (shl (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>; + + // Shift by 1 + def SHL8m1 : I<0xD0, MRM4m, (ops i8mem :$dst), + "shl{b} $dst", + [(store (shl (loadi8 addr:$dst), (i8 1)), addr:$dst)]>; + def SHL16m1 : I<0xD1, MRM4m, (ops i16mem:$dst), + "shl{w} $dst", + [(store (shl (loadi16 addr:$dst), (i8 1)), addr:$dst)]>, + OpSize; + def SHL32m1 : I<0xD1, MRM4m, (ops i32mem:$dst), + "shl{l} $dst", + [(store (shl (loadi32 addr:$dst), (i8 1)), addr:$dst)]>; } def SHR8rCL : I<0xD2, MRM5r, (ops GR8 :$dst, GR8 :$src), @@ -1439,6 +1459,17 @@ "shr{l} {$src2, $dst|$dst, $src2}", [(set GR32:$dst, (srl GR32:$src1, (i8 imm:$src2)))]>; +// Shift by 1 +def SHR8r1 : I<0xD0, MRM5r, (ops GR8:$dst, GR8:$src1), + "shr{b} $dst", + [(set GR8:$dst, (srl GR8:$src1, (i8 1)))]>; +def SHR16r1 : I<0xD1, MRM5r, (ops GR16:$dst, GR16:$src1), + "shr{w} $dst", + [(set GR16:$dst, (srl GR16:$src1, (i8 1)))]>, OpSize; +def SHR32r1 : I<0xD1, MRM5r, (ops GR32:$dst, GR32:$src1), + "shr{l} $dst", + [(set GR32:$dst, (srl GR32:$src1, (i8 1)))]>; + let isTwoAddress = 0 in { def SHR8mCL : I<0xD2, MRM5m, (ops i8mem :$dst), "shr{b} {%cl, $dst|$dst, %CL}", @@ -1462,6 +1493,17 @@ def SHR32mi : Ii8<0xC1, MRM5m, (ops i32mem:$dst, i8imm:$src), "shr{l} {$src, $dst|$dst, $src}", [(store (srl (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>; + + // Shift by 1 + def SHR8m1 : I<0xD0, MRM5m, (ops i8mem :$dst), + "shr{b} $dst", + [(store (srl (loadi8 addr:$dst), (i8 1)), addr:$dst)]>; + def SHR16m1 : I<0xD1, MRM5m, (ops i16mem:$dst), + "shr{w} $dst", + [(store (srl (loadi16 addr:$dst), (i8 1)), addr:$dst)]>,OpSize; + def SHR32m1 : I<0xD1, MRM5m, (ops i32mem:$dst), + "shr{l} $dst", + [(store (srl (loadi32 addr:$dst), (i8 1)), addr:$dst)]>; } def SAR8rCL : I<0xD2, MRM7r, (ops GR8 :$dst, GR8 :$src), @@ -1484,6 +1526,18 @@ def SAR32ri : Ii8<0xC1, MRM7r, (ops GR32:$dst, GR32:$src1, i8imm:$src2), "sar{l} {$src2, $dst|$dst, $src2}", [(set GR32:$dst, (sra GR32:$src1, (i8 imm:$src2)))]>; + +// Shift by 1 +def SAR8r1 : I<0xD0, MRM7r, (ops GR8 :$dst, GR8 :$src1), + "sar{b} $dst", + [(set GR8:$dst, (sra GR8:$src1, (i8 1)))]>; +def SAR16r1 : I<0xD1, MRM7r, (ops GR16:$dst, GR16:$src1), + "sar{w} $dst", + [(set GR16:$dst, (sra GR16:$src1, (i8 1)))]>, OpSize; +def SAR32r1 : I<0xD1, MRM7r, (ops GR32:$dst, GR32:$src1), + "sar{l} $dst", + [(set GR32:$dst, (sra GR32:$src1, (i8 1)))]>; + let isTwoAddress = 0 in { def SAR8mCL : I<0xD2, MRM7m, (ops i8mem :$dst), "sar{b} {%cl, $dst|$dst, %CL}", @@ -1507,6 +1561,18 @@ def SAR32mi : Ii8<0xC1, MRM7m, (ops i32mem:$dst, i8imm:$src), "sar{l} {$src, $dst|$dst, $src}", [(store (sra (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>; + + // Shift by 1 + def SAR8m1 : I<0xD0, MRM7m, (ops i8mem :$dst), + "sar{b} $dst", + [(store (sra (loadi8 addr:$dst), (i8 1)), addr:$dst)]>; + def SAR16m1 : I<0xD1, MRM7m, (ops i16mem:$dst), + "sar{w} $dst", + [(store (sra (loadi16 addr:$dst), (i8 1)), addr:$dst)]>, + OpSize; + def SAR32m1 : I<0xD1, MRM7m, (ops i32mem:$dst), + "sar{l} $dst", + [(store (sra (loadi32 addr:$dst), (i8 1)), addr:$dst)]>; } // Rotate instructions @@ -1531,6 +1597,17 @@ "rol{l} {$src2, $dst|$dst, $src2}", [(set GR32:$dst, (rotl GR32:$src1, (i8 imm:$src2)))]>; +// Rotate by 1 +def ROL8r1 : I<0xD0, MRM0r, (ops GR8 :$dst, GR8 :$src1), + "rol{b} $dst", + [(set GR8:$dst, (rotl GR8:$src1, (i8 1)))]>; +def ROL16r1 : I<0xD1, MRM0r, (ops GR16:$dst, GR16:$src1), + "rol{w} $dst", + [(set GR16:$dst, (rotl GR16:$src1, (i8 1)))]>, OpSize; +def ROL32r1 : I<0xD1, MRM0r, (ops GR32:$dst, GR32:$src1), + "rol{l} $dst", + [(set GR32:$dst, (rotl GR32:$src1, (i8 1)))]>; + let isTwoAddress = 0 in { def ROL8mCL : I<0xD2, MRM0m, (ops i8mem :$dst), "rol{b} {%cl, $dst|$dst, %CL}", @@ -1554,6 +1631,18 @@ def ROL32mi : Ii8<0xC1, MRM0m, (ops i32mem:$dst, i8imm:$src), "rol{l} {$src, $dst|$dst, $src}", [(store (rotl (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>; + + // Rotate by 1 + def ROL8m1 : I<0xD0, MRM0m, (ops i8mem :$dst), + "rol{b} $dst", + [(store (rotl (loadi8 addr:$dst), (i8 1)), addr:$dst)]>; + def ROL16m1 : I<0xD1, MRM0m, (ops i16mem:$dst), + "rol{w} $dst", + [(store (rotl (loadi16 addr:$dst), (i8 1)), addr:$dst)]>, + OpSize; + def ROL32m1 : I<0xD1, MRM0m, (ops i32mem:$dst), + "rol{l} $dst", + [(store (rotl (loadi32 addr:$dst), (i8 1)), addr:$dst)]>; } def ROR8rCL : I<0xD2, MRM1r, (ops GR8 :$dst, GR8 :$src), @@ -1575,6 +1664,18 @@ def ROR32ri : Ii8<0xC1, MRM1r, (ops GR32:$dst, GR32:$src1, i8imm:$src2), "ror{l} {$src2, $dst|$dst, $src2}", [(set GR32:$dst, (rotr GR32:$src1, (i8 imm:$src2)))]>; + +// Rotate by 1 +def ROR8r1 : I<0xD0, MRM1r, (ops GR8 :$dst, GR8 :$src1), + "ror{b} $dst", + [(set GR8:$dst, (rotr GR8:$src1, (i8 1)))]>; +def ROR16r1 : I<0xD1, MRM1r, (ops GR16:$dst, GR16:$src1), + "ror{w} $dst", + [(set GR16:$dst, (rotr GR16:$src1, (i8 1)))]>, OpSize; +def ROR32r1 : I<0xD1, MRM1r, (ops GR32:$dst, GR32:$src1), + "ror{l} $dst", + [(set GR32:$dst, (rotr GR32:$src1, (i8 1)))]>; + let isTwoAddress = 0 in { def ROR8mCL : I<0xD2, MRM1m, (ops i8mem :$dst), "ror{b} {%cl, $dst|$dst, %CL}", @@ -1598,6 +1699,18 @@ def ROR32mi : Ii8<0xC1, MRM1m, (ops i32mem:$dst, i8imm:$src), "ror{l} {$src, $dst|$dst, $src}", [(store (rotr (loadi32 addr:$dst), (i8 imm:$src)), addr:$dst)]>; + + // Rotate by 1 + def ROR8m1 : I<0xD0, MRM1m, (ops i8mem :$dst), + "ror{b} $dst", + [(store (rotr (loadi8 addr:$dst), (i8 1)), addr:$dst)]>; + def ROR16m1 : I<0xD1, MRM1m, (ops i16mem:$dst), + "ror{w} $dst", + [(store (rotr (loadi16 addr:$dst), (i8 1)), addr:$dst)]>, + OpSize; + def ROR32m1 : I<0xD1, MRM1m, (ops i32mem:$dst), + "ror{l} $dst", + [(store (rotr (loadi32 addr:$dst), (i8 1)), addr:$dst)]>; } Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.158 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.159 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.158 Tue Jun 13 00:14:44 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Jun 28 19:36:51 2006 @@ -288,30 +288,45 @@ case X86::SHL8ri: return MakeMIInst(X86::SHL8mi , FrameIndex, MI); case X86::SHL16ri: return MakeMIInst(X86::SHL16mi, FrameIndex, MI); case X86::SHL32ri: return MakeMIInst(X86::SHL32mi, FrameIndex, MI); + case X86::SHL8r1: return MakeMInst(X86::SHL8m1 , FrameIndex, MI); + case X86::SHL16r1: return MakeMInst(X86::SHL16m1, FrameIndex, MI); + case X86::SHL32r1: return MakeMInst(X86::SHL32m1, FrameIndex, MI); case X86::SHR8rCL: return MakeMInst( X86::SHR8mCL ,FrameIndex, MI); case X86::SHR16rCL: return MakeMInst( X86::SHR16mCL,FrameIndex, MI); case X86::SHR32rCL: return MakeMInst( X86::SHR32mCL,FrameIndex, MI); case X86::SHR8ri: return MakeMIInst(X86::SHR8mi , FrameIndex, MI); case X86::SHR16ri: return MakeMIInst(X86::SHR16mi, FrameIndex, MI); case X86::SHR32ri: return MakeMIInst(X86::SHR32mi, FrameIndex, MI); + case X86::SHR8r1: return MakeMInst(X86::SHR8m1 , FrameIndex, MI); + case X86::SHR16r1: return MakeMInst(X86::SHR16m1, FrameIndex, MI); + case X86::SHR32r1: return MakeMInst(X86::SHR32m1, FrameIndex, MI); case X86::SAR8rCL: return MakeMInst( X86::SAR8mCL ,FrameIndex, MI); case X86::SAR16rCL: return MakeMInst( X86::SAR16mCL,FrameIndex, MI); case X86::SAR32rCL: return MakeMInst( X86::SAR32mCL,FrameIndex, MI); case X86::SAR8ri: return MakeMIInst(X86::SAR8mi , FrameIndex, MI); case X86::SAR16ri: return MakeMIInst(X86::SAR16mi, FrameIndex, MI); case X86::SAR32ri: return MakeMIInst(X86::SAR32mi, FrameIndex, MI); + case X86::SAR8r1: return MakeMInst(X86::SAR8m1 , FrameIndex, MI); + case X86::SAR16r1: return MakeMInst(X86::SAR16m1, FrameIndex, MI); + case X86::SAR32r1: return MakeMInst(X86::SAR32m1, FrameIndex, MI); case X86::ROL8rCL: return MakeMInst( X86::ROL8mCL ,FrameIndex, MI); case X86::ROL16rCL: return MakeMInst( X86::ROL16mCL,FrameIndex, MI); case X86::ROL32rCL: return MakeMInst( X86::ROL32mCL,FrameIndex, MI); case X86::ROL8ri: return MakeMIInst(X86::ROL8mi , FrameIndex, MI); case X86::ROL16ri: return MakeMIInst(X86::ROL16mi, FrameIndex, MI); case X86::ROL32ri: return MakeMIInst(X86::ROL32mi, FrameIndex, MI); + case X86::ROL8r1: return MakeMInst(X86::ROL8m1 , FrameIndex, MI); + case X86::ROL16r1: return MakeMInst(X86::ROL16m1, FrameIndex, MI); + case X86::ROL32r1: return MakeMInst(X86::ROL32m1, FrameIndex, MI); case X86::ROR8rCL: return MakeMInst( X86::ROR8mCL ,FrameIndex, MI); case X86::ROR16rCL: return MakeMInst( X86::ROR16mCL,FrameIndex, MI); case X86::ROR32rCL: return MakeMInst( X86::ROR32mCL,FrameIndex, MI); case X86::ROR8ri: return MakeMIInst(X86::ROR8mi , FrameIndex, MI); case X86::ROR16ri: return MakeMIInst(X86::ROR16mi, FrameIndex, MI); case X86::ROR32ri: return MakeMIInst(X86::ROR32mi, FrameIndex, MI); + case X86::ROR8r1: return MakeMInst(X86::ROR8m1 , FrameIndex, MI); + case X86::ROR16r1: return MakeMInst(X86::ROR16m1, FrameIndex, MI); + case X86::ROR32r1: return MakeMInst(X86::ROR32m1, FrameIndex, MI); case X86::SHLD32rrCL:return MakeMRInst( X86::SHLD32mrCL,FrameIndex, MI); case X86::SHLD32rri8:return MakeMRIInst(X86::SHLD32mri8,FrameIndex, MI); case X86::SHRD32rrCL:return MakeMRInst( X86::SHRD32mrCL,FrameIndex, MI); From evan.cheng at apple.com Wed Jun 28 19:54:49 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 19:54:49 -0500 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200606290054.TAA27690@zion.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.111 -> 1.112 --- Log message: Added -disable-cbe to disable C backend testing. --- Diffs of the changes: (+2 -0) NightlyTest.pl | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.111 llvm/utils/NightlyTest.pl:1.112 --- llvm/utils/NightlyTest.pl:1.111 Tue Jun 27 15:30:28 2006 +++ llvm/utils/NightlyTest.pl Wed Jun 28 19:54:37 2006 @@ -23,6 +23,7 @@ # -enable-llcbeta Enable testing of beta features in llc. # -disable-llc Disable LLC tests in the nightly tester. # -disable-jit Disable JIT tests in the nightly tester. +# -disable-cbe Disable C backend tests in the nightly tester. # -verbose Turn on some debug output # -debug Print information useful only to maintainers of this script. # -nice Checkout/Configure/Build with "nice" to reduce impact @@ -303,6 +304,7 @@ $CONFIGUREARGS .= " --disable-llc_diffs"; next; } if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1"; $CONFIGUREARGS .= " --disable-jit"; next; } + if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; } if (/^-verbose$/) { $VERBOSE = 1; next; } if (/^-debug$/) { $DEBUG = 1; next; } if (/^-nice$/) { $NICE = "nice "; next; } From evan.cheng at apple.com Wed Jun 28 20:48:48 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 28 Jun 2006 20:48:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86JITInfo.cpp Message-ID: <200606290148.UAA28771@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86JITInfo.cpp updated: 1.21 -> 1.22 --- Log message: Let X86CompilationCallback pass previous frame and return address to X86CompilationCallback2. Remove alloca hack. --- Diffs of the changes: (+7 -10) X86JITInfo.cpp | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) Index: llvm/lib/Target/X86/X86JITInfo.cpp diff -u llvm/lib/Target/X86/X86JITInfo.cpp:1.21 llvm/lib/Target/X86/X86JITInfo.cpp:1.22 --- llvm/lib/Target/X86/X86JITInfo.cpp:1.21 Sat Jun 24 03:36:10 2006 +++ llvm/lib/Target/X86/X86JITInfo.cpp Wed Jun 28 20:48:36 2006 @@ -64,6 +64,10 @@ #if defined(__APPLE__) "andl $-16, %esp\n" // Align ESP on 16-byte boundary #endif + "subl $16, %esp\n" + "movl 4(%ebp), %eax\n" // Pass prev frame and return address + "movl %eax, 4(%esp)\n" + "movl %ebp, (%esp)\n" #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) "call _X86CompilationCallback2\n" #else @@ -108,22 +112,15 @@ /// function stub when we did not know the real target of a call. This function /// must locate the start of the stub or call site and pass it into the JIT /// compiler function. -extern "C" void X86CompilationCallback2() { #ifdef _MSC_VER +extern "C" void X86CompilationCallback2() { assert(sizeof(size_t) == 4); // FIXME: handle Win64 unsigned *RetAddrLoc = (unsigned *)_AddressOfReturnAddress(); RetAddrLoc += 3; // skip over ret addr, edx, eax unsigned RetAddr = *RetAddrLoc; #else - unsigned *StackPtr = (unsigned*)__builtin_frame_address(1); - unsigned RetAddr = (unsigned)(intptr_t)__builtin_return_address(1); - unsigned *RetAddrLoc = &StackPtr[1]; - - // NOTE: __builtin_frame_address doesn't work if frame pointer elimination has - // been performed. Having a variable sized alloca disables frame pointer - // elimination currently, even if it's dead. This is a gross hack. - alloca(10+(RetAddr >> 31)); - +extern "C" void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) { + intptr_t *RetAddrLoc = &StackPtr[1]; #endif assert(*RetAddrLoc == RetAddr && "Could not find return address on the stack!"); From resistor at mac.com Wed Jun 28 23:22:12 2006 From: resistor at mac.com (Owen Anderson) Date: Wed, 28 Jun 2006 23:22:12 -0500 Subject: [llvm-commits] CVS: llvm/CREDITS.TXT Message-ID: <200606290422.XAA30880@zion.cs.uiuc.edu> Changes in directory llvm: CREDITS.TXT updated: 1.55 -> 1.56 --- Log message: Describe my newest work. --- Diffs of the changes: (+1 -1) CREDITS.TXT | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/CREDITS.TXT diff -u llvm/CREDITS.TXT:1.55 llvm/CREDITS.TXT:1.56 --- llvm/CREDITS.TXT:1.55 Wed May 31 17:15:45 2006 +++ llvm/CREDITS.TXT Wed Jun 28 23:21:59 2006 @@ -15,7 +15,7 @@ N: Owen Anderson E: resistor at mac.com -D: LCSSA pass, TargetData refactoring, random improvements +D: LCSSA pass and related LoopUnswitch work, TargetData refactoring, random improvements N: Henrik Bach D: MingW Win32 API portability layer From evan.cheng at apple.com Thu Jun 29 13:05:08 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 29 Jun 2006 13:05:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrSSE.td Message-ID: <200606291805.NAA12076@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrSSE.td updated: 1.127 -> 1.128 --- Log message: Should just use xorps to clear XMM registers for all data types. pxor is also one byte longer. --- Diffs of the changes: (+10 -14) X86InstrSSE.td | 24 ++++++++++-------------- 1 files changed, 10 insertions(+), 14 deletions(-) Index: llvm/lib/Target/X86/X86InstrSSE.td diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.127 llvm/lib/Target/X86/X86InstrSSE.td:1.128 --- llvm/lib/Target/X86/X86InstrSSE.td:1.127 Wed Jun 28 19:34:23 2006 +++ llvm/lib/Target/X86/X86InstrSSE.td Thu Jun 29 13:04:54 2006 @@ -2109,15 +2109,9 @@ // Alias instructions that map zero vector to pxor / xorp* for sse. // FIXME: remove when we can teach regalloc that xor reg, reg is ok. -def V_SET0_PI : PDI<0xEF, MRMInitReg, (ops VR128:$dst), - "pxor $dst, $dst", - [(set VR128:$dst, (v2i64 immAllZerosV))]>; -def V_SET0_PS : PSI<0x57, MRMInitReg, (ops VR128:$dst), - "xorps $dst, $dst", - [(set VR128:$dst, (v4f32 immAllZerosV))]>; -def V_SET0_PD : PDI<0x57, MRMInitReg, (ops VR128:$dst), - "xorps $dst, $dst", - [(set VR128:$dst, (v2f64 immAllZerosV))]>; +def V_SET0 : PSI<0x57, MRMInitReg, (ops VR128:$dst), + "xorps $dst, $dst", + [(set VR128:$dst, (v4f32 immAllZerosV))]>; def V_SETALLONES : PDI<0x76, MRMInitReg, (ops VR128:$dst), "pcmpeqd $dst, $dst", @@ -2265,9 +2259,11 @@ def : Pat<(v2i64 (undef)), (IMPLICIT_DEF_VR128)>, Requires<[HasSSE2]>; // 128-bit vector all zero's. -def : Pat<(v16i8 immAllZerosV), (V_SET0_PI)>, Requires<[HasSSE2]>; -def : Pat<(v8i16 immAllZerosV), (V_SET0_PI)>, Requires<[HasSSE2]>; -def : Pat<(v4i32 immAllZerosV), (V_SET0_PI)>, Requires<[HasSSE2]>; +def : Pat<(v16i8 immAllZerosV), (V_SET0)>, Requires<[HasSSE2]>; +def : Pat<(v8i16 immAllZerosV), (V_SET0)>, Requires<[HasSSE2]>; +def : Pat<(v4i32 immAllZerosV), (V_SET0)>, Requires<[HasSSE2]>; +def : Pat<(v2i64 immAllZerosV), (V_SET0)>, Requires<[HasSSE2]>; +def : Pat<(v2f64 immAllZerosV), (V_SET0)>, Requires<[HasSSE2]>; // 128-bit vector all one's. def : Pat<(v16i8 immAllOnesV), (V_SETALLONES)>, Requires<[HasSSE2]>; @@ -2365,10 +2361,10 @@ // Zeroing a VR128 then do a MOVS{S|D} to the lower bits. def : Pat<(v2f64 (vector_shuffle immAllZerosV, (v2f64 (scalar_to_vector FR64:$src)), MOVL_shuffle_mask)), - (MOVLSD2PDrr (V_SET0_PD), FR64:$src)>, Requires<[HasSSE2]>; + (MOVLSD2PDrr (V_SET0), FR64:$src)>, Requires<[HasSSE2]>; def : Pat<(v4f32 (vector_shuffle immAllZerosV, (v4f32 (scalar_to_vector FR32:$src)), MOVL_shuffle_mask)), - (MOVLSS2PSrr (V_SET0_PS), FR32:$src)>, Requires<[HasSSE2]>; + (MOVLSS2PSrr (V_SET0), FR32:$src)>, Requires<[HasSSE2]>; } // Splat v2f64 / v2i64 From lattner at cs.uiuc.edu Thu Jun 29 14:38:17 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 29 Jun 2006 14:38:17 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200606291938.OAA12509@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.383 -> 1.384 --- Log message: Allow specifying an explicit list of architectures to build for, e.g.: make ENABLE_OPTIMIZED=1 UNIVERSAL=1 UNIVERSAL_ARCH="i386 ppc ppc64" retain the default of building for just i386/ppc. --- Diffs of the changes: (+15 -6) Makefile.rules | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.383 llvm/Makefile.rules:1.384 --- llvm/Makefile.rules:1.383 Wed Jun 21 16:01:20 2006 +++ llvm/Makefile.rules Thu Jun 29 14:38:04 2006 @@ -370,13 +370,22 @@ # If we are building a universal binary on Mac OS/X, pass extra options. This # is useful to people that want to link the LLVM libraries into their universal -# apps. The UNIVERSAL_SDK_PATH variable can optionally be specified as a path -# to the SDK to use. For Mac OS/X 10.4 Intel machines, the traditional one is: -# UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/ +# apps. +# +# The following can be optionally specified: +# UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use. +# For Mac OS/X 10.4 Intel machines, the traditional one is: +# UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/ +# UNIVERSAL_ARCH can be optionally specified to be a list of architectures +# to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to +# i386/ppc only. ifdef UNIVERSAL - CompileCommonOpts += -arch i386 -arch ppc - Relink.Flags := -XCClinker -arch -XCClinker i386 -XCClinker -arch \ - -XCClinker ppc + ifndef UNIVERSAL_ARCH + UNIVERSAL_ARCH := i386 ppc + endif + UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %) + CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS) + Relink.Flags := $(UNIVERSAL_ARCH_OPTIONS:%=-XCClinker %) ifdef UNIVERSAL_SDK_PATH CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH) Relink.Flags += -XCClinker -isysroot -XCClinker $(UNIVERSAL_SDK_PATH) From alenhar2 at cs.uiuc.edu Thu Jun 29 16:47:39 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 29 Jun 2006 16:47:39 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp PoolAllocator.h Message-ID: <200606292147.QAA13928@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/runtime/FL2Allocator: PoolAllocator.cpp updated: 1.53 -> 1.54 PoolAllocator.h updated: 1.27 -> 1.28 --- Log message: Add runtime support for an alternate pointer compression runtime --- Diffs of the changes: (+38 -1) PoolAllocator.cpp | 28 +++++++++++++++++++++++++++- PoolAllocator.h | 11 +++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.53 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.54 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.53 Wed Jun 14 16:17:32 2006 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp Thu Jun 29 16:47:25 2006 @@ -889,7 +889,6 @@ // next time. static PoolSlab *Pools[4] = { 0, 0, 0, 0 }; - void *poolinit_pc(PoolTy *Pool, unsigned DeclaredSize, unsigned ObjAlignment) { poolinit_internal(Pool, DeclaredSize, ObjAlignment); @@ -980,6 +979,33 @@ return (char*)Result-(char*)Pool->Slabs; } +// Alternate Pointer Compression +void *poolinit_pca(PoolTy *Pool, unsigned NodeSize, + unsigned ObjAlignment) +{ + return poolinit_pc(Pool, NodeSize, ObjAlignment); +} + +void pooldestroy_pca(PoolTy *Pool) +{ + pooldestroy_pc(Pool); +} + +void* poolalloc_pca(PoolTy *Pool, unsigned NumBytes) +{ + return poolalloc_internal(Pool, NumBytes); +} + +void poolfree_pca(PoolTy *Pool, void* Node) +{ + poolfree_internal(Pool, Node); +} + +void* poolrealloc_pca(PoolTy *Pool, void* Node, + unsigned NumBytes) +{ + return poolrealloc_internal(Pool, Node, NumBytes); +} //===----------------------------------------------------------------------===// // Access Tracing Runtime Library Support Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.27 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.28 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.27 Wed Jun 14 16:17:32 2006 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h Thu Jun 29 16:47:25 2006 @@ -215,6 +215,17 @@ unsigned long long poolrealloc_pc(PoolTy *Pool, unsigned long long Node, unsigned NumBytes); + // Alternate Pointer Compression runtime library. Most of these are just + // wrappers around the normal pool routines. + void *poolinit_pca(PoolTy *Pool, unsigned NodeSize, + unsigned ObjAlignment); + void pooldestroy_pca(PoolTy *Pool); + void* poolalloc_pca(PoolTy *Pool, + unsigned NumBytes); + void poolfree_pca(PoolTy *Pool, void* Node); + void* poolrealloc_pca(PoolTy *Pool, + void* Node, unsigned NumBytes); + // Access tracing runtime library support. void poolaccesstraceinit(void); void poolaccesstrace(void *Ptr, void *PD); From evan.cheng at apple.com Thu Jun 29 18:57:19 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 29 Jun 2006 18:57:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200606292357.SAA17302@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.309 -> 1.310 --- Log message: Ugly hack! Add helper functions InsertInFlightSetEntry and RemoveInFlightSetEntry. They are used in place of direct set operators to reduce instruction selection function stack size. --- Diffs of the changes: (+14 -0) SelectionDAG.cpp | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.309 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.310 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.309 Wed Jun 28 13:29:47 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Jun 29 18:57:05 2006 @@ -3099,3 +3099,17 @@ Map.insert(std::make_pair(SDOperand(Key, KeyResNo), SDOperand(Element, ElementResNo))); } + +/// InsertInFlightSetEntry - A helper function to insert a SDNode* to a +/// SDNode* set. This is added to avoid the set insertion operator from being +/// inlined. +void SelectionDAG::InsertInFlightSetEntry(std::set &Set, SDNode *N) { + Set.insert(N); +} + +/// RemoveInFlightSetEntry - A helper function to remove a SDNode* from a +/// SDNode* set. This is added to avoid the set removal operator from being +/// inlined. +void SelectionDAG::RemoveInFlightSetEntry(std::set &Set, SDNode *N) { + Set.erase(N); +} From evan.cheng at apple.com Thu Jun 29 18:57:19 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 29 Jun 2006 18:57:19 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200606292357.SAA17306@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.216 -> 1.217 --- Log message: Ugly hack! Add helper functions InsertInFlightSetEntry and RemoveInFlightSetEntry. They are used in place of direct set operators to reduce instruction selection function stack size. --- Diffs of the changes: (+8 -4) DAGISelEmitter.cpp | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.216 llvm/utils/TableGen/DAGISelEmitter.cpp:1.217 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.216 Mon Jun 19 19:56:37 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Thu Jun 29 18:57:05 2006 @@ -2450,14 +2450,16 @@ emitCode("if (!Match) {"); for (std::vector::iterator AI = InflightNodes.begin(), AE = InflightNodes.end(); AI != AE; ++AI) - emitCode(" InFlightSet.erase(" + *AI + ".Val);"); + emitCode(" SelectionDAG::RemoveInFlightSetEntry(InFlightSet, " + + *AI + ".Val);"); emitCode("}"); } emitCheck("Match"); for (unsigned i = 0; i < NumRes; ++i) { - emitCode("InFlightSet.insert(CPTmp" + utostr(i+ResNo) + ".Val);"); + emitCode("SelectionDAG::InsertInFlightSetEntry(InFlightSet, CPTmp" + + utostr(i+ResNo) + ".Val);"); InflightNodes.push_back("CPTmp" + utostr(i+ResNo)); } for (unsigned i = 0; i < NumRes; ++i) { @@ -2579,7 +2581,8 @@ assert(!Val.empty() && "Variable referenced but not defined and not caught earlier!"); if (Child->isLeaf() && !NodeGetComplexPattern(Child, ISE)) { - emitCode("InFlightSet.insert(" + Val + ".Val);"); + emitCode("SelectionDAG::InsertInFlightSetEntry(InFlightSet, " + + Val + ".Val);"); InflightNodes.push_back(Val); } } @@ -2616,7 +2619,8 @@ // The operands have been selected. Remove them from InFlightSet. for (std::vector::iterator AI = InflightNodes.begin(), AE = InflightNodes.end(); AI != AE; ++AI) - emitCode("InFlightSet.erase(" + *AI + ".Val);"); + emitCode("SelectionDAG::RemoveInFlightSetEntry(InFlightSet, " + + *AI + ".Val);"); } unsigned NumResults = Inst.getNumResults(); From evan.cheng at apple.com Thu Jun 29 18:57:20 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 29 Jun 2006 18:57:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200606292357.SAA17310@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.101 -> 1.102 --- Log message: Ugly hack! Add helper functions InsertInFlightSetEntry and RemoveInFlightSetEntry. They are used in place of direct set operators to reduce instruction selection function stack size. --- Diffs of the changes: (+12 -1) SelectionDAG.h | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.101 llvm/include/llvm/CodeGen/SelectionDAG.h:1.102 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.101 Sat Apr 22 13:53:45 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Thu Jun 29 18:57:05 2006 @@ -18,8 +18,9 @@ #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/ADT/ilist" -#include #include +#include +#include #include namespace llvm { @@ -429,6 +430,16 @@ static void InsertISelMapEntry(std::map &Map, SDNode *Key, unsigned KeyResNo, SDNode *Element, unsigned ElementResNo); + + /// InsertInFlightSetEntry - A helper function to insert a SDNode* to a + /// SDNode* set. This is added to avoid the set insertion operator from being + /// inlined. + static void InsertInFlightSetEntry(std::set &Set, SDNode *N); + + /// RemoveInFlightSetEntry - A helper function to remove a SDNode* from a + /// SDNode* set. This is added to avoid the set removal operator from being + /// inlined. + static void RemoveInFlightSetEntry(std::set &Set, SDNode *N); private: void RemoveNodeFromCSEMaps(SDNode *N); From brukman at cs.uiuc.edu Fri Jun 30 10:16:09 2006 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri, 30 Jun 2006 10:16:09 -0500 Subject: [llvm-commits] CVS: llvm-www/releases/download.html Message-ID: <200606301516.KAA02186@zion.cs.uiuc.edu> Changes in directory llvm-www/releases: download.html updated: 1.30 -> 1.31 --- Log message: Line up
  • tags. --- Diffs of the changes: (+10 -10) download.html | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm-www/releases/download.html diff -u llvm-www/releases/download.html:1.30 llvm-www/releases/download.html:1.31 --- llvm-www/releases/download.html:1.30 Thu Apr 20 02:16:21 2006 +++ llvm-www/releases/download.html Fri Jun 30 10:15:42 2006 @@ -76,9 +76,9 @@ downloading:

  • + Accompanying Technical Report + of our PLDI Submission: Enforcing Alias Analysis for Weakly Typed Languages. +