From gohman at apple.com Mon Mar 23 00:02:45 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 05:02:45 -0000 Subject: [llvm-commits] [llvm] r67507 - /llvm/trunk/lib/Target/X86/X86CallingConv.td Message-ID: <200903230502.n2N52jEd002279@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 00:02:44 2009 New Revision: 67507 URL: http://llvm.org/viewvc/llvm-project?rev=67507&view=rev Log: Fix a grammaro in a comment that Bill noticed. Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=67507&r1=67506&r2=67507&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CallingConv.td (original) +++ llvm/trunk/lib/Target/X86/X86CallingConv.td Mon Mar 23 00:02:44 2009 @@ -24,7 +24,7 @@ def RetCC_X86Common : CallingConv<[ // Scalar values are returned in AX first, then DX, except for i8 where // the convention is to return values in AL and AH. However, using AL and - // is AH problematic -- a return of {i16,i8} would end up using AX and AH, + // AH is problematic -- a return of {i16,i8} would end up using AX and AH, // and one value would clobber the other. C front-ends are currently expected // to pack two i8 values into an i16 in the rare situations where this // is necessary. From sabre at nondot.org Mon Mar 23 00:42:29 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 23 Mar 2009 05:42:29 -0000 Subject: [llvm-commits] [llvm] r67508 - /llvm/trunk/lib/System/Unix/Signals.inc Message-ID: <200903230542.n2N5gTsR003736@zion.cs.uiuc.edu> Author: lattner Date: Mon Mar 23 00:42:29 2009 New Revision: 67508 URL: http://llvm.org/viewvc/llvm-project?rev=67508&view=rev Log: factorize signal registration, part of PR3848. Modified: llvm/trunk/lib/System/Unix/Signals.inc Modified: llvm/trunk/lib/System/Unix/Signals.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=67508&r1=67507&r2=67508&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Signals.inc (original) +++ llvm/trunk/lib/System/Unix/Signals.inc Mon Mar 23 00:42:29 2009 @@ -31,6 +31,8 @@ #endif using namespace llvm; +static RETSIGTYPE SignalHandler(int Sig); // defined below. + /// InterruptFunction - The function to call if ctrl-c is pressed. static void (*InterruptFunction)() = 0; @@ -55,18 +57,34 @@ static const int *const KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]); +// Just call signal +static void RegisterHandler(int Signal) { + signal(Signal, SignalHandler); +} + +static void RegisterHandlers() { + std::for_each(IntSigs, IntSigsEnd, RegisterHandler); + std::for_each(KillSigs, KillSigsEnd, RegisterHandler); +} + static void UnregisterHandler(int Signal) { - signal(Signal, SIG_DFL); + signal(Signal, SIG_DFL); +} + +static void UnregisterHandlers() { + std::for_each(KillSigs, KillSigsEnd, UnregisterHandler); + std::for_each(IntSigs, IntSigsEnd, UnregisterHandler); } + // SignalHandler - The signal handler that runs. static RETSIGTYPE SignalHandler(int Sig) { // Restore the signal behavior to default, so that the program actually // crashes when we return and the signal reissues. This also ensures that if // we crash in our signal handler that the program will terminate immediately // instead of recursing in the signal handler. - std::for_each(KillSigs, KillSigsEnd, UnregisterHandler); + UnregisterHandlers(); // Unmask all potentially blocked kill signals. sigset_t SigMask; @@ -95,15 +113,11 @@ (*CallBacksToRun)[i].first((*CallBacksToRun)[i].second); } -// Just call signal -static void RegisterHandler(int Signal) { - signal(Signal, SignalHandler); -} void llvm::sys::SetInterruptFunction(void (*IF)()) { InterruptFunction = IF; - RegisterHandler(SIGINT); + RegisterHandlers(); } // RemoveFileOnSignal - The public API @@ -114,8 +128,7 @@ FilesToRemove->push_back(Filename); - std::for_each(IntSigs, IntSigsEnd, RegisterHandler); - std::for_each(KillSigs, KillSigsEnd, RegisterHandler); + RegisterHandlers(); return false; } @@ -126,7 +139,7 @@ if (CallBacksToRun == 0) CallBacksToRun = new std::vector >(); CallBacksToRun->push_back(std::make_pair(FnPtr, Cookie)); - std::for_each(KillSigs, KillSigsEnd, RegisterHandler); + RegisterHandlers(); } From sabre at nondot.org Mon Mar 23 00:55:36 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 23 Mar 2009 05:55:36 -0000 Subject: [llvm-commits] [llvm] r67509 - /llvm/trunk/lib/System/Unix/Signals.inc Message-ID: <200903230555.n2N5taN2004277@zion.cs.uiuc.edu> Author: lattner Date: Mon Mar 23 00:55:36 2009 New Revision: 67509 URL: http://llvm.org/viewvc/llvm-project?rev=67509&view=rev Log: When we restore signal handlers, restore them back to what they were when we came around, not to their default handler. This should fix PR3848 Modified: llvm/trunk/lib/System/Unix/Signals.inc Modified: llvm/trunk/lib/System/Unix/Signals.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=67509&r1=67508&r2=67509&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Signals.inc (original) +++ llvm/trunk/lib/System/Unix/Signals.inc Mon Mar 23 00:55:36 2009 @@ -57,23 +57,45 @@ static const int *const KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]); -// Just call signal +static unsigned NumRegisteredSignals = 0; +static struct { + struct sigaction SA; + int SigNo; +} RegisteredSignalInfo[(sizeof(IntSigs)+sizeof(KillSigs))/sizeof(KillSigs[0])]; + + static void RegisterHandler(int Signal) { - signal(Signal, SignalHandler); + assert(NumRegisteredSignals < + sizeof(RegisteredSignalInfo)/sizeof(RegisteredSignalInfo[0]) && + "Out of space for signal handlers!"); + + struct sigaction NewHandler; + + NewHandler.sa_handler = SignalHandler; + NewHandler.sa_flags = SA_NODEFER|SA_RESETHAND; + sigemptyset(&NewHandler.sa_mask); + + // Install the new handler, save the old one in RegisteredSignalInfo. + sigaction(Signal, &NewHandler, + &RegisteredSignalInfo[NumRegisteredSignals].SA); + RegisteredSignalInfo[NumRegisteredSignals].SigNo = Signal; + ++NumRegisteredSignals; } static void RegisterHandlers() { + // If the handlers are already registered, we're done. + if (NumRegisteredSignals != 0) return; + std::for_each(IntSigs, IntSigsEnd, RegisterHandler); std::for_each(KillSigs, KillSigsEnd, RegisterHandler); } -static void UnregisterHandler(int Signal) { - signal(Signal, SIG_DFL); -} - static void UnregisterHandlers() { - std::for_each(KillSigs, KillSigsEnd, UnregisterHandler); - std::for_each(IntSigs, IntSigsEnd, UnregisterHandler); + // Restore all of the signal handlers to how they were before we showed up. + for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i) + sigaction(RegisteredSignalInfo[NumRegisteredSignals].SigNo, + &RegisteredSignalInfo[NumRegisteredSignals].SA, 0); + NumRegisteredSignals = 0; } From sabre at nondot.org Mon Mar 23 01:46:20 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 23 Mar 2009 06:46:20 -0000 Subject: [llvm-commits] [llvm] r67510 - /llvm/trunk/lib/System/Unix/Signals.inc Message-ID: <200903230646.n2N6kKVH006734@zion.cs.uiuc.edu> Author: lattner Date: Mon Mar 23 01:46:20 2009 New Revision: 67510 URL: http://llvm.org/viewvc/llvm-project?rev=67510&view=rev Log: fix a bug Alexei Svitkine pointed out. Modified: llvm/trunk/lib/System/Unix/Signals.inc Modified: llvm/trunk/lib/System/Unix/Signals.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=67510&r1=67509&r2=67510&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Signals.inc (original) +++ llvm/trunk/lib/System/Unix/Signals.inc Mon Mar 23 01:46:20 2009 @@ -93,8 +93,8 @@ static void UnregisterHandlers() { // Restore all of the signal handlers to how they were before we showed up. for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i) - sigaction(RegisteredSignalInfo[NumRegisteredSignals].SigNo, - &RegisteredSignalInfo[NumRegisteredSignals].SA, 0); + sigaction(RegisteredSignalInfo[i].SigNo, + &RegisteredSignalInfo[i].SA, 0); NumRegisteredSignals = 0; } From evan.cheng at apple.com Mon Mar 23 02:19:59 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 23 Mar 2009 07:19:59 -0000 Subject: [llvm-commits] [llvm] r67511 - in /llvm/trunk: lib/CodeGen/LowerSubregs.cpp test/CodeGen/X86/subreg-to-reg-2.ll Message-ID: <200903230719.n2N7JxOV008145@zion.cs.uiuc.edu> Author: evancheng Date: Mon Mar 23 02:19:58 2009 New Revision: 67511 URL: http://llvm.org/viewvc/llvm-project?rev=67511&view=rev Log: Do not fold away subreg_to_reg if the source register has a sub-register index. That means the source register is taking a sub-register of a larger register. e.g. On x86 %RAX = ... %RAX = SUBREG_TO_REG 0, %EAX:3, 3 The first def is defining RAX, not EAX so the top bits were not zero-extended. Added: llvm/trunk/test/CodeGen/X86/subreg-to-reg-2.ll Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=67511&r1=67510&r2=67511&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Mon Mar 23 02:19:58 2009 @@ -165,11 +165,12 @@ unsigned DstReg = MI->getOperand(0).getReg(); unsigned InsReg = MI->getOperand(2).getReg(); - unsigned SubIdx = MI->getOperand(3).getImm(); + unsigned InsSIdx = MI->getOperand(2).getSubReg(); + unsigned SubIdx = MI->getOperand(3).getImm(); assert(SubIdx != 0 && "Invalid index for insert_subreg"); unsigned DstSubReg = TRI.getSubReg(DstReg, SubIdx); - + assert(TargetRegisterInfo::isPhysicalRegister(DstReg) && "Insert destination must be in a physical register"); assert(TargetRegisterInfo::isPhysicalRegister(InsReg) && @@ -177,8 +178,13 @@ DOUT << "subreg: CONVERTING: " << *MI; - if (DstSubReg == InsReg) { + if (DstSubReg == InsReg && InsSIdx == 0) { // No need to insert an identify copy instruction. + // Watch out for case like this: + // %RAX = ... + // %RAX = SUBREG_TO_REG 0, %EAX:3, 3 + // The first def is defining RAX, not EAX so the top bits were not + // zero extended. DOUT << "subreg: eliminated!"; } else { // Insert sub-register copy Added: llvm/trunk/test/CodeGen/X86/subreg-to-reg-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/subreg-to-reg-2.ll?rev=67511&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/subreg-to-reg-2.ll (added) +++ llvm/trunk/test/CodeGen/X86/subreg-to-reg-2.ll Mon Mar 23 02:19:58 2009 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl +; rdar://6707985 + + %XXOO = type { %"struct.XXC::XXCC", i8*, %"struct.XXC::XXOO::$_71" } + %XXValue = type opaque + %"struct.XXC::ArrayStorage" = type { i32, i32, i32, i8*, i8*, [1 x %XXValue*] } + %"struct.XXC::XXArray" = type { %XXOO, i32, %"struct.XXC::ArrayStorage"* } + %"struct.XXC::XXCC" = type { i32 (...)**, i8* } + %"struct.XXC::XXOO::$_71" = type { [2 x %XXValue*] } + +define internal fastcc %XXValue* @t(i64* %out, %"struct.XXC::ArrayStorage"* %tmp9) nounwind { +prologue: + %array = load %XXValue** inttoptr (i64 11111111 to %XXValue**) ; <%XXValue*> [#uses=0] + %index = load %XXValue** inttoptr (i64 22222222 to %XXValue**) ; <%XXValue*> [#uses=1] + %tmp = ptrtoint %XXValue* %index to i64 ; [#uses=2] + store i64 %tmp, i64* %out + %tmp6 = trunc i64 %tmp to i32 ; [#uses=1] + br label %bb5 + +bb5: ; preds = %prologue + %tmp10 = zext i32 %tmp6 to i64 ; [#uses=1] + %tmp11 = getelementptr %"struct.XXC::ArrayStorage"* %tmp9, i64 0, i32 5, i64 %tmp10 ; <%XXValue**> [#uses=1] + %tmp12 = load %XXValue** %tmp11, align 8 ; <%XXValue*> [#uses=1] + ret %XXValue* %tmp12 +} From evan.cheng at apple.com Mon Mar 23 03:01:16 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 23 Mar 2009 08:01:16 -0000 Subject: [llvm-commits] [llvm] r67512 - in /llvm/trunk: include/llvm/InlineAsm.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/MachineInstr.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp lib/CodeGen/TwoAddressInstructionPass.cpp lib/Target/X86/X86FloatingPoint.cpp test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll test/CodeGen/X86/2008-09-18-inline-asm-2.ll test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll test/CodeGen/X86/inline-asm-2addr.ll Message-ID: <200903230801.n2N81Huw016210@zion.cs.uiuc.edu> Author: evancheng Date: Mon Mar 23 03:01:15 2009 New Revision: 67512 URL: http://llvm.org/viewvc/llvm-project?rev=67512&view=rev Log: Model inline asm constraint which ties an input to an output register as machine operand TIED_TO constraint. This eliminated the need to pre-allocate registers for these. This also allows register allocator can eliminate the unneeded copies. Added: llvm/trunk/test/CodeGen/X86/inline-asm-2addr.ll Modified: llvm/trunk/include/llvm/InlineAsm.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/MachineInstr.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll llvm/trunk/test/CodeGen/X86/2008-09-18-inline-asm-2.ll llvm/trunk/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll Modified: llvm/trunk/include/llvm/InlineAsm.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InlineAsm.h?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/include/llvm/InlineAsm.h (original) +++ llvm/trunk/include/llvm/InlineAsm.h Mon Mar 23 03:01:15 2009 @@ -135,14 +135,13 @@ return (Flag & 0xffff) >> 3; } - /// isOutputOperandTiedToUse - Return true if the flag of the inline asm - /// operand indicates it is an output that's matched to an input operand. - static bool isOutputOperandTiedToUse(unsigned Flag, unsigned &UseIdx) { - if (Flag & 0x80000000) { - UseIdx = Flag >> 16; - return true; - } - return false; + /// isUseOperandTiedToDef - Return true if the flag of the inline asm + /// operand indicates it is an use operand that's matched to a def operand. + static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) { + if ((Flag & 0x80000000) == 0) + return false; + Idx = (Flag & ~0x80000000) >> 16; + return true; } Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Mar 23 03:01:15 2009 @@ -477,8 +477,8 @@ assert(interval.containsOneValue()); unsigned DefIndex = getDefIndex(interval.getValNumInfo(0)->def); unsigned RedefIndex = getDefIndex(MIIdx); - // It cannot be an early clobber MO. - assert(!MO.isEarlyClobber() && "Unexpected early clobber!"); + if (MO.isEarlyClobber()) + RedefIndex = getUseIndex(MIIdx); const LiveRange *OldLR = interval.getLiveRangeContaining(RedefIndex-1); VNInfo *OldValNo = OldLR->valno; @@ -499,6 +499,8 @@ // Value#0 is now defined by the 2-addr instruction. OldValNo->def = RedefIndex; OldValNo->copy = 0; + if (MO.isEarlyClobber()) + OldValNo->redefByEC = true; // Add the new live interval which replaces the range for the input copy. LiveRange LR(DefIndex, RedefIndex, ValNo); @@ -546,8 +548,8 @@ // live until the end of the block. We've already taken care of the // rest of the live range. unsigned defIndex = getDefIndex(MIIdx); - // It cannot be an early clobber MO. - assert(!MO.isEarlyClobber() && "Unexpected early clobber!"); + if (MO.isEarlyClobber()) + defIndex = getUseIndex(MIIdx); VNInfo *ValNo; MachineInstr *CopyMI = NULL; Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Mar 23 03:01:15 2009 @@ -11,8 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/Constants.h" +#include "llvm/InlineAsm.h" #include "llvm/Value.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -692,6 +693,35 @@ /// isRegReDefinedByTwoAddr - Given the index of a register operand, /// check if the register def is a re-definition due to two addr elimination. bool MachineInstr::isRegReDefinedByTwoAddr(unsigned DefIdx) const{ + if (getOpcode() == TargetInstrInfo::INLINEASM) { + assert(DefIdx >= 2); + const MachineOperand &MO = getOperand(DefIdx); + if (!MO.isReg() || !MO.isDef()) + return false; + // Determine the actual operand no corresponding to this index. + unsigned DefNo = 0; + for (unsigned i = 1, e = getNumOperands(); i < e; ) { + const MachineOperand &FMO = getOperand(i); + assert(FMO.isImm()); + // Skip over this def. + i += InlineAsm::getNumOperandRegisters(FMO.getImm()) + 1; + if (i > DefIdx) + break; + ++DefNo; + } + for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { + const MachineOperand &FMO = getOperand(i); + if (!FMO.isImm()) + continue; + if (i+1 >= e || !getOperand(i+1).isReg() || !getOperand(i+1).isUse()) + continue; + unsigned Idx; + if (InlineAsm::isUseOperandTiedToDef(FMO.getImm(), Idx) && + Idx == DefNo) + return true; + } + } + assert(getOperand(DefIdx).isDef() && "DefIdx is not a def!"); const TargetInstrDesc &TID = getDesc(); for (unsigned i = 0, e = TID.getNumOperands(); i != e; ++i) { @@ -707,6 +737,35 @@ /// is a register use and it is tied to an def operand. It also returns the def /// operand index by reference. bool MachineInstr::isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx){ + if (getOpcode() == TargetInstrInfo::INLINEASM) { + const MachineOperand &MO = getOperand(UseOpIdx); + if (!MO.isReg() || !MO.isUse()) + return false; + assert(UseOpIdx > 0); + const MachineOperand &UFMO = getOperand(UseOpIdx-1); + if (!UFMO.isImm()) + return false; // Must be physreg uses. + unsigned DefNo; + if (InlineAsm::isUseOperandTiedToDef(UFMO.getImm(), DefNo)) { + if (!DefOpIdx) + return true; + + unsigned DefIdx = 1; + // Remember to adjust the index. First operand is asm string, then there + // is a flag for each. + while (DefNo) { + const MachineOperand &FMO = getOperand(DefIdx); + assert(FMO.isImm()); + // Skip over this def. + DefIdx += InlineAsm::getNumOperandRegisters(FMO.getImm()) + 1; + --DefNo; + } + *DefOpIdx = DefIdx+1; + return true; + } + return false; + } + const TargetInstrDesc &TID = getDesc(); if (UseOpIdx >= TID.getNumOperands()) return false; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Mar 23 03:01:15 2009 @@ -4932,28 +4932,17 @@ std::vector RegClassRegs; const TargetRegisterClass *RC = PhysReg.second; if (RC) { - // If this is a tied register, our regalloc doesn't know how to maintain - // the constraint, so we have to pick a register to pin the input/output to. - // If it isn't a matched constraint, go ahead and create vreg and let the - // regalloc do its thing. - if (!OpInfo.hasMatchingInput()) { - RegVT = *PhysReg.second->vt_begin(); - if (OpInfo.ConstraintVT == MVT::Other) - ValueVT = RegVT; - - // Create the appropriate number of virtual registers. - MachineRegisterInfo &RegInfo = MF.getRegInfo(); - for (; NumRegs; --NumRegs) - Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second)); - - OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); - return; - } - - // Otherwise, we can't allocate it. Let the code below figure out how to - // maintain these constraints. - RegClassRegs.assign(PhysReg.second->begin(), PhysReg.second->end()); + RegVT = *PhysReg.second->vt_begin(); + if (OpInfo.ConstraintVT == MVT::Other) + ValueVT = RegVT; + + // Create the appropriate number of virtual registers. + MachineRegisterInfo &RegInfo = MF.getRegInfo(); + for (; NumRegs; --NumRegs) + Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second)); + OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); + return; } else { // This is a reference to a register class that doesn't directly correspond // to an LLVM register class. Allocate NumRegs consecutive, available, @@ -5237,8 +5226,8 @@ OpInfo.AssignedRegs.AddInlineAsmOperands(OpInfo.isEarlyClobber ? 6 /* EARLYCLOBBER REGDEF */ : 2 /* REGDEF */ , - OpInfo.hasMatchingInput(), - OpInfo.MatchingInput, + false, + 0, DAG, AsmNodeOperands); break; } @@ -5272,18 +5261,19 @@ RegsForValue MatchedRegs; MatchedRegs.TLI = &TLI; MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType()); - MatchedRegs.RegVTs.push_back(AsmNodeOperands[CurOp+1].getValueType()); + MVT RegVT = AsmNodeOperands[CurOp+1].getValueType(); + MatchedRegs.RegVTs.push_back(RegVT); + MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo(); for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag); - i != e; ++i) { - unsigned Reg = - cast(AsmNodeOperands[++CurOp])->getReg(); - MatchedRegs.Regs.push_back(Reg); - } + i != e; ++i) + MatchedRegs.Regs. + push_back(RegInfo.createVirtualRegister(TLI.getRegClassFor(RegVT))); // Use the produced MatchedRegs object to MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(), Chain, &Flag); - MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, false, 0, + MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, + true, OpInfo.getMatchedOperand(), DAG, AsmNodeOperands); break; } else { @@ -5291,6 +5281,8 @@ assert((InlineAsm::getNumOperandRegisters(OpFlag)) == 1 && "Unexpected number of operands"); // Add information to the INLINEASM node to know about this input. + // See InlineAsm.h isUseOperandTiedToDef. + OpFlag |= 0x80000000 | (OpInfo.getMatchedOperand() << 16); AsmNodeOperands.push_back(DAG.getTargetConstant(OpFlag, TLI.getPointerTy())); AsmNodeOperands.push_back(AsmNodeOperands[CurOp+1]); Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Mar 23 03:01:15 2009 @@ -634,7 +634,9 @@ ProcessCopy(&*mi, &*mbbi, Processed); - for (unsigned si = 1, e = TID.getNumOperands(); si < e; ++si) { + unsigned NumOps = (mi->getOpcode() == TargetInstrInfo::INLINEASM) + ? mi->getNumOperands() : TID.getNumOperands(); + for (unsigned si = 0; si < NumOps; ++si) { unsigned ti = 0; if (!mi->isRegTiedToDefOperand(si, &ti)) continue; @@ -660,8 +662,7 @@ unsigned regA = mi->getOperand(ti).getReg(); unsigned regB = mi->getOperand(si).getReg(); - assert(TargetRegisterInfo::isVirtualRegister(regA) && - TargetRegisterInfo::isVirtualRegister(regB) && + assert(TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"); #ifndef NDEBUG @@ -753,7 +754,7 @@ } InstructionRearranged: - const TargetRegisterClass* rc = MRI->getRegClass(regA); + const TargetRegisterClass* rc = MRI->getRegClass(regB); MachineInstr *DefMI = MRI->getVRegDef(regB); // If it's safe and profitable, remat the definition instead of // copying it. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Mon Mar 23 03:01:15 2009 @@ -1017,9 +1017,37 @@ case X86::MOV_Fp8032: case X86::MOV_Fp8064: case X86::MOV_Fp8080: { - unsigned SrcReg = getFPReg(MI->getOperand(1)); - unsigned DestReg = getFPReg(MI->getOperand(0)); + const MachineOperand &MO1 = MI->getOperand(1); + unsigned SrcReg = getFPReg(MO1); + const MachineOperand &MO0 = MI->getOperand(0); + // These can be created due to inline asm. Two address pass can introduce + // copies from RFP registers to virtual registers. + if (MO0.getReg() == X86::ST0 && SrcReg == 0) { + assert(MO1.isKill()); + // Treat %ST0 = MOV_Fp8080 %FP0 + // like FpSET_ST0_80 %FP0, %ST0 + assert((StackTop == 1 || StackTop == 2) + && "Stack should have one or two element on it to return!"); + --StackTop; // "Forget" we have something on the top of stack! + break; + } else if (MO0.getReg() == X86::ST1 && SrcReg == 1) { + assert(MO1.isKill()); + // Treat %ST1 = MOV_Fp8080 %FP1 + // like FpSET_ST1_80 %FP0, %ST1 + // StackTop can be 1 if a FpSET_ST0_* was before this. Exchange them. + if (StackTop == 1) { + BuildMI(*MBB, I, dl, TII->get(X86::XCH_F)).addReg(X86::ST1); + NumFXCH++; + StackTop = 0; + break; + } + assert(StackTop == 2 && "Stack should have two element on it to return!"); + --StackTop; // "Forget" we have something on the top of stack! + break; + } + + unsigned DestReg = getFPReg(MO0); if (MI->killsRegister(X86::FP0+SrcReg)) { // If the input operand is killed, we can just change the owner of the // incoming stack slot into the result. Modified: llvm/trunk/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll Mon Mar 23 03:01:15 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc | grep {a: %ecx %ecx} -; RUN: llvm-as < %s | llc | grep {b: %ecx %edx %ecx} +; RUN: llvm-as < %s | llc | grep {a:} | not grep ax +; RUN: llvm-as < %s | llc | grep {b:} | not grep ax ; PR2078 ; The clobber list says that "ax" is clobbered. Make sure that eax isn't ; allocated to the input/output register. Modified: llvm/trunk/test/CodeGen/X86/2008-09-18-inline-asm-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-09-18-inline-asm-2.ll?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-09-18-inline-asm-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-09-18-inline-asm-2.ll Mon Mar 23 03:01:15 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep "#%ebp %eax %edx 8(%esi) %ebx (%edi)" -; RUN: llvm-as < %s | llc -march=x86 -regalloc=local | grep "#%ecx %eax %edx 8(%edi) %ebx (%esi)" +; RUN: llvm-as < %s | llc -march=x86 | grep "#%ebp %edi %esi 8(%edx) %eax (%ebx)" +; RUN: llvm-as < %s | llc -march=x86 -regalloc=local | grep "#%edi %edx %ebp 8(%ebx) %eax (%esi)" ; The 1st, 2nd, 3rd and 5th registers above must all be different. The registers ; referenced in the 4th and 6th operands must not be the same as the 1st or 5th ; operand. There are many combinations that work; this is what llc puts out now. Modified: llvm/trunk/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll?rev=67512&r1=67511&r2=67512&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll Mon Mar 23 03:01:15 2009 @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | %prcontext End 1 | grep {movl.*%ecx} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | %prcontext End 2 | grep mov ; PR3149 +; Make sure the copy after inline asm is not coalesced away. @"\01LC" = internal constant [7 x i8] c"n0=%d\0A\00" ; <[7 x i8]*> [#uses=1] @llvm.used = appending global [1 x i8*] [ i8* bitcast (i32 (i64, i64)* @umoddi3 to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] Added: llvm/trunk/test/CodeGen/X86/inline-asm-2addr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/inline-asm-2addr.ll?rev=67512&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/inline-asm-2addr.ll (added) +++ llvm/trunk/test/CodeGen/X86/inline-asm-2addr.ll Mon Mar 23 03:01:15 2009 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep movq | count 1 + +define i64 @t(i64 %a, i64 %b) nounwind ssp { +entry: + %asmtmp = tail call i64 asm "rorq $1,$0", "=r,J,0,~{dirflag},~{fpsr},~{flags},~{cc}"(i32 1, i64 %a) nounwind ; [#uses=1] + %asmtmp1 = tail call i64 asm "rorq $1,$0", "=r,J,0,~{dirflag},~{fpsr},~{flags},~{cc}"(i32 1, i64 %b) nounwind ; [#uses=1] + %0 = add i64 %asmtmp1, %asmtmp ; [#uses=1] + ret i64 %0 +} From fvbommel at wxs.nl Mon Mar 23 05:07:19 2009 From: fvbommel at wxs.nl (Frits van Bommel) Date: Mon, 23 Mar 2009 11:07:19 +0100 Subject: [llvm-commits] [llvm] r67502 - /llvm/trunk/lib/Target/X86/X86CallingConv.td In-Reply-To: <200903230428.n2N4SOp2000430@zion.cs.uiuc.edu> References: <200903230428.n2N4SOp2000430@zion.cs.uiuc.edu> Message-ID: <49C75F57.404@wxs.nl> Dan Gohman wrote: > // Return-value conventions common to all X86 CC's. > def RetCC_X86Common : CallingConv<[ > - // Scalar values are returned in AX first, then DX. > + // Scalar values are returned in AX first, then DX, except for i8 where > + // the convention is to return values in AL and AH. However, using AL and > + // is AH problematic -- a return of {i16,i8} would end up using AX and AH, > + // and one value would clobber the other. C front-ends are currently expected > + // to pack two i8 values into an i16 in the rare situations where this > + // is necessary. > CCIfType<[i8] , CCAssignToReg<[AL]>>, > CCIfType<[i16], CCAssignToReg<[AX, DX]>>, > CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>, Is this "convention" documented anywhere? I looked at the ABI documents I have (System V i386 abi and the AMD64 abi), and the first makes no mention that I can find of returning multiple integers in registers while the second explicitly says the second integer part of a struct, when returning it in registers, is to be returned in %rdx... Is there any reason you can't just use DL as the second i8 register? (even if only for fastcc?) In my case, packing two i8 values into an i16 isn't a solution since the first value might be an i16/i32/i64 (on x86-64). On a related topic, is there any way for a frontend to determine whether or not the backend will abort() if it tries to generate code for returning a given struct type in registers? (assuming it has pointers to the relevant TargetData and TargetMachine) From baldrick at free.fr Mon Mar 23 05:54:40 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 23 Mar 2009 10:54:40 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67516 - in /llvm-gcc-4.2/trunk/gcc/config: i386/linux.h i386/linux64.h rs6000/sysv4.h Message-ID: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> Author: baldrick Date: Mon Mar 23 05:54:30 2009 New Revision: 67516 URL: http://llvm.org/viewvc/llvm-project?rev=67516&view=rev Log: Revert commit 67369: older versions of ld do not support the --hash-style option, for example GNU ld version 2.17 Debian GNU/Linux which is in use on a couple of nightly testers. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux.h llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/linux.h?rev=67516&r1=67515&r2=67516&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/linux.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/linux.h Mon Mar 23 05:54:30 2009 @@ -109,8 +109,7 @@ { "dynamic_linker", LINUX_DYNAMIC_LINKER } #undef LINK_SPEC -/* LLVM LOCAL set linker hash_style */ -#define LINK_SPEC "-m %(link_emulation) --hash-style=both %{shared:-shared} \ +#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ %{!shared: \ %{!ibcs: \ %{!static: \ Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h?rev=67516&r1=67515&r2=67516&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h Mon Mar 23 05:54:30 2009 @@ -53,8 +53,7 @@ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" #undef LINK_SPEC -/* LLVM LOCAL set linker hash_style */ -#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} --hash-style=both \ +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ %{shared:-shared} \ %{!shared: \ %{!static: \ Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h?rev=67516&r1=67515&r2=67516&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h Mon Mar 23 05:54:30 2009 @@ -910,9 +910,8 @@ #define LINUX_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) -/* LLVM LOCAL set linker hash_style */ -#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=both %{!shared: \ - %{!static: %{rdynamic:-export-dynamic} \ +#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" #if defined(HAVE_LD_EH_FRAME_HDR) From gohman at apple.com Mon Mar 23 10:40:12 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 15:40:12 -0000 Subject: [llvm-commits] [llvm] r67518 - /llvm/trunk/lib/Target/X86/X86ISelLowering.h Message-ID: <200903231540.n2NFeDkC013670@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 10:40:10 2009 New Revision: 67518 URL: http://llvm.org/viewvc/llvm-project?rev=67518&view=rev Log: Correct some comments. Operand numbers start at 0. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=67518&r1=67517&r2=67518&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Mar 23 10:40:10 2009 @@ -118,7 +118,7 @@ /// X86 bit-test instructions. BT, - /// X86 SetCC. Operand 1 is condition code, and operand 2 is the flag + /// X86 SetCC. Operand 0 is condition code, and operand 1 is the flag /// operand produced by a CMP instruction. SETCC, @@ -128,14 +128,14 @@ /// flag result. CMOV, - /// X86 conditional branches. Operand 1 is the chain operand, operand 2 - /// is the block to branch if condition is true, operand 3 is the - /// condition code, and operand 4 is the flag operand produced by a CMP + /// X86 conditional branches. Operand 0 is the chain operand, operand 1 + /// is the block to branch if condition is true, operand 2 is the + /// condition code, and operand 3 is the flag operand produced by a CMP /// or TEST instruction. BRCOND, - /// Return with a flag operand. Operand 1 is the chain operand, operand - /// 2 is the number of bytes of stack to pop. + /// Return with a flag operand. Operand 0 is the chain operand, operand + /// 1 is the number of bytes of stack to pop. RET_FLAG, /// REP_STOS - Repeat fill, corresponds to X86::REP_STOSx. From kremenek at apple.com Mon Mar 23 10:46:22 2009 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 23 Mar 2009 15:46:22 -0000 Subject: [llvm-commits] [llvm] r67520 - /llvm/tags/checker/checker-0.179/ Message-ID: <200903231546.n2NFkNqf014095@zion.cs.uiuc.edu> Author: kremenek Date: Mon Mar 23 10:46:16 2009 New Revision: 67520 URL: http://llvm.org/viewvc/llvm-project?rev=67520&view=rev Log: Tagging checker-0.179. Added: llvm/tags/checker/checker-0.179/ - copied from r67519, llvm/trunk/ From gohman at apple.com Mon Mar 23 10:48:29 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 15:48:29 -0000 Subject: [llvm-commits] [llvm] r67522 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <200903231548.n2NFmUBr014291@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 10:48:29 2009 New Revision: 67522 URL: http://llvm.org/viewvc/llvm-project?rev=67522&view=rev Log: Make getOperandNumForIncomingValue and getOperandNumForIncomingBlock static member functions, and add getIncomingValueNumForOperand and getIncomingBlockNumForOperand, which are the respective inverses. Modified: llvm/trunk/include/llvm/Instructions.h Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=67522&r1=67521&r2=67522&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon Mar 23 10:48:29 2009 @@ -1942,9 +1942,13 @@ assert(i*2 < getNumOperands() && "Invalid value number!"); setOperand(i*2, V); } - unsigned getOperandNumForIncomingValue(unsigned i) { + static unsigned getOperandNumForIncomingValue(unsigned i) { return i*2; } + static unsigned getIncomingValueNumForOperand(unsigned i) { + assert(i % 2 == 0 && "Invalid incoming-value operand index!"); + return i/2; + } /// getIncomingBlock - Return incoming basic block corresponding /// to value use iterator @@ -1962,9 +1966,13 @@ void setIncomingBlock(unsigned i, BasicBlock *BB) { setOperand(i*2+1, BB); } - unsigned getOperandNumForIncomingBlock(unsigned i) { + static unsigned getOperandNumForIncomingBlock(unsigned i) { return i*2+1; } + static unsigned getIncomingBlockNumForOperand(unsigned i) { + assert(i % 2 == 1 && "Invalid incoming-block operand index!"); + return i/2; + } /// addIncoming - Add an incoming value to the end of the PHI list /// From gohman at apple.com Mon Mar 23 10:49:37 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 15:49:37 -0000 Subject: [llvm-commits] [llvm] r67523 - /llvm/trunk/lib/Analysis/LiveValues.cpp Message-ID: <200903231549.n2NFnb1k014376@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 10:49:37 2009 New Revision: 67523 URL: http://llvm.org/viewvc/llvm-project?rev=67523&view=rev Log: Enhance LiveValues to work on PHI operands. Modified: llvm/trunk/lib/Analysis/LiveValues.cpp Modified: llvm/trunk/lib/Analysis/LiveValues.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LiveValues.cpp?rev=67523&r1=67522&r2=67523&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LiveValues.cpp (original) +++ llvm/trunk/lib/Analysis/LiveValues.cpp Mon Mar 23 10:49:37 2009 @@ -142,21 +142,32 @@ if (L->contains(UseBB)) break; - if (isa(U)) { - // The value is used by a PHI, so it is live-out of the defining block. - LiveOutOfDefBB = true; - } else if (UseBB != DefBB) { - // A use outside the defining block has been found. + // Search for live-through blocks. + const BasicBlock *BB; + if (const PHINode *PHI = dyn_cast(U)) { + // For PHI nodes, start the search at the incoming block paired with the + // incoming value, which must be dominated by the definition. + unsigned Num = PHI->getIncomingValueNumForOperand(I.getOperandNo()); + BB = PHI->getIncomingBlock(Num); + + // A PHI-node use means the value is live-out of it's defining block + // even if that block also contains the only use. LiveOutOfDefBB = true; + } else { + // Otherwise just start the search at the use. + BB = UseBB; - // Climb the immediate dominator tree from the use to the definition - // and mark all intermediate blocks as live-through. Don't do this if - // the user is a PHI because such users may not be dominated by the - // definition. - for (const BasicBlock *BB = getImmediateDominator(UseBB, DT); - BB != DefBB; BB = getImmediateDominator(BB, DT)) - if (!M.LiveThrough.insert(BB)) - break; + // Note if the use is outside the defining block. + LiveOutOfDefBB |= UseBB != DefBB; + } + + // Climb the immediate dominator tree from the use to the definition + // and mark all intermediate blocks as live-through. Don't do this if + // the user is a PHI because such users may not be dominated by the + // definition. + for (; BB != DefBB; BB = getImmediateDominator(BB, DT)) { + if (BB != UseBB && !M.LiveThrough.insert(BB)) + break; } } From gohman at apple.com Mon Mar 23 10:50:53 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 15:50:53 -0000 Subject: [llvm-commits] [llvm] r67524 - /llvm/trunk/lib/Analysis/LoopVR.cpp Message-ID: <200903231550.n2NFor7r014474@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 10:50:52 2009 New Revision: 67524 URL: http://llvm.org/viewvc/llvm-project?rev=67524&view=rev Log: LoopVR is not CFGOnly. Modified: llvm/trunk/lib/Analysis/LoopVR.cpp Modified: llvm/trunk/lib/Analysis/LoopVR.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopVR.cpp?rev=67524&r1=67523&r2=67524&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopVR.cpp (original) +++ llvm/trunk/lib/Analysis/LoopVR.cpp Mon Mar 23 10:50:52 2009 @@ -23,7 +23,7 @@ using namespace llvm; char LoopVR::ID = 0; -static RegisterPass X("loopvr", "Loop Value Ranges", true, true); +static RegisterPass X("loopvr", "Loop Value Ranges", false, true); /// getRange - determine the range for a particular SCEV within a given Loop ConstantRange LoopVR::getRange(SCEVHandle S, Loop *L, ScalarEvolution &SE) { From gohman at apple.com Mon Mar 23 10:54:03 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 15:54:03 -0000 Subject: [llvm-commits] [llvm] r67525 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200903231554.n2NFs3h9014678@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 10:54:02 2009 New Revision: 67525 URL: http://llvm.org/viewvc/llvm-project?rev=67525&view=rev Log: Clarify a comment. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=67525&r1=67524&r2=67525&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Mar 23 10:54:02 2009 @@ -75,7 +75,7 @@ /// and getMachineOpcode() member functions of SDNode. /// enum NodeType { - // DELETED_NODE - This is an illegal flag value that is used to catch + // DELETED_NODE - This is an illegal value that is used to catch // errors. This opcode is not a legal opcode for any node. DELETED_NODE, From gohman at apple.com Mon Mar 23 10:57:19 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 15:57:19 -0000 Subject: [llvm-commits] [llvm] r67526 - in /llvm/trunk/lib: CodeGen/MachineFunction.cpp CodeGen/PseudoSourceValue.cpp CodeGen/SelectionDAG/SelectionDAG.cpp Support/PrettyStackTrace.cpp Target/CppBackend/CPPBackend.cpp Transforms/Utils/LowerSwitch.cpp VMCore/AsmWriter.cpp Message-ID: <200903231557.n2NFvKU1014958@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 10:57:19 2009 New Revision: 67526 URL: http://llvm.org/viewvc/llvm-project?rev=67526&view=rev Log: Now that errs() is properly non-buffered, there's no need to explicitly flush it. Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Support/PrettyStackTrace.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Mar 23 10:57:19 2009 @@ -558,4 +558,4 @@ } } -void MachineConstantPool::dump() const { print(errs()); errs().flush(); } +void MachineConstantPool::dump() const { print(errs()); } Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original) +++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Mon Mar 23 10:57:19 2009 @@ -42,7 +42,7 @@ Value(PointerType::getUnqual(Type::Int8Ty), PseudoSourceValueVal) {} void PseudoSourceValue::dump() const { - print(errs()); errs() << '\n'; errs().flush(); + print(errs()); errs() << '\n'; } void PseudoSourceValue::print(raw_ostream &OS) const { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Mar 23 10:57:19 2009 @@ -5308,7 +5308,6 @@ void SDNode::dump() const { dump(0); } void SDNode::dump(const SelectionDAG *G) const { print(errs(), G); - errs().flush(); } void SDNode::print_types(raw_ostream &OS, const SelectionDAG *G) const { @@ -5544,7 +5543,6 @@ void SDNode::dumpr() const { VisitedSDNodeSet once; DumpNodesr(errs(), this, 0, 0, once); - errs().flush(); } const Type *ConstantPoolSDNode::getType() const { Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PrettyStackTrace.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/Support/PrettyStackTrace.cpp (original) +++ llvm/trunk/lib/Support/PrettyStackTrace.cpp Mon Mar 23 10:57:19 2009 @@ -68,7 +68,6 @@ if (!TmpStr.empty()) { __crashreporter_info__ = strdup(TmpStr.c_str()); errs() << __crashreporter_info__; - errs().flush(); } #endif Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon Mar 23 10:57:19 2009 @@ -1802,7 +1802,6 @@ Out << "int main(int argc, char**argv) {\n"; Out << " Module* Mod = " << fname << "();\n"; Out << " verifyModule(*Mod, PrintMessageAction);\n"; - Out << " errs().flush();\n"; Out << " outs().flush();\n"; Out << " PassManager PM;\n"; Out << " PM.add(createPrintModulePass(&outs()));\n"; Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon Mar 23 10:57:19 2009 @@ -147,8 +147,7 @@ CaseRange& Pivot = *(Begin + Mid); DEBUG(errs() << "Pivot ==> " << cast(Pivot.Low)->getValue() << " -" - << cast(Pivot.High)->getValue() << "\n"; - errs().flush()); + << cast(Pivot.High)->getValue() << "\n"); BasicBlock* LBranch = switchConvert(LHS.begin(), LHS.end(), Val, OrigBlock, Default); Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=67526&r1=67525&r2=67526&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Mar 23 10:57:19 2009 @@ -1813,18 +1813,17 @@ } // Value::dump - allow easy printing of Values from the debugger. -void Value::dump() const { print(errs()); errs() << '\n'; errs().flush(); } +void Value::dump() const { print(errs()); errs() << '\n'; } // Type::dump - allow easy printing of Types from the debugger. // This one uses type names from the given context module void Type::dump(const Module *Context) const { WriteTypeSymbolic(errs(), this, Context); errs() << '\n'; - errs().flush(); } // Type::dump - allow easy printing of Types from the debugger. void Type::dump() const { dump(0); } // Module::dump() - Allow printing of Modules from the debugger. -void Module::dump() const { print(errs(), 0); errs().flush(); } +void Module::dump() const { print(errs(), 0); } From gohman at apple.com Mon Mar 23 11:10:52 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 16:10:52 -0000 Subject: [llvm-commits] [llvm] r67528 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Message-ID: <200903231610.n2NGArwE015889@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 11:10:52 2009 New Revision: 67528 URL: http://llvm.org/viewvc/llvm-project?rev=67528&view=rev Log: Add a new bit to SUnit to record whether a node has implicit physreg defs, regardless of whether they are actually used. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=67528&r1=67527&r2=67528&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon Mar 23 11:10:52 2009 @@ -245,6 +245,7 @@ bool isTwoAddress : 1; // Is a two-address instruction. bool isCommutable : 1; // Is a commutable instruction. bool hasPhysRegDefs : 1; // Has physreg defs that are being used. + bool hasPhysRegClobbers : 1; // Has any physreg defs, used or not. bool isPending : 1; // True once pending. bool isAvailable : 1; // True once available. bool isScheduled : 1; // True once scheduled. @@ -265,6 +266,7 @@ : Node(node), Instr(0), OrigNode(0), NodeNum(nodenum), NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0), isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false), + hasPhysRegClobbers(false), isPending(false), isAvailable(false), isScheduled(false), isScheduleHigh(false), isCloned(false), isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0), @@ -276,6 +278,7 @@ : Node(0), Instr(instr), OrigNode(0), NodeNum(nodenum), NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0), isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false), + hasPhysRegClobbers(false), isPending(false), isAvailable(false), isScheduled(false), isScheduleHigh(false), isCloned(false), isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0), @@ -286,6 +289,7 @@ : Node(0), Instr(0), OrigNode(0), NodeNum(~0u), NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0), isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false), + hasPhysRegClobbers(false), isPending(false), isAvailable(false), isScheduled(false), isScheduleHigh(false), isCloned(false), isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=67528&r1=67527&r2=67528&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon Mar 23 11:10:52 2009 @@ -41,6 +41,7 @@ SU->isTwoAddress = Old->isTwoAddress; SU->isCommutable = Old->isCommutable; SU->hasPhysRegDefs = Old->hasPhysRegDefs; + SU->hasPhysRegClobbers = Old->hasPhysRegClobbers; Old->isCloned = true; return SU; } @@ -172,9 +173,11 @@ // Find all predecessors and successors of the group. for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode()) { if (N->isMachineOpcode() && - TII->get(N->getMachineOpcode()).getImplicitDefs() && - CountResults(N) > TII->get(N->getMachineOpcode()).getNumDefs()) - SU->hasPhysRegDefs = true; + TII->get(N->getMachineOpcode()).getImplicitDefs()) { + SU->hasPhysRegClobbers = true; + if (CountResults(N) > TII->get(N->getMachineOpcode()).getNumDefs()) + SU->hasPhysRegDefs = true; + } for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { SDNode *OpN = N->getOperand(i).getNode(); From gohman at apple.com Mon Mar 23 11:23:02 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 16:23:02 -0000 Subject: [llvm-commits] [llvm] r67531 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200903231623.n2NGN2L9016759@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 11:23:01 2009 New Revision: 67531 URL: http://llvm.org/viewvc/llvm-project?rev=67531&view=rev Log: Fix canClobberPhysRegDefs to check all SDNodes grouped together in an SUnit, instead of just the first one. This fix is needed by some upcoming scheduler changes. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=67531&r1=67530&r2=67531&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Mar 23 11:23:01 2009 @@ -1199,21 +1199,26 @@ unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs(); const unsigned *ImpDefs = TII->get(N->getMachineOpcode()).getImplicitDefs(); assert(ImpDefs && "Caller should check hasPhysRegDefs"); - const unsigned *SUImpDefs = - TII->get(SU->getNode()->getMachineOpcode()).getImplicitDefs(); - if (!SUImpDefs) - return false; - for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) { - MVT VT = N->getValueType(i); - if (VT == MVT::Flag || VT == MVT::Other) - continue; - if (!N->hasAnyUseOfValue(i)) + for (const SDNode *SUNode = SU->getNode(); SUNode; + SUNode = SUNode->getFlaggedNode()) { + if (!SUNode->isMachineOpcode()) continue; - unsigned Reg = ImpDefs[i - NumDefs]; - for (;*SUImpDefs; ++SUImpDefs) { - unsigned SUReg = *SUImpDefs; - if (TRI->regsOverlap(Reg, SUReg)) - return true; + const unsigned *SUImpDefs = + TII->get(SUNode->getMachineOpcode()).getImplicitDefs(); + if (!SUImpDefs) + return false; + for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) { + MVT VT = N->getValueType(i); + if (VT == MVT::Flag || VT == MVT::Other) + continue; + if (!N->hasAnyUseOfValue(i)) + continue; + unsigned Reg = ImpDefs[i - NumDefs]; + for (;*SUImpDefs; ++SUImpDefs) { + unsigned SUReg = *SUImpDefs; + if (TRI->regsOverlap(Reg, SUReg)) + return true; + } } } return false; From nicholas at mxc.ca Mon Mar 23 11:50:32 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 23 Mar 2009 09:50:32 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r67516 - in /llvm-gcc-4.2/trunk/gcc/config: i386/linux.h i386/linux64.h rs6000/sysv4.h In-Reply-To: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> Message-ID: <49C7BDD8.1070301@mxc.ca> Duncan Sands wrote: > Author: baldrick > Date: Mon Mar 23 05:54:30 2009 > New Revision: 67516 > > URL: http://llvm.org/viewvc/llvm-project?rev=67516&view=rev > Log: > Revert commit 67369: older versions of ld do not > support the --hash-style option, for example > GNU ld version 2.17 Debian GNU/Linux > which is in use on a couple of nightly testers. Hi Duncan. What does GCC do here? Detect it at configure time? The difference is seen with: int main() { return 0; } compiled by the llvm-g++ driver vs. the FSF g++ driver. When built without --hash-style "valgrind --tool=callgrind" reports 2,206,956 instructions vs. 1,334,028 with this patch. The extra instructions are due to the dynamic linker doing extra work to load the program. Nick > Modified: > llvm-gcc-4.2/trunk/gcc/config/i386/linux.h > llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h > llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/linux.h?rev=67516&r1=67515&r2=67516&view=diff > > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/i386/linux.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/i386/linux.h Mon Mar 23 05:54:30 2009 > @@ -109,8 +109,7 @@ > { "dynamic_linker", LINUX_DYNAMIC_LINKER } > > #undef LINK_SPEC > -/* LLVM LOCAL set linker hash_style */ > -#define LINK_SPEC "-m %(link_emulation) --hash-style=both %{shared:-shared} \ > +#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ > %{!shared: \ > %{!ibcs: \ > %{!static: \ > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h?rev=67516&r1=67515&r2=67516&view=diff > > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h Mon Mar 23 05:54:30 2009 > @@ -53,8 +53,7 @@ > #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" > > #undef LINK_SPEC > -/* LLVM LOCAL set linker hash_style */ > -#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} --hash-style=both \ > +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ > %{shared:-shared} \ > %{!shared: \ > %{!static: \ > > Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h?rev=67516&r1=67515&r2=67516&view=diff > > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h Mon Mar 23 05:54:30 2009 > @@ -910,9 +910,8 @@ > #define LINUX_DYNAMIC_LINKER \ > CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) > > -/* LLVM LOCAL set linker hash_style */ > -#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=both %{!shared: \ > - %{!static: %{rdynamic:-export-dynamic} \ > +#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ > + %{rdynamic:-export-dynamic} \ > %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" > > #if defined(HAVE_LD_EH_FRAME_HDR) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From kremenek at apple.com Mon Mar 23 12:12:28 2009 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 23 Mar 2009 17:12:28 -0000 Subject: [llvm-commits] [llvm] r67535 - /llvm/tags/checker/checker-0.179/ Message-ID: <200903231712.n2NHCSkq019445@zion.cs.uiuc.edu> Author: kremenek Date: Mon Mar 23 12:12:27 2009 New Revision: 67535 URL: http://llvm.org/viewvc/llvm-project?rev=67535&view=rev Log: Removing checker-0.179. Removed: llvm/tags/checker/checker-0.179/ From kremenek at apple.com Mon Mar 23 12:13:15 2009 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 23 Mar 2009 17:13:15 -0000 Subject: [llvm-commits] [llvm] r67537 - /llvm/tags/checker/checker-0.179/ Message-ID: <200903231713.n2NHDGw0019495@zion.cs.uiuc.edu> Author: kremenek Date: Mon Mar 23 12:13:15 2009 New Revision: 67537 URL: http://llvm.org/viewvc/llvm-project?rev=67537&view=rev Log: Tagging checker-0.179. Added: llvm/tags/checker/checker-0.179/ - copied from r67536, llvm/trunk/ From gohman at apple.com Mon Mar 23 12:39:36 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 17:39:36 -0000 Subject: [llvm-commits] [llvm] r67540 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Message-ID: <200903231739.n2NHdaIJ021206@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 12:39:36 2009 New Revision: 67540 URL: http://llvm.org/viewvc/llvm-project?rev=67540&view=rev Log: Don't set SUnit::hasPhysRegDefs to true unless the defs are actually have uses, which reflects the way it's used. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=67540&r1=67539&r2=67540&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon Mar 23 12:39:36 2009 @@ -175,7 +175,10 @@ if (N->isMachineOpcode() && TII->get(N->getMachineOpcode()).getImplicitDefs()) { SU->hasPhysRegClobbers = true; - if (CountResults(N) > TII->get(N->getMachineOpcode()).getNumDefs()) + unsigned NumUsed = CountResults(N); + while (NumUsed != 0 && !N->hasAnyUseOfValue(NumUsed - 1)) + --NumUsed; // Skip over unused values at the end. + if (NumUsed > TII->get(N->getMachineOpcode()).getNumDefs()) SU->hasPhysRegDefs = true; } From evan.cheng at apple.com Mon Mar 23 13:24:37 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 23 Mar 2009 18:24:37 -0000 Subject: [llvm-commits] [llvm] r67544 - in /llvm/trunk: include/llvm/CodeGen/LiveIntervalAnalysis.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegAllocLinearScan.cpp test/CodeGen/X86/inline-asm-out-regs.ll Message-ID: <200903231824.n2NIOcMB023436@zion.cs.uiuc.edu> Author: evancheng Date: Mon Mar 23 13:24:37 2009 New Revision: 67544 URL: http://llvm.org/viewvc/llvm-project?rev=67544&view=rev Log: Fix PR3391 and PR3864. Reg allocator infinite looping. Added: llvm/trunk/test/CodeGen/X86/inline-asm-out-regs.ll Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=67544&r1=67543&r2=67544&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Mon Mar 23 13:24:37 2009 @@ -367,8 +367,9 @@ VirtRegMap &vrm, float& SSWeight); /// spillPhysRegAroundRegDefsUses - Spill the specified physical register - /// around all defs and uses of the specified interval. - void spillPhysRegAroundRegDefsUses(const LiveInterval &li, + /// around all defs and uses of the specified interval. Return true if it + /// was able to cut its interval. + bool spillPhysRegAroundRegDefsUses(const LiveInterval &li, unsigned PhysReg, VirtRegMap &vrm); /// isReMaterializable - Returns true if every definition of MI of every Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=67544&r1=67543&r2=67544&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Mar 23 13:24:37 2009 @@ -2214,8 +2214,9 @@ } /// spillPhysRegAroundRegDefsUses - Spill the specified physical register -/// around all defs and uses of the specified interval. -void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li, +/// around all defs and uses of the specified interval. Return true if it +/// was able to cut its interval. +bool LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li, unsigned PhysReg, VirtRegMap &vrm) { unsigned SpillReg = getRepresentativeReg(PhysReg); @@ -2226,6 +2227,7 @@ assert(*AS == SpillReg || !allocatableRegs_[*AS] || tri_->isSuperRegister(*AS, SpillReg)); + bool Cut = false; LiveInterval &pli = getInterval(SpillReg); SmallPtrSet SeenMIs; for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(li.reg), @@ -2240,9 +2242,10 @@ vrm.addEmergencySpill(SpillReg, MI); unsigned StartIdx = getLoadIndex(Index); unsigned EndIdx = getStoreIndex(Index)+1; - if (pli.isInOneLiveRange(StartIdx, EndIdx)) + if (pli.isInOneLiveRange(StartIdx, EndIdx)) { pli.removeRange(StartIdx, EndIdx); - else { + Cut = true; + } else { cerr << "Ran out of registers during register allocation!\n"; if (MI->getOpcode() == TargetInstrInfo::INLINEASM) { cerr << "Please check your inline asm statement for invalid " @@ -2260,6 +2263,7 @@ } } } + return Cut; } LiveRange LiveIntervals::addLiveRangeToEndOfBlock(unsigned reg, Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=67544&r1=67543&r2=67544&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Mon Mar 23 13:24:37 2009 @@ -869,8 +869,12 @@ if (cur->weight == HUGE_VALF || li_->getApproximateInstructionCount(*cur) == 0) { // Spill a physical register around defs and uses. - li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_); - assignRegOrStackSlotAtInterval(cur); + if (li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_)) + assignRegOrStackSlotAtInterval(cur); + else { + cerr << "Ran out of registers during register allocation!\n"; + exit(1); + } return; } } Added: llvm/trunk/test/CodeGen/X86/inline-asm-out-regs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/inline-asm-out-regs.ll?rev=67544&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/inline-asm-out-regs.ll (added) +++ llvm/trunk/test/CodeGen/X86/inline-asm-out-regs.ll Mon Mar 23 13:24:37 2009 @@ -0,0 +1,42 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu +; XFAIL: * +; Expected to run out of registers during allocation. +; PR3391 + + at pci_indirect = external global { } ; <{ }*> [#uses=1] + at pcibios_last_bus = external global i32 ; [#uses=2] + +define void @pci_pcbios_init() nounwind section ".init.text" { +entry: + br label %bb1.i + +bb1.i: ; preds = %bb6.i.i, %bb1.i, %entry + %0 = load i32* null, align 8 ; [#uses=1] + %1 = icmp ugt i32 %0, 1048575 ; [#uses=1] + br i1 %1, label %bb2.i, label %bb1.i + +bb2.i: ; preds = %bb1.i + %asmtmp.i.i = tail call { i32, i32, i32, i32 } asm "lcall *(%edi); cld\0A\09jc 1f\0A\09xor %ah, %ah\0A1:", "={dx},={ax},={bx},={cx},1,{di},~{dirflag},~{fpsr},~{flags},~{memory}"(i32 45313, { }* @pci_indirect) nounwind ; <{ i32, i32, i32, i32 }> [#uses=2] + %asmresult2.i.i = extractvalue { i32, i32, i32, i32 } %asmtmp.i.i, 1 + ; [#uses=1] + %2 = lshr i32 %asmresult2.i.i, 8 ; [#uses=1] + %3 = trunc i32 %2 to i8 ; [#uses=1] + %4 = load i32* @pcibios_last_bus, align 4 ; [#uses=1] + %5 = icmp slt i32 %4, 0 ; [#uses=1] + br i1 %5, label %bb5.i.i, label %bb6.i.i + +bb5.i.i: ; preds = %bb2.i + %asmresult4.i.i = extractvalue { i32, i32, i32, i32 } %asmtmp.i.i, 3 + ; [#uses=1] + %6 = and i32 %asmresult4.i.i, 255 ; [#uses=1] + store i32 %6, i32* @pcibios_last_bus, align 4 + br label %bb6.i.i + +bb6.i.i: ; preds = %bb5.i.i, %bb2.i + %7 = icmp eq i8 %3, 0 ; [#uses=1] + %or.cond.i.i = and i1 %7, false ; [#uses=1] + br i1 %or.cond.i.i, label %bb1.i, label %bb8.i.i + +bb8.i.i: ; preds = %bb6.i.i + unreachable +} From evan.cheng at apple.com Mon Mar 23 13:27:36 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 23 Mar 2009 18:27:36 -0000 Subject: [llvm-commits] [llvm] r67545 - /llvm/trunk/test/CodeGen/X86/illegal-asm.ll Message-ID: <200903231827.n2NIRaOu023613@zion.cs.uiuc.edu> Author: evancheng Date: Mon Mar 23 13:27:36 2009 New Revision: 67545 URL: http://llvm.org/viewvc/llvm-project?rev=67545&view=rev Log: Update test for pr3864. Modified: llvm/trunk/test/CodeGen/X86/illegal-asm.ll Modified: llvm/trunk/test/CodeGen/X86/illegal-asm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/illegal-asm.ll?rev=67545&r1=67544&r2=67545&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/illegal-asm.ll (original) +++ llvm/trunk/test/CodeGen/X86/illegal-asm.ll Mon Mar 23 13:27:36 2009 @@ -1,6 +1,8 @@ ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -disable-fp-elim +; RUN: llvm-as < %s | llc -mtriple=i386-linux -disable-fp-elim ; XFAIL: * ; Expected to run out of registers during allocation. +; PR3864 ; rdar://6251720 %struct.CABACContext = type { i32, i32, i8* } From isanbard at gmail.com Mon Mar 23 13:36:07 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 18:36:07 -0000 Subject: [llvm-commits] [llvm] r67546 - in /llvm/branches/Apple/Dib: include/llvm/ include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/X86/ test/CodeGen/X86/ Message-ID: <200903231836.n2NIa8h3024150@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 13:36:00 2009 New Revision: 67546 URL: http://llvm.org/viewvc/llvm-project?rev=67546&view=rev Log: --- Merging (from foreign repository) r67387 into '.': U include/llvm/InlineAsm.h U lib/CodeGen/AsmPrinter/AsmPrinter.cpp U lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp U lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp U lib/CodeGen/SelectionDAG/LegalizeDAG.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp For inline asm output operand that matches an input. Encode the input operand index in the high bits. --- Merging (from foreign repository) r67335 into '.': U include/llvm/CodeGen/MachineInstr.h G lib/CodeGen/LiveIntervalAnalysis.cpp U lib/CodeGen/Spiller.cpp U lib/CodeGen/MachineInstr.cpp U lib/CodeGen/RegAllocLocal.cpp U lib/CodeGen/TwoAddressInstructionPass.cpp Added MachineInstr::isRegTiedToDefOperand to check for two-addressness. --- Merging (from foreign repository) r67512 into '.': A test/CodeGen/X86/inline-asm-2addr.ll G include/llvm/InlineAsm.h U lib/CodeGen/LiveIntervalAnalysis.cpp A test/CodeGen/X86/inline-asm-2addr.ll G lib/CodeGen/MachineInstr.cpp G lib/CodeGen/TwoAddressInstructionPass.cpp G lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp U lib/Target/X86/X86FloatingPoint.cpp Model inline asm constraint which ties an input to an output register as machine operand TIED_TO constraint. This eliminated the need to pre-allocate registers for these. This also allows register allocator can eliminate the unneeded copies. Added: llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-2addr.ll Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/MachineInstr.h llvm/branches/Apple/Dib/include/llvm/InlineAsm.h llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/branches/Apple/Dib/lib/CodeGen/MachineInstr.cpp llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLocal.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/branches/Apple/Dib/lib/CodeGen/Spiller.cpp llvm/branches/Apple/Dib/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/branches/Apple/Dib/lib/Target/X86/X86FloatingPoint.cpp llvm/branches/Apple/Dib/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2008-09-18-inline-asm-2.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/MachineInstr.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/MachineInstr.h?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/CodeGen/MachineInstr.h (original) +++ llvm/branches/Apple/Dib/include/llvm/CodeGen/MachineInstr.h Mon Mar 23 13:36:00 2009 @@ -245,6 +245,11 @@ /// check if the register def is a re-definition due to two addr elimination. bool isRegReDefinedByTwoAddr(unsigned DefIdx) const; + /// isRegTiedToDefOperand - Return true if the use operand of the specified + /// index is tied to an def operand. It also returns the def operand index by + /// reference if DefOpIdx is not null. + bool isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx = 0); + /// copyKillDeadInfo - Copies kill / dead operand properties from MI. /// void copyKillDeadInfo(const MachineInstr *MI); Modified: llvm/branches/Apple/Dib/include/llvm/InlineAsm.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/InlineAsm.h?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/InlineAsm.h (original) +++ llvm/branches/Apple/Dib/include/llvm/InlineAsm.h Mon Mar 23 13:36:00 2009 @@ -128,6 +128,23 @@ static inline bool classof(const Value *V) { return V->getValueID() == Value::InlineAsmVal; } + + /// getNumOperandRegisters - Extract the number of registers field from the + /// inline asm operand flag. + static unsigned getNumOperandRegisters(unsigned Flag) { + return (Flag & 0xffff) >> 3; + } + + /// isUseOperandTiedToDef - Return true if the flag of the inline asm + /// operand indicates it is an use operand that's matched to a def operand. + static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) { + if ((Flag & 0x80000000) == 0) + return false; + Idx = (Flag & ~0x80000000) >> 16; + return true; + } + + }; } // End llvm namespace Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Mar 23 13:36:00 2009 @@ -1401,7 +1401,7 @@ for (; Val; --Val) { if (OpNo >= MI->getNumOperands()) break; unsigned OpFlags = MI->getOperand(OpNo).getImm(); - OpNo += (OpFlags >> 3) + 1; + OpNo += InlineAsm::getNumOperandRegisters(OpFlags) + 1; } if (OpNo >= MI->getNumOperands()) { Modified: llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Mar 23 13:36:00 2009 @@ -477,8 +477,8 @@ assert(interval.containsOneValue()); unsigned DefIndex = getDefIndex(interval.getValNumInfo(0)->def); unsigned RedefIndex = getDefIndex(MIIdx); - // It cannot be an early clobber MO. - assert(!MO.isEarlyClobber() && "Unexpected early clobber!"); + if (MO.isEarlyClobber()) + RedefIndex = getUseIndex(MIIdx); const LiveRange *OldLR = interval.getLiveRangeContaining(RedefIndex-1); VNInfo *OldValNo = OldLR->valno; @@ -499,6 +499,8 @@ // Value#0 is now defined by the 2-addr instruction. OldValNo->def = RedefIndex; OldValNo->copy = 0; + if (MO.isEarlyClobber()) + OldValNo->redefByEC = true; // Add the new live interval which replaces the range for the input copy. LiveRange LR(DefIndex, RedefIndex, ValNo); @@ -546,8 +548,8 @@ // live until the end of the block. We've already taken care of the // rest of the live range. unsigned defIndex = getDefIndex(MIIdx); - // It cannot be an early clobber MO. - assert(!MO.isEarlyClobber() && "Unexpected early clobber!"); + if (MO.isEarlyClobber()) + defIndex = getUseIndex(MIIdx); VNInfo *ValNo; MachineInstr *CopyMI = NULL; @@ -1062,8 +1064,6 @@ SmallVector &Ops, unsigned &MRInfo, SmallVector &FoldOps) { - const TargetInstrDesc &TID = MI->getDesc(); - MRInfo = 0; for (unsigned i = 0, e = Ops.size(); i != e; ++i) { unsigned OpIdx = Ops[i]; @@ -1075,8 +1075,7 @@ MRInfo |= (unsigned)VirtRegMap::isMod; else { // Filter out two-address use operand(s). - if (!MO.isImplicit() && - TID.getOperandConstraint(OpIdx, TOI::TIED_TO) != -1) { + if (MI->isRegTiedToDefOperand(OpIdx)) { MRInfo = VirtRegMap::isModRef; continue; } @@ -2160,8 +2159,7 @@ MachineInstr *LastUse = getInstructionFromIndex(LastUseIdx); int UseIdx = LastUse->findRegisterUseOperandIdx(LI->reg, false); assert(UseIdx != -1); - if (LastUse->getOperand(UseIdx).isImplicit() || - LastUse->getDesc().getOperandConstraint(UseIdx,TOI::TIED_TO) == -1){ + if (!LastUse->isRegTiedToDefOperand(UseIdx)) { LastUse->getOperand(UseIdx).setIsKill(); vrm.addKillPoint(LI->reg, LastUseIdx); } Modified: llvm/branches/Apple/Dib/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/MachineInstr.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/MachineInstr.cpp Mon Mar 23 13:36:00 2009 @@ -11,8 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/Constants.h" +#include "llvm/InlineAsm.h" #include "llvm/Value.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -689,9 +690,38 @@ return -1; } -/// isRegReDefinedByTwoAddr - Given the index of a register def operand, +/// isRegReDefinedByTwoAddr - Given the index of a register operand, /// check if the register def is a re-definition due to two addr elimination. bool MachineInstr::isRegReDefinedByTwoAddr(unsigned DefIdx) const{ + if (getOpcode() == TargetInstrInfo::INLINEASM) { + assert(DefIdx >= 2); + const MachineOperand &MO = getOperand(DefIdx); + if (!MO.isReg() || !MO.isDef()) + return false; + // Determine the actual operand no corresponding to this index. + unsigned DefNo = 0; + for (unsigned i = 1, e = getNumOperands(); i < e; ) { + const MachineOperand &FMO = getOperand(i); + assert(FMO.isImm()); + // Skip over this def. + i += InlineAsm::getNumOperandRegisters(FMO.getImm()) + 1; + if (i > DefIdx) + break; + ++DefNo; + } + for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { + const MachineOperand &FMO = getOperand(i); + if (!FMO.isImm()) + continue; + if (i+1 >= e || !getOperand(i+1).isReg() || !getOperand(i+1).isUse()) + continue; + unsigned Idx; + if (InlineAsm::isUseOperandTiedToDef(FMO.getImm(), Idx) && + Idx == DefNo) + return true; + } + } + assert(getOperand(DefIdx).isDef() && "DefIdx is not a def!"); const TargetInstrDesc &TID = getDesc(); for (unsigned i = 0, e = TID.getNumOperands(); i != e; ++i) { @@ -703,6 +733,53 @@ return false; } +/// isRegTiedToDefOperand - Return true if the operand of the specified index +/// is a register use and it is tied to an def operand. It also returns the def +/// operand index by reference. +bool MachineInstr::isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx){ + if (getOpcode() == TargetInstrInfo::INLINEASM) { + const MachineOperand &MO = getOperand(UseOpIdx); + if (!MO.isReg() || !MO.isUse()) + return false; + assert(UseOpIdx > 0); + const MachineOperand &UFMO = getOperand(UseOpIdx-1); + if (!UFMO.isImm()) + return false; // Must be physreg uses. + unsigned DefNo; + if (InlineAsm::isUseOperandTiedToDef(UFMO.getImm(), DefNo)) { + if (!DefOpIdx) + return true; + + unsigned DefIdx = 1; + // Remember to adjust the index. First operand is asm string, then there + // is a flag for each. + while (DefNo) { + const MachineOperand &FMO = getOperand(DefIdx); + assert(FMO.isImm()); + // Skip over this def. + DefIdx += InlineAsm::getNumOperandRegisters(FMO.getImm()) + 1; + --DefNo; + } + *DefOpIdx = DefIdx+1; + return true; + } + return false; + } + + const TargetInstrDesc &TID = getDesc(); + if (UseOpIdx >= TID.getNumOperands()) + return false; + const MachineOperand &MO = getOperand(UseOpIdx); + if (!MO.isReg() || !MO.isUse()) + return false; + int DefIdx = TID.getOperandConstraint(UseOpIdx, TOI::TIED_TO); + if (DefIdx == -1) + return false; + if (DefOpIdx) + *DefOpIdx = (unsigned)DefIdx; + return true; +} + /// copyKillDeadInfo - Copies kill / dead operand properties from MI. /// void MachineInstr::copyKillDeadInfo(const MachineInstr *MI) { Modified: llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLocal.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLocal.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLocal.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLocal.cpp Mon Mar 23 13:36:00 2009 @@ -695,7 +695,7 @@ if (isPhysReg || !usedOutsideBlock) { if (MO.isUse()) { // Don't mark uses that are tied to defs as kills. - if (MI->getDesc().getOperandConstraint(idx, TOI::TIED_TO) == -1) + if (!MI->isRegTiedToDefOperand(idx)) MO.setIsKill(true); } else MO.setIsDead(true); Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Mar 23 13:36:00 2009 @@ -1974,7 +1974,8 @@ bool HasInFlag = Ops.back().getValueType() == MVT::Flag; for (unsigned i = 2, e = Ops.size()-HasInFlag; i < e; ) { - unsigned NumVals = cast(Ops[i])->getZExtValue() >> 3; + unsigned NumVals = InlineAsm:: + getNumOperandRegisters(cast(Ops[i])->getZExtValue()); for (++i; NumVals; ++i, --NumVals) { SDValue Op = LegalizeOp(Ops[i]); if (Op != Ops[i]) { Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Mar 23 13:36:00 2009 @@ -632,7 +632,7 @@ for (unsigned i = 2; i != NumOps;) { unsigned Flags = cast(Node->getOperand(i))->getZExtValue(); - unsigned NumVals = Flags >> 3; + unsigned NumVals = (Flags & 0xffff) >> 3; ++i; // Skip the ID value. if ((Flags & 7) == 2 || (Flags & 7) == 6) { Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp Mon Mar 23 13:36:00 2009 @@ -561,7 +561,7 @@ for (unsigned i = 2; i != NumOps;) { unsigned Flags = cast(Node->getOperand(i))->getZExtValue(); - unsigned NumVals = Flags >> 3; + unsigned NumVals = InlineAsm::getNumOperandRegisters(Flags); MI->addOperand(MachineOperand::CreateImm(Flags)); ++i; // Skip the ID value. Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Mar 23 13:36:00 2009 @@ -228,10 +228,11 @@ SDValue &Chain, SDValue *Flag) const; /// AddInlineAsmOperands - Add this value to the specified inlineasm node - /// operand list. This adds the code marker and includes the number of - /// values added into it. - void AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG, - std::vector &Ops) const; + /// operand list. This adds the code marker, matching input operand index + /// (if applicable), and includes the number of values added into it. + void AddInlineAsmOperands(unsigned Code, + bool HasMatching, unsigned MatchingIdx, + SelectionDAG &DAG, std::vector &Ops) const; }; } @@ -4659,10 +4660,16 @@ /// AddInlineAsmOperands - Add this value to the specified inlineasm node /// operand list. This adds the code marker and includes the number of /// values added into it. -void RegsForValue::AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG, +void RegsForValue::AddInlineAsmOperands(unsigned Code, + bool HasMatching,unsigned MatchingIdx, + SelectionDAG &DAG, std::vector &Ops) const { MVT IntPtrTy = DAG.getTargetLoweringInfo().getPointerTy(); - Ops.push_back(DAG.getTargetConstant(Code | (Regs.size() << 3), IntPtrTy)); + assert(Regs.size() < (1 << 13) && "Too many inline asm outputs!"); + unsigned Flag = Code | (Regs.size() << 3); + if (HasMatching) + Flag |= 0x80000000 | (MatchingIdx << 16); + Ops.push_back(DAG.getTargetConstant(Flag, IntPtrTy)); for (unsigned Value = 0, Reg = 0, e = ValueVTs.size(); Value != e; ++Value) { unsigned NumRegs = TLI->getNumRegisters(ValueVTs[Value]); MVT RegisterVT = RegVTs[Value]; @@ -4925,28 +4932,17 @@ std::vector RegClassRegs; const TargetRegisterClass *RC = PhysReg.second; if (RC) { - // If this is a tied register, our regalloc doesn't know how to maintain - // the constraint, so we have to pick a register to pin the input/output to. - // If it isn't a matched constraint, go ahead and create vreg and let the - // regalloc do its thing. - if (!OpInfo.hasMatchingInput()) { - RegVT = *PhysReg.second->vt_begin(); - if (OpInfo.ConstraintVT == MVT::Other) - ValueVT = RegVT; - - // Create the appropriate number of virtual registers. - MachineRegisterInfo &RegInfo = MF.getRegInfo(); - for (; NumRegs; --NumRegs) - Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second)); - - OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); - return; - } + RegVT = *PhysReg.second->vt_begin(); + if (OpInfo.ConstraintVT == MVT::Other) + ValueVT = RegVT; - // Otherwise, we can't allocate it. Let the code below figure out how to - // maintain these constraints. - RegClassRegs.assign(PhysReg.second->begin(), PhysReg.second->end()); + // Create the appropriate number of virtual registers. + MachineRegisterInfo &RegInfo = MF.getRegInfo(); + for (; NumRegs; --NumRegs) + Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second)); + OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); + return; } else { // This is a reference to a register class that doesn't directly correspond // to an LLVM register class. Allocate NumRegs consecutive, available, @@ -5230,6 +5226,8 @@ OpInfo.AssignedRegs.AddInlineAsmOperands(OpInfo.isEarlyClobber ? 6 /* EARLYCLOBBER REGDEF */ : 2 /* REGDEF */ , + false, + 0, DAG, AsmNodeOperands); break; } @@ -5246,40 +5244,46 @@ unsigned CurOp = 2; // The first operand. for (; OperandNo; --OperandNo) { // Advance to the next operand. - unsigned NumOps = + unsigned OpFlag = cast(AsmNodeOperands[CurOp])->getZExtValue(); - assert(((NumOps & 7) == 2 /*REGDEF*/ || - (NumOps & 7) == 6 /*EARLYCLOBBER REGDEF*/ || - (NumOps & 7) == 4 /*MEM*/) && + assert(((OpFlag & 7) == 2 /*REGDEF*/ || + (OpFlag & 7) == 6 /*EARLYCLOBBER REGDEF*/ || + (OpFlag & 7) == 4 /*MEM*/) && "Skipped past definitions?"); - CurOp += (NumOps>>3)+1; + CurOp += InlineAsm::getNumOperandRegisters(OpFlag)+1; } - unsigned NumOps = + unsigned OpFlag = cast(AsmNodeOperands[CurOp])->getZExtValue(); - if ((NumOps & 7) == 2 /*REGDEF*/ - || (NumOps & 7) == 6 /* EARLYCLOBBER REGDEF */) { - // Add NumOps>>3 registers to MatchedRegs. + if ((OpFlag & 7) == 2 /*REGDEF*/ + || (OpFlag & 7) == 6 /* EARLYCLOBBER REGDEF */) { + // Add (OpFlag&0xffff)>>3 registers to MatchedRegs. RegsForValue MatchedRegs; MatchedRegs.TLI = &TLI; MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType()); - MatchedRegs.RegVTs.push_back(AsmNodeOperands[CurOp+1].getValueType()); - for (unsigned i = 0, e = NumOps>>3; i != e; ++i) { - unsigned Reg = - cast(AsmNodeOperands[++CurOp])->getReg(); - MatchedRegs.Regs.push_back(Reg); - } + MVT RegVT = AsmNodeOperands[CurOp+1].getValueType(); + MatchedRegs.RegVTs.push_back(RegVT); + MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo(); + for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag); + i != e; ++i) + MatchedRegs.Regs. + push_back(RegInfo.createVirtualRegister(TLI.getRegClassFor(RegVT))); // Use the produced MatchedRegs object to MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(), Chain, &Flag); - MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, DAG, AsmNodeOperands); + MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, + true, OpInfo.getMatchedOperand(), + DAG, AsmNodeOperands); break; } else { - assert(((NumOps & 7) == 4) && "Unknown matching constraint!"); - assert((NumOps >> 3) == 1 && "Unexpected number of operands"); + assert(((OpFlag & 7) == 4) && "Unknown matching constraint!"); + assert((InlineAsm::getNumOperandRegisters(OpFlag)) == 1 && + "Unexpected number of operands"); // Add information to the INLINEASM node to know about this input. - AsmNodeOperands.push_back(DAG.getTargetConstant(NumOps, + // See InlineAsm.h isUseOperandTiedToDef. + OpFlag |= 0x80000000 | (OpInfo.getMatchedOperand() << 16); + AsmNodeOperands.push_back(DAG.getTargetConstant(OpFlag, TLI.getPointerTy())); AsmNodeOperands.push_back(AsmNodeOperands[CurOp+1]); break; @@ -5334,7 +5338,7 @@ OpInfo.AssignedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(), Chain, &Flag); - OpInfo.AssignedRegs.AddInlineAsmOperands(1/*REGUSE*/, + OpInfo.AssignedRegs.AddInlineAsmOperands(1/*REGUSE*/, false, 0, DAG, AsmNodeOperands); break; } @@ -5343,7 +5347,7 @@ // allocator is aware that the physreg got clobbered. if (!OpInfo.AssignedRegs.Regs.empty()) OpInfo.AssignedRegs.AddInlineAsmOperands(6 /* EARLYCLOBBER REGDEF */, - DAG, AsmNodeOperands); + false, 0, DAG,AsmNodeOperands); break; } } Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Mar 23 13:36:00 2009 @@ -1168,10 +1168,12 @@ unsigned Flags = cast(InOps[i])->getZExtValue(); if ((Flags & 7) != 4 /*MEM*/) { // Just skip over this operand, copying the operands verbatim. - Ops.insert(Ops.end(), InOps.begin()+i, InOps.begin()+i+(Flags >> 3) + 1); - i += (Flags >> 3) + 1; + Ops.insert(Ops.end(), InOps.begin()+i, + InOps.begin()+i+InlineAsm::getNumOperandRegisters(Flags) + 1); + i += InlineAsm::getNumOperandRegisters(Flags) + 1; } else { - assert((Flags >> 3) == 1 && "Memory operand with multiple values?"); + assert(InlineAsm::getNumOperandRegisters(Flags) == 1 && + "Memory operand with multiple values?"); // Otherwise, this is a memory operand. Ask the target to select it. std::vector SelOps; if (SelectInlineAsmMemoryOperand(InOps[i+1], 'm', SelOps)) { Modified: llvm/branches/Apple/Dib/lib/CodeGen/Spiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/Spiller.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/Spiller.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/Spiller.cpp Mon Mar 23 13:36:00 2009 @@ -233,8 +233,7 @@ KillOps[Reg]->setIsKill(false); KillOps[Reg] = NULL; RegKills.reset(Reg); - if (i < TID.getNumOperands() && - TID.getOperandConstraint(i, TOI::TIED_TO) == -1) + if (!MI.isRegTiedToDefOperand(i)) // Unless it's a two-address operand, this is the new kill. MO.setIsKill(); } @@ -748,8 +747,8 @@ int UseIdx = DefMI->findRegisterUseOperandIdx(DestReg, false); if (UseIdx == -1) return false; - int DefIdx = TID.getOperandConstraint(UseIdx, TOI::TIED_TO); - if (DefIdx == -1) + unsigned DefIdx; + if (!MI.isRegTiedToDefOperand(UseIdx, &DefIdx)) return false; assert(DefMI->getOperand(DefIdx).isReg() && DefMI->getOperand(DefIdx).getReg() == SrcReg); @@ -890,7 +889,7 @@ continue; if (!LastUD || (LastUD->isUse() && MO.isDef())) LastUD = &MO; - if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) + if (LastUDMI->isRegTiedToDefOperand(i)) return; } if (LastUD->isDef()) @@ -1168,8 +1167,8 @@ // aren't allowed to modify the reused register. If none of these cases // apply, reuse it. bool CanReuse = true; - int ti = TID.getOperandConstraint(i, TOI::TIED_TO); - if (ti != -1) { + bool isTied = MI.isRegTiedToDefOperand(i); + if (isTied) { // Okay, we have a two address operand. We can reuse this physreg as // long as we are allowed to clobber the value and there isn't an // earlier def that has already clobbered the physreg. @@ -1206,7 +1205,7 @@ // we can get at R0 or its alias. ReusedOperands.addReuse(i, ReuseSlot, PhysReg, VRM.getPhys(VirtReg), VirtReg); - if (ti != -1) + if (isTied) // Only mark it clobbered if this is a use&def operand. ReusedOperands.markClobbered(PhysReg); ++NumReused; @@ -1226,7 +1225,7 @@ // Mark is isKill if it's there no other uses of the same virtual // register and it's not a two-address operand. IsKill will be // unset if reg is reused. - if (ti == -1 && KilledMIRegs.count(VirtReg) == 0) { + if (!isTied && KilledMIRegs.count(VirtReg) == 0) { MI.getOperand(i).setIsKill(); KilledMIRegs.insert(VirtReg); } @@ -1325,7 +1324,7 @@ Spills.addAvailable(SSorRMId, PhysReg); // Assumes this is the last use. IsKill will be unset if reg is reused // unless it's a two-address operand. - if (TID.getOperandConstraint(i, TOI::TIED_TO) == -1 && + if (!MI.isRegTiedToDefOperand(i) && KilledMIRegs.count(VirtReg) == 0) { MI.getOperand(i).setIsKill(); KilledMIRegs.insert(VirtReg); Modified: llvm/branches/Apple/Dib/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Mar 23 13:36:00 2009 @@ -234,7 +234,7 @@ for (unsigned i = 0, e = TID.getNumOperands(); i != e; ++i) { MachineOperand &MO = UseMI->getOperand(i); if (MO.isReg() && MO.getReg() == Reg && - (MO.isDef() || TID.getOperandConstraint(i, TOI::TIED_TO) != -1)) + (MO.isDef() || UseMI->isRegTiedToDefOperand(i))) // Earlier use is a two-address one. return true; } @@ -338,8 +338,8 @@ const MachineOperand &MO = MI.getOperand(i); if (!MO.isReg() || !MO.isUse() || MO.getReg() != Reg) continue; - int ti = TID.getOperandConstraint(i, TOI::TIED_TO); - if (ti != -1) { + unsigned ti; + if (MI.isRegTiedToDefOperand(i, &ti)) { DstReg = MI.getOperand(ti).getReg(); return true; } @@ -634,9 +634,11 @@ ProcessCopy(&*mi, &*mbbi, Processed); - for (unsigned si = 1, e = TID.getNumOperands(); si < e; ++si) { - int ti = TID.getOperandConstraint(si, TOI::TIED_TO); - if (ti == -1) + unsigned NumOps = (mi->getOpcode() == TargetInstrInfo::INLINEASM) + ? mi->getNumOperands() : TID.getNumOperands(); + for (unsigned si = 0; si < NumOps; ++si) { + unsigned ti = 0; + if (!mi->isRegTiedToDefOperand(si, &ti)) continue; if (FirstTied) { @@ -660,8 +662,7 @@ unsigned regA = mi->getOperand(ti).getReg(); unsigned regB = mi->getOperand(si).getReg(); - assert(TargetRegisterInfo::isVirtualRegister(regA) && - TargetRegisterInfo::isVirtualRegister(regB) && + assert(TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"); #ifndef NDEBUG @@ -669,7 +670,7 @@ // b + a for example) because our transformation will not work. This // should never occur because we are in SSA form. for (unsigned i = 0; i != mi->getNumOperands(); ++i) - assert((int)i == ti || + assert(i == ti || !mi->getOperand(i).isReg() || mi->getOperand(i).getReg() != regA); #endif @@ -753,7 +754,7 @@ } InstructionRearranged: - const TargetRegisterClass* rc = MRI->getRegClass(regA); + const TargetRegisterClass* rc = MRI->getRegClass(regB); MachineInstr *DefMI = MRI->getVRegDef(regB); // If it's safe and profitable, remat the definition instead of // copying it. Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86FloatingPoint.cpp?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86FloatingPoint.cpp Mon Mar 23 13:36:00 2009 @@ -1017,9 +1017,37 @@ case X86::MOV_Fp8032: case X86::MOV_Fp8064: case X86::MOV_Fp8080: { - unsigned SrcReg = getFPReg(MI->getOperand(1)); - unsigned DestReg = getFPReg(MI->getOperand(0)); + const MachineOperand &MO1 = MI->getOperand(1); + unsigned SrcReg = getFPReg(MO1); + const MachineOperand &MO0 = MI->getOperand(0); + // These can be created due to inline asm. Two address pass can introduce + // copies from RFP registers to virtual registers. + if (MO0.getReg() == X86::ST0 && SrcReg == 0) { + assert(MO1.isKill()); + // Treat %ST0 = MOV_Fp8080 %FP0 + // like FpSET_ST0_80 %FP0, %ST0 + assert((StackTop == 1 || StackTop == 2) + && "Stack should have one or two element on it to return!"); + --StackTop; // "Forget" we have something on the top of stack! + break; + } else if (MO0.getReg() == X86::ST1 && SrcReg == 1) { + assert(MO1.isKill()); + // Treat %ST1 = MOV_Fp8080 %FP1 + // like FpSET_ST1_80 %FP0, %ST1 + // StackTop can be 1 if a FpSET_ST0_* was before this. Exchange them. + if (StackTop == 1) { + BuildMI(*MBB, I, dl, TII->get(X86::XCH_F)).addReg(X86::ST1); + NumFXCH++; + StackTop = 0; + break; + } + assert(StackTop == 2 && "Stack should have two element on it to return!"); + --StackTop; // "Forget" we have something on the top of stack! + break; + } + + unsigned DestReg = getFPReg(MO0); if (MI->killsRegister(X86::FP0+SrcReg)) { // If the input operand is killed, we can just change the owner of the // incoming stack slot into the result. Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll Mon Mar 23 13:36:00 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc | grep {a: %ecx %ecx} -; RUN: llvm-as < %s | llc | grep {b: %ecx %edx %ecx} +; RUN: llvm-as < %s | llc | grep {a:} | not grep ax +; RUN: llvm-as < %s | llc | grep {b:} | not grep ax ; PR2078 ; The clobber list says that "ax" is clobbered. Make sure that eax isn't ; allocated to the input/output register. Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2008-09-18-inline-asm-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2008-09-18-inline-asm-2.ll?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2008-09-18-inline-asm-2.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2008-09-18-inline-asm-2.ll Mon Mar 23 13:36:00 2009 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep "#%ebp %eax %edx 8(%esi) %ebx (%edi)" -; RUN: llvm-as < %s | llc -march=x86 -regalloc=local | grep "#%ecx %eax %edx 8(%edi) %ebx (%esi)" +; RUN: llvm-as < %s | llc -march=x86 | grep "#%ebp %edi %esi 8(%edx) %eax (%ebx)" +; RUN: llvm-as < %s | llc -march=x86 -regalloc=local | grep "#%edi %edx %ebp 8(%ebx) %eax (%esi)" ; The 1st, 2nd, 3rd and 5th registers above must all be different. The registers ; referenced in the 4th and 6th operands must not be the same as the 1st or 5th ; operand. There are many combinations that work; this is what llc puts out now. Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll?rev=67546&r1=67545&r2=67546&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2008-12-19-EarlyClobberBug.ll Mon Mar 23 13:36:00 2009 @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | %prcontext End 1 | grep {movl.*%ecx} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | %prcontext End 2 | grep mov ; PR3149 +; Make sure the copy after inline asm is not coalesced away. @"\01LC" = internal constant [7 x i8] c"n0=%d\0A\00" ; <[7 x i8]*> [#uses=1] @llvm.used = appending global [1 x i8*] [ i8* bitcast (i32 (i64, i64)* @umoddi3 to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] Added: llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-2addr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-2addr.ll?rev=67546&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-2addr.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-2addr.ll Mon Mar 23 13:36:00 2009 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep movq | count 1 + +define i64 @t(i64 %a, i64 %b) nounwind ssp { +entry: + %asmtmp = tail call i64 asm "rorq $1,$0", "=r,J,0,~{dirflag},~{fpsr},~{flags},~{cc}"(i32 1, i64 %a) nounwind ; [#uses=1] + %asmtmp1 = tail call i64 asm "rorq $1,$0", "=r,J,0,~{dirflag},~{fpsr},~{flags},~{cc}"(i32 1, i64 %b) nounwind ; [#uses=1] + %0 = add i64 %asmtmp1, %asmtmp ; [#uses=1] + ret i64 %0 +} From isanbard at gmail.com Mon Mar 23 13:37:24 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 18:37:24 -0000 Subject: [llvm-commits] [llvm] r67547 - in /llvm/branches/Apple/Dib: lib/CodeGen/LowerSubregs.cpp test/CodeGen/X86/subreg-to-reg-2.ll Message-ID: <200903231837.n2NIbPQH024251@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 13:37:24 2009 New Revision: 67547 URL: http://llvm.org/viewvc/llvm-project?rev=67547&view=rev Log: --- Merging (from foreign repository) r67511 into '.': A test/CodeGen/X86/subreg-to-reg-2.ll U lib/CodeGen/LowerSubregs.cpp Do not fold away subreg_to_reg if the source register has a sub-register index. That means the source register is taking a sub-register of a larger register. e.g. On x86 %RAX = ... %RAX = SUBREG_TO_REG 0, %EAX:3, 3 The first def is defining RAX, not EAX so the top bits were not zero-extended. Added: llvm/branches/Apple/Dib/test/CodeGen/X86/subreg-to-reg-2.ll Modified: llvm/branches/Apple/Dib/lib/CodeGen/LowerSubregs.cpp Modified: llvm/branches/Apple/Dib/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/LowerSubregs.cpp?rev=67547&r1=67546&r2=67547&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/LowerSubregs.cpp Mon Mar 23 13:37:24 2009 @@ -165,11 +165,12 @@ unsigned DstReg = MI->getOperand(0).getReg(); unsigned InsReg = MI->getOperand(2).getReg(); - unsigned SubIdx = MI->getOperand(3).getImm(); + unsigned InsSIdx = MI->getOperand(2).getSubReg(); + unsigned SubIdx = MI->getOperand(3).getImm(); assert(SubIdx != 0 && "Invalid index for insert_subreg"); unsigned DstSubReg = TRI.getSubReg(DstReg, SubIdx); - + assert(TargetRegisterInfo::isPhysicalRegister(DstReg) && "Insert destination must be in a physical register"); assert(TargetRegisterInfo::isPhysicalRegister(InsReg) && @@ -177,8 +178,13 @@ DOUT << "subreg: CONVERTING: " << *MI; - if (DstSubReg == InsReg) { + if (DstSubReg == InsReg && InsSIdx == 0) { // No need to insert an identify copy instruction. + // Watch out for case like this: + // %RAX = ... + // %RAX = SUBREG_TO_REG 0, %EAX:3, 3 + // The first def is defining RAX, not EAX so the top bits were not + // zero extended. DOUT << "subreg: eliminated!"; } else { // Insert sub-register copy Added: llvm/branches/Apple/Dib/test/CodeGen/X86/subreg-to-reg-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/subreg-to-reg-2.ll?rev=67547&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/subreg-to-reg-2.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/subreg-to-reg-2.ll Mon Mar 23 13:37:24 2009 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl +; rdar://6707985 + + %XXOO = type { %"struct.XXC::XXCC", i8*, %"struct.XXC::XXOO::$_71" } + %XXValue = type opaque + %"struct.XXC::ArrayStorage" = type { i32, i32, i32, i8*, i8*, [1 x %XXValue*] } + %"struct.XXC::XXArray" = type { %XXOO, i32, %"struct.XXC::ArrayStorage"* } + %"struct.XXC::XXCC" = type { i32 (...)**, i8* } + %"struct.XXC::XXOO::$_71" = type { [2 x %XXValue*] } + +define internal fastcc %XXValue* @t(i64* %out, %"struct.XXC::ArrayStorage"* %tmp9) nounwind { +prologue: + %array = load %XXValue** inttoptr (i64 11111111 to %XXValue**) ; <%XXValue*> [#uses=0] + %index = load %XXValue** inttoptr (i64 22222222 to %XXValue**) ; <%XXValue*> [#uses=1] + %tmp = ptrtoint %XXValue* %index to i64 ; [#uses=2] + store i64 %tmp, i64* %out + %tmp6 = trunc i64 %tmp to i32 ; [#uses=1] + br label %bb5 + +bb5: ; preds = %prologue + %tmp10 = zext i32 %tmp6 to i64 ; [#uses=1] + %tmp11 = getelementptr %"struct.XXC::ArrayStorage"* %tmp9, i64 0, i32 5, i64 %tmp10 ; <%XXValue**> [#uses=1] + %tmp12 = load %XXValue** %tmp11, align 8 ; <%XXValue*> [#uses=1] + ret %XXValue* %tmp12 +} From gohman at apple.com Mon Mar 23 15:20:55 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 23 Mar 2009 20:20:55 -0000 Subject: [llvm-commits] [llvm] r67554 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200903232020.n2NKKuLt028172@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 15:20:43 2009 New Revision: 67554 URL: http://llvm.org/viewvc/llvm-project?rev=67554&view=rev Log: When unfolding a load during scheduling, the new operator node has a data dependency on the load node, so it really needs a data-dependence edge to the load node, even if the load previously existed. And add a few comments. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=67554&r1=67553&r2=67554&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Mar 23 15:20:43 2009 @@ -410,6 +410,7 @@ NewSU->isCommutable = true; ComputeLatency(NewSU); + // Record all the edges to and from the old SU, by category. SmallVector ChainPreds; SmallVector ChainSuccs; SmallVector LoadPreds; @@ -433,6 +434,7 @@ NodeSuccs.push_back(*I); } + // Now assign edges to the newly-created nodes. for (unsigned i = 0, e = ChainPreds.size(); i != e; ++i) { const SDep &Pred = ChainPreds[i]; RemovePred(SU, Pred); @@ -468,9 +470,10 @@ AddPred(SuccDep, D); } } - if (isNewLoad) { - AddPred(NewSU, SDep(LoadSU, SDep::Order, LoadSU->Latency)); - } + + // Add a data dependency to reflect that NewSU reads the value defined + // by LoadSU. + AddPred(NewSU, SDep(LoadSU, SDep::Data, LoadSU->Latency)); if (isNewLoad) AvailableQueue->addNode(LoadSU); From isanbard at gmail.com Mon Mar 23 15:24:21 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 20:24:21 -0000 Subject: [llvm-commits] [llvm] r67555 - in /llvm/branches/Apple/Dib/utils/TableGen: AsmWriterEmitter.cpp TGLexer.cpp Message-ID: <200903232024.n2NKOLiJ028349@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 15:24:09 2009 New Revision: 67555 URL: http://llvm.org/viewvc/llvm-project?rev=67555&view=rev Log: --- Reverse-merging (from foreign repository) r66958 into '.': U utils/TableGen/AsmWriterEmitter.cpp U utils/TableGen/TGLexer.cpp Revert r66958. Modified: llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp Modified: llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp?rev=67555&r1=67554&r2=67555&view=diff ============================================================================== --- llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp (original) +++ llvm/branches/Apple/Dib/utils/TableGen/AsmWriterEmitter.cpp Mon Mar 23 15:24:09 2009 @@ -130,20 +130,11 @@ // Emit a constant string fragment. if (DollarPos != LastEmitted) { - if (CurVariant == Variant || CurVariant == ~0U) { - for (; LastEmitted != DollarPos; ++LastEmitted) - switch (AsmString[LastEmitted]) { - case '\n': AddLiteralString("\\n"); break; - case '\t': AddLiteralString("\\t"); break; - case '"': AddLiteralString("\\\""); break; - case '\\': AddLiteralString("\\\\"); break; - default: - AddLiteralString(std::string(1, AsmString[LastEmitted])); - break; - } - } else { - LastEmitted = DollarPos; - } + // TODO: this should eventually handle escaping. + if (CurVariant == Variant || CurVariant == ~0U) + AddLiteralString(std::string(AsmString.begin()+LastEmitted, + AsmString.begin()+DollarPos)); + LastEmitted = DollarPos; } else if (AsmString[DollarPos] == '\\') { if (DollarPos+1 != AsmString.size() && (CurVariant == Variant || CurVariant == ~0U)) { Modified: llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp?rev=67555&r1=67554&r2=67555&view=diff ============================================================================== --- llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp (original) +++ llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp Mon Mar 23 15:24:09 2009 @@ -174,11 +174,11 @@ CurStrVal += *CurPtr++; break; case 't': - CurStrVal += '\t'; + CurStrVal += "\\t"; ++CurPtr; break; case 'n': - CurStrVal += '\n'; + CurStrVal += "\\n"; ++CurPtr; break; From isanbard at gmail.com Mon Mar 23 15:26:16 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 20:26:16 -0000 Subject: [llvm-commits] [llvm] r67556 - /llvm/tags/Apple/llvmCore-2104.1/ Message-ID: <200903232026.n2NKQHFv028418@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 15:26:13 2009 New Revision: 67556 URL: http://llvm.org/viewvc/llvm-project?rev=67556&view=rev Log: Creating llvmCore-2104.1 from llvmCore-2104. Added: llvm/tags/Apple/llvmCore-2104.1/ - copied from r67555, llvm/tags/Apple/llvmCore-2104/ From isanbard at gmail.com Mon Mar 23 15:27:02 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 20:27:02 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67557 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2104.1/ Message-ID: <200903232027.n2NKR2Sx028459@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 15:27:01 2009 New Revision: 67557 URL: http://llvm.org/viewvc/llvm-project?rev=67557&view=rev Log: Creating llvmgcc42-2104.1 from llvmgcc42-2104. Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2104.1/ - copied from r67556, llvm-gcc-4.2/tags/Apple/llvmgcc42-2104/ From isanbard at gmail.com Mon Mar 23 15:33:05 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 20:33:05 -0000 Subject: [llvm-commits] [llvm] r67558 - in /llvm/tags/Apple/llvmCore-2104.1/utils/TableGen: AsmWriterEmitter.cpp TGLexer.cpp Message-ID: <200903232033.n2NKX5do028667@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 15:33:03 2009 New Revision: 67558 URL: http://llvm.org/viewvc/llvm-project?rev=67558&view=rev Log: --- Reverse-merging r66958 into '.': U utils/TableGen/AsmWriterEmitter.cpp U utils/TableGen/TGLexer.cpp Revert r66958. Modified: llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/AsmWriterEmitter.cpp llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp Modified: llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/AsmWriterEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/AsmWriterEmitter.cpp?rev=67558&r1=67557&r2=67558&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/AsmWriterEmitter.cpp (original) +++ llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/AsmWriterEmitter.cpp Mon Mar 23 15:33:03 2009 @@ -130,20 +130,11 @@ // Emit a constant string fragment. if (DollarPos != LastEmitted) { - if (CurVariant == Variant || CurVariant == ~0U) { - for (; LastEmitted != DollarPos; ++LastEmitted) - switch (AsmString[LastEmitted]) { - case '\n': AddLiteralString("\\n"); break; - case '\t': AddLiteralString("\\t"); break; - case '"': AddLiteralString("\\\""); break; - case '\\': AddLiteralString("\\\\"); break; - default: - AddLiteralString(std::string(1, AsmString[LastEmitted])); - break; - } - } else { - LastEmitted = DollarPos; - } + // TODO: this should eventually handle escaping. + if (CurVariant == Variant || CurVariant == ~0U) + AddLiteralString(std::string(AsmString.begin()+LastEmitted, + AsmString.begin()+DollarPos)); + LastEmitted = DollarPos; } else if (AsmString[DollarPos] == '\\') { if (DollarPos+1 != AsmString.size() && (CurVariant == Variant || CurVariant == ~0U)) { Modified: llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp?rev=67558&r1=67557&r2=67558&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp (original) +++ llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp Mon Mar 23 15:33:03 2009 @@ -174,11 +174,11 @@ CurStrVal += *CurPtr++; break; case 't': - CurStrVal += '\t'; + CurStrVal += "\\t"; ++CurPtr; break; case 'n': - CurStrVal += '\n'; + CurStrVal += "\\n"; ++CurPtr; break; From ojomojo at gmail.com Mon Mar 23 16:00:46 2009 From: ojomojo at gmail.com (John Mosby) Date: Mon, 23 Mar 2009 21:00:46 -0000 Subject: [llvm-commits] [llvm] r67560 - /llvm/trunk/README.txt Message-ID: <200903232100.n2NL0kJo029825@zion.cs.uiuc.edu> Author: jdm Date: Mon Mar 23 16:00:45 2009 New Revision: 67560 URL: http://llvm.org/viewvc/llvm-project?rev=67560&view=rev Log: README.txt: test commit w/blank line appended Modified: llvm/trunk/README.txt Modified: llvm/trunk/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/README.txt?rev=67560&r1=67559&r2=67560&view=diff ============================================================================== --- llvm/trunk/README.txt (original) +++ llvm/trunk/README.txt Mon Mar 23 16:00:45 2009 @@ -10,3 +10,4 @@ Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. + From dalej at apple.com Mon Mar 23 16:16:54 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 23 Mar 2009 21:16:54 -0000 Subject: [llvm-commits] [llvm] r67562 - in /llvm/trunk: lib/AsmParser/LLLexer.cpp lib/AsmParser/LLLexer.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Support/APFloat.cpp lib/Target/CBackend/CBackend.cpp lib/VMCore/AsmWriter.cpp test/CodeGen/X86/2009-03-23-i80-fp80.ll Message-ID: <200903232116.n2NLGstJ030407@zion.cs.uiuc.edu> Author: johannes Date: Mon Mar 23 16:16:53 2009 New Revision: 67562 URL: http://llvm.org/viewvc/llvm-project?rev=67562&view=rev Log: Fix internal representation of fp80 to be the same as a normal i80 {low64, high16} rather than its own {high64, low16}. A depressing number of places know about this; I think I got them all. Bitcode readers and writers convert back to the old form to avoid breaking compatibility. Added: llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/AsmParser/LLLexer.h llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/Support/APFloat.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Mon Mar 23 16:16:53 2009 @@ -115,6 +115,37 @@ Error("constant bigger than 128 bits detected!"); } +/// FP80HexToIntPair - translate an 80 bit FP80 number (20 hexits) into +/// { low64, high16 } as usual for an APInt. +void LLLexer::FP80HexToIntPair(const char *Buffer, const char *End, + uint64_t Pair[2]) { + Pair[1] = 0; + for (int i=0; i<4 && Buffer != End; i++, Buffer++) { + assert(Buffer != End); + Pair[1] *= 16; + char C = *Buffer; + if (C >= '0' && C <= '9') + Pair[1] += C-'0'; + else if (C >= 'A' && C <= 'F') + Pair[1] += C-'A'+10; + else if (C >= 'a' && C <= 'f') + Pair[1] += C-'a'+10; + } + Pair[0] = 0; + for (int i=0; i<16; i++, Buffer++) { + Pair[0] *= 16; + char C = *Buffer; + if (C >= '0' && C <= '9') + Pair[0] += C-'0'; + else if (C >= 'A' && C <= 'F') + Pair[0] += C-'A'+10; + else if (C >= 'a' && C <= 'f') + Pair[0] += C-'a'+10; + } + if (Buffer != End) + Error("constant bigger than 128 bits detected!"); +} + // UnEscapeLexed - Run through the specified buffer and change \xx codes to the // appropriate character. static void UnEscapeLexed(std::string &Str) { @@ -670,19 +701,21 @@ } uint64_t Pair[2]; - HexToIntPair(TokStart+3, CurPtr, Pair); switch (Kind) { default: assert(0 && "Unknown kind!"); case 'K': // F80HexFPConstant - x87 long double in hexadecimal format (10 bytes) + FP80HexToIntPair(TokStart+3, CurPtr, Pair); APFloatVal = APFloat(APInt(80, 2, Pair)); return lltok::APFloat; case 'L': // F128HexFPConstant - IEEE 128-bit in hexadecimal format (16 bytes) + HexToIntPair(TokStart+3, CurPtr, Pair); APFloatVal = APFloat(APInt(128, 2, Pair), true); return lltok::APFloat; case 'M': // PPC128HexFPConstant - PowerPC 128-bit in hexadecimal format (16 bytes) + HexToIntPair(TokStart+3, CurPtr, Pair); APFloatVal = APFloat(APInt(128, 2, Pair)); return lltok::APFloat; } Modified: llvm/trunk/lib/AsmParser/LLLexer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.h?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.h (original) +++ llvm/trunk/lib/AsmParser/LLLexer.h Mon Mar 23 16:16:53 2009 @@ -77,6 +77,7 @@ uint64_t atoull(const char *Buffer, const char *End); uint64_t HexIntToVal(const char *Buffer, const char *End); void HexToIntPair(const char *Buffer, const char *End, uint64_t Pair[2]); + void FP80HexToIntPair(const char *Buff, const char *End, uint64_t Pair[2]); }; } // end namespace llvm Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Mar 23 16:16:53 2009 @@ -801,9 +801,13 @@ V = ConstantFP::get(APFloat(APInt(32, (uint32_t)Record[0]))); else if (CurTy == Type::DoubleTy) V = ConstantFP::get(APFloat(APInt(64, Record[0]))); - else if (CurTy == Type::X86_FP80Ty) - V = ConstantFP::get(APFloat(APInt(80, 2, &Record[0]))); - else if (CurTy == Type::FP128Ty) + else if (CurTy == Type::X86_FP80Ty) { + // Bits are not stored the same way as a normal i80 APInt, compensate. + uint64_t Rearrange[2]; + Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16); + Rearrange[1] = Record[0] >> 48; + V = ConstantFP::get(APFloat(APInt(80, 2, Rearrange))); + } else if (CurTy == Type::FP128Ty) V = ConstantFP::get(APFloat(APInt(128, 2, &Record[0]), true)); else if (CurTy == Type::PPC_FP128Ty) V = ConstantFP::get(APFloat(APInt(128, 2, &Record[0]))); Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Mar 23 16:16:53 2009 @@ -559,10 +559,11 @@ Record.push_back(CFP->getValueAPF().bitcastToAPInt().getZExtValue()); } else if (Ty == Type::X86_FP80Ty) { // api needed to prevent premature destruction + // bits are not in the same order as a normal i80 APInt, compensate. APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); - Record.push_back(p[0]); - Record.push_back((uint16_t)p[1]); + Record.push_back((p[1] << 48) | (p[0] >> 16)); + Record.push_back(p[0] & 0xffffLL); } else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) { APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Mar 23 16:16:53 2009 @@ -1046,10 +1046,13 @@ DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); if (TD->isBigEndian()) { - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) << '\t' << TAI->getCommentString() << " long double most significant halfword of ~" << DoubleVal.convertToDouble() << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) + << '\t' << TAI->getCommentString() + << " long double next halfword\n"; O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32) << '\t' << TAI->getCommentString() << " long double next halfword\n"; @@ -1058,18 +1061,12 @@ << " long double next halfword\n"; O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) - << '\t' << TAI->getCommentString() << " long double least significant halfword\n"; } else { - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) << '\t' << TAI->getCommentString() << " long double least significant halfword of ~" << DoubleVal.convertToDouble() << '\n'; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16) << '\t' << TAI->getCommentString() << " long double next halfword\n"; @@ -1078,6 +1075,9 @@ << " long double next halfword\n"; O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) << '\t' << TAI->getCommentString() + << " long double next halfword\n"; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) + << '\t' << TAI->getCommentString() << " long double most significant halfword\n"; } EmitZeros(TD->getTypePaddedSize(Type::X86_FP80Ty) - Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon Mar 23 16:16:53 2009 @@ -2603,10 +2603,9 @@ } uint64_t words[2]; - words[0] = ((uint64_t)(sign & 1) << 63) | - ((myexponent & 0x7fffLL) << 48) | - ((mysignificand >>16) & 0xffffffffffffLL); - words[1] = mysignificand & 0xffff; + words[0] = mysignificand; + words[1] = ((uint64_t)(sign & 1) << 15) | + (myexponent & 0x7fffLL); return APInt(80, 2, words); } @@ -2764,14 +2763,13 @@ assert(api.getBitWidth()==80); uint64_t i1 = api.getRawData()[0]; uint64_t i2 = api.getRawData()[1]; - uint64_t myexponent = (i1 >> 48) & 0x7fff; - uint64_t mysignificand = ((i1 << 16) & 0xffffffffffff0000ULL) | - (i2 & 0xffff); + uint64_t myexponent = (i2 & 0x7fff); + uint64_t mysignificand = i1; initialize(&APFloat::x87DoubleExtended); assert(partCount()==2); - sign = static_cast(i1>>63); + sign = static_cast(i2>>15); if (myexponent==0 && mysignificand==0) { // exponent, significand meaningless category = fcZero; Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Mon Mar 23 16:16:53 2009 @@ -2087,9 +2087,8 @@ APInt api = FPC->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Out << "static const ConstantFP80Ty FPConstant" << FPCounter++ - << " = { 0x" - << utohexstr((uint16_t)p[1] | (p[0] & 0xffffffffffffLL)<<16) - << "ULL, 0x" << utohexstr((uint16_t)(p[0] >> 48)) << ",{0,0,0}" + << " = { 0x" << utohexstr(p[0]) + << "ULL, 0x" << utohexstr((uint16_t)p[1]) << ",{0,0,0}" << "}; /* Long double constant */\n"; } else if (FPC->getType() == Type::PPC_FP128Ty) { APInt api = FPC->getValueAPF().bitcastToAPInt(); Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=67562&r1=67561&r2=67562&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Mar 23 16:16:53 2009 @@ -797,9 +797,29 @@ // Some form of long double. These appear as a magic letter identifying // the type, then a fixed number of hex digits. Out << "0x"; - if (&CFP->getValueAPF().getSemantics() == &APFloat::x87DoubleExtended) + if (&CFP->getValueAPF().getSemantics() == &APFloat::x87DoubleExtended) { Out << 'K'; - else if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEquad) + // api needed to prevent premature destruction + APInt api = CFP->getValueAPF().bitcastToAPInt(); + const uint64_t* p = api.getRawData(); + uint64_t word = p[1]; + int shiftcount=12; + int width = api.getBitWidth(); + for (int j=0; j>shiftcount) & 15; + if (nibble < 10) + Out << (unsigned char)(nibble + '0'); + else + Out << (unsigned char)(nibble - 10 + 'A'); + if (shiftcount == 0 && j+4 < width) { + word = *p; + shiftcount = 64; + if (width-j-4 < 64) + shiftcount = width-j-4; + } + } + return; + } else if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEquad) Out << 'L'; else if (&CFP->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble) Out << 'M'; Added: llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll?rev=67562&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-03-23-i80-fp80.ll Mon Mar 23 16:16:53 2009 @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 302245289961712575840256 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep K40018000000000000000 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin9" + +define i80 @from() { + %tmp = bitcast x86_fp80 0xK4000C000000000000000 to i80 + ret i80 %tmp +} + +define x86_fp80 @to() { + %tmp = bitcast i80 302259125019767858003968 to x86_fp80 + ret x86_fp80 %tmp +} From dalej at apple.com Mon Mar 23 16:18:01 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 23 Mar 2009 21:18:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67563 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200903232118.n2NLI130030455@zion.cs.uiuc.edu> Author: johannes Date: Mon Mar 23 16:18:00 2009 New Revision: 67563 URL: http://llvm.org/viewvc/llvm-project?rev=67563&view=rev Log: Fix fp80 internal representation to use {low64, high16} like a normal i80. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=67563&r1=67562&r2=67563&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Mar 23 16:18:00 2009 @@ -6413,12 +6413,9 @@ long RealArr[4]; uint64_t UArr[2]; REAL_VALUE_TO_TARGET_LONG_DOUBLE(TREE_REAL_CST(exp), RealArr); - - UArr[0] = ((uint64_t)((uint16_t)RealArr[2]) << 48) | - ((uint64_t)((uint32_t)RealArr[1]) << 16) | - ((uint64_t)((uint16_t)(RealArr[0] >> 16))); - UArr[1] = (uint16_t)RealArr[0]; - + UArr[0] = ((uint64_t)((uint32_t)RealArr[0])) | + ((uint64_t)((uint32_t)RealArr[1]) << 32); + UArr[1] = (uint16_t)RealArr[2]; return ConstantFP::get(APFloat(APInt(80, 2, UArr))); } else if (Ty==Type::PPC_FP128Ty) { long RealArr[4]; From kremenek at apple.com Mon Mar 23 16:54:33 2009 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 23 Mar 2009 21:54:33 -0000 Subject: [llvm-commits] [llvm] r67565 - /llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Message-ID: <200903232154.n2NLsXE3032157@zion.cs.uiuc.edu> Author: kremenek Date: Mon Mar 23 16:54:33 2009 New Revision: 67565 URL: http://llvm.org/viewvc/llvm-project?rev=67565&view=rev Log: Add sanity check in Clang TableGen backend to check if 'Component' is a string. Modified: llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Modified: llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=67565&r1=67564&r2=67565&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Mon Mar 23 16:54:33 2009 @@ -113,7 +113,7 @@ continue; const StringInit* SV = dynamic_cast(V->getValue()); - if (SV->getValue() != Component) + if (!SV || SV->getValue() != Component) continue; } From isanbard at gmail.com Mon Mar 23 17:18:34 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 22:18:34 -0000 Subject: [llvm-commits] [llvm] r67566 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/LiveIntervalAnalysis.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegAllocLinearScan.cpp test/CodeGen/X86/inline-asm-out-regs.ll Message-ID: <200903232218.n2NMIZ2f000793@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 17:18:34 2009 New Revision: 67566 URL: http://llvm.org/viewvc/llvm-project?rev=67566&view=rev Log: --- Merging (from foreign repository) r67544 into '.': A test/CodeGen/X86/inline-asm-out-regs.ll U include/llvm/CodeGen/LiveIntervalAnalysis.h U lib/CodeGen/LiveIntervalAnalysis.cpp U lib/CodeGen/RegAllocLinearScan.cpp Fix PR3391 and PR3864. Reg allocator infinite looping. Added: llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-out-regs.ll Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=67566&r1=67565&r2=67566&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/branches/Apple/Dib/include/llvm/CodeGen/LiveIntervalAnalysis.h Mon Mar 23 17:18:34 2009 @@ -367,8 +367,9 @@ VirtRegMap &vrm, float& SSWeight); /// spillPhysRegAroundRegDefsUses - Spill the specified physical register - /// around all defs and uses of the specified interval. - void spillPhysRegAroundRegDefsUses(const LiveInterval &li, + /// around all defs and uses of the specified interval. Return true if it + /// was able to cut its interval. + bool spillPhysRegAroundRegDefsUses(const LiveInterval &li, unsigned PhysReg, VirtRegMap &vrm); /// isReMaterializable - Returns true if every definition of MI of every Modified: llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=67566&r1=67565&r2=67566&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Mar 23 17:18:34 2009 @@ -2214,8 +2214,9 @@ } /// spillPhysRegAroundRegDefsUses - Spill the specified physical register -/// around all defs and uses of the specified interval. -void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li, +/// around all defs and uses of the specified interval. Return true if it +/// was able to cut its interval. +bool LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li, unsigned PhysReg, VirtRegMap &vrm) { unsigned SpillReg = getRepresentativeReg(PhysReg); @@ -2226,6 +2227,7 @@ assert(*AS == SpillReg || !allocatableRegs_[*AS] || tri_->isSuperRegister(*AS, SpillReg)); + bool Cut = false; LiveInterval &pli = getInterval(SpillReg); SmallPtrSet SeenMIs; for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(li.reg), @@ -2240,9 +2242,10 @@ vrm.addEmergencySpill(SpillReg, MI); unsigned StartIdx = getLoadIndex(Index); unsigned EndIdx = getStoreIndex(Index)+1; - if (pli.isInOneLiveRange(StartIdx, EndIdx)) + if (pli.isInOneLiveRange(StartIdx, EndIdx)) { pli.removeRange(StartIdx, EndIdx); - else { + Cut = true; + } else { cerr << "Ran out of registers during register allocation!\n"; if (MI->getOpcode() == TargetInstrInfo::INLINEASM) { cerr << "Please check your inline asm statement for invalid " @@ -2260,6 +2263,7 @@ } } } + return Cut; } LiveRange LiveIntervals::addLiveRangeToEndOfBlock(unsigned reg, Modified: llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp?rev=67566&r1=67565&r2=67566&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/RegAllocLinearScan.cpp Mon Mar 23 17:18:34 2009 @@ -869,8 +869,12 @@ if (cur->weight == HUGE_VALF || li_->getApproximateInstructionCount(*cur) == 0) { // Spill a physical register around defs and uses. - li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_); - assignRegOrStackSlotAtInterval(cur); + if (li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_)) + assignRegOrStackSlotAtInterval(cur); + else { + cerr << "Ran out of registers during register allocation!\n"; + exit(1); + } return; } } Added: llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-out-regs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-out-regs.ll?rev=67566&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-out-regs.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/inline-asm-out-regs.ll Mon Mar 23 17:18:34 2009 @@ -0,0 +1,42 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu +; XFAIL: * +; Expected to run out of registers during allocation. +; PR3391 + + at pci_indirect = external global { } ; <{ }*> [#uses=1] + at pcibios_last_bus = external global i32 ; [#uses=2] + +define void @pci_pcbios_init() nounwind section ".init.text" { +entry: + br label %bb1.i + +bb1.i: ; preds = %bb6.i.i, %bb1.i, %entry + %0 = load i32* null, align 8 ; [#uses=1] + %1 = icmp ugt i32 %0, 1048575 ; [#uses=1] + br i1 %1, label %bb2.i, label %bb1.i + +bb2.i: ; preds = %bb1.i + %asmtmp.i.i = tail call { i32, i32, i32, i32 } asm "lcall *(%edi); cld\0A\09jc 1f\0A\09xor %ah, %ah\0A1:", "={dx},={ax},={bx},={cx},1,{di},~{dirflag},~{fpsr},~{flags},~{memory}"(i32 45313, { }* @pci_indirect) nounwind ; <{ i32, i32, i32, i32 }> [#uses=2] + %asmresult2.i.i = extractvalue { i32, i32, i32, i32 } %asmtmp.i.i, 1 + ; [#uses=1] + %2 = lshr i32 %asmresult2.i.i, 8 ; [#uses=1] + %3 = trunc i32 %2 to i8 ; [#uses=1] + %4 = load i32* @pcibios_last_bus, align 4 ; [#uses=1] + %5 = icmp slt i32 %4, 0 ; [#uses=1] + br i1 %5, label %bb5.i.i, label %bb6.i.i + +bb5.i.i: ; preds = %bb2.i + %asmresult4.i.i = extractvalue { i32, i32, i32, i32 } %asmtmp.i.i, 3 + ; [#uses=1] + %6 = and i32 %asmresult4.i.i, 255 ; [#uses=1] + store i32 %6, i32* @pcibios_last_bus, align 4 + br label %bb6.i.i + +bb6.i.i: ; preds = %bb5.i.i, %bb2.i + %7 = icmp eq i8 %3, 0 ; [#uses=1] + %or.cond.i.i = and i1 %7, false ; [#uses=1] + br i1 %or.cond.i.i, label %bb1.i, label %bb8.i.i + +bb8.i.i: ; preds = %bb6.i.i + unreachable +} From dalej at apple.com Mon Mar 23 17:26:11 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 23 Mar 2009 22:26:11 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67567 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200903232226.n2NMQCLn001321@zion.cs.uiuc.edu> Author: johannes Date: Mon Mar 23 17:26:11 2009 New Revision: 67567 URL: http://llvm.org/viewvc/llvm-project?rev=67567&view=rev Log: Temporary to give this an svn checkin number. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67567&r1=67566&r2=67567&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon Mar 23 17:26:11 2009 @@ -310,9 +310,11 @@ /// source line - "llvm.dbg.stoppoint." void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { +#if 0 // Do not emit line number info, for now. if (optimize) return; +#endif // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && From dalej at apple.com Mon Mar 23 17:26:40 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 23 Mar 2009 22:26:40 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67568 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200903232226.n2NMQeHB001366@zion.cs.uiuc.edu> Author: johannes Date: Mon Mar 23 17:26:39 2009 New Revision: 67568 URL: http://llvm.org/viewvc/llvm-project?rev=67568&view=rev Log: Revert previous. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67568&r1=67567&r2=67568&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon Mar 23 17:26:39 2009 @@ -310,11 +310,9 @@ /// source line - "llvm.dbg.stoppoint." void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { -#if 0 // Do not emit line number info, for now. if (optimize) return; -#endif // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && From kremenek at apple.com Mon Mar 23 17:32:43 2009 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 23 Mar 2009 22:32:43 -0000 Subject: [llvm-commits] [llvm] r67571 - /llvm/tags/checker/checker-0.180/ Message-ID: <200903232232.n2NMWhvV001794@zion.cs.uiuc.edu> Author: kremenek Date: Mon Mar 23 17:32:43 2009 New Revision: 67571 URL: http://llvm.org/viewvc/llvm-project?rev=67571&view=rev Log: Tagging checker-0.180. Added: llvm/tags/checker/checker-0.180/ - copied from r67570, llvm/trunk/ From eli.friedman at gmail.com Mon Mar 23 17:36:56 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 23 Mar 2009 15:36:56 -0700 Subject: [llvm-commits] [llvm] r67502 - /llvm/trunk/lib/Target/X86/X86CallingConv.td In-Reply-To: <49C75F57.404@wxs.nl> References: <200903230428.n2N4SOp2000430@zion.cs.uiuc.edu> <49C75F57.404@wxs.nl> Message-ID: On Mon, Mar 23, 2009 at 3:07 AM, Frits van Bommel wrote: > Is this "convention" documented anywhere? No... AFAIK, the C front-ends don't use the i8 and i16 cases, and only use the i32 case implicitly by returning an i64. Using DL seems reasonable to me. > In my case, packing two i8 values into an i16 isn't a solution since the > first value might be an i16/i32/i64 (on x86-64). So pack the values into an i32/i64/i128... that's what the the C front-ends do on x86 on Darwin. (Note that Darwin differs from the standard x86 ABI in a number of places...) -Eli From evan.cheng at apple.com Mon Mar 23 17:57:19 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 23 Mar 2009 22:57:19 -0000 Subject: [llvm-commits] [llvm] r67574 - in /llvm/trunk: lib/CodeGen/RegAllocLinearScan.cpp test/CodeGen/X86/2009-03-23-LinearScanBug.ll Message-ID: <200903232257.n2NMvJXn003091@zion.cs.uiuc.edu> Author: evancheng Date: Mon Mar 23 17:57:19 2009 New Revision: 67574 URL: http://llvm.org/viewvc/llvm-project?rev=67574&view=rev Log: Fix a bug in spill weight computation. If the alias is a super-register, and the super-register is in the register class we are trying to allocate. Then add the weight to all sub-registers of the super-register even if they are not aliases. e.g. allocating for GR32, bh is not used, updating bl spill weight. bl should get the same spill weight otherwise it will be choosen as a spill candidate since spilling bh doesn't make ebx available. This fix PR2866. Added: llvm/trunk/test/CodeGen/X86/2009-03-23-LinearScanBug.ll Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=67574&r1=67573&r2=67574&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Mon Mar 23 17:57:19 2009 @@ -155,6 +155,10 @@ /// is available, or spill. void assignRegOrStackSlotAtInterval(LiveInterval* cur); + void updateSpillWeights(std::vector &Weights, + unsigned reg, float weight, + const TargetRegisterClass *RC); + /// findIntervalsToSpill - Determine the intervals to spill for the /// specified interval. It's passed the physical registers whose spill /// weight is the lowest among all the registers whose live intervals @@ -515,12 +519,35 @@ /// updateSpillWeights - updates the spill weights of the specifed physical /// register and its weight. -static void updateSpillWeights(std::vector &Weights, - unsigned reg, float weight, - const TargetRegisterInfo *TRI) { +void RALinScan::updateSpillWeights(std::vector &Weights, + unsigned reg, float weight, + const TargetRegisterClass *RC) { + SmallSet Processed; + SmallSet SuperAdded; + SmallVector Supers; Weights[reg] += weight; - for (const unsigned* as = TRI->getAliasSet(reg); *as; ++as) + Processed.insert(reg); + for (const unsigned* as = tri_->getAliasSet(reg); *as; ++as) { Weights[*as] += weight; + Processed.insert(*as); + if (tri_->isSubRegister(*as, reg) && + SuperAdded.insert(*as) && + RC->contains(*as)) { + Supers.push_back(*as); + } + } + + // If the alias is a super-register, and the super-register is in the + // register class we are trying to allocate. Then add the weight to all + // sub-registers of the super-register even if they are not aliases. + // e.g. allocating for GR32, bh is not used, updating bl spill weight. + // bl should get the same spill weight otherwise it will be choosen + // as a spill candidate since spilling bh doesn't make ebx available. + for (unsigned i = 0, e = Supers.size(); i != e; ++i) { + for (const unsigned *sr = tri_->getSubRegisters(Supers[i]); *sr; ++sr) + if (!Processed.count(*sr)) + Weights[*sr] += weight; + } } static @@ -817,7 +844,7 @@ std::vector SpillWeights(tri_->getNumRegs(), 0.0f); for (std::vector >::iterator I = SpillWeightsToAdd.begin(), E = SpillWeightsToAdd.end(); I != E; ++I) - updateSpillWeights(SpillWeights, I->first, I->second, tri_); + updateSpillWeights(SpillWeights, I->first, I->second, RC); // for each interval in active, update spill weights. for (IntervalPtrs::const_iterator i = active_.begin(), e = active_.end(); @@ -826,14 +853,14 @@ assert(TargetRegisterInfo::isVirtualRegister(reg) && "Can only allocate virtual registers!"); reg = vrm_->getPhys(reg); - updateSpillWeights(SpillWeights, reg, i->first->weight, tri_); + updateSpillWeights(SpillWeights, reg, i->first->weight, RC); } DOUT << "\tassigning stack slot at interval "<< *cur << ":\n"; // Find a register to spill. float minWeight = HUGE_VALF; - unsigned minReg = 0; /*cur->preference*/; // Try the preferred register first. + unsigned minReg = 0; /*cur->preference*/; // Try the pref register first. bool Found = false; std::vector > RegsWeights; Added: llvm/trunk/test/CodeGen/X86/2009-03-23-LinearScanBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-23-LinearScanBug.ll?rev=67574&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-23-LinearScanBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-03-23-LinearScanBug.ll Mon Mar 23 17:57:19 2009 @@ -0,0 +1,23 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -fast + +define fastcc void @optimize_bit_field() nounwind { +bb4: + %a = load i32* null ; [#uses=1] + %s = load i32* getelementptr (i32* null, i32 1) ; [#uses=1] + %z = load i32* getelementptr (i32* null, i32 2) ; [#uses=1] + %r = bitcast i32 0 to i32 ; [#uses=1] + %q = trunc i32 %z to i8 ; [#uses=1] + %b = icmp eq i8 0, %q ; [#uses=1] + br i1 %b, label %bb73, label %bb72 + +bb72: ; preds = %bb4 + %f = tail call fastcc i32 @gen_lowpart(i32 %r, i32 %a) nounwind ; [#uses=1] + br label %bb73 + +bb73: ; preds = %bb72, %bb4 + %y = phi i32 [ %f, %bb72 ], [ %s, %bb4 ] ; [#uses=1] + store i32 %y, i32* getelementptr (i32* null, i32 3) + unreachable +} + +declare fastcc i32 @gen_lowpart(i32, i32) nounwind From dalej at apple.com Mon Mar 23 18:39:20 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 23 Mar 2009 23:39:20 -0000 Subject: [llvm-commits] [llvm] r67578 - in /llvm/trunk: include/llvm/Transforms/IPO/InlinerPass.h lib/Transforms/IPO/Inliner.cpp Message-ID: <200903232339.n2NNdKpX005647@zion.cs.uiuc.edu> Author: johannes Date: Mon Mar 23 18:39:20 2009 New Revision: 67578 URL: http://llvm.org/viewvc/llvm-project?rev=67578&view=rev Log: Use a SmallPtrSet instead of std::set. Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h llvm/trunk/lib/Transforms/IPO/Inliner.cpp Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h?rev=67578&r1=67577&r2=67578&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h (original) +++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h Mon Mar 23 18:39:20 2009 @@ -20,7 +20,6 @@ #include "llvm/CallGraphSCCPass.h" #include "llvm/Transforms/Utils/InlineCost.h" #include "llvm/Target/TargetData.h" -#include namespace llvm { @@ -48,7 +47,7 @@ // InlineCallIfPossible bool InlineCallIfPossible(CallSite CS, CallGraph &CG, - const std::set &SCCFunctions, + const SmallPtrSet &SCCFunctions, const TargetData &TD); /// This method returns the value specified by the -inline-threshold value, Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=67578&r1=67577&r2=67578&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon Mar 23 18:39:20 2009 @@ -52,7 +52,7 @@ // InlineCallIfPossible - If it is possible to inline the specified call site, // do so and update the CallGraph for this operation. bool Inliner::InlineCallIfPossible(CallSite CS, CallGraph &CG, - const std::set &SCCFunctions, + const SmallPtrSet &SCCFunctions, const TargetData &TD) { Function *Callee = CS.getCalledFunction(); Function *Caller = CS.getCaller(); @@ -128,7 +128,7 @@ CallGraph &CG = getAnalysis(); TargetData &TD = getAnalysis(); - std::set SCCFunctions; + SmallPtrSet SCCFunctions; DOUT << "Inliner visiting SCC:"; for (unsigned i = 0, e = SCC.size(); i != e; ++i) { Function *F = SCC[i]->getFunction(); From evan.cheng at apple.com Mon Mar 23 19:17:41 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 24 Mar 2009 00:17:41 -0000 Subject: [llvm-commits] [llvm] r67580 - in /llvm/trunk: lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp test/CodeGen/ARM/constants.ll test/CodeGen/ARM/long.ll test/CodeGen/X86/2007-06-04-tailmerge4.ll test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll Message-ID: <200903240017.n2O0HgXU006919@zion.cs.uiuc.edu> Author: evancheng Date: Mon Mar 23 19:17:40 2009 New Revision: 67580 URL: http://llvm.org/viewvc/llvm-project?rev=67580&view=rev Log: Do not emit comments unless -asm-verbose. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp llvm/trunk/test/CodeGen/ARM/constants.ll llvm/trunk/test/CodeGen/ARM/long.ll llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Mar 23 19:17:40 2009 @@ -1010,30 +1010,42 @@ if (CFP->getType() == Type::DoubleTy) { double Val = CFP->getValueAPF().convertToDouble(); // for comment only uint64_t i = CFP->getValueAPF().bitcastToAPInt().getZExtValue(); - if (TAI->getData64bitsDirective(AddrSpace)) - O << TAI->getData64bitsDirective(AddrSpace) << i << '\t' - << TAI->getCommentString() << " double value: " << Val << '\n'; - else if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32) - << '\t' << TAI->getCommentString() - << " double most significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i) - << '\t' << TAI->getCommentString() - << " double least significant word " << Val << '\n'; + if (TAI->getData64bitsDirective(AddrSpace)) { + O << TAI->getData64bitsDirective(AddrSpace) << i; + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " double value: " << Val; + O << '\n'; + } else if (TD->isBigEndian()) { + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double most significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double least significant word " << Val; + O << '\n'; } else { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i) - << '\t' << TAI->getCommentString() - << " double least significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32) - << '\t' << TAI->getCommentString() - << " double most significant word " << Val << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double least significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double most significant word " << Val; + O << '\n'; } return; } else if (CFP->getType() == Type::FloatTy) { float Val = CFP->getValueAPF().convertToFloat(); // for comment only O << TAI->getData32bitsDirective(AddrSpace) - << CFP->getValueAPF().bitcastToAPInt().getZExtValue() - << '\t' << TAI->getCommentString() << " float " << Val << '\n'; + << CFP->getValueAPF().bitcastToAPInt().getZExtValue(); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " float " << Val; + O << '\n'; return; } else if (CFP->getType() == Type::X86_FP80Ty) { // all long double variants are printed as hex @@ -1046,39 +1058,56 @@ DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); if (TD->isBigEndian()) { - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double most significant halfword of ~" - << DoubleVal.convertToDouble() << '\n'; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double least significant halfword\n"; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant halfword of ~" + << DoubleVal.convertToDouble(); + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant halfword"; + O << '\n'; } else { - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double least significant halfword of ~" - << DoubleVal.convertToDouble() << '\n'; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double most significant halfword\n"; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant halfword of ~" + << DoubleVal.convertToDouble(); + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant halfword"; + O << '\n'; } EmitZeros(TD->getTypePaddedSize(Type::X86_FP80Ty) - TD->getTypeStoreSize(Type::X86_FP80Ty), AddrSpace); @@ -1089,31 +1118,47 @@ APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double most significant word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double least significant word\n"; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant word"; + O << '\n'; } else { - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double least significant word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double most significant word\n"; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant word"; + O << '\n'; } return; } else assert(0 && "Floating point constant type not handled"); @@ -1140,19 +1185,27 @@ if (TAI->getData64bitsDirective(AddrSpace)) O << TAI->getData64bitsDirective(AddrSpace) << Val << '\n'; else if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32) - << '\t' << TAI->getCommentString() - << " Double-word most significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val) - << '\t' << TAI->getCommentString() - << " Double-word least significant word " << Val << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word most significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word least significant word " << Val; + O << '\n'; } else { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val) - << '\t' << TAI->getCommentString() - << " Double-word least significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32) - << '\t' << TAI->getCommentString() - << " Double-word most significant word " << Val << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word least significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word most significant word " << Val; + O << '\n'; } } } @@ -1188,10 +1241,12 @@ printDataDirective(type, AddrSpace); EmitConstantValueOnly(CV); - if (const ConstantInt *CI = dyn_cast(CV)) { - SmallString<40> S; - CI->getValue().toStringUnsigned(S, 16); - O << "\t\t\t" << TAI->getCommentString() << " 0x" << S.c_str(); + if (VerboseAsm) { + if (const ConstantInt *CI = dyn_cast(CV)) { + SmallString<40> S; + CI->getValue().toStringUnsigned(S, 16); + O << "\t\t\t" << TAI->getCommentString() << " 0x" << S.c_str(); + } } O << '\n'; } @@ -1211,7 +1266,8 @@ if (!strcmp(Code, "private")) { O << TAI->getPrivateGlobalPrefix(); } else if (!strcmp(Code, "comment")) { - O << TAI->getCommentString(); + if (VerboseAsm) + O << TAI->getCommentString(); } else if (!strcmp(Code, "uid")) { // Assign a unique ID to this machine instruction. static const MachineInstr *LastMI = 0; @@ -1441,8 +1497,9 @@ /// printImplicitDef - This method prints the specified machine instruction /// that is an implicit def. void AsmPrinter::printImplicitDef(const MachineInstr *MI) const { - O << '\t' << TAI->getCommentString() << " implicit-def: " - << TRI->getAsmName(MI->getOperand(0).getReg()) << '\n'; + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " implicit-def: " + << TRI->getAsmName(MI->getOperand(0).getReg()) << '\n'; } /// printLabel - This method prints a local label used by debug and Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Mar 23 19:17:40 2009 @@ -255,7 +255,7 @@ I != E; ++I) { // Print a label for the basic block. if (I != MF.begin()) { - printBasicBlockLabel(I, true, true); + printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); @@ -356,7 +356,9 @@ if (Rot) { O << "#" << Imm << ", " << Rot; // Pretty printed version. - O << ' ' << TAI->getCommentString() << ' ' << (int)ARM_AM::rotr32(Imm, Rot); + if (VerboseAsm) + O << ' ' << TAI->getCommentString() + << ' ' << (int)ARM_AM::rotr32(Imm, Rot); } else { O << "#" << Imm; } @@ -870,8 +872,11 @@ O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; EmitGlobalConstant(C); return; @@ -892,8 +897,10 @@ if (TAI->getCOMMDirectiveTakesAlignment()) O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); } - O << "\t\t" << TAI->getCommentString() << " "; - PrintUnmangledNameSafely(GVar, O); + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(GVar, O); + } O << "\n"; return; } @@ -928,8 +935,11 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " "; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(GVar, O); + } O << "\n"; if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size " << name << ", " << Size << "\n"; Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Mon Mar 23 19:17:40 2009 @@ -704,9 +704,12 @@ } else { O << ".comm " << name << ',' << Size; } - O << "\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; return; } @@ -737,9 +740,13 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; // If the initializer is a extern weak symbol, remember to emit the weak // reference! @@ -819,7 +826,7 @@ I != E; ++I) { // Print a label for the basic block. if (I != MF.begin()) { - printBasicBlockLabel(I, true, true); + printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); @@ -938,8 +945,11 @@ O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " "; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; EmitGlobalConstant(C); return; @@ -949,9 +959,12 @@ if (Subtarget.isDarwin9()) O << ',' << Align; } - O << "\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; return; } @@ -980,9 +993,13 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; // If the initializer is a extern weak symbol, remember to emit the weak // reference! Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Mar 23 19:17:40 2009 @@ -239,7 +239,7 @@ I != E; ++I) { // Print a label for the basic block. if (!I->pred_empty()) { - printBasicBlockLabel(I, true, true); + printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); @@ -315,7 +315,7 @@ O << MO.getImm(); return; case MachineOperand::MO_MachineBasicBlock: - printBasicBlockLabel(MO.getMBB()); + printBasicBlockLabel(MO.getMBB(), false, false, VerboseAsm); return; case MachineOperand::MO_JumpTableIndex: { bool isMemOp = Modifier && !strcmp(Modifier, "mem"); @@ -829,8 +829,11 @@ O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; EmitGlobalConstant(C); return; @@ -848,8 +851,10 @@ if (TAI->getCOMMDirectiveTakesAlignment()) O << ',' << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); } - O << "\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; return; } @@ -887,8 +892,11 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm){ + O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size\t" << name << ", " << Size << '\n'; Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Mon Mar 23 19:17:40 2009 @@ -489,8 +489,11 @@ if (!bCustomSegment) EmitAlignment(Align, I); - O << name << ":\t\t\t\t" << TAI->getCommentString() - << " " << I->getName() << '\n'; + O << name << ":"; + if (VerboseAsm) + O << name << "\t\t\t\t" << TAI->getCommentString() + << " " << I->getName(); + O << '\n'; EmitGlobalConstant(C); Modified: llvm/trunk/test/CodeGen/ARM/constants.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/constants.ll?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/constants.ll (original) +++ llvm/trunk/test/CodeGen/ARM/constants.ll Mon Mar 23 19:17:40 2009 @@ -2,11 +2,11 @@ ; RUN: grep {mov r0, #0} | count 1 ; RUN: llvm-as < %s | llc -march=arm | \ ; RUN: grep {mov r0, #255$} | count 1 -; RUN: llvm-as < %s | llc -march=arm | \ +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | \ ; RUN: grep {mov r0.*256} | count 1 -; RUN: llvm-as < %s | llc -march=arm | grep {orr.*256} | count 1 -; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, .*-1073741761} | count 1 -; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, .*1008} | count 1 +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | grep {orr.*256} | count 1 +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | grep {mov r0, .*-1073741761} | count 1 +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | grep {mov r0, .*1008} | count 1 ; RUN: llvm-as < %s | llc -march=arm | grep {cmp r0, #1, 16} | count 1 define i32 @f1() { Modified: llvm/trunk/test/CodeGen/ARM/long.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/long.ll?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/long.ll (original) +++ llvm/trunk/test/CodeGen/ARM/long.ll Mon Mar 23 19:17:40 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm | \ +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | \ ; RUN: grep -- {-2147483648} | count 3 ; RUN: llvm-as < %s | llc -march=arm | grep mvn | count 3 ; RUN: llvm-as < %s | llc -march=arm | grep adds | count 1 Modified: llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll Mon Mar 23 19:17:40 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -enable-eh | grep invcont131 +; RUN: llvm-as < %s | llc -enable-eh -asm-verbose | grep invcont131 ; PR 1496: tail merge was incorrectly removing this block ; ModuleID = 'report.1.bc' Modified: llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll Mon Mar 23 19:17:40 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep {#} | not grep -v {##} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -asm-verbose | grep {#} | not grep -v {##} %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* } %struct.AGenericManager = type <{ i8 }> Modified: llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll?rev=67580&r1=67579&r2=67580&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll Mon Mar 23 19:17:40 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep -A 1 lpad | grep Llabel +; RUN: llvm-as < %s | llc -march=x86 -asm-verbose | grep -A 1 lpad | grep Llabel ; Check that register copies in the landing pad come after the EH_LABEL declare i32 @f() From gohman at apple.com Mon Mar 23 19:49:13 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 00:49:13 -0000 Subject: [llvm-commits] [llvm] r67586 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200903240049.n2O0nDME008071@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 19:49:12 2009 New Revision: 67586 URL: http://llvm.org/viewvc/llvm-project?rev=67586&view=rev Log: Add a pre-pass to the burr-list scheduler which makes adjustments to help out the register pressure reduction heuristics in the case of nodes with multiple uses. Currently this uses very conservative heuristics, so it doesn't have a broad impact, but in cases where it does help it can make a big difference. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=67586&r1=67585&r2=67586&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Mar 23 19:49:12 2009 @@ -988,6 +988,8 @@ SUnits = &sunits; // Add pseudo dependency edges for two-address nodes. AddPseudoTwoAddrDeps(); + // Reroute edges to nodes with multiple uses. + PrescheduleNodesWithMultipleUses(); // Calculate node priorities. CalculateSethiUllmanNumbers(); } @@ -1072,6 +1074,7 @@ protected: bool canClobber(const SUnit *SU, const SUnit *Op); void AddPseudoTwoAddrDeps(); + void PrescheduleNodesWithMultipleUses(); void CalculateSethiUllmanNumbers(); }; @@ -1227,6 +1230,123 @@ return false; } +/// PrescheduleNodesWithMultipleUses - Nodes with multiple uses +/// are not handled well by the general register pressure reduction +/// heuristics. When presented with code like this: +/// +/// N +/// / | +/// / | +/// U store +/// | +/// ... +/// +/// the heuristics tend to push the store up, but since the +/// operand of the store has another use (U), this would increase +/// the length of that other use (the U->N edge). +/// +/// This function transforms code like the above to route U's +/// dependence through the store when possible, like this: +/// +/// N +/// || +/// || +/// store +/// | +/// U +/// | +/// ... +/// +/// This results in the store being scheduled immediately +/// after N, which shortens the U->N live range, reducing +/// register pressure. +/// +template +void RegReductionPriorityQueue::PrescheduleNodesWithMultipleUses() { + // Visit all the nodes in topological order, working top-down. + for (unsigned i = 0, e = SUnits->size(); i != e; ++i) { + SUnit *SU = &(*SUnits)[i]; + // For now, only look at nodes with no data successors, such as stores. + // These are especially important, due to the heuristics in + // getNodePriority for nodes with no data successors. + if (SU->NumSuccs != 0) + continue; + // For now, only look at nodes with exactly one data predecessor. + if (SU->NumPreds != 1) + continue; + // Avoid prescheduling copies to virtual registers, which don't behave + // like other nodes from the perspective of scheduling heuristics. + if (SDNode *N = SU->getNode()) + if (N->getOpcode() == ISD::CopyToReg && + TargetRegisterInfo::isVirtualRegister + (cast(N->getOperand(1))->getReg())) + continue; + + // Locate the single data predecessor. + SUnit *PredSU = 0; + for (SUnit::const_pred_iterator II = SU->Preds.begin(), + EE = SU->Preds.end(); II != EE; ++II) + if (!II->isCtrl()) { + PredSU = II->getSUnit(); + break; + } + assert(PredSU); + + // Don't rewrite edges that carry physregs, because that requires additional + // support infrastructure. + if (PredSU->hasPhysRegDefs) + continue; + // Short-circuit the case where SU is PredSU's only data successor. + if (PredSU->NumSuccs == 1) + continue; + // Avoid prescheduling to copies from virtual registers, which don't behave + // like other nodes from the perspective of scheduling // heuristics. + if (SDNode *N = SU->getNode()) + if (N->getOpcode() == ISD::CopyFromReg && + TargetRegisterInfo::isVirtualRegister + (cast(N->getOperand(1))->getReg())) + continue; + + // Perform checks on the successors of PredSU. + for (SUnit::const_succ_iterator II = PredSU->Succs.begin(), + EE = PredSU->Succs.end(); II != EE; ++II) { + SUnit *PredSuccSU = II->getSUnit(); + if (PredSuccSU == SU) continue; + // If PredSU has another successor with no data successors, for + // now don't attempt to choose either over the other. + if (PredSuccSU->NumSuccs == 0) + goto outer_loop_continue; + // Don't break physical register dependencies. + if (SU->hasPhysRegClobbers && PredSuccSU->hasPhysRegDefs) + if (canClobberPhysRegDefs(PredSuccSU, SU, TII, TRI)) + goto outer_loop_continue; + // Don't introduce graph cycles. + if (scheduleDAG->IsReachable(SU, PredSuccSU)) + goto outer_loop_continue; + } + + // Ok, the transformation is safe and the heuristics suggest it is + // profitable. Update the graph. + DOUT << "Prescheduling SU # " << SU->NodeNum + << " next to PredSU # " << PredSU->NodeNum + << " to guide scheduling in the presence of multiple uses\n"; + for (unsigned i = 0; i != PredSU->Succs.size(); ++i) { + SDep Edge = PredSU->Succs[i]; + assert(!Edge.isAssignedRegDep()); + SUnit *SuccSU = Edge.getSUnit(); + if (SuccSU != SU) { + Edge.setSUnit(PredSU); + scheduleDAG->RemovePred(SuccSU, Edge); + scheduleDAG->AddPred(SU, Edge); + Edge.setSUnit(SU); + scheduleDAG->AddPred(SuccSU, Edge); + --i; + } + } + outer_loop_continue:; + } +} + /// AddPseudoTwoAddrDeps - If two nodes share an operand and one of them uses /// it as a def&use operand. Add a pseudo control edge from it to the other /// node (if it won't create a cycle) so the two-address one will be scheduled From gohman at apple.com Mon Mar 23 19:50:07 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 00:50:07 -0000 Subject: [llvm-commits] [llvm] r67587 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200903240050.n2O0o71D008132@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 19:50:07 2009 New Revision: 67587 URL: http://llvm.org/viewvc/llvm-project?rev=67587&view=rev Log: Minor compile-time optimization; don't bother checking canClobberPhysRegDefs if the successor node doesn't clobber any physical registers. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=67587&r1=67586&r2=67587&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Mar 23 19:50:07 2009 @@ -1392,7 +1392,7 @@ continue; // Don't constrain nodes with physical register defs if the // predecessor can clobber them. - if (SuccSU->hasPhysRegDefs) { + if (SuccSU->hasPhysRegDefs && SU->hasPhysRegClobbers) { if (canClobberPhysRegDefs(SuccSU, SU, TII, TRI)) continue; } From gohman at apple.com Mon Mar 23 20:04:34 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 01:04:34 -0000 Subject: [llvm-commits] [llvm] r67588 - /llvm/trunk/lib/Target/X86/X86CallingConv.td Message-ID: <200903240104.n2O14YI4008766@zion.cs.uiuc.edu> Author: djg Date: Mon Mar 23 20:04:34 2009 New Revision: 67588 URL: http://llvm.org/viewvc/llvm-project?rev=67588&view=rev Log: I was convinced that it's ok to allow a second i8 return value to be returned in DL. LLVM's multiple-return-value support is not ABI-conforming; front-ends that wish to have code emitted that conforms to an ABI are currently expected to make arrangements for this on their own rather than assuming that multiple-return-values will automatically do the right thing. This commit doesn't fundamentally change this situation. Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=67588&r1=67587&r2=67588&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CallingConv.td (original) +++ llvm/trunk/lib/Target/X86/X86CallingConv.td Mon Mar 23 20:04:34 2009 @@ -22,13 +22,14 @@ // Return-value conventions common to all X86 CC's. def RetCC_X86Common : CallingConv<[ - // Scalar values are returned in AX first, then DX, except for i8 where - // the convention is to return values in AL and AH. However, using AL and - // AH is problematic -- a return of {i16,i8} would end up using AX and AH, - // and one value would clobber the other. C front-ends are currently expected - // to pack two i8 values into an i16 in the rare situations where this - // is necessary. - CCIfType<[i8] , CCAssignToReg<[AL]>>, + // Scalar values are returned in AX first, then DX. For i8, the ABI + // requires the values to be in AL and AH, however this code uses AL and DL + // instead. This is because using AH for the second register conflicts with + // the way LLVM does multiple return values -- a return of {i16,i8} would end + // up in AX and AH, which overlap. Front-ends wishing to conform to the ABI + // for functions that return two i8 values are currently expected to pack the + // values into an i16 (which uses AX, and thus AL:AH). + CCIfType<[i8] , CCAssignToReg<[AL, DL]>>, CCIfType<[i16], CCAssignToReg<[AX, DX]>>, CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>, CCIfType<[i64], CCAssignToReg<[RAX, RDX]>>, From isanbard at gmail.com Mon Mar 23 20:05:56 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 01:05:56 -0000 Subject: [llvm-commits] [llvm] r67589 - in /llvm/tags/Apple/llvmCore-2104.1: test/TableGen/String.td utils/TableGen/TGLexer.cpp Message-ID: <200903240105.n2O15uHn008859@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 20:05:56 2009 New Revision: 67589 URL: http://llvm.org/viewvc/llvm-project?rev=67589&view=rev Log: Revert r66949 and r66957 from Dib. Removed: llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td Modified: llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp Removed: llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td?rev=67588&view=auto ============================================================================== --- llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td (original) +++ llvm/tags/Apple/llvmCore-2104.1/test/TableGen/String.td (removed) @@ -1,5 +0,0 @@ -// RUN: tblgen %s -class x { - string y = "missing terminating '\"' character"; -} - Modified: llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp?rev=67589&r1=67588&r2=67589&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp (original) +++ llvm/tags/Apple/llvmCore-2104.1/utils/TableGen/TGLexer.cpp Mon Mar 23 20:05:56 2009 @@ -151,8 +151,6 @@ tgtok::TokKind TGLexer::LexString() { const char *StrStart = CurPtr; - CurStrVal = ""; - while (*CurPtr != '"') { // If we hit the end of the buffer, report an error. if (*CurPtr == 0 && CurPtr == CurBuf->getBufferEnd()) @@ -161,41 +159,10 @@ if (*CurPtr == '\n' || *CurPtr == '\r') return ReturnError(StrStart, "End of line in string literal"); - if (*CurPtr != '\\') { - CurStrVal += *CurPtr++; - continue; - } - ++CurPtr; - - switch (*CurPtr) { - case '\\': case '\'': case '"': - // These turn into their literal character. - CurStrVal += *CurPtr++; - break; - case 't': - CurStrVal += "\\t"; - ++CurPtr; - break; - case 'n': - CurStrVal += "\\n"; - ++CurPtr; - break; - - case '\n': - case '\r': - return ReturnError(CurPtr, "escaped newlines not supported in tblgen"); - - // If we hit the end of the buffer, report an error. - case '\0': - if (CurPtr == CurBuf->getBufferEnd()) - return ReturnError(StrStart, "End of file in string literal"); - // FALL THROUGH - default: - return ReturnError(CurPtr, "invalid escape in string literal"); - } } + CurStrVal.assign(StrStart, CurPtr); ++CurPtr; return tgtok::StrVal; } From isanbard at gmail.com Mon Mar 23 20:07:15 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 01:07:15 -0000 Subject: [llvm-commits] [llvm] r67591 - in /llvm/branches/Apple/Dib: test/CodeGen/ARM/constants.ll test/CodeGen/ARM/long.ll test/CodeGen/X86/2007-06-04-tailmerge4.ll test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll test/TableGen/String.td utils/TableGen/TGLexer.cpp Message-ID: <200903240107.n2O17FKo008983@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 20:07:14 2009 New Revision: 67591 URL: http://llvm.org/viewvc/llvm-project?rev=67591&view=rev Log: Revert r66949 and r66957 from Dib. Removed: llvm/branches/Apple/Dib/test/TableGen/String.td Modified: llvm/branches/Apple/Dib/test/CodeGen/ARM/constants.ll llvm/branches/Apple/Dib/test/CodeGen/ARM/long.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp Modified: llvm/branches/Apple/Dib/test/CodeGen/ARM/constants.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/ARM/constants.ll?rev=67591&r1=67590&r2=67591&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/ARM/constants.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/ARM/constants.ll Mon Mar 23 20:07:14 2009 @@ -2,11 +2,11 @@ ; RUN: grep {mov r0, #0} | count 1 ; RUN: llvm-as < %s | llc -march=arm | \ ; RUN: grep {mov r0, #255$} | count 1 -; RUN: llvm-as < %s | llc -march=arm | \ +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | \ ; RUN: grep {mov r0.*256} | count 1 -; RUN: llvm-as < %s | llc -march=arm | grep {orr.*256} | count 1 -; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, .*-1073741761} | count 1 -; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, .*1008} | count 1 +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | grep {orr.*256} | count 1 +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | grep {mov r0, .*-1073741761} | count 1 +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | grep {mov r0, .*1008} | count 1 ; RUN: llvm-as < %s | llc -march=arm | grep {cmp r0, #1, 16} | count 1 define i32 @f1() { Modified: llvm/branches/Apple/Dib/test/CodeGen/ARM/long.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/ARM/long.ll?rev=67591&r1=67590&r2=67591&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/ARM/long.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/ARM/long.ll Mon Mar 23 20:07:14 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm | \ +; RUN: llvm-as < %s | llc -march=arm -asm-verbose | \ ; RUN: grep -- {-2147483648} | count 3 ; RUN: llvm-as < %s | llc -march=arm | grep mvn | count 3 ; RUN: llvm-as < %s | llc -march=arm | grep adds | count 1 Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll?rev=67591&r1=67590&r2=67591&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll Mon Mar 23 20:07:14 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -enable-eh | grep invcont131 +; RUN: llvm-as < %s | llc -enable-eh -asm-verbose | grep invcont131 ; PR 1496: tail merge was incorrectly removing this block ; ModuleID = 'report.1.bc' Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll?rev=67591&r1=67590&r2=67591&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll Mon Mar 23 20:07:14 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep {#} | not grep -v {##} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -asm-verbose | grep {#} | not grep -v {##} %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* } %struct.AGenericManager = type <{ i8 }> Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll?rev=67591&r1=67590&r2=67591&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll Mon Mar 23 20:07:14 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep -A 1 lpad | grep Llabel +; RUN: llvm-as < %s | llc -march=x86 -asm-verbose | grep -A 1 lpad | grep Llabel ; Check that register copies in the landing pad come after the EH_LABEL declare i32 @f() Removed: llvm/branches/Apple/Dib/test/TableGen/String.td URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/TableGen/String.td?rev=67590&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/TableGen/String.td (original) +++ llvm/branches/Apple/Dib/test/TableGen/String.td (removed) @@ -1,5 +0,0 @@ -// RUN: tblgen %s -class x { - string y = "missing terminating '\"' character"; -} - Modified: llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp?rev=67591&r1=67590&r2=67591&view=diff ============================================================================== --- llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp (original) +++ llvm/branches/Apple/Dib/utils/TableGen/TGLexer.cpp Mon Mar 23 20:07:14 2009 @@ -151,8 +151,6 @@ tgtok::TokKind TGLexer::LexString() { const char *StrStart = CurPtr; - CurStrVal = ""; - while (*CurPtr != '"') { // If we hit the end of the buffer, report an error. if (*CurPtr == 0 && CurPtr == CurBuf->getBufferEnd()) @@ -161,41 +159,10 @@ if (*CurPtr == '\n' || *CurPtr == '\r') return ReturnError(StrStart, "End of line in string literal"); - if (*CurPtr != '\\') { - CurStrVal += *CurPtr++; - continue; - } - ++CurPtr; - - switch (*CurPtr) { - case '\\': case '\'': case '"': - // These turn into their literal character. - CurStrVal += *CurPtr++; - break; - case 't': - CurStrVal += "\\t"; - ++CurPtr; - break; - case 'n': - CurStrVal += "\\n"; - ++CurPtr; - break; - - case '\n': - case '\r': - return ReturnError(CurPtr, "escaped newlines not supported in tblgen"); - - // If we hit the end of the buffer, report an error. - case '\0': - if (CurPtr == CurBuf->getBufferEnd()) - return ReturnError(StrStart, "End of file in string literal"); - // FALL THROUGH - default: - return ReturnError(CurPtr, "invalid escape in string literal"); - } } + CurStrVal.assign(StrStart, CurPtr); ++CurPtr; return tgtok::StrVal; } From isanbard at gmail.com Mon Mar 23 20:41:22 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 01:41:22 -0000 Subject: [llvm-commits] [llvm] r67597 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Message-ID: <200903240141.n2O1fM3O011384@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 20:41:22 2009 New Revision: 67597 URL: http://llvm.org/viewvc/llvm-project?rev=67597&view=rev Log: --- Merging (from foreign repository) r67528 into '.': U include/llvm/CodeGen/ScheduleDAG.h U lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp --- Merging (from foreign repository) r67531 into '.': U lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp --- Merging (from foreign repository) r67540 into '.': G lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp --- Merging (from foreign repository) r67554 into '.': G lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp --- Merging (from foreign repository) r67586 into '.': G lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/ScheduleDAG.h llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/ScheduleDAG.h?rev=67597&r1=67596&r2=67597&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/branches/Apple/Dib/include/llvm/CodeGen/ScheduleDAG.h Mon Mar 23 20:41:22 2009 @@ -245,6 +245,7 @@ bool isTwoAddress : 1; // Is a two-address instruction. bool isCommutable : 1; // Is a commutable instruction. bool hasPhysRegDefs : 1; // Has physreg defs that are being used. + bool hasPhysRegClobbers : 1; // Has any physreg defs, used or not. bool isPending : 1; // True once pending. bool isAvailable : 1; // True once available. bool isScheduled : 1; // True once scheduled. @@ -265,6 +266,7 @@ : Node(node), Instr(0), OrigNode(0), NodeNum(nodenum), NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0), isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false), + hasPhysRegClobbers(false), isPending(false), isAvailable(false), isScheduled(false), isScheduleHigh(false), isCloned(false), isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0), @@ -276,6 +278,7 @@ : Node(0), Instr(instr), OrigNode(0), NodeNum(nodenum), NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0), isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false), + hasPhysRegClobbers(false), isPending(false), isAvailable(false), isScheduled(false), isScheduleHigh(false), isCloned(false), isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0), @@ -286,6 +289,7 @@ : Node(0), Instr(0), OrigNode(0), NodeNum(~0u), NodeQueueId(0), Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0), isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false), + hasPhysRegClobbers(false), isPending(false), isAvailable(false), isScheduled(false), isScheduleHigh(false), isCloned(false), isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0), Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=67597&r1=67596&r2=67597&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Mar 23 20:41:22 2009 @@ -410,6 +410,7 @@ NewSU->isCommutable = true; ComputeLatency(NewSU); + // Record all the edges to and from the old SU, by category. SmallVector ChainPreds; SmallVector ChainSuccs; SmallVector LoadPreds; @@ -433,6 +434,7 @@ NodeSuccs.push_back(*I); } + // Now assign edges to the newly-created nodes. for (unsigned i = 0, e = ChainPreds.size(); i != e; ++i) { const SDep &Pred = ChainPreds[i]; RemovePred(SU, Pred); @@ -468,9 +470,10 @@ AddPred(SuccDep, D); } } - if (isNewLoad) { - AddPred(NewSU, SDep(LoadSU, SDep::Order, LoadSU->Latency)); - } + + // Add a data dependency to reflect that NewSU reads the value defined + // by LoadSU. + AddPred(NewSU, SDep(LoadSU, SDep::Data, LoadSU->Latency)); if (isNewLoad) AvailableQueue->addNode(LoadSU); @@ -985,6 +988,8 @@ SUnits = &sunits; // Add pseudo dependency edges for two-address nodes. AddPseudoTwoAddrDeps(); + // Reroute edges to nodes with multiple uses. + PrescheduleNodesWithMultipleUses(); // Calculate node priorities. CalculateSethiUllmanNumbers(); } @@ -1069,6 +1074,7 @@ protected: bool canClobber(const SUnit *SU, const SUnit *Op); void AddPseudoTwoAddrDeps(); + void PrescheduleNodesWithMultipleUses(); void CalculateSethiUllmanNumbers(); }; @@ -1199,26 +1205,148 @@ unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs(); const unsigned *ImpDefs = TII->get(N->getMachineOpcode()).getImplicitDefs(); assert(ImpDefs && "Caller should check hasPhysRegDefs"); - const unsigned *SUImpDefs = - TII->get(SU->getNode()->getMachineOpcode()).getImplicitDefs(); - if (!SUImpDefs) - return false; - for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) { - MVT VT = N->getValueType(i); - if (VT == MVT::Flag || VT == MVT::Other) - continue; - if (!N->hasAnyUseOfValue(i)) - continue; - unsigned Reg = ImpDefs[i - NumDefs]; - for (;*SUImpDefs; ++SUImpDefs) { - unsigned SUReg = *SUImpDefs; - if (TRI->regsOverlap(Reg, SUReg)) - return true; + for (const SDNode *SUNode = SU->getNode(); SUNode; + SUNode = SUNode->getFlaggedNode()) { + if (!SUNode->isMachineOpcode()) + continue; + const unsigned *SUImpDefs = + TII->get(SUNode->getMachineOpcode()).getImplicitDefs(); + if (!SUImpDefs) + return false; + for (unsigned i = NumDefs, e = N->getNumValues(); i != e; ++i) { + MVT VT = N->getValueType(i); + if (VT == MVT::Flag || VT == MVT::Other) + continue; + if (!N->hasAnyUseOfValue(i)) + continue; + unsigned Reg = ImpDefs[i - NumDefs]; + for (;*SUImpDefs; ++SUImpDefs) { + unsigned SUReg = *SUImpDefs; + if (TRI->regsOverlap(Reg, SUReg)) + return true; + } } } return false; } +/// PrescheduleNodesWithMultipleUses - Nodes with multiple uses +/// are not handled well by the general register pressure reduction +/// heuristics. When presented with code like this: +/// +/// N +/// / | +/// / | +/// U store +/// | +/// ... +/// +/// the heuristics tend to push the store up, but since the +/// operand of the store has another use (U), this would increase +/// the length of that other use (the U->N edge). +/// +/// This function transforms code like the above to route U's +/// dependence through the store when possible, like this: +/// +/// N +/// || +/// || +/// store +/// | +/// U +/// | +/// ... +/// +/// This results in the store being scheduled immediately +/// after N, which shortens the U->N live range, reducing +/// register pressure. +/// +template +void RegReductionPriorityQueue::PrescheduleNodesWithMultipleUses() { + // Visit all the nodes in topological order, working top-down. + for (unsigned i = 0, e = SUnits->size(); i != e; ++i) { + SUnit *SU = &(*SUnits)[i]; + // For now, only look at nodes with no data successors, such as stores. + // These are especially important, due to the heuristics in + // getNodePriority for nodes with no data successors. + if (SU->NumSuccs != 0) + continue; + // For now, only look at nodes with exactly one data predecessor. + if (SU->NumPreds != 1) + continue; + // Avoid prescheduling copies to virtual registers, which don't behave + // like other nodes from the perspective of scheduling heuristics. + if (SDNode *N = SU->getNode()) + if (N->getOpcode() == ISD::CopyToReg && + TargetRegisterInfo::isVirtualRegister + (cast(N->getOperand(1))->getReg())) + continue; + + // Locate the single data predecessor. + SUnit *PredSU = 0; + for (SUnit::const_pred_iterator II = SU->Preds.begin(), + EE = SU->Preds.end(); II != EE; ++II) + if (!II->isCtrl()) { + PredSU = II->getSUnit(); + break; + } + assert(PredSU); + + // Don't rewrite edges that carry physregs, because that requires additional + // support infrastructure. + if (PredSU->hasPhysRegDefs) + continue; + // Short-circuit the case where SU is PredSU's only data successor. + if (PredSU->NumSuccs == 1) + continue; + // Avoid prescheduling to copies from virtual registers, which don't behave + // like other nodes from the perspective of scheduling // heuristics. + if (SDNode *N = SU->getNode()) + if (N->getOpcode() == ISD::CopyFromReg && + TargetRegisterInfo::isVirtualRegister + (cast(N->getOperand(1))->getReg())) + continue; + + // Perform checks on the successors of PredSU. + for (SUnit::const_succ_iterator II = PredSU->Succs.begin(), + EE = PredSU->Succs.end(); II != EE; ++II) { + SUnit *PredSuccSU = II->getSUnit(); + if (PredSuccSU == SU) continue; + // If PredSU has another successor with no data successors, for + // now don't attempt to choose either over the other. + if (PredSuccSU->NumSuccs == 0) + goto outer_loop_continue; + // Don't break physical register dependencies. + if (SU->hasPhysRegClobbers && PredSuccSU->hasPhysRegDefs) + if (canClobberPhysRegDefs(PredSuccSU, SU, TII, TRI)) + goto outer_loop_continue; + // Don't introduce graph cycles. + if (scheduleDAG->IsReachable(SU, PredSuccSU)) + goto outer_loop_continue; + } + + // Ok, the transformation is safe and the heuristics suggest it is + // profitable. Update the graph. + DOUT << "Prescheduling SU # " << SU->NodeNum + << " next to PredSU # " << PredSU->NodeNum + << " to guide scheduling in the presence of multiple uses\n"; + for (unsigned i = 0; i != PredSU->Succs.size(); ++i) { + SDep Edge = PredSU->Succs[i]; + assert(!Edge.isAssignedRegDep()); + SUnit *SuccSU = Edge.getSUnit(); + if (SuccSU != SU) { + Edge.setSUnit(PredSU); + scheduleDAG->RemovePred(SuccSU, Edge); + scheduleDAG->AddPred(SU, Edge); + Edge.setSUnit(SU); + scheduleDAG->AddPred(SuccSU, Edge); + --i; + } + } + outer_loop_continue:; + } +} + /// AddPseudoTwoAddrDeps - If two nodes share an operand and one of them uses /// it as a def&use operand. Add a pseudo control edge from it to the other /// node (if it won't create a cycle) so the two-address one will be scheduled Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=67597&r1=67596&r2=67597&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon Mar 23 20:41:22 2009 @@ -41,6 +41,7 @@ SU->isTwoAddress = Old->isTwoAddress; SU->isCommutable = Old->isCommutable; SU->hasPhysRegDefs = Old->hasPhysRegDefs; + SU->hasPhysRegClobbers = Old->hasPhysRegClobbers; Old->isCloned = true; return SU; } @@ -175,9 +176,14 @@ // Find all predecessors and successors of the group. for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode()) { if (N->isMachineOpcode() && - TII->get(N->getMachineOpcode()).getImplicitDefs() && - CountResults(N) > TII->get(N->getMachineOpcode()).getNumDefs()) - SU->hasPhysRegDefs = true; + TII->get(N->getMachineOpcode()).getImplicitDefs()) { + SU->hasPhysRegClobbers = true; + unsigned NumUsed = CountResults(N); + while (NumUsed != 0 && !N->hasAnyUseOfValue(NumUsed - 1)) + --NumUsed; // Skip over unused values at the end. + if (NumUsed > TII->get(N->getMachineOpcode()).getNumDefs()) + SU->hasPhysRegDefs = true; + } for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { SDNode *OpN = N->getOperand(i).getNode(); From isanbard at gmail.com Mon Mar 23 20:59:47 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 01:59:47 -0000 Subject: [llvm-commits] [llvm] r67599 - in /llvm/branches/Apple/Dib: lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/AsmPrinter/ lib/Support/ lib/Target/ARM/AsmPrinter/ lib/Target/CBackend/ lib/Target/PowerPC/AsmPrinter/ lib/Target/X86/AsmPrinter/ lib/VMCore/ test/CodeGen/X86/ Message-ID: <200903240159.n2O1xlQO013129@zion.cs.uiuc.edu> Author: void Date: Mon Mar 23 20:59:46 2009 New Revision: 67599 URL: http://llvm.org/viewvc/llvm-project?rev=67599&view=rev Log: --- Merging (from foreign repository) r67562 into '.': A test/CodeGen/X86/2009-03-23-i80-fp80.ll U lib/CodeGen/AsmPrinter/AsmPrinter.cpp U lib/Target/CBackend/CBackend.cpp U lib/Bitcode/Reader/BitcodeReader.cpp U lib/Bitcode/Writer/BitcodeWriter.cpp U lib/VMCore/AsmWriter.cpp U lib/Support/APFloat.cpp U lib/AsmParser/LLLexer.cpp U lib/AsmParser/LLLexer.h --- Merging (from foreign repository) r67580 into '.': G lib/CodeGen/AsmPrinter/AsmPrinter.cpp U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Added: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-23-i80-fp80.ll Modified: llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.cpp llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.h llvm/branches/Apple/Dib/lib/Bitcode/Reader/BitcodeReader.cpp llvm/branches/Apple/Dib/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/branches/Apple/Dib/lib/Support/APFloat.cpp llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/CBackend/CBackend.cpp llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp llvm/branches/Apple/Dib/lib/VMCore/AsmWriter.cpp Modified: llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.cpp (original) +++ llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.cpp Mon Mar 23 20:59:46 2009 @@ -115,6 +115,37 @@ Error("constant bigger than 128 bits detected!"); } +/// FP80HexToIntPair - translate an 80 bit FP80 number (20 hexits) into +/// { low64, high16 } as usual for an APInt. +void LLLexer::FP80HexToIntPair(const char *Buffer, const char *End, + uint64_t Pair[2]) { + Pair[1] = 0; + for (int i=0; i<4 && Buffer != End; i++, Buffer++) { + assert(Buffer != End); + Pair[1] *= 16; + char C = *Buffer; + if (C >= '0' && C <= '9') + Pair[1] += C-'0'; + else if (C >= 'A' && C <= 'F') + Pair[1] += C-'A'+10; + else if (C >= 'a' && C <= 'f') + Pair[1] += C-'a'+10; + } + Pair[0] = 0; + for (int i=0; i<16; i++, Buffer++) { + Pair[0] *= 16; + char C = *Buffer; + if (C >= '0' && C <= '9') + Pair[0] += C-'0'; + else if (C >= 'A' && C <= 'F') + Pair[0] += C-'A'+10; + else if (C >= 'a' && C <= 'f') + Pair[0] += C-'a'+10; + } + if (Buffer != End) + Error("constant bigger than 128 bits detected!"); +} + // UnEscapeLexed - Run through the specified buffer and change \xx codes to the // appropriate character. static void UnEscapeLexed(std::string &Str) { @@ -670,19 +701,21 @@ } uint64_t Pair[2]; - HexToIntPair(TokStart+3, CurPtr, Pair); switch (Kind) { default: assert(0 && "Unknown kind!"); case 'K': // F80HexFPConstant - x87 long double in hexadecimal format (10 bytes) + FP80HexToIntPair(TokStart+3, CurPtr, Pair); APFloatVal = APFloat(APInt(80, 2, Pair)); return lltok::APFloat; case 'L': // F128HexFPConstant - IEEE 128-bit in hexadecimal format (16 bytes) + HexToIntPair(TokStart+3, CurPtr, Pair); APFloatVal = APFloat(APInt(128, 2, Pair), true); return lltok::APFloat; case 'M': // PPC128HexFPConstant - PowerPC 128-bit in hexadecimal format (16 bytes) + HexToIntPair(TokStart+3, CurPtr, Pair); APFloatVal = APFloat(APInt(128, 2, Pair)); return lltok::APFloat; } Modified: llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.h?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.h (original) +++ llvm/branches/Apple/Dib/lib/AsmParser/LLLexer.h Mon Mar 23 20:59:46 2009 @@ -77,6 +77,7 @@ uint64_t atoull(const char *Buffer, const char *End); uint64_t HexIntToVal(const char *Buffer, const char *End); void HexToIntPair(const char *Buffer, const char *End, uint64_t Pair[2]); + void FP80HexToIntPair(const char *Buff, const char *End, uint64_t Pair[2]); }; } // end namespace llvm Modified: llvm/branches/Apple/Dib/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Bitcode/Reader/BitcodeReader.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/branches/Apple/Dib/lib/Bitcode/Reader/BitcodeReader.cpp Mon Mar 23 20:59:46 2009 @@ -801,9 +801,13 @@ V = ConstantFP::get(APFloat(APInt(32, (uint32_t)Record[0]))); else if (CurTy == Type::DoubleTy) V = ConstantFP::get(APFloat(APInt(64, Record[0]))); - else if (CurTy == Type::X86_FP80Ty) - V = ConstantFP::get(APFloat(APInt(80, 2, &Record[0]))); - else if (CurTy == Type::FP128Ty) + else if (CurTy == Type::X86_FP80Ty) { + // Bits are not stored the same way as a normal i80 APInt, compensate. + uint64_t Rearrange[2]; + Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16); + Rearrange[1] = Record[0] >> 48; + V = ConstantFP::get(APFloat(APInt(80, 2, Rearrange))); + } else if (CurTy == Type::FP128Ty) V = ConstantFP::get(APFloat(APInt(128, 2, &Record[0]), true)); else if (CurTy == Type::PPC_FP128Ty) V = ConstantFP::get(APFloat(APInt(128, 2, &Record[0]))); Modified: llvm/branches/Apple/Dib/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Mar 23 20:59:46 2009 @@ -559,10 +559,11 @@ Record.push_back(CFP->getValueAPF().bitcastToAPInt().getZExtValue()); } else if (Ty == Type::X86_FP80Ty) { // api needed to prevent premature destruction + // bits are not in the same order as a normal i80 APInt, compensate. APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); - Record.push_back(p[0]); - Record.push_back((uint16_t)p[1]); + Record.push_back((p[1] << 48) | (p[0] >> 16)); + Record.push_back(p[0] & 0xffffLL); } else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) { APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Mar 23 20:59:46 2009 @@ -1010,30 +1010,42 @@ if (CFP->getType() == Type::DoubleTy) { double Val = CFP->getValueAPF().convertToDouble(); // for comment only uint64_t i = CFP->getValueAPF().bitcastToAPInt().getZExtValue(); - if (TAI->getData64bitsDirective(AddrSpace)) - O << TAI->getData64bitsDirective(AddrSpace) << i << '\t' - << TAI->getCommentString() << " double value: " << Val << '\n'; - else if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32) - << '\t' << TAI->getCommentString() - << " double most significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i) - << '\t' << TAI->getCommentString() - << " double least significant word " << Val << '\n'; + if (TAI->getData64bitsDirective(AddrSpace)) { + O << TAI->getData64bitsDirective(AddrSpace) << i; + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " double value: " << Val; + O << '\n'; + } else if (TD->isBigEndian()) { + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double most significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double least significant word " << Val; + O << '\n'; } else { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i) - << '\t' << TAI->getCommentString() - << " double least significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32) - << '\t' << TAI->getCommentString() - << " double most significant word " << Val << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double least significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " double most significant word " << Val; + O << '\n'; } return; } else if (CFP->getType() == Type::FloatTy) { float Val = CFP->getValueAPF().convertToFloat(); // for comment only O << TAI->getData32bitsDirective(AddrSpace) - << CFP->getValueAPF().bitcastToAPInt().getZExtValue() - << '\t' << TAI->getCommentString() << " float " << Val << '\n'; + << CFP->getValueAPF().bitcastToAPInt().getZExtValue(); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " float " << Val; + O << '\n'; return; } else if (CFP->getType() == Type::X86_FP80Ty) { // all long double variants are printed as hex @@ -1046,39 +1058,56 @@ DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); if (TD->isBigEndian()) { - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) - << '\t' << TAI->getCommentString() - << " long double most significant halfword of ~" - << DoubleVal.convertToDouble() << '\n'; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double least significant halfword\n"; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant halfword of ~" + << DoubleVal.convertToDouble(); + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant halfword"; + O << '\n'; } else { - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double least significant halfword of ~" - << DoubleVal.convertToDouble() << '\n'; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double next halfword\n"; - O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48) - << '\t' << TAI->getCommentString() - << " long double most significant halfword\n"; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant halfword of ~" + << DoubleVal.convertToDouble(); + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next halfword"; + O << '\n'; + O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant halfword"; + O << '\n'; } EmitZeros(TD->getTypePaddedSize(Type::X86_FP80Ty) - TD->getTypeStoreSize(Type::X86_FP80Ty), AddrSpace); @@ -1089,31 +1118,47 @@ APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double most significant word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double least significant word\n"; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant word"; + O << '\n'; } else { - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]) - << '\t' << TAI->getCommentString() - << " long double least significant word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]) - << '\t' << TAI->getCommentString() - << " long double next word\n"; - O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32) - << '\t' << TAI->getCommentString() - << " long double most significant word\n"; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double least significant word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double next word"; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " long double most significant word"; + O << '\n'; } return; } else assert(0 && "Floating point constant type not handled"); @@ -1140,19 +1185,27 @@ if (TAI->getData64bitsDirective(AddrSpace)) O << TAI->getData64bitsDirective(AddrSpace) << Val << '\n'; else if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32) - << '\t' << TAI->getCommentString() - << " Double-word most significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val) - << '\t' << TAI->getCommentString() - << " Double-word least significant word " << Val << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word most significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word least significant word " << Val; + O << '\n'; } else { - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val) - << '\t' << TAI->getCommentString() - << " Double-word least significant word " << Val << '\n'; - O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32) - << '\t' << TAI->getCommentString() - << " Double-word most significant word " << Val << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word least significant word " << Val; + O << '\n'; + O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32); + if (VerboseAsm) + O << '\t' << TAI->getCommentString() + << " Double-word most significant word " << Val; + O << '\n'; } } } @@ -1188,10 +1241,12 @@ printDataDirective(type, AddrSpace); EmitConstantValueOnly(CV); - if (const ConstantInt *CI = dyn_cast(CV)) { - SmallString<40> S; - CI->getValue().toStringUnsigned(S, 16); - O << "\t\t\t" << TAI->getCommentString() << " 0x" << S.c_str(); + if (VerboseAsm) { + if (const ConstantInt *CI = dyn_cast(CV)) { + SmallString<40> S; + CI->getValue().toStringUnsigned(S, 16); + O << "\t\t\t" << TAI->getCommentString() << " 0x" << S.c_str(); + } } O << '\n'; } @@ -1211,7 +1266,8 @@ if (!strcmp(Code, "private")) { O << TAI->getPrivateGlobalPrefix(); } else if (!strcmp(Code, "comment")) { - O << TAI->getCommentString(); + if (VerboseAsm) + O << TAI->getCommentString(); } else if (!strcmp(Code, "uid")) { // Assign a unique ID to this machine instruction. static const MachineInstr *LastMI = 0; @@ -1441,8 +1497,9 @@ /// printImplicitDef - This method prints the specified machine instruction /// that is an implicit def. void AsmPrinter::printImplicitDef(const MachineInstr *MI) const { - O << '\t' << TAI->getCommentString() << " implicit-def: " - << TRI->getAsmName(MI->getOperand(0).getReg()) << '\n'; + if (VerboseAsm) + O << '\t' << TAI->getCommentString() << " implicit-def: " + << TRI->getAsmName(MI->getOperand(0).getReg()) << '\n'; } /// printLabel - This method prints a local label used by debug and Modified: llvm/branches/Apple/Dib/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Support/APFloat.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Support/APFloat.cpp (original) +++ llvm/branches/Apple/Dib/lib/Support/APFloat.cpp Mon Mar 23 20:59:46 2009 @@ -2603,10 +2603,9 @@ } uint64_t words[2]; - words[0] = ((uint64_t)(sign & 1) << 63) | - ((myexponent & 0x7fffLL) << 48) | - ((mysignificand >>16) & 0xffffffffffffLL); - words[1] = mysignificand & 0xffff; + words[0] = mysignificand; + words[1] = ((uint64_t)(sign & 1) << 15) | + (myexponent & 0x7fffLL); return APInt(80, 2, words); } @@ -2764,14 +2763,13 @@ assert(api.getBitWidth()==80); uint64_t i1 = api.getRawData()[0]; uint64_t i2 = api.getRawData()[1]; - uint64_t myexponent = (i1 >> 48) & 0x7fff; - uint64_t mysignificand = ((i1 << 16) & 0xffffffffffff0000ULL) | - (i2 & 0xffff); + uint64_t myexponent = (i2 & 0x7fff); + uint64_t mysignificand = i1; initialize(&APFloat::x87DoubleExtended); assert(partCount()==2); - sign = static_cast(i1>>63); + sign = static_cast(i2>>15); if (myexponent==0 && mysignificand==0) { // exponent, significand meaningless category = fcZero; Modified: llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Mar 23 20:59:46 2009 @@ -255,7 +255,7 @@ I != E; ++I) { // Print a label for the basic block. if (I != MF.begin()) { - printBasicBlockLabel(I, true, true); + printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); @@ -356,7 +356,9 @@ if (Rot) { O << "#" << Imm << ", " << Rot; // Pretty printed version. - O << ' ' << TAI->getCommentString() << ' ' << (int)ARM_AM::rotr32(Imm, Rot); + if (VerboseAsm) + O << ' ' << TAI->getCommentString() + << ' ' << (int)ARM_AM::rotr32(Imm, Rot); } else { O << "#" << Imm; } @@ -870,8 +872,11 @@ O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; EmitGlobalConstant(C); return; @@ -892,8 +897,10 @@ if (TAI->getCOMMDirectiveTakesAlignment()) O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); } - O << "\t\t" << TAI->getCommentString() << " "; - PrintUnmangledNameSafely(GVar, O); + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(GVar, O); + } O << "\n"; return; } @@ -928,8 +935,11 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " "; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(GVar, O); + } O << "\n"; if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size " << name << ", " << Size << "\n"; Modified: llvm/branches/Apple/Dib/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CBackend/CBackend.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/CBackend/CBackend.cpp Mon Mar 23 20:59:46 2009 @@ -2087,9 +2087,8 @@ APInt api = FPC->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Out << "static const ConstantFP80Ty FPConstant" << FPCounter++ - << " = { 0x" - << utohexstr((uint16_t)p[1] | (p[0] & 0xffffffffffffLL)<<16) - << "ULL, 0x" << utohexstr((uint16_t)(p[0] >> 48)) << ",{0,0,0}" + << " = { 0x" << utohexstr(p[0]) + << "ULL, 0x" << utohexstr((uint16_t)p[1]) << ",{0,0,0}" << "}; /* Long double constant */\n"; } else if (FPC->getType() == Type::PPC_FP128Ty) { APInt api = FPC->getValueAPF().bitcastToAPInt(); Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Mon Mar 23 20:59:46 2009 @@ -704,9 +704,12 @@ } else { O << ".comm " << name << ',' << Size; } - O << "\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; return; } @@ -737,9 +740,13 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; // If the initializer is a extern weak symbol, remember to emit the weak // reference! @@ -819,7 +826,7 @@ I != E; ++I) { // Print a label for the basic block. if (I != MF.begin()) { - printBasicBlockLabel(I, true, true); + printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); @@ -938,8 +945,11 @@ O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " "; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " "; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; EmitGlobalConstant(C); return; @@ -949,9 +959,12 @@ if (Subtarget.isDarwin9()) O << ',' << Align; } - O << "\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; return; } @@ -980,9 +993,13 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << " '"; - PrintUnmangledNameSafely(GVar, O); - O << "'\n"; + O << name << ":"; + if (VerboseAsm) { + O << "\t\t\t\t" << TAI->getCommentString() << " '"; + PrintUnmangledNameSafely(GVar, O); + O << "'"; + } + O << '\n'; // If the initializer is a extern weak symbol, remember to emit the weak // reference! Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Mar 23 20:59:46 2009 @@ -239,7 +239,7 @@ I != E; ++I) { // Print a label for the basic block. if (!I->pred_empty()) { - printBasicBlockLabel(I, true, true); + printBasicBlockLabel(I, true, true, VerboseAsm); O << '\n'; } for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end(); @@ -315,7 +315,7 @@ O << MO.getImm(); return; case MachineOperand::MO_MachineBasicBlock: - printBasicBlockLabel(MO.getMBB()); + printBasicBlockLabel(MO.getMBB(), false, false, VerboseAsm); return; case MachineOperand::MO_JumpTableIndex: { bool isMemOp = Modifier && !strcmp(Modifier, "mem"); @@ -829,8 +829,11 @@ O << "\t.globl " << name << '\n' << TAI->getWeakDefDirective() << name << '\n'; EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm) { + O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; EmitGlobalConstant(C); return; @@ -848,8 +851,10 @@ if (TAI->getCOMMDirectiveTakesAlignment()) O << ',' << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); } - O << "\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + if (VerboseAsm) { + O << "\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; return; } @@ -887,8 +892,11 @@ } EmitAlignment(Align, GVar); - O << name << ":\t\t\t\t" << TAI->getCommentString() << ' '; - PrintUnmangledNameSafely(GVar, O); + O << name << ":"; + if (VerboseAsm){ + O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + PrintUnmangledNameSafely(GVar, O); + } O << '\n'; if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size\t" << name << ", " << Size << '\n'; Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Mon Mar 23 20:59:46 2009 @@ -489,8 +489,11 @@ if (!bCustomSegment) EmitAlignment(Align, I); - O << name << ":\t\t\t\t" << TAI->getCommentString() - << " " << I->getName() << '\n'; + O << name << ":"; + if (VerboseAsm) + O << name << "\t\t\t\t" << TAI->getCommentString() + << " " << I->getName(); + O << '\n'; EmitGlobalConstant(C); Modified: llvm/branches/Apple/Dib/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/VMCore/AsmWriter.cpp?rev=67599&r1=67598&r2=67599&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/VMCore/AsmWriter.cpp (original) +++ llvm/branches/Apple/Dib/lib/VMCore/AsmWriter.cpp Mon Mar 23 20:59:46 2009 @@ -797,9 +797,29 @@ // Some form of long double. These appear as a magic letter identifying // the type, then a fixed number of hex digits. Out << "0x"; - if (&CFP->getValueAPF().getSemantics() == &APFloat::x87DoubleExtended) + if (&CFP->getValueAPF().getSemantics() == &APFloat::x87DoubleExtended) { Out << 'K'; - else if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEquad) + // api needed to prevent premature destruction + APInt api = CFP->getValueAPF().bitcastToAPInt(); + const uint64_t* p = api.getRawData(); + uint64_t word = p[1]; + int shiftcount=12; + int width = api.getBitWidth(); + for (int j=0; j>shiftcount) & 15; + if (nibble < 10) + Out << (unsigned char)(nibble + '0'); + else + Out << (unsigned char)(nibble - 10 + 'A'); + if (shiftcount == 0 && j+4 < width) { + word = *p; + shiftcount = 64; + if (width-j-4 < 64) + shiftcount = width-j-4; + } + } + return; + } else if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEquad) Out << 'L'; else if (&CFP->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble) Out << 'M'; Added: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-23-i80-fp80.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-23-i80-fp80.ll?rev=67599&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-23-i80-fp80.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-23-i80-fp80.ll Mon Mar 23 20:59:46 2009 @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 302245289961712575840256 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep K40018000000000000000 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin9" + +define i80 @from() { + %tmp = bitcast x86_fp80 0xK4000C000000000000000 to i80 + ret i80 %tmp +} + +define x86_fp80 @to() { + %tmp = bitcast i80 302259125019767858003968 to x86_fp80 + ret x86_fp80 %tmp +} From isanbard at gmail.com Mon Mar 23 23:01:05 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 23 Mar 2009 21:01:05 -0700 Subject: [llvm-commits] [llvm] r67504 - /llvm/trunk/docs/CodingStandards.html In-Reply-To: <200903230453.n2N4r0QX001703@zion.cs.uiuc.edu> References: <200903230453.n2N4r0QX001703@zion.cs.uiuc.edu> Message-ID: On Mar 22, 2009, at 9:52 PM, Chris Lattner wrote: > Author: lattner > Date: Sun Mar 22 23:52:53 2009 > New Revision: 67504 > > Do not recommend llvm::OStream anymore. Use raw_ostream or > MemoryBuffer. > *sniff* The end of an era. -bw From baldrick at free.fr Tue Mar 24 01:14:15 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 24 Mar 2009 07:14:15 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r67516 - in /llvm-gcc-4.2/trunk/gcc/config: i386/linux.h i386/linux64.h rs6000/sysv4.h In-Reply-To: <49C7BDD8.1070301@mxc.ca> References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> <49C7BDD8.1070301@mxc.ca> Message-ID: <200903240714.15380.baldrick@free.fr> Hi Nick, > > Revert commit 67369: older versions of ld do not > > support the --hash-style option, for example > > GNU ld version 2.17 Debian GNU/Linux > > which is in use on a couple of nightly testers. > > Hi Duncan. What does GCC do here? Detect it at configure time? it seems gcc mainline does not do this. I grepped for "hash-style", but there was nothing interesting. Ciao, Duncan. > The difference is seen with: > > int main() { return 0; } > > compiled by the llvm-g++ driver vs. the FSF g++ driver. When built > without --hash-style "valgrind --tool=callgrind" reports 2,206,956 > instructions vs. 1,334,028 with this patch. The extra instructions are > due to the dynamic linker doing extra work to load the program. > > Nick > > > Modified: > > llvm-gcc-4.2/trunk/gcc/config/i386/linux.h > > llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h > > llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h > > > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux.h > > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/linux.h?rev=67516&r1=67515&r2=67516&view=diff > > > > ============================================================================== > > --- llvm-gcc-4.2/trunk/gcc/config/i386/linux.h (original) > > +++ llvm-gcc-4.2/trunk/gcc/config/i386/linux.h Mon Mar 23 05:54:30 2009 > > @@ -109,8 +109,7 @@ > > { "dynamic_linker", LINUX_DYNAMIC_LINKER } > > > > #undef LINK_SPEC > > -/* LLVM LOCAL set linker hash_style */ > > -#define LINK_SPEC "-m %(link_emulation) --hash-style=both %{shared:-shared} \ > > +#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ > > %{!shared: \ > > %{!ibcs: \ > > %{!static: \ > > > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h > > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h?rev=67516&r1=67515&r2=67516&view=diff > > > > ============================================================================== > > --- llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h (original) > > +++ llvm-gcc-4.2/trunk/gcc/config/i386/linux64.h Mon Mar 23 05:54:30 2009 > > @@ -53,8 +53,7 @@ > > #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" > > > > #undef LINK_SPEC > > -/* LLVM LOCAL set linker hash_style */ > > -#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} --hash-style=both \ > > +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ > > %{shared:-shared} \ > > %{!shared: \ > > %{!static: \ > > > > Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h > > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h?rev=67516&r1=67515&r2=67516&view=diff > > > > ============================================================================== > > --- llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h (original) > > +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/sysv4.h Mon Mar 23 05:54:30 2009 > > @@ -910,9 +910,8 @@ > > #define LINUX_DYNAMIC_LINKER \ > > CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) > > > > -/* LLVM LOCAL set linker hash_style */ > > -#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=both %{!shared: \ > > - %{!static: %{rdynamic:-export-dynamic} \ > > +#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ > > + %{rdynamic:-export-dynamic} \ > > %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" > > > > #if defined(HAVE_LD_EH_FRAME_HDR) > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From Sanjiv.Gupta at microchip.com Tue Mar 24 05:17:10 2009 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Tue, 24 Mar 2009 03:17:10 -0700 Subject: [llvm-commits] DAGCombiner Patch: Allow targets to do combine first. References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu><49C7BDD8.1070301@mxc.ca> <200903240714.15380.baldrick@free.fr> Message-ID: The DAGCombiner::combine() in its existing form does not allow targets to do anything if the visitNODE() has done something with it. IMO, the targets should always be allowed to do stuff irrespective of what we want to do in visitNODE(). Attached is a patch for same. Let me know if it sounds ok. I will go ahead and commit it. - Sanjiv -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4132 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090324/a97418f5/attachment.bin From clattner at apple.com Tue Mar 24 10:10:38 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 24 Mar 2009 08:10:38 -0700 Subject: [llvm-commits] [llvm] r67586 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp In-Reply-To: <200903240049.n2O0nDME008071@zion.cs.uiuc.edu> References: <200903240049.n2O0nDME008071@zion.cs.uiuc.edu> Message-ID: On Mar 23, 2009, at 5:49 PM, Dan Gohman wrote: > Author: djg > Date: Mon Mar 23 19:49:12 2009 > New Revision: 67586 > > URL: http://llvm.org/viewvc/llvm-project?rev=67586&view=rev > Log: > Add a pre-pass to the burr-list scheduler which makes adjustments to > help out the register pressure reduction heuristics in the case of > nodes with multiple uses. Currently this uses very conservative > heuristics, so it doesn't have a broad impact, but in cases where it > does help it can make a big difference. Testcase? It would be nice to not lose the "big difference" in the future. -Chris From sabre at nondot.org Tue Mar 24 10:22:14 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 15:22:14 -0000 Subject: [llvm-commits] [llvm] r67616 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200903241522.n2OFMF9A000642@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 10:22:11 2009 New Revision: 67616 URL: http://llvm.org/viewvc/llvm-project?rev=67616&view=rev Log: simplify this code a bit now that "allocation to a vreg class" can never fail. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67616&r1=67615&r2=67616&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Mar 24 10:22:11 2009 @@ -4929,9 +4929,7 @@ // Otherwise, if this was a reference to an LLVM register class, create vregs // for this reference. - std::vector RegClassRegs; - const TargetRegisterClass *RC = PhysReg.second; - if (RC) { + if (PhysReg.second != 0) { RegVT = *PhysReg.second->vt_begin(); if (OpInfo.ConstraintVT == MVT::Other) ValueVT = RegVT; @@ -4943,13 +4941,14 @@ OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); return; - } else { - // This is a reference to a register class that doesn't directly correspond - // to an LLVM register class. Allocate NumRegs consecutive, available, - // registers from the class. - RegClassRegs = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode, - OpInfo.ConstraintVT); } + + // This is a reference to a register class that doesn't directly correspond + // to an LLVM register class. Allocate NumRegs consecutive, available, + // registers from the class. + std::vector RegClassRegs + = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode, + OpInfo.ConstraintVT); const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo(); unsigned NumAllocated = 0; @@ -4965,13 +4964,11 @@ // Check to see if this register is allocatable (i.e. don't give out the // stack pointer). - if (RC == 0) { - RC = isAllocatableRegister(Reg, MF, TLI, TRI); - if (!RC) { // Couldn't allocate this register. - // Reset NumAllocated to make sure we return consecutive registers. - NumAllocated = 0; - continue; - } + const TargetRegisterClass *RC = isAllocatableRegister(Reg, MF, TLI, TRI); + if (!RC) { // Couldn't allocate this register. + // Reset NumAllocated to make sure we return consecutive registers. + NumAllocated = 0; + continue; } // Okay, this register is good, we can use it. From sabre at nondot.org Tue Mar 24 10:25:07 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 15:25:07 -0000 Subject: [llvm-commits] [llvm] r67617 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200903241525.n2OFP7mj000755@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 10:25:07 2009 New Revision: 67617 URL: http://llvm.org/viewvc/llvm-project?rev=67617&view=rev Log: Tidy a bit more. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67617&r1=67616&r2=67617&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Mar 24 10:25:07 2009 @@ -4929,15 +4929,15 @@ // Otherwise, if this was a reference to an LLVM register class, create vregs // for this reference. - if (PhysReg.second != 0) { - RegVT = *PhysReg.second->vt_begin(); + if (const TargetRegisterClass *RC = PhysReg.second) { + RegVT = *RC->vt_begin(); if (OpInfo.ConstraintVT == MVT::Other) ValueVT = RegVT; // Create the appropriate number of virtual registers. MachineRegisterInfo &RegInfo = MF.getRegInfo(); for (; NumRegs; --NumRegs) - Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second)); + Regs.push_back(RegInfo.createVirtualRegister(RC)); OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); return; From sabre at nondot.org Tue Mar 24 10:27:41 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 15:27:41 -0000 Subject: [llvm-commits] [llvm] r67618 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200903241527.n2OFRhBV000876@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 10:27:37 2009 New Revision: 67618 URL: http://llvm.org/viewvc/llvm-project?rev=67618&view=rev Log: more tidying: name the components of PhysReg in the case when the target constraint specifies a specific physreg. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67618&r1=67617&r2=67618&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Mar 24 10:27:37 2009 @@ -4896,28 +4896,29 @@ // If this is a constraint for a specific physical register, like {r17}, // assign it now. - if (PhysReg.first) { + if (unsigned AssignedReg = PhysReg.first) { + const TargetRegisterClass *RC = PhysReg.second; if (OpInfo.ConstraintVT == MVT::Other) - ValueVT = *PhysReg.second->vt_begin(); + ValueVT = *RC->vt_begin(); // Get the actual register value type. This is important, because the user // may have asked for (e.g.) the AX register in i32 type. We need to // remember that AX is actually i16 to get the right extension. - RegVT = *PhysReg.second->vt_begin(); + RegVT = *RC->vt_begin(); // This is a explicit reference to a physical register. - Regs.push_back(PhysReg.first); + Regs.push_back(AssignedReg); // If this is an expanded reference, add the rest of the regs to Regs. if (NumRegs != 1) { - TargetRegisterClass::iterator I = PhysReg.second->begin(); - for (; *I != PhysReg.first; ++I) - assert(I != PhysReg.second->end() && "Didn't find reg!"); + TargetRegisterClass::iterator I = RC->begin(); + for (; *I != AssignedReg; ++I) + assert(I != RC->end() && "Didn't find reg!"); // Already added the first reg. --NumRegs; ++I; for (; NumRegs; --NumRegs, ++I) { - assert(I != PhysReg.second->end() && "Ran out of registers to allocate!"); + assert(I != RC->end() && "Ran out of registers to allocate!"); Regs.push_back(*I); } } From gohman at apple.com Tue Mar 24 11:38:27 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 16:38:27 -0000 Subject: [llvm-commits] [llvm] r67622 - /llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll Message-ID: <200903241638.n2OGcSBP005242@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 11:38:27 2009 New Revision: 67622 URL: http://llvm.org/viewvc/llvm-project?rev=67622&view=rev Log: Add a testcase for the scheduling heuristic introduced in r67586. Added: llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll Added: llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll?rev=67622&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-03-23-MultiUseSched.ll Tue Mar 24 11:38:27 2009 @@ -0,0 +1,242 @@ +; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static -stats -info-output-file - > %t +; RUN: not grep spill %t +; RUN: not grep {%rsp} %t +; RUN: not grep {%rbp} %t + +; The register-pressure scheduler should be able to schedule this in a +; way that does not require spills. + + at X = external global i64 ; [#uses=25] + +define fastcc i64 @foo() nounwind { + %tmp = volatile load i64* @X ; [#uses=7] + %tmp1 = volatile load i64* @X ; [#uses=5] + %tmp2 = volatile load i64* @X ; [#uses=3] + %tmp3 = volatile load i64* @X ; [#uses=1] + %tmp4 = volatile load i64* @X ; [#uses=5] + %tmp5 = volatile load i64* @X ; [#uses=3] + %tmp6 = volatile load i64* @X ; [#uses=2] + %tmp7 = volatile load i64* @X ; [#uses=1] + %tmp8 = volatile load i64* @X ; [#uses=1] + %tmp9 = volatile load i64* @X ; [#uses=1] + %tmp10 = volatile load i64* @X ; [#uses=1] + %tmp11 = volatile load i64* @X ; [#uses=1] + %tmp12 = volatile load i64* @X ; [#uses=1] + %tmp13 = volatile load i64* @X ; [#uses=1] + %tmp14 = volatile load i64* @X ; [#uses=1] + %tmp15 = volatile load i64* @X ; [#uses=1] + %tmp16 = volatile load i64* @X ; [#uses=1] + %tmp17 = volatile load i64* @X ; [#uses=1] + %tmp18 = volatile load i64* @X ; [#uses=1] + %tmp19 = volatile load i64* @X ; [#uses=1] + %tmp20 = volatile load i64* @X ; [#uses=1] + %tmp21 = volatile load i64* @X ; [#uses=1] + %tmp22 = volatile load i64* @X ; [#uses=1] + %tmp23 = volatile load i64* @X ; [#uses=1] + %tmp24 = call i64 @llvm.bswap.i64(i64 %tmp8) ; [#uses=1] + %tmp25 = add i64 %tmp6, %tmp5 ; [#uses=1] + %tmp26 = add i64 %tmp25, %tmp4 ; [#uses=1] + %tmp27 = add i64 %tmp7, %tmp4 ; [#uses=1] + %tmp28 = add i64 %tmp27, %tmp26 ; [#uses=1] + %tmp29 = add i64 %tmp28, %tmp24 ; [#uses=2] + %tmp30 = add i64 %tmp2, %tmp1 ; [#uses=1] + %tmp31 = add i64 %tmp30, %tmp ; [#uses=1] + %tmp32 = add i64 %tmp2, %tmp1 ; [#uses=1] + %tmp33 = add i64 %tmp31, %tmp32 ; [#uses=1] + %tmp34 = add i64 %tmp29, %tmp3 ; [#uses=5] + %tmp35 = add i64 %tmp33, %tmp ; [#uses=1] + %tmp36 = add i64 %tmp35, %tmp29 ; [#uses=7] + %tmp37 = call i64 @llvm.bswap.i64(i64 %tmp9) ; [#uses=1] + %tmp38 = add i64 %tmp4, %tmp5 ; [#uses=1] + %tmp39 = add i64 %tmp38, %tmp34 ; [#uses=1] + %tmp40 = add i64 %tmp6, %tmp37 ; [#uses=1] + %tmp41 = add i64 %tmp40, %tmp39 ; [#uses=1] + %tmp42 = add i64 %tmp41, %tmp34 ; [#uses=2] + %tmp43 = add i64 %tmp1, %tmp ; [#uses=1] + %tmp44 = add i64 %tmp36, %tmp43 ; [#uses=1] + %tmp45 = add i64 %tmp1, %tmp ; [#uses=1] + %tmp46 = add i64 %tmp44, %tmp45 ; [#uses=1] + %tmp47 = add i64 %tmp42, %tmp2 ; [#uses=5] + %tmp48 = add i64 %tmp36, %tmp46 ; [#uses=1] + %tmp49 = add i64 %tmp48, %tmp42 ; [#uses=7] + %tmp50 = call i64 @llvm.bswap.i64(i64 %tmp10) ; [#uses=1] + %tmp51 = add i64 %tmp34, %tmp4 ; [#uses=1] + %tmp52 = add i64 %tmp51, %tmp47 ; [#uses=1] + %tmp53 = add i64 %tmp5, %tmp50 ; [#uses=1] + %tmp54 = add i64 %tmp53, %tmp52 ; [#uses=1] + %tmp55 = add i64 %tmp54, %tmp47 ; [#uses=2] + %tmp56 = add i64 %tmp36, %tmp ; [#uses=1] + %tmp57 = add i64 %tmp49, %tmp56 ; [#uses=1] + %tmp58 = add i64 %tmp36, %tmp ; [#uses=1] + %tmp59 = add i64 %tmp57, %tmp58 ; [#uses=1] + %tmp60 = add i64 %tmp55, %tmp1 ; [#uses=5] + %tmp61 = add i64 %tmp49, %tmp59 ; [#uses=1] + %tmp62 = add i64 %tmp61, %tmp55 ; [#uses=7] + %tmp63 = call i64 @llvm.bswap.i64(i64 %tmp11) ; [#uses=1] + %tmp64 = add i64 %tmp47, %tmp34 ; [#uses=1] + %tmp65 = add i64 %tmp64, %tmp60 ; [#uses=1] + %tmp66 = add i64 %tmp4, %tmp63 ; [#uses=1] + %tmp67 = add i64 %tmp66, %tmp65 ; [#uses=1] + %tmp68 = add i64 %tmp67, %tmp60 ; [#uses=2] + %tmp69 = add i64 %tmp49, %tmp36 ; [#uses=1] + %tmp70 = add i64 %tmp62, %tmp69 ; [#uses=1] + %tmp71 = add i64 %tmp49, %tmp36 ; [#uses=1] + %tmp72 = add i64 %tmp70, %tmp71 ; [#uses=1] + %tmp73 = add i64 %tmp68, %tmp ; [#uses=5] + %tmp74 = add i64 %tmp62, %tmp72 ; [#uses=1] + %tmp75 = add i64 %tmp74, %tmp68 ; [#uses=7] + %tmp76 = call i64 @llvm.bswap.i64(i64 %tmp12) ; [#uses=1] + %tmp77 = add i64 %tmp60, %tmp47 ; [#uses=1] + %tmp78 = add i64 %tmp77, %tmp73 ; [#uses=1] + %tmp79 = add i64 %tmp34, %tmp76 ; [#uses=1] + %tmp80 = add i64 %tmp79, %tmp78 ; [#uses=1] + %tmp81 = add i64 %tmp80, %tmp73 ; [#uses=2] + %tmp82 = add i64 %tmp62, %tmp49 ; [#uses=1] + %tmp83 = add i64 %tmp75, %tmp82 ; [#uses=1] + %tmp84 = add i64 %tmp62, %tmp49 ; [#uses=1] + %tmp85 = add i64 %tmp83, %tmp84 ; [#uses=1] + %tmp86 = add i64 %tmp81, %tmp36 ; [#uses=5] + %tmp87 = add i64 %tmp75, %tmp85 ; [#uses=1] + %tmp88 = add i64 %tmp87, %tmp81 ; [#uses=7] + %tmp89 = call i64 @llvm.bswap.i64(i64 %tmp13) ; [#uses=1] + %tmp90 = add i64 %tmp73, %tmp60 ; [#uses=1] + %tmp91 = add i64 %tmp90, %tmp86 ; [#uses=1] + %tmp92 = add i64 %tmp47, %tmp89 ; [#uses=1] + %tmp93 = add i64 %tmp92, %tmp91 ; [#uses=1] + %tmp94 = add i64 %tmp93, %tmp86 ; [#uses=2] + %tmp95 = add i64 %tmp75, %tmp62 ; [#uses=1] + %tmp96 = add i64 %tmp88, %tmp95 ; [#uses=1] + %tmp97 = add i64 %tmp75, %tmp62 ; [#uses=1] + %tmp98 = add i64 %tmp96, %tmp97 ; [#uses=1] + %tmp99 = add i64 %tmp94, %tmp49 ; [#uses=5] + %tmp100 = add i64 %tmp88, %tmp98 ; [#uses=1] + %tmp101 = add i64 %tmp100, %tmp94 ; [#uses=7] + %tmp102 = call i64 @llvm.bswap.i64(i64 %tmp14) ; [#uses=1] + %tmp103 = add i64 %tmp86, %tmp73 ; [#uses=1] + %tmp104 = add i64 %tmp103, %tmp99 ; [#uses=1] + %tmp105 = add i64 %tmp102, %tmp60 ; [#uses=1] + %tmp106 = add i64 %tmp105, %tmp104 ; [#uses=1] + %tmp107 = add i64 %tmp106, %tmp99 ; [#uses=2] + %tmp108 = add i64 %tmp88, %tmp75 ; [#uses=1] + %tmp109 = add i64 %tmp101, %tmp108 ; [#uses=1] + %tmp110 = add i64 %tmp88, %tmp75 ; [#uses=1] + %tmp111 = add i64 %tmp109, %tmp110 ; [#uses=1] + %tmp112 = add i64 %tmp107, %tmp62 ; [#uses=5] + %tmp113 = add i64 %tmp101, %tmp111 ; [#uses=1] + %tmp114 = add i64 %tmp113, %tmp107 ; [#uses=7] + %tmp115 = call i64 @llvm.bswap.i64(i64 %tmp15) ; [#uses=1] + %tmp116 = add i64 %tmp99, %tmp86 ; [#uses=1] + %tmp117 = add i64 %tmp116, %tmp112 ; [#uses=1] + %tmp118 = add i64 %tmp115, %tmp73 ; [#uses=1] + %tmp119 = add i64 %tmp118, %tmp117 ; [#uses=1] + %tmp120 = add i64 %tmp119, %tmp112 ; [#uses=2] + %tmp121 = add i64 %tmp101, %tmp88 ; [#uses=1] + %tmp122 = add i64 %tmp114, %tmp121 ; [#uses=1] + %tmp123 = add i64 %tmp101, %tmp88 ; [#uses=1] + %tmp124 = add i64 %tmp122, %tmp123 ; [#uses=1] + %tmp125 = add i64 %tmp120, %tmp75 ; [#uses=5] + %tmp126 = add i64 %tmp114, %tmp124 ; [#uses=1] + %tmp127 = add i64 %tmp126, %tmp120 ; [#uses=7] + %tmp128 = call i64 @llvm.bswap.i64(i64 %tmp16) ; [#uses=1] + %tmp129 = add i64 %tmp112, %tmp99 ; [#uses=1] + %tmp130 = add i64 %tmp129, %tmp125 ; [#uses=1] + %tmp131 = add i64 %tmp128, %tmp86 ; [#uses=1] + %tmp132 = add i64 %tmp131, %tmp130 ; [#uses=1] + %tmp133 = add i64 %tmp132, %tmp125 ; [#uses=2] + %tmp134 = add i64 %tmp114, %tmp101 ; [#uses=1] + %tmp135 = add i64 %tmp127, %tmp134 ; [#uses=1] + %tmp136 = add i64 %tmp114, %tmp101 ; [#uses=1] + %tmp137 = add i64 %tmp135, %tmp136 ; [#uses=1] + %tmp138 = add i64 %tmp133, %tmp88 ; [#uses=5] + %tmp139 = add i64 %tmp127, %tmp137 ; [#uses=1] + %tmp140 = add i64 %tmp139, %tmp133 ; [#uses=7] + %tmp141 = call i64 @llvm.bswap.i64(i64 %tmp17) ; [#uses=1] + %tmp142 = add i64 %tmp125, %tmp112 ; [#uses=1] + %tmp143 = add i64 %tmp142, %tmp138 ; [#uses=1] + %tmp144 = add i64 %tmp141, %tmp99 ; [#uses=1] + %tmp145 = add i64 %tmp144, %tmp143 ; [#uses=1] + %tmp146 = add i64 %tmp145, %tmp138 ; [#uses=2] + %tmp147 = add i64 %tmp127, %tmp114 ; [#uses=1] + %tmp148 = add i64 %tmp140, %tmp147 ; [#uses=1] + %tmp149 = add i64 %tmp127, %tmp114 ; [#uses=1] + %tmp150 = add i64 %tmp148, %tmp149 ; [#uses=1] + %tmp151 = add i64 %tmp146, %tmp101 ; [#uses=5] + %tmp152 = add i64 %tmp140, %tmp150 ; [#uses=1] + %tmp153 = add i64 %tmp152, %tmp146 ; [#uses=7] + %tmp154 = call i64 @llvm.bswap.i64(i64 %tmp18) ; [#uses=1] + %tmp155 = add i64 %tmp138, %tmp125 ; [#uses=1] + %tmp156 = add i64 %tmp155, %tmp151 ; [#uses=1] + %tmp157 = add i64 %tmp154, %tmp112 ; [#uses=1] + %tmp158 = add i64 %tmp157, %tmp156 ; [#uses=1] + %tmp159 = add i64 %tmp158, %tmp151 ; [#uses=2] + %tmp160 = add i64 %tmp140, %tmp127 ; [#uses=1] + %tmp161 = add i64 %tmp153, %tmp160 ; [#uses=1] + %tmp162 = add i64 %tmp140, %tmp127 ; [#uses=1] + %tmp163 = add i64 %tmp161, %tmp162 ; [#uses=1] + %tmp164 = add i64 %tmp159, %tmp114 ; [#uses=5] + %tmp165 = add i64 %tmp153, %tmp163 ; [#uses=1] + %tmp166 = add i64 %tmp165, %tmp159 ; [#uses=7] + %tmp167 = call i64 @llvm.bswap.i64(i64 %tmp19) ; [#uses=1] + %tmp168 = add i64 %tmp151, %tmp138 ; [#uses=1] + %tmp169 = add i64 %tmp168, %tmp164 ; [#uses=1] + %tmp170 = add i64 %tmp167, %tmp125 ; [#uses=1] + %tmp171 = add i64 %tmp170, %tmp169 ; [#uses=1] + %tmp172 = add i64 %tmp171, %tmp164 ; [#uses=2] + %tmp173 = add i64 %tmp153, %tmp140 ; [#uses=1] + %tmp174 = add i64 %tmp166, %tmp173 ; [#uses=1] + %tmp175 = add i64 %tmp153, %tmp140 ; [#uses=1] + %tmp176 = add i64 %tmp174, %tmp175 ; [#uses=1] + %tmp177 = add i64 %tmp172, %tmp127 ; [#uses=5] + %tmp178 = add i64 %tmp166, %tmp176 ; [#uses=1] + %tmp179 = add i64 %tmp178, %tmp172 ; [#uses=6] + %tmp180 = call i64 @llvm.bswap.i64(i64 %tmp20) ; [#uses=1] + %tmp181 = add i64 %tmp164, %tmp151 ; [#uses=1] + %tmp182 = add i64 %tmp181, %tmp177 ; [#uses=1] + %tmp183 = add i64 %tmp180, %tmp138 ; [#uses=1] + %tmp184 = add i64 %tmp183, %tmp182 ; [#uses=1] + %tmp185 = add i64 %tmp184, %tmp177 ; [#uses=2] + %tmp186 = add i64 %tmp166, %tmp153 ; [#uses=1] + %tmp187 = add i64 %tmp179, %tmp186 ; [#uses=1] + %tmp188 = add i64 %tmp166, %tmp153 ; [#uses=1] + %tmp189 = add i64 %tmp187, %tmp188 ; [#uses=1] + %tmp190 = add i64 %tmp185, %tmp140 ; [#uses=4] + %tmp191 = add i64 %tmp179, %tmp189 ; [#uses=1] + %tmp192 = add i64 %tmp191, %tmp185 ; [#uses=4] + %tmp193 = call i64 @llvm.bswap.i64(i64 %tmp21) ; [#uses=1] + %tmp194 = add i64 %tmp177, %tmp164 ; [#uses=1] + %tmp195 = add i64 %tmp194, %tmp190 ; [#uses=1] + %tmp196 = add i64 %tmp193, %tmp151 ; [#uses=1] + %tmp197 = add i64 %tmp196, %tmp195 ; [#uses=1] + %tmp198 = add i64 %tmp197, %tmp190 ; [#uses=2] + %tmp199 = add i64 %tmp179, %tmp166 ; [#uses=1] + %tmp200 = add i64 %tmp192, %tmp199 ; [#uses=1] + %tmp201 = add i64 %tmp179, %tmp166 ; [#uses=1] + %tmp202 = add i64 %tmp200, %tmp201 ; [#uses=1] + %tmp203 = add i64 %tmp198, %tmp153 ; [#uses=3] + %tmp204 = add i64 %tmp192, %tmp202 ; [#uses=1] + %tmp205 = add i64 %tmp204, %tmp198 ; [#uses=2] + %tmp206 = call i64 @llvm.bswap.i64(i64 %tmp22) ; [#uses=1] + %tmp207 = add i64 %tmp190, %tmp177 ; [#uses=1] + %tmp208 = add i64 %tmp207, %tmp203 ; [#uses=1] + %tmp209 = add i64 %tmp206, %tmp164 ; [#uses=1] + %tmp210 = add i64 %tmp209, %tmp208 ; [#uses=1] + %tmp211 = add i64 %tmp210, %tmp203 ; [#uses=2] + %tmp212 = add i64 %tmp192, %tmp179 ; [#uses=1] + %tmp213 = add i64 %tmp205, %tmp212 ; [#uses=1] + %tmp214 = add i64 %tmp192, %tmp179 ; [#uses=1] + %tmp215 = add i64 %tmp213, %tmp214 ; [#uses=1] + %tmp216 = add i64 %tmp211, %tmp166 ; [#uses=2] + %tmp217 = add i64 %tmp205, %tmp215 ; [#uses=1] + %tmp218 = add i64 %tmp217, %tmp211 ; [#uses=1] + %tmp219 = call i64 @llvm.bswap.i64(i64 %tmp23) ; [#uses=2] + volatile store i64 %tmp219, i64* @X, align 8 + %tmp220 = add i64 %tmp203, %tmp190 ; [#uses=1] + %tmp221 = add i64 %tmp220, %tmp216 ; [#uses=1] + %tmp222 = add i64 %tmp219, %tmp177 ; [#uses=1] + %tmp223 = add i64 %tmp222, %tmp221 ; [#uses=1] + %tmp224 = add i64 %tmp223, %tmp216 ; [#uses=1] + %tmp225 = add i64 %tmp224, %tmp218 ; [#uses=1] + ret i64 %tmp225 +} + +declare i64 @llvm.bswap.i64(i64) nounwind readnone From dalej at apple.com Tue Mar 24 12:35:45 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 24 Mar 2009 17:35:45 -0000 Subject: [llvm-commits] [llvm] r67629 - /llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200903241735.n2OHZjCB008486@zion.cs.uiuc.edu> Author: johannes Date: Tue Mar 24 12:35:45 2009 New Revision: 67629 URL: http://llvm.org/viewvc/llvm-project?rev=67629&view=rev Log: Change JIT for different layout of fp80. Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=67629&r1=67628&r2=67629&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Tue Mar 24 12:35:45 2009 @@ -752,11 +752,11 @@ uint16_t *Dest = (uint16_t*)Ptr; const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData(); // This is endian dependent, but it will only work on x86 anyway. - Dest[0] = Src[4]; - Dest[1] = Src[0]; - Dest[2] = Src[1]; - Dest[3] = Src[2]; - Dest[4] = Src[3]; + Dest[0] = Src[0]; + Dest[1] = Src[1]; + Dest[2] = Src[2]; + Dest[3] = Src[3]; + Dest[4] = Src[4]; break; } case Type::PointerTyID: From isanbard at gmail.com Tue Mar 24 12:42:38 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 17:42:38 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67630 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Message-ID: <200903241742.n2OHgcoC008791@zion.cs.uiuc.edu> Author: void Date: Tue Mar 24 12:42:38 2009 New Revision: 67630 URL: http://llvm.org/viewvc/llvm-project?rev=67630&view=rev Log: --- Merging (from foreign repository) r67563 into '.': U gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp?rev=67630&r1=67629&r2=67630&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Tue Mar 24 12:42:38 2009 @@ -6413,12 +6413,9 @@ long RealArr[4]; uint64_t UArr[2]; REAL_VALUE_TO_TARGET_LONG_DOUBLE(TREE_REAL_CST(exp), RealArr); - - UArr[0] = ((uint64_t)((uint16_t)RealArr[2]) << 48) | - ((uint64_t)((uint32_t)RealArr[1]) << 16) | - ((uint64_t)((uint16_t)(RealArr[0] >> 16))); - UArr[1] = (uint16_t)RealArr[0]; - + UArr[0] = ((uint64_t)((uint32_t)RealArr[0])) | + ((uint64_t)((uint32_t)RealArr[1]) << 32); + UArr[1] = (uint16_t)RealArr[2]; return ConstantFP::get(APFloat(APInt(80, 2, UArr))); } else if (Ty==Type::PPC_FP128Ty) { long RealArr[4]; From isanbard at gmail.com Tue Mar 24 12:45:21 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 17:45:21 -0000 Subject: [llvm-commits] [llvm] r67631 - /llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200903241745.n2OHjLNU008945@zion.cs.uiuc.edu> Author: void Date: Tue Mar 24 12:45:21 2009 New Revision: 67631 URL: http://llvm.org/viewvc/llvm-project?rev=67631&view=rev Log: --- Merging (from foreign repository) r67629 into '.': U lib/ExecutionEngine/ExecutionEngine.cpp Modified: llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp Modified: llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp?rev=67631&r1=67630&r2=67631&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp Tue Mar 24 12:45:21 2009 @@ -752,11 +752,11 @@ uint16_t *Dest = (uint16_t*)Ptr; const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData(); // This is endian dependent, but it will only work on x86 anyway. - Dest[0] = Src[4]; - Dest[1] = Src[0]; - Dest[2] = Src[1]; - Dest[3] = Src[2]; - Dest[4] = Src[3]; + Dest[0] = Src[0]; + Dest[1] = Src[1]; + Dest[2] = Src[2]; + Dest[3] = Src[3]; + Dest[4] = Src[4]; break; } case Type::PointerTyID: From sabre at nondot.org Tue Mar 24 13:15:30 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 18:15:30 -0000 Subject: [llvm-commits] [llvm] r67635 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/shift.ll Message-ID: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 13:15:30 2009 New Revision: 67635 URL: http://llvm.org/viewvc/llvm-project?rev=67635&view=rev Log: two changes: 1. Make instcombine always canonicalize trunc x to i1 into an icmp(x&1). This exposes the AND to other instcombine xforms and is more of what the code generator expects. 2. Rewrite the remaining trunc pattern match to use 'match', which simplifies it a lot. Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/test/Transforms/InstCombine/shift.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=67635&r1=67634&r2=67635&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Mar 24 13:15:30 2009 @@ -6575,8 +6575,8 @@ // preferable because it allows the C<hasOneUse() && RHSV == 0 && - ICI.isEquality() && !Shift->isArithmeticShift() && - isa(Shift->getOperand(0))) { + ICI.isEquality() && !Shift->isArithmeticShift()/* && + isa(Shift->getOperand(0))*/) { // Compute C << Y. Value *NS; if (Shift->getOpcode() == Instruction::LShr) { @@ -8147,49 +8147,33 @@ const Type *Ty = CI.getType(); uint32_t DestBitWidth = Ty->getPrimitiveSizeInBits(); uint32_t SrcBitWidth = cast(Src->getType())->getBitWidth(); - - if (Instruction *SrcI = dyn_cast(Src)) { - switch (SrcI->getOpcode()) { - default: break; - case Instruction::LShr: - // We can shrink lshr to something smaller if we know the bits shifted in - // are already zeros. - if (ConstantInt *ShAmtV = dyn_cast(SrcI->getOperand(1))) { - uint32_t ShAmt = ShAmtV->getLimitedValue(SrcBitWidth); - - // Get a mask for the bits shifting in. - APInt Mask(APInt::getLowBitsSet(SrcBitWidth, ShAmt).shl(DestBitWidth)); - Value* SrcIOp0 = SrcI->getOperand(0); - if (SrcI->hasOneUse() && MaskedValueIsZero(SrcIOp0, Mask)) { - if (ShAmt >= DestBitWidth) // All zeros. - return ReplaceInstUsesWith(CI, Constant::getNullValue(Ty)); - - // Okay, we can shrink this. Truncate the input, then return a new - // shift. - Value *V1 = InsertCastBefore(Instruction::Trunc, SrcIOp0, Ty, CI); - Value *V2 = InsertCastBefore(Instruction::Trunc, SrcI->getOperand(1), - Ty, CI); - return BinaryOperator::CreateLShr(V1, V2); - } - } else { // This is a variable shr. - - // Turn 'trunc (lshr X, Y) to bool' into '(X & (1 << Y)) != 0'. This is - // more LLVM instructions, but allows '1 << Y' to be hoisted if - // loop-invariant and CSE'd. - if (CI.getType() == Type::Int1Ty && SrcI->hasOneUse()) { - Value *One = ConstantInt::get(SrcI->getType(), 1); - - Value *V = InsertNewInstBefore( - BinaryOperator::CreateShl(One, SrcI->getOperand(1), - "tmp"), CI); - V = InsertNewInstBefore(BinaryOperator::CreateAnd(V, - SrcI->getOperand(0), - "tmp"), CI); - Value *Zero = Constant::getNullValue(V->getType()); - return new ICmpInst(ICmpInst::ICMP_NE, V, Zero); - } - } - break; + + // Canonicalize trunc x to i1 -> (icmp ne (and x, 1), 0) + if (DestBitWidth == 1) { + Constant *One = ConstantInt::get(Src->getType(), 1); + Src = InsertNewInstBefore(BinaryOperator::CreateAnd(Src, One, "tmp"), CI); + Value *Zero = Constant::getNullValue(Src->getType()); + return new ICmpInst(ICmpInst::ICMP_NE, Src, Zero); + } + + // Optimize trunc(lshr(), c) to pull the shift through the truncate. + ConstantInt *ShAmtV = 0; + Value *ShiftOp = 0; + if (Src->hasOneUse() && + match(Src, m_LShr(m_Value(ShiftOp), m_ConstantInt(ShAmtV)))) { + uint32_t ShAmt = ShAmtV->getLimitedValue(SrcBitWidth); + + // Get a mask for the bits shifting in. + APInt Mask(APInt::getLowBitsSet(SrcBitWidth, ShAmt).shl(DestBitWidth)); + if (MaskedValueIsZero(ShiftOp, Mask)) { + if (ShAmt >= DestBitWidth) // All zeros. + return ReplaceInstUsesWith(CI, Constant::getNullValue(Ty)); + + // Okay, we can shrink this. Truncate the input, then return a new + // shift. + Value *V1 = InsertCastBefore(Instruction::Trunc, ShiftOp, Ty, CI); + Value *V2 = ConstantExpr::getTrunc(ShAmtV, Ty); + return BinaryOperator::CreateLShr(V1, V2); } } Modified: llvm/trunk/test/Transforms/InstCombine/shift.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/shift.ll?rev=67635&r1=67634&r2=67635&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/shift.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/shift.ll Tue Mar 24 13:15:30 2009 @@ -206,4 +206,11 @@ %D = shl i32 %C, 1 ; [#uses=1] ret i32 %D } + + +define i1 @test27(i32 %x) nounwind { + %y = lshr i32 %x, 3 + %z = trunc i32 %y to i1 + ret i1 %z +} From dalej at apple.com Tue Mar 24 13:16:17 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 24 Mar 2009 18:16:17 -0000 Subject: [llvm-commits] [llvm] r67636 - /llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200903241816.n2OIGI75010903@zion.cs.uiuc.edu> Author: johannes Date: Tue Mar 24 13:16:17 2009 New Revision: 67636 URL: http://llvm.org/viewvc/llvm-project?rev=67636&view=rev Log: fix one more fp80 case (used only by Interpreter) and streamline code here a bit. Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=67636&r1=67635&r2=67636&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Tue Mar 24 13:16:17 2009 @@ -748,17 +748,9 @@ case Type::DoubleTyID: *((double*)Ptr) = Val.DoubleVal; break; - case Type::X86_FP80TyID: { - uint16_t *Dest = (uint16_t*)Ptr; - const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData(); - // This is endian dependent, but it will only work on x86 anyway. - Dest[0] = Src[0]; - Dest[1] = Src[1]; - Dest[2] = Src[2]; - Dest[3] = Src[3]; - Dest[4] = Src[4]; - break; - } + case Type::X86_FP80TyID: + memcpy(Ptr, Val.IntVal.getRawData(), 10); + break; case Type::PointerTyID: // Ensure 64 bit target pointers are fully initialized on 32 bit hosts. if (StoreBytes != sizeof(PointerTy)) @@ -835,16 +827,8 @@ case Type::X86_FP80TyID: { // This is endian dependent, but it will only work on x86 anyway. // FIXME: Will not trap if loading a signaling NaN. - uint16_t *p = (uint16_t*)Ptr; - union { - uint16_t x[8]; - uint64_t y[2]; - }; - x[0] = p[1]; - x[1] = p[2]; - x[2] = p[3]; - x[3] = p[4]; - x[4] = p[0]; + uint64_t y[2]; + memcpy(y, Ptr, 10); Result.IntVal = APInt(80, 2, y); break; } From isanbard at gmail.com Tue Mar 24 13:30:35 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 24 Mar 2009 18:30:35 -0000 Subject: [llvm-commits] [llvm] r67637 - /llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200903241830.n2OIUar1011695@zion.cs.uiuc.edu> Author: void Date: Tue Mar 24 13:30:35 2009 New Revision: 67637 URL: http://llvm.org/viewvc/llvm-project?rev=67637&view=rev Log: --- Merging (from foreign repository) r67636 into '.': U lib/ExecutionEngine/ExecutionEngine.cpp Modified: llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp Modified: llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp?rev=67637&r1=67636&r2=67637&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/branches/Apple/Dib/lib/ExecutionEngine/ExecutionEngine.cpp Tue Mar 24 13:30:35 2009 @@ -748,17 +748,9 @@ case Type::DoubleTyID: *((double*)Ptr) = Val.DoubleVal; break; - case Type::X86_FP80TyID: { - uint16_t *Dest = (uint16_t*)Ptr; - const uint16_t *Src = (uint16_t*)Val.IntVal.getRawData(); - // This is endian dependent, but it will only work on x86 anyway. - Dest[0] = Src[0]; - Dest[1] = Src[1]; - Dest[2] = Src[2]; - Dest[3] = Src[3]; - Dest[4] = Src[4]; - break; - } + case Type::X86_FP80TyID: + memcpy(Ptr, Val.IntVal.getRawData(), 10); + break; case Type::PointerTyID: // Ensure 64 bit target pointers are fully initialized on 32 bit hosts. if (StoreBytes != sizeof(PointerTy)) @@ -835,16 +827,8 @@ case Type::X86_FP80TyID: { // This is endian dependent, but it will only work on x86 anyway. // FIXME: Will not trap if loading a signaling NaN. - uint16_t *p = (uint16_t*)Ptr; - union { - uint16_t x[8]; - uint64_t y[2]; - }; - x[0] = p[1]; - x[1] = p[2]; - x[2] = p[3]; - x[3] = p[4]; - x[4] = p[0]; + uint64_t y[2]; + memcpy(y, Ptr, 10); Result.IntVal = APInt(80, 2, y); break; } From sabre at nondot.org Tue Mar 24 13:35:40 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 18:35:40 -0000 Subject: [llvm-commits] [llvm] r67638 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/ptr-int-cast.ll Message-ID: <200903241835.n2OIZeK5011881@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 13:35:40 2009 New Revision: 67638 URL: http://llvm.org/viewvc/llvm-project?rev=67638&view=rev Log: canonicalize inttoptr and ptrtoint instructions which cast pointers to/from integer types that are not intptr_t to convert to intptr_t then do an integer conversion to the dest type. This exposes the cast to the optimizer. Added: llvm/trunk/test/Transforms/InstCombine/ptr-int-cast.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=67638&r1=67637&r2=67638&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Mar 24 13:35:40 2009 @@ -218,7 +218,7 @@ Instruction *visitFPToSI(FPToSIInst &FI); Instruction *visitUIToFP(CastInst &CI); Instruction *visitSIToFP(CastInst &CI); - Instruction *visitPtrToInt(CastInst &CI); + Instruction *visitPtrToInt(PtrToIntInst &CI); Instruction *visitIntToPtr(IntToPtrInst &CI); Instruction *visitBitCast(BitCastInst &CI); Instruction *FoldSelectOpOp(SelectInst &SI, Instruction *TI, @@ -474,9 +474,16 @@ Instruction::CastOps firstOp = Instruction::CastOps(CI->getOpcode()); Instruction::CastOps secondOp = Instruction::CastOps(opcode); - return Instruction::CastOps( - CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, - DstTy, TD->getIntPtrType())); + unsigned Res = CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, + DstTy, TD->getIntPtrType()); + + // We don't want to form an inttoptr or ptrtoint that converts to an integer + // type that differs from the pointer size. + if ((Res == Instruction::IntToPtr && SrcTy != TD->getIntPtrType()) || + (Res == Instruction::PtrToInt && DstTy != TD->getIntPtrType())) + Res = 0; + + return Instruction::CastOps(Res); } /// ValueRequiresCast - Return true if the cast from "V to Ty" actually results @@ -8536,11 +8543,36 @@ return commonCastTransforms(CI); } -Instruction *InstCombiner::visitPtrToInt(CastInst &CI) { +Instruction *InstCombiner::visitPtrToInt(PtrToIntInst &CI) { + // If the destination integer type is smaller than the intptr_t type for + // this target, do a ptrtoint to intptr_t then do a trunc. This allows the + // trunc to be exposed to other transforms. Don't do this for extending + // ptrtoint's, because we don't know if the target sign or zero extends its + // pointers. + if (CI.getType()->getPrimitiveSizeInBits() < TD->getPointerSizeInBits()) { + Value *P = InsertNewInstBefore(new PtrToIntInst(CI.getOperand(0), + TD->getIntPtrType(), + "tmp"), CI); + return new TruncInst(P, CI.getType()); + } + return commonPointerCastTransforms(CI); } Instruction *InstCombiner::visitIntToPtr(IntToPtrInst &CI) { + // If the source integer type is larger than the intptr_t type for + // this target, do a trunc to the intptr_t type, then inttoptr of it. This + // allows the trunc to be exposed to other transforms. Don't do this for + // extending inttoptr's, because we don't know if the target sign or zero + // extends to pointers. + if (CI.getOperand(0)->getType()->getPrimitiveSizeInBits() > + TD->getPointerSizeInBits()) { + Value *P = InsertNewInstBefore(new TruncInst(CI.getOperand(0), + TD->getIntPtrType(), + "tmp"), CI); + return new IntToPtrInst(P, CI.getType()); + } + if (Instruction *I = commonCastTransforms(CI)) return I; Added: llvm/trunk/test/Transforms/InstCombine/ptr-int-cast.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/ptr-int-cast.ll?rev=67638&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/ptr-int-cast.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/ptr-int-cast.ll Tue Mar 24 13:35:40 2009 @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t + +define i1 @test1(i32 *%x) nounwind { +entry: +; RUN: grep {ptrtoint i32\\* %x to i64} %t + %tmp = ptrtoint i32* %x to i1 + ret i1 %tmp +} + +define i32* @test2(i128 %x) nounwind { +entry: +; RUN: grep {inttoptr i64 %.mp1 to i32\\*} %t + %tmp = inttoptr i128 %x to i32* + ret i32* %tmp +} + From gohman at apple.com Tue Mar 24 14:08:46 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 12:08:46 -0700 Subject: [llvm-commits] DAGCombiner Patch: Allow targets to do combine first. In-Reply-To: References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> <49C7BDD8.1070301@mxc.ca> <200903240714.15380.baldrick@free.fr> Message-ID: <28167C61-6F2F-470D-A5FC-ACBA8EC222EC@apple.com> On Mar 24, 2009, at 3:17 AM, Sanjiv.Gupta at microchip.com wrote: > The DAGCombiner::combine() in its existing form does not allow > targets to do anything if the visitNODE() has done something with it. > IMO, the targets should always be allowed to do stuff irrespective > of what we want to do in visitNODE(). DAGCombine is iterative; I believe the target hook will be called after DAGCombine is done hacking with it. I guess what your patch does is add a hook to let the target intervene before DAGCombine runs. One of the main purposes of the first DAGCombine runs is to clean up and canonicalize the mess that SelectionDAGLowering emits so that the rest of CodeGen doesn't have to deal with it. Consequently, it's not clear why it would be useful to give targets a hook to step into the mess, in general. And in the specific case that's motivating this, it seems that trying to fix this problem by selectively disabling optimizations seems to be swimming upstream. > Attached is a patch for same. Let me know if it sounds ok. I will go > ahead and commit it. Please send normal attachments. winmail.dat seems to be some Outlook-specific thing. LLVM's CodeGen is designed for register architectures. When it is used to target stack architectures, the preferred approach seems to be to do instruction selection as if the target had registers and instructions that operate on registers, and then to lower everything to stack operations in a later phase. PIC16 seems to be an accumulator architecture. Would it make sense to take a similar approach? Ultimately, LLVM does have its share of hacks for expedience, so this probably won't be forbidden, if that's the case. Dan From ggreif at gmail.com Tue Mar 24 14:28:40 2009 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 24 Mar 2009 19:28:40 -0000 Subject: [llvm-commits] [llvm] r67642 - /llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Message-ID: <200903241928.n2OJSeIT014811@zion.cs.uiuc.edu> Author: ggreif Date: Tue Mar 24 14:28:39 2009 New Revision: 67642 URL: http://llvm.org/viewvc/llvm-project?rev=67642&view=rev Log: simplify logic and get rid of the assumption that operand 0 is the callee Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=67642&r1=67641&r2=67642&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Mar 24 14:28:39 2009 @@ -123,14 +123,14 @@ Pointers.insert(&*I); Instruction &Inst = *I; User::op_iterator OI = Inst.op_begin(); - if ((isa(Inst) || isa(Inst)) && - isa(Inst.getOperand(0))) + CallSite CS = CallSite::get(&Inst); + if (CS.getInstruction() && + isa(CS.getCalledValue())) ++OI; // Skip actual functions for direct function calls. for (; OI != Inst.op_end(); ++OI) if (isa((*OI)->getType()) && !isa(*OI)) Pointers.insert(*OI); - CallSite CS = CallSite::get(&*I); if (CS.getInstruction()) CallSites.insert(CS); } From gohman at apple.com Tue Mar 24 15:20:28 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 20:20:28 -0000 Subject: [llvm-commits] [llvm] r67646 - /llvm/trunk/projects/sample/autoconf/AutoRegen.sh Message-ID: <200903242020.n2OKKSgW016763@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 15:20:28 2009 New Revision: 67646 URL: http://llvm.org/viewvc/llvm-project?rev=67646&view=rev Log: Set the svn:mime-type to text/x-sh, so that diffs work. Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh (props changed) Propchange: llvm/trunk/projects/sample/autoconf/AutoRegen.sh ------------------------------------------------------------------------------ --- svn:mime-type (original) +++ svn:mime-type Tue Mar 24 15:20:28 2009 @@ -1 +1 @@ -application/x-sh +text/x-sh From gohman at apple.com Tue Mar 24 15:21:37 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 20:21:37 -0000 Subject: [llvm-commits] [llvm] r67647 - /llvm/trunk/projects/sample/autoconf/AutoRegen.sh Message-ID: <200903242021.n2OKLbVB016867@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 15:21:37 2009 New Revision: 67647 URL: http://llvm.org/viewvc/llvm-project?rev=67647&view=rev Log: Fix bash-isms. Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/autoconf/AutoRegen.sh?rev=67647&r1=67646&r2=67647&view=diff ============================================================================== --- llvm/trunk/projects/sample/autoconf/AutoRegen.sh (original) +++ llvm/trunk/projects/sample/autoconf/AutoRegen.sh Tue Mar 24 15:21:37 2009 @@ -25,11 +25,11 @@ else while true ; do echo "LLVM source root not found." - read -p "Enter full path to LLVM source:" + read -p "Enter full path to LLVM source:" REPLY if test -d "$REPLY/autoconf/m4" ; then llvm_src_root="$REPLY" llvm_m4="$REPLY/autoconf/m4" - read -p "Enter full path to LLVM objects (empty for same as source):" + read -p "Enter full path to LLVM objects (empty for same as source):" REPLY if test -d "$REPLY" ; then llvm_obj_root="$REPLY" else From evan.cheng at apple.com Tue Mar 24 15:33:17 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 24 Mar 2009 20:33:17 -0000 Subject: [llvm-commits] [llvm] r67649 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200903242033.n2OKXHiC017364@zion.cs.uiuc.edu> Author: evancheng Date: Tue Mar 24 15:33:17 2009 New Revision: 67649 URL: http://llvm.org/viewvc/llvm-project?rev=67649&view=rev Log: Fix PR3845: Avoid stale MachineInstruction pointer reference. Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=67649&r1=67648&r2=67649&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Tue Mar 24 15:33:17 2009 @@ -513,8 +513,6 @@ int SPAdj = 0; // SP offset due to call frame setup / destroy. if (RS) RS->enterBasicBlock(BB); for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) { - MachineInstr *MI = I; - if (I->getOpcode() == TargetInstrInfo::DECLARE) { // Ignore it. ++I; @@ -545,8 +543,8 @@ continue; } + MachineInstr *MI = I; bool DoIncr = true; - for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) if (MI->getOperand(i).isFI()) { // Some instructions (e.g. inline asm instructions) can have From baldrick at free.fr Tue Mar 24 16:16:40 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 24 Mar 2009 21:16:40 -0000 Subject: [llvm-commits] [llvm] r67651 - /llvm/trunk/docs/GCCFEBuildInstrs.html Message-ID: <200903242116.n2OLGeT2019615@zion.cs.uiuc.edu> Author: baldrick Date: Tue Mar 24 16:16:39 2009 New Revision: 67651 URL: http://llvm.org/viewvc/llvm-project?rev=67651&view=rev Log: Mention explicitly that the Ada front-end will not bootstrap. The configure line had --disable-bootstrap, but it was not clear that this is essential. Modified: llvm/trunk/docs/GCCFEBuildInstrs.html Modified: llvm/trunk/docs/GCCFEBuildInstrs.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GCCFEBuildInstrs.html?rev=67651&r1=67650&r2=67651&view=diff ============================================================================== --- llvm/trunk/docs/GCCFEBuildInstrs.html (original) +++ llvm/trunk/docs/GCCFEBuildInstrs.html Tue Mar 24 16:16:39 2009 @@ -100,6 +100,11 @@ compiler with checking enabled. This causes it to run much slower, but helps catch mistakes in the compiler (please report any problems using LLVM bugzilla).

+
  • The Ada front-end fails to + bootstrap, due to lack of LLVM support for + setjmp/longjmp style exception handling (used + internally by the compiler), so you must specify + --disable-bootstrap.

  • Supposing appropriate compilers are available, llvm-gcc with Ada support can From baldrick at free.fr Tue Mar 24 16:19:02 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 24 Mar 2009 22:19:02 +0100 Subject: [llvm-commits] [llvm] r67638 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/ptr-int-cast.ll In-Reply-To: <200903241835.n2OIZeK5011881@zion.cs.uiuc.edu> References: <200903241835.n2OIZeK5011881@zion.cs.uiuc.edu> Message-ID: <200903242219.02394.baldrick@free.fr> Hi Chris, > +; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t you forgot to do something with %t! Ciao, Duncan. From baldrick at free.fr Tue Mar 24 16:23:30 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 24 Mar 2009 22:23:30 +0100 Subject: [llvm-commits] [llvm] r67635 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/shift.ll In-Reply-To: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> References: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> Message-ID: <200903242223.30812.baldrick@free.fr> Hi Chris, > - ICI.isEquality() && !Shift->isArithmeticShift() && > - isa(Shift->getOperand(0))) { > + ICI.isEquality() && !Shift->isArithmeticShift()/* && > + isa(Shift->getOperand(0))*/) { did you mean to comment this out? Ciao, Duncan. From fvbommel at wxs.nl Tue Mar 24 16:34:28 2009 From: fvbommel at wxs.nl (Frits van Bommel) Date: Tue, 24 Mar 2009 22:34:28 +0100 Subject: [llvm-commits] [llvm] r67638 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/ptr-int-cast.ll In-Reply-To: <200903242219.02394.baldrick@free.fr> References: <200903241835.n2OIZeK5011881@zion.cs.uiuc.edu> <200903242219.02394.baldrick@free.fr> Message-ID: <49C951E4.4090306@wxs.nl> Duncan Sands wrote: > Hi Chris, > >> +; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t > > you forgot to do something with %t! Look at it again; there are RUN lines in the functions that grep it. From brukman+llvm at gmail.com Tue Mar 24 16:36:09 2009 From: brukman+llvm at gmail.com (Misha Brukman) Date: Tue, 24 Mar 2009 21:36:09 -0000 Subject: [llvm-commits] [llvm] r67652 - in /llvm/trunk: test/Integer/a1.ll test/Integer/a1.ll.out unittests/ADT/APIntTest.cpp unittests/Makefile unittests/VMCore/ unittests/VMCore/ConstantsTest.cpp unittests/VMCore/Makefile Message-ID: <200903242136.n2OLa9kl020801@zion.cs.uiuc.edu> Author: brukman Date: Tue Mar 24 16:36:09 2009 New Revision: 67652 URL: http://llvm.org/viewvc/llvm-project?rev=67652&view=rev Log: Converted a1.ll to unittests. Added: llvm/trunk/unittests/VMCore/ llvm/trunk/unittests/VMCore/ConstantsTest.cpp llvm/trunk/unittests/VMCore/Makefile Removed: llvm/trunk/test/Integer/a1.ll llvm/trunk/test/Integer/a1.ll.out Modified: llvm/trunk/unittests/ADT/APIntTest.cpp llvm/trunk/unittests/Makefile Removed: llvm/trunk/test/Integer/a1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Integer/a1.ll?rev=67651&view=auto ============================================================================== --- llvm/trunk/test/Integer/a1.ll (original) +++ llvm/trunk/test/Integer/a1.ll (removed) @@ -1,25 +0,0 @@ -; RUN: llvm-as %s -o - | llvm-dis > %t.ll -; RUN: diff %t.ll %s.out - -; test 1 bit -; - at b = constant i1 add(i1 1 , i1 1) - at c = constant i1 add(i1 -1, i1 1) - at d = constant i1 add(i1 -1, i1 -1) - at e = constant i1 sub(i1 -1, i1 1) - at f = constant i1 sub(i1 1 , i1 -1) - at g = constant i1 sub(i1 1 , i1 1) - - at h = constant i1 shl(i1 1 , i1 1) ; undefined - at i = constant i1 shl(i1 1 , i1 0) - at j = constant i1 lshr(i1 1, i1 1) ; undefined - at m = constant i1 ashr(i1 1, i1 1) ; undefined - - at n = constant i1 mul(i1 -1, i1 1) - at o = constant i1 sdiv(i1 -1, i1 1) ; overflow - at p = constant i1 sdiv(i1 1 , i1 -1); overflow - at q = constant i1 udiv(i1 -1, i1 1) - at r = constant i1 udiv(i1 1, i1 -1) - at s = constant i1 srem(i1 -1, i1 1) ; overflow - at t = constant i1 urem(i1 -1, i1 1) - at u = constant i1 srem(i1 1, i1 -1) ; overflow Removed: llvm/trunk/test/Integer/a1.ll.out URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Integer/a1.ll.out?rev=67651&view=auto ============================================================================== --- llvm/trunk/test/Integer/a1.ll.out (original) +++ llvm/trunk/test/Integer/a1.ll.out (removed) @@ -1,19 +0,0 @@ -; ModuleID = '' - at b = constant i1 false ; [#uses=0] - at c = constant i1 false ; [#uses=0] - at d = constant i1 false ; [#uses=0] - at e = constant i1 false ; [#uses=0] - at f = constant i1 false ; [#uses=0] - at g = constant i1 false ; [#uses=0] - at h = constant i1 undef ; [#uses=0] - at i = constant i1 true ; [#uses=0] - at j = constant i1 undef ; [#uses=0] - at m = constant i1 undef ; [#uses=0] - at n = constant i1 true ; [#uses=0] - at o = constant i1 true ; [#uses=0] - at p = constant i1 true ; [#uses=0] - at q = constant i1 true ; [#uses=0] - at r = constant i1 true ; [#uses=0] - at s = constant i1 false ; [#uses=0] - at t = constant i1 false ; [#uses=0] - at u = constant i1 false ; [#uses=0] Modified: llvm/trunk/unittests/ADT/APIntTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APIntTest.cpp?rev=67652&r1=67651&r2=67652&view=diff ============================================================================== --- llvm/trunk/unittests/ADT/APIntTest.cpp (original) +++ llvm/trunk/unittests/ADT/APIntTest.cpp Tue Mar 24 16:36:09 2009 @@ -7,13 +7,29 @@ // //===----------------------------------------------------------------------===// +#include +#include "llvm/Support/raw_ostream.h" #include "gtest/gtest.h" #include "llvm/ADT/APInt.h" +#include "llvm/ADT/SmallString.h" using namespace llvm; namespace { +// Make the Google Test failure output equivalent to APInt::dump() +std::ostream& operator<<(std::ostream &OS, const llvm::APInt& I) { + llvm::raw_os_ostream raw_os(OS); + + SmallString<40> S, U; + I.toStringUnsigned(U); + I.toStringSigned(S); + raw_os << "APInt(" << I.getBitWidth()<< "b, " + << U.c_str() << "u " << S.c_str() << "s)"; + raw_os.flush(); + return OS; +} + // Test that APInt shift left works when bitwidth > 64 and shiftamt == 0 TEST(APIntTest, ShiftLeftByZero) { APInt One = APInt::getNullValue(65) + 1; @@ -22,7 +38,7 @@ EXPECT_EQ(false, Shl[1]); } -TEST(APIntTest, I128NegativeCount) { +TEST(APIntTest, i128_NegativeCount) { APInt Minus3(128, (uint64_t)-3, true); EXPECT_EQ(126u, Minus3.countLeadingOnes()); EXPECT_EQ(-3, Minus3.getSExtValue()); @@ -37,7 +53,7 @@ EXPECT_EQ(-1, Minus1.getSExtValue()); } -TEST(APIntTest, I33Count) { +TEST(APIntTest, i33_Count) { APInt i33minus2(33, -2, true); EXPECT_EQ(0u, i33minus2.countLeadingZeros()); EXPECT_EQ(32u, i33minus2.countLeadingOnes()); @@ -48,7 +64,7 @@ EXPECT_EQ(((uint64_t)-2)&((1ull<<33) -1), i33minus2.getZExtValue()); } -TEST(APIntTest, I65Count) { +TEST(APIntTest, i65_Count) { APInt i65minus(65, 0, true); i65minus.set(64); EXPECT_EQ(0u, i65minus.countLeadingZeros()); @@ -58,7 +74,7 @@ EXPECT_EQ(1u, i65minus.countPopulation()); } -TEST(APIntTest, I128PositiveCount) { +TEST(APIntTest, i128_PositiveCount) { APInt u128max = APInt::getAllOnesValue(128); EXPECT_EQ(128u, u128max.countLeadingOnes()); EXPECT_EQ(0u, u128max.countLeadingZeros()); @@ -97,4 +113,67 @@ EXPECT_EQ(1u, one.getZExtValue()); } +TEST(APIntTest, i1) { + const APInt neg_two(1, -2, true); + const APInt neg_one(1, -1, true); + const APInt zero(1, 0); + const APInt one(1, 1); + const APInt two(1, 2); + + EXPECT_EQ(0, neg_two.getSExtValue()); + EXPECT_EQ(-1, neg_one.getSExtValue()); + EXPECT_EQ(1u, neg_one.getZExtValue()); + EXPECT_EQ(0u, zero.getZExtValue()); + EXPECT_EQ(-1, one.getSExtValue()); + EXPECT_EQ(1u, one.getZExtValue()); + EXPECT_EQ(0u, two.getZExtValue()); + EXPECT_EQ(0, two.getSExtValue()); + + // Basic equalities for 1-bit values. + EXPECT_EQ(zero, two); + EXPECT_EQ(zero, neg_two); + EXPECT_EQ(one, neg_one); + EXPECT_EQ(two, neg_two); + + // Additions. + EXPECT_EQ(two, one + one); + EXPECT_EQ(zero, neg_one + one); + EXPECT_EQ(neg_two, neg_one + neg_one); + + // Subtractions. + EXPECT_EQ(neg_two, neg_one - one); + EXPECT_EQ(two, one - neg_one); + EXPECT_EQ(zero, one - one); + + // Shifts. + EXPECT_EQ(zero, one << one); + EXPECT_EQ(one, one << zero); + EXPECT_EQ(zero, one.shl(1)); + EXPECT_EQ(one, one.shl(0)); + EXPECT_EQ(zero, one.lshr(1)); + EXPECT_EQ(zero, one.ashr(1)); + + // Multiplies. + EXPECT_EQ(neg_one, neg_one * one); + EXPECT_EQ(neg_one, one * neg_one); + EXPECT_EQ(one, neg_one * neg_one); + EXPECT_EQ(one, one * one); + + // Divides. + EXPECT_EQ(neg_one, one.sdiv(neg_one)); + EXPECT_EQ(neg_one, neg_one.sdiv(one)); + EXPECT_EQ(one, neg_one.sdiv(neg_one)); + EXPECT_EQ(one, one.sdiv(one)); + + EXPECT_EQ(neg_one, one.udiv(neg_one)); + EXPECT_EQ(neg_one, neg_one.udiv(one)); + EXPECT_EQ(one, neg_one.udiv(neg_one)); + EXPECT_EQ(one, one.udiv(one)); + + // Remainders. + EXPECT_EQ(zero, neg_one.srem(one)); + EXPECT_EQ(zero, neg_one.urem(one)); + EXPECT_EQ(zero, one.srem(neg_one)); +} + } Modified: llvm/trunk/unittests/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Makefile?rev=67652&r1=67651&r2=67652&view=diff ============================================================================== --- llvm/trunk/unittests/Makefile (original) +++ llvm/trunk/unittests/Makefile Tue Mar 24 16:36:09 2009 @@ -16,7 +16,7 @@ CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/ CPP.Flags += -Wno-variadic-macros -PARALLEL_DIRS = ADT Support +PARALLEL_DIRS = ADT Support VMCore include $(LEVEL)/Makefile.common Added: llvm/trunk/unittests/VMCore/ConstantsTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/ConstantsTest.cpp?rev=67652&view=auto ============================================================================== --- llvm/trunk/unittests/VMCore/ConstantsTest.cpp (added) +++ llvm/trunk/unittests/VMCore/ConstantsTest.cpp Tue Mar 24 16:36:09 2009 @@ -0,0 +1,98 @@ +//===- llvm/unittest/VMCore/ConstantsTest.cpp - Constants unit tests ------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "gtest/gtest.h" + +namespace llvm { +namespace { + +TEST(ConstantsTest, Integer_i1) { + const IntegerType* Int1 = IntegerType::get(1); + Constant* One = ConstantInt::get(Int1, 1, true); + Constant* Zero = ConstantInt::get(Int1, 0); + Constant* NegOne = ConstantInt::get(Int1, -1, true); + Constant* Undef = UndefValue::get(Int1); + + // Input: @b = constant i1 add(i1 1 , i1 1) + // Output: @b = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getAdd(One, One)); + + // @c = constant i1 add(i1 -1, i1 1) + // @c = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, One)); + + // @d = constant i1 add(i1 -1, i1 -1) + // @d = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, NegOne)); + + // @e = constant i1 sub(i1 -1, i1 1) + // @e = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getSub(NegOne, One)); + + // @f = constant i1 sub(i1 1 , i1 -1) + // @f = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getSub(One, NegOne)); + + // @g = constant i1 sub(i1 1 , i1 1) + // @g = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getSub(One, One)); + + // @h = constant i1 shl(i1 1 , i1 1) ; undefined + // @h = constant i1 undef + EXPECT_EQ(Undef, ConstantExpr::getShl(One, One)); + + // @i = constant i1 shl(i1 1 , i1 0) + // @i = constant i1 true + EXPECT_EQ(One, ConstantExpr::getShl(One, Zero)); + + // @j = constant i1 lshr(i1 1, i1 1) ; undefined + // @j = constant i1 undef + EXPECT_EQ(Undef, ConstantExpr::getLShr(One, One)); + + // @m = constant i1 ashr(i1 1, i1 1) ; undefined + // @m = constant i1 undef + EXPECT_EQ(Undef, ConstantExpr::getAShr(One, One)); + + // @n = constant i1 mul(i1 -1, i1 1) + // @n = constant i1 true + EXPECT_EQ(One, ConstantExpr::getMul(NegOne, One)); + + // @o = constant i1 sdiv(i1 -1, i1 1) ; overflow + // @o = constant i1 true + EXPECT_EQ(One, ConstantExpr::getSDiv(NegOne, One)); + + // @p = constant i1 sdiv(i1 1 , i1 -1); overflow + // @p = constant i1 true + EXPECT_EQ(One, ConstantExpr::getSDiv(One, NegOne)); + + // @q = constant i1 udiv(i1 -1, i1 1) + // @q = constant i1 true + EXPECT_EQ(One, ConstantExpr::getUDiv(NegOne, One)); + + // @r = constant i1 udiv(i1 1, i1 -1) + // @r = constant i1 true + EXPECT_EQ(One, ConstantExpr::getUDiv(One, NegOne)); + + // @s = constant i1 srem(i1 -1, i1 1) ; overflow + // @s = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getSRem(NegOne, One)); + + // @t = constant i1 urem(i1 -1, i1 1) + // @t = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getURem(NegOne, One)); + + // @u = constant i1 srem(i1 1, i1 -1) ; overflow + // @u = constant i1 false + EXPECT_EQ(Zero, ConstantExpr::getSRem(One, NegOne)); +} + +} // end anonymous namespace +} // end namespace llvm Added: llvm/trunk/unittests/VMCore/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/Makefile?rev=67652&view=auto ============================================================================== --- llvm/trunk/unittests/VMCore/Makefile (added) +++ llvm/trunk/unittests/VMCore/Makefile Tue Mar 24 16:36:09 2009 @@ -0,0 +1,15 @@ +##===- unittests/VMCore/Makefile ---------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LEVEL = ../.. +TESTNAME = VMCore +LINK_COMPONENTS := core support + +include $(LEVEL)/Makefile.config +include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest From brukman at gmail.com Tue Mar 24 16:45:31 2009 From: brukman at gmail.com (Misha Brukman) Date: Tue, 24 Mar 2009 17:45:31 -0400 Subject: [llvm-commits] [llvm] r67635 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/shift.ll In-Reply-To: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> References: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> Message-ID: On Tue, Mar 24, 2009 at 2:15 PM, Chris Lattner wrote: > > ============================================================================== > --- llvm/trunk/test/Transforms/InstCombine/shift.ll (original) > +++ llvm/trunk/test/Transforms/InstCombine/shift.ll Tue Mar 24 13:15:30 > 2009 > @@ -206,4 +206,11 @@ > %D = shl i32 %C, 1 ; [#uses=1] > ret i32 %D > } > + > + > +define i1 @test27(i32 %x) nounwind { > + %y = lshr i32 %x, 3 > + %z = trunc i32 %y to i1 > + ret i1 %z > +} This would work great as a unittest. Just sayin'. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090324/433f27cd/attachment.html From sabre at nondot.org Tue Mar 24 18:42:50 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 16:42:50 -0700 Subject: [llvm-commits] [llvm] r67638 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/ptr-int-cast.ll In-Reply-To: <200903242219.02394.baldrick@free.fr> References: <200903241835.n2OIZeK5011881@zion.cs.uiuc.edu> <200903242219.02394.baldrick@free.fr> Message-ID: <42234B0D-EFB5-4442-AEB0-E1DCBE83611A@nondot.org> On Mar 24, 2009, at 2:19 PM, Duncan Sands wrote: > Hi Chris, > >> +; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t > > you forgot to do something with %t! I grep them later in the file? -Chris From gohman at apple.com Tue Mar 24 18:45:15 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 23:45:15 -0000 Subject: [llvm-commits] [llvm] r67654 - /llvm/trunk/projects/sample/autoconf/AutoRegen.sh Message-ID: <200903242345.n2ONjGt3027959@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 18:45:13 2009 New Revision: 67654 URL: http://llvm.org/viewvc/llvm-project?rev=67654&view=rev Log: Update for autoconf 2.6x; Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/autoconf/AutoRegen.sh?rev=67654&r1=67653&r2=67654&view=diff ============================================================================== --- llvm/trunk/projects/sample/autoconf/AutoRegen.sh (original) +++ llvm/trunk/projects/sample/autoconf/AutoRegen.sh Tue Mar 24 18:45:13 2009 @@ -5,9 +5,9 @@ } test -d autoconf && test -f autoconf/configure.ac && cd autoconf test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first" -autoconf --version | egrep '2\.5[0-9]' > /dev/null +autoconf --version | egrep '2\.[56][0-9]' > /dev/null if test $? -ne 0 ; then - die "Your autoconf was not detected as being 2.5x" + die "Your autoconf was not detected as being 2.5x or 2.6x" fi cwd=`pwd` if test -d ../../../autoconf/m4 ; then @@ -46,7 +46,7 @@ echo "Regenerating aclocal.m4 with aclocal" rm -f aclocal.m4 aclocal -I $llvm_m4 -I "$llvm_m4/.." || die "aclocal failed" -echo "Regenerating configure with autoconf 2.5x" +echo "Regenerating configure with autoconf" autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed" cd .. exit 0 From gohman at apple.com Tue Mar 24 18:46:25 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 23:46:25 -0000 Subject: [llvm-commits] [llvm] r67655 - in /llvm/trunk/projects/sample/autoconf: AutoRegen.sh configure.ac Message-ID: <200903242346.n2ONkP4S028040@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 18:46:25 2009 New Revision: 67655 URL: http://llvm.org/viewvc/llvm-project?rev=67655&view=rev Log: Fix paths; AutoRegen.sh changes its current working directory to be the autoconf directory, but these paths need to be relative to the main source directory. Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh llvm/trunk/projects/sample/autoconf/configure.ac Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/autoconf/AutoRegen.sh?rev=67655&r1=67654&r2=67655&view=diff ============================================================================== --- llvm/trunk/projects/sample/autoconf/AutoRegen.sh (original) +++ llvm/trunk/projects/sample/autoconf/AutoRegen.sh Tue Mar 24 18:46:25 2009 @@ -13,14 +13,14 @@ if test -d ../../../autoconf/m4 ; then cd ../../../autoconf/m4 llvm_m4=`pwd` - llvm_src_root=../../.. - llvm_obj_root=../../.. + llvm_src_root=../.. + llvm_obj_root=../.. cd $cwd elif test -d ../../llvm/autoconf/m4 ; then cd ../../llvm/autoconf/m4 llvm_m4=`pwd` - llvm_src_root=../.. - llvm_obj_root=../.. + llvm_src_root=.. + llvm_obj_root=.. cd $cwd else while true ; do Modified: llvm/trunk/projects/sample/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/autoconf/configure.ac?rev=67655&r1=67654&r2=67655&view=diff ============================================================================== --- llvm/trunk/projects/sample/autoconf/configure.ac (original) +++ llvm/trunk/projects/sample/autoconf/configure.ac Tue Mar 24 18:46:25 2009 @@ -4,8 +4,8 @@ AC_INIT([[[SAMPLE]]],[[[x.xx]]],[bugs at yourdomain]) dnl Identify where LLVM source tree is -LLVM_SRC_ROOT="../../" -LLVM_OBJ_ROOT="../../" +LLVM_SRC_ROOT="../.." +LLVM_OBJ_ROOT="../.." dnl Tell autoconf that the auxilliary files are actually located in dnl the LLVM autoconf directory, not here. AC_CONFIG_AUX_DIR($LLVM_SRC_ROOT/autoconf) From gohman at apple.com Tue Mar 24 18:47:12 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 24 Mar 2009 23:47:12 -0000 Subject: [llvm-commits] [llvm] r67656 - /llvm/trunk/projects/sample/configure Message-ID: <200903242347.n2ONlC14028100@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 18:47:11 2009 New Revision: 67656 URL: http://llvm.org/viewvc/llvm-project?rev=67656&view=rev Log: Regenerate configure. Modified: llvm/trunk/projects/sample/configure Modified: llvm/trunk/projects/sample/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/configure?rev=67656&r1=67655&r2=67656&view=diff ============================================================================== --- llvm/trunk/projects/sample/configure (original) +++ llvm/trunk/projects/sample/configure Tue Mar 24 18:47:11 2009 @@ -1,27 +1,56 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for [SAMPLE] [x.xx]. +# Generated by GNU Autoconf 2.61 for [SAMPLE] [x.xx]. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -31,8 +60,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -46,18 +110,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -65,157 +130,388 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. fi +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf at gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -224,7 +520,28 @@ as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,39 +550,27 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='[SAMPLE]' PACKAGE_TARNAME='--sample--' @@ -274,8 +579,52 @@ PACKAGE_BUGREPORT='bugs at yourdomain' ac_unique_file=""Makefile.common.in"" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +LLVM_SRC +LLVM_OBJ +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias' + # Initialize some variables set by options. ac_init_help= @@ -302,34 +651,48 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -351,33 +714,45 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -404,6 +779,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -428,13 +809,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -499,6 +883,16 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -551,24 +945,20 @@ -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -599,8 +989,7 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -620,27 +1009,19 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -667,54 +1048,76 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -743,9 +1146,6 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -763,15 +1163,22 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/--sample--] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -792,120 +1199,86 @@ Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF [SAMPLE] configure [x.xx] -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by [SAMPLE] $as_me [x.xx], which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -924,7 +1297,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -938,6 +1311,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -959,7 +1333,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -970,7 +1343,7 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -992,9 +1365,7 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1005,8 +1376,8 @@ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1019,20 +1390,34 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1043,22 +1428,28 @@ echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1070,26 +1461,24 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1120,14 +1509,17 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1143,8 +1535,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1156,12 +1548,11 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1186,8 +1577,7 @@ # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1204,12 +1594,6 @@ { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1234,77 +1618,90 @@ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +LLVM_SRC_ROOT="../.." +LLVM_OBJ_ROOT="../.." ac_aux_dir= -for ac_dir in ../../autoconf $srcdir/../../autoconf; do - if test -f $ac_dir/install-sh; then +for ac_dir in $LLVM_SRC_ROOT/autoconf "$srcdir"/$LLVM_SRC_ROOT/autoconf; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../autoconf $srcdir/../../autoconf" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in ../../autoconf $srcdir/../../autoconf" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Check whether --with-llvmsrc or --without-llvmsrc was given. + +# Check whether --with-llvmsrc was given. if test "${with_llvmsrc+set}" = set; then - withval="$with_llvmsrc" - llvm_src="$withval" + withval=$with_llvmsrc; llvm_src="$withval" else - llvm_src=`cd ${srcdir}/../..; pwd` -fi; + llvm_src="$LLVM_SRC_ROOT" +fi + LLVM_SRC=$llvm_src -# Check whether --with-llvmobj or --without-llvmobj was given. +# Check whether --with-llvmobj was given. if test "${with_llvmobj+set}" = set; then - withval="$with_llvmobj" - llvm_obj="$withval" + withval=$with_llvmobj; llvm_obj="$withval" else - llvm_obj=`cd ../..; pwd` -fi; + llvm_obj="$LLVM_OBJ_ROOT" +fi + LLVM_OBJ=$llvm_obj - ac_config_commands="$ac_config_commands setup" + ac_config_commands="$ac_config_commands setup" - ac_config_files="$ac_config_files Makefile.common" +ac_config_files="$ac_config_files Makefile.common" - ac_config_commands="$ac_config_commands Makefile" +ac_config_commands="$ac_config_commands Makefile" - ac_config_commands="$ac_config_commands lib/Makefile" +ac_config_commands="$ac_config_commands lib/Makefile" - ac_config_commands="$ac_config_commands lib/sample/Makefile" +ac_config_commands="$ac_config_commands lib/sample/Makefile" - ac_config_commands="$ac_config_commands tools/Makefile" +ac_config_commands="$ac_config_commands tools/Makefile" - ac_config_commands="$ac_config_commands tools/sample/Makefile" +ac_config_commands="$ac_config_commands tools/sample/Makefile" @@ -1335,39 +1732,58 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -1376,63 +1792,48 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -1463,17 +1864,45 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -1483,8 +1912,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -1498,18 +1962,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -1517,159 +1982,120 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits +# CDPATH. +$as_unset CDPATH -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -1678,7 +2104,28 @@ as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -1687,31 +2134,14 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by [SAMPLE] $as_me [x.xx], which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -1719,30 +2149,19 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_commands="$ac_config_commands" -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -1750,7 +2169,7 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -1764,18 +2183,20 @@ $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ [SAMPLE] config.status [x.xx] -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -1786,60 +2207,42 @@ do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -1855,41 +2258,53 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - llvm_src="${LLVM_SRC}" _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; - "setup" ) CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; - "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - "lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; - "lib/sample/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/sample/Makefile" ;; - "tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; - "tools/sample/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/sample/Makefile" ;; + case $ac_config_target in + "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; + "Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; + "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; + "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; + "lib/sample/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/sample/Makefile" ;; + "tools/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; + "tools/sample/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/sample/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -1900,440 +2315,407 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s, at SHELL@,$SHELL,;t t -s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t -s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t -s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s, at exec_prefix@,$exec_prefix,;t t -s, at prefix@,$prefix,;t t -s, at program_transform_name@,$program_transform_name,;t t -s, at bindir@,$bindir,;t t -s, at sbindir@,$sbindir,;t t -s, at libexecdir@,$libexecdir,;t t -s, at datadir@,$datadir,;t t -s, at sysconfdir@,$sysconfdir,;t t -s, at sharedstatedir@,$sharedstatedir,;t t -s, at localstatedir@,$localstatedir,;t t -s, at libdir@,$libdir,;t t -s, at includedir@,$includedir,;t t -s, at oldincludedir@,$oldincludedir,;t t -s, at infodir@,$infodir,;t t -s, at mandir@,$mandir,;t t -s, at build_alias@,$build_alias,;t t -s, at host_alias@,$host_alias,;t t -s, at target_alias@,$target_alias,;t t -s, at DEFS@,$DEFS,;t t -s, at ECHO_C@,$ECHO_C,;t t -s, at ECHO_N@,$ECHO_N,;t t -s, at ECHO_T@,$ECHO_T,;t t -s, at LIBS@,$LIBS,;t t -s, at LLVM_SRC@,$LLVM_SRC,;t t -s, at LLVM_OBJ@,$LLVM_OBJ,;t t -s, at LIBOBJS@,$LIBOBJS,;t t -s, at LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +LLVM_SRC!$LLVM_SRC$ac_delim +LLVM_OBJ!$LLVM_OBJ$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 41; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + case $ac_mode in + :F) + # + # CONFIG_FILE + # - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." +_ACEOF - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s, at configure_input@,$configure_input,;t t -s, at srcdir@,$ac_srcdir,;t t -s, at abs_srcdir@,$ac_abs_srcdir,;t t -s, at top_srcdir@,$ac_top_srcdir,;t t -s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s, at builddir@,$ac_builddir,;t t -s, at abs_builddir@,$ac_abs_builddir,;t t -s, at top_builddir@,$ac_top_builddir,;t t -s, at abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` + case $ac_file$ac_mode in + "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;; - lib/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` + "lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;; - lib/sample/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/sample/Makefile` + "lib/sample/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/sample/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/sample/Makefile lib/sample/Makefile ;; - tools/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile` + "tools/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;; - tools/sample/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/sample/Makefile` + "tools/sample/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/sample/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/sample/Makefile tools/sample/Makefile ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF From sabre at nondot.org Tue Mar 24 18:48:25 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 23:48:25 -0000 Subject: [llvm-commits] [llvm] r67657 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200903242348.n2ONmPQh028180@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 18:48:25 2009 New Revision: 67657 URL: http://llvm.org/viewvc/llvm-project?rev=67657&view=rev Log: oops, I intended to remove this, not comment it out. Thanks Duncan! Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=67657&r1=67656&r2=67657&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Mar 24 18:48:25 2009 @@ -6582,8 +6582,7 @@ // preferable because it allows the C<hasOneUse() && RHSV == 0 && - ICI.isEquality() && !Shift->isArithmeticShift()/* && - isa(Shift->getOperand(0))*/) { + ICI.isEquality() && !Shift->isArithmeticShift()) { // Compute C << Y. Value *NS; if (Shift->getOpcode() == Instruction::LShr) { From gohman at apple.com Tue Mar 24 19:09:15 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 25 Mar 2009 00:09:15 -0000 Subject: [llvm-commits] [llvm] r67658 - /llvm/trunk/projects/sample/Makefile.common.in Message-ID: <200903250009.n2P09GqR029471@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 19:09:05 2009 New Revision: 67658 URL: http://llvm.org/viewvc/llvm-project?rev=67658&view=rev Log: LLVM's master Makefile.common is in LLVM_SRC_ROOT, not LLVM_OBJ_ROOT. Modified: llvm/trunk/projects/sample/Makefile.common.in Modified: llvm/trunk/projects/sample/Makefile.common.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/Makefile.common.in?rev=67658&r1=67657&r2=67658&view=diff ============================================================================== --- llvm/trunk/projects/sample/Makefile.common.in (original) +++ llvm/trunk/projects/sample/Makefile.common.in Tue Mar 24 19:09:05 2009 @@ -19,4 +19,4 @@ PROJ_INSTALL_ROOT := @prefix@ # Include LLVM's Master Makefile. -include $(LLVM_OBJ_ROOT)/Makefile.common +include $(LLVM_SRC_ROOT)/Makefile.common From resistor at mac.com Tue Mar 24 19:18:29 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 24 Mar 2009 19:18:29 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2009-03-CGO-ESoftCheck.html 2009-03-CGO-ESoftCheck.pdf pubs.js Message-ID: <200903250018.n2P0ITqW030118@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2009-03-CGO-ESoftCheck.html added (r1.1) 2009-03-CGO-ESoftCheck.pdf added (r1.1) pubs.js updated: 1.8 -> 1.9 --- Log message: Add ESoftCheck from CGO'09. --- Diffs of the changes: (+72 -0) 2009-03-CGO-ESoftCheck.html | 66 ++++++++++++++++++++++++++++++++++++++++++++ 2009-03-CGO-ESoftCheck.pdf | 0 pubs.js | 6 ++++ 3 files changed, 72 insertions(+) Index: llvm-www/pubs/2009-03-CGO-ESoftCheck.html diff -c /dev/null llvm-www/pubs/2009-03-CGO-ESoftCheck.html:1.1 *** /dev/null Tue Mar 24 19:16:34 2009 --- llvm-www/pubs/2009-03-CGO-ESoftCheck.html Tue Mar 24 19:16:23 2009 *************** *** 0 **** --- 1,66 ---- + + + + + + ESoftCheck: Removal of Non-vital Checks for Fault Tolerance + + + +

    + ESoftCheck: Removal of Non-vital Checks for Fault Tolerance +
    +
    + Jing Yu, + Maria Jesus Garzaran, + Marc Snir + Vikram Adve +
    + +

    Abstract:

    +
    + As semiconductor technology scales into the deep + submicron regime the occurrence of transient or soft errors will + increase. This will require new approaches to error detection. + Software checking approaches are attractive because they require + little hardware modi???cation and can be easily adjusted to ???t different reliability and performance requirements. Unfortunately, + software checking adds a signi???cant performance overhead. + + In this paper we present ESoftCheck, a set of compiler + optimization techniques to determine which are the vital checks, + that is, the minimum number of checks that are necessary to + detect an error and roll back to a correct program state. ESoftCheck identi???es the vital checks on platforms where registers + are hardware-protected with parity or ECC, when there are + redundant checks and when checks appear in loops. ESoftCheck + also provides knobs to trade reliability for performance based + on the support for recovery and the degree of trustiness of the + operations. Our experimental results on a Pentium 4 show that + ESoftCheck can obtain 27.1% performance improvement without + losing fault coverage. + +
    + +

    To Appear:

    +
    + "ESoftCheck: Removal of Non-vital Checks for Fault Tolerance"
    + Jing Yu, Maria Jesus Garzaran, and Marc Snir
    + Proceedings of the Seventh International Symposium on + Code Generation and Optimization (CGO '09), + Seattle WA, March, 2009. +
    + +

    Download:

    +

    Paper:

    + + + +
    + Valid CSS! + Valid HTML 4.01! + + + Index: llvm-www/pubs/2009-03-CGO-ESoftCheck.pdf Index: llvm-www/pubs/pubs.js diff -u llvm-www/pubs/pubs.js:1.8 llvm-www/pubs/pubs.js:1.9 --- llvm-www/pubs/pubs.js:1.8 Wed Feb 25 22:30:33 2009 +++ llvm-www/pubs/pubs.js Tue Mar 24 19:16:23 2009 @@ -1,6 +1,12 @@ // The array should be sorted reverse-chronologically, and will be displayed on // the page in the order listed. var PUBS = [ + {url: '2009-03-CGO-ESoftCheck.html', + title: 'ESoftCheck: Removal of Non-vital Checks for Fault Tolerance', + author: 'Jing Yu, Maria Jesus Garzaran, Marc Snir', + published: "Proceedings of the Sevent International Symposium on Code Generation and Optimization (CGO '09)", + month: 3, + year: 2009 }, {url: '2009-03-ASPLOS-Recovery.html', title: 'Recovery Domains: An Organizing Principle for Recoverable Operating Systems', author: 'Andrew Lenharth, Samuel T. King, Vikram Adve', From resistor at mac.com Tue Mar 24 19:22:27 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 24 Mar 2009 19:22:27 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/pubs.js Message-ID: <200903250022.n2P0MQfX030794@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: pubs.js updated: 1.9 -> 1.10 --- Log message: Typo. --- Diffs of the changes: (+1 -1) pubs.js | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/pubs/pubs.js diff -u llvm-www/pubs/pubs.js:1.9 llvm-www/pubs/pubs.js:1.10 --- llvm-www/pubs/pubs.js:1.9 Tue Mar 24 19:16:23 2009 +++ llvm-www/pubs/pubs.js Tue Mar 24 19:22:00 2009 @@ -4,7 +4,7 @@ {url: '2009-03-CGO-ESoftCheck.html', title: 'ESoftCheck: Removal of Non-vital Checks for Fault Tolerance', author: 'Jing Yu, Maria Jesus Garzaran, Marc Snir', - published: "Proceedings of the Sevent International Symposium on Code Generation and Optimization (CGO '09)", + published: "Proceedings of the Seventh International Symposium on Code Generation and Optimization (CGO '09)", month: 3, year: 2009 }, {url: '2009-03-ASPLOS-Recovery.html', From dpatel at apple.com Tue Mar 24 19:28:40 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 25 Mar 2009 00:28:40 -0000 Subject: [llvm-commits] [llvm] r67661 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200903250028.n2P0SeQ1031190@zion.cs.uiuc.edu> Author: dpatel Date: Tue Mar 24 19:28:40 2009 New Revision: 67661 URL: http://llvm.org/viewvc/llvm-project?rev=67661&view=rev Log: Do not ignore DW_TAG_class_type! Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=67661&r1=67660&r2=67661&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Mar 24 19:28:40 2009 @@ -1713,6 +1713,7 @@ break; case DW_TAG_structure_type: case DW_TAG_union_type: + case DW_TAG_class_type: { // Add elements to structure type. DIArray Elements = CTy.getTypeArray(); From sabre at nondot.org Tue Mar 24 19:28:58 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 25 Mar 2009 00:28:58 -0000 Subject: [llvm-commits] [llvm] r67662 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2009-03-24-InfLoop.ll Message-ID: <200903250028.n2P0SxeB031222@zion.cs.uiuc.edu> Author: lattner Date: Tue Mar 24 19:28:58 2009 New Revision: 67662 URL: http://llvm.org/viewvc/llvm-project?rev=67662&view=rev Log: Fix PR3874 by restoring a condition I removed, but making it more precise than it used to be. Added: llvm/trunk/test/Transforms/InstCombine/2009-03-24-InfLoop.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=67662&r1=67661&r2=67662&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Mar 24 19:28:58 2009 @@ -6582,7 +6582,8 @@ // preferable because it allows the C<hasOneUse() && RHSV == 0 && - ICI.isEquality() && !Shift->isArithmeticShift()) { + ICI.isEquality() && !Shift->isArithmeticShift() && + !isa(Shift->getOperand(0))) { // Compute C << Y. Value *NS; if (Shift->getOpcode() == Instruction::LShr) { Added: llvm/trunk/test/Transforms/InstCombine/2009-03-24-InfLoop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2009-03-24-InfLoop.ll?rev=67662&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2009-03-24-InfLoop.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2009-03-24-InfLoop.ll Tue Mar 24 19:28:58 2009 @@ -0,0 +1,9 @@ +; PR3874 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis + define i1 @test(i32 %x) { + %A = lshr i32 3968, %x + %B = and i32 %A, 1 + %C = icmp eq i32 %B, 0 + ret i1 %C + } + From gohman at apple.com Tue Mar 24 19:52:11 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 25 Mar 2009 00:52:11 -0000 Subject: [llvm-commits] [llvm] r67666 - in /llvm/trunk/projects/sample: autoconf/AutoRegen.sh autoconf/configure.ac configure Message-ID: <200903250052.n2P0qBXS000358@zion.cs.uiuc.edu> Author: djg Date: Tue Mar 24 19:52:11 2009 New Revision: 67666 URL: http://llvm.org/viewvc/llvm-project?rev=67666&view=rev Log: Revert r67655 and r67656, as they are breaking the build. I'm not going to persue this further at this time. Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh llvm/trunk/projects/sample/autoconf/configure.ac llvm/trunk/projects/sample/configure Modified: llvm/trunk/projects/sample/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/autoconf/AutoRegen.sh?rev=67666&r1=67665&r2=67666&view=diff ============================================================================== --- llvm/trunk/projects/sample/autoconf/AutoRegen.sh (original) +++ llvm/trunk/projects/sample/autoconf/AutoRegen.sh Tue Mar 24 19:52:11 2009 @@ -13,14 +13,14 @@ if test -d ../../../autoconf/m4 ; then cd ../../../autoconf/m4 llvm_m4=`pwd` - llvm_src_root=../.. - llvm_obj_root=../.. + llvm_src_root=../../.. + llvm_obj_root=../../.. cd $cwd elif test -d ../../llvm/autoconf/m4 ; then cd ../../llvm/autoconf/m4 llvm_m4=`pwd` - llvm_src_root=.. - llvm_obj_root=.. + llvm_src_root=../.. + llvm_obj_root=../.. cd $cwd else while true ; do Modified: llvm/trunk/projects/sample/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/autoconf/configure.ac?rev=67666&r1=67665&r2=67666&view=diff ============================================================================== --- llvm/trunk/projects/sample/autoconf/configure.ac (original) +++ llvm/trunk/projects/sample/autoconf/configure.ac Tue Mar 24 19:52:11 2009 @@ -4,8 +4,8 @@ AC_INIT([[[SAMPLE]]],[[[x.xx]]],[bugs at yourdomain]) dnl Identify where LLVM source tree is -LLVM_SRC_ROOT="../.." -LLVM_OBJ_ROOT="../.." +LLVM_SRC_ROOT="../../" +LLVM_OBJ_ROOT="../../" dnl Tell autoconf that the auxilliary files are actually located in dnl the LLVM autoconf directory, not here. AC_CONFIG_AUX_DIR($LLVM_SRC_ROOT/autoconf) Modified: llvm/trunk/projects/sample/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/configure?rev=67666&r1=67665&r2=67666&view=diff ============================================================================== --- llvm/trunk/projects/sample/configure (original) +++ llvm/trunk/projects/sample/configure Tue Mar 24 19:52:11 2009 @@ -1,56 +1,27 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for [SAMPLE] [x.xx]. +# Generated by GNU Autoconf 2.59 for [SAMPLE] [x.xx]. # # Report bugs to . # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -60,43 +31,8 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - # Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' @@ -110,19 +46,18 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -130,388 +65,157 @@ # Name of the executable. -as_me=`$as_basename -- "$0" || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi -test \$exitcode = 0) || { (exit 1); exit 1; } + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + for as_base in sh bash ksh sh5; do + case $as_dir in /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - + if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || + chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -520,28 +224,7 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -550,27 +233,39 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH -exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +exec 6>&1 + # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + # Identity of this package. PACKAGE_NAME='[SAMPLE]' PACKAGE_TARNAME='--sample--' @@ -579,52 +274,8 @@ PACKAGE_BUGREPORT='bugs at yourdomain' ac_unique_file=""Makefile.common.in"" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -LLVM_SRC -LLVM_OBJ -LIBOBJS -LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ LIBOBJS LTLIBOBJS' ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias' - # Initialize some variables set by options. ac_init_help= @@ -651,48 +302,34 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -714,45 +351,33 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -779,12 +404,6 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -809,16 +428,13 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -883,16 +499,6 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -945,20 +551,24 @@ -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -989,7 +599,8 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) @@ -1009,19 +620,27 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - eval ac_val=\$$ac_var + eval ac_val=$`echo $ac_var` case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -1048,76 +667,54 @@ test "$silent" = yes && exec 6>/dev/null -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } + fi fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias # # Report the --help message. @@ -1146,6 +743,9 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -1163,22 +763,15 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/--sample--] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF @@ -1199,86 +792,120 @@ Report bugs to . _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) +if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi -test -n "$ac_init_help" && exit $ac_status +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF [SAMPLE] configure [x.xx] -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.59 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi -cat >config.log <<_ACEOF +exec 5>config.log +cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by [SAMPLE] $as_me [x.xx], which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF -exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1297,7 +924,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1311,7 +938,6 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done -IFS=$as_save_IFS } >&5 @@ -1333,6 +959,7 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1343,7 +970,7 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1365,7 +992,9 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done @@ -1376,8 +1005,8 @@ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1390,34 +1019,20 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) + esac; +} echo cat <<\_ASBOX @@ -1428,28 +1043,22 @@ echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## +## ------------- ## +## Output files. ## +## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1461,24 +1070,26 @@ ## ----------- ## _ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. @@ -1509,17 +1120,14 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi -shift -for ac_site_file -do +for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1535,8 +1143,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else @@ -1548,11 +1156,12 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1577,7 +1186,8 @@ # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1594,6 +1204,12 @@ { (exit 1); exit 1; }; } fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + @@ -1618,90 +1234,77 @@ -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -LLVM_SRC_ROOT="../.." -LLVM_OBJ_ROOT="../.." ac_aux_dir= -for ac_dir in $LLVM_SRC_ROOT/autoconf "$srcdir"/$LLVM_SRC_ROOT/autoconf; do - if test -f "$ac_dir/install-sh"; then +for ac_dir in ../../autoconf $srcdir/../../autoconf; do + if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f "$ac_dir/install.sh"; then + elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f "$ac_dir/shtool"; then + elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../autoconf $srcdir/../../autoconf" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in ../../autoconf $srcdir/../../autoconf" >&2;} { (exit 1); exit 1; }; } fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Check whether --with-llvmsrc was given. +# Check whether --with-llvmsrc or --without-llvmsrc was given. if test "${with_llvmsrc+set}" = set; then - withval=$with_llvmsrc; llvm_src="$withval" + withval="$with_llvmsrc" + llvm_src="$withval" else - llvm_src="$LLVM_SRC_ROOT" -fi - + llvm_src=`cd ${srcdir}/../..; pwd` +fi; LLVM_SRC=$llvm_src -# Check whether --with-llvmobj was given. +# Check whether --with-llvmobj or --without-llvmobj was given. if test "${with_llvmobj+set}" = set; then - withval=$with_llvmobj; llvm_obj="$withval" + withval="$with_llvmobj" + llvm_obj="$withval" else - llvm_obj="$LLVM_OBJ_ROOT" -fi - + llvm_obj=`cd ../..; pwd` +fi; LLVM_OBJ=$llvm_obj - ac_config_commands="$ac_config_commands setup" + ac_config_commands="$ac_config_commands setup" -ac_config_files="$ac_config_files Makefile.common" + ac_config_files="$ac_config_files Makefile.common" -ac_config_commands="$ac_config_commands Makefile" + ac_config_commands="$ac_config_commands Makefile" -ac_config_commands="$ac_config_commands lib/Makefile" + ac_config_commands="$ac_config_commands lib/Makefile" -ac_config_commands="$ac_config_commands lib/sample/Makefile" + ac_config_commands="$ac_config_commands lib/sample/Makefile" -ac_config_commands="$ac_config_commands tools/Makefile" + ac_config_commands="$ac_config_commands tools/Makefile" -ac_config_commands="$ac_config_commands tools/sample/Makefile" + ac_config_commands="$ac_config_commands tools/sample/Makefile" @@ -1732,58 +1335,39 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache @@ -1792,48 +1376,63 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, +# take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -ac_script=' +cat >confdef2opt.sed <<\_ACEOF t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -1864,45 +1463,17 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -1912,43 +1483,8 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - # Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' @@ -1962,19 +1498,18 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -1982,120 +1517,159 @@ # Name of the executable. -as_me=`$as_basename -- "$0" || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` -# CDPATH. -$as_unset CDPATH +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi as_lineno_1=$LINENO as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -2104,28 +1678,7 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -2134,14 +1687,31 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -# Save the log message, to keep $[0] and so on meaningful, and to +# Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + This file was extended by [SAMPLE] $as_me [x.xx], which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -2149,19 +1719,30 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -config_files="$ac_config_files" -config_commands="$ac_config_commands" +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi -_ACEOF +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi cat >>$CONFIG_STATUS <<\_ACEOF + ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -2169,7 +1750,7 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit + -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -2183,20 +1764,18 @@ $config_commands Report bugs to ." - _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ [SAMPLE] config.status [x.xx] -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' +srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -2207,42 +1786,60 @@ do case $1 in --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift @@ -2258,53 +1855,41 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 -_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS +# INIT-COMMANDS section. # + llvm_src="${LLVM_SRC}" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# Handling of arguments. + +cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do - case $ac_config_target in - "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; - "Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; - "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; - "lib/sample/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/sample/Makefile" ;; - "tools/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; - "tools/sample/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/sample/Makefile" ;; - + case "$ac_config_target" in + # Handling of arguments. + "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; + "setup" ) CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; + "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; + "lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; + "lib/sample/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/sample/Makefile" ;; + "tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; + "tools/sample/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/sample/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -2315,351 +1900,284 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + # -# Set up the sed scripts for CONFIG_FILES section. +# CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s, at SHELL@,$SHELL,;t t +s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t +s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t +s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s, at exec_prefix@,$exec_prefix,;t t +s, at prefix@,$prefix,;t t +s, at program_transform_name@,$program_transform_name,;t t +s, at bindir@,$bindir,;t t +s, at sbindir@,$sbindir,;t t +s, at libexecdir@,$libexecdir,;t t +s, at datadir@,$datadir,;t t +s, at sysconfdir@,$sysconfdir,;t t +s, at sharedstatedir@,$sharedstatedir,;t t +s, at localstatedir@,$localstatedir,;t t +s, at libdir@,$libdir,;t t +s, at includedir@,$includedir,;t t +s, at oldincludedir@,$oldincludedir,;t t +s, at infodir@,$infodir,;t t +s, at mandir@,$mandir,;t t +s, at build_alias@,$build_alias,;t t +s, at host_alias@,$host_alias,;t t +s, at target_alias@,$target_alias,;t t +s, at DEFS@,$DEFS,;t t +s, at ECHO_C@,$ECHO_C,;t t +s, at ECHO_N@,$ECHO_N,;t t +s, at ECHO_T@,$ECHO_T,;t t +s, at LIBS@,$LIBS,;t t +s, at LLVM_SRC@,$LLVM_SRC,;t t +s, at LLVM_OBJ@,$LLVM_OBJ,;t t +s, at LIBOBJS@,$LIBOBJS,;t t +s, at LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -LLVM_SRC!$LLVM_SRC$ac_delim -LLVM_OBJ!$LLVM_OBJ$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 41; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi +fi # test -n "$CONFIG_FILES" -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - ac_dir=`$as_dirname -- "$ac_file" || + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) +if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - case $ac_mode in - :F) - # - # CONFIG_FILE - # -_ACEOF + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } _ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -2667,55 +2185,155 @@ cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +s, at configure_input@,$configure_input,;t t +s, at srcdir@,$ac_srcdir,;t t +s, at abs_srcdir@,$ac_abs_srcdir,;t t +s, at top_srcdir@,$ac_top_srcdir,;t t +s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s, at builddir@,$ac_builddir,;t t +s, at abs_builddir@,$ac_abs_builddir,;t t +s, at top_builddir@,$ac_top_builddir,;t t +s, at abs_top_builddir@,$ac_abs_top_builddir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac + ac_builddir=. +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi - case $ac_file$ac_mode in - "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;; - "lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` + lib/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;; - "lib/sample/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/sample/Makefile` + lib/sample/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/sample/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/sample/Makefile lib/sample/Makefile ;; - "tools/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile` + tools/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;; - "tools/sample/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/sample/Makefile` + tools/sample/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/sample/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/tools/sample/Makefile tools/sample/Makefile ;; - esac -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF From evan.cheng at apple.com Tue Mar 24 20:08:43 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 01:08:43 -0000 Subject: [llvm-commits] [llvm] r67667 - in /llvm/trunk/lib/Target/X86/AsmPrinter: X86ATTAsmPrinter.cpp X86IntelAsmPrinter.cpp Message-ID: <200903250108.n2P18h6Y001373@zion.cs.uiuc.edu> Author: evancheng Date: Tue Mar 24 20:08:42 2009 New Revision: 67667 URL: http://llvm.org/viewvc/llvm-project?rev=67667&view=rev Log: Don't print global names twice with -asm-verbose. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=67667&r1=67666&r2=67667&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Tue Mar 24 20:08:42 2009 @@ -831,7 +831,7 @@ EmitAlignment(Align, GVar); O << name << ":"; if (VerboseAsm) { - O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + O << "\t\t\t\t" << TAI->getCommentString() << ' '; PrintUnmangledNameSafely(GVar, O); } O << '\n'; @@ -894,7 +894,7 @@ EmitAlignment(Align, GVar); O << name << ":"; if (VerboseAsm){ - O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + O << "\t\t\t\t" << TAI->getCommentString() << ' '; PrintUnmangledNameSafely(GVar, O); } O << '\n'; Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=67667&r1=67666&r2=67667&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Tue Mar 24 20:08:42 2009 @@ -491,7 +491,7 @@ O << name << ":"; if (VerboseAsm) - O << name << "\t\t\t\t" << TAI->getCommentString() + O << "\t\t\t\t" << TAI->getCommentString() << " " << I->getName(); O << '\n'; From evan.cheng at apple.com Tue Mar 24 20:47:28 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 01:47:28 -0000 Subject: [llvm-commits] [llvm] r67668 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CellSPU/ lib/Target/CellSPU/AsmPrinter/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/Sparc/AsmPrinter/ lib/Target/X86/ lib/Target/X86/AsmPrinter/ lib/Target/XCore/ test/CodeGen/X86/ Message-ID: <200903250147.n2P1lUov003682@zion.cs.uiuc.edu> Author: evancheng Date: Tue Mar 24 20:47:28 2009 New Revision: 67668 URL: http://llvm.org/viewvc/llvm-project?rev=67668&view=rev Log: CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/include/llvm/Target/TargetMachine.h llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/Target/ARM/ARM.h llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp llvm/trunk/lib/Target/ARM/ARMTargetMachine.h llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp llvm/trunk/lib/Target/Alpha/Alpha.h llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp llvm/trunk/lib/Target/CellSPU/SPU.h llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h llvm/trunk/lib/Target/IA64/IA64.h llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp llvm/trunk/lib/Target/IA64/IA64TargetMachine.h llvm/trunk/lib/Target/Mips/Mips.h llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp llvm/trunk/lib/Target/Mips/MipsTargetMachine.h llvm/trunk/lib/Target/PIC16/PIC16.h llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/trunk/lib/Target/PowerPC/PPC.h llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp llvm/trunk/lib/Target/Sparc/Sparc.h llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h llvm/trunk/lib/Target/TargetMachine.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h llvm/trunk/lib/Target/X86/X86.h llvm/trunk/lib/Target/X86/X86TargetMachine.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.h llvm/trunk/lib/Target/XCore/XCore.h llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll llvm/trunk/test/CodeGen/X86/aliases.ll llvm/trunk/test/CodeGen/X86/pic_jumptable.ll Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Mar 24 20:47:28 2009 @@ -104,14 +104,22 @@ /// IsInTextSection - True if the current section we are emitting to is a /// text section. bool IsInTextSection; - + + /// VerboseAsm - Emit comments in assembly output if this is true. + /// + bool VerboseAsm; + protected: AsmPrinter(raw_ostream &o, TargetMachine &TM, - const TargetAsmInfo *T, bool F); + const TargetAsmInfo *T, bool F, bool V); public: virtual ~AsmPrinter(); - + + /// isVerbose - Return true if assembly output should contain comments. + /// + bool isVerbose() const { return VerboseAsm; } + /// SwitchToTextSection - Switch to the specified section of the executable /// if we are not already in it! If GV is non-null and if the global has an /// explicitly requested section, we switch to the section indicated for the Modified: llvm/trunk/include/llvm/Target/TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetMachine.h (original) +++ llvm/trunk/include/llvm/Target/TargetMachine.h Tue Mar 24 20:47:28 2009 @@ -174,6 +174,7 @@ static Reloc::Model getRelocationModel(); /// setRelocationModel - Sets the code generation relocation model. + /// static void setRelocationModel(Reloc::Model Model); /// getCodeModel - Returns the code model. The choices are small, kernel, @@ -181,8 +182,17 @@ static CodeModel::Model getCodeModel(); /// setCodeModel - Sets the code model. + /// static void setCodeModel(CodeModel::Model Model); + /// getAsmVerbosityDefault - Returns the default value of asm verbosity. + /// + static bool getAsmVerbosityDefault(); + + /// setAsmVerbosityDefault - Set the default value of asm verbosity. Default + /// is false. + static void setAsmVerbosityDefault(bool); + /// CodeGenFileType - These enums are meant to be passed into /// addPassesToEmitFile to indicate what type of file to emit. enum CodeGenFileType { @@ -319,8 +329,8 @@ /// addAssemblyEmitter - This pass should be overridden by the target to add /// the asmprinter, if asm emission is supported. If this is not supported, /// 'true' should be returned. - virtual bool addAssemblyEmitter(PassManagerBase &, bool /*Fast*/, - raw_ostream &) { + virtual bool addAssemblyEmitter(PassManagerBase &, bool /*Fast*/, + bool /* VerboseAsmDefault */, raw_ostream &) { return true; } Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Tue Mar 24 20:47:28 2009 @@ -104,10 +104,6 @@ /// realigned, if needed. extern bool RealignStack; - /// VerboseAsm - When this flag is set, the asm printer prints additional - /// comments to asm directives. - extern bool VerboseAsm; - /// DisableJumpTables - This flag indicates jump tables should not be /// generated. extern bool DisableJumpTables; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetAsmInfo.h" @@ -35,13 +36,23 @@ #include using namespace llvm; +static cl::opt +AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), + cl::init(cl::BOU_UNSET)); + char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *T, bool F) + const TargetAsmInfo *T, bool F, bool VDef) : MachineFunctionPass(&ID), FunctionNumber(0), Fast(F), O(o), TM(tm), TAI(T), TRI(tm.getRegisterInfo()), IsInTextSection(false) -{} +{ + switch (AsmVerbose) { + case cl::BOU_UNSET: VerboseAsm = VDef; break; + case cl::BOU_TRUE: VerboseAsm = true; break; + case cl::BOU_FALSE: VerboseAsm = false; break; + } +} AsmPrinter::~AsmPrinter() { for (gcp_iterator I = GCMetadataPrinters.begin(), Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Mar 24 20:47:28 2009 @@ -1072,7 +1072,7 @@ Asm->EOL("Offset"); } else if (Reg < 64) { Asm->EmitInt8(DW_CFA_offset + Reg); - if (VerboseAsm) + if (Asm->isVerbose()) Asm->EOL("DW_CFA_offset + Reg (" + utostr(Reg) + ")"); else Asm->EOL(); @@ -2197,7 +2197,7 @@ // Emit the code (index) for the abbreviation. Asm->EmitULEB128Bytes(AbbrevNumber); - if (VerboseAsm) + if (Asm->isVerbose()) Asm->EOL(std::string("Abbrev [" + utostr(AbbrevNumber) + "] 0x" + utohexstr(Die->getOffset()) + @@ -2487,7 +2487,7 @@ // Isolate current sections line info. const std::vector &LineInfos = SectionSourceLines[j]; - if (VerboseAsm) { + if (Asm->isVerbose()) { const Section* S = SectionMap[j + 1]; O << '\t' << TAI->getCommentString() << " Section" << S->getName() << '\n'; @@ -2504,7 +2504,7 @@ unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID()); if (!LabelID) continue; - if (!VerboseAsm) + if (!Asm->isVerbose()) Asm->EOL(); else { std::pair SourceID = Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -76,7 +76,7 @@ default: break; case TargetMachine::AssemblyFile: - if (addAssemblyEmitter(PM, Fast, Out)) + if (addAssemblyEmitter(PM, Fast, getAsmVerbosityDefault(), Out)) return FileModel::Error; return FileModel::AsmFile; case TargetMachine::ObjectFile: Modified: llvm/trunk/lib/Target/ARM/ARM.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARM.h (original) +++ llvm/trunk/lib/Target/ARM/ARM.h Tue Mar 24 20:47:28 2009 @@ -91,7 +91,7 @@ FunctionPass *createARMISelDag(ARMTargetMachine &TM); FunctionPass *createARMCodePrinterPass(raw_ostream &O, ARMTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM, MachineCodeEmitter &MCE); FunctionPass *createARMLoadStoreOptimizationPass(); Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -156,11 +156,11 @@ } bool ARMTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { // Output assembly language. assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(Out, *this, Fast)); + PM.add(AsmPrinterCtor(Out, *this, Fast, Verbose)); return false; } @@ -177,7 +177,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; @@ -190,7 +190,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -41,7 +41,7 @@ // set this functions to ctor pointer at startup time if they are linked in. typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, ARMTargetMachine &tm, - bool fast); + bool fast, bool verbose); static AsmPrinterCtorFn AsmPrinterCtor; public: @@ -72,7 +72,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -81,8 +81,8 @@ bool InCPMode; public: ARMAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), DW(0), MMI(NULL), AFI(NULL), MCP(NULL), + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), DW(0), MMI(NULL), AFI(NULL), MCP(NULL), InCPMode(false) { Subtarget = &TM.getSubtarget(); } @@ -346,7 +346,8 @@ } } -static void printSOImm(raw_ostream &O, int64_t V, const TargetAsmInfo *TAI) { +static void printSOImm(raw_ostream &O, int64_t V, bool VerboseAsm, + const TargetAsmInfo *TAI) { assert(V < (1 << 12) && "Not a valid so_imm value!"); unsigned Imm = ARM_AM::getSOImmValImm(V); unsigned Rot = ARM_AM::getSOImmValRot(V); @@ -369,7 +370,7 @@ void ARMAsmPrinter::printSOImmOperand(const MachineInstr *MI, int OpNum) { const MachineOperand &MO = MI->getOperand(OpNum); assert(MO.isImm() && "Not a valid so_imm value!"); - printSOImm(O, MO.getImm(), TAI); + printSOImm(O, MO.getImm(), VerboseAsm, TAI); } /// printSOImm2PartOperand - SOImm is broken into two pieces using a 'mov' @@ -379,7 +380,7 @@ assert(MO.isImm() && "Not a valid so_imm value!"); unsigned V1 = ARM_AM::getSOImmTwoPartFirst(MO.getImm()); unsigned V2 = ARM_AM::getSOImmTwoPartSecond(MO.getImm()); - printSOImm(O, ARM_AM::getSOImmVal(V1), TAI); + printSOImm(O, ARM_AM::getSOImmVal(V1), VerboseAsm, TAI); O << "\n\torr"; printPredicateOperand(MI, 2); O << " "; @@ -387,7 +388,7 @@ O << ", "; printOperand(MI, 0); O << ", "; - printSOImm(O, ARM_AM::getSOImmVal(V2), TAI); + printSOImm(O, ARM_AM::getSOImmVal(V2), VerboseAsm, TAI); } // so_reg is a 4-operand unit corresponding to register forms of the A5.1 @@ -1057,8 +1058,8 @@ /// FunctionPass *llvm::createARMCodePrinterPass(raw_ostream &o, ARMTargetMachine &tm, - bool fast) { - return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } namespace { Modified: llvm/trunk/lib/Target/Alpha/Alpha.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/Alpha.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/Alpha.h (original) +++ llvm/trunk/lib/Target/Alpha/Alpha.h Tue Mar 24 20:47:28 2009 @@ -26,7 +26,7 @@ FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM); FunctionPass *createAlphaCodePrinterPass(raw_ostream &OS, TargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM); FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM, MachineCodeEmitter &MCE); Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -85,17 +85,18 @@ PM.add(createAlphaBranchSelectionPass()); return false; } -bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, +bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, + bool Verbose, raw_ostream &Out) { PM.add(createAlphaLLRPPass(*this)); - PM.add(createAlphaCodePrinterPass(Out, *this, Fast)); + PM.add(createAlphaCodePrinterPass(Out, *this, Fast, Verbose)); return false; } bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { PM.add(createAlphaCodeEmitterPass(*this, MCE)); if (DumpAsm) - PM.add(createAlphaCodePrinterPass(errs(), *this, Fast)); + PM.add(createAlphaCodePrinterPass(errs(), *this, Fast, true)); return false; } bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -61,7 +61,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -37,8 +37,8 @@ /// AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *T, bool F) - : AsmPrinter(o, tm, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(o, tm, T, F, V) {} virtual const char *getPassName() const { return "Alpha Assembly Printer"; @@ -68,8 +68,8 @@ /// FunctionPass *llvm::createAlphaCodePrinterPass(raw_ostream &o, TargetMachine &tm, - bool fast) { - return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } #include "AlphaGenAsmWriter.inc" Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -49,8 +49,8 @@ std::set FnStubs, GVStubs; public: SPUAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) : - AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) : + AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "STI CBEA SPU Assembly Printer"; @@ -289,8 +289,8 @@ MachineModuleInfo *MMI; public: LinuxAsmPrinter(raw_ostream &O, SPUTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : SPUAsmPrinter(O, TM, T, F), DW(0), MMI(0) {} + const TargetAsmInfo *T, bool F, bool V) + : SPUAsmPrinter(O, TM, T, F, V), DW(0), MMI(0) {} virtual const char *getPassName() const { return "STI CBEA SPU Assembly Printer"; @@ -615,6 +615,6 @@ /// FunctionPass *llvm::createSPUAsmPrinterPass(raw_ostream &o, SPUTargetMachine &tm, - bool fast) { - return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } Modified: llvm/trunk/lib/Target/CellSPU/SPU.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPU.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPU.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPU.h Tue Mar 24 20:47:28 2009 @@ -25,7 +25,7 @@ FunctionPass *createSPUISelDag(SPUTargetMachine &TM); FunctionPass *createSPUAsmPrinterPass(raw_ostream &o, SPUTargetMachine &tm, - bool fast); + bool fast, bool verbose); /*--== Utility functions/predicates/etc used all over the place: --==*/ //! Predicate test for a signed 10-bit value Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -89,7 +89,7 @@ } bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { - PM.add(createSPUAsmPrinterPass(Out, *this, Fast)); + bool Verbose, raw_ostream &Out) { + PM.add(createSPUAsmPrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -85,7 +85,7 @@ // Pass Pipeline Configuration virtual bool addInstSelector(PassManagerBase &PM, bool /*Fast*/); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool /*Fast*/, - raw_ostream &Out); + bool /*Verbose*/, raw_ostream &Out); }; } // end namespace llvm Modified: llvm/trunk/lib/Target/IA64/IA64.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64.h (original) +++ llvm/trunk/lib/Target/IA64/IA64.h Tue Mar 24 20:47:28 2009 @@ -37,7 +37,7 @@ /// FunctionPass *createIA64CodePrinterPass(raw_ostream &o, IA64TargetMachine &tm, - bool fast); + bool fast, bool verbose); } // End llvm namespace Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -38,8 +38,8 @@ std::set ExternalFunctionNames, ExternalObjectNames; public: IA64AsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "IA64 Assembly Printer"; @@ -370,6 +370,6 @@ /// FunctionPass *llvm::createIA64CodePrinterPass(raw_ostream &o, IA64TargetMachine &tm, - bool fast) { - return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -83,8 +83,8 @@ return true; } bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { - PM.add(createIA64CodePrinterPass(Out, *this, Fast)); + bool Verbose, raw_ostream &Out) { + PM.add(createIA64CodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetMachine.h (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.h Tue Mar 24 20:47:28 2009 @@ -54,7 +54,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; } // End llvm namespace Modified: llvm/trunk/lib/Target/Mips/Mips.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/Mips.h (original) +++ llvm/trunk/lib/Target/Mips/Mips.h Tue Mar 24 20:47:28 2009 @@ -25,7 +25,7 @@ FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM); FunctionPass *createMipsCodePrinterPass(raw_ostream &OS, MipsTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); } // end namespace llvm; // Defines symbolic names for Mips registers. This defines a mapping from Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -50,8 +50,8 @@ const MipsSubtarget *Subtarget; public: MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) { + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) { Subtarget = &TM.getSubtarget(); } @@ -91,8 +91,8 @@ /// regardless of whether the function is in SSA form. FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o, MipsTargetMachine &tm, - bool fast) { - return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -125,9 +125,9 @@ // true if AssemblyEmitter is supported bool MipsTargetMachine:: addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) + bool Verbose, raw_ostream &Out) { // Output assembly language. - PM.add(createMipsCodePrinterPass(Out, *this, Fast)); + PM.add(createMipsCodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -60,7 +60,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; /// MipselTargetMachine - Mipsel target machine. Modified: llvm/trunk/lib/Target/PIC16/PIC16.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16.h Tue Mar 24 20:47:28 2009 @@ -75,7 +75,7 @@ FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM); FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS, PIC16TargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); } // end namespace llvm; // Defines symbolic names for PIC16 registers. This defines a mapping from Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -139,8 +139,8 @@ /// FunctionPass *llvm::createPIC16CodePrinterPass(raw_ostream &o, PIC16TargetMachine &tm, - bool fast) { - return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) { Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h Tue Mar 24 20:47:28 2009 @@ -24,9 +24,9 @@ namespace llvm { struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { - PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) { + PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) { CurBank = ""; IsRomData = false; } Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -62,9 +62,10 @@ } bool PIC16TargetMachine:: -addAssemblyEmitter(PassManagerBase &PM, bool Fast, raw_ostream &Out) { +addAssemblyEmitter(PassManagerBase &PM, bool Fast, bool Verbose, + raw_ostream &Out) { // Output assembly language. - PM.add(createPIC16CodePrinterPass(Out, *this, Fast)); + PM.add(createPIC16CodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Tue Mar 24 20:47:28 2009 @@ -59,7 +59,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; // PIC16TargetMachine. /// CooperTargetMachine Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -55,8 +55,8 @@ const PPCSubtarget &Subtarget; public: PPCAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), Subtarget(TM.getSubtarget()) {} virtual const char *getPassName() const { @@ -298,8 +298,8 @@ MachineModuleInfo *MMI; public: PPCLinuxAsmPrinter(raw_ostream &O, PPCTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0) {} + const TargetAsmInfo *T, bool F, bool V) + : PPCAsmPrinter(O, TM, T, F, V), DW(0), MMI(0) {} virtual const char *getPassName() const { return "Linux PPC Assembly Printer"; @@ -327,8 +327,8 @@ raw_ostream &OS; public: PPCDarwinAsmPrinter(raw_ostream &O, PPCTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0), OS(O) {} + const TargetAsmInfo *T, bool F, bool V) + : PPCAsmPrinter(O, TM, T, F, V), DW(0), MMI(0), OS(O) {} virtual const char *getPassName() const { return "Darwin PPC Assembly Printer"; @@ -1175,13 +1175,13 @@ /// FunctionPass *llvm::createPPCAsmPrinterPass(raw_ostream &o, PPCTargetMachine &tm, - bool fast) { + bool fast, bool verbose) { const PPCSubtarget *Subtarget = &tm.getSubtarget(); if (Subtarget->isDarwin()) { - return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } else { - return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } } Modified: llvm/trunk/lib/Target/PowerPC/PPC.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPC.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPC.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPC.h Tue Mar 24 20:47:28 2009 @@ -28,7 +28,7 @@ FunctionPass *createPPCISelDag(PPCTargetMachine &TM); FunctionPass *createPPCAsmPrinterPass(raw_ostream &OS, PPCTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM, MachineCodeEmitter &MCE); } // end namespace llvm; Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -143,10 +143,10 @@ } bool PPCTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(Out, *this, Fast)); + PM.add(AsmPrinterCtor(Out, *this, Fast, Verbose)); return false; } @@ -176,7 +176,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; @@ -189,7 +189,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -46,7 +46,7 @@ // set this functions to ctor pointer at startup time if they are linked in. typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, PPCTargetMachine &tm, - bool fast); + bool fast, bool verbose); static AsmPrinterCtorFn AsmPrinterCtor; public: @@ -79,7 +79,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -49,8 +49,8 @@ ValueMapTy NumberForBB; public: SparcAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "Sparc Assembly Printer"; @@ -82,8 +82,8 @@ /// FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o, TargetMachine &tm, - bool fast) { - return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } /// runOnMachineFunction - This uses the printInstruction() Modified: llvm/trunk/lib/Target/Sparc/Sparc.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/Sparc.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/Sparc.h (original) +++ llvm/trunk/lib/Target/Sparc/Sparc.h Tue Mar 24 20:47:28 2009 @@ -24,8 +24,8 @@ class raw_ostream; FunctionPass *createSparcISelDag(SparcTargetMachine &TM); - FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, - TargetMachine &TM, bool Fast); + FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM, + bool Fast, bool Verbose); FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM); FunctionPass *createSparcFPMoverPass(TargetMachine &TM); } // end namespace llvm; Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -83,8 +83,8 @@ } bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { // Output assembly language. - PM.add(createSparcCodePrinterPass(Out, *this, Fast)); + PM.add(createSparcCodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -54,7 +54,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; } // end namespace llvm Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -39,10 +39,10 @@ bool PerformTailCallOpt; unsigned StackAlignment; bool RealignStack; - bool VerboseAsm; bool DisableJumpTables; bool StrongPHIElim; bool DisableRedZone; + bool AsmVerbosityDefault(false); } static cl::opt @@ -154,10 +154,6 @@ cl::location(RealignStack), cl::init(true)); static cl::opt -AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), - cl::location(VerboseAsm), - cl::init(false)); -static cl::opt DisableSwitchTables(cl::Hidden, "disable-jump-tables", cl::desc("Do not generate jump tables."), cl::location(DisableJumpTables), @@ -203,6 +199,14 @@ CMModel = Model; } +bool TargetMachine::getAsmVerbosityDefault() { + return AsmVerbosityDefault; +} + +void TargetMachine::setAsmVerbosityDefault(bool V) { + AsmVerbosityDefault = V; +} + namespace llvm { /// LessPreciseFPMAD - This flag return true when -enable-fp-mad option /// is specified on the command line. When this flag is off(default), the Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Tue Mar 24 20:47:28 2009 @@ -34,8 +34,8 @@ const X86Subtarget *Subtarget; public: X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), DW(0), MMI(0) { + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), DW(0), MMI(0) { Subtarget = &TM.getSubtarget(); } Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -25,13 +25,13 @@ /// FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm, - bool fast) { + bool fast, bool verbose) { const X86Subtarget *Subtarget = &tm.getSubtarget(); if (Subtarget->isFlavorIntel()) { - return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } else { - return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } } Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h Tue Mar 24 20:47:28 2009 @@ -26,8 +26,8 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter { X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "X86 Intel-Style Assembly Printer"; Modified: llvm/trunk/lib/Target/X86/X86.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86.h (original) +++ llvm/trunk/lib/Target/X86/X86.h Tue Mar 24 20:47:28 2009 @@ -44,7 +44,7 @@ /// FunctionPass *createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm, - bool fast); + bool fast, bool Verbose); /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code /// to the specified MCE object. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -207,10 +207,10 @@ } bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(Out, *this, Fast)); + PM.add(AsmPrinterCtor(Out, *this, Fast, Verbose)); return false; } @@ -236,7 +236,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; @@ -248,7 +248,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Tue Mar 24 20:47:28 2009 @@ -45,7 +45,7 @@ // set this functions to ctor pointer at startup time if they are linked in. typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, X86TargetMachine &tm, - bool fast); + bool fast, bool verbose); static AsmPrinterCtorFn AsmPrinterCtor; public: @@ -78,7 +78,7 @@ virtual bool addPreRegAlloc(PassManagerBase &PM, bool Fast); virtual bool addPostRegAlloc(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/trunk/lib/Target/XCore/XCore.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCore.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCore.h (original) +++ llvm/trunk/lib/Target/XCore/XCore.h Tue Mar 24 20:47:28 2009 @@ -24,7 +24,7 @@ FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM); FunctionPass *createXCoreCodePrinterPass(raw_ostream &OS, XCoreTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); } // end namespace llvm; // Defines symbolic names for XCore registers. This defines a mapping from Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Tue Mar 24 20:47:28 2009 @@ -58,8 +58,8 @@ const XCoreSubtarget &Subtarget; public: XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), DW(0), + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), DW(0), Subtarget(*TM.getSubtargetImpl()) {} virtual const char *getPassName() const { @@ -105,8 +105,8 @@ /// FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o, XCoreTargetMachine &tm, - bool fast) { - return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } // PrintEscapedString - Print each character of the specified string, escaping Modified: llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreTargetMachine.cpp Tue Mar 24 20:47:28 2009 @@ -61,8 +61,8 @@ } bool XCoreTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { // Output assembly language. - PM.add(createXCoreCodePrinterPass(Out, *this, Fast)); + PM.add(createXCoreCodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h (original) +++ llvm/trunk/lib/Target/XCore/XCoreTargetMachine.h Tue Mar 24 20:47:28 2009 @@ -54,7 +54,7 @@ // Pass Pipeline Configuration virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; } // end namespace llvm Modified: llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-06-04-tailmerge4.ll Tue Mar 24 20:47:28 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -enable-eh -asm-verbose | grep invcont131 +; RUN: llvm-as < %s | llc -enable-eh | grep invcont131 ; PR 1496: tail merge was incorrectly removing this block ; ModuleID = 'report.1.bc' Modified: llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll Tue Mar 24 20:47:28 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -asm-verbose | grep {#} | not grep -v {##} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep {#} | not grep -v {##} %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* } %struct.AGenericManager = type <{ i8 }> Modified: llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll Tue Mar 24 20:47:28 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -asm-verbose | grep -A 1 lpad | grep Llabel +; RUN: llvm-as < %s | llc -march=x86 | grep -A 1 lpad | grep Llabel ; Check that register copies in the landing pad come after the EH_LABEL declare i32 @f() Modified: llvm/trunk/test/CodeGen/X86/aliases.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/aliases.ll?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/aliases.ll (original) +++ llvm/trunk/test/CodeGen/X86/aliases.ll Tue Mar 24 20:47:28 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=i686-pc-linux-gnu -o %t -f +; RUN: llc -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t -f ; RUN: grep set %t | count 7 ; RUN: grep globl %t | count 6 ; RUN: grep weak %t | count 1 Modified: llvm/trunk/test/CodeGen/X86/pic_jumptable.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic_jumptable.ll?rev=67668&r1=67667&r2=67668&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic_jumptable.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic_jumptable.ll Tue Mar 24 20:47:28 2009 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu | not grep -F .text -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | not grep lea -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | grep add | count 2 +; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu -asm-verbose=false | not grep -F .text +; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false | not grep lea +; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false | grep add | count 2 declare void @_Z3bari(i32) From evan.cheng at apple.com Tue Mar 24 20:48:22 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 01:48:22 -0000 Subject: [llvm-commits] [llvm] r67669 - /llvm/trunk/tools/llc/llc.cpp Message-ID: <200903250148.n2P1mMob003739@zion.cs.uiuc.edu> Author: evancheng Date: Tue Mar 24 20:48:21 2009 New Revision: 67669 URL: http://llvm.org/viewvc/llvm-project?rev=67669&view=rev Log: CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose. Modified: llvm/trunk/tools/llc/llc.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=67669&r1=67668&r2=67669&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Tue Mar 24 20:48:21 2009 @@ -280,6 +280,9 @@ // Ask the target to add backend passes as necessary. MachineCodeEmitter *MCE = 0; + // Override default to generate verbose assembly. + Target.setAsmVerbosityDefault(true); + switch (Target.addPassesToEmitFile(Passes, *Out, FileType, Fast)) { default: assert(0 && "Invalid file model!"); From isanbard at gmail.com Tue Mar 24 20:59:11 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 01:59:11 -0000 Subject: [llvm-commits] [llvm] r67670 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CellSPU/ lib/Target/CellSPU/AsmPrinter/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/Sparc/AsmPrinter/ lib/Target/X86/ lib/Target/X86/AsmPrinter/ lib/Target/XCore/ test/CodeGen/X86/ to... Message-ID: <200903250159.n2P1xFwo004460@zion.cs.uiuc.edu> Author: void Date: Tue Mar 24 20:59:09 2009 New Revision: 67670 URL: http://llvm.org/viewvc/llvm-project?rev=67670&view=rev Log: --- Merging (from foreign repository) r67667 into '.': U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Don't print global names twice with -asm-verbose. --- Merging (from foreign repository) r67668 into '.': U test/CodeGen/X86/aliases.ll U test/CodeGen/X86/2007-06-04-tailmerge4.ll U test/CodeGen/X86/pic_jumptable.ll U test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll U test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll U include/llvm/Target/TargetOptions.h U include/llvm/Target/TargetMachine.h U include/llvm/CodeGen/AsmPrinter.h U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/AsmPrinter/DwarfWriter.cpp U lib/CodeGen/AsmPrinter/AsmPrinter.cpp U lib/Target/PowerPC/PPCTargetMachine.h U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp U lib/Target/PowerPC/PPCTargetMachine.cpp U lib/Target/PowerPC/PPC.h U lib/Target/ARM/ARMTargetMachine.cpp U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp U lib/Target/ARM/ARMTargetMachine.h U lib/Target/ARM/ARM.h U lib/Target/XCore/XCoreTargetMachine.cpp U lib/Target/XCore/XCoreTargetMachine.h U lib/Target/XCore/XCoreAsmPrinter.cpp U lib/Target/XCore/XCore.h U lib/Target/PIC16/PIC16TargetMachine.cpp U lib/Target/PIC16/PIC16TargetMachine.h U lib/Target/PIC16/PIC16AsmPrinter.cpp U lib/Target/PIC16/PIC16.h U lib/Target/PIC16/PIC16AsmPrinter.h U lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp U lib/Target/Alpha/AlphaTargetMachine.cpp U lib/Target/Alpha/AlphaTargetMachine.h U lib/Target/Alpha/Alpha.h U lib/Target/X86/X86TargetMachine.h U lib/Target/X86/X86.h U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86TargetMachine.cpp U lib/Target/TargetMachine.cpp U lib/Target/IA64/IA64TargetMachine.cpp U lib/Target/IA64/IA64TargetMachine.h U lib/Target/IA64/IA64AsmPrinter.cpp U lib/Target/IA64/IA64.h U lib/Target/CellSPU/SPUTargetMachine.h U lib/Target/CellSPU/SPU.h U lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp U lib/Target/CellSPU/SPUTargetMachine.cpp U lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp U lib/Target/Sparc/SparcTargetMachine.cpp U lib/Target/Sparc/SparcTargetMachine.h U lib/Target/Sparc/Sparc.h U lib/Target/Mips/MipsTargetMachine.cpp U lib/Target/Mips/MipsTargetMachine.h U lib/Target/Mips/MipsAsmPrinter.cpp U lib/Target/Mips/Mips.h --- Merging (from foreign repository) r67669 into '.': U tools/llc/llc.cpp CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose. Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h llvm/branches/Apple/Dib/include/llvm/Target/TargetMachine.h llvm/branches/Apple/Dib/include/llvm/Target/TargetOptions.h llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/branches/Apple/Dib/lib/CodeGen/LLVMTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.h llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.h llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.h llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.h llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.h llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.h llvm/branches/Apple/Dib/lib/Target/TargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h llvm/branches/Apple/Dib/lib/Target/X86/X86.h llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.h llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll llvm/branches/Apple/Dib/test/CodeGen/X86/aliases.ll llvm/branches/Apple/Dib/test/CodeGen/X86/pic_jumptable.ll llvm/branches/Apple/Dib/tools/llc/llc.cpp Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h Tue Mar 24 20:59:09 2009 @@ -104,14 +104,22 @@ /// IsInTextSection - True if the current section we are emitting to is a /// text section. bool IsInTextSection; - + + /// VerboseAsm - Emit comments in assembly output if this is true. + /// + bool VerboseAsm; + protected: AsmPrinter(raw_ostream &o, TargetMachine &TM, - const TargetAsmInfo *T, bool F); + const TargetAsmInfo *T, bool F, bool V); public: virtual ~AsmPrinter(); - + + /// isVerbose - Return true if assembly output should contain comments. + /// + bool isVerbose() const { return VerboseAsm; } + /// SwitchToTextSection - Switch to the specified section of the executable /// if we are not already in it! If GV is non-null and if the global has an /// explicitly requested section, we switch to the section indicated for the Modified: llvm/branches/Apple/Dib/include/llvm/Target/TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/Target/TargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/Target/TargetMachine.h (original) +++ llvm/branches/Apple/Dib/include/llvm/Target/TargetMachine.h Tue Mar 24 20:59:09 2009 @@ -174,6 +174,7 @@ static Reloc::Model getRelocationModel(); /// setRelocationModel - Sets the code generation relocation model. + /// static void setRelocationModel(Reloc::Model Model); /// getCodeModel - Returns the code model. The choices are small, kernel, @@ -181,8 +182,17 @@ static CodeModel::Model getCodeModel(); /// setCodeModel - Sets the code model. + /// static void setCodeModel(CodeModel::Model Model); + /// getAsmVerbosityDefault - Returns the default value of asm verbosity. + /// + static bool getAsmVerbosityDefault(); + + /// setAsmVerbosityDefault - Set the default value of asm verbosity. Default + /// is false. + static void setAsmVerbosityDefault(bool); + /// CodeGenFileType - These enums are meant to be passed into /// addPassesToEmitFile to indicate what type of file to emit. enum CodeGenFileType { @@ -319,8 +329,8 @@ /// addAssemblyEmitter - This pass should be overridden by the target to add /// the asmprinter, if asm emission is supported. If this is not supported, /// 'true' should be returned. - virtual bool addAssemblyEmitter(PassManagerBase &, bool /*Fast*/, - raw_ostream &) { + virtual bool addAssemblyEmitter(PassManagerBase &, bool /*Fast*/, + bool /* VerboseAsmDefault */, raw_ostream &) { return true; } Modified: llvm/branches/Apple/Dib/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/Target/TargetOptions.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/Target/TargetOptions.h (original) +++ llvm/branches/Apple/Dib/include/llvm/Target/TargetOptions.h Tue Mar 24 20:59:09 2009 @@ -104,10 +104,6 @@ /// realigned, if needed. extern bool RealignStack; - /// VerboseAsm - When this flag is set, the asm printer prints additional - /// comments to asm directives. - extern bool VerboseAsm; - /// DisableJumpTables - This flag indicates jump tables should not be /// generated. extern bool DisableJumpTables; Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetAsmInfo.h" @@ -35,13 +36,23 @@ #include using namespace llvm; +static cl::opt +AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), + cl::init(cl::BOU_UNSET)); + char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *T, bool F) + const TargetAsmInfo *T, bool F, bool VDef) : MachineFunctionPass(&ID), FunctionNumber(0), Fast(F), O(o), TM(tm), TAI(T), TRI(tm.getRegisterInfo()), IsInTextSection(false) -{} +{ + switch (AsmVerbose) { + case cl::BOU_UNSET: VerboseAsm = VDef; break; + case cl::BOU_TRUE: VerboseAsm = true; break; + case cl::BOU_FALSE: VerboseAsm = false; break; + } +} AsmPrinter::~AsmPrinter() { for (gcp_iterator I = GCMetadataPrinters.begin(), Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Mar 24 20:59:09 2009 @@ -1072,7 +1072,7 @@ Asm->EOL("Offset"); } else if (Reg < 64) { Asm->EmitInt8(DW_CFA_offset + Reg); - if (VerboseAsm) + if (Asm->isVerbose()) Asm->EOL("DW_CFA_offset + Reg (" + utostr(Reg) + ")"); else Asm->EOL(); @@ -2196,7 +2196,7 @@ // Emit the code (index) for the abbreviation. Asm->EmitULEB128Bytes(AbbrevNumber); - if (VerboseAsm) + if (Asm->isVerbose()) Asm->EOL(std::string("Abbrev [" + utostr(AbbrevNumber) + "] 0x" + utohexstr(Die->getOffset()) + @@ -2486,7 +2486,7 @@ // Isolate current sections line info. const std::vector &LineInfos = SectionSourceLines[j]; - if (VerboseAsm) { + if (Asm->isVerbose()) { const Section* S = SectionMap[j + 1]; O << '\t' << TAI->getCommentString() << " Section" << S->getName() << '\n'; @@ -2503,7 +2503,7 @@ unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID()); if (!LabelID) continue; - if (!VerboseAsm) + if (!Asm->isVerbose()) Asm->EOL(); else { std::pair SourceID = Modified: llvm/branches/Apple/Dib/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/LLVMTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/LLVMTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -76,7 +76,7 @@ default: break; case TargetMachine::AssemblyFile: - if (addAssemblyEmitter(PM, Fast, Out)) + if (addAssemblyEmitter(PM, Fast, getAsmVerbosityDefault(), Out)) return FileModel::Error; return FileModel::AsmFile; case TargetMachine::ObjectFile: Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h (original) +++ llvm/branches/Apple/Dib/lib/Target/ARM/ARM.h Tue Mar 24 20:59:09 2009 @@ -91,7 +91,7 @@ FunctionPass *createARMISelDag(ARMTargetMachine &TM); FunctionPass *createARMCodePrinterPass(raw_ostream &O, ARMTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM, MachineCodeEmitter &MCE); FunctionPass *createARMLoadStoreOptimizationPass(); Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -156,11 +156,11 @@ } bool ARMTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { // Output assembly language. assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(Out, *this, Fast)); + PM.add(AsmPrinterCtor(Out, *this, Fast, Verbose)); return false; } @@ -177,7 +177,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; @@ -190,7 +190,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/ARM/ARMTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -41,7 +41,7 @@ // set this functions to ctor pointer at startup time if they are linked in. typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, ARMTargetMachine &tm, - bool fast); + bool fast, bool verbose); static AsmPrinterCtorFn AsmPrinterCtor; public: @@ -72,7 +72,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -81,8 +81,8 @@ bool InCPMode; public: ARMAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), DW(0), MMI(NULL), AFI(NULL), MCP(NULL), + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), DW(0), MMI(NULL), AFI(NULL), MCP(NULL), InCPMode(false) { Subtarget = &TM.getSubtarget(); } @@ -346,7 +346,8 @@ } } -static void printSOImm(raw_ostream &O, int64_t V, const TargetAsmInfo *TAI) { +static void printSOImm(raw_ostream &O, int64_t V, bool VerboseAsm, + const TargetAsmInfo *TAI) { assert(V < (1 << 12) && "Not a valid so_imm value!"); unsigned Imm = ARM_AM::getSOImmValImm(V); unsigned Rot = ARM_AM::getSOImmValRot(V); @@ -369,7 +370,7 @@ void ARMAsmPrinter::printSOImmOperand(const MachineInstr *MI, int OpNum) { const MachineOperand &MO = MI->getOperand(OpNum); assert(MO.isImm() && "Not a valid so_imm value!"); - printSOImm(O, MO.getImm(), TAI); + printSOImm(O, MO.getImm(), VerboseAsm, TAI); } /// printSOImm2PartOperand - SOImm is broken into two pieces using a 'mov' @@ -379,7 +380,7 @@ assert(MO.isImm() && "Not a valid so_imm value!"); unsigned V1 = ARM_AM::getSOImmTwoPartFirst(MO.getImm()); unsigned V2 = ARM_AM::getSOImmTwoPartSecond(MO.getImm()); - printSOImm(O, ARM_AM::getSOImmVal(V1), TAI); + printSOImm(O, ARM_AM::getSOImmVal(V1), VerboseAsm, TAI); O << "\n\torr"; printPredicateOperand(MI, 2); O << " "; @@ -387,7 +388,7 @@ O << ", "; printOperand(MI, 0); O << ", "; - printSOImm(O, ARM_AM::getSOImmVal(V2), TAI); + printSOImm(O, ARM_AM::getSOImmVal(V2), VerboseAsm, TAI); } // so_reg is a 4-operand unit corresponding to register forms of the A5.1 @@ -1057,8 +1058,8 @@ /// FunctionPass *llvm::createARMCodePrinterPass(raw_ostream &o, ARMTargetMachine &tm, - bool fast) { - return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } namespace { Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h (original) +++ llvm/branches/Apple/Dib/lib/Target/Alpha/Alpha.h Tue Mar 24 20:59:09 2009 @@ -26,7 +26,7 @@ FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM); FunctionPass *createAlphaCodePrinterPass(raw_ostream &OS, TargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM); FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM, MachineCodeEmitter &MCE); Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -85,17 +85,18 @@ PM.add(createAlphaBranchSelectionPass()); return false; } -bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, +bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, + bool Verbose, raw_ostream &Out) { PM.add(createAlphaLLRPPass(*this)); - PM.add(createAlphaCodePrinterPass(Out, *this, Fast)); + PM.add(createAlphaCodePrinterPass(Out, *this, Fast, Verbose)); return false; } bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { PM.add(createAlphaCodeEmitterPass(*this, MCE)); if (DumpAsm) - PM.add(createAlphaCodePrinterPass(errs(), *this, Fast)); + PM.add(createAlphaCodePrinterPass(errs(), *this, Fast, true)); return false; } bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/Alpha/AlphaTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -61,7 +61,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -37,8 +37,8 @@ /// AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm, - const TargetAsmInfo *T, bool F) - : AsmPrinter(o, tm, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(o, tm, T, F, V) {} virtual const char *getPassName() const { return "Alpha Assembly Printer"; @@ -68,8 +68,8 @@ /// FunctionPass *llvm::createAlphaCodePrinterPass(raw_ostream &o, TargetMachine &tm, - bool fast) { - return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } #include "AlphaGenAsmWriter.inc" Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -49,8 +49,8 @@ std::set FnStubs, GVStubs; public: SPUAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) : - AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) : + AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "STI CBEA SPU Assembly Printer"; @@ -289,8 +289,8 @@ MachineModuleInfo *MMI; public: LinuxAsmPrinter(raw_ostream &O, SPUTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : SPUAsmPrinter(O, TM, T, F), DW(0), MMI(0) {} + const TargetAsmInfo *T, bool F, bool V) + : SPUAsmPrinter(O, TM, T, F, V), DW(0), MMI(0) {} virtual const char *getPassName() const { return "STI CBEA SPU Assembly Printer"; @@ -615,6 +615,6 @@ /// FunctionPass *llvm::createSPUAsmPrinterPass(raw_ostream &o, SPUTargetMachine &tm, - bool fast) { - return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h (original) +++ llvm/branches/Apple/Dib/lib/Target/CellSPU/SPU.h Tue Mar 24 20:59:09 2009 @@ -25,7 +25,7 @@ FunctionPass *createSPUISelDag(SPUTargetMachine &TM); FunctionPass *createSPUAsmPrinterPass(raw_ostream &o, SPUTargetMachine &tm, - bool fast); + bool fast, bool verbose); /*--== Utility functions/predicates/etc used all over the place: --==*/ //! Predicate test for a signed 10-bit value Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -89,7 +89,7 @@ } bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { - PM.add(createSPUAsmPrinterPass(Out, *this, Fast)); + bool Verbose, raw_ostream &Out) { + PM.add(createSPUAsmPrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/CellSPU/SPUTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -85,7 +85,7 @@ // Pass Pipeline Configuration virtual bool addInstSelector(PassManagerBase &PM, bool /*Fast*/); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool /*Fast*/, - raw_ostream &Out); + bool /*Verbose*/, raw_ostream &Out); }; } // end namespace llvm Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h (original) +++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64.h Tue Mar 24 20:59:09 2009 @@ -37,7 +37,7 @@ /// FunctionPass *createIA64CodePrinterPass(raw_ostream &o, IA64TargetMachine &tm, - bool fast); + bool fast, bool verbose); } // End llvm namespace Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64AsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -38,8 +38,8 @@ std::set ExternalFunctionNames, ExternalObjectNames; public: IA64AsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "IA64 Assembly Printer"; @@ -370,6 +370,6 @@ /// FunctionPass *llvm::createIA64CodePrinterPass(raw_ostream &o, IA64TargetMachine &tm, - bool fast) { - return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -83,8 +83,8 @@ return true; } bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { - PM.add(createIA64CodePrinterPass(Out, *this, Fast)); + bool Verbose, raw_ostream &Out) { + PM.add(createIA64CodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/IA64/IA64TargetMachine.h Tue Mar 24 20:59:09 2009 @@ -54,7 +54,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; } // End llvm namespace Modified: llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h (original) +++ llvm/branches/Apple/Dib/lib/Target/Mips/Mips.h Tue Mar 24 20:59:09 2009 @@ -25,7 +25,7 @@ FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM); FunctionPass *createMipsCodePrinterPass(raw_ostream &OS, MipsTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); } // end namespace llvm; // Defines symbolic names for Mips registers. This defines a mapping from Modified: llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/Mips/MipsAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -50,8 +50,8 @@ const MipsSubtarget *Subtarget; public: MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) { + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) { Subtarget = &TM.getSubtarget(); } @@ -91,8 +91,8 @@ /// regardless of whether the function is in SSA form. FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o, MipsTargetMachine &tm, - bool fast) { - return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } //===----------------------------------------------------------------------===// Modified: llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -125,9 +125,9 @@ // true if AssemblyEmitter is supported bool MipsTargetMachine:: addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) + bool Verbose, raw_ostream &Out) { // Output assembly language. - PM.add(createMipsCodePrinterPass(Out, *this, Fast)); + PM.add(createMipsCodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/Mips/MipsTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -60,7 +60,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; /// MipselTargetMachine - Mipsel target machine. Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h (original) +++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16.h Tue Mar 24 20:59:09 2009 @@ -75,7 +75,7 @@ FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM); FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS, PIC16TargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); } // end namespace llvm; // Defines symbolic names for PIC16 registers. This defines a mapping from Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -139,8 +139,8 @@ /// FunctionPass *llvm::createPIC16CodePrinterPass(raw_ostream &o, PIC16TargetMachine &tm, - bool fast) { - return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) { Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h (original) +++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16AsmPrinter.h Tue Mar 24 20:59:09 2009 @@ -24,9 +24,9 @@ namespace llvm { struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { - PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) { + PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) { CurBank = ""; IsRomData = false; } Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -62,9 +62,10 @@ } bool PIC16TargetMachine:: -addAssemblyEmitter(PassManagerBase &PM, bool Fast, raw_ostream &Out) { +addAssemblyEmitter(PassManagerBase &PM, bool Fast, bool Verbose, + raw_ostream &Out) { // Output assembly language. - PM.add(createPIC16CodePrinterPass(Out, *this, Fast)); + PM.add(createPIC16CodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/PIC16/PIC16TargetMachine.h Tue Mar 24 20:59:09 2009 @@ -59,7 +59,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; // PIC16TargetMachine. /// CooperTargetMachine Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -55,8 +55,8 @@ const PPCSubtarget &Subtarget; public: PPCAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), Subtarget(TM.getSubtarget()) {} virtual const char *getPassName() const { @@ -298,8 +298,8 @@ MachineModuleInfo *MMI; public: PPCLinuxAsmPrinter(raw_ostream &O, PPCTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0) {} + const TargetAsmInfo *T, bool F, bool V) + : PPCAsmPrinter(O, TM, T, F, V), DW(0), MMI(0) {} virtual const char *getPassName() const { return "Linux PPC Assembly Printer"; @@ -327,8 +327,8 @@ raw_ostream &OS; public: PPCDarwinAsmPrinter(raw_ostream &O, PPCTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0), OS(O) {} + const TargetAsmInfo *T, bool F, bool V) + : PPCAsmPrinter(O, TM, T, F, V), DW(0), MMI(0), OS(O) {} virtual const char *getPassName() const { return "Darwin PPC Assembly Printer"; @@ -1175,13 +1175,13 @@ /// FunctionPass *llvm::createPPCAsmPrinterPass(raw_ostream &o, PPCTargetMachine &tm, - bool fast) { + bool fast, bool verbose) { const PPCSubtarget *Subtarget = &tm.getSubtarget(); if (Subtarget->isDarwin()) { - return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } else { - return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } } Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h (original) +++ llvm/branches/Apple/Dib/lib/Target/PowerPC/PPC.h Tue Mar 24 20:59:09 2009 @@ -28,7 +28,7 @@ FunctionPass *createPPCISelDag(PPCTargetMachine &TM); FunctionPass *createPPCAsmPrinterPass(raw_ostream &OS, PPCTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM, MachineCodeEmitter &MCE); } // end namespace llvm; Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -143,10 +143,10 @@ } bool PPCTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(Out, *this, Fast)); + PM.add(AsmPrinterCtor(Out, *this, Fast, Verbose)); return false; } @@ -176,7 +176,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; @@ -189,7 +189,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/PowerPC/PPCTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -46,7 +46,7 @@ // set this functions to ctor pointer at startup time if they are linked in. typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, PPCTargetMachine &tm, - bool fast); + bool fast, bool verbose); static AsmPrinterCtorFn AsmPrinterCtor; public: @@ -79,7 +79,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -49,8 +49,8 @@ ValueMapTy NumberForBB; public: SparcAsmPrinter(raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "Sparc Assembly Printer"; @@ -82,8 +82,8 @@ /// FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o, TargetMachine &tm, - bool fast) { - return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } /// runOnMachineFunction - This uses the printInstruction() Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h (original) +++ llvm/branches/Apple/Dib/lib/Target/Sparc/Sparc.h Tue Mar 24 20:59:09 2009 @@ -24,8 +24,8 @@ class raw_ostream; FunctionPass *createSparcISelDag(SparcTargetMachine &TM); - FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, - TargetMachine &TM, bool Fast); + FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM, + bool Fast, bool Verbose); FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM); FunctionPass *createSparcFPMoverPass(TargetMachine &TM); } // end namespace llvm; Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -83,8 +83,8 @@ } bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { // Output assembly language. - PM.add(createSparcCodePrinterPass(Out, *this, Fast)); + PM.add(createSparcCodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/Sparc/SparcTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -54,7 +54,7 @@ virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; } // end namespace llvm Modified: llvm/branches/Apple/Dib/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/TargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/TargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/TargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -39,10 +39,10 @@ bool PerformTailCallOpt; unsigned StackAlignment; bool RealignStack; - bool VerboseAsm; bool DisableJumpTables; bool StrongPHIElim; bool DisableRedZone; + bool AsmVerbosityDefault(false); } static cl::opt @@ -154,10 +154,6 @@ cl::location(RealignStack), cl::init(true)); static cl::opt -AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), - cl::location(VerboseAsm), - cl::init(false)); -static cl::opt DisableSwitchTables(cl::Hidden, "disable-jump-tables", cl::desc("Do not generate jump tables."), cl::location(DisableJumpTables), @@ -203,6 +199,14 @@ CMModel = Model; } +bool TargetMachine::getAsmVerbosityDefault() { + return AsmVerbosityDefault; +} + +void TargetMachine::setAsmVerbosityDefault(bool V) { + AsmVerbosityDefault = V; +} + namespace llvm { /// LessPreciseFPMAD - This flag return true when -enable-fp-mad option /// is specified on the command line. When this flag is off(default), the Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -831,7 +831,7 @@ EmitAlignment(Align, GVar); O << name << ":"; if (VerboseAsm) { - O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + O << "\t\t\t\t" << TAI->getCommentString() << ' '; PrintUnmangledNameSafely(GVar, O); } O << '\n'; @@ -894,7 +894,7 @@ EmitAlignment(Align, GVar); O << name << ":"; if (VerboseAsm){ - O << name << "\t\t\t\t" << TAI->getCommentString() << ' '; + O << "\t\t\t\t" << TAI->getCommentString() << ' '; PrintUnmangledNameSafely(GVar, O); } O << '\n'; Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Tue Mar 24 20:59:09 2009 @@ -34,8 +34,8 @@ const X86Subtarget *Subtarget; public: X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), DW(0), MMI(0) { + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), DW(0), MMI(0) { Subtarget = &TM.getSubtarget(); } Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -25,13 +25,13 @@ /// FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm, - bool fast) { + bool fast, bool verbose) { const X86Subtarget *Subtarget = &tm.getSubtarget(); if (Subtarget->isFlavorIntel()) { - return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } else { - return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } } Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -491,7 +491,7 @@ O << name << ":"; if (VerboseAsm) - O << name << "\t\t\t\t" << TAI->getCommentString() + O << "\t\t\t\t" << TAI->getCommentString() << " " << I->getName(); O << '\n'; Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h Tue Mar 24 20:59:09 2009 @@ -26,8 +26,8 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter { X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F) {} + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V) {} virtual const char *getPassName() const { return "X86 Intel-Style Assembly Printer"; Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86.h (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86.h Tue Mar 24 20:59:09 2009 @@ -44,7 +44,7 @@ /// FunctionPass *createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm, - bool fast); + bool fast, bool Verbose); /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code /// to the specified MCE object. Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -207,10 +207,10 @@ } bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(Out, *this, Fast)); + PM.add(AsmPrinterCtor(Out, *this, Fast, Verbose)); return false; } @@ -236,7 +236,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; @@ -248,7 +248,7 @@ if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(errs(), *this, Fast)); + PM.add(AsmPrinterCtor(errs(), *this, Fast, true)); } return false; Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86TargetMachine.h Tue Mar 24 20:59:09 2009 @@ -45,7 +45,7 @@ // set this functions to ctor pointer at startup time if they are linked in. typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, X86TargetMachine &tm, - bool fast); + bool fast, bool verbose); static AsmPrinterCtorFn AsmPrinterCtor; public: @@ -78,7 +78,7 @@ virtual bool addPreRegAlloc(PassManagerBase &PM, bool Fast); virtual bool addPostRegAlloc(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h (original) +++ llvm/branches/Apple/Dib/lib/Target/XCore/XCore.h Tue Mar 24 20:59:09 2009 @@ -24,7 +24,7 @@ FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM); FunctionPass *createXCoreCodePrinterPass(raw_ostream &OS, XCoreTargetMachine &TM, - bool Fast); + bool Fast, bool Verbose); } // end namespace llvm; // Defines symbolic names for XCore registers. This defines a mapping from Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/XCore/XCoreAsmPrinter.cpp Tue Mar 24 20:59:09 2009 @@ -58,8 +58,8 @@ const XCoreSubtarget &Subtarget; public: XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM, - const TargetAsmInfo *T, bool F) - : AsmPrinter(O, TM, T, F), DW(0), + const TargetAsmInfo *T, bool F, bool V) + : AsmPrinter(O, TM, T, F, V), DW(0), Subtarget(*TM.getSubtargetImpl()) {} virtual const char *getPassName() const { @@ -105,8 +105,8 @@ /// FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o, XCoreTargetMachine &tm, - bool fast) { - return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast); + bool fast, bool verbose) { + return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast, verbose); } // PrintEscapedString - Print each character of the specified string, escaping Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.cpp Tue Mar 24 20:59:09 2009 @@ -61,8 +61,8 @@ } bool XCoreTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out) { + bool Verbose, raw_ostream &Out) { // Output assembly language. - PM.add(createXCoreCodePrinterPass(Out, *this, Fast)); + PM.add(createXCoreCodePrinterPass(Out, *this, Fast, Verbose)); return false; } Modified: llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.h?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.h (original) +++ llvm/branches/Apple/Dib/lib/Target/XCore/XCoreTargetMachine.h Tue Mar 24 20:59:09 2009 @@ -54,7 +54,7 @@ // Pass Pipeline Configuration virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - raw_ostream &Out); + bool Verbose, raw_ostream &Out); }; } // end namespace llvm Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2007-06-04-tailmerge4.ll Tue Mar 24 20:59:09 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -enable-eh -asm-verbose | grep invcont131 +; RUN: llvm-as < %s | llc -enable-eh | grep invcont131 ; PR 1496: tail merge was incorrectly removing this block ; ModuleID = 'report.1.bc' Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll Tue Mar 24 20:59:09 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -asm-verbose | grep {#} | not grep -v {##} +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep {#} | not grep -v {##} %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* } %struct.AGenericManager = type <{ i8 }> Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll Tue Mar 24 20:59:09 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -asm-verbose | grep -A 1 lpad | grep Llabel +; RUN: llvm-as < %s | llc -march=x86 | grep -A 1 lpad | grep Llabel ; Check that register copies in the landing pad come after the EH_LABEL declare i32 @f() Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/aliases.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/aliases.ll?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/aliases.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/aliases.ll Tue Mar 24 20:59:09 2009 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -mtriple=i686-pc-linux-gnu -o %t -f +; RUN: llc -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t -f ; RUN: grep set %t | count 7 ; RUN: grep globl %t | count 6 ; RUN: grep weak %t | count 1 Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/pic_jumptable.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/pic_jumptable.ll?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/pic_jumptable.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/pic_jumptable.ll Tue Mar 24 20:59:09 2009 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu | not grep -F .text -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | not grep lea -; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | grep add | count 2 +; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu -asm-verbose=false | not grep -F .text +; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false | not grep lea +; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false | grep add | count 2 declare void @_Z3bari(i32) Modified: llvm/branches/Apple/Dib/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/tools/llc/llc.cpp?rev=67670&r1=67669&r2=67670&view=diff ============================================================================== --- llvm/branches/Apple/Dib/tools/llc/llc.cpp (original) +++ llvm/branches/Apple/Dib/tools/llc/llc.cpp Tue Mar 24 20:59:09 2009 @@ -280,6 +280,9 @@ // Ask the target to add backend passes as necessary. MachineCodeEmitter *MCE = 0; + // Override default to generate verbose assembly. + Target.setAsmVerbosityDefault(true); + switch (Target.addPassesToEmitFile(Passes, *Out, FileType, Fast)) { default: assert(0 && "Invalid file model!"); From clattner at apple.com Tue Mar 24 21:09:23 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 24 Mar 2009 19:09:23 -0700 Subject: [llvm-commits] [llvm] r67635 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/shift.ll In-Reply-To: References: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> Message-ID: <2C492F79-4216-4CA5-B8C9-A12A3022B9BA@apple.com> On Mar 24, 2009, at 2:45 PM, Misha Brukman wrote: > On Tue, Mar 24, 2009 at 2:15 PM, Chris Lattner > wrote: > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/InstCombine/shift.ll (original) > +++ llvm/trunk/test/Transforms/InstCombine/shift.ll Tue Mar 24 > 13:15:30 2009 > @@ -206,4 +206,11 @@ > %D = shl i32 %C, 1 ; [#uses=1] > ret i32 %D > } > + > + > +define i1 @test27(i32 %x) nounwind { > + %y = lshr i32 %x, 3 > + %z = trunc i32 %y to i1 > + ret i1 %z > +} > > This would work great as a unittest. Just sayin'. Why would it be better as a unit test? -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090324/34f2faf0/attachment.html From sabre at nondot.org Tue Mar 24 21:13:38 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 24 Mar 2009 21:13:38 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2009-03-CGO-ESoftCheck.html Message-ID: <200903250213.n2P2Dcl2005402@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2009-03-CGO-ESoftCheck.html updated: 1.1 -> 1.2 --- Log message: remove unrelated person. --- Diffs of the changes: (+0 -1) 2009-03-CGO-ESoftCheck.html | 1 - 1 files changed, 1 deletion(-) Index: llvm-www/pubs/2009-03-CGO-ESoftCheck.html diff -u llvm-www/pubs/2009-03-CGO-ESoftCheck.html:1.1 llvm-www/pubs/2009-03-CGO-ESoftCheck.html:1.2 --- llvm-www/pubs/2009-03-CGO-ESoftCheck.html:1.1 Tue Mar 24 19:16:23 2009 +++ llvm-www/pubs/2009-03-CGO-ESoftCheck.html Tue Mar 24 21:12:30 2009 @@ -14,7 +14,6 @@ Jing Yu, Maria Jesus Garzaran, Marc Snir - Vikram Adve

    Abstract:

    From clattner at apple.com Tue Mar 24 21:13:41 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 24 Mar 2009 19:13:41 -0700 Subject: [llvm-commits] [llvm] r67668 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CellSPU/ lib/Target/CellSPU/AsmPrinter/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/Sparc/AsmPrinter/ lib/Target/X86/ lib/Target/X86/AsmPrinter/ lib/Target/XCore/ test/CodeGen/X86/ In-Reply-To: <200903250147.n2P1lUov003682@zion.cs.uiuc.edu> References: <200903250147.n2P1lUov003682@zion.cs.uiuc.edu> Message-ID: On Mar 24, 2009, at 6:47 PM, Evan Cheng wrote: > Author: evancheng > Date: Tue Mar 24 20:47:28 2009 > New Revision: 67668 > > URL: http://llvm.org/viewvc/llvm-project?rev=67668&view=rev > Log: > CodeGen still defaults to non-verbose asm, but llc now overrides it > and default to verbose. Nice, thanks Evan. -Chris From dpatel at apple.com Tue Mar 24 22:52:12 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 25 Mar 2009 03:52:12 -0000 Subject: [llvm-commits] [llvm] r67675 - /llvm/trunk/lib/Analysis/DebugInfo.cpp Message-ID: <200903250352.n2P3qDkD011488@zion.cs.uiuc.edu> Author: dpatel Date: Tue Mar 24 22:52:06 2009 New Revision: 67675 URL: http://llvm.org/viewvc/llvm-project?rev=67675&view=rev Log: Do not ignore DW_TAG_class_type! Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=67675&r1=67674&r2=67675&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Mar 24 22:52:06 2009 @@ -150,6 +150,7 @@ case dwarf::DW_TAG_enumeration_type: case dwarf::DW_TAG_vector_type: case dwarf::DW_TAG_subroutine_type: + case dwarf::DW_TAG_class_type: return true; default: return false; From resistor at mac.com Wed Mar 25 00:16:53 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 24 Mar 2009 22:16:53 -0700 Subject: [llvm-commits] CVS: llvm-www/pubs/2009-03-CGO-ESoftCheck.html In-Reply-To: <200903250213.n2P2Dcl2005402@zion.cs.uiuc.edu> References: <200903250213.n2P2Dcl2005402@zion.cs.uiuc.edu> Message-ID: <14E261A1-771F-46DE-BC7E-168BD289C61C@mac.com> Sorry, that's what happens when I'm sleepy and start from a template. :-) --Owen On Mar 24, 2009, at 7:13 PM, Chris Lattner wrote: > > > Changes in directory llvm-www/pubs: > > 2009-03-CGO-ESoftCheck.html updated: 1.1 -> 1.2 > --- > Log message: > > remove unrelated person. > > > --- > Diffs of the changes: (+0 -1) > > 2009-03-CGO-ESoftCheck.html | 1 - > 1 files changed, 1 deletion(-) > > > Index: llvm-www/pubs/2009-03-CGO-ESoftCheck.html > diff -u llvm-www/pubs/2009-03-CGO-ESoftCheck.html:1.1 llvm-www/pubs/ > 2009-03-CGO-ESoftCheck.html:1.2 > --- llvm-www/pubs/2009-03-CGO-ESoftCheck.html:1.1 Tue Mar 24 > 19:16:23 2009 > +++ llvm-www/pubs/2009-03-CGO-ESoftCheck.html Tue Mar 24 21:12:30 2009 > @@ -14,7 +14,6 @@ > Jing Yu, > Maria Jesus Garzaran, > Marc Snir > - Vikram Adve > > >

    Abstract:

    > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Wed Mar 25 00:52:28 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 25 Mar 2009 00:52:28 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-09-ASE-FrameAxioms.html 2008-09-ASE-FrameAxioms.pdf pubs.js Message-ID: <200903250552.n2P5qSCZ018172@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-09-ASE-FrameAxioms.html added (r1.1) 2008-09-ASE-FrameAxioms.pdf added (r1.1) pubs.js updated: 1.10 -> 1.11 --- Log message: add a paper. --- Diffs of the changes: (+55 -0) 2008-09-ASE-FrameAxioms.html | 47 +++++++++++++++++++++++++++++++++++++++++++ 2008-09-ASE-FrameAxioms.pdf | 0 pubs.js | 8 +++++++ 3 files changed, 55 insertions(+) Index: llvm-www/pubs/2008-09-ASE-FrameAxioms.html diff -c /dev/null llvm-www/pubs/2008-09-ASE-FrameAxioms.html:1.1 *** /dev/null Wed Mar 25 00:49:41 2009 --- llvm-www/pubs/2008-09-ASE-FrameAxioms.html Wed Mar 25 00:49:31 2009 *************** *** 0 **** --- 1,47 ---- + + + + + + Automatic Inference of Frame Axioms Using Static Analysis + + + +
    + Automatic Inference of Frame Axioms Using Static Analysis +
    +
    + Zvonimir Rakamaric and Alan J. Hu +
    + +

    Abstract:

    +
    + + Many approaches to software verification are currently + semi-automatic: a human must provide key logical insights + ??? e.g., loop invariants, class invariants, and frame axioms + that limit the scope of changes that must be analyzed. + This paper describes a technique for automatically inferring frame + axioms of procedures and loops using static + analysis. The technique builds on a pointer analysis + that generates limited information about all data structures + in the heap. Our technique uses that information + to over-approximate a potentially unbounded set of memory + locations modified by each procedure/loop; this over-approximation + is a candidate frame axiom. + We have tested this approach on the buffer-over???ow + benchmarks from ASE 2007. With manually provided specifications + and invariants/axioms, our tool could verify/falsify + 226 of the 289 benchmarks. With our automatically inferred + frame axioms, the tool could verify/falsify 203 of the 289, + demonstrating the effectiveness of our approach. + +
    + +

    Download:

    + + + + Index: llvm-www/pubs/2008-09-ASE-FrameAxioms.pdf Index: llvm-www/pubs/pubs.js diff -u llvm-www/pubs/pubs.js:1.10 llvm-www/pubs/pubs.js:1.11 --- llvm-www/pubs/pubs.js:1.10 Tue Mar 24 19:22:00 2009 +++ llvm-www/pubs/pubs.js Wed Mar 25 00:49:31 2009 @@ -52,6 +52,14 @@ month: 10, year: 2008}, + {url: '2008-09-ASE-FrameAxioms.html', + title: 'Automatic Inference of Frame Axioms Using Static Analysis', + author: 'Zvonimir Rakamaric and Alan J. Hu', + published: '23rd IEEE/ACM International Conference on Automated Software Engineering (ASE 2008)', + month: 9, + year: 2008, + location: "L'Aquila, Italy"}, + {url: '2008-09-LadyVM.html', title: 'A Lazy Developer Approach: Building a JVM with Third Party Software', author: 'Nicolas Geoffray, Gael Thomas, Charles Clement and Bertil Folliot', From sabre at nondot.org Wed Mar 25 00:58:18 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 25 Mar 2009 00:58:18 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2009-01-VMCAI-ScalableMemoryModel.html 2009-01-VMCAI-ScalableMemoryModel.pdf pubs.js Message-ID: <200903250558.n2P5wIUn018536@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2009-01-VMCAI-ScalableMemoryModel.html added (r1.1) 2009-01-VMCAI-ScalableMemoryModel.pdf added (r1.1) pubs.js updated: 1.11 -> 1.12 --- Log message: add another paper. --- Diffs of the changes: (+58 -0) 2009-01-VMCAI-ScalableMemoryModel.html | 50 +++++++++++++++++++++++++++++++++ 2009-01-VMCAI-ScalableMemoryModel.pdf | 0 pubs.js | 8 +++++ 3 files changed, 58 insertions(+) Index: llvm-www/pubs/2009-01-VMCAI-ScalableMemoryModel.html diff -c /dev/null llvm-www/pubs/2009-01-VMCAI-ScalableMemoryModel.html:1.1 *** /dev/null Wed Mar 25 00:58:02 2009 --- llvm-www/pubs/2009-01-VMCAI-ScalableMemoryModel.html Wed Mar 25 00:57:51 2009 *************** *** 0 **** --- 1,50 ---- + + + + + + A Scalable Memory Model for Low-Level Code + + + +
    + A Scalable Memory Model for Low-Level Code +
    +
    + Zvonimir Rakamaric and Alan J. Hu +
    + +

    Abstract:

    +
    + Because of its critical importance underlying all other software, low-level + system software is among the most important targets for formal verification. + Low-level systems software must sometimes make type-unsafe memory accesses, + but because of the vast size of available heap memory in today's computer systems, + faithfully representing each memory allocation and access does not scale + when analyzing large programs. Instead, verification tools rely on abstract memory + models to represent the program heap. This paper reports on two related + investigations to develop an accurate (i.e., providing a useful level of soundness + and precision) and scalable memory model: First, we compare a recently introduced + memory model, specifically designed to more accurately model low-level + memory accesses in systems code, to an older, widely adopted memory model. + Unfortunately, we find that the newer memory model scales poorly compared to + the earlier, less accurate model. Next, we investigate how to improve the + soundness of the less accurate model. A direct approach is to add assertions to the code + that each memory access does not break the assumptions of the memory model, + but this causes verification complexity to blow-up. Instead, we develop a novel, + extremely lightweight static analysis that quickly and conservatively guarantees + that most memory accesses safely respect the assumptions of the memory model, + thereby eliminating almost all of these extra type-checking assertions. Furthermore, + this analysis allows us to create automatically memory models that flexibly + use the more scalable memory model for most of memory, but resorting to a more + accurate model for memory accesses that might need it. +
    + +

    Download:

    + + + + Index: llvm-www/pubs/2009-01-VMCAI-ScalableMemoryModel.pdf Index: llvm-www/pubs/pubs.js diff -u llvm-www/pubs/pubs.js:1.11 llvm-www/pubs/pubs.js:1.12 --- llvm-www/pubs/pubs.js:1.11 Wed Mar 25 00:49:31 2009 +++ llvm-www/pubs/pubs.js Wed Mar 25 00:57:52 2009 @@ -14,6 +14,14 @@ month: 3, year: 2009}, + {url: '2009-01-VMCAI-ScalableMemoryModel.html', + title: 'A Scalable Memory Model for Low-Level Code', + author: 'Zvonimir Rakamaric and Alan J. Hu', + published: 'Proceedings of the 10th International Conference on Verification, Model Checking and Abstract Interpretation (VMCAI 2009)', + location: 'Savannah, GA, USA', + month: 1, + year: 2009}, + {url: '2009-01-ASP-DAC-Automatic_Instrumentation.html', title: 'Automatic Instrumentation of Embedded Software for High Level Hardware/Software Co-Simulation', author: 'Aimen Bouchhima, Patrice Gerin, Frederic Petrot', From ggreif at gmail.com Wed Mar 25 01:32:59 2009 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 25 Mar 2009 06:32:59 -0000 Subject: [llvm-commits] [llvm] r67681 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <200903250632.n2P6Wx8u020354@zion.cs.uiuc.edu> Author: ggreif Date: Wed Mar 25 01:32:59 2009 New Revision: 67681 URL: http://llvm.org/viewvc/llvm-project?rev=67681&view=rev Log: do not rely on callee being operand 0 Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=67681&r1=67680&r2=67681&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Wed Mar 25 01:32:59 2009 @@ -1366,7 +1366,7 @@ } case Instruction::Call:{ const CallInst* call = cast(I); - if (InlineAsm* ila = dyn_cast(call->getOperand(0))) { + if (const InlineAsm* ila = dyn_cast(call->getCalledValue())) { Out << "InlineAsm* " << getCppName(ila) << " = InlineAsm::get(" << getCppName(ila->getFunctionType()) << ", \"" << ila->getAsmString() << "\", \"" From sabre at nondot.org Wed Mar 25 01:36:36 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 25 Mar 2009 06:36:36 -0000 Subject: [llvm-commits] [llvm] r67682 - in /llvm/trunk: lib/AsmParser/LLParser.cpp test/Assembler/2009-03-24-ZextConstantExpr.ll Message-ID: <200903250636.n2P6aaPR020546@zion.cs.uiuc.edu> Author: lattner Date: Wed Mar 25 01:36:36 2009 New Revision: 67682 URL: http://llvm.org/viewvc/llvm-project?rev=67682&view=rev Log: Fix a bug in our autoupgrade support: in an argument list to a function call, we should treat "i64 zext" as the start of a constant expr, but "i64 0 zext" as an argument with an obsolete attribute on it (this form is already tested by test/Assembler/2007-07-30-AutoUpgradeZextSext.ll). Make the autoupgrade logic more discerning to avoid treating "i64 zext" as an old-style attribute, causing us to reject a valid constant expr. This fixes PR3876. Added: llvm/trunk/test/Assembler/2009-03-24-ZextConstantExpr.ll Modified: llvm/trunk/lib/AsmParser/LLParser.cpp Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=67682&r1=67681&r2=67682&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Mar 25 01:36:36 2009 @@ -678,6 +678,7 @@ /// ParseOptionalAttrs - Parse a potentially empty attribute list. AttrKind /// indicates what kind of attribute list this is: 0: function arg, 1: result, /// 2: function attr. +/// 3: function arg after value: FIXME: REMOVE IN LLVM 3.0 bool LLParser::ParseOptionalAttrs(unsigned &Attrs, unsigned AttrKind) { Attrs = Attribute::None; LocTy AttrLoc = Lex.getLoc(); @@ -686,9 +687,12 @@ switch (Lex.getKind()) { case lltok::kw_sext: case lltok::kw_zext: - // Treat these as signext/zeroext unless they are function attrs. + // Treat these as signext/zeroext if they occur in the argument list after + // the value, as in "call i8 @foo(i8 10 sext)". If they occur before the + // value, as in "call i8 @foo(i8 sext (" then it is part of a constant + // expr. // FIXME: REMOVE THIS IN LLVM 3.0 - if (AttrKind != 2) { + if (AttrKind == 3) { if (Lex.getKind() == lltok::kw_sext) Attrs |= Attribute::SExt; else @@ -700,7 +704,7 @@ if (AttrKind != 2 && (Attrs & Attribute::FunctionOnly)) return Error(AttrLoc, "invalid use of function-only attribute"); - if (AttrKind != 0 && (Attrs & Attribute::ParameterOnly)) + if (AttrKind != 0 && AttrKind != 3 && (Attrs & Attribute::ParameterOnly)) return Error(AttrLoc, "invalid use of parameter-only attribute"); return false; @@ -1085,7 +1089,7 @@ ParseValue(ArgTy, V, PFS) || // FIXME: Should not allow attributes after the argument, remove this in // LLVM 3.0. - ParseOptionalAttrs(ArgAttrs2, 0)) + ParseOptionalAttrs(ArgAttrs2, 3)) return true; ArgList.push_back(ParamInfo(ArgLoc, V, ArgAttrs1|ArgAttrs2)); } Added: llvm/trunk/test/Assembler/2009-03-24-ZextConstantExpr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2009-03-24-ZextConstantExpr.ll?rev=67682&view=auto ============================================================================== --- llvm/trunk/test/Assembler/2009-03-24-ZextConstantExpr.ll (added) +++ llvm/trunk/test/Assembler/2009-03-24-ZextConstantExpr.ll Wed Mar 25 01:36:36 2009 @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llvm-dis +; PR3876 + at gdtr = external global [0 x i8] + +define void @test() { + call zeroext i1 @paging_map(i64 zext (i32 and (i32 ptrtoint ([0 x i8]* @gdtr to i32), i32 -4096) to i64)) + ret void +} + +declare zeroext i1 @paging_map(i64) + From baldrick at free.fr Wed Mar 25 03:06:22 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 25 Mar 2009 09:06:22 +0100 Subject: [llvm-commits] [llvm] r67638 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/ptr-int-cast.ll In-Reply-To: <42234B0D-EFB5-4442-AEB0-E1DCBE83611A@nondot.org> References: <200903241835.n2OIZeK5011881@zion.cs.uiuc.edu> <200903242219.02394.baldrick@free.fr> <42234B0D-EFB5-4442-AEB0-E1DCBE83611A@nondot.org> Message-ID: <200903250906.22897.baldrick@free.fr> > > you forgot to do something with %t! > > I grep them later in the file? So you do! Not sure how I missed that, sorry for the noise. Ciao, Duncan. From Sanjiv.Gupta at microchip.com Wed Mar 25 08:46:14 2009 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Wed, 25 Mar 2009 06:46:14 -0700 Subject: [llvm-commits] DAGCombiner Patch: Allow targets to do combinefirst. In-Reply-To: <28167C61-6F2F-470D-A5FC-ACBA8EC222EC@apple.com> References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu><49C7BDD8.1070301@mxc.ca> <200903240714.15380.baldrick@free.fr> <28167C61-6F2F-470D-A5FC-ACBA8EC222EC@apple.com> Message-ID: > > > The DAGCombiner::combine() in its existing form does not allow > > targets to do anything if the visitNODE() has done something with it. > > IMO, the targets should always be allowed to do stuff irrespective > > of what we want to do in visitNODE(). > > DAGCombine is iterative; I believe the target hook will be called > after DAGCombine is done hacking with it. I guess what your patch does > is add a hook to let the target intervene before DAGCombine runs. One > of the main purposes of the first DAGCombine runs is to clean up and > canonicalize the mess that SelectionDAGLowering emits so that the rest > of CodeGen doesn't have to deal with it. Consequently, it's not clear > why it would be useful to give targets a hook to step into the mess, > in general. Sometimes a target knows better that a few things in this mess are really unwanted for it; so it can pitch in early and take care of the cleaning process rather than just wait for the combine to make its job more difficult. To be specific, in our case the caller directly saves the arguments on callee's stack and hence those extra stores generated by clang to store the argvals to callee's frame indices are unwanted. I mentioned the problem in case you might get some better ideas to solve the problem. If you didn't like this idea of moving the call to an early place, then we can probably think of another hook called PerfromDAGPreCombine() that pitches in earlier than visitNODE(). > And in the specific case that's motivating this, it seems > that trying to fix this problem by selectively disabling optimizations > seems to be swimming upstream. > I agree that this is probably a better way to solve the problem. That functionality will anyway be required because there might be few other cases in which one may need to do that. I will probably keep a bitmask that a TLI hook can use to set the switches ON/OFF. > > Attached is a patch for same. Let me know if it sounds ok. I will go > > ahead and commit it. > > Please send normal attachments. winmail.dat seems to be some > Outlook-specific thing. > I didn't how this .dat thing got into it. I was on Linux when I attached a .txt patch. > LLVM's CodeGen is designed for register architectures. When it > is used to target stack architectures, the preferred approach > seems to be to do instruction selection as if the target had > registers and instructions that operate on registers, and then > to lower everything to stack operations in a later phase. We do not even maintain a run-time stack. The current model (statically assigned stack) works well for us where we have defined only one register. The regalloc knows it and generates spilling/reloading accordingly. Did you mean that we have a separate regclass posing mem bytes as regs and lower things after regalloc is done? We do not even have membyte to membyte copy insn. Well, TBH, I did not quite understand it. - Sanjiv From brukman at gmail.com Wed Mar 25 09:23:41 2009 From: brukman at gmail.com (Misha Brukman) Date: Wed, 25 Mar 2009 10:23:41 -0400 Subject: [llvm-commits] [llvm] r67635 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/shift.ll In-Reply-To: <2C492F79-4216-4CA5-B8C9-A12A3022B9BA@apple.com> References: <200903241815.n2OIFUD7010832@zion.cs.uiuc.edu> <2C492F79-4216-4CA5-B8C9-A12A3022B9BA@apple.com> Message-ID: On Tue, Mar 24, 2009 at 10:09 PM, Chris Lattner wrote: > On Mar 24, 2009, at 2:45 PM, Misha Brukman wrote: > > On Tue, Mar 24, 2009 at 2:15 PM, Chris Lattner wrote: > >> >> ============================================================================== >> --- llvm/trunk/test/Transforms/InstCombine/shift.ll (original) >> +++ llvm/trunk/test/Transforms/InstCombine/shift.ll Tue Mar 24 13:15:30 >> 2009 >> @@ -206,4 +206,11 @@ >> %D = shl i32 %C, 1 ; [#uses=1] >> ret i32 %D >> } >> + >> + >> +define i1 @test27(i32 %x) nounwind { >> + %y = lshr i32 %x, 3 >> + %z = trunc i32 %y to i1 >> + ret i1 %z >> +} > > > This would work great as a unittest. Just sayin'. > > Why would it be better as a unit test? > shift.ll has this RUN line: ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh which means that all -instcombine needs to do is to delete any shift-related instructions and it would still pass. This test is not checking that -instcombine is replacing each shift instruction with the proper sequence of instructions, which you cannot do with grep. Also, to test this .ll file, it requires loading and running 5 executables (llvm-{as,dis}, opt, grep, and bash for "not"), and parsing/unparsing LLVM assembly and bytecode, the latter of which are orthogonal to the thing being tested, but still take time. The test suite then does this over and over for each .ll file being tested. To improve the test you *could* replace the "not grep sh" with a diff to a "golden file" that has all the expected code sequences, but I would argue that we can make the tests run faster by avoiding all the extra binary invocations (and in the latter case, also writing to a file on disk and calling diff on the two) and just write a unittest instead. Misha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090325/eaa93f9d/attachment.html From evan.cheng at apple.com Wed Mar 25 11:29:38 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 16:29:38 -0000 Subject: [llvm-commits] [llvm] r67688 - /llvm/trunk/test/FrontendC/object_size.c Message-ID: <200903251629.n2PGTcu1002117@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 11:29:33 2009 New Revision: 67688 URL: http://llvm.org/viewvc/llvm-project?rev=67688&view=rev Log: Add a __builtin_object_size test. Added: llvm/trunk/test/FrontendC/object_size.c Added: llvm/trunk/test/FrontendC/object_size.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/object_size.c?rev=67688&view=auto ============================================================================== --- llvm/trunk/test/FrontendC/object_size.c (added) +++ llvm/trunk/test/FrontendC/object_size.c Wed Mar 25 11:29:33 2009 @@ -0,0 +1,16 @@ +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep ret | grep {\\-1} | count 1 +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep ret | grep {0} | count 1 +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep ret | grep {8} | count 1 + +unsigned t1(void *d) { + return __builtin_object_size(d, 0); +} + +unsigned t2(void *d) { + return __builtin_object_size(d, 2); +} + +char buf[8]; +unsigned t3() { + return __builtin_object_size(buf, 0); +} From baldrick at free.fr Wed Mar 25 11:44:05 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 25 Mar 2009 16:44:05 -0000 Subject: [llvm-commits] [llvm] r67689 - in /llvm/trunk/test: FrontendC++/2009-03-17-dbg.cpp FrontendC/2009-03-09-WeakDeclarations-1.c FrontendC/2009-03-13-dbg.c Message-ID: <200903251644.n2PGi6Lh003044@zion.cs.uiuc.edu> Author: baldrick Date: Wed Mar 25 11:43:59 2009 New Revision: 67689 URL: http://llvm.org/viewvc/llvm-project?rev=67689&view=rev Log: These tests pass on linux. Modified: llvm/trunk/test/FrontendC++/2009-03-17-dbg.cpp llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c llvm/trunk/test/FrontendC/2009-03-13-dbg.c Modified: llvm/trunk/test/FrontendC++/2009-03-17-dbg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-03-17-dbg.cpp?rev=67689&r1=67688&r2=67689&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2009-03-17-dbg.cpp (original) +++ llvm/trunk/test/FrontendC++/2009-03-17-dbg.cpp Wed Mar 25 11:43:59 2009 @@ -1,5 +1,5 @@ // RUN: %llvmgxx -c -emit-llvm %s -o /dev/null -g -// XTARGET: darwin +// XTARGET: darwin,linux // XFAIL: * template inline void f(const T1&,const T2&) { } Modified: llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c?rev=67689&r1=67688&r2=67689&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c (original) +++ llvm/trunk/test/FrontendC/2009-03-09-WeakDeclarations-1.c Wed Mar 25 11:43:59 2009 @@ -1,7 +1,7 @@ // RUN: $llvmgcc $test -c -o /dev/null |& \ // RUN: egrep {(14|15|22): warning:} | \ // RUN: wc -l | grep --quiet 3 -// XTARGET: darwin +// XTARGET: darwin,linux // XFAIL: * // END. // Insist upon warnings for inappropriate weak attributes. Modified: llvm/trunk/test/FrontendC/2009-03-13-dbg.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2009-03-13-dbg.c?rev=67689&r1=67688&r2=67689&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2009-03-13-dbg.c (original) +++ llvm/trunk/test/FrontendC/2009-03-13-dbg.c Wed Mar 25 11:43:59 2009 @@ -1,5 +1,5 @@ // RUN: %llvmgcc %s -c -g -o /dev/null -// XTARGET: darwin +// XTARGET: darwin,linux // XFAIL: * void foo() {} From evan.cheng at apple.com Wed Mar 25 11:48:43 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 16:48:43 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67690 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <200903251648.n2PGmh0u003313@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 11:48:43 2009 New Revision: 67690 URL: http://llvm.org/viewvc/llvm-project?rev=67690&view=rev Log: Lower object size checking variants of string builtins (e.g. __builtin_memcpy_chk) into plain vanilla ones if the object size is -1 (unknown) or is known to be larger than the copy/move/set length. Warn if the call is known to overflow. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=67690&r1=67689&r2=67690&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Mar 25 11:48:43 2009 @@ -4410,8 +4410,9 @@ AttrListPtr()); return true; } - - switch (DECL_FUNCTION_CODE(fndecl)) { + + enum built_in_function fcode = DECL_FUNCTION_CODE(fndecl); + switch (fcode) { default: return false; // Varargs builtins. case BUILT_IN_VA_START: @@ -4422,9 +4423,16 @@ case BUILT_IN_ALLOCA: return EmitBuiltinAlloca(exp, Result); case BUILT_IN_EXTEND_POINTER: return EmitBuiltinExtendPointer(exp, Result); case BUILT_IN_EXPECT: return EmitBuiltinExpect(exp, DestLoc, Result); - case BUILT_IN_MEMCPY: return EmitBuiltinMemCopy(exp, Result, false); - case BUILT_IN_MEMMOVE: return EmitBuiltinMemCopy(exp, Result, true); - case BUILT_IN_MEMSET: return EmitBuiltinMemSet(exp, Result); + case BUILT_IN_MEMCPY: return EmitBuiltinMemCopy(exp, Result, + false, false); + case BUILT_IN_MEMCPY_CHK: return EmitBuiltinMemCopy(exp, Result, + false, true); + case BUILT_IN_MEMMOVE: return EmitBuiltinMemCopy(exp, Result, + true, false); + case BUILT_IN_MEMMOVE_CHK: return EmitBuiltinMemCopy(exp, Result, + true, true); + case BUILT_IN_MEMSET: return EmitBuiltinMemSet(exp, Result, false); + case BUILT_IN_MEMSET_CHK: return EmitBuiltinMemSet(exp, Result, true); case BUILT_IN_BZERO: return EmitBuiltinBZero(exp, Result); case BUILT_IN_PREFETCH: return EmitBuiltinPrefetch(exp); case BUILT_IN_FRAME_ADDRESS: return EmitBuiltinReturnAddr(exp, Result,true); @@ -5100,13 +5108,46 @@ return true; } +/// OptimizeIntoPlainBuiltIn - Return true if it's safe to lower the object +/// size checking builtin calls (e.g. __builtin___memcpy_chk into the +/// plain non-checking calls. If the size of the argument is either -1 (unknown) +/// or large enough to ensure no overflow (> len), then it's safe to do so. +static bool OptimizeIntoPlainBuiltIn(tree exp, Value *Len, Value *Size) { + if (BitCastInst *BC = dyn_cast(Size)) + Size = BC->getOperand(0); + ConstantInt *SizeCI = dyn_cast(Size); + if (!SizeCI) + return false; + if (SizeCI->isAllOnesValue()) + // If size is -1, convert to plain memcpy, etc. + return true; + + ConstantInt *LenCI = dyn_cast(Len); + if (!LenCI) + return false; + if (LenCI->getZExtValue() >= SizeCI->getZExtValue()) { + location_t locus = EXPR_LOCATION(exp); + warning (0, "%Hcall to %D will always overflow destination buffer", + &locus, get_callee_fndecl(exp)); + return false; + } + return true; +} + /// EmitBuiltinMemCopy - Emit an llvm.memcpy or llvm.memmove intrinsic, /// depending on the value of isMemMove. -bool TreeToLLVM::EmitBuiltinMemCopy(tree exp, Value *&Result, bool isMemMove) { +bool TreeToLLVM::EmitBuiltinMemCopy(tree exp, Value *&Result, bool isMemMove, + bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); - if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, - INTEGER_TYPE, VOID_TYPE)) - return false; + if (SizeCheck) { + if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, + INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return false; + } else { + if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, + INTEGER_TYPE, VOID_TYPE)) + return false; + } tree Dst = TREE_VALUE(arglist); tree Src = TREE_VALUE(TREE_CHAIN(arglist)); @@ -5116,6 +5157,13 @@ Value *DstV = Emit(Dst, 0); Value *SrcV = Emit(Src, 0); Value *Len = Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0); + if (SizeCheck) { + tree SizeArg = TREE_VALUE(TREE_CHAIN(TREE_CHAIN(TREE_CHAIN(arglist)))); + Value *Size = Emit(SizeArg, 0); + if (!OptimizeIntoPlainBuiltIn(exp, Len, Size)) + return false; + } + if (isMemMove) EmitMemMove(DstV, SrcV, Len, std::min(SrcAlign, DstAlign)); else @@ -5124,7 +5172,7 @@ return true; } -bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result) { +bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result, bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -5136,6 +5184,12 @@ Value *DstV = Emit(Dst, 0); Value *Val = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); Value *Len = Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0); + if (SizeCheck) { + tree SizeArg = TREE_VALUE(TREE_CHAIN(TREE_CHAIN(TREE_CHAIN(arglist)))); + Value *Size = Emit(SizeArg, 0); + if (!OptimizeIntoPlainBuiltIn(exp, Len, Size)) + return false; + } EmitMemSet(DstV, Val, Len, DstAlign); Result = DstV; return true; Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=67690&r1=67689&r2=67690&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Wed Mar 25 11:48:43 2009 @@ -547,8 +547,9 @@ bool EmitBuiltinVAStart(tree_node *exp); bool EmitBuiltinVAEnd(tree_node *exp); bool EmitBuiltinVACopy(tree_node *exp); - bool EmitBuiltinMemCopy(tree_node *exp, Value *&Result, bool isMemMove); - bool EmitBuiltinMemSet(tree_node *exp, Value *&Result); + bool EmitBuiltinMemCopy(tree_node *exp, Value *&Result, + bool isMemMove, bool SizeCheck); + bool EmitBuiltinMemSet(tree_node *exp, Value *&Result, bool SizeCheck); bool EmitBuiltinBZero(tree_node *exp, Value *&Result); bool EmitBuiltinPrefetch(tree_node *exp); bool EmitBuiltinReturnAddr(tree_node *exp, Value *&Result, bool isFrame); From evan.cheng at apple.com Wed Mar 25 11:49:32 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 16:49:32 -0000 Subject: [llvm-commits] [llvm] r67691 - /llvm/trunk/test/FrontendC/memcpy_chk.c Message-ID: <200903251649.n2PGnWDY003384@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 11:49:31 2009 New Revision: 67691 URL: http://llvm.org/viewvc/llvm-project?rev=67691&view=rev Log: Add __builtin___memcpy_chk tests. Added: llvm/trunk/test/FrontendC/memcpy_chk.c Added: llvm/trunk/test/FrontendC/memcpy_chk.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/memcpy_chk.c?rev=67691&view=auto ============================================================================== --- llvm/trunk/test/FrontendC/memcpy_chk.c (added) +++ llvm/trunk/test/FrontendC/memcpy_chk.c Wed Mar 25 11:49:31 2009 @@ -0,0 +1,23 @@ +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep memcpy_chk | count 3 +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep {llvm.memcpy} | count 2 + +void *t1(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, 0); +} + +void *t2(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, 10); +} + +void *t3(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, 17); +} + +void *t4(void *d, void *s, unsigned len) { + return __builtin___memcpy_chk(d, s, len, 17); +} + +char buf[10]; +void *t5(void *s, unsigned len) { + return __builtin___memcpy_chk(buf, s, 5, __builtin_object_size(buf, 0)); +} From baldrick at free.fr Wed Mar 25 12:13:15 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 25 Mar 2009 18:13:15 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r67690 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h In-Reply-To: <200903251648.n2PGmh0u003313@zion.cs.uiuc.edu> References: <200903251648.n2PGmh0u003313@zion.cs.uiuc.edu> Message-ID: <200903251813.16199.baldrick@free.fr> Hi Evan, > + if (BitCastInst *BC = dyn_cast(Size)) > + Size = BC->getOperand(0); why would this ever be a bitcast? > + ConstantInt *LenCI = dyn_cast(Len); > + if (!LenCI) > + return false; If Size can be a bitcast, why not Len? > + if (LenCI->getZExtValue() >= SizeCI->getZExtValue()) { This will blow up if Len or Size doesn't fit in 64 bits. Of course real code will never have such big values, but that's no reason ignore this possibility. Ciao, Duncan. From asl at math.spbu.ru Wed Mar 25 12:29:41 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 25 Mar 2009 12:29:41 -0500 Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html Message-ID: <200903251729.n2PHTfTE005988@zion.cs.uiuc.edu> Changes in directory llvm-www: OpenProjects.html updated: 1.49 -> 1.50 --- Log message: Another crazy idea :) --- Diffs of the changes: (+2 -1) OpenProjects.html | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.49 llvm-www/OpenProjects.html:1.50 --- llvm-www/OpenProjects.html:1.49 Sat Mar 21 04:05:46 2009 +++ llvm-www/OpenProjects.html Wed Mar 25 12:27:33 2009 @@ -492,6 +492,7 @@ mudflap does for gcc compiled code. +
  • Write LLVM IR level debugger (extend Interpreter?)
  • @@ -506,7 +507,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2009/03/21 09:05:46 $ + Last modified: $Date: 2009/03/25 17:27:33 $ From dalej at apple.com Wed Mar 25 12:36:08 2009 From: dalej at apple.com (Dale Johannesen) Date: Wed, 25 Mar 2009 17:36:08 -0000 Subject: [llvm-commits] [llvm] r67692 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200903251736.n2PHa9l0006677@zion.cs.uiuc.edu> Author: johannes Date: Wed Mar 25 12:36:08 2009 New Revision: 67692 URL: http://llvm.org/viewvc/llvm-project?rev=67692&view=rev Log: When optimizing with debug info, don't keep the stoppoint nodes around until Legalize; doing this imposed an ordering on a sequence of loads that came from different lines, interfering with scheduling. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67692&r1=67691&r2=67692&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Wed Mar 25 12:36:08 2009 @@ -3895,10 +3895,11 @@ DbgStopPointInst &SPI = cast(I); if (DW && DW->ValidDebugInfo(SPI.getContext())) { MachineFunction &MF = DAG.getMachineFunction(); - DAG.setRoot(DAG.getDbgStopPoint(getRoot(), - SPI.getLine(), - SPI.getColumn(), - SPI.getContext())); + if (Fast) + DAG.setRoot(DAG.getDbgStopPoint(getRoot(), + SPI.getLine(), + SPI.getColumn(), + SPI.getContext())); DICompileUnit CU(cast(SPI.getContext())); std::string Dir, FN; unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir), From echeng at apple.com Wed Mar 25 12:42:24 2009 From: echeng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 10:42:24 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r67690 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h In-Reply-To: <200903251813.16199.baldrick@free.fr> References: <200903251648.n2PGmh0u003313@zion.cs.uiuc.edu> <200903251813.16199.baldrick@free.fr> Message-ID: On Mar 25, 2009, at 10:13 AM, Duncan Sands wrote: > Hi Evan, > >> + if (BitCastInst *BC = dyn_cast(Size)) >> + Size = BC->getOperand(0); > > why would this ever be a bitcast? This code in llvm-convert.cpp: Value *RHS = Emit(rhs, 0); const Type *LHSTy = ConvertType(TREE_TYPE(lhs)); // The value may need to be replaced later if this temporary is multiply // defined - ensure it can be uniquely identified by not folding the cast. Instruction::CastOps opc = CastInst::getCastOpcode(RHS, RHSSigned, LHSTy, LHSSigned); CastInst *Cast = CastInst::Create(opc, RHS, LHSTy, RHS- >getNameStart()); This emits a noop bitcast: %1 = bitcast i32 -1 to i32 I'll fix the rest. Evan > >> + ConstantInt *LenCI = dyn_cast(Len); >> + if (!LenCI) >> + return false; > > If Size can be a bitcast, why not Len? > >> + if (LenCI->getZExtValue() >= SizeCI->getZExtValue()) { > > This will blow up if Len or Size doesn't fit in 64 bits. > Of course real code will never have such big values, but > that's no reason ignore this possibility. > > Ciao, > > Duncan. From evan.cheng at apple.com Wed Mar 25 12:44:20 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 17:44:20 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67693 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200903251744.n2PHiK21007214@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 12:44:20 2009 New Revision: 67693 URL: http://llvm.org/viewvc/llvm-project?rev=67693&view=rev Log: Update per feedback. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=67693&r1=67692&r2=67693&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Mar 25 12:44:20 2009 @@ -5113,8 +5113,8 @@ /// plain non-checking calls. If the size of the argument is either -1 (unknown) /// or large enough to ensure no overflow (> len), then it's safe to do so. static bool OptimizeIntoPlainBuiltIn(tree exp, Value *Len, Value *Size) { - if (BitCastInst *BC = dyn_cast(Size)) - Size = BC->getOperand(0); + if (BitCastInst *SizeBC = dyn_cast(Size)) + Size = SizeBC->getOperand(0); ConstantInt *SizeCI = dyn_cast(Size); if (!SizeCI) return false; @@ -5122,10 +5122,12 @@ // If size is -1, convert to plain memcpy, etc. return true; + if (BitCastInst *LenBC = dyn_cast(Len)) + Len = LenBC->getOperand(0); ConstantInt *LenCI = dyn_cast(Len); if (!LenCI) return false; - if (LenCI->getZExtValue() >= SizeCI->getZExtValue()) { + if (SizeCI->getValue().ult(LenCI->getValue())) { location_t locus = EXPR_LOCATION(exp); warning (0, "%Hcall to %D will always overflow destination buffer", &locus, get_callee_fndecl(exp)); From evan.cheng at apple.com Wed Mar 25 12:45:18 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 17:45:18 -0000 Subject: [llvm-commits] [llvm] r67694 - /llvm/trunk/test/FrontendC/memcpy_chk.c Message-ID: <200903251745.n2PHjIW8007291@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 12:45:18 2009 New Revision: 67694 URL: http://llvm.org/viewvc/llvm-project?rev=67694&view=rev Log: One more test. Modified: llvm/trunk/test/FrontendC/memcpy_chk.c Modified: llvm/trunk/test/FrontendC/memcpy_chk.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/memcpy_chk.c?rev=67694&r1=67693&r2=67694&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/memcpy_chk.c (original) +++ llvm/trunk/test/FrontendC/memcpy_chk.c Wed Mar 25 12:45:18 2009 @@ -1,5 +1,6 @@ // RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep memcpy_chk | count 3 -// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep {llvm.memcpy} | count 2 +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep {llvm.memcpy} | count 3 +// rdar://6716432 void *t1(void *d, void *s) { return __builtin___memcpy_chk(d, s, 16, 0); @@ -21,3 +22,7 @@ void *t5(void *s, unsigned len) { return __builtin___memcpy_chk(buf, s, 5, __builtin_object_size(buf, 0)); } + +void *t6(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, __builtin_object_size(d, 0)); +} From isanbard at gmail.com Wed Mar 25 13:28:29 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 18:28:29 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67698 - in /llvm-gcc-4.2/branches/Apple/Dib/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <200903251828.n2PISTTX010903@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 13:28:28 2009 New Revision: 67698 URL: http://llvm.org/viewvc/llvm-project?rev=67698&view=rev Log: --- Merging (from foreign repository) r67690 into '.': U gcc/llvm-convert.cpp U gcc/llvm-internal.h Lower object size checking variants of string builtins (e.g. __builtin_memcpy_chk) into plain vanilla ones if the object size is -1 (unknown) or is known to be larger than the copy/move/set length. Warn if the call is known to overflow. --- Merging (from foreign repository) r67693 into '.': G gcc/llvm-convert.cpp Update per feedback. Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-internal.h Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp?rev=67698&r1=67697&r2=67698&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Wed Mar 25 13:28:28 2009 @@ -4410,8 +4410,9 @@ AttrListPtr()); return true; } - - switch (DECL_FUNCTION_CODE(fndecl)) { + + enum built_in_function fcode = DECL_FUNCTION_CODE(fndecl); + switch (fcode) { default: return false; // Varargs builtins. case BUILT_IN_VA_START: @@ -4422,9 +4423,16 @@ case BUILT_IN_ALLOCA: return EmitBuiltinAlloca(exp, Result); case BUILT_IN_EXTEND_POINTER: return EmitBuiltinExtendPointer(exp, Result); case BUILT_IN_EXPECT: return EmitBuiltinExpect(exp, DestLoc, Result); - case BUILT_IN_MEMCPY: return EmitBuiltinMemCopy(exp, Result, false); - case BUILT_IN_MEMMOVE: return EmitBuiltinMemCopy(exp, Result, true); - case BUILT_IN_MEMSET: return EmitBuiltinMemSet(exp, Result); + case BUILT_IN_MEMCPY: return EmitBuiltinMemCopy(exp, Result, + false, false); + case BUILT_IN_MEMCPY_CHK: return EmitBuiltinMemCopy(exp, Result, + false, true); + case BUILT_IN_MEMMOVE: return EmitBuiltinMemCopy(exp, Result, + true, false); + case BUILT_IN_MEMMOVE_CHK: return EmitBuiltinMemCopy(exp, Result, + true, true); + case BUILT_IN_MEMSET: return EmitBuiltinMemSet(exp, Result, false); + case BUILT_IN_MEMSET_CHK: return EmitBuiltinMemSet(exp, Result, true); case BUILT_IN_BZERO: return EmitBuiltinBZero(exp, Result); case BUILT_IN_PREFETCH: return EmitBuiltinPrefetch(exp); case BUILT_IN_FRAME_ADDRESS: return EmitBuiltinReturnAddr(exp, Result,true); @@ -5100,13 +5108,48 @@ return true; } +/// OptimizeIntoPlainBuiltIn - Return true if it's safe to lower the object +/// size checking builtin calls (e.g. __builtin___memcpy_chk into the +/// plain non-checking calls. If the size of the argument is either -1 (unknown) +/// or large enough to ensure no overflow (> len), then it's safe to do so. +static bool OptimizeIntoPlainBuiltIn(tree exp, Value *Len, Value *Size) { + if (BitCastInst *SizeBC = dyn_cast(Size)) + Size = SizeBC->getOperand(0); + ConstantInt *SizeCI = dyn_cast(Size); + if (!SizeCI) + return false; + if (SizeCI->isAllOnesValue()) + // If size is -1, convert to plain memcpy, etc. + return true; + + if (BitCastInst *LenBC = dyn_cast(Len)) + Len = LenBC->getOperand(0); + ConstantInt *LenCI = dyn_cast(Len); + if (!LenCI) + return false; + if (SizeCI->getValue().ult(LenCI->getValue())) { + location_t locus = EXPR_LOCATION(exp); + warning (0, "%Hcall to %D will always overflow destination buffer", + &locus, get_callee_fndecl(exp)); + return false; + } + return true; +} + /// EmitBuiltinMemCopy - Emit an llvm.memcpy or llvm.memmove intrinsic, /// depending on the value of isMemMove. -bool TreeToLLVM::EmitBuiltinMemCopy(tree exp, Value *&Result, bool isMemMove) { +bool TreeToLLVM::EmitBuiltinMemCopy(tree exp, Value *&Result, bool isMemMove, + bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); - if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, - INTEGER_TYPE, VOID_TYPE)) - return false; + if (SizeCheck) { + if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, + INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return false; + } else { + if (!validate_arglist(arglist, POINTER_TYPE, POINTER_TYPE, + INTEGER_TYPE, VOID_TYPE)) + return false; + } tree Dst = TREE_VALUE(arglist); tree Src = TREE_VALUE(TREE_CHAIN(arglist)); @@ -5116,6 +5159,13 @@ Value *DstV = Emit(Dst, 0); Value *SrcV = Emit(Src, 0); Value *Len = Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0); + if (SizeCheck) { + tree SizeArg = TREE_VALUE(TREE_CHAIN(TREE_CHAIN(TREE_CHAIN(arglist)))); + Value *Size = Emit(SizeArg, 0); + if (!OptimizeIntoPlainBuiltIn(exp, Len, Size)) + return false; + } + if (isMemMove) EmitMemMove(DstV, SrcV, Len, std::min(SrcAlign, DstAlign)); else @@ -5124,7 +5174,7 @@ return true; } -bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result) { +bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result, bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -5136,6 +5186,12 @@ Value *DstV = Emit(Dst, 0); Value *Val = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); Value *Len = Emit(TREE_VALUE(TREE_CHAIN(TREE_CHAIN(arglist))), 0); + if (SizeCheck) { + tree SizeArg = TREE_VALUE(TREE_CHAIN(TREE_CHAIN(TREE_CHAIN(arglist)))); + Value *Size = Emit(SizeArg, 0); + if (!OptimizeIntoPlainBuiltIn(exp, Len, Size)) + return false; + } EmitMemSet(DstV, Val, Len, DstAlign); Result = DstV; return true; Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-internal.h?rev=67698&r1=67697&r2=67698&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-internal.h Wed Mar 25 13:28:28 2009 @@ -547,8 +547,9 @@ bool EmitBuiltinVAStart(tree_node *exp); bool EmitBuiltinVAEnd(tree_node *exp); bool EmitBuiltinVACopy(tree_node *exp); - bool EmitBuiltinMemCopy(tree_node *exp, Value *&Result, bool isMemMove); - bool EmitBuiltinMemSet(tree_node *exp, Value *&Result); + bool EmitBuiltinMemCopy(tree_node *exp, Value *&Result, + bool isMemMove, bool SizeCheck); + bool EmitBuiltinMemSet(tree_node *exp, Value *&Result, bool SizeCheck); bool EmitBuiltinBZero(tree_node *exp, Value *&Result); bool EmitBuiltinPrefetch(tree_node *exp); bool EmitBuiltinReturnAddr(tree_node *exp, Value *&Result, bool isFrame); From isanbard at gmail.com Wed Mar 25 13:30:16 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 18:30:16 -0000 Subject: [llvm-commits] [llvm] r67699 - /llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c Message-ID: <200903251830.n2PIUH4F011013@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 13:30:16 2009 New Revision: 67699 URL: http://llvm.org/viewvc/llvm-project?rev=67699&view=rev Log: --- Merging (from foreign repository) r67691 into '.': A test/FrontendC/memcpy_chk.c --- Merging (from foreign repository) r67694 into '.': U test/FrontendC/memcpy_chk.c Test cases. Added: llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c Added: llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c?rev=67699&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c (added) +++ llvm/branches/Apple/Dib/test/FrontendC/memcpy_chk.c Wed Mar 25 13:30:16 2009 @@ -0,0 +1,28 @@ +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep memcpy_chk | count 3 +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | grep {llvm.memcpy} | count 3 +// rdar://6716432 + +void *t1(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, 0); +} + +void *t2(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, 10); +} + +void *t3(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, 17); +} + +void *t4(void *d, void *s, unsigned len) { + return __builtin___memcpy_chk(d, s, len, 17); +} + +char buf[10]; +void *t5(void *s, unsigned len) { + return __builtin___memcpy_chk(buf, s, 5, __builtin_object_size(buf, 0)); +} + +void *t6(void *d, void *s) { + return __builtin___memcpy_chk(d, s, 16, __builtin_object_size(d, 0)); +} From stoklund at 2pi.dk Wed Mar 25 14:39:12 2009 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 25 Mar 2009 20:39:12 +0100 Subject: [llvm-commits] PATCH: Add TargetRegisterClass::getName() Message-ID: <6D3992A6-4671-4BEF-80DE-08DFD0F8546B@2pi.dk> The attached patch adds a getName() method to TargetRegisterClass, just like in TargetRegisterInfo. This makes debugging register classes a bit easier. -------------- next part -------------- A non-text attachment was scrubbed... Name: tablegen-regclass Type: application/octet-stream Size: 2434 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090325/8d08443f/attachment.obj -------------- next part -------------- From evan.cheng at apple.com Wed Mar 25 15:20:11 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 20:20:11 -0000 Subject: [llvm-commits] [llvm] r67701 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/CodeGen/CellSPU/and_ops.ll test/CodeGen/CellSPU/eqv.ll test/CodeGen/CellSPU/nand.ll test/CodeGen/CellSPU/or_ops.ll test/CodeGen/CellSPU/shift_ops.ll test/CodeGen/CellSPU/stores.ll test/CodeGen/CellSPU/struct_1.ll test/CodeGen/X86/2007-08-10-SignExtSubreg.ll test/CodeGen/X86/20090313-signext.ll test/CodeGen/X86/const-select.ll test/CodeGen/X86/sext-trunc.ll test/CodeGen/X86/split-eh-lpad-edges.ll Message-ID: <200903252020.n2PKKCQC017757@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 15:20:11 2009 New Revision: 67701 URL: http://llvm.org/viewvc/llvm-project?rev=67701&view=rev Log: Revert 67132. This is breaking some objective-c apps. Also fixes SDISel so it *does not* force promote return value if the function is not marked signext / zeroext. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/test/CodeGen/CellSPU/and_ops.ll llvm/trunk/test/CodeGen/CellSPU/eqv.ll llvm/trunk/test/CodeGen/CellSPU/nand.ll llvm/trunk/test/CodeGen/CellSPU/or_ops.ll llvm/trunk/test/CodeGen/CellSPU/shift_ops.ll llvm/trunk/test/CodeGen/CellSPU/stores.ll llvm/trunk/test/CodeGen/CellSPU/struct_1.ll llvm/trunk/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll llvm/trunk/test/CodeGen/X86/20090313-signext.ll llvm/trunk/test/CodeGen/X86/const-select.ll llvm/trunk/test/CodeGen/X86/sext-trunc.ll llvm/trunk/test/CodeGen/X86/split-eh-lpad-edges.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Wed Mar 25 15:20:11 2009 @@ -980,9 +980,6 @@ for (unsigned j = 0, f = NumValues; j != f; ++j) { MVT VT = ValueVTs[j]; - unsigned NumParts = TLI.getNumRegisters(VT); - MVT PartVT = TLI.getRegisterType(VT); - SmallVector Parts(NumParts); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; const Function *F = I.getParent()->getParent(); @@ -991,6 +988,19 @@ else if (F->paramHasAttr(0, Attribute::ZExt)) ExtendKind = ISD::ZERO_EXTEND; + // FIXME: C calling convention requires the return type to be promoted to + // at least 32-bit. But this is not necessary for non-C calling + // conventions. The frontend should mark functions whose return values + // require promoting with signext or zeroext attributes. + if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger()) { + MVT MinVT = TLI.getRegisterType(MVT::i32); + if (VT.bitsLT(MinVT)) + VT = MinVT; + } + + unsigned NumParts = TLI.getNumRegisters(VT); + MVT PartVT = TLI.getRegisterType(VT); + SmallVector Parts(NumParts); getCopyToParts(DAG, getCurDebugLoc(), SDValue(RetOp.getNode(), RetOp.getResNo() + j), &Parts[0], NumParts, PartVT, ExtendKind); Modified: llvm/trunk/test/CodeGen/CellSPU/and_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/and_ops.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/and_ops.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/and_ops.ll Wed Mar 25 15:20:11 2009 @@ -1,7 +1,7 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep and %t1.s | count 230 +; RUN: grep and %t1.s | count 234 ; RUN: grep andc %t1.s | count 85 -; RUN: grep andi %t1.s | count 35 +; RUN: grep andi %t1.s | count 37 ; RUN: grep andhi %t1.s | count 30 ; RUN: grep andbi %t1.s | count 4 Modified: llvm/trunk/test/CodeGen/CellSPU/eqv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/eqv.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/eqv.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/eqv.ll Wed Mar 25 15:20:11 2009 @@ -1,5 +1,8 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: grep eqv %t1.s | count 18 +; RUN: grep xshw %t1.s | count 6 +; RUN: grep xsbh %t1.s | count 3 +; RUN: grep andi %t1.s | count 3 ; Test the 'eqv' instruction, whose boolean expression is: ; (a & b) | (~a & ~b), which simplifies to Modified: llvm/trunk/test/CodeGen/CellSPU/nand.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/nand.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/nand.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/nand.ll Wed Mar 25 15:20:11 2009 @@ -1,6 +1,8 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: grep nand %t1.s | count 90 -; RUN: grep and %t1.s | count 90 +; RUN: grep and %t1.s | count 94 +; RUN: grep xsbh %t1.s | count 2 +; RUN: grep xshw %t1.s | count 4 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" target triple = "spu" Modified: llvm/trunk/test/CodeGen/CellSPU/or_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/or_ops.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/or_ops.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/or_ops.ll Wed Mar 25 15:20:11 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s +; RUN: grep and %t1.s | count 2 ; RUN: grep orc %t1.s | count 85 ; RUN: grep ori %t1.s | count 30 ; RUN: grep orhi %t1.s | count 30 Modified: llvm/trunk/test/CodeGen/CellSPU/shift_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/shift_ops.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/shift_ops.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/shift_ops.ll Wed Mar 25 15:20:11 2009 @@ -3,6 +3,8 @@ ; RUN: grep {shlhi } %t1.s | count 3 ; RUN: grep {shl } %t1.s | count 9 ; RUN: grep {shli } %t1.s | count 3 +; RUN: grep {xshw } %t1.s | count 5 +; RUN: grep {and } %t1.s | count 5 ; RUN: grep {andi } %t1.s | count 2 ; RUN: grep {rotmi } %t1.s | count 2 ; RUN: grep {rotqmbyi } %t1.s | count 1 Modified: llvm/trunk/test/CodeGen/CellSPU/stores.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/stores.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/stores.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/stores.ll Wed Mar 25 15:20:11 2009 @@ -6,13 +6,13 @@ ; RUN: grep 771 %t1.s | count 4 ; RUN: grep 515 %t1.s | count 2 ; RUN: grep 1799 %t1.s | count 2 -; RUN: grep 1543 %t1.s | count 3 -; RUN: grep 1029 %t1.s | count 1 +; RUN: grep 1543 %t1.s | count 5 +; RUN: grep 1029 %t1.s | count 3 ; RUN: grep {shli.*, 4} %t1.s | count 4 ; RUN: grep stqx %t1.s | count 4 -; RUN: grep ilhu %t1.s | count 9 -; RUN: grep iohl %t1.s | count 6 -; RUN: grep shufb %t1.s | count 13 +; RUN: grep ilhu %t1.s | count 11 +; RUN: grep iohl %t1.s | count 8 +; RUN: grep shufb %t1.s | count 15 ; RUN: grep frds %t1.s | count 1 ; ModuleID = 'stores.bc' Modified: llvm/trunk/test/CodeGen/CellSPU/struct_1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/struct_1.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/struct_1.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/struct_1.ll Wed Mar 25 15:20:11 2009 @@ -3,6 +3,8 @@ ; RUN: grep lqa %t1.s | count 5 ; RUN: grep lqd %t1.s | count 11 ; RUN: grep rotqbyi %t1.s | count 7 +; RUN: grep xshw %t1.s | count 1 +; RUN: grep andi %t1.s | count 5 ; RUN: grep cbd %t1.s | count 3 ; RUN: grep chd %t1.s | count 1 ; RUN: grep cwd %t1.s | count 3 @@ -12,6 +14,8 @@ ; RUN: grep ilhu %t2.s | count 16 ; RUN: grep lqd %t2.s | count 16 ; RUN: grep rotqbyi %t2.s | count 7 +; RUN: grep xshw %t2.s | count 1 +; RUN: grep andi %t2.s | count 5 ; RUN: grep cbd %t2.s | count 3 ; RUN: grep chd %t2.s | count 1 ; RUN: grep cwd %t2.s | count 3 Modified: llvm/trunk/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll Wed Mar 25 15:20:11 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | not grep {movsbl} +; RUN: llvm-as < %s | llc -march=x86 | grep {movsbl} @X = global i32 0 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/20090313-signext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/20090313-signext.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/20090313-signext.ll (original) +++ llvm/trunk/test/CodeGen/X86/20090313-signext.ll Wed Mar 25 15:20:11 2009 @@ -1,6 +1,7 @@ ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=pic > %t ; RUN: grep {movswl %ax, %edi} %t ; RUN: grep {movw (%rax), %ax} %t +; XFAIL: * @x = common global i16 0 Modified: llvm/trunk/test/CodeGen/X86/const-select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/const-select.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/const-select.ll (original) +++ llvm/trunk/test/CodeGen/X86/const-select.ll Wed Mar 25 15:20:11 2009 @@ -10,7 +10,7 @@ ret float %iftmp.0.0 } -; RUN: llvm-as < %s | llc | grep {movb.*(%e.x,%e.x,4), %al} +; RUN: llvm-as < %s | llc | grep {movsbl.*(%e.x,%e.x,4), %eax} define signext i8 @test(i8* nocapture %P, double %F) nounwind readonly { entry: %0 = fcmp olt double %F, 4.200000e+01 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/sext-trunc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sext-trunc.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/sext-trunc.ll (original) +++ llvm/trunk/test/CodeGen/X86/sext-trunc.ll Wed Mar 25 15:20:11 2009 @@ -1,6 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 > %t -; RUN: grep movb %t -; RUN: not grep movsbl %t +; RUN: grep movsbl %t ; RUN: not grep movz %t ; RUN: not grep and %t Modified: llvm/trunk/test/CodeGen/X86/split-eh-lpad-edges.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/split-eh-lpad-edges.ll?rev=67701&r1=67700&r2=67701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/split-eh-lpad-edges.ll (original) +++ llvm/trunk/test/CodeGen/X86/split-eh-lpad-edges.ll Wed Mar 25 15:20:11 2009 @@ -32,38 +32,3 @@ } declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...) -; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | not grep jmp -; rdar://6647639 -; XFAIL: * - - %struct.FetchPlanHeader = type { i8*, i8*, i32, i8*, i8*, i8*, i8*, i8*, %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)*, %struct.__attributeDescriptionFlags } - %struct.NSArray = type { %struct.NSObject } - %struct.NSAutoreleasePool = type { %struct.NSObject, i8*, i8*, i8*, i8* } - %struct.NSObject = type { %struct.NSObject* } - %struct.__attributeDescriptionFlags = type <{ i32 }> - %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* } - %struct.objc_selector = type opaque -@"\01l_objc_msgSend_fixup_alloc" = external global %struct._message_ref_t, align 16 ; <%struct._message_ref_t*> [#uses=2] - -define %struct.NSArray* @newFetchedRowsForFetchPlan_MT(%struct.FetchPlanHeader* %fetchPlan, %struct.objc_selector* %selectionMethod, %struct.NSObject* %selectionParameter) ssp { -entry: - %0 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc") - to label %invcont unwind label %lpad ; <%struct.NSObject*> [#uses=1] - -invcont: ; preds = %entry - %1 = invoke %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)* @objc_msgSend(%struct.NSObject* %0, %struct.objc_selector* null) - to label %invcont26 unwind label %lpad ; <%struct.NSObject*> [#uses=0] - -invcont26: ; preds = %invcont - %2 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc") - to label %invcont27 unwind label %lpad ; <%struct.NSObject*> [#uses=0] - -invcont27: ; preds = %invcont26 - unreachable - -lpad: ; preds = %invcont26, %invcont, %entry - %pool.1 = phi %struct.NSAutoreleasePool* [ null, %entry ], [ null, %invcont ], [ null, %invcont26 ] ; <%struct.NSAutoreleasePool*> [#uses=0] - unreachable -} - -declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...) From evan.cheng at apple.com Wed Mar 25 15:30:19 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 20:30:19 -0000 Subject: [llvm-commits] [llvm] r67702 - /llvm/trunk/test/CodeGen/X86/sext-ret-val.ll Message-ID: <200903252030.n2PKUJo3018468@zion.cs.uiuc.edu> Author: evancheng Date: Wed Mar 25 15:30:19 2009 New Revision: 67702 URL: http://llvm.org/viewvc/llvm-project?rev=67702&view=rev Log: Add a test case for PR3779: when to promote the function return value. Added: llvm/trunk/test/CodeGen/X86/sext-ret-val.ll Added: llvm/trunk/test/CodeGen/X86/sext-ret-val.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sext-ret-val.ll?rev=67702&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/sext-ret-val.ll (added) +++ llvm/trunk/test/CodeGen/X86/sext-ret-val.ll Wed Mar 25 15:30:19 2009 @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep movzbl | count 1 +; rdar://6699246 + +define signext i8 @t1(i8* %A) nounwind readnone ssp { +entry: + %0 = icmp ne i8* %A, null + %1 = zext i1 %0 to i8 + ret i8 %1 +} + +define i8 @t2(i8* %A) nounwind readnone ssp { +entry: + %0 = icmp ne i8* %A, null + %1 = zext i1 %0 to i8 + ret i8 %1 +} From baldrick at free.fr Wed Mar 25 15:40:18 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 25 Mar 2009 21:40:18 +0100 Subject: [llvm-commits] [llvm] r67702 - /llvm/trunk/test/CodeGen/X86/sext-ret-val.ll In-Reply-To: <200903252030.n2PKUJo3018468@zion.cs.uiuc.edu> References: <200903252030.n2PKUJo3018468@zion.cs.uiuc.edu> Message-ID: <200903252140.18559.baldrick@free.fr> Hi Evan, > Add a test case for PR3779: when to promote the function return value. as I explained in PR3779 I don't think the return value should be extended here. That's because i8 is legal on x86. I think this should be fixed in the front-end. Ciao, Duncan. > > Added: > llvm/trunk/test/CodeGen/X86/sext-ret-val.ll > > Added: llvm/trunk/test/CodeGen/X86/sext-ret-val.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sext-ret-val.ll?rev=67702&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/sext-ret-val.ll (added) > +++ llvm/trunk/test/CodeGen/X86/sext-ret-val.ll Wed Mar 25 15:30:19 2009 > @@ -0,0 +1,16 @@ > +; RUN: llvm-as < %s | llc -march=x86 | grep movzbl | count 1 > +; rdar://6699246 > + > +define signext i8 @t1(i8* %A) nounwind readnone ssp { > +entry: > + %0 = icmp ne i8* %A, null > + %1 = zext i1 %0 to i8 > + ret i8 %1 > +} > + > +define i8 @t2(i8* %A) nounwind readnone ssp { > +entry: > + %0 = icmp ne i8* %A, null > + %1 = zext i1 %0 to i8 > + ret i8 %1 > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From echeng at apple.com Wed Mar 25 15:47:37 2009 From: echeng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 13:47:37 -0700 Subject: [llvm-commits] [llvm] r67702 - /llvm/trunk/test/CodeGen/X86/sext-ret-val.ll In-Reply-To: <200903252140.18559.baldrick@free.fr> References: <200903252030.n2PKUJo3018468@zion.cs.uiuc.edu> <200903252140.18559.baldrick@free.fr> Message-ID: <0DA7A97D-6F19-4E61-A159-7498DD4C9697@apple.com> On Mar 25, 2009, at 1:40 PM, Duncan Sands wrote: > Hi Evan, > >> Add a test case for PR3779: when to promote the function return >> value. > > as I explained in PR3779 I don't think the return value should be > extended here. That's because i8 is legal on x86. I think this > should be fixed in the front-end. This is purely a codegen test. This demonstrates (for now) if the function is marked signext, the the value should be extended. Once we have made the changes this (and potentially) other tests will go away / change. Evan > > Ciao, > > Duncan. > >> >> Added: >> llvm/trunk/test/CodeGen/X86/sext-ret-val.ll >> >> Added: llvm/trunk/test/CodeGen/X86/sext-ret-val.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sext-ret-val.ll?rev=67702&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/sext-ret-val.ll (added) >> +++ llvm/trunk/test/CodeGen/X86/sext-ret-val.ll Wed Mar 25 15:30:19 >> 2009 >> @@ -0,0 +1,16 @@ >> +; RUN: llvm-as < %s | llc -march=x86 | grep movzbl | count 1 >> +; rdar://6699246 >> + >> +define signext i8 @t1(i8* %A) nounwind readnone ssp { >> +entry: >> + %0 = icmp ne i8* %A, null >> + %1 = zext i1 %0 to i8 >> + ret i8 %1 >> +} >> + >> +define i8 @t2(i8* %A) nounwind readnone ssp { >> +entry: >> + %0 = icmp ne i8* %A, null >> + %1 = zext i1 %0 to i8 >> + ret i8 %1 >> +} >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > From baldrick at free.fr Wed Mar 25 15:51:43 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 25 Mar 2009 21:51:43 +0100 Subject: [llvm-commits] [llvm] r67702 - /llvm/trunk/test/CodeGen/X86/sext-ret-val.ll In-Reply-To: <0DA7A97D-6F19-4E61-A159-7498DD4C9697@apple.com> References: <200903252030.n2PKUJo3018468@zion.cs.uiuc.edu> <200903252140.18559.baldrick@free.fr> <0DA7A97D-6F19-4E61-A159-7498DD4C9697@apple.com> Message-ID: <200903252151.43716.baldrick@free.fr> Hi Evan, > > as I explained in PR3779 I don't think the return value should be > > extended here. That's because i8 is legal on x86. I think this > > should be fixed in the front-end. > > This is purely a codegen test. This demonstrates (for now) if the > function is marked signext, the the value should be extended. Once we > have made the changes this (and potentially) other tests will go > away / change. I don't get it - why is the value being sign extended? It shouldn't be: i8 is a legal type, so the return attribute doesn't matter. And you're not testing for sign extension: the test checks for zero extension. Confused. Ciao, Duncan. > Evan > > > > > Ciao, > > > > Duncan. > > > >> > >> Added: > >> llvm/trunk/test/CodeGen/X86/sext-ret-val.ll > >> > >> Added: llvm/trunk/test/CodeGen/X86/sext-ret-val.ll > >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sext-ret-val.ll?rev=67702&view=auto > >> > >> = > >> = > >> = > >> = > >> = > >> = > >> = > >> = > >> = > >> ===================================================================== > >> --- llvm/trunk/test/CodeGen/X86/sext-ret-val.ll (added) > >> +++ llvm/trunk/test/CodeGen/X86/sext-ret-val.ll Wed Mar 25 15:30:19 > >> 2009 > >> @@ -0,0 +1,16 @@ > >> +; RUN: llvm-as < %s | llc -march=x86 | grep movzbl | count 1 > >> +; rdar://6699246 > >> + > >> +define signext i8 @t1(i8* %A) nounwind readnone ssp { > >> +entry: > >> + %0 = icmp ne i8* %A, null > >> + %1 = zext i1 %0 to i8 > >> + ret i8 %1 > >> +} > >> + > >> +define i8 @t2(i8* %A) nounwind readnone ssp { > >> +entry: > >> + %0 = icmp ne i8* %A, null > >> + %1 = zext i1 %0 to i8 > >> + ret i8 %1 > >> +} > >> > >> > >> _______________________________________________ > >> llvm-commits mailing list > >> llvm-commits at cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > >> > > > > From isanbard at gmail.com Wed Mar 25 15:59:48 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 20:59:48 -0000 Subject: [llvm-commits] [llvm] r67704 - in /llvm/branches/Apple/Dib: lib/CodeGen/SelectionDAG/ test/CodeGen/CellSPU/ test/CodeGen/X86/ Message-ID: <200903252059.n2PKxoT7020459@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 15:59:48 2009 New Revision: 67704 URL: http://llvm.org/viewvc/llvm-project?rev=67704&view=rev Log: --- Merging (from foreign repository) r67701 into '.': U test/CodeGen/X86/20090313-signext.ll U test/CodeGen/X86/split-eh-lpad-edges.ll U test/CodeGen/X86/2007-08-10-SignExtSubreg.ll U test/CodeGen/X86/sext-trunc.ll U test/CodeGen/X86/const-select.ll U test/CodeGen/CellSPU/stores.ll U test/CodeGen/CellSPU/nand.ll U test/CodeGen/CellSPU/and_ops.ll U test/CodeGen/CellSPU/shift_ops.ll U test/CodeGen/CellSPU/or_ops.ll U test/CodeGen/CellSPU/eqv.ll U test/CodeGen/CellSPU/struct_1.ll U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Revert 67132. This is breaking some objective-c apps. Also fixes SDISel so it *does not* force promote return value if the function is not marked signext / zeroext. --- Merging (from foreign repository) r67702 into '.': A test/CodeGen/X86/sext-ret-val.ll Add a test case for PR3779: when to promote the function return value. Added: llvm/branches/Apple/Dib/test/CodeGen/X86/sext-ret-val.ll Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/branches/Apple/Dib/test/CodeGen/CellSPU/and_ops.ll llvm/branches/Apple/Dib/test/CodeGen/CellSPU/eqv.ll llvm/branches/Apple/Dib/test/CodeGen/CellSPU/nand.ll llvm/branches/Apple/Dib/test/CodeGen/CellSPU/or_ops.ll llvm/branches/Apple/Dib/test/CodeGen/CellSPU/shift_ops.ll llvm/branches/Apple/Dib/test/CodeGen/CellSPU/stores.ll llvm/branches/Apple/Dib/test/CodeGen/CellSPU/struct_1.ll llvm/branches/Apple/Dib/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll llvm/branches/Apple/Dib/test/CodeGen/X86/20090313-signext.ll llvm/branches/Apple/Dib/test/CodeGen/X86/const-select.ll llvm/branches/Apple/Dib/test/CodeGen/X86/sext-trunc.ll llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Wed Mar 25 15:59:48 2009 @@ -980,9 +980,6 @@ for (unsigned j = 0, f = NumValues; j != f; ++j) { MVT VT = ValueVTs[j]; - unsigned NumParts = TLI.getNumRegisters(VT); - MVT PartVT = TLI.getRegisterType(VT); - SmallVector Parts(NumParts); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; const Function *F = I.getParent()->getParent(); @@ -991,6 +988,19 @@ else if (F->paramHasAttr(0, Attribute::ZExt)) ExtendKind = ISD::ZERO_EXTEND; + // FIXME: C calling convention requires the return type to be promoted to + // at least 32-bit. But this is not necessary for non-C calling + // conventions. The frontend should mark functions whose return values + // require promoting with signext or zeroext attributes. + if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger()) { + MVT MinVT = TLI.getRegisterType(MVT::i32); + if (VT.bitsLT(MinVT)) + VT = MinVT; + } + + unsigned NumParts = TLI.getNumRegisters(VT); + MVT PartVT = TLI.getRegisterType(VT); + SmallVector Parts(NumParts); getCopyToParts(DAG, getCurDebugLoc(), SDValue(RetOp.getNode(), RetOp.getResNo() + j), &Parts[0], NumParts, PartVT, ExtendKind); Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/and_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/and_ops.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/and_ops.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/and_ops.ll Wed Mar 25 15:59:48 2009 @@ -1,7 +1,7 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep and %t1.s | count 230 +; RUN: grep and %t1.s | count 234 ; RUN: grep andc %t1.s | count 85 -; RUN: grep andi %t1.s | count 35 +; RUN: grep andi %t1.s | count 37 ; RUN: grep andhi %t1.s | count 30 ; RUN: grep andbi %t1.s | count 4 Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/eqv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/eqv.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/eqv.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/eqv.ll Wed Mar 25 15:59:48 2009 @@ -1,5 +1,8 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: grep eqv %t1.s | count 18 +; RUN: grep xshw %t1.s | count 6 +; RUN: grep xsbh %t1.s | count 3 +; RUN: grep andi %t1.s | count 3 ; Test the 'eqv' instruction, whose boolean expression is: ; (a & b) | (~a & ~b), which simplifies to Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/nand.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/nand.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/nand.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/nand.ll Wed Mar 25 15:59:48 2009 @@ -1,6 +1,8 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: grep nand %t1.s | count 90 -; RUN: grep and %t1.s | count 90 +; RUN: grep and %t1.s | count 94 +; RUN: grep xsbh %t1.s | count 2 +; RUN: grep xshw %t1.s | count 4 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" target triple = "spu" Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/or_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/or_ops.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/or_ops.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/or_ops.ll Wed Mar 25 15:59:48 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s +; RUN: grep and %t1.s | count 2 ; RUN: grep orc %t1.s | count 85 ; RUN: grep ori %t1.s | count 30 ; RUN: grep orhi %t1.s | count 30 Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/shift_ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/shift_ops.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/shift_ops.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/shift_ops.ll Wed Mar 25 15:59:48 2009 @@ -3,6 +3,8 @@ ; RUN: grep {shlhi } %t1.s | count 3 ; RUN: grep {shl } %t1.s | count 9 ; RUN: grep {shli } %t1.s | count 3 +; RUN: grep {xshw } %t1.s | count 5 +; RUN: grep {and } %t1.s | count 5 ; RUN: grep {andi } %t1.s | count 2 ; RUN: grep {rotmi } %t1.s | count 2 ; RUN: grep {rotqmbyi } %t1.s | count 1 Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/stores.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/stores.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/stores.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/stores.ll Wed Mar 25 15:59:48 2009 @@ -6,13 +6,13 @@ ; RUN: grep 771 %t1.s | count 4 ; RUN: grep 515 %t1.s | count 2 ; RUN: grep 1799 %t1.s | count 2 -; RUN: grep 1543 %t1.s | count 3 -; RUN: grep 1029 %t1.s | count 1 +; RUN: grep 1543 %t1.s | count 5 +; RUN: grep 1029 %t1.s | count 3 ; RUN: grep {shli.*, 4} %t1.s | count 4 ; RUN: grep stqx %t1.s | count 4 -; RUN: grep ilhu %t1.s | count 9 -; RUN: grep iohl %t1.s | count 6 -; RUN: grep shufb %t1.s | count 13 +; RUN: grep ilhu %t1.s | count 11 +; RUN: grep iohl %t1.s | count 8 +; RUN: grep shufb %t1.s | count 15 ; RUN: grep frds %t1.s | count 1 ; ModuleID = 'stores.bc' Modified: llvm/branches/Apple/Dib/test/CodeGen/CellSPU/struct_1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/CellSPU/struct_1.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/CellSPU/struct_1.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/CellSPU/struct_1.ll Wed Mar 25 15:59:48 2009 @@ -3,6 +3,8 @@ ; RUN: grep lqa %t1.s | count 5 ; RUN: grep lqd %t1.s | count 11 ; RUN: grep rotqbyi %t1.s | count 7 +; RUN: grep xshw %t1.s | count 1 +; RUN: grep andi %t1.s | count 5 ; RUN: grep cbd %t1.s | count 3 ; RUN: grep chd %t1.s | count 1 ; RUN: grep cwd %t1.s | count 3 @@ -12,6 +14,8 @@ ; RUN: grep ilhu %t2.s | count 16 ; RUN: grep lqd %t2.s | count 16 ; RUN: grep rotqbyi %t2.s | count 7 +; RUN: grep xshw %t2.s | count 1 +; RUN: grep andi %t2.s | count 5 ; RUN: grep cbd %t2.s | count 3 ; RUN: grep chd %t2.s | count 1 ; RUN: grep cwd %t2.s | count 3 Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll Wed Mar 25 15:59:48 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | not grep {movsbl} +; RUN: llvm-as < %s | llc -march=x86 | grep {movsbl} @X = global i32 0 ; [#uses=1] Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/20090313-signext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/20090313-signext.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/20090313-signext.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/20090313-signext.ll Wed Mar 25 15:59:48 2009 @@ -1,6 +1,7 @@ ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=pic > %t ; RUN: grep {movswl %ax, %edi} %t ; RUN: grep {movw (%rax), %ax} %t +; XFAIL: * @x = common global i16 0 Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/const-select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/const-select.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/const-select.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/const-select.ll Wed Mar 25 15:59:48 2009 @@ -10,7 +10,7 @@ ret float %iftmp.0.0 } -; RUN: llvm-as < %s | llc | grep {movb.*(%e.x,%e.x,4), %al} +; RUN: llvm-as < %s | llc | grep {movsbl.*(%e.x,%e.x,4), %eax} define signext i8 @test(i8* nocapture %P, double %F) nounwind readonly { entry: %0 = fcmp olt double %F, 4.200000e+01 ; [#uses=1] Added: llvm/branches/Apple/Dib/test/CodeGen/X86/sext-ret-val.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/sext-ret-val.ll?rev=67704&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/sext-ret-val.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/sext-ret-val.ll Wed Mar 25 15:59:48 2009 @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep movzbl | count 1 +; rdar://6699246 + +define signext i8 @t1(i8* %A) nounwind readnone ssp { +entry: + %0 = icmp ne i8* %A, null + %1 = zext i1 %0 to i8 + ret i8 %1 +} + +define i8 @t2(i8* %A) nounwind readnone ssp { +entry: + %0 = icmp ne i8* %A, null + %1 = zext i1 %0 to i8 + ret i8 %1 +} Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/sext-trunc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/sext-trunc.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/sext-trunc.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/sext-trunc.ll Wed Mar 25 15:59:48 2009 @@ -1,6 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 > %t -; RUN: grep movb %t -; RUN: not grep movsbl %t +; RUN: grep movsbl %t ; RUN: not grep movz %t ; RUN: not grep and %t Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll?rev=67704&r1=67703&r2=67704&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll Wed Mar 25 15:59:48 2009 @@ -32,38 +32,3 @@ } declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...) -; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | not grep jmp -; rdar://6647639 -; XFAIL: * - - %struct.FetchPlanHeader = type { i8*, i8*, i32, i8*, i8*, i8*, i8*, i8*, %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)*, %struct.__attributeDescriptionFlags } - %struct.NSArray = type { %struct.NSObject } - %struct.NSAutoreleasePool = type { %struct.NSObject, i8*, i8*, i8*, i8* } - %struct.NSObject = type { %struct.NSObject* } - %struct.__attributeDescriptionFlags = type <{ i32 }> - %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* } - %struct.objc_selector = type opaque -@"\01l_objc_msgSend_fixup_alloc" = external global %struct._message_ref_t, align 16 ; <%struct._message_ref_t*> [#uses=2] - -define %struct.NSArray* @newFetchedRowsForFetchPlan_MT(%struct.FetchPlanHeader* %fetchPlan, %struct.objc_selector* %selectionMethod, %struct.NSObject* %selectionParameter) ssp { -entry: - %0 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc") - to label %invcont unwind label %lpad ; <%struct.NSObject*> [#uses=1] - -invcont: ; preds = %entry - %1 = invoke %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)* @objc_msgSend(%struct.NSObject* %0, %struct.objc_selector* null) - to label %invcont26 unwind label %lpad ; <%struct.NSObject*> [#uses=0] - -invcont26: ; preds = %invcont - %2 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc") - to label %invcont27 unwind label %lpad ; <%struct.NSObject*> [#uses=0] - -invcont27: ; preds = %invcont26 - unreachable - -lpad: ; preds = %invcont26, %invcont, %entry - %pool.1 = phi %struct.NSAutoreleasePool* [ null, %entry ], [ null, %invcont ], [ null, %invcont26 ] ; <%struct.NSAutoreleasePool*> [#uses=0] - unreachable -} - -declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...) From isanbard at gmail.com Wed Mar 25 16:28:17 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 21:28:17 -0000 Subject: [llvm-commits] [llvm] r67709 - in /llvm/branches/Apple/Dib: Makefile.rules test/BugPoint/misopt-basictest.ll test/BugPoint/remove_arguments_test.ll test/Makefile test/lib/llvm.exp Message-ID: <200903252128.n2PLSHHb022262@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 16:28:17 2009 New Revision: 67709 URL: http://llvm.org/viewvc/llvm-project?rev=67709&view=rev Log: --- Merging (from foreign repository) r67334 into '.': U test/BugPoint/misopt-basictest.ll U test/BugPoint/remove_arguments_test.ll U test/lib/llvm.exp U test/Makefile U Makefile.rules More makefile changes to allow dejagnu tests to pass when system tools default to a different target from the llvm configuration (e.g. 64-bit gcc and 32-bit llvm). Modified: llvm/branches/Apple/Dib/Makefile.rules llvm/branches/Apple/Dib/test/BugPoint/misopt-basictest.ll llvm/branches/Apple/Dib/test/BugPoint/remove_arguments_test.ll llvm/branches/Apple/Dib/test/Makefile llvm/branches/Apple/Dib/test/lib/llvm.exp Modified: llvm/branches/Apple/Dib/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/Makefile.rules?rev=67709&r1=67708&r2=67709&view=diff ============================================================================== --- llvm/branches/Apple/Dib/Makefile.rules (original) +++ llvm/branches/Apple/Dib/Makefile.rules Wed Mar 25 16:28:17 2009 @@ -437,7 +437,7 @@ SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ -mmacosx-version-min=$(DARWIN_VERSION) - CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) + TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) else ifeq ($(OS),Cygwin) SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \ @@ -536,10 +536,10 @@ else ifeq ($(OS),Darwin) ifeq ($(ARCH),x86_64) - CompileCommonOpts += -m64 + TargetCommonOpts = -m64 else ifeq ($(ARCH),x86) - CompileCommonOpts += -m32 + TargetCommonOpts = -m32 endif endif endif @@ -560,33 +560,35 @@ ifeq ($(BUILD_COMPONENT), 1) Compile.C = $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(C.Flags.NoRelink) \ - $(CompileCommonOpts) -c + $(TargetCommonOpts) $(CompileCommonOpts) -c Compile.CXX = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \ - $(CompileCommonOpts) -c - Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) \ - $(CXX.Flags.NoRelink) -E + $(TargetCommonOpts) $(CompileCommonOpts) -c + Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(TargetCommonOpts) \ + $(CompileCommonOpts) $(CXX.Flags) $(CXX.Flags.NoRelink) -E Link = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \ - $(CompileCommonOpts) $(LD.Flags) $(Strip) - Relink = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \ - $(Relink.Flags) + $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) $(Strip) + Relink = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) \ + $(CompileCommonOpts) $(Relink.Flags) else Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(C.Flags.NoRelink) \ - $(CompileCommonOpts) -c + $(TargetCommonOpts) $(CompileCommonOpts) -c Compile.CXX = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \ - $(CompileCommonOpts) -c - Preprocess.CXX= $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) \ - $(CXX.Flags.NoRelink) -E + $(TargetCommonOpts) $(CompileCommonOpts) -c + Preprocess.CXX= $(CXX) $(CPP.Flags) $(TargetCommonOpts) \ + $(CompileCommonOpts) $(CXX.Flags) $(CXX.Flags.NoRelink) -E Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \ - $(CompileCommonOpts) $(LD.Flags) $(Strip) - Relink = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \ - $(Relink.Flags) + $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) $(Strip) + Relink = $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) \ + $(CompileCommonOpts) $(Relink.Flags) endif -BCCompile.C = $(LLVMGCCWITHPATH) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -E +BCCompile.C = $(LLVMGCCWITHPATH) $(CPP.Flags) $(C.Flags) \ + $(TargetCommonOpts) $(CompileCommonOpts) +Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) \ + $(TargetCommonOpts) $(CompileCommonOpts) -E BCCompile.CXX = $(LLVMGXXWITHPATH) $(CPP.Flags) $(CXX.Flags) \ - $(CompileCommonOpts) + $(TargetCommonOpts) $(CompileCommonOpts) ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755 ScriptInstall = $(INSTALL) -m 0755 Modified: llvm/branches/Apple/Dib/test/BugPoint/misopt-basictest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/BugPoint/misopt-basictest.ll?rev=67709&r1=67708&r2=67709&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/BugPoint/misopt-basictest.ll (original) +++ llvm/branches/Apple/Dib/test/BugPoint/misopt-basictest.ll Wed Mar 25 16:28:17 2009 @@ -1,4 +1,4 @@ -; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes +; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes %bugpoint_tops @.LC0 = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1] Modified: llvm/branches/Apple/Dib/test/BugPoint/remove_arguments_test.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/BugPoint/remove_arguments_test.ll?rev=67709&r1=67708&r2=67709&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/BugPoint/remove_arguments_test.ll (original) +++ llvm/branches/Apple/Dib/test/BugPoint/remove_arguments_test.ll Wed Mar 25 16:28:17 2009 @@ -1,4 +1,4 @@ -; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes +; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes ; Test to make sure that arguments are removed from the function if they are ; unnecessary. Modified: llvm/branches/Apple/Dib/test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/Makefile?rev=67709&r1=67708&r2=67709&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/Makefile (original) +++ llvm/branches/Apple/Dib/test/Makefile Wed Mar 25 16:28:17 2009 @@ -87,6 +87,9 @@ else DSYMUTIL=true endif +ifeq ($(OS),Darwin) +BUGPOINT_TOPTS="-gcc-tool-args $(TargetCommonOpts)" +endif FORCE: @@ -108,12 +111,13 @@ @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp @echo 'set gccpath "$(CC)"' >>site.tmp @echo 'set gxxpath "$(CXX)"' >>site.tmp - @echo 'set compile_c "' $(CC) $(CPP.Flags) $(CompileCommonOpts) -c '"' >>site.tmp - @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c '"' >> site.tmp - @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp - @echo 'set llvmgcc "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp - @echo 'set llvmgxx "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp + @echo 'set compile_c "' $(CC) $(CPP.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >>site.tmp + @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >> site.tmp + @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp + @echo 'set llvmgcc "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp + @echo 'set llvmgxx "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp + @echo 'set bugpoint_topts $(BUGPOINT_TOPTS)' >> site.tmp @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp @echo 'set valgrind "$(VALGRIND)"' >> site.tmp Modified: llvm/branches/Apple/Dib/test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/lib/llvm.exp?rev=67709&r1=67708&r2=67709&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/lib/llvm.exp (original) +++ llvm/branches/Apple/Dib/test/lib/llvm.exp Wed Mar 25 16:28:17 2009 @@ -48,8 +48,8 @@ proc substitute { line test tmpFile } { global srcroot objroot srcdir objdir subdir target_triplet prcontext global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlc - global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir llvmdsymutil - global valgrind grep gas + global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir + global llvmdsymutil valgrind grep gas bugpoint_topts set path [file join $srcdir $subdir] # Substitute all Tcl variables. @@ -77,6 +77,8 @@ regsub -all {%llvmdsymutil} $new_line "$llvmdsymutil" new_line #replace %llvmlibsdir with configure library directory regsub -all {%llvmlibsdir} $new_line "$llvmlibsdir" new_line + #replace %bugpoint_tops with actual bugpoint target options + regsub -all {%bugpoint_tops} $new_line "$bugpoint_topts" new_line #replace %p with path to source, regsub -all {%p} $new_line [file join $srcdir $subdir] new_line #replace %s with filename From bruno.cardoso at gmail.com Wed Mar 25 17:01:02 2009 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 25 Mar 2009 19:01:02 -0300 Subject: [llvm-commits] LLVM Developers Message-ID: <275e64e40903251501v10b6fct8b203fc97e1eedfe@mail.gmail.com> Hi all, If it's not a problem I'd like to be added to LLVM Developers page! :) Should I send a diff ? If so, in what repo is that page? Anyway, this is the link for the photo: http://brunocardoso.cc/random/bruno-small.jpeg and it should link to http://brunocardoso.cc Thanks! -- Bruno Cardoso Lopes http://www.brunocardoso.cc From dalej at apple.com Wed Mar 25 17:26:09 2009 From: dalej at apple.com (Dale Johannesen) Date: Wed, 25 Mar 2009 22:26:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67711 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200903252226.n2PMQ9vV025349@zion.cs.uiuc.edu> Author: johannes Date: Wed Mar 25 17:26:09 2009 New Revision: 67711 URL: http://llvm.org/viewvc/llvm-project?rev=67711&view=rev Log: For now, don't emit global variable debug info when optimization is on; this affects some optimizations. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=67711&r1=67710&r2=67711&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed Mar 25 17:26:09 2009 @@ -1364,7 +1364,10 @@ #endif } - if (TheDebugInfo) TheDebugInfo->EmitGlobalVariable(GV, decl); + // No debug info for globals when optimization is on. While this is + // something that would be accurate and useful to a user, it currently + // affects some optimizations that, e.g., count uses. + if (TheDebugInfo && !optimize) TheDebugInfo->EmitGlobalVariable(GV, decl); TREE_ASM_WRITTEN(decl) = 1; timevar_pop(TV_LLVM_GLOBALS); From dpatel at apple.com Wed Mar 25 17:32:35 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 25 Mar 2009 22:32:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67712 - in /llvm-gcc-4.2/trunk/gcc/config: arm/darwin.h i386/darwin.h rs6000/darwin.h Message-ID: <200903252232.n2PMWZQa025704@zion.cs.uiuc.edu> Author: dpatel Date: Wed Mar 25 17:32:35 2009 New Revision: 67712 URL: http://llvm.org/viewvc/llvm-project?rev=67712&view=rev Log: Ignore -g* in LTO mode. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=67712&r1=67711&r2=67712&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Wed Mar 25 17:32:35 2009 @@ -36,6 +36,8 @@ %{!fbuiltin-strcpy:-fno-builtin-strcpy} \ % Changes in directory llvm-www/img: PhotoBruno.jpg added (r1.1) --- Log message: Add Bruno Lopes to developers page. --- Diffs of the changes: (+0 -0) PhotoBruno.jpg | 0 1 files changed Index: llvm-www/img/PhotoBruno.jpg From tonic at nondot.org Wed Mar 25 17:53:48 2009 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 25 Mar 2009 17:53:48 -0500 Subject: [llvm-commits] CVS: llvm-www/developers.txt Message-ID: <200903252253.n2PMrmBD027065@zion.cs.uiuc.edu> Changes in directory llvm-www: developers.txt updated: 1.17 -> 1.18 --- Log message: Add Bruno Lopes to developers page. --- Diffs of the changes: (+1 -0) developers.txt | 1 + 1 files changed, 1 insertion(+) Index: llvm-www/developers.txt diff -u llvm-www/developers.txt:1.17 llvm-www/developers.txt:1.18 --- llvm-www/developers.txt:1.17 Wed Oct 10 13:44:24 2007 +++ llvm-www/developers.txt Wed Mar 25 17:53:12 2009 @@ -19,6 +19,7 @@ Chris Lattner href=http://nondot.org/sabre/LLVMNotes/ img=PhotoChris.jpg width=150 height=152 alt=Sabre Tanya Lattner href=http://nondot.org/tonic/ img=PhotoTanya.jpg width=200 height=217 alt=tonic Andrew Lenharth href=http://www.lenharth.org/~andrewl/ img=PhotoAndrew.jpg width=140 height=177 alt=Andrew +Bruno Lopes href=http://brunocardoso.cc img=PhotoBruno.jpg width=190 height=178 alt=Bruno Duraid Madina href=http://kinoko.c.u-tokyo.ac.jp/~duraid/llvm.html img=PhotoDuraid.jpg width=138 height=195 alt=camel_ Devang Patel href=mailto:dpatel at apple.com img=PhotoDevang.jpg width=145 height=172 alt=Devang Reid Spencer href=http://illuvium.net/rspencer/ img=PhotoReid.jpg width=145 height=172 alt=Reid From lattner at apple.com Wed Mar 25 17:54:21 2009 From: lattner at apple.com (Tanya Lattner) Date: Wed, 25 Mar 2009 15:54:21 -0700 Subject: [llvm-commits] LLVM Developers In-Reply-To: <275e64e40903251501v10b6fct8b203fc97e1eedfe@mail.gmail.com> References: <275e64e40903251501v10b6fct8b203fc97e1eedfe@mail.gmail.com> Message-ID: <9185EA61-A825-46D7-BA7E-4DA5C4CF7A89@apple.com> Done. Btw, your webpage seems to redirect. Is that what you wanted? -Tanya On Mar 25, 2009, at 3:01 PM, Bruno Cardoso Lopes wrote: > Hi all, > > If it's not a problem I'd like to be added to LLVM Developers page! :) > Should I send a diff ? If so, in what repo is that page? > Anyway, this is the link for the photo: > http://brunocardoso.cc/random/bruno-small.jpeg > and it should link to http://brunocardoso.cc > > Thanks! > > -- > Bruno Cardoso Lopes > http://www.brunocardoso.cc > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090325/419075b7/attachment.html From bruno.cardoso at gmail.com Wed Mar 25 18:18:03 2009 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 25 Mar 2009 20:18:03 -0300 Subject: [llvm-commits] LLVM Developers In-Reply-To: <9185EA61-A825-46D7-BA7E-4DA5C4CF7A89@apple.com> References: <275e64e40903251501v10b6fct8b203fc97e1eedfe@mail.gmail.com> <9185EA61-A825-46D7-BA7E-4DA5C4CF7A89@apple.com> Message-ID: <275e64e40903251618n140a96cere165abe8c53d0896@mail.gmail.com> On Wed, Mar 25, 2009 at 7:54 PM, Tanya Lattner wrote: > Done. > Btw, your webpage seems to redirect. Is that what you wanted? Yep. I'm redirecting to my blog until I get a new webpage. Thanks Tanya :) -- Bruno Cardoso Lopes http://www.brunocardoso.cc From grosbach at apple.com Wed Mar 25 18:28:34 2009 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 25 Mar 2009 23:28:34 -0000 Subject: [llvm-commits] [llvm] r67714 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200903252328.n2PNSYMV029265@zion.cs.uiuc.edu> Author: grosbach Date: Wed Mar 25 18:28:33 2009 New Revision: 67714 URL: http://llvm.org/viewvc/llvm-project?rev=67714&view=rev Log: Modify getRegisterValueType() to allow for a register being in mutliple register classes. Before, MVT::Other would be returned anytime a reg was in multiple register classes. Now, MVT::Other is only returned if the types for those register classes differ. Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=67714&r1=67713&r2=67714&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Wed Mar 25 18:28:33 2009 @@ -175,12 +175,33 @@ } }; -/// getRegisterValueType - Look up and return the first ValueType of specified -/// RegisterClass record +/// getRegisterValueType - Look up and return the ValueType of the specified +/// register. If the register is a member of multiple register classes which +/// have different associated types, return MVT::Other. static MVT::SimpleValueType getRegisterValueType(Record *R, const CodeGenTarget &T) { - if (const CodeGenRegisterClass *RC = T.getRegisterClassForRegister(R)) - return RC->getValueTypeNum(0); - return MVT::Other; + int FoundRC = 0; + MVT::SimpleValueType VT = MVT::Other; + const std::vector &RCs = T.getRegisterClasses(); + std::vector::const_iterator RC; + std::vector::const_iterator Element; + + for (RC = RCs.begin() ; RC != RCs.end() ; RC++) { + Element = find((*RC).Elements.begin(), (*RC).Elements.end(), R); + if (Element != (*RC).Elements.end()) { + if (!FoundRC) { + FoundRC = 1; + VT = (*RC).getValueTypeNum(0); + } else { + // In multiple RC's + if (VT != (*RC).getValueTypeNum(0)) { + // Types of the RC's do not agree. Return MVT::Other. The + // target is responsible for handling this. + return MVT::Other; + } + } + } + } + return VT; } From isanbard at gmail.com Wed Mar 25 18:32:28 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 23:32:28 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67716 - in /llvm-gcc-4.2/branches/Apple/Dib/gcc/config: arm/darwin.h i386/darwin.h rs6000/darwin.h Message-ID: <200903252332.n2PNWS50029493@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 18:32:28 2009 New Revision: 67716 URL: http://llvm.org/viewvc/llvm-project?rev=67716&view=rev Log: --- Merging (from foreign repository) r67712 into '.': U gcc/config/i386/darwin.h U gcc/config/rs6000/darwin.h U gcc/config/arm/darwin.h Ignore -g* in LTO mode. Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/config/arm/darwin.h llvm-gcc-4.2/branches/Apple/Dib/gcc/config/i386/darwin.h llvm-gcc-4.2/branches/Apple/Dib/gcc/config/rs6000/darwin.h Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/config/arm/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/config/arm/darwin.h?rev=67716&r1=67715&r2=67716&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/config/arm/darwin.h (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/config/arm/darwin.h Wed Mar 25 18:32:28 2009 @@ -36,6 +36,8 @@ %{!fbuiltin-strcpy:-fno-builtin-strcpy} \ % References: <200903252232.n2PMWZQa025704@zion.cs.uiuc.edu> Message-ID: Hi Devang, Can you add a brief comment somewhere explaining why this is needed? It doesn't have to go into gruesome detail, just something simple like "on Darwin, debug info is not linked into executables, so -g with LTO will require special support" is enough for me. Thanks, Dan On Mar 25, 2009, at 3:32 PM, Devang Patel wrote: > Author: dpatel > Date: Wed Mar 25 17:32:35 2009 > New Revision: 67712 > > URL: http://llvm.org/viewvc/llvm-project?rev=67712&view=rev > Log: > Ignore -g* in LTO mode. > > Modified: > llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h > llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h > llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h > > Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=67712&r1=67711&r2=67712&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Wed Mar 25 17:32:35 > 2009 > @@ -36,6 +36,8 @@ > %{!fbuiltin-strcpy:-fno-builtin-strcpy} \ > % % +"/* LLVM LOCAL ignore -g in LTO mode */"\ > +%{O4|flto: % % > #undef LIB_SPEC > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h?rev=67712&r1=67711&r2=67712&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h Wed Mar 25 17:32:35 > 2009 > @@ -101,6 +101,8 @@ > %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: % > (darwin_cc1_minversion)}} \ > "/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */"\ > % % + "/* LLVM LOCAL ignore -g in LTO mode */"\ > + %{O4|flto: % %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused- > debug-symbols }}" > > /* APPLE LOCAL AltiVec */ > > Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h?rev=67712&r1=67711&r2=67712&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Wed Mar 25 > 17:32:35 2009 > @@ -114,6 +114,8 @@ > "/* APPLE LOCAL ARM 5683689 */"\ > %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: % > (darwin_cc1_minversion)}} \ > "/* APPLE LOCAL -fast or -fastf or -fastcp */"\ > + "/* LLVM LOCAL ignore -g in LTO mode */"\ > + %{O4|flto: % %{!mkernel:%{!static:%{!fast:%{!fastf:%{!fastcp:%{!mdynamic-no- > pic:-fPIC}}}}}}" > > #define DARWIN_ARCH_SPEC "%{m64:ppc64;:ppc}" > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Wed Mar 25 18:38:07 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 25 Mar 2009 16:38:07 -0700 Subject: [llvm-commits] [llvm] r67714 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp In-Reply-To: <200903252328.n2PNSYMV029265@zion.cs.uiuc.edu> References: <200903252328.n2PNSYMV029265@zion.cs.uiuc.edu> Message-ID: <98963199-92A8-41AE-9762-AB74752D91F0@apple.com> Hi Jim, On Mar 25, 2009, at 4:28 PM, Jim Grosbach wrote: > > + int FoundRC = 0; Please use bool, false, and true, instead of int, 0, and 1 here. Thanks, Dan From dpatel at apple.com Wed Mar 25 18:54:54 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 25 Mar 2009 23:54:54 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67718 - in /llvm-gcc-4.2/trunk/gcc/config: arm/darwin.h i386/darwin.h rs6000/darwin.h Message-ID: <200903252354.n2PNsscO030845@zion.cs.uiuc.edu> Author: dpatel Date: Wed Mar 25 18:54:53 2009 New Revision: 67718 URL: http://llvm.org/viewvc/llvm-project?rev=67718&view=rev Log: Add comment explaining why -g* ignored in LTO mode on darwin. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=67718&r1=67717&r2=67718&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Wed Mar 25 18:54:53 2009 @@ -37,6 +37,8 @@ % References: <200903252232.n2PMWZQa025704@zion.cs.uiuc.edu> Message-ID: <118109FB-77A1-4933-8556-9DBF97DCFD91@apple.com> ok. done. - Devang On Mar 25, 2009, at 4:34 PM, Dan Gohman wrote: > Hi Devang, > > Can you add a brief comment somewhere explaining why > this is needed? It doesn't have to go into gruesome detail, > just something simple like "on Darwin, debug info is > not linked into executables, so -g with LTO will require > special support" is enough for me. > > Thanks, > > Dan > > On Mar 25, 2009, at 3:32 PM, Devang Patel wrote: > >> Author: dpatel >> Date: Wed Mar 25 17:32:35 2009 >> New Revision: 67712 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=67712&view=rev >> Log: >> Ignore -g* in LTO mode. >> >> Modified: >> llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h >> llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h >> llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h >> >> Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h >> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=67712&r1=67711&r2=67712&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original) >> +++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Wed Mar 25 17:32:35 >> 2009 >> @@ -36,6 +36,8 @@ >> %{!fbuiltin-strcpy:-fno-builtin-strcpy} \ >> %> %> +"/* LLVM LOCAL ignore -g in LTO mode */"\ >> +%{O4|flto: %> %> >> #undef LIB_SPEC >> >> Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h >> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h?rev=67712&r1=67711&r2=67712&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h (original) >> +++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h Wed Mar 25 17:32:35 >> 2009 >> @@ -101,6 +101,8 @@ >> %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: % >> (darwin_cc1_minversion)}} \ >> "/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */"\ >> %> %> + "/* LLVM LOCAL ignore -g in LTO mode */"\ >> + %{O4|flto: %> %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused- >> debug-symbols }}" >> >> /* APPLE LOCAL AltiVec */ >> >> Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h >> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h?rev=67712&r1=67711&r2=67712&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h (original) >> +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Wed Mar 25 >> 17:32:35 2009 >> @@ -114,6 +114,8 @@ >> "/* APPLE LOCAL ARM 5683689 */"\ >> %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: % >> (darwin_cc1_minversion)}} \ >> "/* APPLE LOCAL -fast or -fastf or -fastcp */"\ >> + "/* LLVM LOCAL ignore -g in LTO mode */"\ >> + %{O4|flto: %> %{!mkernel:%{!static:%{!fast:%{!fastf:%{!fastcp:%{!mdynamic-no- >> pic:-fPIC}}}}}}" >> >> #define DARWIN_ARCH_SPEC "%{m64:ppc64;:ppc}" >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Wed Mar 25 18:57:48 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 25 Mar 2009 23:57:48 -0000 Subject: [llvm-commits] [llvm] r67719 - in /llvm/trunk: lib/Analysis/LoopPass.cpp lib/Transforms/Scalar/LoopIndexSplit.cpp test/Transforms/LICM/2009-03-25-AliasSetTracker.ll Message-ID: <200903252357.n2PNvm4T031027@zion.cs.uiuc.edu> Author: dpatel Date: Wed Mar 25 18:57:48 2009 New Revision: 67719 URL: http://llvm.org/viewvc/llvm-project?rev=67719&view=rev Log: Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block. Added: llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll Modified: llvm/trunk/lib/Analysis/LoopPass.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=67719&r1=67718&r2=67719&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Wed Mar 25 18:57:48 2009 @@ -152,6 +152,13 @@ /// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes. void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) { + if (BasicBlock *BB = dyn_cast(V)) { + for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; + ++BI) { + Instruction &I = *BI; + deleteSimpleAnalysisValue(&I, L); + } + } for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); LoopPass *LP = dynamic_cast(P); Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=67719&r1=67718&r2=67719&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Wed Mar 25 18:57:48 2009 @@ -673,6 +673,7 @@ while (!WorkList.empty()) { BasicBlock *BB = WorkList.back(); WorkList.pop_back(); + LPM->deleteSimpleAnalysisValue(BB, LP); for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end(); BBI != BBE; ) { Instruction *I = BBI; @@ -680,7 +681,6 @@ I->replaceAllUsesWith(UndefValue::get(I->getType())); I->eraseFromParent(); } - LPM->deleteSimpleAnalysisValue(BB, LP); DT->eraseNode(BB); DF->removeBlock(BB); LI->removeBlock(BB); Added: llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll?rev=67719&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll (added) +++ llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll Wed Mar 25 18:57:48 2009 @@ -0,0 +1,39 @@ + +; RUN: llvm-as < %s | opt -licm -loop-index-split -instcombine -disable-output + + %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } + %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } +@"\01LC81" = external constant [4 x i8] ; <[4 x i8]*> [#uses=1] + +define fastcc void @hex_dump_internal(i8* %avcl, %struct.FILE* %f, i32 %level, i8* nocapture %buf, i32 %size) nounwind { +entry: + br i1 false, label %bb4, label %return + +bb4: ; preds = %bb30, %entry + br label %bb6 + +bb6: ; preds = %bb15, %bb4 + %j.0.reg2mem.0 = phi i32 [ %2, %bb15 ], [ 0, %bb4 ] ; [#uses=2] + %0 = icmp slt i32 %j.0.reg2mem.0, 0 ; [#uses=1] + br i1 %0, label %bb7, label %bb13 + +bb7: ; preds = %bb6 + br label %bb15 + +bb13: ; preds = %bb6 + %1 = tail call i32 @fwrite(i8* getelementptr ([4 x i8]* @"\01LC81", i32 0, i32 0), i32 1, i32 3, i8* null) nounwind ; [#uses=0] + br label %bb15 + +bb15: ; preds = %bb13, %bb7 + %2 = add i32 %j.0.reg2mem.0, 1 ; [#uses=2] + %3 = icmp sgt i32 %2, 15 ; [#uses=1] + br i1 %3, label %bb30, label %bb6 + +bb30: ; preds = %bb15 + br i1 false, label %bb4, label %return + +return: ; preds = %bb30, %entry + ret void +} + +declare i32 @fwrite(i8* nocapture, i32, i32, i8* nocapture) nounwind From gohman at apple.com Wed Mar 25 20:11:22 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 25 Mar 2009 18:11:22 -0700 Subject: [llvm-commits] DAGCombiner Patch: Allow targets to do combinefirst. In-Reply-To: References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> <49C7BDD8.1070301@mxc.ca> <200903240714.15380.baldrick@free.fr> <28167C61-6F2F-470D-A5FC-ACBA8EC222EC@apple.com> Message-ID: On Mar 25, 2009, at 6:46 AM, Sanjiv.Gupta at microchip.com wrote: > > Did you mean that we have a separate regclass posing mem bytes as regs > and lower things after regalloc is done? We do not even have membyte > to > membyte copy insn. Well, TBH, I did not quite understand it. Here's a quick sketch of how this might work for an accumulator-style architecture: Tell instruction selection that there's an add instruction that operates from registers, in addition to the one that takes an operand from memory. Do this for all similar instructions. Run the optimizer and codegen. Since there's only one physical register, any time there are two distinct virtual registers being used by a single instruction, one of them will need to be spilled, and the reload can be folded into the instruction. It would be worthwhile to see if anyone has done this kind of thing before. Dan From dalej at apple.com Wed Mar 25 20:15:07 2009 From: dalej at apple.com (Dale Johannesen) Date: Thu, 26 Mar 2009 01:15:07 -0000 Subject: [llvm-commits] [llvm] r67724 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <200903260115.n2Q1F7m5002784@zion.cs.uiuc.edu> Author: johannes Date: Wed Mar 25 20:15:07 2009 New Revision: 67724 URL: http://llvm.org/viewvc/llvm-project?rev=67724&view=rev Log: Skip debug info one more place. (This one gets called from llc, not opt, but it's an IR level optimization nevertheless.) Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=67724&r1=67723&r2=67724&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Wed Mar 25 20:15:07 2009 @@ -20,6 +20,7 @@ #include "llvm/Function.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Pass.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" @@ -350,15 +351,20 @@ BasicBlock *Pred = *PI; // To be usable, the pred has to end with an uncond branch to the dest. BranchInst *PredBr = dyn_cast(Pred->getTerminator()); - if (!PredBr || !PredBr->isUnconditional() || - // Must be empty other than the branch. - &Pred->front() != PredBr || - // Cannot be the entry block; its label does not get emitted. - Pred == &(Dest->getParent()->getEntryBlock())) + if (!PredBr || !PredBr->isUnconditional()) + continue; + // Must be empty other than the branch and debug info. + BasicBlock::iterator I = Pred->begin(); + while (isa(I)) + I++; + if (dyn_cast(I) != PredBr) + continue; + // Cannot be the entry block; its label does not get emitted. + if (Pred == &(Dest->getParent()->getEntryBlock())) continue; // Finally, since we know that Dest has phi nodes in it, we have to make - // sure that jumping to Pred will have the same affect as going to Dest in + // sure that jumping to Pred will have the same effect as going to Dest in // terms of PHI values. PHINode *PN; unsigned PHINo = 0; From gohman at apple.com Wed Mar 25 20:21:22 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 25 Mar 2009 18:21:22 -0700 Subject: [llvm-commits] DAGCombiner Patch: Allow targets to do combinefirst. In-Reply-To: References: <200903231054.n2NAsfHR030210@zion.cs.uiuc.edu> <49C7BDD8.1070301@mxc.ca> <200903240714.15380.baldrick@free.fr> <28167C61-6F2F-470D-A5FC-ACBA8EC222EC@apple.com> Message-ID: <2AA5F598-D144-4CC8-B85B-D8DD3DAC6EA0@apple.com> On Mar 25, 2009, at 6:46 AM, Sanjiv.Gupta at microchip.com wrote: > To be specific, in our case the caller directly saves > the arguments on callee's stack and hence those extra stores generated > by clang to store the argvals to callee's frame indices are > unwanted. I > mentioned the problem in case you might get some better ideas to solve > the problem. The mem2reg pass typically cleans up stores like those. Do I guess correctly that you're not running the optimizer at all? Dan From isanbard at gmail.com Wed Mar 25 20:46:57 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 01:46:57 -0000 Subject: [llvm-commits] [llvm] r67727 - /llvm/trunk/lib/Target/X86/X86ISelLowering.h Message-ID: <200903260146.n2Q1kvB2004648@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 20:46:56 2009 New Revision: 67727 URL: http://llvm.org/viewvc/llvm-project?rev=67727&view=rev Log: Doxygen-ify comments. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=67727&r1=67726&r2=67727&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Mar 25 20:46:56 2009 @@ -654,8 +654,8 @@ bool invSrc = false) const; /// Utility function to emit atomic min and max. It takes the min/max - // instruction to expand, the associated basic block, and the associated - // cmov opcode for moving the min or max value. + /// instruction to expand, the associated basic block, and the associated + /// cmov opcode for moving the min or max value. MachineBasicBlock *EmitAtomicMinMaxWithCustomInserter(MachineInstr *BInstr, MachineBasicBlock *BB, unsigned cmovOpc) const; From isanbard at gmail.com Wed Mar 25 20:47:50 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 01:47:50 -0000 Subject: [llvm-commits] [llvm] r67728 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200903260147.n2Q1loiX004707@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 20:47:50 2009 New Revision: 67728 URL: http://llvm.org/viewvc/llvm-project?rev=67728&view=rev Log: Match this pattern so that we can generate simpler code: %a = ... %b = and i32 %a, 2 %c = srl i32 %b, 1 %d = br i32 %c, into %a = ... %b = and %a, 2 %c = X86ISD::CMP %b, 0 %d = X86ISD::BRCOND %c ... This applies only when the AND constant value has one bit set and the SRL constant is equal to the log2 of the AND constant. The back-end is smart enough to convert the result into a TEST/JMP sequence. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67728&r1=67727&r2=67728&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Mar 25 20:47:50 2009 @@ -5870,6 +5870,45 @@ CC = DAG.getConstant(CCode, MVT::i8); Cond = Cond.getOperand(0).getOperand(1); addTest = false; + } else if (Cond.hasOneUse() && Cond.getOpcode() == ISD::SRL) { + // Match this pattern so that we can generate simpler code: + // + // %a = ... + // %b = and i32 %a, 2 + // %c = srl i32 %b, 1 + // %d = br i32 %c, + // + // into + // + // %a = ... + // %b = and %a, 2 + // %c = X86ISD::CMP %b, 0 + // %d = X86ISD::BRCOND %c ... + // + // This applies only when the AND constant value has one bit set and the + // SRL constant is equal to the log2 of the AND constant. The back-end is + // smart enough to convert the result into a TEST/JMP sequence. + SDValue Op0 = Cond.getOperand(0); + SDValue Op1 = Cond.getOperand(1); + + if (Op0.getOpcode() == ISD::AND && + Op0.hasOneUse() && + Op1.getOpcode() == ISD::Constant) { + SDValue AndOp0 = Op0.getOperand(0); + SDValue AndOp1 = Op0.getOperand(1); + + if (AndOp1.getOpcode() == ISD::Constant) { + const APInt &AndConst = cast(AndOp1)->getAPIntValue(); + + if (AndConst.isPowerOf2() && + cast(Op1)->getAPIntValue()==AndConst.logBase2()) { + CC = DAG.getConstant(X86::COND_NE, MVT::i8); + Cond = EmitTest(Op0, X86::COND_NE, DAG); + return DAG.getNode(X86ISD::BRCOND, dl, Op.getValueType(), + Chain, Dest, CC, Cond); + } + } + } } } From isanbard at gmail.com Wed Mar 25 20:52:47 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 01:52:47 -0000 Subject: [llvm-commits] [llvm] r67729 - /llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903260152.n2Q1qlbM005061@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 20:52:47 2009 New Revision: 67729 URL: http://llvm.org/viewvc/llvm-project?rev=67729&view=rev Log: Add testcase for r67728. Added: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Added: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67729&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Wed Mar 25 20:52:47 2009 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | llc -o %t +; RUN: not grep and %t +; RUN: not grep shr %t +; rdar://6661955 + + at hello = internal constant [7 x i8] c"hello\0A\00" + at world = internal constant [7 x i8] c"world\0A\00" + +define void @func(i32* %b) { +bb1579.i.i: ; preds = %bb1514.i.i, %bb191.i.i + %tmp176 = load i32* %b, align 4 + %tmp177 = and i32 %tmp176, 2 + %tmp178 = icmp eq i32 %tmp177, 0 + br i1 %tmp178, label %hello, label %world + +hello: + %h = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @hello, i32 0, i32 0)) + ret void + +world: + %w = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @world, i32 0, i32 0)) + ret void +} + +declare i32 @printf(i8*, ...) nounwind From isanbard at gmail.com Wed Mar 25 20:54:23 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 01:54:23 -0000 Subject: [llvm-commits] [llvm] r67730 - in /llvm/branches/Apple/Dib: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903260154.n2Q1sNof005161@zion.cs.uiuc.edu> Author: void Date: Wed Mar 25 20:54:23 2009 New Revision: 67730 URL: http://llvm.org/viewvc/llvm-project?rev=67730&view=rev Log: --- Merging (from foreign repository) r67728 into '.': U lib/Target/X86/X86ISelLowering.cpp A test/CodeGen/X86/2009-03-25-TestBug.ll Match this pattern so that we can generate simpler code: %a = ... %b = and i32 %a, 2 %c = srl i32 %b, 1 %d = br i32 %c, into %a = ... %b = and %a, 2 %c = X86ISD::CMP %b, 0 %d = X86ISD::BRCOND %c ... This applies only when the AND constant value has one bit set and the SRL constant is equal to the log2 of the AND constant. The back-end is smart enough to convert the result into a TEST/JMP sequence. Added: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp?rev=67730&r1=67729&r2=67730&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Wed Mar 25 20:54:23 2009 @@ -5870,6 +5870,45 @@ CC = DAG.getConstant(CCode, MVT::i8); Cond = Cond.getOperand(0).getOperand(1); addTest = false; + } else if (Cond.hasOneUse() && Cond.getOpcode() == ISD::SRL) { + // Match this pattern so that we can generate simpler code: + // + // %a = ... + // %b = and i32 %a, 2 + // %c = srl i32 %b, 1 + // %d = br i32 %c, + // + // into + // + // %a = ... + // %b = and %a, 2 + // %c = X86ISD::CMP %b, 0 + // %d = X86ISD::BRCOND %c ... + // + // This applies only when the AND constant value has one bit set and the + // SRL constant is equal to the log2 of the AND constant. The back-end is + // smart enough to convert the result into a TEST/JMP sequence. + SDValue Op0 = Cond.getOperand(0); + SDValue Op1 = Cond.getOperand(1); + + if (Op0.getOpcode() == ISD::AND && + Op0.hasOneUse() && + Op1.getOpcode() == ISD::Constant) { + SDValue AndOp0 = Op0.getOperand(0); + SDValue AndOp1 = Op0.getOperand(1); + + if (AndOp1.getOpcode() == ISD::Constant) { + const APInt &AndConst = cast(AndOp1)->getAPIntValue(); + + if (AndConst.isPowerOf2() && + cast(Op1)->getAPIntValue()==AndConst.logBase2()) { + CC = DAG.getConstant(X86::COND_NE, MVT::i8); + Cond = EmitTest(Op0, X86::COND_NE, DAG); + return DAG.getNode(X86ISD::BRCOND, dl, Op.getValueType(), + Chain, Dest, CC, Cond); + } + } + } } } Added: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67730&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Wed Mar 25 20:54:23 2009 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | llc -o %t +; RUN: not grep and %t +; RUN: not grep shr %t +; rdar://6661955 + + at hello = internal constant [7 x i8] c"hello\0A\00" + at world = internal constant [7 x i8] c"world\0A\00" + +define void @func(i32* %b) { +bb1579.i.i: ; preds = %bb1514.i.i, %bb191.i.i + %tmp176 = load i32* %b, align 4 + %tmp177 = and i32 %tmp176, 2 + %tmp178 = icmp eq i32 %tmp177, 0 + br i1 %tmp178, label %hello, label %world + +hello: + %h = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @hello, i32 0, i32 0)) + ret void + +world: + %w = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @world, i32 0, i32 0)) + ret void +} + +declare i32 @printf(i8*, ...) nounwind From nicholas at mxc.ca Wed Mar 25 22:12:08 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 25 Mar 2009 20:12:08 -0700 Subject: [llvm-commits] embedded metadata preview In-Reply-To: <49C1EAA0.2060405@mxc.ca> References: <49BB6E93.9050802@mxc.ca> <49BF3557.8050409@mxc.ca> <7E811979-29E7-4C6D-AA1F-09BD0D7ABFC9@apple.com> <49C1EAA0.2060405@mxc.ca> Message-ID: <49CAF288.6060305@mxc.ca> Ping! Chris, you asked to review this before I committed it, since it is a large blob of new code. I know you're busy, but I'd appreciate being able to get it out of my tree :) See attachment here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090316/075433.html no need to fill everyone's inboxes with it again. Nick Nick Lewycky wrote: > Dan Gohman wrote: >> On Mar 16, 2009, at 10:29 PM, Nick Lewycky wrote: >> >>> Dan Gohman wrote: >>>> Hi Nick, >>>> >>>> Here are a few review comments. >>>> >>>>> Index: lib/Bitcode/Writer/BitcodeWriter.cpp >>>>> =================================================================== >>>>> --- lib/Bitcode/Writer/BitcodeWriter.cpp (revision 66999) >>>>> +++ lib/Bitcode/Writer/BitcodeWriter.cpp (working copy) >>>>> @@ -677,6 +677,17 @@ >>>>> Record.push_back(CE->getPredicate()); >>>>> break; >>>>> } >>>>> + } else if (const MDString *S = dyn_cast(C)) { >>>>> + Code = bitc::CST_CODE_MDSTRING; >>>>> + Record.push_back(S->length()); >>>>> + for (unsigned i = 0, e = S->length(); i != e; ++i) >>>>> + Record.push_back(S->begin()[i]); >>>> It seems pretty inefficient to put each char in a uint64_t. >>>> Forgive me for prematurely optimizing :-). >>> No that's fine, I just copied this out of the handling for strings in >>> inline-asm under the assumption that it must be fine. >>> >>> I tried adding "AbbrevToUse = String8Abbrev;" here but that causes a >>> crash ("Invalid abbrev for record"). I'm not really familiar with this >>> code, do you know how it's supposed to work? (If not I'm sure I can >>> figure it out...) >> >> I'm not familiar with this code either. >> >>>>> Index: docs/LangRef.html >>>>> =================================================================== >>>>> --- docs/LangRef.html (revision 66999) >>>>> +++ docs/LangRef.html (working copy) >>>>> @@ -1847,6 +1848,14 @@ >>>>> large arrays) and is always exactly equivalent to using explicit >>>> zero >>>>> initializers. >>>>> >>>>> + >>>>> +
    Metadata node
    >>>>> + >>>>> +
    A metadata node is a structure-like constant with the type >>>> of an empty >>>>> + struct. For example: "{ } !{ i32 0, { } !"test" }". >>>> Unlike other >>>>> + constants that are meant to be interpreted as part of the >>>> instruction stream, >>>>> + metadata is a place to attach additional information such as >>>> debug info. >>>> >>>> It would be helpful to mention that this is also expected to be >>>> used for >>>> encoding information that will be used by optimizations. >>> I'm actually thinking of removing any mention of them here and only >>> talking about them under the "Embedded Metadata" section. Thoughts? >>> >>> I added this as the last paragraph in that section: >>> "Optimizations may rely on metadata to provide additional information >>> about the program that isn't available in the instructions, or that >>> isn't easily computable. Similarly, the code generator may expect a >>> certain metadata format to be used to express debugging information." >>> >>> Close enough? :) >> >> Sounds reasonable. >> >>>> Why do MDString and MDNode inherit from Constant instead of, say, >>>> User? I >>>> see that ConstantLastVal is moved to include MDStringVal and >>>> MDNodeVal, >>>> presumably for the same reason. >>> I tried that initially, where MDNode was a User and MDString was a >>> Value. In practise, they seem to have semantics much closer to that of >>> Constants; they're uniqued / pointer comparable and they're global. The >>> point where it really made a difference was in the .ll parser, >>> switching >>> them over to being Constant made the parser changes much simpler. >> >> The parser parts are not present in the patch. That may be a reason >> why it wasn't clear why Constant is used. > > That was accidental. They don't turn up in 'svn diff' unless I > explicitly ask for 'svn diff lib/AsmParser'. > > Here, I've attached a newer version of the patch which ought to include > everything. > > Thanks for the review! > > Nick > >> Thanks, >> >> Dan From echeng at apple.com Thu Mar 26 00:18:49 2009 From: echeng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 22:18:49 -0700 Subject: [llvm-commits] [llvm] r67728 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200903260147.n2Q1loiX004707@zion.cs.uiuc.edu> References: <200903260147.n2Q1loiX004707@zion.cs.uiuc.edu> Message-ID: <9F2E313E-9F7F-4666-AC3D-2CC37079F709@apple.com> Hi Bill, Thanks. But shouldn't this be a target independent dag combine? Also, what's the code being generated? On x86, AND c + CMP 0 == TEST c, right? Evan On Mar 25, 2009, at 6:47 PM, Bill Wendling wrote: > Author: void > Date: Wed Mar 25 20:47:50 2009 > New Revision: 67728 > > URL: http://llvm.org/viewvc/llvm-project?rev=67728&view=rev > Log: > Match this pattern so that we can generate simpler code: > > %a = ... > %b = and i32 %a, 2 > %c = srl i32 %b, 1 > %d = br i32 %c, > > into > > %a = ... > %b = and %a, 2 > %c = X86ISD::CMP %b, 0 > %d = X86ISD::BRCOND %c ... > > This applies only when the AND constant value has one bit set and > the SRL > constant is equal to the log2 of the AND constant. The back-end is > smart enough > to convert the result into a TEST/JMP sequence. > > Modified: > llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67728&r1=67727&r2=67728&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Mar 25 > 20:47:50 2009 > @@ -5870,6 +5870,45 @@ > CC = DAG.getConstant(CCode, MVT::i8); > Cond = Cond.getOperand(0).getOperand(1); > addTest = false; > + } else if (Cond.hasOneUse() && Cond.getOpcode() == ISD::SRL) { > + // Match this pattern so that we can generate simpler code: > + // > + // %a = ... > + // %b = and i32 %a, 2 > + // %c = srl i32 %b, 1 > + // %d = br i32 %c, > + // > + // into > + // > + // %a = ... > + // %b = and %a, 2 > + // %c = X86ISD::CMP %b, 0 > + // %d = X86ISD::BRCOND %c ... > + // > + // This applies only when the AND constant value has one bit > set and the > + // SRL constant is equal to the log2 of the AND constant. The > back-end is > + // smart enough to convert the result into a TEST/JMP sequence. > + SDValue Op0 = Cond.getOperand(0); > + SDValue Op1 = Cond.getOperand(1); > + > + if (Op0.getOpcode() == ISD::AND && > + Op0.hasOneUse() && > + Op1.getOpcode() == ISD::Constant) { > + SDValue AndOp0 = Op0.getOperand(0); > + SDValue AndOp1 = Op0.getOperand(1); > + > + if (AndOp1.getOpcode() == ISD::Constant) { > + const APInt &AndConst = cast(AndOp1)- > >getAPIntValue(); > + > + if (AndConst.isPowerOf2() && > + cast(Op1)->getAPIntValue() > ==AndConst.logBase2()) { > + CC = DAG.getConstant(X86::COND_NE, MVT::i8); > + Cond = EmitTest(Op0, X86::COND_NE, DAG); > + return DAG.getNode(X86ISD::BRCOND, dl, Op.getValueType(), > + Chain, Dest, CC, Cond); > + } > + } > + } > } > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Thu Mar 26 00:25:59 2009 From: sabre at nondot.org (Chris Lattner) Date: Thu, 26 Mar 2009 05:25:59 -0000 Subject: [llvm-commits] [llvm] r67736 - /llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Message-ID: <200903260525.n2Q5PxIg016907@zion.cs.uiuc.edu> Author: lattner Date: Thu Mar 26 00:25:59 2009 New Revision: 67736 URL: http://llvm.org/viewvc/llvm-project?rev=67736&view=rev Log: fix warning in -asserts build. Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=67736&r1=67735&r2=67736&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Mar 26 00:25:59 2009 @@ -1388,8 +1388,7 @@ addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset()); } else if (RetOpcode == PPC::TCRETURNri) { MBBI = prior(MBB.end()); - MachineOperand &JumpTarget = MBBI->getOperand(0); - assert(JumpTarget.isReg() && "Expecting register operand."); + assert(MBBI->getOperand(0).isReg() && "Expecting register operand."); BuildMI(MBB, MBBI, dl, TII.get(PPC::TAILBCTR)); } else if (RetOpcode == PPC::TCRETURNai) { MBBI = prior(MBB.end()); @@ -1402,8 +1401,7 @@ addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset()); } else if (RetOpcode == PPC::TCRETURNri8) { MBBI = prior(MBB.end()); - MachineOperand &JumpTarget = MBBI->getOperand(0); - assert(JumpTarget.isReg() && "Expecting register operand."); + assert(MBBI->getOperand(0).isReg() && "Expecting register operand."); BuildMI(MBB, MBBI, dl, TII.get(PPC::TAILBCTR8)); } else if (RetOpcode == PPC::TCRETURNai8) { MBBI = prior(MBB.end()); From sabre at nondot.org Thu Mar 26 00:28:15 2009 From: sabre at nondot.org (Chris Lattner) Date: Thu, 26 Mar 2009 05:28:15 -0000 Subject: [llvm-commits] [llvm] r67737 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Message-ID: <200903260528.n2Q5SFxA017025@zion.cs.uiuc.edu> Author: lattner Date: Thu Mar 26 00:28:14 2009 New Revision: 67737 URL: http://llvm.org/viewvc/llvm-project?rev=67737&view=rev Log: fix an apparently real bug exposed by a warning in -asserts mode. Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=67737&r1=67736&r2=67737&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Mar 26 00:28:14 2009 @@ -948,13 +948,14 @@ // to 32 bits. Insert an assert[sz]ext to capture this, then // truncate to the right size. if (VA.getLocInfo() != CCValAssign::Full) { - unsigned Opcode; + unsigned Opcode = 0; if (VA.getLocInfo() == CCValAssign::SExt) Opcode = ISD::AssertSext; else if (VA.getLocInfo() == CCValAssign::ZExt) Opcode = ISD::AssertZext; - ArgValue = DAG.getNode(Opcode, dl, RegVT, ArgValue, - DAG.getValueType(VA.getValVT())); + if (Opcode) + ArgValue = DAG.getNode(Opcode, dl, RegVT, ArgValue, + DAG.getValueType(VA.getValVT())); ArgValue = DAG.getNode(ISD::TRUNCATE, dl, VA.getValVT(), ArgValue); } From sabre at nondot.org Thu Mar 26 00:28:26 2009 From: sabre at nondot.org (Chris Lattner) Date: Thu, 26 Mar 2009 05:28:26 -0000 Subject: [llvm-commits] [llvm] r67738 - /llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Message-ID: <200903260528.n2Q5SQrO017050@zion.cs.uiuc.edu> Author: lattner Date: Thu Mar 26 00:28:26 2009 New Revision: 67738 URL: http://llvm.org/viewvc/llvm-project?rev=67738&view=rev Log: fix some warnings in release-asserts mode. Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp?rev=67738&r1=67737&r2=67738&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Thu Mar 26 00:28:26 2009 @@ -182,8 +182,7 @@ void MipsInstrInfo:: storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned SrcReg, bool isKill, int FI, - const TargetRegisterClass *RC) const -{ + const TargetRegisterClass *RC) const { unsigned Opc; DebugLoc DL = DebugLoc::getUnknownLoc(); @@ -193,11 +192,11 @@ Opc = Mips::SW; else if (RC == Mips::FGR32RegisterClass) Opc = Mips::SWC1; - else if (RC == Mips::AFGR64RegisterClass) + else { + assert(RC == Mips::AFGR64RegisterClass); Opc = Mips::SDC1; - else - assert(0 && "Can't store this register to stack slot"); - + } + BuildMI(MBB, I, DL, get(Opc)).addReg(SrcReg, false, false, isKill) .addImm(0).addFrameIndex(FI); } @@ -211,11 +210,11 @@ Opc = Mips::SW; else if (RC == Mips::FGR32RegisterClass) Opc = Mips::SWC1; - else if (RC == Mips::AFGR64RegisterClass) + else { + assert(RC == Mips::AFGR64RegisterClass); Opc = Mips::SDC1; - else - assert(0 && "Can't store this register"); - + } + DebugLoc DL = DebugLoc::getUnknownLoc(); MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc)) .addReg(SrcReg, false, false, isKill); @@ -235,11 +234,11 @@ Opc = Mips::LW; else if (RC == Mips::FGR32RegisterClass) Opc = Mips::LWC1; - else if (RC == Mips::AFGR64RegisterClass) + else { + assert(RC == Mips::AFGR64RegisterClass); Opc = Mips::LDC1; - else - assert(0 && "Can't load this register from stack slot"); - + } + DebugLoc DL = DebugLoc::getUnknownLoc(); if (I != MBB.end()) DL = I->getDebugLoc(); BuildMI(MBB, I, DL, get(Opc), DestReg).addImm(0).addFrameIndex(FI); @@ -254,10 +253,10 @@ Opc = Mips::LW; else if (RC == Mips::FGR32RegisterClass) Opc = Mips::LWC1; - else if (RC == Mips::AFGR64RegisterClass) + else { + assert(RC == Mips::AFGR64RegisterClass); Opc = Mips::LDC1; - else - assert(0 && "Can't load this register"); + } DebugLoc DL = DebugLoc::getUnknownLoc(); MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg); @@ -307,10 +306,10 @@ if (RC == Mips::FGR32RegisterClass) { LoadOpc = Mips::LWC1; StoreOpc = Mips::SWC1; - } else if (RC == Mips::AFGR64RegisterClass) { + } else { + assert(RC == Mips::AFGR64RegisterClass); LoadOpc = Mips::LDC1; StoreOpc = Mips::SDC1; - } else - assert(0 && "foldMemoryOperandImpl register unknown"); + } if (Ops[0] == 0) { // COPY -> STORE unsigned SrcReg = MI->getOperand(1).getReg(); From sabre at nondot.org Thu Mar 26 00:29:34 2009 From: sabre at nondot.org (Chris Lattner) Date: Thu, 26 Mar 2009 05:29:34 -0000 Subject: [llvm-commits] [llvm] r67739 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Message-ID: <200903260529.n2Q5TY7I017117@zion.cs.uiuc.edu> Author: lattner Date: Thu Mar 26 00:29:34 2009 New Revision: 67739 URL: http://llvm.org/viewvc/llvm-project?rev=67739&view=rev Log: fix warning in -asserts mode. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=67739&r1=67738&r2=67739&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Thu Mar 26 00:29:34 2009 @@ -1503,7 +1503,6 @@ return SDValue(); // Wasn't a constant vector or splat exceeded min uint64_t SplatBits = APSplatBits.getZExtValue(); - unsigned SplatSize = SplatBitSize / 8; switch (VT.getSimpleVT()) { default: @@ -1514,17 +1513,17 @@ /*NOTREACHED*/ case MVT::v4f32: { uint32_t Value32 = uint32_t(SplatBits); - assert(SplatSize == 4 + assert(SplatBitSize == 32 && "LowerBUILD_VECTOR: Unexpected floating point vector element."); // NOTE: pretend the constant is an integer. LLVM won't load FP constants SDValue T = DAG.getConstant(Value32, MVT::i32); return DAG.getNode(ISD::BIT_CONVERT, dl, MVT::v4f32, - DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, T, T, T, T)); + DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, T,T,T,T)); break; } case MVT::v2f64: { uint64_t f64val = uint64_t(SplatBits); - assert(SplatSize == 8 + assert(SplatBitSize == 64 && "LowerBUILD_VECTOR: 64-bit float vector size > 8 bytes."); // NOTE: pretend the constant is an integer. LLVM won't load FP constants SDValue T = DAG.getConstant(f64val, MVT::i64); From isanbard at gmail.com Thu Mar 26 00:32:21 2009 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 25 Mar 2009 22:32:21 -0700 Subject: [llvm-commits] [llvm] r67728 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <9F2E313E-9F7F-4666-AC3D-2CC37079F709@apple.com> References: <200903260147.n2Q1loiX004707@zion.cs.uiuc.edu> <9F2E313E-9F7F-4666-AC3D-2CC37079F709@apple.com> Message-ID: On Mar 25, 2009, at 10:18 PM, Evan Cheng wrote: > Hi Bill, > > Thanks. But shouldn't this be a target independent dag combine? > I'll see if it's feasible. > Also, what's the code being generated? The code generated before this was something like: mov 12(%esp), %eax and $2, %eax shr %eax test %eax, %eax je ... Now it's just test $2, 12(%esp) je ... > On x86, AND c + CMP 0 == TEST c, right? > Yes. -bw From sabre at nondot.org Thu Mar 26 00:51:18 2009 From: sabre at nondot.org (Chris Lattner) Date: Thu, 26 Mar 2009 05:51:18 -0000 Subject: [llvm-commits] [llvm] r67740 - /llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903260551.n2Q5pIRq018286@zion.cs.uiuc.edu> Author: lattner Date: Thu Mar 26 00:51:18 2009 New Revision: 67740 URL: http://llvm.org/viewvc/llvm-project?rev=67740&view=rev Log: no need for eh info Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67740&r1=67739&r2=67740&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Thu Mar 26 00:51:18 2009 @@ -6,7 +6,7 @@ @hello = internal constant [7 x i8] c"hello\0A\00" @world = internal constant [7 x i8] c"world\0A\00" -define void @func(i32* %b) { +define void @func(i32* %b) nounwind { bb1579.i.i: ; preds = %bb1514.i.i, %bb191.i.i %tmp176 = load i32* %b, align 4 %tmp177 = and i32 %tmp176, 2 From isanbard at gmail.com Thu Mar 26 01:14:09 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 06:14:09 -0000 Subject: [llvm-commits] [llvm] r67742 - in /llvm/trunk/lib: CodeGen/SelectionDAG/DAGCombiner.cpp Target/X86/X86ISelLowering.cpp Message-ID: <200903260614.n2Q6EAWP019582@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 01:14:09 2009 New Revision: 67742 URL: http://llvm.org/viewvc/llvm-project?rev=67742&view=rev Log: Pull transform from target-dependent code into target-independent code. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=67742&r1=67741&r2=67742&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Mar 26 01:14:09 2009 @@ -4355,6 +4355,55 @@ N1.getOperand(0), N1.getOperand(1), N2); } + if (N1.hasOneUse() && N1.getOpcode() == ISD::SRL) { + // Match this pattern so that we can generate simpler code: + // + // %a = ... + // %b = and i32 %a, 2 + // %c = srl i32 %b, 1 + // brcond i32 %c ... + // + // into + // + // %a = ... + // %b = and %a, 2 + // %c = setcc eq %b, 0 + // brcond %c ... + // + // This applies only when the AND constant value has one bit set and the + // SRL constant is equal to the log2 of the AND constant. The back-end is + // smart enough to convert the result into a TEST/JMP sequence. + SDValue Op0 = N1.getOperand(0); + SDValue Op1 = N1.getOperand(1); + + if (Op0.getOpcode() == ISD::AND && + Op0.hasOneUse() && + Op1.getOpcode() == ISD::Constant) { + SDValue AndOp0 = Op0.getOperand(0); + SDValue AndOp1 = Op0.getOperand(1); + + if (AndOp1.getOpcode() == ISD::Constant) { + const APInt &AndConst = cast(AndOp1)->getAPIntValue(); + + if (AndConst.isPowerOf2() && + cast(Op1)->getAPIntValue()==AndConst.logBase2()) { + SDValue SetCC = + DAG.getSetCC(N->getDebugLoc(), + TLI.getSetCCResultType(Op0.getValueType()), + Op0, DAG.getConstant(0, Op0.getValueType()), + ISD::SETNE); + + // Replace the uses of SRL with SETCC + DAG.ReplaceAllUsesOfValueWith(N1, SetCC); + removeFromWorkList(N1.getNode()); + DAG.DeleteNode(N1.getNode()); + return DAG.getNode(ISD::BRCOND, N->getDebugLoc(), + MVT::Other, Chain, SetCC, N2); + } + } + } + } + return SDValue(); } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67742&r1=67741&r2=67742&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Mar 26 01:14:09 2009 @@ -5870,45 +5870,6 @@ CC = DAG.getConstant(CCode, MVT::i8); Cond = Cond.getOperand(0).getOperand(1); addTest = false; - } else if (Cond.hasOneUse() && Cond.getOpcode() == ISD::SRL) { - // Match this pattern so that we can generate simpler code: - // - // %a = ... - // %b = and i32 %a, 2 - // %c = srl i32 %b, 1 - // %d = br i32 %c, - // - // into - // - // %a = ... - // %b = and %a, 2 - // %c = X86ISD::CMP %b, 0 - // %d = X86ISD::BRCOND %c ... - // - // This applies only when the AND constant value has one bit set and the - // SRL constant is equal to the log2 of the AND constant. The back-end is - // smart enough to convert the result into a TEST/JMP sequence. - SDValue Op0 = Cond.getOperand(0); - SDValue Op1 = Cond.getOperand(1); - - if (Op0.getOpcode() == ISD::AND && - Op0.hasOneUse() && - Op1.getOpcode() == ISD::Constant) { - SDValue AndOp0 = Op0.getOperand(0); - SDValue AndOp1 = Op0.getOperand(1); - - if (AndOp1.getOpcode() == ISD::Constant) { - const APInt &AndConst = cast(AndOp1)->getAPIntValue(); - - if (AndConst.isPowerOf2() && - cast(Op1)->getAPIntValue()==AndConst.logBase2()) { - CC = DAG.getConstant(X86::COND_NE, MVT::i8); - Cond = EmitTest(Op0, X86::COND_NE, DAG); - return DAG.getNode(X86ISD::BRCOND, dl, Op.getValueType(), - Chain, Dest, CC, Cond); - } - } - } } } From isanbard at gmail.com Thu Mar 26 01:15:57 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 06:15:57 -0000 Subject: [llvm-commits] [llvm] r67743 - in /llvm/branches/Apple/Dib/lib: CodeGen/SelectionDAG/DAGCombiner.cpp Target/X86/X86ISelLowering.cpp Message-ID: <200903260615.n2Q6FwZm019686@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 01:15:57 2009 New Revision: 67743 URL: http://llvm.org/viewvc/llvm-project?rev=67743&view=rev Log: --- Merging (from foreign repository) r67742 into '.': U lib/CodeGen/SelectionDAG/DAGCombiner.cpp U lib/Target/X86/X86ISelLowering.cpp Pull target-dependent transform into target-independent code. Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=67743&r1=67742&r2=67743&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Mar 26 01:15:57 2009 @@ -4355,6 +4355,55 @@ N1.getOperand(0), N1.getOperand(1), N2); } + if (N1.hasOneUse() && N1.getOpcode() == ISD::SRL) { + // Match this pattern so that we can generate simpler code: + // + // %a = ... + // %b = and i32 %a, 2 + // %c = srl i32 %b, 1 + // brcond i32 %c ... + // + // into + // + // %a = ... + // %b = and %a, 2 + // %c = setcc eq %b, 0 + // brcond %c ... + // + // This applies only when the AND constant value has one bit set and the + // SRL constant is equal to the log2 of the AND constant. The back-end is + // smart enough to convert the result into a TEST/JMP sequence. + SDValue Op0 = N1.getOperand(0); + SDValue Op1 = N1.getOperand(1); + + if (Op0.getOpcode() == ISD::AND && + Op0.hasOneUse() && + Op1.getOpcode() == ISD::Constant) { + SDValue AndOp0 = Op0.getOperand(0); + SDValue AndOp1 = Op0.getOperand(1); + + if (AndOp1.getOpcode() == ISD::Constant) { + const APInt &AndConst = cast(AndOp1)->getAPIntValue(); + + if (AndConst.isPowerOf2() && + cast(Op1)->getAPIntValue()==AndConst.logBase2()) { + SDValue SetCC = + DAG.getSetCC(N->getDebugLoc(), + TLI.getSetCCResultType(Op0.getValueType()), + Op0, DAG.getConstant(0, Op0.getValueType()), + ISD::SETNE); + + // Replace the uses of SRL with SETCC + DAG.ReplaceAllUsesOfValueWith(N1, SetCC); + removeFromWorkList(N1.getNode()); + DAG.DeleteNode(N1.getNode()); + return DAG.getNode(ISD::BRCOND, N->getDebugLoc(), + MVT::Other, Chain, SetCC, N2); + } + } + } + } + return SDValue(); } Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp?rev=67743&r1=67742&r2=67743&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Thu Mar 26 01:15:57 2009 @@ -5870,45 +5870,6 @@ CC = DAG.getConstant(CCode, MVT::i8); Cond = Cond.getOperand(0).getOperand(1); addTest = false; - } else if (Cond.hasOneUse() && Cond.getOpcode() == ISD::SRL) { - // Match this pattern so that we can generate simpler code: - // - // %a = ... - // %b = and i32 %a, 2 - // %c = srl i32 %b, 1 - // %d = br i32 %c, - // - // into - // - // %a = ... - // %b = and %a, 2 - // %c = X86ISD::CMP %b, 0 - // %d = X86ISD::BRCOND %c ... - // - // This applies only when the AND constant value has one bit set and the - // SRL constant is equal to the log2 of the AND constant. The back-end is - // smart enough to convert the result into a TEST/JMP sequence. - SDValue Op0 = Cond.getOperand(0); - SDValue Op1 = Cond.getOperand(1); - - if (Op0.getOpcode() == ISD::AND && - Op0.hasOneUse() && - Op1.getOpcode() == ISD::Constant) { - SDValue AndOp0 = Op0.getOperand(0); - SDValue AndOp1 = Op0.getOperand(1); - - if (AndOp1.getOpcode() == ISD::Constant) { - const APInt &AndConst = cast(AndOp1)->getAPIntValue(); - - if (AndConst.isPowerOf2() && - cast(Op1)->getAPIntValue()==AndConst.logBase2()) { - CC = DAG.getConstant(X86::COND_NE, MVT::i8); - Cond = EmitTest(Op0, X86::COND_NE, DAG); - return DAG.getNode(X86ISD::BRCOND, dl, Op.getValueType(), - Chain, Dest, CC, Cond); - } - } - } } } From isanbard at gmail.com Thu Mar 26 01:17:54 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 06:17:54 -0000 Subject: [llvm-commits] [llvm] r67744 - /llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903260617.n2Q6HsOa019827@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 01:17:54 2009 New Revision: 67744 URL: http://llvm.org/viewvc/llvm-project?rev=67744&view=rev Log: Add -f to RUN line. Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67744&r1=67743&r2=67744&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Thu Mar 26 01:17:54 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o %t +; RUN: llvm-as < %s | llc -o %t -f ; RUN: not grep and %t ; RUN: not grep shr %t ; rdar://6661955 From isanbard at gmail.com Thu Mar 26 01:18:16 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 06:18:16 -0000 Subject: [llvm-commits] [llvm] r67745 - /llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903260618.n2Q6IGLW019854@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 01:18:16 2009 New Revision: 67745 URL: http://llvm.org/viewvc/llvm-project?rev=67745&view=rev Log: Add -f to RUN line. Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67745&r1=67744&r2=67745&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Thu Mar 26 01:18:16 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o %t +; RUN: llvm-as < %s | llc -o %t -f ; RUN: not grep and %t ; RUN: not grep shr %t ; rdar://6661955 From echeng at apple.com Thu Mar 26 01:21:00 2009 From: echeng at apple.com (Evan Cheng) Date: Wed, 25 Mar 2009 23:21:00 -0700 Subject: [llvm-commits] [llvm] r67728 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: References: <200903260147.n2Q1loiX004707@zion.cs.uiuc.edu> <9F2E313E-9F7F-4666-AC3D-2CC37079F709@apple.com> Message-ID: On Mar 25, 2009, at 10:32 PM, Bill Wendling wrote: > On Mar 25, 2009, at 10:18 PM, Evan Cheng wrote: > >> Hi Bill, >> >> Thanks. But shouldn't this be a target independent dag combine? >> > I'll see if it's feasible. > >> Also, what's the code being generated? > > The code generated before this was something like: > > mov 12(%esp), %eax > and $2, %eax > shr %eax > test %eax, %eax > je ... > > Now it's just > > test $2, 12(%esp) > je ... > >> On x86, AND c + CMP 0 == TEST c, right? >> > Yes. Cool. Thanks. Evan > > -bw > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Thu Mar 26 03:47:26 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 26 Mar 2009 09:47:26 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r67718 - in /llvm-gcc-4.2/trunk/gcc/config: arm/darwin.h i386/darwin.h rs6000/darwin.h In-Reply-To: <200903252354.n2PNsscO030845@zion.cs.uiuc.edu> References: <200903252354.n2PNsscO030845@zion.cs.uiuc.edu> Message-ID: <200903260947.27631.baldrick@free.fr> Hi Devang, > "/* LLVM LOCAL ignore -g in LTO mode */"\ > +"/* On Darwin, debug info is extracting in .dSYM files. */"\ not sure what this says. Maybe "On Darwin, debug info is stored in .dSYM files."? > +"/* This requires sepcial support in LTO mode. */" \ sepcial -> special Ciao, Duncan. From baldrick at free.fr Thu Mar 26 03:53:37 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 26 Mar 2009 09:53:37 +0100 Subject: [llvm-commits] [llvm] r67701 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/CodeGen/CellSPU/and_ops.ll test/CodeGen/CellSPU/eqv.ll test/CodeGen/CellSPU/nand.ll test/CodeGen/CellSPU/or_ops.ll test/CodeGen/CellSPU/shift_ops.ll test/CodeGen/CellSPU/stores.ll test/CodeGen/CellSPU/struct_1.ll test/CodeGen/X86/2007-08-10-SignExtSubreg.ll test/CodeGen/X86/20090313-signext.ll test/CodeGen/X86/const-select.ll test/CodeGen/X86/sext-trunc.ll test/CodeGen/X86/split-eh-lpad-edges.ll In-Reply-To: <200903252020.n2PKKCQC017757@zion.cs.uiuc.edu> References: <200903252020.n2PKKCQC017757@zion.cs.uiuc.edu> Message-ID: <200903260953.37317.baldrick@free.fr> Hi Evan, > Revert 67132. This is breaking some objective-c apps. do you have a simple objc testcase? Ciao, Duncan. From mikael.lepisto at tut.fi Thu Mar 26 06:35:41 2009 From: mikael.lepisto at tut.fi (=?ISO-8859-1?Q?Mikael_Lepist=F6?=) Date: Thu, 26 Mar 2009 13:35:41 +0200 Subject: [llvm-commits] [PATCH] Added TCE target to llvm-gcc Message-ID: <49CB688D.8070606@tut.fi> Hi, We are about to release our TCE toolset (with MIT license), which utilises LLVM and llvm-gcc. Toolset depends on our patched llvm-gcc version which contains target for building a cross-compiler which outputs suitable llvm bitcode for our target processor. It would be very useful, if target would be applied to official source so we wouldn't need to offer our patched version of llvm-gcc sources. Best regards, Mikael Lepist? Tampere University Of Technology http://tce.cs.tut.fi ps. Next I'm planning to add some ALWAYS_EMIT_LLVM type define, which actually would hardcode --emit-llvm switch to be always set and compiler called binutils to be llvm-ld, llvm-as, llvm-ar, and so on. That would be useful also for future backends, which are only ment to output byte code and never processors native code. -------------- next part -------------- A non-text attachment was scrubbed... Name: tcepatch_for_llvm_gcc_2.5.diff Type: text/x-patch Size: 49425 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090326/2c71b02f/attachment.bin From baldrick at free.fr Thu Mar 26 08:05:48 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 26 Mar 2009 14:05:48 +0100 Subject: [llvm-commits] [PATCH] Added TCE target to llvm-gcc In-Reply-To: <49CB688D.8070606@tut.fi> References: <49CB688D.8070606@tut.fi> Message-ID: <200903261405.48884.baldrick@free.fr> Hi, are you planning to get this target into mainline gcc at some point? Why do you only emit bitcode - are you planning to implement an LLVM code generator for your target? Finally, does this break the llvm-gcc build if llvm-gcc is configured with LLVM support disabled? Ciao, Duncan. From mikael.lepisto at tut.fi Thu Mar 26 09:01:45 2009 From: mikael.lepisto at tut.fi (=?UTF-8?B?TWlrYWVsIExlcGlzdMO2?=) Date: Thu, 26 Mar 2009 16:01:45 +0200 Subject: [llvm-commits] [PATCH] Added TCE target to llvm-gcc In-Reply-To: <200903261405.48884.baldrick@free.fr> References: <49CB688D.8070606@tut.fi> <200903261405.48884.baldrick@free.fr> Message-ID: <49CB8AC9.80308@tut.fi> Duncan Sands wrote: > Hi, are you planning to get this target into mainline gcc > at some point? I don't think that it's possible since we generate new version of our backend for each processor configuration (with different instruction sets and registers) and load it as a plugin to our own llc replacement. This replacement also converts llvm bitcode to our native format. > Why do you only emit bitcode - are you > planning to implement an LLVM code generator for your > target? In short: We already have LLVM code generator, but it's quite different approach that usual llvm backends... We do linking and optimizing on llvm IR (also linking static newlib to program). After we have fully linked bitcode we build code generation plugin which contains information about customizes resources of the processor. That plugin generates our native IR out of bitcode and use generated IR for scheduling program to a specific processor configuration. So basically bitcode programs are universal programs, which can be converted to run on any different processor configuration. For more information on tce.cs.tut.fi page contains tutorials and videos about the system. There is also a masters thesis about to be released (in few months) which covers our compiler chain. > Finally, does this break the llvm-gcc build if > llvm-gcc is configured with LLVM support disabled? > Looks like it compiled fine without special --target setting. However --target=tce-llvm without --enable-llvm failed. Patch has really small changes to configure system just for recognizing that new --target=tce-llvm target exists. > Ciao, > > Duncan. > Mikael From stefanus.dutoit at rapidmind.com Thu Mar 26 09:05:34 2009 From: stefanus.dutoit at rapidmind.com (Stefanus Du Toit) Date: Thu, 26 Mar 2009 10:05:34 -0400 Subject: [llvm-commits] Ping! [PATCH] Fwd: Docs:added: fix for missing x86 target library in windows References: <49B59097.3080502@rapidmind.com> Message-ID: <89CDBFD4-DCDA-4550-B3D6-9E1698B8BACE@rapidmind.com> Just thought I would ping this patch in the hopes that someone might apply it. It's a simple docs patch that points out a step necessary to make Visual Studio projects work with LLVM if one wants to use the JIT. Figuring this out caused us some frustration, so hopefully this will help others in the same boat. Begin forwarded message: > From: Tareq Siraj > Date: March 9, 2009 5:56:39 PM GMT-04:00 > To: "llvm-commits at cs.uiuc.edu" > Subject: [llvm-commits] Docs:added: fix for missing x86 target > library in windows > Reply-To: Commit Messages and Patches for LLVM > > > As discussed in #llvm, added documentation about the fix for missing > x86 > target library in windows under the "Common problems" section. > > -- > Regards, > Tareq Ahmed Siraj > RapidMind Inc. > http://www.rapidmind.com > -------------- next part -------------- A non-text attachment was scrubbed... Name: GettingStartedVS.html.patch Type: text/x-diff Size: 897 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090326/cfdae034/attachment.bin -------------- next part -------------- -- Stefanus Du Toit RapidMind Inc. phone: +1 519 885 5455 x116 -- fax: +1 519 885 1463 From grosbach at apple.com Thu Mar 26 09:45:34 2009 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 26 Mar 2009 14:45:34 -0000 Subject: [llvm-commits] [llvm] r67750 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200903261445.n2QEjYxh027493@zion.cs.uiuc.edu> Author: grosbach Date: Thu Mar 26 09:45:34 2009 New Revision: 67750 URL: http://llvm.org/viewvc/llvm-project?rev=67750&view=rev Log: Use 'bool' for FoundRC Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=67750&r1=67749&r2=67750&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Mar 26 09:45:34 2009 @@ -179,7 +179,7 @@ /// register. If the register is a member of multiple register classes which /// have different associated types, return MVT::Other. static MVT::SimpleValueType getRegisterValueType(Record *R, const CodeGenTarget &T) { - int FoundRC = 0; + bool FoundRC = false; MVT::SimpleValueType VT = MVT::Other; const std::vector &RCs = T.getRegisterClasses(); std::vector::const_iterator RC; @@ -189,7 +189,7 @@ Element = find((*RC).Elements.begin(), (*RC).Elements.end(), R); if (Element != (*RC).Elements.end()) { if (!FoundRC) { - FoundRC = 1; + FoundRC = true; VT = (*RC).getValueTypeNum(0); } else { // In multiple RC's From arnold.schwaighofer at gmail.com Thu Mar 26 10:50:20 2009 From: arnold.schwaighofer at gmail.com (Arnold Schwaighofer) Date: Thu, 26 Mar 2009 16:50:20 +0100 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> Message-ID: Hello Bill, this change seems to prevent llvm from building on Mac OS X 10.4.11 on x86 and apparently ppc (http://llvm.org/bugs/show_bug.cgi?id=3867) with the following error message. llvm[3]: Linking Debug Loadable Module LLVMHello.dylib /usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o LC_LOAD_DYLINKER load command in object file (should not be in an input file to the link editor for the output file type MH_DYLIB) collect2: ld returned 1 exit status If i revert r67469 llvm builds again. But ld will complain about referenced symbols that are not exported. lvm[2]: Linking Debug executable llvm-as /usr/bin/ld: warning symbol: _NXArgc referenced dynamically and must be exported ... Reverting r67468 will get rid of those warnings. regards arnold On Sun, Mar 22, 2009 at 9:56 AM, Bill Wendling wrote: > Author: void > Date: Sun Mar 22 03:56:15 2009 > New Revision: 67469 > > URL: http://llvm.org/viewvc/llvm-project?rev=67469&view=rev > Log: > Really should pass -dylib to the linker... > > Modified: > ? ?llvm/trunk/Makefile.rules > > Modified: llvm/trunk/Makefile.rules > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=67469&r1=67468&r2=67469&view=diff > > ============================================================================== > --- llvm/trunk/Makefile.rules (original) > +++ llvm/trunk/Makefile.rules Sun Mar 22 03:56:15 2009 > @@ -435,7 +435,7 @@ > ? # Get "4" out of 10.4 for later pieces in the makefile. > ? DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') > > - ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -dylib \ > + ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ > ? ? ? ? ? ? ? ? ? ? -mmacosx-version-min=$(DARWIN_VERSION) > ? CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) > ?else > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From echeng at apple.com Thu Mar 26 11:13:44 2009 From: echeng at apple.com (Evan Cheng) Date: Thu, 26 Mar 2009 09:13:44 -0700 Subject: [llvm-commits] [llvm] r67701 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/CodeGen/CellSPU/and_ops.ll test/CodeGen/CellSPU/eqv.ll test/CodeGen/CellSPU/nand.ll test/CodeGen/CellSPU/or_ops.ll test/CodeGen/CellSPU/shift_ops.ll test/CodeGen/CellSPU/stores.ll test/CodeGen/CellSPU/struct_1.ll test/CodeGen/X86/2007-08-10-SignExtSubreg.ll test/CodeGen/X86/20090313-signext.ll test/CodeGen/X86/const-select.ll test/CodeGen/X86/sext-trunc.ll test/CodeGen/X86/split-eh-lpad-edges.ll In-Reply-To: <200903260953.37317.baldrick@free.fr> References: <200903252020.n2PKKCQC017757@zion.cs.uiuc.edu> <200903260953.37317.baldrick@free.fr> Message-ID: <043013F4-169B-4524-917A-E05EA3311060@apple.com> I don't have anything that I can share. Sorry. Evan On Mar 26, 2009, at 1:53 AM, Duncan Sands wrote: > Hi Evan, > >> Revert 67132. This is breaking some objective-c apps. > > do you have a simple objc testcase? > > Ciao, > > Duncan. From grosbach at apple.com Thu Mar 26 11:17:51 2009 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 26 Mar 2009 16:17:51 -0000 Subject: [llvm-commits] [llvm] r67758 - in /llvm/trunk/utils/TableGen: ClangDiagnosticsEmitter.cpp CodeGenDAGPatterns.cpp CodeGenDAGPatterns.h CodeGenIntrinsics.h DAGISelEmitter.cpp IntrinsicEmitter.cpp SubtargetEmitter.cpp TGParser.cpp TGSourceMgr.cpp Message-ID: <200903261617.n2QGHpCW000631@zion.cs.uiuc.edu> Author: grosbach Date: Thu Mar 26 11:17:51 2009 New Revision: 67758 URL: http://llvm.org/viewvc/llvm-project?rev=67758&view=rev Log: fix a few spelling errors and typos Modified: llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h llvm/trunk/utils/TableGen/CodeGenIntrinsics.h llvm/trunk/utils/TableGen/DAGISelEmitter.cpp llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp llvm/trunk/utils/TableGen/SubtargetEmitter.cpp llvm/trunk/utils/TableGen/TGParser.cpp llvm/trunk/utils/TableGen/TGSourceMgr.cpp Modified: llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Thu Mar 26 11:17:51 2009 @@ -24,7 +24,7 @@ using namespace llvm; //===----------------------------------------------------------------------===// -// Generic routines for all Clang TableGen backens. +// Generic routines for all Clang TableGen backends. //===----------------------------------------------------------------------===// typedef std::vector RecordVector; Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Thu Mar 26 11:17:51 2009 @@ -352,7 +352,7 @@ default: // Too many VT's to pick from. case 0: break; // No info yet. case 1: - // Only one VT of this flavor. Cannot ever satisify the constraints. + // Only one VT of this flavor. Cannot ever satisfy the constraints. return NodeToApply->UpdateNodeType(MVT::Other, TP); // throw case 2: // If we have exactly two possible types, the little operand must be the @@ -1048,7 +1048,7 @@ /// canPatternMatch - If it is impossible for this pattern to match on this /// target, fill in Reason and return false. Otherwise, return true. This is -/// used as a santity check for .td files (to prevent people from writing stuff +/// used as a sanity check for .td files (to prevent people from writing stuff /// that can never possibly work), and to prevent the pattern permuter from /// generating stuff that is useless. bool TreePatternNode::canPatternMatch(std::string &Reason, @@ -1261,7 +1261,7 @@ } /// InferAllTypes - Infer/propagate as many types throughout the expression -/// patterns as possible. Return true if all types are infered, false +/// patterns as possible. Return true if all types are inferred, false /// otherwise. Throw an exception if a type contradiction is found. bool TreePattern::InferAllTypes() { bool MadeChange = true; @@ -1351,7 +1351,7 @@ Nodes.pop_back(); } - // Get the buildin intrinsic nodes. + // Get the builtin intrinsic nodes. intrinsic_void_sdnode = getSDNodeNamed("intrinsic_void"); intrinsic_w_chain_sdnode = getSDNodeNamed("intrinsic_w_chain"); intrinsic_wo_chain_sdnode = getSDNodeNamed("intrinsic_wo_chain"); @@ -1405,7 +1405,7 @@ DagInit *OpsList = Fragments[i]->getValueAsDag("Operands"); DefInit *OpsOp = dynamic_cast(OpsList->getOperator()); // Special cases: ops == outs == ins. Different names are used to - // improve readibility. + // improve readability. if (!OpsOp || (OpsOp->getDef()->getName() != "ops" && OpsOp->getDef()->getName() != "outs" && @@ -2260,9 +2260,9 @@ // Look up interesting info about the node. const SDNodeInfo &NodeInfo = CDP.getSDNodeInfo(N->getOperator()); - // If this node is associative, reassociate. + // If this node is associative, re-associate. if (NodeInfo.hasProperty(SDNPAssociative)) { - // Reassociate by pulling together all of the linked operators + // Re-associate by pulling together all of the linked operators std::vector MaximalChildren; GatherChildrenOfAssociativeOpcode(N, MaximalChildren); @@ -2366,7 +2366,7 @@ // Loop over all of the patterns we've collected, checking to see if we can // generate variants of the instruction, through the exploitation of - // identities. This permits the target to provide agressive matching without + // identities. This permits the target to provide aggressive matching without // the .td file having to contain tons of variants of instructions. // // Note that this loop adds new patterns to the PatternsToMatch list, but we Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h (original) +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h Thu Mar 26 11:17:51 2009 @@ -365,7 +365,7 @@ } /// InferAllTypes - Infer/propagate as many types throughout the expression - /// patterns as possible. Return true if all types are infered, false + /// patterns as possible. Return true if all types are inferred, false /// otherwise. Throw an exception if a type contradiction is found. bool InferAllTypes(); Modified: llvm/trunk/utils/TableGen/CodeGenIntrinsics.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenIntrinsics.h?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenIntrinsics.h (original) +++ llvm/trunk/utils/TableGen/CodeGenIntrinsics.h Thu Mar 26 11:17:51 2009 @@ -34,7 +34,7 @@ /// parameter values of an intrinsic. If the number of return values is > 1, /// then the intrinsic implicitly returns a first-class aggregate. The /// numbering of the types starts at 0 with the first return value and - /// continues from there throug the parameter list. This is useful for + /// continues from there through the parameter list. This is useful for /// "matching" types. struct IntrinsicSignature { /// RetVTs - The MVT::SimpleValueType for each return type. Note that this Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Mar 26 11:17:51 2009 @@ -1610,7 +1610,7 @@ // in this group share the same next line, emit it inline now. Do this // until we run out of common predicates. while (!ErasedPatterns && Patterns.back().second.back().first == 1) { - // Check that all of fhe patterns in Patterns end with the same predicate. + // Check that all of the patterns in Patterns end with the same predicate. bool AllEndWithSamePredicate = true; for (unsigned i = 0, e = Patterns.size(); i != e; ++i) if (Patterns[i].second.back() != Patterns.back().second.back()) { Modified: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Thu Mar 26 11:17:51 2009 @@ -236,7 +236,7 @@ } } -/// RecordListComparator - Provide a determinstic comparator for lists of +/// RecordListComparator - Provide a deterministic comparator for lists of /// records. namespace { typedef std::pair, std::vector > RecPair; Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Thu Mar 26 11:17:51 2009 @@ -78,7 +78,7 @@ if (CommandLineName.empty()) continue; - // Emit as { "feature", "decription", feactureEnum, i1 | i2 | ... | in } + // Emit as { "feature", "description", featureEnum, i1 | i2 | ... | in } OS << " { " << "\"" << CommandLineName << "\", " << "\"" << Desc << "\", " Modified: llvm/trunk/utils/TableGen/TGParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGParser.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TGParser.cpp (original) +++ llvm/trunk/utils/TableGen/TGParser.cpp Thu Mar 26 11:17:51 2009 @@ -527,7 +527,7 @@ std::string Val = Lex.getCurStrVal(); Lex.Lex(); - // Handle multiple consequtive concatenated strings. + // Handle multiple consecutive concatenated strings. while (Lex.getCode() == tgtok::StrVal) { Val += Lex.getCurStrVal(); Lex.Lex(); Modified: llvm/trunk/utils/TableGen/TGSourceMgr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGSourceMgr.cpp?rev=67758&r1=67757&r2=67758&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TGSourceMgr.cpp (original) +++ llvm/trunk/utils/TableGen/TGSourceMgr.cpp Thu Mar 26 11:17:51 2009 @@ -98,7 +98,7 @@ ++LineEnd; // Print out the line. OS << std::string(LineStart, LineEnd) << "\n"; - // Print out spaces before the carat. + // Print out spaces before the caret. for (const char *Pos = LineStart; Pos != ErrorLoc.getPointer(); ++Pos) OS << (*Pos == '\t' ? '\t' : ' '); OS << "^\n"; From vadve at cs.uiuc.edu Thu Mar 26 11:46:45 2009 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Thu, 26 Mar 2009 11:46:45 -0500 Subject: [llvm-commits] CVS: llvm-www/Users.html Message-ID: <200903261646.n2QGkjMa017711@maute.cs.uiuc.edu> Changes in directory llvm-www: Users.html updated: 1.48 -> 1.49 --- Log message: Added IcedTea (Zero). --- Diffs of the changes: (+15 -2) Users.html | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) Index: llvm-www/Users.html diff -u llvm-www/Users.html:1.48 llvm-www/Users.html:1.49 --- llvm-www/Users.html:1.48 Tue Jan 6 15:15:08 2009 +++ llvm-www/Users.html Thu Mar 26 11:45:50 2009 @@ -9,6 +9,10 @@ or another (mentioned it on llvmdev, published work on it, etc.). We believe there are many other users not listed here and would welcome a brief note telling us about your use so that we can add you to the list. +

    +This page has only brief entries. Some of these projects are +described in more detail on the + "Projects Using LLVM" page.

    Industry Users
    @@ -367,12 +371,21 @@ Description + + + + + IcedTea Version of Sun's OpenJDK + Uses LLVM as JIT on architectures other than x86 and Sparc. + + PyPy Project Python interpreter written in Python. Targets LLVM and C. - + Faust Signal Processing Language @@ -421,6 +434,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
    LLVM Development List
    - Last modified: $Date: 2009/01/06 21:15:08 $ + Last modified: $Date: 2009/03/26 16:45:50 $ From vadve at cs.uiuc.edu Thu Mar 26 11:56:08 2009 From: vadve at cs.uiuc.edu (Vikram Adve) Date: Thu, 26 Mar 2009 11:56:08 -0500 Subject: [llvm-commits] CVS: llvm-www/ProjectsWithLLVM/index.html Message-ID: <200903261656.n2QGu8fY018076@maute.cs.uiuc.edu> Changes in directory llvm-www/ProjectsWithLLVM: index.html updated: 1.46 -> 1.47 --- Log message: Added IcedTea. --- Diffs of the changes: (+31 -0) index.html | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+) Index: llvm-www/ProjectsWithLLVM/index.html diff -u llvm-www/ProjectsWithLLVM/index.html:1.46 llvm-www/ProjectsWithLLVM/index.html:1.47 --- llvm-www/ProjectsWithLLVM/index.html:1.46 Thu Jan 22 13:08:33 2009 +++ llvm-www/ProjectsWithLLVM/index.html Thu Mar 26 11:54:50 2009 @@ -35,6 +35,7 @@
      +
    • The IcedTea Version of Sun's OpenJDK
    • The Pure Programming Language Compiler
    • LDC Compiler for the D Programming Language
    • How to Write Your Own Compiler
    • @@ -65,6 +66,36 @@ + +
      +By Gary Benson (Red Hat, USA) +
      + +
      +

      +The IcedTea +project was formed to provide a harness to build OpenJDK +using only free software build tools and to provide replacements for +the not-yet free parts of OpenJDK. Over time, various extensions to +OpenJDK have been included in IcedTea. +

      +

      One of these extensions is +Zero. +OpenJDK only supports x86 and SPARC +processors; Zero is a processor-independent layer that allows OpenJDK +to build and run using any processor. Zero contains a JIT compiler +called Shark +which uses LLVM to provide native code generation without +introducing processor-dependent code. +

      +

      The development of Zero and Shark were funded by Red Hat. +

      +
      + + + From dpatel at apple.com Thu Mar 26 12:09:53 2009 From: dpatel at apple.com (Devang Patel) Date: Thu, 26 Mar 2009 17:09:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67763 - in /llvm-gcc-4.2/trunk/gcc/config: arm/darwin.h i386/darwin.h rs6000/darwin.h Message-ID: <200903261709.n2QH9rLl004378@zion.cs.uiuc.edu> Author: dpatel Date: Thu Mar 26 12:09:49 2009 New Revision: 67763 URL: http://llvm.org/viewvc/llvm-project?rev=67763&view=rev Log: Fix grammar. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=67763&r1=67762&r2=67763&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Thu Mar 26 12:09:49 2009 @@ -37,8 +37,8 @@ % Author: resistor Date: Thu Mar 26 13:53:38 2009 New Revision: 67764 URL: http://llvm.org/viewvc/llvm-project?rev=67764&view=rev Log: Don't assign a new stack slot if the pre-alloc splitter already assigned one. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=67764&r1=67763&r2=67764&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Mar 26 13:53:38 2009 @@ -1973,8 +1973,15 @@ } // One stack slot per live interval. - if (NeedStackSlot && vrm.getPreSplitReg(li.reg) == 0) - Slot = vrm.assignVirt2StackSlot(li.reg); + if (NeedStackSlot && vrm.getPreSplitReg(li.reg) == 0) { + if (vrm.getStackSlot(li.reg) == VirtRegMap::NO_STACK_SLOT) + Slot = vrm.assignVirt2StackSlot(li.reg); + + // This case only occurs when the prealloc splitter has already assigned + // a stack slot to this vreg. + else + Slot = vrm.getStackSlot(li.reg); + } // Create new intervals and rewrite defs and uses. for (LiveInterval::Ranges::const_iterator From evan.cheng at apple.com Thu Mar 26 14:09:01 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 26 Mar 2009 19:09:01 -0000 Subject: [llvm-commits] [llvm] r67765 - /llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Message-ID: <200903261909.n2QJ91Ws012303@zion.cs.uiuc.edu> Author: evancheng Date: Thu Mar 26 14:09:01 2009 New Revision: 67765 URL: http://llvm.org/viewvc/llvm-project?rev=67765&view=rev Log: tADDhirr is a thumb instruction. Do not allow this code to be reached in non-thumb mode. Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=67765&r1=67764&r2=67765&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Mar 26 14:09:01 2009 @@ -595,6 +595,8 @@ } } case ISD::ADD: { + if (!Subtarget->isThumb()) + break; // Select add sp, c to tADDhirr. SDValue N0 = Op.getOperand(0); SDValue N1 = Op.getOperand(1); From isanbard at gmail.com Thu Mar 26 15:07:24 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 13:07:24 -0700 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> Message-ID: <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> Hi Arnold, Please put VERBOSE=1 on the "make" command line and send me what command it's using to try to build LLVMHello.dylib. Thanks -bw On Thu, Mar 26, 2009 at 8:50 AM, Arnold Schwaighofer wrote: > Hello Bill, > > this change seems to prevent llvm from building on Mac OS X 10.4.11 on > x86 and apparently ppc (http://llvm.org/bugs/show_bug.cgi?id=3867) > with the following error message. > > llvm[3]: Linking Debug Loadable Module LLVMHello.dylib > /usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o > LC_LOAD_DYLINKER load command in object file (should not be in an > input file to the link editor for the output file type MH_DYLIB) > collect2: ld returned 1 exit status > > If i revert r67469 llvm builds again. But ld will complain about > referenced symbols that are not exported. > > lvm[2]: Linking Debug executable llvm-as > /usr/bin/ld: warning symbol: _NXArgc referenced dynamically and must be exported > ... > > Reverting r67468 will get rid of those warnings. > > regards arnold > > On Sun, Mar 22, 2009 at 9:56 AM, Bill Wendling wrote: >> Author: void >> Date: Sun Mar 22 03:56:15 2009 >> New Revision: 67469 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=67469&view=rev >> Log: >> Really should pass -dylib to the linker... >> >> Modified: >> ? ?llvm/trunk/Makefile.rules >> >> Modified: llvm/trunk/Makefile.rules >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=67469&r1=67468&r2=67469&view=diff >> >> ============================================================================== >> --- llvm/trunk/Makefile.rules (original) >> +++ llvm/trunk/Makefile.rules Sun Mar 22 03:56:15 2009 >> @@ -435,7 +435,7 @@ >> ? # Get "4" out of 10.4 for later pieces in the makefile. >> ? DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') >> >> - ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -dylib \ >> + ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ >> ? ? ? ? ? ? ? ? ? ? -mmacosx-version-min=$(DARWIN_VERSION) >> ? CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) >> ?else >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From foldr at codedgers.com Thu Mar 26 16:23:48 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Thu, 26 Mar 2009 21:23:48 -0000 Subject: [llvm-commits] [llvm] r67768 - /llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp Message-ID: <200903262123.n2QLNmhk020268@zion.cs.uiuc.edu> Author: foldr Date: Thu Mar 26 16:23:48 2009 New Revision: 67768 URL: http://llvm.org/viewvc/llvm-project?rev=67768&view=rev Log: Fix misc. small issues with debug visualization. Detailed bug report: http://llvm.org/bugs/show_bug.cgi?id=3873 Modified: llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp Modified: llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp?rev=67768&r1=67767&r2=67768&view=diff ============================================================================== --- llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp (original) +++ llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp Thu Mar 26 16:23:48 2009 @@ -465,6 +465,9 @@ // Check for cycles. ret += this->CheckCycles(); + if (!ret) + std::cerr << "check-graph: no errors found.\n"; + return ret; } @@ -520,7 +523,9 @@ std::ofstream O("compilation-graph.dot"); if (O.good()) { - llvm::WriteGraph(this, "compilation-graph"); + std::cerr << "Writing 'compilation-graph.dot' file..."; + llvm::WriteGraph(O, this); + std::cerr << "done.\n"; O.close(); } else { From evan.cheng at apple.com Thu Mar 26 16:50:00 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 26 Mar 2009 21:50:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67778 - /llvm-gcc-4.2/trunk/gcc/libgcov.c Message-ID: <200903262150.n2QLo2c6022052@zion.cs.uiuc.edu> Author: evancheng Date: Thu Mar 26 16:49:58 2009 New Revision: 67778 URL: http://llvm.org/viewvc/llvm-project?rev=67778&view=rev Log: Put back change in 66069 that got lost due to gcc merge. Modified: llvm-gcc-4.2/trunk/gcc/libgcov.c Modified: llvm-gcc-4.2/trunk/gcc/libgcov.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/libgcov.c?rev=67778&r1=67777&r2=67778&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/libgcov.c (original) +++ llvm-gcc-4.2/trunk/gcc/libgcov.c Thu Mar 26 16:49:58 2009 @@ -35,7 +35,7 @@ #include "tm.h" /* APPLE LOCAL begin instant off 6414141 */ -#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) +#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #include #if defined(VPROC_HAS_TRANSACTIONS) vproc_transaction_t vproc_transaction_begin(vproc_t virtual_proc) __attribute__((weak)); @@ -160,7 +160,7 @@ } /* APPLE LOCAL begin instant off 6414141 */ -#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) +#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #if defined(VPROC_HAS_TRANSACTIONS) static vproc_transaction_t gcov_trans; #endif From isanbard at gmail.com Thu Mar 26 16:52:36 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 21:52:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67779 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c Message-ID: <200903262152.n2QLqaIn022204@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 16:52:36 2009 New Revision: 67779 URL: http://llvm.org/viewvc/llvm-project?rev=67779&view=rev Log: --- Merging (from foreign repository) r67778 into '.': U gcc/libgcov.c Put back change in 66069 that got lost due to gcc merge. Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c?rev=67779&r1=67778&r2=67779&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c Thu Mar 26 16:52:36 2009 @@ -35,7 +35,7 @@ #include "tm.h" /* APPLE LOCAL begin instant off 6414141 */ -#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) +#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #include #if defined(VPROC_HAS_TRANSACTIONS) vproc_transaction_t vproc_transaction_begin(vproc_t virtual_proc) __attribute__((weak)); @@ -160,7 +160,7 @@ } /* APPLE LOCAL begin instant off 6414141 */ -#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) +#if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #if defined(VPROC_HAS_TRANSACTIONS) static vproc_transaction_t gcov_trans; #endif From gohman at apple.com Thu Mar 26 17:28:38 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 26 Mar 2009 22:28:38 -0000 Subject: [llvm-commits] [test-suite] r67781 - in /test-suite/trunk: TEST.nightly.Makefile TEST.nightly2.Makefile Message-ID: <200903262228.n2QMScJ9024173@zion.cs.uiuc.edu> Author: djg Date: Thu Mar 26 17:28:38 2009 New Revision: 67781 URL: http://llvm.org/viewvc/llvm-project?rev=67781&view=rev Log: OPTBETA tests depend on opt. CBE tests depend on LLC, now that the CBE is built into llc. Modified: test-suite/trunk/TEST.nightly.Makefile test-suite/trunk/TEST.nightly2.Makefile Modified: test-suite/trunk/TEST.nightly.Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.nightly.Makefile?rev=67781&r1=67780&r2=67781&view=diff ============================================================================== --- test-suite/trunk/TEST.nightly.Makefile (original) +++ test-suite/trunk/TEST.nightly.Makefile Thu Mar 26 17:28:38 2009 @@ -90,7 +90,7 @@ # OPT experimental tests $(PROGRAMS_TO_TEST:%=Output/%.nightly.opt-beta.report.txt): \ -Output/%.nightly.opt-beta.report.txt: Output/%.llvm.optbeta.bc Output/%.exe-opt-beta $(LLC) +Output/%.nightly.opt-beta.report.txt: Output/%.llvm.optbeta.bc Output/%.exe-opt-beta $(LOPT) @echo > $@ -head -n 100 Output/$*.exe-opt-beta >> $@ @-if test -f Output/$*.exe-opt-beta; then \ @@ -107,7 +107,7 @@ # CBE tests $(PROGRAMS_TO_TEST:%=Output/%.nightly.cbe.report.txt): \ -Output/%.nightly.cbe.report.txt: Output/%.llvm.bc Output/%.exe-cbe $(LDIS) +Output/%.nightly.cbe.report.txt: Output/%.llvm.bc Output/%.exe-cbe $(LLC) @echo > $@ -head -n 100 Output/$*.exe-cbe >> $@ @-if test -f Output/$*.exe-cbe; then \ @@ -150,4 +150,4 @@ @echo "---------------------------------------------------------------" @-cat $< -REPORT_DEPENDENCIES := $(LDIS) $(LLI) $(LLC) +REPORT_DEPENDENCIES := $(LOPT) $(LLI) $(LLC) Modified: test-suite/trunk/TEST.nightly2.Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.nightly2.Makefile?rev=67781&r1=67780&r2=67781&view=diff ============================================================================== --- test-suite/trunk/TEST.nightly2.Makefile (original) +++ test-suite/trunk/TEST.nightly2.Makefile Thu Mar 26 17:28:38 2009 @@ -90,7 +90,7 @@ # OPT experimental tests $(PROGRAMS_TO_TEST:%=Output/%.nightly.opt-beta.report.txt): \ -Output/%.nightly.opt-beta.report.txt: Output/%.llvm.optbeta.bc Output/%.exe-opt-beta $(LLC) +Output/%.nightly.opt-beta.report.txt: Output/%.llvm.optbeta.bc Output/%.exe-opt-beta $(LOPT) @echo > $@ -head -n 100 Output/$*.exe-opt-beta >> $@ @-if test -f Output/$*.exe-opt-beta; then \ @@ -107,7 +107,7 @@ # CBE tests $(PROGRAMS_TO_TEST:%=Output/%.nightly.cbe.report.txt): \ -Output/%.nightly.cbe.report.txt: Output/%.llvm.bc Output/%.exe-cbe $(LDIS) +Output/%.nightly.cbe.report.txt: Output/%.llvm.bc Output/%.exe-cbe $(LLC) @echo > $@ -head -n 100 Output/$*.exe-cbe >> $@ @-if test -f Output/$*.exe-cbe; then \ @@ -150,4 +150,4 @@ @echo "---------------------------------------------------------------" @-cat $< -REPORT_DEPENDENCIES := $(LDIS) $(LLI) $(LLC) +REPORT_DEPENDENCIES := $(LOPT) $(LLI) $(LLC) From gohman at apple.com Thu Mar 26 17:56:02 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 26 Mar 2009 22:56:02 -0000 Subject: [llvm-commits] [test-suite] r67782 - in /test-suite/trunk: TEST.nightly.Makefile TEST.nightly2.Makefile Message-ID: <200903262256.n2QMu2CJ025674@zion.cs.uiuc.edu> Author: djg Date: Thu Mar 26 17:56:02 2009 New Revision: 67782 URL: http://llvm.org/viewvc/llvm-project?rev=67782&view=rev Log: Don't generate the "compile" report if LLVM bytecode files are not being generated. And set REPORT_DEPENDENCIES according to the tools that are actually being tested. These changes make it easier to run the test-suite in native-only mode. Modified: test-suite/trunk/TEST.nightly.Makefile test-suite/trunk/TEST.nightly2.Makefile Modified: test-suite/trunk/TEST.nightly.Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.nightly.Makefile?rev=67782&r1=67781&r2=67782&view=diff ============================================================================== --- test-suite/trunk/TEST.nightly.Makefile (original) +++ test-suite/trunk/TEST.nightly.Makefile Thu Mar 26 17:56:02 2009 @@ -9,21 +9,27 @@ PROGDIR := $(PROJ_SRC_ROOT) RELDIR := $(subst $(PROGDIR),,$(CURDIR)) -REPORTS_TO_GEN := compile nat +REPORTS_TO_GEN := nat +REPORT_DEPENDENCIES := ifndef DISABLE_LLC -REPORTS_TO_GEN += llc +REPORTS_TO_GEN += llc compile +REPORT_DEPENDENCIES += $(LLC) $(LOPT) endif ifndef DISABLE_JIT -REPORTS_TO_GEN += jit +REPORTS_TO_GEN += jit compile +REPORT_DEPENDENCIES += $(LLI) $(LOPT) endif ifndef DISABLE_CBE -REPORTS_TO_GEN += cbe +REPORTS_TO_GEN += cbe compile +REPORT_DEPENDENCIES += $(CBE) $(LOPT) endif ifdef ENABLE_LLCBETA -REPORTS_TO_GEN += llc-beta +REPORTS_TO_GEN += llc-beta compile +REPORT_DEPENDENCIES += $(LLC) $(LOPT) endif ifdef ENABLE_OPTBETA -REPORTS_TO_GEN += opt-beta +REPORTS_TO_GEN += opt-beta compile +REPORT_DEPENDENCIES += $(LOPT) endif REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN)) @@ -149,5 +155,3 @@ @echo ">>> ========= '$(RELDIR)/$*' Program" @echo "---------------------------------------------------------------" @-cat $< - -REPORT_DEPENDENCIES := $(LOPT) $(LLI) $(LLC) Modified: test-suite/trunk/TEST.nightly2.Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.nightly2.Makefile?rev=67782&r1=67781&r2=67782&view=diff ============================================================================== --- test-suite/trunk/TEST.nightly2.Makefile (original) +++ test-suite/trunk/TEST.nightly2.Makefile Thu Mar 26 17:56:02 2009 @@ -9,21 +9,27 @@ PROGDIR := $(PROJ_SRC_ROOT) RELDIR := $(subst $(PROGDIR),,$(CURDIR)) -REPORTS_TO_GEN := compile nat +REPORTS_TO_GEN := nat +REPORT_DEPENDENCIES := ifndef DISABLE_LLC -REPORTS_TO_GEN += llc +REPORTS_TO_GEN += llc compile +REPORT_DEPENDENCIES += $(LLC) $(LOPT) endif ifndef DISABLE_JIT -REPORTS_TO_GEN += jit +REPORTS_TO_GEN += jit compile +REPORT_DEPENDENCIES += $(LLI) $(LOPT) endif ifndef DISABLE_CBE -REPORTS_TO_GEN += cbe +REPORTS_TO_GEN += cbe compile +REPORT_DEPENDENCIES += $(CBE) $(LOPT) endif ifdef ENABLE_LLCBETA -REPORTS_TO_GEN += llc-beta +REPORTS_TO_GEN += llc-beta compile +REPORT_DEPENDENCIES += $(LLC) $(LOPT) endif ifdef ENABLE_OPTBETA -REPORTS_TO_GEN += opt-beta +REPORTS_TO_GEN += opt-beta compile +REPORT_DEPENDENCIES += $(LOPT) endif REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN)) @@ -149,5 +155,3 @@ @echo ">>> ========= '$(RELDIR)/$*' Program" @echo "---------------------------------------------------------------" @-cat $< - -REPORT_DEPENDENCIES := $(LOPT) $(LLI) $(LLC) From evan.cheng at apple.com Thu Mar 26 18:03:32 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 26 Mar 2009 23:03:32 -0000 Subject: [llvm-commits] [llvm] r67783 - /llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903262303.n2QN3WB3026196@zion.cs.uiuc.edu> Author: evancheng Date: Thu Mar 26 18:03:32 2009 New Revision: 67783 URL: http://llvm.org/viewvc/llvm-project?rev=67783&view=rev Log: Add -march=x86. Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Modified: llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67783&r1=67782&r2=67783&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-03-25-TestBug.ll Thu Mar 26 18:03:32 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -o %t -f ; RUN: not grep and %t ; RUN: not grep shr %t ; rdar://6661955 From evan.cheng at apple.com Thu Mar 26 18:06:33 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 26 Mar 2009 23:06:33 -0000 Subject: [llvm-commits] [llvm] r67784 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200903262306.n2QN6XX0026420@zion.cs.uiuc.edu> Author: evancheng Date: Thu Mar 26 18:06:32 2009 New Revision: 67784 URL: http://llvm.org/viewvc/llvm-project?rev=67784&view=rev Log: -no-implicit-float means explicit fp operations are legal. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67784&r1=67783&r2=67784&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Mar 26 18:06:32 2009 @@ -500,7 +500,7 @@ } // Long double always uses X87. - if (!UseSoftFloat && !NoImplicitFloat) { + if (!UseSoftFloat) { addRegisterClass(MVT::f80, X86::RFP80RegisterClass); setOperationAction(ISD::UNDEF, MVT::f80, Expand); setOperationAction(ISD::FCOPYSIGN, MVT::f80, Expand); @@ -589,7 +589,7 @@ // FIXME: In order to prevent SSE instructions being expanded to MMX ones // with -msoft-float, disable use of MMX as well. - if (!UseSoftFloat && !NoImplicitFloat && !DisableMMX && Subtarget->hasMMX()) { + if (!UseSoftFloat && !DisableMMX && Subtarget->hasMMX()) { addRegisterClass(MVT::v8i8, X86::VR64RegisterClass); addRegisterClass(MVT::v4i16, X86::VR64RegisterClass); addRegisterClass(MVT::v2i32, X86::VR64RegisterClass); @@ -669,7 +669,7 @@ setOperationAction(ISD::SELECT, MVT::v1i64, Custom); } - if (!UseSoftFloat && !NoImplicitFloat && Subtarget->hasSSE1()) { + if (!UseSoftFloat && Subtarget->hasSSE1()) { addRegisterClass(MVT::v4f32, X86::VR128RegisterClass); setOperationAction(ISD::FADD, MVT::v4f32, Legal); @@ -686,7 +686,7 @@ setOperationAction(ISD::VSETCC, MVT::v4f32, Custom); } - if (!UseSoftFloat && !NoImplicitFloat && Subtarget->hasSSE2()) { + if (!UseSoftFloat && Subtarget->hasSSE2()) { addRegisterClass(MVT::v2f64, X86::VR128RegisterClass); // FIXME: Unfortunately -soft-float and -no-implicit-float means XMM From isanbard at gmail.com Thu Mar 26 18:10:18 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 23:10:18 -0000 Subject: [llvm-commits] [llvm] r67785 - in /llvm/branches/Apple/Dib: lib/Target/ARM/ARMISelDAGToDAG.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2009-03-25-TestBug.ll Message-ID: <200903262310.n2QNAJ0m026637@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 18:10:18 2009 New Revision: 67785 URL: http://llvm.org/viewvc/llvm-project?rev=67785&view=rev Log: --- Merging (from foreign repository) r67765 into '.': U lib/Target/ARM/ARMISelDAGToDAG.cpp --- Merging (from foreign repository) r67784 into '.': U lib/Target/X86/X86ISelLowering.cpp -no-implicit-float means explicit fp operations are legal. --- Merging (from foreign repository) r67783 into '.': U test/CodeGen/X86/2009-03-25-TestBug.ll Add -march=x86. Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Modified: llvm/branches/Apple/Dib/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=67785&r1=67784&r2=67785&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Mar 26 18:10:18 2009 @@ -595,6 +595,8 @@ } } case ISD::ADD: { + if (!Subtarget->isThumb()) + break; // Select add sp, c to tADDhirr. SDValue N0 = Op.getOperand(0); SDValue N1 = Op.getOperand(1); Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp?rev=67785&r1=67784&r2=67785&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Thu Mar 26 18:10:18 2009 @@ -500,7 +500,7 @@ } // Long double always uses X87. - if (!UseSoftFloat && !NoImplicitFloat) { + if (!UseSoftFloat) { addRegisterClass(MVT::f80, X86::RFP80RegisterClass); setOperationAction(ISD::UNDEF, MVT::f80, Expand); setOperationAction(ISD::FCOPYSIGN, MVT::f80, Expand); @@ -589,7 +589,7 @@ // FIXME: In order to prevent SSE instructions being expanded to MMX ones // with -msoft-float, disable use of MMX as well. - if (!UseSoftFloat && !NoImplicitFloat && !DisableMMX && Subtarget->hasMMX()) { + if (!UseSoftFloat && !DisableMMX && Subtarget->hasMMX()) { addRegisterClass(MVT::v8i8, X86::VR64RegisterClass); addRegisterClass(MVT::v4i16, X86::VR64RegisterClass); addRegisterClass(MVT::v2i32, X86::VR64RegisterClass); @@ -669,7 +669,7 @@ setOperationAction(ISD::SELECT, MVT::v1i64, Custom); } - if (!UseSoftFloat && !NoImplicitFloat && Subtarget->hasSSE1()) { + if (!UseSoftFloat && Subtarget->hasSSE1()) { addRegisterClass(MVT::v4f32, X86::VR128RegisterClass); setOperationAction(ISD::FADD, MVT::v4f32, Legal); @@ -686,7 +686,7 @@ setOperationAction(ISD::VSETCC, MVT::v4f32, Custom); } - if (!UseSoftFloat && !NoImplicitFloat && Subtarget->hasSSE2()) { + if (!UseSoftFloat && Subtarget->hasSSE2()) { addRegisterClass(MVT::v2f64, X86::VR128RegisterClass); // FIXME: Unfortunately -soft-float and -no-implicit-float means XMM Modified: llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll?rev=67785&r1=67784&r2=67785&view=diff ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll (original) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/2009-03-25-TestBug.ll Thu Mar 26 18:10:18 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -o %t -f +; RUN: llvm-as < %s | llc -march=x86 -o %t -f ; RUN: not grep and %t ; RUN: not grep shr %t ; rdar://6661955 From gohman at apple.com Thu Mar 26 18:17:01 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 26 Mar 2009 23:17:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67787 - /llvm-gcc-4.2/trunk/build_gcc Message-ID: <200903262317.n2QNH1ww027116@zion.cs.uiuc.edu> Author: djg Date: Thu Mar 26 18:17:01 2009 New Revision: 67787 URL: http://llvm.org/viewvc/llvm-project?rev=67787&view=rev Log: Add a flag to explicitly communicate to the build system when llvm-gcc is being built "Apple style". Modified: llvm-gcc-4.2/trunk/build_gcc Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=67787&r1=67786&r2=67787&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Thu Mar 26 18:17:01 2009 @@ -248,6 +248,8 @@ # LLVM LOCAL begin if [ "$ENABLE_LLVM" == true ]; then + # Indicate the llvm-gcc is being built "Apple style". + MAKEFLAGS="$MAKEFLAGS BUILD_LLVM_APPLE_STYLE=1" # Build llvm-gcc in 'dylib mode'. MAKEFLAGS="$MAKEFLAGS BUILD_LLVM_INTO_A_DYLIB=1" MAKEFLAGS="$MAKEFLAGS LLVM_VERSION_INFO=$LLVM_SUBMIT_VERSION" From gohman at apple.com Thu Mar 26 18:22:59 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 26 Mar 2009 23:22:59 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67788 - /llvm-gcc-4.2/trunk/gcc/Makefile.in Message-ID: <200903262322.n2QNMxtQ027524@zion.cs.uiuc.edu> Author: djg Date: Thu Mar 26 18:22:59 2009 New Revision: 67788 URL: http://llvm.org/viewvc/llvm-project?rev=67788&view=rev Log: Translate a Makefile variable into a preprocessor define. Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=67788&r1=67787&r2=67788&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Thu Mar 26 18:22:59 2009 @@ -264,6 +264,11 @@ CPPFLAGS += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"' endif # LLVM LOCAL end +# APPLE LOCAL begin +ifdef BUILD_LLVM_APPLE_STYLE +CPPFLAGS += -DBUILD_LLVM_APPLE_STYLE +endif +# APPLE LOCAL end # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS = From gohman at apple.com Thu Mar 26 18:33:06 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 26 Mar 2009 23:33:06 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67789 - /llvm-gcc-4.2/trunk/gcc/version.c Message-ID: <200903262333.n2QNX6ZS028179@zion.cs.uiuc.edu> Author: djg Date: Thu Mar 26 18:33:05 2009 New Revision: 67789 URL: http://llvm.org/viewvc/llvm-project?rev=67789&view=rev Log: Set llvm-gcc's bug report URL to http://llvm.org/bugs/ by default. The Apple-specific URL is now only used when llvm-gcc is built "Apple style", with the build_gcc script. Modified: llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=67789&r1=67788&r2=67789&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Thu Mar 26 18:33:05 2009 @@ -27,8 +27,14 @@ forward us bugs reported to you, if you determine that they are not bugs in your modifications.) */ -/* APPLE LOCAL Apple bug-report */ +/* APPLE LOCAL begin Apple bug-report */ +#ifdef BUILD_LLVM_APPLE_STYLE +// When llvm-gcc is built "Apple style", use Apple's bugreporter. const char bug_report_url[] = ""; +#else +const char bug_report_url[] = ""; +#endif +/* APPLE LOCAL end Apple bug-report */ /* The complete version string, assembled from several pieces. BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */ From gohman at apple.com Thu Mar 26 18:33:38 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 26 Mar 2009 23:33:38 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67790 - /llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Message-ID: <200903262333.n2QNXcEV028219@zion.cs.uiuc.edu> Author: djg Date: Thu Mar 26 18:33:38 2009 New Revision: 67790 URL: http://llvm.org/viewvc/llvm-project?rev=67790&view=rev Log: Don't define __APPLE_CC__ on non-Darwin targets. Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c?rev=67790&r1=67789&r2=67790&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Thu Mar 26 18:33:38 2009 @@ -371,6 +371,7 @@ gcc_assert (!*v || *v == ' ' || *v == '-'); /* LLVM LOCAL no version number */ +#ifdef CONFIG_DARWIN_H #ifndef LLVM_VERSION_INFO /* APPLE LOCAL begin Apple version */ @@ -401,7 +402,6 @@ /* LLVM LOCAL begin version number */ #else -#ifdef CONFIG_DARWIN_H /* This chunk of code defines __APPLE_CC__ from the version string. It expects to see a substring of the version string of the form "build NNNN)", where each N is a digit, and the first @@ -441,8 +441,8 @@ else builtin_define_with_value_n ("__APPLE_CC__", vt, q - vt); } -#endif /*CONFIG_DARWIN_H*/ #endif /*LLVM_VERSION_INFO*/ +#endif /*CONFIG_DARWIN_H*/ /* LLVM LOCAL end version number */ } From mrs at apple.com Thu Mar 26 18:43:16 2009 From: mrs at apple.com (Mike Stump) Date: Thu, 26 Mar 2009 23:43:16 -0000 Subject: [llvm-commits] [llvm] r67791 - /llvm/trunk/Makefile Message-ID: <200903262343.n2QNhGAK028785@zion.cs.uiuc.edu> Author: mrs Date: Thu Mar 26 18:43:14 2009 New Revision: 67791 URL: http://llvm.org/viewvc/llvm-project?rev=67791&view=rev Log: Update to account for driver renaming. Modified: llvm/trunk/Makefile Modified: llvm/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=67791&r1=67790&r2=67791&view=diff ============================================================================== --- llvm/trunk/Makefile (original) +++ llvm/trunk/Makefile Thu Mar 26 18:43:14 2009 @@ -55,7 +55,8 @@ endif ifeq ($(MAKECMDGOALS),install-clang) - DIRS := tools/clang/Driver tools/clang/lib/Headers tools/clang/tools/ccc + DIRS := tools/clang/tools/driver tools/clang/tools/clang-cc \ + tools/clang/lib/Headers OPTIONAL_DIRS := NO_INSTALL = 1 endif From dpatel at apple.com Thu Mar 26 18:48:52 2009 From: dpatel at apple.com (Devang Patel) Date: Thu, 26 Mar 2009 23:48:52 -0000 Subject: [llvm-commits] [llvm] r67798 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp Message-ID: <200903262348.n2QNmqAk029195@zion.cs.uiuc.edu> Author: dpatel Date: Thu Mar 26 18:48:52 2009 New Revision: 67798 URL: http://llvm.org/viewvc/llvm-project?rev=67798&view=rev Log: While hoisting an instruction, update alias info set tracker. Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=67798&r1=67797&r2=67798&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Thu Mar 26 18:48:52 2009 @@ -605,6 +605,7 @@ // Remove the instruction from its current basic block... but don't delete the // instruction. + CurAST->deleteValue(&I); I.removeFromParent(); // Insert the new node in Preheader, before the terminator. From isanbard at gmail.com Thu Mar 26 18:57:24 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 26 Mar 2009 23:57:24 -0000 Subject: [llvm-commits] [llvm] r67801 - /llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp Message-ID: <200903262357.n2QNvO6P029861@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 18:57:24 2009 New Revision: 67801 URL: http://llvm.org/viewvc/llvm-project?rev=67801&view=rev Log: --- Merging (from foreign repository) r67798 into '.': U lib/Transforms/Scalar/LICM.cpp While hoisting an instruction, update alias info set tracker. Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp?rev=67801&r1=67800&r2=67801&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp Thu Mar 26 18:57:24 2009 @@ -605,6 +605,7 @@ // Remove the instruction from its current basic block... but don't delete the // instruction. + CurAST->deleteValue(&I); I.removeFromParent(); // Insert the new node in Preheader, before the terminator. From isanbard at gmail.com Thu Mar 26 19:16:23 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 00:16:23 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67804 - /llvm-gcc-4.2/trunk/gcc/version.c Message-ID: <200903270016.n2R0GNvw031049@zion.cs.uiuc.edu> Author: void Date: Thu Mar 26 19:16:21 2009 New Revision: 67804 URL: http://llvm.org/viewvc/llvm-project?rev=67804&view=rev Log: No C++-style comments. Modified: llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=67804&r1=67803&r2=67804&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Thu Mar 26 19:16:21 2009 @@ -29,7 +29,7 @@ /* APPLE LOCAL begin Apple bug-report */ #ifdef BUILD_LLVM_APPLE_STYLE -// When llvm-gcc is built "Apple style", use Apple's bugreporter. +/* When llvm-gcc is built "Apple style", use Apple's bugreporter. */ const char bug_report_url[] = ""; #else const char bug_report_url[] = ""; From dalej at apple.com Thu Mar 26 20:13:38 2009 From: dalej at apple.com (Dale Johannesen) Date: Fri, 27 Mar 2009 01:13:38 -0000 Subject: [llvm-commits] [llvm] r67811 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <200903270113.n2R1DcvP001846@zion.cs.uiuc.edu> Author: johannes Date: Thu Mar 26 20:13:37 2009 New Revision: 67811 URL: http://llvm.org/viewvc/llvm-project?rev=67811&view=rev Log: One more place to skip debug info. Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=67811&r1=67810&r2=67811&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Mar 26 20:13:37 2009 @@ -145,10 +145,11 @@ return EverMadeChange; } -/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes -/// and an unconditional branch. Passes before isel (e.g. LSR/loopsimplify) -/// often split edges in ways that are non-optimal for isel. Start by -/// eliminating these blocks so we can split them the way we want them. +/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes, +/// debug info directives, and an unconditional branch. Passes before isel +/// (e.g. LSR/loopsimplify) often split edges in ways that are non-optimal for +/// isel. Start by eliminating these blocks so we can split them the way we +/// want them. bool CodeGenPrepare::EliminateMostlyEmptyBlocks(Function &F) { bool MadeChange = false; // Note that this intentionally skips the entry block. @@ -160,12 +161,18 @@ if (!BI || !BI->isUnconditional()) continue; - // If the instruction before the branch isn't a phi node, then other stuff - // is happening here. + // If the instruction before the branch (skipping debug info) isn't a phi + // node, then other stuff is happening here. BasicBlock::iterator BBI = BI; if (BBI != BB->begin()) { --BBI; - if (!isa(BBI)) continue; + while (isa(BBI)) { + if (BBI == BB->begin()) + break; + --BBI; + } + if (!isa(BBI) && !isa(BBI)) + continue; } // Do not break infinite loops. From evan.cheng at apple.com Thu Mar 26 21:43:32 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 27 Mar 2009 02:43:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67814 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200903270243.n2R2hWDm006875@zion.cs.uiuc.edu> Author: evancheng Date: Thu Mar 26 21:43:31 2009 New Revision: 67814 URL: http://llvm.org/viewvc/llvm-project?rev=67814&view=rev Log: __builtin_memset_chk has an extra integer argument. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=67814&r1=67813&r2=67814&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Mar 26 21:43:31 2009 @@ -5176,9 +5176,15 @@ bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result, bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); - if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, - INTEGER_TYPE, VOID_TYPE)) - return false; + if (SizeCheck) { + if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, + INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return false; + } else { + if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, + INTEGER_TYPE, VOID_TYPE)) + return false; + } tree Dst = TREE_VALUE(arglist); unsigned DstAlign = getPointerAlignment(Dst); From evan.cheng at apple.com Thu Mar 26 21:45:15 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 27 Mar 2009 02:45:15 -0000 Subject: [llvm-commits] [llvm] r67815 - /llvm/trunk/test/FrontendC/memset_chk.c Message-ID: <200903270245.n2R2jFs2006938@zion.cs.uiuc.edu> Author: evancheng Date: Thu Mar 26 21:45:14 2009 New Revision: 67815 URL: http://llvm.org/viewvc/llvm-project?rev=67815&view=rev Log: Add a __builtin___memset_chk test. Added: llvm/trunk/test/FrontendC/memset_chk.c Added: llvm/trunk/test/FrontendC/memset_chk.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/memset_chk.c?rev=67815&view=auto ============================================================================== --- llvm/trunk/test/FrontendC/memset_chk.c (added) +++ llvm/trunk/test/FrontendC/memset_chk.c Thu Mar 26 21:45:14 2009 @@ -0,0 +1,6 @@ +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | not grep memset_chk +// rdar://6728562 + +void t(void *ptr) { + __builtin___memset_chk(ptr, 0, 32, __builtin_object_size (ptr, 0)); +} From isanbard at gmail.com Fri Mar 27 01:18:09 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 06:18:09 -0000 Subject: [llvm-commits] [llvm] r67829 - in /llvm/branches/Apple/Dib/lib: CodeGen/SelectionDAG/SelectionDAGBuild.cpp Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <200903270618.n2R6I9eO018882@zion.cs.uiuc.edu> Author: void Date: Fri Mar 27 01:18:09 2009 New Revision: 67829 URL: http://llvm.org/viewvc/llvm-project?rev=67829&view=rev Log: --- Merging (from foreign repository) r67692 into '.': U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp --- Merging (from foreign repository) r67724 into '.': U lib/Transforms/Scalar/CodeGenPrepare.cpp --- Merging (from foreign repository) r67811 into '.': G lib/Transforms/Scalar/CodeGenPrepare.cpp Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=67829&r1=67828&r2=67829&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Fri Mar 27 01:18:09 2009 @@ -3905,10 +3905,11 @@ DbgStopPointInst &SPI = cast(I); if (DW && DW->ValidDebugInfo(SPI.getContext())) { MachineFunction &MF = DAG.getMachineFunction(); - DAG.setRoot(DAG.getDbgStopPoint(getRoot(), - SPI.getLine(), - SPI.getColumn(), - SPI.getContext())); + if (Fast) + DAG.setRoot(DAG.getDbgStopPoint(getRoot(), + SPI.getLine(), + SPI.getColumn(), + SPI.getContext())); DICompileUnit CU(cast(SPI.getContext())); std::string Dir, FN; unsigned SrcFile = DW->getOrCreateSourceID(CU.getDirectory(Dir), Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=67829&r1=67828&r2=67829&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Mar 27 01:18:09 2009 @@ -20,6 +20,7 @@ #include "llvm/Function.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Pass.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" @@ -144,10 +145,11 @@ return EverMadeChange; } -/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes -/// and an unconditional branch. Passes before isel (e.g. LSR/loopsimplify) -/// often split edges in ways that are non-optimal for isel. Start by -/// eliminating these blocks so we can split them the way we want them. +/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes, +/// debug info directives, and an unconditional branch. Passes before isel +/// (e.g. LSR/loopsimplify) often split edges in ways that are non-optimal for +/// isel. Start by eliminating these blocks so we can split them the way we +/// want them. bool CodeGenPrepare::EliminateMostlyEmptyBlocks(Function &F) { bool MadeChange = false; // Note that this intentionally skips the entry block. @@ -159,12 +161,18 @@ if (!BI || !BI->isUnconditional()) continue; - // If the instruction before the branch isn't a phi node, then other stuff - // is happening here. + // If the instruction before the branch (skipping debug info) isn't a phi + // node, then other stuff is happening here. BasicBlock::iterator BBI = BI; if (BBI != BB->begin()) { --BBI; - if (!isa(BBI)) continue; + while (isa(BBI)) { + if (BBI == BB->begin()) + break; + --BBI; + } + if (!isa(BBI) && !isa(BBI)) + continue; } // Do not break infinite loops. @@ -350,15 +358,20 @@ BasicBlock *Pred = *PI; // To be usable, the pred has to end with an uncond branch to the dest. BranchInst *PredBr = dyn_cast(Pred->getTerminator()); - if (!PredBr || !PredBr->isUnconditional() || - // Must be empty other than the branch. - &Pred->front() != PredBr || - // Cannot be the entry block; its label does not get emitted. - Pred == &(Dest->getParent()->getEntryBlock())) + if (!PredBr || !PredBr->isUnconditional()) + continue; + // Must be empty other than the branch and debug info. + BasicBlock::iterator I = Pred->begin(); + while (isa(I)) + I++; + if (dyn_cast(I) != PredBr) + continue; + // Cannot be the entry block; its label does not get emitted. + if (Pred == &(Dest->getParent()->getEntryBlock())) continue; // Finally, since we know that Dest has phi nodes in it, we have to make - // sure that jumping to Pred will have the same affect as going to Dest in + // sure that jumping to Pred will have the same effect as going to Dest in // terms of PHI values. PHINode *PN; unsigned PHINo = 0; From ojomojo at gmail.com Fri Mar 27 01:09:40 2009 From: ojomojo at gmail.com (John Mosby) Date: Fri, 27 Mar 2009 06:09:40 -0000 Subject: [llvm-commits] [llvm] r67828 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200903270609.n2R69ex7018421@zion.cs.uiuc.edu> Author: jdm Date: Fri Mar 27 01:09:40 2009 New Revision: 67828 URL: http://llvm.org/viewvc/llvm-project?rev=67828&view=rev Log: Shrink wrapping in PEI: initial release. Finishing development, enable with --shrink-wrap. Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=67828&r1=67827&r2=67828&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Fri Mar 27 01:09:40 2009 @@ -14,9 +14,34 @@ // This pass must be run after register allocation. After this pass is // executed, it is illegal to construct MO_FrameIndex operands. // +// This pass implements a shrink wrapping variant of prolog/epilog insertion: +// - Places callee saved register (CSR) spills and restores in the CFG to +// tightly surround uses so that execution paths that do not use CSRs do not +// pay the spill/restore penalty. +// +// - Avoiding placment of spills/restores in loops: if a CSR is used inside a +// loop(nest), the spills are placed in the loop preheader, and restores are +// placed in the loop exit nodes (the successors of the loop _exiting_ nodes). +// +// - Covering paths without CSR uses: e.g. if a restore is placed in a join +// block, a matching spill is added to the end of all immediate predecessor +// blocks that are not reached by a spill. Similarly for saves placed in +// branch blocks. +// +// Shrink wrapping uses an analysis similar to the one in GVNPRE to determine +// which basic blocks require callee-saved register save/restore code. +// +// This pass uses MachineDominators and MachineLoopInfo. Loop information +// is used to prevent shrink wrapping of callee-saved register save/restore +// code into loops. +// //===----------------------------------------------------------------------===// +#define DEBUG_TYPE "shrink-wrap" + #include "llvm/CodeGen/Passes.h" +#include "llvm/CodeGen/MachineDominators.h" +#include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -27,11 +52,24 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/ADT/SparseBitVector.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" #include "llvm/ADT/STLExtras.h" #include +#include + using namespace llvm; +// Shrink Wrapping: +static cl::opt +ShrinkWrapping("shrink-wrap", + cl::desc("Apply shrink wrapping to callee-saved register spills/restores")); + namespace { struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { static char ID; @@ -42,8 +80,13 @@ } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addPreservedID(MachineLoopInfoID); - AU.addPreservedID(MachineDominatorsID); + AU.setPreservesCFG(); + if (ShrinkWrapping) { + AU.addRequired(); + AU.addRequired(); + } + AU.addPreserved(); + AU.addPreserved(); MachineFunctionPass::getAnalysisUsage(AU); } @@ -69,8 +112,16 @@ // information and eliminates call frame pseudo instructions. calculateCalleeSavedRegisters(Fn); + // Determine placement of CSR spill/restore code: + // - with shrink wrapping, place spills and restores to tightly + // enclose regions in the Machine CFG of the function where + // they are used. Without shrink wrapping + // - default (no shrink wrapping), place all spills in the + // entry block, all restores in return blocks. + placeCSRSpillsAndRestores(Fn); + // Add the code to save and restore the callee saved registers - saveCalleeSavedRegisters(Fn); + insertCSRSpillsAndRestores(Fn); // Allow the target machine to make final modifications to the function // before the frame layout is finalized. @@ -94,7 +145,7 @@ delete RS; return true; } - + private: RegScavenger *RS; @@ -102,22 +153,702 @@ // stack frame indexes. unsigned MinCSFrameIndex, MaxCSFrameIndex; + // Analysis info for spill/restore placement. + // "CSR": "callee saved register". + + // CSRegSet contains indices into the Callee Saved Register Info + // vector built by calculateCalleeSavedRegisters() and accessed + // via MF.getFrameInfo()->getCalleeSavedInfo(). + typedef SparseBitVector<> CSRegSet; + + // CSRegBlockMap maps MachineBasicBlocks to sets of callee + // saved register indices. + typedef DenseMap CSRegBlockMap; + + // Set and maps for computing CSR spill/restore placement: + // used in function (UsedCSRegs) + // used in a basic block (CSRUsed) + // anticipatable in a basic block (Antic{In,Out}) + // available in a basic block (Avail{In,Out}) + // to be spilled at the entry to a basic block (CSRSave) + // to be restored at the end of a basic block (CSRRestore) + + CSRegSet UsedCSRegs; + CSRegBlockMap CSRUsed; + CSRegBlockMap AnticIn, AnticOut; + CSRegBlockMap AvailIn, AvailOut; + CSRegBlockMap CSRSave; + CSRegBlockMap CSRRestore; + + // Entry and return blocks of the current function. + MachineBasicBlock* EntryBlock; + SmallVector ReturnBlocks; + + // Flag to control shrink wrapping per-function: + // may choose to skip shrink wrapping for certain + // functions. + bool ShrinkWrapThisFunction; + + bool calculateSets(MachineFunction &Fn); + void calculateAnticAvail(MachineFunction &Fn); + MachineBasicBlock* moveSpillsOutOfLoops(MachineFunction &Fn, + MachineBasicBlock* MBB); + void addRestoresForSBranchBlock(MachineFunction &Fn, + MachineBasicBlock* MBB); + void moveRestoresOutOfLoops(MachineFunction& Fn, + MachineBasicBlock* MBB, + std::vector& SBLKS); + void addSavesForRJoinBlocks(MachineFunction& Fn, + std::vector& SBLKS); + void placeSpillsAndRestores(MachineFunction &Fn); + void placeCSRSpillsAndRestores(MachineFunction &Fn); void calculateCalleeSavedRegisters(MachineFunction &Fn); - void saveCalleeSavedRegisters(MachineFunction &Fn); + void insertCSRSpillsAndRestores(MachineFunction &Fn); void calculateFrameObjectOffsets(MachineFunction &Fn); void replaceFrameIndices(MachineFunction &Fn); void insertPrologEpilogCode(MachineFunction &Fn); + + // Initialize all shrink wrapping data. + void initShrinkWrappingInfo() { + UsedCSRegs.clear(); + CSRUsed.clear(); + AnticIn.clear(); + AnticOut.clear(); + AvailIn.clear(); + AvailOut.clear(); + CSRSave.clear(); + CSRRestore.clear(); + EntryBlock = 0; + if (! ReturnBlocks.empty()) + ReturnBlocks.clear(); + ShrinkWrapThisFunction = ShrinkWrapping; + } + + // Convienences for dealing with machine loops. + MachineBasicBlock* getTopLevelLoopPreheader(MachineLoop* LP) { + assert(LP && "Machine loop is NULL."); + MachineBasicBlock* PHDR = LP->getLoopPreheader(); + MachineLoop* PLP = LP->getParentLoop(); + while (PLP) { + PHDR = PLP->getLoopPreheader(); + PLP = PLP->getParentLoop(); + } + return PHDR; + } + + MachineLoop* getTopLevelLoopParent(MachineLoop *LP) { + if (LP == 0) + return 0; + MachineLoop* PLP = LP->getParentLoop(); + while (PLP) { + LP = PLP; + PLP = PLP->getParentLoop(); + } + return LP; + } + +#ifndef NDEBUG + // Debugging methods. + static std::string getBasicBlockName(const MachineBasicBlock* MBB) { + std::ostringstream name; + if (MBB) { + if (MBB->getBasicBlock()) + name << MBB->getBasicBlock()->getName(); + else + name << "_MBB_" << MBB->getNumber(); + } + return name.str(); + } + + static std::string stringifyCSRegSet(const CSRegSet& s, + MachineFunction &Fn) { + const TargetRegisterInfo* TRI = Fn.getTarget().getRegisterInfo(); + const std::vector CSI = + Fn.getFrameInfo()->getCalleeSavedInfo(); + + std::ostringstream srep; + if (CSI.size() == 0) { + srep << "[]"; + return srep.str(); + } + srep << "["; + CSRegSet::iterator I = s.begin(), E = s.end(); + if (I != E) { + unsigned reg = CSI[*I].getReg(); + srep << TRI->getName(reg); + for (++I; I != E; ++I) { + reg = CSI[*I].getReg(); + srep << ","; + srep << TRI->getName(reg); + } + } + srep << "]"; + return srep.str(); + } + + static void dumpSet(const CSRegSet& s, MachineFunction &Fn) { + DOUT << stringifyCSRegSet(s, Fn) << "\n"; + } +#endif + }; char PEI::ID = 0; } - /// createPrologEpilogCodeInserter - This function returns a pass that inserts /// prolog and epilog code, and eliminates abstract frame references. /// FunctionPass *llvm::createPrologEpilogCodeInserter() { return new PEI(); } +/// placeCSRSpillsAndRestores - determine which MBBs of the function +/// need save, restore code for callee-saved registers by doing a DF analysis +/// similar to the one used in code motion (GVNPRE). This produces maps of MBBs +/// to sets of registers (CSRs) for saves and restores. MachineLoopInfo +/// is used to ensure that CSR save/restore code is not placed inside loops. +/// This function computes the maps of MBBs -> CSRs to spill and restore +/// in CSRSave, CSRRestore. +/// +/// If shrink wrapping is not being performed, place all spills in +/// the entry block, all restores in return blocks. In this case, +/// CSRSave has a single mapping, CSRRestore has mappings for each +/// return block. +/// +void PEI::placeCSRSpillsAndRestores(MachineFunction &Fn) { + +#ifndef NDEBUG + DOUT << "Place CSR spills/restores for " + << Fn.getFunction()->getName() << "\n"; +#endif + + initShrinkWrappingInfo(); + + if (calculateSets(Fn)) + placeSpillsAndRestores(Fn); +} + +/// calculateAnticAvail - helper for computing the data flow +/// sets required for determining spill/restore placements. +/// +void PEI::calculateAnticAvail(MachineFunction &Fn) { + + // Calulate Antic{In,Out} and Avail{In,Out} iteratively on the MCFG. + bool changed = true; + unsigned iterations = 0; + while (changed) { + changed = false; + for (MachineFunction::iterator MBBI = Fn.begin(), MBBE = Fn.end(); + MBBI != MBBE; ++MBBI) { + MachineBasicBlock* MBB = MBBI; + + // AnticOut[MBB] = INTERSECT(AnticIn[S] for S in SUCC(MBB)) + MachineBasicBlock::succ_iterator SI = MBB->succ_begin(), + SE = MBB->succ_end(); + if (SI != SE) { + CSRegSet prevAnticOut = AnticOut[MBB]; + MachineBasicBlock* SUCC = *SI; + AnticOut[MBB] = AnticIn[SUCC]; + for (++SI; SI != SE; ++SI) { + SUCC = *SI; + AnticOut[MBB] &= AnticIn[SUCC]; + } + if (prevAnticOut != AnticOut[MBB]) + changed = true; + } + // AnticIn[MBB] = CSRUsed[MBB] | AnticOut[MBB]; + CSRegSet prevAnticIn = AnticIn[MBB]; + AnticIn[MBB] = CSRUsed[MBB] | AnticOut[MBB]; + if (prevAnticIn |= AnticIn[MBB]) + changed = true; + + // AvailIn[MBB] = INTERSECT(AvailOut[S] for S in PRED(MBB)) + MachineBasicBlock::pred_iterator PI = MBB->pred_begin(), + PE = MBB->pred_end(); + if (PI != PE) { + CSRegSet prevAvailIn = AvailIn[MBB]; + MachineBasicBlock* PRED = *PI; + AvailIn[MBB] = AvailOut[PRED]; + for (++PI; PI != PE; ++PI) { + PRED = *PI; + AvailIn[MBB] &= AvailOut[PRED]; + } + if (prevAvailIn != AvailIn[MBB]) + changed = true; + } + // AvailOut[MBB] = CSRUsed[MBB] | AvailIn[MBB]; + CSRegSet prevAvailOut = AvailOut[MBB]; + AvailOut[MBB] = CSRUsed[MBB] | AvailIn[MBB]; + if (prevAvailOut |= AvailOut[MBB]) + changed = true; + } + ++iterations; + } + + // EXP + AnticIn[EntryBlock].clear(); + AnticOut[EntryBlock].clear(); + +#ifndef NDEBUG + DOUT << "-----------------------------------------------------------\n"; + DOUT << "iterations = " << iterations << "\n"; + DOUT << "-----------------------------------------------------------\n"; + DOUT << "MBB | ANTIC_IN | ANTIC_OUT | AVAIL_IN | AVAIL_OUT\n"; + DOUT << "-----------------------------------------------------------\n"; + for (MachineFunction::iterator MBBI = Fn.begin(), MBBE = Fn.end(); + MBBI != MBBE; ++MBBI) { + MachineBasicBlock* MBB = MBBI; + + DOUT << getBasicBlockName(MBB) << " | " + << stringifyCSRegSet(AnticIn[MBB], Fn) + << " | " + << stringifyCSRegSet(AnticOut[MBB], Fn) + << " | " + << stringifyCSRegSet(AvailIn[MBB], Fn) + << " | " + << stringifyCSRegSet(AvailOut[MBB], Fn) + << "\n"; + } +#endif +} + +/// calculateSets - helper function for placeCSRSpillsAndRestores, +/// collect the CSRs used in this function, develop the DF sets that +/// describe the minimal regions in the Machine CFG around which spills, +/// restores must be placed. +/// +/// This function decides if shrink wrapping should actually be done: +/// if all CSR uses are in the entry block, no shrink wrapping is possible, +/// so ShrinkWrapping is turned off (for the current function) and the +/// function returns false. +/// +bool PEI::calculateSets(MachineFunction &Fn) { + + // Sets used to compute spill, restore placement sets. + const std::vector CSI = + Fn.getFrameInfo()->getCalleeSavedInfo(); + + // If no CSRs used, we are done. + if (CSI.empty()) { +#ifndef NDEBUG + DOUT << Fn.getFunction()->getName() + << " uses no callee-saved registers.\n"; +#endif + return false; + } + +#ifndef NDEBUG + DOUT << "-----------------------------------------------------------\n"; +#endif + + const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); + bool allCSRUsesInEntryBlock = true; + + // Initialize UsedCSRegs set, CSRUsed map. + // At the same time, put entry block directly into + // CSRSave, CSRRestore sets if any CSRs are used. + // + // Quick exit option (not implemented): + // Given N CSR uses in entry block, + // revert to default behavior, skip the placement + // step and put all saves in entry, restores in + // return blocks. + + // Set up entry and return blocks. + EntryBlock = Fn.begin(); + for (MachineFunction::iterator MBB = Fn.begin(), E = Fn.end(); + MBB != E; ++MBB) + if (!MBB->empty() && MBB->back().getDesc().isReturn()) + ReturnBlocks.push_back(MBB); + + // TODO -- check for a use of a CSR in each imm. successor of EntryBlock, + // do not shrink wrap this function if this is the case. + + // If not shrink wrapping (this function) at this point, set bits in + // CSR{Save,Restore}[] and UsedCSRegs, then return. + if (! ShrinkWrapThisFunction) { + for (unsigned inx = 0, e = CSI.size(); inx != e; ++inx) { + UsedCSRegs.set(inx); + CSRSave[EntryBlock].set(inx); + for (unsigned ri = 0, re = ReturnBlocks.size(); ri != re; ++ri) + CSRRestore[ReturnBlocks[ri]].set(inx); + } + return false; + } + + // Walk instructions in all MBBs, create basic sets, choose + // whether or not to shrink wrap this function. + for (MachineFunction::iterator MBBI = Fn.begin(), MBBE = Fn.end(); + MBBI != MBBE; ++MBBI) { + MachineBasicBlock* MBB = MBBI; + for (MachineBasicBlock::iterator I = MBB->begin(); I != MBB->end(); ++I) { + for (unsigned inx = 0, e = CSI.size(); inx != e; ++inx) { + unsigned Reg = CSI[inx].getReg(); + // If instruction I reads or modifies Reg, add it to UsedCSRegs, + // CSRUsed map for the current block. + for (unsigned opInx = 0, opEnd = I->getNumOperands(); + opInx != opEnd; ++opInx) { + const MachineOperand &MO = I->getOperand(opInx); + if (! (MO.isReg() && (MO.isUse() || MO.isDef()))) + continue; + unsigned MOReg = MO.getReg(); + if (!MOReg) + continue; + if (MOReg == Reg || + (TargetRegisterInfo::isPhysicalRegister(MOReg) && + TargetRegisterInfo::isPhysicalRegister(Reg) && + TRI->isSubRegister(MOReg, Reg))) { + // CSR Reg is defined/used in block MBB. + UsedCSRegs.set(inx); + CSRUsed[MBB].set(inx); + // Short-circuit analysis for entry, return blocks: + // if a CSR is used in the entry block, add it directly + // to CSRSave[EntryBlock] and to CSRRestore[R] for R + // in ReturnBlocks. Note CSR uses in non-entry blocks. + if (ShrinkWrapThisFunction) { + if (MBB == EntryBlock) { + CSRSave[MBB].set(inx); + for (unsigned ri = 0, re = ReturnBlocks.size(); ri != re; ++ri) + CSRRestore[ReturnBlocks[ri]].set(inx); + } else + allCSRUsesInEntryBlock = false; + } else { + // Not shrink wrapping => ensure saves/restores are correctly + // added for entry, return blocks. + CSRSave[EntryBlock].set(inx); + for (unsigned ri = 0, re = ReturnBlocks.size(); ri != re; ++ri) + CSRRestore[ReturnBlocks[ri]].set(inx); + } + } + } + } + } +#ifndef NDEBUG + DOUT << "CSRUsed[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(CSRUsed[MBB], Fn) << "\n"; +#endif + } + +#ifndef NDEBUG + DOUT << "UsedCSRegs = " << stringifyCSRegSet(UsedCSRegs, Fn) << "\n"; +#endif + + // Early exit: + // 1. Not asked to do shrink wrapping => just "place" all spills(restores) + // in the entry(return) block(s), already done above. + // 2. All CSR uses in entry block => same as case 1, but say we will + // not shrink wrap the current function. + ShrinkWrapThisFunction = (ShrinkWrapping && + ShrinkWrapThisFunction && + ! allCSRUsesInEntryBlock); + if (! ShrinkWrapThisFunction) { + return false; + } + + calculateAnticAvail(Fn); + + return true; +} + +/// moveSpillsOutOfLoops - helper for placeSpillsAndRestores() which +/// relocates a spill from a subgraph in a loop to the loop preheader. +/// Returns the MBB to which saves have been moved, or the given MBB +/// if it is a branch point. +/// +MachineBasicBlock* PEI::moveSpillsOutOfLoops(MachineFunction &Fn, + MachineBasicBlock* MBB) { + if (MBB == 0 || CSRSave[MBB].empty()) + return 0; + + // Block to which saves are moved. + MachineBasicBlock* DEST = 0; + MachineLoopInfo &LI = getAnalysis(); + + if (MachineLoop* LP = LI.getLoopFor(MBB)) { + MachineBasicBlock* LPH = getTopLevelLoopPreheader(LP); + assert(LPH && "Loop has no top level preheader?"); + +#ifndef NDEBUG + DOUT << "Moving saves of " + << stringifyCSRegSet(CSRSave[MBB], Fn) + << " from " << getBasicBlockName(MBB) + << " to " << getBasicBlockName(LPH) << "\n"; +#endif + // Add CSRegSet from MBB to LPH, empty out MBB's CSRegSet. + CSRSave[LPH] |= CSRSave[MBB]; + // If saves moved to entry block, add restores to returns. + if (LPH == EntryBlock) { + for (unsigned i = 0, e = ReturnBlocks.size(); i != e; ++i) + CSRRestore[ReturnBlocks[i]] |= CSRSave[MBB]; + } else { + // Remember where we moved the save so we can add + // restores on successor paths if necessary. + if (LPH->succ_size() > 1) + DEST = LPH; + } + CSRSave[MBB].clear(); + } else if (MBB->succ_size() > 1) + DEST = MBB; + return DEST; +} + +/// addRestoresForSBranchBlock - helper for placeSpillsAndRestores() which +/// adds restores of CSRs saved in branch point MBBs to the front of any +/// successor blocks connected to regions with no uses of the saved CSRs. +/// +void PEI::addRestoresForSBranchBlock(MachineFunction &Fn, + MachineBasicBlock* MBB) { + + if (MBB == 0 || CSRSave[MBB].empty() || MBB->succ_size() < 2) + return; + + // Add restores of CSRs saved in branch point MBBs to the + // front of any succ blocks flowing into regions that + // have no uses of MBB's CSRs. + bool hasCSRUses = false; + for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(), + SE = MBB->succ_end(); SI != SE; ++SI) { + MachineBasicBlock* SUCC = *SI; + bool needsRestore = false; + if (CSRUsed[SUCC].intersects(CSRSave[MBB])) { + hasCSRUses = true; + continue; + } + needsRestore = true; + for (df_iterator BI = df_begin(SUCC), + BE = df_end(SUCC); BI != BE; ++BI) { + MachineBasicBlock* SBB = *BI; + if (CSRUsed[SBB].intersects(CSRSave[MBB])) { + hasCSRUses = true; + needsRestore = false; + break; + } + } + // Additional restores are needed for SUCC iff there is at least + // one CSR use reachable from the successors of MBB and there + // are no uses in or below SUCC. + if (needsRestore && hasCSRUses) { +#ifndef NDEBUG + DOUT << "MBB " << getBasicBlockName(MBB) + << " needs a restore on path to successor " + << getBasicBlockName(SUCC) << "\n"; +#endif + // Add restores to SUCC for all CSRs saved in MBB... + CSRRestore[SUCC] = CSRSave[MBB]; + } + } +} + +/// moveRestoresOutOfLoops - helper for placeSpillsAndRestores() which +/// relocates restores from a subgraph in a loop to the loop exit blocks. +/// This function records the MBBs to which restores have been moved in +/// SBLKS. If no restores are moved, SBLKS contains the input MBB if it +/// is a join point in the Machine CFG. +/// +void PEI::moveRestoresOutOfLoops(MachineFunction& Fn, + MachineBasicBlock* MBB, + std::vector& SBLKS) { + + SBLKS.clear(); + if (MBB == 0 || CSRRestore[MBB].empty()) + return; + + MachineLoopInfo &LI = getAnalysis(); + + if (MachineLoop* LP = LI.getLoopFor(MBB)) { + LP = getTopLevelLoopParent(LP); + assert(LP && "Loop with no top level parent?"); + + SmallVector exitBlocks; + + LP->getExitBlocks(exitBlocks); + assert(exitBlocks.size() > 0 && + "Loop has no top level exit blocks?"); + for (unsigned i = 0, e = exitBlocks.size(); i != e; ++i) { + MachineBasicBlock* EXB = exitBlocks[i]; + +#ifndef NDEBUG + DOUT << "Moving restores of " + << stringifyCSRegSet(CSRRestore[MBB], Fn) + << " from " << getBasicBlockName(MBB) + << " to " << getBasicBlockName(EXB) << "\n"; +#endif + + // Add CSRegSet from MBB to LPE, empty out MBB's CSRegSet. + CSRRestore[EXB] |= CSRRestore[MBB]; + if (EXB->pred_size() > 1) + SBLKS.push_back(EXB); + } + CSRRestore[MBB].clear(); + } else if (MBB->pred_size() > 1) + SBLKS.push_back(MBB); +} + +/// addSavesForRJoinBlocks - Add saves of CSRs restored in join point MBBs +/// to the ends of any pred blocks that flow into MBB from regions that +/// have no uses of MBB's CSRs. +/// +void PEI::addSavesForRJoinBlocks(MachineFunction& Fn, + std::vector& SBLKS) { + + if (SBLKS.empty()) + return; + + for (unsigned i = 0, e = SBLKS.size(); i != e; ++i) { + MachineBasicBlock* MBB = SBLKS[i]; + if (MBB->pred_size() > 1) { + bool needsSave = false; + for (MachineBasicBlock::pred_iterator PI = MBB->pred_begin(), + PE = MBB->pred_end(); PI != PE; ++PI) { + MachineBasicBlock* PRED = *PI; + + // Walk back up in the CFG from the preds of MBB, look for + // a block that uses any CSR that is restored in MBB. + if (CSRUsed[PRED].intersects(CSRRestore[MBB])) + continue; + needsSave = true; + for (idf_iterator PPI = idf_begin(PRED), + PPE = idf_end(PRED); PPI != PPE; ++PPI) { + MachineBasicBlock* PBB = *PPI; + if (CSRUsed[PBB].intersects(CSRRestore[MBB])) { + needsSave = false; + break; + } + } + if (needsSave) { + // Add saves to PRED for all CSRs restored in MBB... +#ifndef NDEBUG + DOUT << "MBB " << getBasicBlockName(MBB) + << " needs a save on path from predecessor " + << getBasicBlockName(PRED) << "\n"; +#endif + CSRSave[PRED] = CSRRestore[MBB]; + } + } + } + } +} + +/// placeSpillsAndRestores - decide which MBBs need spills, restores +/// of CSRs. +/// +void PEI::placeSpillsAndRestores(MachineFunction &Fn) { + +#ifndef NDEBUG + DOUT << "-----------------------------------------------------------\n"; +#endif + + // Calculate CSR{Save,Restore} using Antic, Avail on the Machine-CFG. + for (MachineFunction::iterator MBBI = Fn.begin(), MBBE = Fn.end(); + MBBI != MBBE; ++MBBI) { + MachineBasicBlock* MBB = MBBI; + // Entry block saves are recorded in UsedCSRegs pass above. + if (MBB != EntryBlock) { + // Intersect (CSRegs - AnticIn[P]) for all predecessors P of MBB + CSRegSet anticInPreds; + MachineBasicBlock::pred_iterator PI = MBB->pred_begin(), + PE = MBB->pred_end(); + if (PI != PE) { + MachineBasicBlock* PRED = *PI; + anticInPreds = UsedCSRegs - AnticIn[PRED]; + for (++PI; PI != PE; ++PI) { + PRED = *PI; + // Handle self loop. + if (PRED != MBB) + anticInPreds &= (UsedCSRegs - AnticIn[PRED]); + } + } + // CSRSave[MBB] = (AnticIn[MBB] - AvailIn[MBB]) & anticInPreds + CSRSave[MBB] = (AnticIn[MBB] - AvailIn[MBB]) & anticInPreds; + + // Remove the CSRs that are saved in the entry block + if (! CSRSave[MBB].empty() && ! CSRSave[EntryBlock].empty()) + CSRSave[MBB] = CSRSave[MBB] - CSRSave[EntryBlock]; + + // Move saves inside loops to the preheaders of the outermost + // containing loops, add restores to blocks reached by saves + // placed at branch points where necessary. + if (MachineBasicBlock* DESTBB = moveSpillsOutOfLoops(Fn, MBB)) { + // Add restores to blocks reached by saves placed at branch + // points where necessary. + addRestoresForSBranchBlock(Fn, DESTBB); + } + } + +#ifndef NDEBUG + if (! CSRSave[MBB].empty()) + DOUT << "SAVE[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(CSRSave[MBB], Fn) << "\n"; +#endif + + // Compute CSRRestore, which may already be set for return blocks. + if (! CSRRestore[MBB].empty() || MBB->pred_size() == 0) + continue; + + // Intersect (CSRegs - AvailOut[S]) for all successors S of MBB + CSRegSet availOutSucc; + MachineBasicBlock::succ_iterator SI = MBB->succ_begin(), + SE = MBB->succ_end(); + if (SI != SE) { + MachineBasicBlock* SUCC = *SI; + availOutSucc = UsedCSRegs - AvailOut[SUCC]; + for (++SI; SI != SE; ++SI) { + SUCC = *SI; + // Handle self loop. + if (SUCC != MBB) + availOutSucc &= (UsedCSRegs - AvailOut[SUCC]); + } + } else if (! CSRUsed[MBB].empty()) { + // Take care of uses in return blocks (which have no successors). + availOutSucc = UsedCSRegs; + } + // CSRRestore[MBB] = (AvailOut[MBB] - AnticOut[MBB]) & availOutSucc + CSRRestore[MBB] = (AvailOut[MBB] - AnticOut[MBB]) & availOutSucc; + + // Remove the CSRs that are restored in the return blocks. + // Lest this be confusing, note that: + // CSRSave[EntryBlock] == CSRRestore[B] for all B in ReturnBlocks. + if (! CSRRestore[MBB].empty() && ! CSRSave[EntryBlock].empty()) + CSRRestore[MBB] = CSRRestore[MBB] - CSRSave[EntryBlock]; + + // Move restores inside loops to the exits of the outermost (top level) + // containing loops. + std::vector saveBlocks; + moveRestoresOutOfLoops(Fn, MBB, saveBlocks); + + // Add saves of CSRs restored in join point MBBs to the ends + // of any pred blocks that flow into MBB from regions that + // have no uses of MBB's CSRs. + addSavesForRJoinBlocks(Fn, saveBlocks); + +#ifndef NDEBUG + if (! CSRRestore[MBB].empty()) + DOUT << "RESTORE[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(CSRRestore[MBB], Fn) << "\n"; +#endif + } + +#ifndef NDEBUG + DOUT << "-----------------------------------------------------------\n"; + DOUT << "Final SAVE, RESTORE:\n"; + DOUT << "-----------------------------------------------------------\n"; + for (MachineFunction::iterator MBB = Fn.begin(), E = Fn.end(); + MBB != E; ++MBB) { + if (! CSRSave[MBB].empty()) { + DOUT << "SAVE[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(CSRSave[MBB], Fn); + if (CSRRestore[MBB].empty()) + DOUT << "\n"; + } + if (! CSRRestore[MBB].empty()) { + if (! CSRSave[MBB].empty()) + DOUT << " "; + DOUT << "RESTORE[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(CSRRestore[MBB], Fn) << "\n"; + } + } +#endif +} + /// calculateCalleeSavedRegisters - Scan the function for modified callee saved /// registers. Also calculate the MaxCallFrameSize and HasCalls variables for /// the function's frame information and eliminates call frame pseudo @@ -221,7 +952,8 @@ unsigned Align = RC->getAlignment(); unsigned StackAlign = TFI->getStackAlignment(); // We may not be able to sastify the desired alignment specification of - // the TargetRegisterClass if the stack alignment is smaller. Use the min. + // the TargetRegisterClass if the stack alignment is smaller. + // Use the min. Align = std::min(Align, StackAlign); FrameIdx = FFI->CreateStackObject(RC->getSize(), Align); if ((unsigned)FrameIdx < MinCSFrameIndex) MinCSFrameIndex = FrameIdx; @@ -236,41 +968,104 @@ FFI->setCalleeSavedInfo(CSI); } -/// saveCalleeSavedRegisters - Insert spill code for any callee saved registers -/// that are modified in the function. +/// insertCSRSpillsAndRestores - Insert spill and restore code for +/// callee saved registers used in the function, handling shrink wrapping. /// -void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) { +void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) { // Get callee saved register information. MachineFrameInfo *FFI = Fn.getFrameInfo(); const std::vector &CSI = FFI->getCalleeSavedInfo(); - + // Early exit if no callee saved registers are modified! if (CSI.empty()) return; const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo(); + MachineBasicBlock::iterator I; + std::vector blockCSI; + +#ifndef NDEBUG + DOUT << "Inserting spill/restore code for CSRs in function " + << Fn.getFunction()->getName() << "\n"; +#endif + + // Insert spills. + for (CSRegBlockMap::iterator + BI = CSRSave.begin(), BE = CSRSave.end(); BI != BE; ++BI) { + MachineBasicBlock* MBB = BI->first; + CSRegSet save = BI->second; + + if (save.empty()) + continue; + + if (! ShrinkWrapThisFunction) { + // Spill using target interface. + I = MBB->begin(); + if (!TII.spillCalleeSavedRegisters(*MBB, I, CSI)) { + for (unsigned i = 0, e = CSI.size(); i != e; ++i) { + // Add the callee-saved register as live-in. It's killed at the spill. + MBB->addLiveIn(CSI[i].getReg()); + + // Insert the spill to the stack frame. + TII.storeRegToStackSlot(*MBB, I, CSI[i].getReg(), true, + CSI[i].getFrameIdx(), CSI[i].getRegClass()); + } + } + } else { +#ifndef NDEBUG + DOUT << "CSRSave[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(save, Fn) << "\n"; +#endif + + blockCSI.clear(); + for (CSRegSet::iterator RI = save.begin(), + RE = save.end(); RI != RE; ++RI) { + blockCSI.push_back(CSI[*RI]); + } + assert(blockCSI.size() > 0 && + "Could not collect callee saved register info"); + + // If MBB has no uses of CSRs being saved, this means saves + // must be inserted at the _end_. + if (! MBB->empty() && ! CSRUsed[MBB].intersects(save)) { + I = MBB->end(); + --I; + if (I->getDesc().isCall()) { + ++I; + } else { + MachineBasicBlock::iterator I2 = I; + while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator()) + I = I2; + } + } else { + I = MBB->begin(); + } - // Now that we have a stack slot for each register to be saved, insert spill - // code into the entry block. - MachineBasicBlock *MBB = Fn.begin(); - MachineBasicBlock::iterator I = MBB->begin(); - - if (!TII.spillCalleeSavedRegisters(*MBB, I, CSI)) { - for (unsigned i = 0, e = CSI.size(); i != e; ++i) { - // Add the callee-saved register as live-in. It's killed at the spill. - MBB->addLiveIn(CSI[i].getReg()); - - // Insert the spill to the stack frame. - TII.storeRegToStackSlot(*MBB, I, CSI[i].getReg(), true, - CSI[i].getFrameIdx(), CSI[i].getRegClass()); + // When shrink wrapping, use stack slot stores/loads. + for (unsigned i = 0, e = blockCSI.size(); i != e; ++i) { + // Add the callee-saved register as live-in. + // It's killed at the spill. + MBB->addLiveIn(blockCSI[i].getReg()); + + // Insert the spill to the stack frame. + TII.storeRegToStackSlot(*MBB, I, blockCSI[i].getReg(), + true, + blockCSI[i].getFrameIdx(), + blockCSI[i].getRegClass()); + } } } + // Use CSRRestore to add code to restore the callee-saved registers in + // each block. + for (CSRegBlockMap::iterator + BI = CSRRestore.begin(), BE = CSRRestore.end(); BI != BE; ++BI) { + MachineBasicBlock* MBB = BI->first; + CSRegSet restore = BI->second; - // Add code to restore the callee-save registers in each exiting block. - for (MachineFunction::iterator FI = Fn.begin(), E = Fn.end(); FI != E; ++FI) - // If last instruction is a return instruction, add an epilogue. - if (!FI->empty() && FI->back().getDesc().isReturn()) { - MBB = FI; + if (restore.empty()) + continue; + if (! ShrinkWrapThisFunction) { + // Restore using target interface. I = MBB->end(); --I; // Skip over all terminator instructions, which are part of the return @@ -283,18 +1078,18 @@ MachineBasicBlock::iterator BeforeI = I; if (!AtStart) --BeforeI; - - // Restore all registers immediately before the return and any terminators - // that preceed it. + + // Restore all registers immediately before the return and any + // terminators that preceed it. if (!TII.restoreCalleeSavedRegisters(*MBB, I, CSI)) { for (unsigned i = 0, e = CSI.size(); i != e; ++i) { TII.loadRegFromStackSlot(*MBB, I, CSI[i].getReg(), - CSI[i].getFrameIdx(), - CSI[i].getRegClass()); + CSI[i].getFrameIdx(), + CSI[i].getRegClass()); assert(I != MBB->begin() && "loadRegFromStackSlot didn't insert any code!"); - // Insert in reverse order. loadRegFromStackSlot can insert multiple - // instructions. + // Insert in reverse order. loadRegFromStackSlot can insert + // multiple instructions. if (AtStart) I = MBB->begin(); else { @@ -303,7 +1098,79 @@ } } } + } else { +#ifndef NDEBUG + DOUT << "CSRRestore[" << getBasicBlockName(MBB) << "] = " + << stringifyCSRegSet(restore, Fn) << "\n"; +#endif + + blockCSI.clear(); + for (CSRegSet::iterator RI = restore.begin(), + RE = restore.end(); RI != RE; ++RI) { + blockCSI.push_back(CSI[*RI]); + } + assert(blockCSI.size() > 0 && + "Could not find callee saved register info"); + + // If MBB uses no CSRs but has restores, this means + // it must have restores inserted at the _beginning_. + // N.B. -- not necessary if edge splitting done. + if (MBB->empty() || ! CSRUsed[MBB].intersects(restore)) { + I = MBB->begin(); + } else { + I = MBB->end(); + --I; + + // EXP iff spill/restore implemented with push/pop: + // append restore to block unless it ends in a + // barrier terminator instruction. + + // Skip over all terminator instructions, which are part of the + // return sequence. + if (I->getDesc().isCall()) { + ++I; + } else { + MachineBasicBlock::iterator I2 = I; + while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator()) + I = I2; + } + } + + bool AtStart = I == MBB->begin(); + MachineBasicBlock::iterator BeforeI = I; + if (!AtStart) + --BeforeI; + +#ifndef NDEBUG + if (! MBB->empty() && ! CSRUsed[MBB].intersects(restore)) { + MachineInstr* MI = BeforeI; + DOUT << "adding restore after "; + DEBUG(MI->dump()); + } else { + DOUT << "adding restore to beginning of " + << getBasicBlockName(MBB) << "\n"; + } +#endif + + // Restore all registers immediately before the return and any + // terminators that preceed it. + for (unsigned i = 0, e = blockCSI.size(); i != e; ++i) { + TII.loadRegFromStackSlot(*MBB, I, blockCSI[i].getReg(), + blockCSI[i].getFrameIdx(), + blockCSI[i].getRegClass()); + assert(I != MBB->begin() && + "loadRegFromStackSlot didn't insert any code!"); + // Insert in reverse order. loadRegFromStackSlot can insert + // multiple instructions. + if (AtStart) + I = MBB->begin(); + else { + I = BeforeI; + ++I; + } + } } + } } /// AdjustStackOffset - Helper function used to adjust the stack frame offset. @@ -358,8 +1225,8 @@ // If there are fixed sized objects that are preallocated in the local area, // non-fixed objects can't be allocated right at the start of local area. - // We currently don't support filling in holes in between fixed sized objects, - // so we adjust 'Offset' to point to the end of last fixed sized + // We currently don't support filling in holes in between fixed sized + // objects, so we adjust 'Offset' to point to the end of last fixed sized // preallocated object. for (int i = FFI->getObjectIndexBegin(); i != 0; ++i) { int64_t FixedOff; @@ -385,8 +1252,8 @@ Offset += FFI->getObjectSize(i); unsigned Align = FFI->getObjectAlignment(i); - // If the alignment of this object is greater than that of the stack, then - // increase the stack alignment to match. + // If the alignment of this object is greater than that of the stack, + // then increase the stack alignment to match. MaxAlign = std::max(MaxAlign, Align); // Adjust to alignment boundary Offset = (Offset+Align-1)/Align*Align; @@ -397,8 +1264,8 @@ int MaxCSFI = MaxCSFrameIndex, MinCSFI = MinCSFrameIndex; for (int i = MaxCSFI; i >= MinCSFI ; --i) { unsigned Align = FFI->getObjectAlignment(i); - // If the alignment of this object is greater than that of the stack, then - // increase the stack alignment to match. + // If the alignment of this object is greater than that of the stack, + // then increase the stack alignment to match. MaxAlign = std::max(MaxAlign, Align); // Adjust to alignment boundary Offset = (Offset+Align-1)/Align*Align; @@ -453,7 +1320,7 @@ // offsets will be relative to SP not FP; round up the stack size so this // works. if (!RegInfo->targetHandlesStackFrameRounding() && - (FFI->hasCalls() || FFI->hasVarSizedObjects() || + (FFI->hasCalls() || FFI->hasVarSizedObjects() || (RegInfo->needsStackRealignment(Fn) && FFI->getObjectIndexEnd() != 0))) { // If we have reserved argument space for call sites in the function @@ -509,9 +1376,11 @@ int FrameSetupOpcode = TRI.getCallFrameSetupOpcode(); int FrameDestroyOpcode = TRI.getCallFrameDestroyOpcode(); - for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { + for (MachineFunction::iterator BB = Fn.begin(), + E = Fn.end(); BB != E; ++BB) { int SPAdj = 0; // SP offset due to call frame setup / destroy. if (RS) RS->enterBasicBlock(BB); + for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) { if (I->getOpcode() == TargetInstrInfo::DECLARE) { // Ignore it. @@ -560,6 +1429,7 @@ // If this instruction has a FrameIndex operand, we need to // use that target machine register info object to eliminate // it. + TRI.eliminateFrameIndex(MI, SPAdj, RS); // Reset the iterator if we were at the beginning of the BB. From jlerouge at apple.com Fri Mar 27 01:18:30 2009 From: jlerouge at apple.com (Julien Lerouge) Date: Thu, 26 Mar 2009 23:18:30 -0700 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> Message-ID: <20090327061830.GC1152@pom.apple.com> Here is the output on ppc, it seems to be the same thing on intel. g++ -I/Users/buildbot/buildbot/llvm-src/include -I/Users/buildbot/buildbot/llvm-src/lib/Transforms/Hello -I/Users/buildbot/buildbot/llvm/llvm-build/include -I/Users/buildbot/buildbot/llvm/llvm-build/lib/Transforms/Hello -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -fno-common -Woverloaded-virtual -mmacosx-version-min=10.4 -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -fstrict-aliasing -Wstrict-aliasing -O3 -module -L/Users/buildbot/buildbot/llvm/llvm-build/Release/lib -L/Users/buildbot/buildbot/llvm/llvm-build/Release/lib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib -mmacosx-version-min=10.4 -o /Users/buildbot/buildbot/llvm/llvm-build/Release/lib/LLVMHello.dylib /Users/buildbot/buildbot/llvm/llvm-build/lib/Transforms/Hello/Release/Hello.o \ /usr/bin/ld: /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../crt1.o LC_LOAD_DYLINKER load command in object file (should not be in an input file to the link editor for the output file type MH_DYLIB) collect2: ld returned 1 exit status make[3]: *** [/Users/buildbot/buildbot/llvm/llvm-build/Release/lib/LLVMHello.dylib] Error 1 Running with -v: Using built-in specs. Target: powerpc-apple-darwin8 Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8 Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5367) /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/collect2 -dynamic -arch ppc -macosx_version_min 10.4 -macosx_version_min 10.4 -multiply_defined suppress -weak_reference_mismatches non-weak -o /Users/buildbot/buildbot/llvm/llvm-build/Release/lib/LLVMHello.dylib -lcrt1.o /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/crt3.o -L/Users/buildbot/buildbot/llvm/llvm-build/Release/lib -L/Users/buildbot/buildbot/llvm/llvm-build/Release/lib -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1 -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1 -L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../.. -flat_namespace -undefined suppress -dylib /Users/buildbot/buildbot/llvm/llvm-build/lib/Transforms/Hello/Release/Hello.o -lstdc++ -lgcc_s.10.4 -lgcc -lSystemStubs -lSystem /usr/bin/ld: /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../crt1.o LC_LOAD_DYLINKER load command in object file (should not be in an input file to the link editor for the output file type MH_DYLIB) collect2: ld returned 1 exit status Thanks, Julien On Thu, Mar 26, 2009 at 01:07:24PM -0700, Bill Wendling wrote: > Hi Arnold, > > Please put VERBOSE=1 on the "make" command line and send me what > command it's using to try to build LLVMHello.dylib. > > Thanks > -bw > > On Thu, Mar 26, 2009 at 8:50 AM, Arnold Schwaighofer > wrote: > > Hello Bill, > > > > this change seems to prevent llvm from building on Mac OS X 10.4.11 on > > x86 and apparently ppc (http://llvm.org/bugs/show_bug.cgi?id=3867) > > with the following error message. > > > > llvm[3]: Linking Debug Loadable Module LLVMHello.dylib > > /usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o > > LC_LOAD_DYLINKER load command in object file (should not be in an > > input file to the link editor for the output file type MH_DYLIB) > > collect2: ld returned 1 exit status > > > > If i revert r67469 llvm builds again. But ld will complain about > > referenced symbols that are not exported. > > > > lvm[2]: Linking Debug executable llvm-as > > /usr/bin/ld: warning symbol: _NXArgc referenced dynamically and must be exported > > ... > > > > Reverting r67468 will get rid of those warnings. > > > > regards arnold > > > > On Sun, Mar 22, 2009 at 9:56 AM, Bill Wendling wrote: > >> Author: void > >> Date: Sun Mar 22 03:56:15 2009 > >> New Revision: 67469 > >> > >> URL: http://llvm.org/viewvc/llvm-project?rev=67469&view=rev > >> Log: > >> Really should pass -dylib to the linker... > >> > >> Modified: > >> ? ?llvm/trunk/Makefile.rules > >> > >> Modified: llvm/trunk/Makefile.rules > >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=67469&r1=67468&r2=67469&view=diff > >> > >> ============================================================================== > >> --- llvm/trunk/Makefile.rules (original) > >> +++ llvm/trunk/Makefile.rules Sun Mar 22 03:56:15 2009 > >> @@ -435,7 +435,7 @@ > >> ? # Get "4" out of 10.4 for later pieces in the makefile. > >> ? DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') > >> > >> - ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -dylib \ > >> + ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ > >> ? ? ? ? ? ? ? ? ? ? -mmacosx-version-min=$(DARWIN_VERSION) > >> ? CompileCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) > >> ?else > >> > >> > >> _______________________________________________ > >> llvm-commits mailing list > >> llvm-commits at cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > >> > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com From isanbard at gmail.com Fri Mar 27 01:20:35 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 06:20:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67830 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp Message-ID: <200903270620.n2R6KZ94019034@zion.cs.uiuc.edu> Author: void Date: Fri Mar 27 01:20:35 2009 New Revision: 67830 URL: http://llvm.org/viewvc/llvm-project?rev=67830&view=rev Log: --- Merging (from foreign repository) r67711 into '.': U gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp?rev=67830&r1=67829&r2=67830&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp Fri Mar 27 01:20:35 2009 @@ -1350,7 +1350,10 @@ #endif } - if (TheDebugInfo) TheDebugInfo->EmitGlobalVariable(GV, decl); + // No debug info for globals when optimization is on. While this is + // something that would be accurate and useful to a user, it currently + // affects some optimizations that, e.g., count uses. + if (TheDebugInfo && !optimize) TheDebugInfo->EmitGlobalVariable(GV, decl); TREE_ASM_WRITTEN(decl) = 1; timevar_pop(TV_LLVM_GLOBALS); From arnold.schwaighofer at gmail.com Fri Mar 27 02:49:00 2009 From: arnold.schwaighofer at gmail.com (Arnold Schwaighofer) Date: Fri, 27 Mar 2009 08:49:00 +0100 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <20090327061830.GC1152@pom.apple.com> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> <20090327061830.GC1152@pom.apple.com> Message-ID: The output on x86: llvm[3]: Linking Debug Loadable Module LLVMHello.dylib g++ -I/Users/arnold/Desktop/LLVM/build/include -I/Users/arnold/Desktop/LLVM/build/lib/Transforms/Hello -I/Users/arnold/Desktop/LLVM/llvm/include -I/Users/arnold/Desktop/LLVM/llvm/lib/Transforms/Hello -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -m32 -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -g -module -L/Users/arnold/Desktop/LLVM/build/Debug/lib -L/Users/arnold/Desktop/LLVM/build/Debug/lib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib -mmacosx-version-min=10.4 -o /Users/arnold/Desktop/LLVM/build/Debug/lib/LLVMHello.dylib /Users/arnold/Desktop/LLVM/build/lib/Transforms/Hello/Debug/Hello.o \ /usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../crt1.o LC_LOAD_DYLINKER load command in object file (should not be in an input file to the link editor for the output file type MH_DYLIB) gcc -v outputs: Target: i686-apple-darwin8 Configured with: /private/var/tmp/gcc/gcc-5363.obj~28/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8 Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5363) From baldrick at free.fr Fri Mar 27 04:42:33 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 09:42:33 -0000 Subject: [llvm-commits] [llvm] r67831 - /llvm/trunk/Makefile.rules Message-ID: <200903270942.n2R9gfPb008357@zion.cs.uiuc.edu> Author: baldrick Date: Fri Mar 27 04:41:56 2009 New Revision: 67831 URL: http://llvm.org/viewvc/llvm-project?rev=67831&view=rev Log: A Release-Asserts build makes it sound like assertions are turned on, while in fact they are turned off. Name this Release-NoAsserts instead. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=67831&r1=67830&r2=67831&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Fri Mar 27 04:41:56 2009 @@ -293,7 +293,7 @@ # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. ifdef DISABLE_ASSERTIONS - BuildMode := $(BuildMode)-Asserts + BuildMode := $(BuildMode)-NoAsserts CPP.Defines += -DNDEBUG else CPP.Defines += -D_DEBUG From baldrick at free.fr Fri Mar 27 04:42:33 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 09:42:33 -0000 Subject: [llvm-commits] [test-suite] r67832 - /test-suite/trunk/Makefile.rules Message-ID: <200903270942.n2R9gpvI008371@zion.cs.uiuc.edu> Author: baldrick Date: Fri Mar 27 04:42:23 2009 New Revision: 67832 URL: http://llvm.org/viewvc/llvm-project?rev=67832&view=rev Log: Match the LLVM name. Modified: test-suite/trunk/Makefile.rules Modified: test-suite/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?rev=67832&r1=67831&r2=67832&view=diff ============================================================================== --- test-suite/trunk/Makefile.rules (original) +++ test-suite/trunk/Makefile.rules Fri Mar 27 04:42:23 2009 @@ -151,7 +151,7 @@ # If ENABLE_ASSERTIONS=1 is specified (make command line or configured), # then adjust the CONFIGURATION name appropriately (to match LLVM makefiles) ifeq ($(DISABLE_ASSERTIONS),1) - CONFIGURATION := $(CONFIGURATION)-Asserts + CONFIGURATION := $(CONFIGURATION)-NoAsserts endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or From ggreif at gmail.com Fri Mar 27 06:23:07 2009 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 27 Mar 2009 04:23:07 -0700 (PDT) Subject: [llvm-commits] [test-suite] r67832 - /test-suite/trunk/Makefile.rules In-Reply-To: <200903270942.n2R9gpvI008371@zion.cs.uiuc.edu> References: <200903270942.n2R9gpvI008371@zion.cs.uiuc.edu> Message-ID: On Mar 27, 10:42?am, Duncan Sands wrote: > Author: baldrick > Date: Fri Mar 27 04:42:23 2009 > New Revision: 67832 > > URL:http://llvm.org/viewvc/llvm-project?rev=67832&view=rev > Log: > Match the LLVM name. > > Modified: > ? ? test-suite/trunk/Makefile.rules > > Modified: test-suite/trunk/Makefile.rules > URL:http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?r... > > ============================================================================== > --- test-suite/trunk/Makefile.rules (original) > +++ test-suite/trunk/Makefile.rules Fri Mar 27 04:42:23 2009 > @@ -151,7 +151,7 @@ > ?# If ENABLE_ASSERTIONS=1 is specified (make command line or configured), > ?# then adjust the CONFIGURATION name appropriately (to match LLVM makefiles) > ?ifeq ($(DISABLE_ASSERTIONS),1) > - ?CONFIGURATION := $(CONFIGURATION)-Asserts > + ?CONFIGURATION := $(CONFIGURATION)-NoAsserts > ?endif Hi Duncan, this change has some ugly implications. For example there are many svn:ignore properties on test directories that must be changed. Btw. Release-Asserts is (was) intended to mean Release build minus (less) Asserts. But I guess this is know to you... Cheers, Gabor > > ?# If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or > > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Fri Mar 27 06:32:56 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 12:32:56 +0100 Subject: [llvm-commits] [test-suite] r67832 - /test-suite/trunk/Makefile.rules In-Reply-To: References: <200903270942.n2R9gpvI008371@zion.cs.uiuc.edu> Message-ID: <200903271232.57167.baldrick@free.fr> Hi Gabor, > Btw. Release-Asserts is (was) intended to mean > Release build minus (less) Asserts. But I guess this > is know to you... no, I didn't know that. Let me take care of it... Ciao, Duncan. From baldrick at free.fr Fri Mar 27 06:35:04 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 11:35:04 -0000 Subject: [llvm-commits] [llvm] r67833 - /llvm/trunk/Makefile.rules Message-ID: <200903271135.n2RBZ58n014593@zion.cs.uiuc.edu> Author: baldrick Date: Fri Mar 27 06:35:00 2009 New Revision: 67833 URL: http://llvm.org/viewvc/llvm-project?rev=67833&view=rev Log: Revert previous change in favour of an explanatory comment. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=67833&r1=67832&r2=67833&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Fri Mar 27 06:35:00 2009 @@ -293,7 +293,8 @@ # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. ifdef DISABLE_ASSERTIONS - BuildMode := $(BuildMode)-NoAsserts + # Indicate that assertions are turned off using a minus sign + BuildMode := $(BuildMode)-Asserts CPP.Defines += -DNDEBUG else CPP.Defines += -D_DEBUG From baldrick at free.fr Fri Mar 27 06:35:18 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 11:35:18 -0000 Subject: [llvm-commits] [test-suite] r67834 - /test-suite/trunk/Makefile.rules Message-ID: <200903271135.n2RBZIsR014618@zion.cs.uiuc.edu> Author: baldrick Date: Fri Mar 27 06:35:17 2009 New Revision: 67834 URL: http://llvm.org/viewvc/llvm-project?rev=67834&view=rev Log: Match LLVM name. Modified: test-suite/trunk/Makefile.rules Modified: test-suite/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?rev=67834&r1=67833&r2=67834&view=diff ============================================================================== --- test-suite/trunk/Makefile.rules (original) +++ test-suite/trunk/Makefile.rules Fri Mar 27 06:35:17 2009 @@ -151,7 +151,8 @@ # If ENABLE_ASSERTIONS=1 is specified (make command line or configured), # then adjust the CONFIGURATION name appropriately (to match LLVM makefiles) ifeq ($(DISABLE_ASSERTIONS),1) - CONFIGURATION := $(CONFIGURATION)-NoAsserts + # Indicate that assertions are turned off using a minus sign + CONFIGURATION := $(CONFIGURATION)-Asserts endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or From foldr at codedgers.com Fri Mar 27 07:57:36 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 27 Mar 2009 12:57:36 -0000 Subject: [llvm-commits] [llvm] r67835 - in /llvm/trunk: include/llvm/CompilerDriver/CompilationGraph.h include/llvm/CompilerDriver/Main.inc lib/CompilerDriver/CompilationGraph.cpp Message-ID: <200903271257.n2RCvind019180@zion.cs.uiuc.edu> Author: foldr Date: Fri Mar 27 07:57:14 2009 New Revision: 67835 URL: http://llvm.org/viewvc/llvm-project?rev=67835&view=rev Log: -write-graph now can be used with -o. Makes it possible to set the output file name. Modified: llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h llvm/trunk/include/llvm/CompilerDriver/Main.inc llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp Modified: llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h?rev=67835&r1=67834&r2=67835&view=diff ============================================================================== --- llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h (original) +++ llvm/trunk/include/llvm/CompilerDriver/CompilationGraph.h Fri Mar 27 07:57:14 2009 @@ -157,8 +157,8 @@ /// in your path. void viewGraph(); - /// writeGraph - Write a compilation-graph.dot file. - void writeGraph(); + /// writeGraph - Write Graphviz .dot source file to the current direcotry. + void writeGraph(const std::string& OutputFilename); // GraphTraits support. friend NodesIterator GraphBegin(CompilationGraph*); Modified: llvm/trunk/include/llvm/CompilerDriver/Main.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CompilerDriver/Main.inc?rev=67835&r1=67834&r2=67835&view=diff ============================================================================== --- llvm/trunk/include/llvm/CompilerDriver/Main.inc (original) +++ llvm/trunk/include/llvm/CompilerDriver/Main.inc Fri Mar 27 07:57:14 2009 @@ -98,7 +98,11 @@ Plugins.PopulateCompilationGraph(graph); if (CheckGraph) { - return graph.Check(); + int ret = graph.Check(); + if (!ret) + std::cerr << "check-graph: no errors found.\n"; + + return ret; } if (ViewGraph) { @@ -108,7 +112,9 @@ } if (WriteGraph) { - graph.writeGraph(); + graph.writeGraph(OutputFilename.empty() + ? std::string("compilation-graph.dot") + : OutputFilename); return 0; } Modified: llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp?rev=67835&r1=67834&r2=67835&view=diff ============================================================================== --- llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp (original) +++ llvm/trunk/lib/CompilerDriver/CompilationGraph.cpp Fri Mar 27 07:57:14 2009 @@ -465,9 +465,6 @@ // Check for cycles. ret += this->CheckCycles(); - if (!ret) - std::cerr << "check-graph: no errors found.\n"; - return ret; } @@ -519,18 +516,18 @@ } -void CompilationGraph::writeGraph() { - std::ofstream O("compilation-graph.dot"); +void CompilationGraph::writeGraph(const std::string& OutputFilename) { + std::ofstream O(OutputFilename.c_str()); if (O.good()) { - std::cerr << "Writing 'compilation-graph.dot' file..."; + std::cerr << "Writing '"<< OutputFilename << "' file..."; llvm::WriteGraph(O, this); std::cerr << "done.\n"; O.close(); } else { - throw std::runtime_error("Error opening file 'compilation-graph.dot'" - " for writing!"); + throw std::runtime_error("Error opening file '" + OutputFilename + + "' for writing!"); } } From foldr at codedgers.com Fri Mar 27 07:58:30 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 27 Mar 2009 12:58:30 -0000 Subject: [llvm-commits] [llvm] r67836 - in /llvm/trunk: docs/CommandGuide/llvmc.pod docs/CompilerDriver.html tools/llvmc/doc/LLVMC-Reference.rst Message-ID: <200903271258.n2RCwViT019239@zion.cs.uiuc.edu> Author: foldr Date: Fri Mar 27 07:58:29 2009 New Revision: 67836 URL: http://llvm.org/viewvc/llvm-project?rev=67836&view=rev Log: Documentation update. Expand a bit on various '--*-graph' options. Modified: llvm/trunk/docs/CommandGuide/llvmc.pod llvm/trunk/docs/CompilerDriver.html llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst Modified: llvm/trunk/docs/CommandGuide/llvmc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvmc.pod?rev=67836&r1=67835&r2=67836&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvmc.pod (original) +++ llvm/trunk/docs/CommandGuide/llvmc.pod Fri Mar 27 07:58:29 2009 @@ -44,21 +44,24 @@ =item B<--check-graph> -Check the compilation for common errors like mismatched output/input -language names, multiple default edges and cycles. Hidden option, -useful for debugging. +Check the compilation for common errors like mismatched output/input language +names, multiple default edges and cycles. Because of plugins, these checks can't +be performed at compile-time. Exit with code zero if no errors were found, and +return the number of found errors otherwise. Hidden option, useful for debugging +LLVMC plugins. =item B<--view-graph> -Show a graphical representation of the compilation graph. Requires -that you have I and I programs installed. Hidden option, -useful for debugging. +Show a graphical representation of the compilation graph and exit. Requires that +you have I and I programs installed. Hidden option, useful for +debugging LLVMC plugins. =item B<--write-graph> -Write a I file in the current directory with -the compilation graph description in the Graphviz format. Hidden -option, useful for debugging. +Write a I file in the current directory with the +compilation graph description in Graphviz format (identical to the file used by +the B<--view-graph> option). The B<-o> option can be used to set the output file +name. Hidden option, useful for debugging LLVMC plugins. =item B<--save-temps> @@ -109,7 +112,8 @@ =item B<-opt> -Enable optimization with B. +Enable optimization passes with B. To pass options to the B program +use the B<-Wo,> option. =item B<-I> I Modified: llvm/trunk/docs/CompilerDriver.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CompilerDriver.html?rev=67836&r1=67835&r2=67836&view=diff ============================================================================== --- llvm/trunk/docs/CompilerDriver.html (original) +++ llvm/trunk/docs/CompilerDriver.html Fri Mar 27 07:58:29 2009 @@ -107,15 +107,18 @@
    • -load PLUGIN_NAME - Load the specified plugin DLL. Example: -load $LLVM_DIR/Release/lib/LLVMCSimple.so.
    • -v - Enable verbose mode, i.e. print out all executed commands.
    • -
    • --check-graph - Check the compilation for common errors like -mismatched output/input language names, multiple default edges and -cycles. Hidden option, useful for debugging.
    • -
    • --view-graph - Show a graphical representation of the compilation -graph. Requires that you have dot and gv programs -installed. Hidden option, useful for debugging.
    • -
    • --write-graph - Write a compilation-graph.dot file in the -current directory with the compilation graph description in the -Graphviz format. Hidden option, useful for debugging.
    • +
    • --check-graph - Check the compilation for common errors like mismatched +output/input language names, multiple default edges and cycles. Because of +plugins, these checks can't be performed at compile-time. Exit with code zero if +no errors were found, and return the number of found errors otherwise. Hidden +option, useful for debugging LLVMC plugins.
    • +
    • --view-graph - Show a graphical representation of the compilation graph +and exit. Requires that you have dot and gv programs installed. Hidden +option, useful for debugging LLVMC plugins.
    • +
    • --write-graph - Write a compilation-graph.dot file in the current +directory with the compilation graph description in Graphviz format (identical +to the file used by the --view-graph option). The -o option can be used +to set the output file name. Hidden option, useful for debugging LLVMC plugins.
    • --save-temps - Write temporary files to the current directory and do not delete them on exit. Hidden option, useful for debugging.
    • --help, --help-hidden, --version - These options have @@ -589,7 +592,7 @@

      When writing LLVMC plugins, it can be useful to get a visual view of the resulting compilation graph. This can be achieved via the command line option --view-graph. This command assumes that Graphviz and -Ghostview are installed. There is also a --dump-graph option that +Ghostview are installed. There is also a --write-graph option that creates a Graphviz source file (compilation-graph.dot) in the current directory.

      Another useful llvmc option is --check-graph. It checks the @@ -611,7 +614,7 @@ Mikhail Glushenkov
      LLVM Compiler Infrastructure
      -Last modified: $Date$ +Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $

    Modified: llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst?rev=67836&r1=67835&r2=67836&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst (original) +++ llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst Fri Mar 27 07:58:29 2009 @@ -92,17 +92,20 @@ * ``-v`` - Enable verbose mode, i.e. print out all executed commands. -* ``--check-graph`` - Check the compilation for common errors like - mismatched output/input language names, multiple default edges and - cycles. Hidden option, useful for debugging. - -* ``--view-graph`` - Show a graphical representation of the compilation - graph. Requires that you have ``dot`` and ``gv`` programs - installed. Hidden option, useful for debugging. - -* ``--write-graph`` - Write a ``compilation-graph.dot`` file in the - current directory with the compilation graph description in the - Graphviz format. Hidden option, useful for debugging. +* ``--check-graph`` - Check the compilation for common errors like mismatched + output/input language names, multiple default edges and cycles. Because of + plugins, these checks can't be performed at compile-time. Exit with code zero if + no errors were found, and return the number of found errors otherwise. Hidden + option, useful for debugging LLVMC plugins. + +* ``--view-graph`` - Show a graphical representation of the compilation graph + and exit. Requires that you have ``dot`` and ``gv`` programs installed. Hidden + option, useful for debugging LLVMC plugins. + +* ``--write-graph`` - Write a ``compilation-graph.dot`` file in the current + directory with the compilation graph description in Graphviz format (identical + to the file used by the ``--view-graph`` option). The ``-o`` option can be used + to set the output file name. Hidden option, useful for debugging LLVMC plugins. * ``--save-temps`` - Write temporary files to the current directory and do not delete them on exit. Hidden option, useful for debugging. @@ -631,7 +634,7 @@ When writing LLVMC plugins, it can be useful to get a visual view of the resulting compilation graph. This can be achieved via the command line option ``--view-graph``. This command assumes that Graphviz_ and -Ghostview_ are installed. There is also a ``--dump-graph`` option that +Ghostview_ are installed. There is also a ``--write-graph`` option that creates a Graphviz source file (``compilation-graph.dot``) in the current directory. From baldrick at free.fr Fri Mar 27 09:56:48 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 14:56:48 -0000 Subject: [llvm-commits] [llvm] r67839 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp Message-ID: <200903271456.n2REunqD026396@zion.cs.uiuc.edu> Author: baldrick Date: Fri Mar 27 09:56:47 2009 New Revision: 67839 URL: http://llvm.org/viewvc/llvm-project?rev=67839&view=rev Log: Revert r67798: it breaks llvm-gcc bootstrap on x86-64-linux, presumably due to a miscompilation. make[4]: Entering directory `gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include' if [ ! -d "./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch" ]; then \ mkdir -p ./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch; \ fi; \ gcc-4.2.llvm-objects/./gcc/xgcc -shared-libgcc -Bgcc-4.2.llvm-objects/./gcc -nostdinc++ -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/include -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g -O2 -D_GNU_SOURCE -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include -Igcc-4.2.llvm/libstdc++-v3/libsupc++ -O2 -g gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h -o x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch In file included from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/repeat.h:247, from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional:1098, from gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h:53: gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional_iterate.h:417: internal compiler error: in ggc_recalculate_in_use_p, at ggc-page.c:1602 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make[4]: *** [x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch] Error 1 Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=67839&r1=67838&r2=67839&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Fri Mar 27 09:56:47 2009 @@ -605,7 +605,6 @@ // Remove the instruction from its current basic block... but don't delete the // instruction. - CurAST->deleteValue(&I); I.removeFromParent(); // Insert the new node in Preheader, before the terminator. From mrs at apple.com Fri Mar 27 10:01:23 2009 From: mrs at apple.com (Mike Stump) Date: Fri, 27 Mar 2009 08:01:23 -0700 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <20090327061830.GC1152@pom.apple.com> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> <20090327061830.GC1152@pom.apple.com> Message-ID: <8C545F46-5A2A-4287-AF4C-42AF540DB59D@apple.com> On Mar 26, 2009, at 11:18 PM, Julien Lerouge wrote: > Here is the output on ppc, it seems to be the same thing on intel. > > g++ -I/Users/buildbot/buildbot/llvm-src/include -I/Users/buildbot/ > buildbot/llvm-src/lib/Transforms/Hello -I/Users/buildbot/buildbot/ > llvm/llvm-build/include -I/Users/buildbot/buildbot/llvm/llvm-build/ > lib/Transforms/Hello -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS - > D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -fno-common - > Woverloaded-virtual -mmacosx-version-min=10.4 -pedantic -Wall -W - > Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter - > fstrict-aliasing -Wstrict-aliasing -O3 -module -L/Users/buildbot/ > buildbot/llvm/llvm-build/Release/lib -L/Users/buildbot/buildbot/llvm/ > llvm-build/Release/lib -Wl,-flat_namespace -Wl,-undefined - > Wl,suppress -Wl,-dylib Ick, this is wrong, try just -dynamiclib instead. >>>> - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined - >>>> Wl,suppress -dylib \ >>>> + SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined - >>>> Wl,suppress -Wl,-dylib \ >>>> -mmacosx-version-min=$(DARWIN_VERSION) Yup, right there. From gohman at apple.com Fri Mar 27 10:01:54 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 08:01:54 -0700 Subject: [llvm-commits] [llvm] r67839 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp In-Reply-To: <200903271456.n2REunqD026396@zion.cs.uiuc.edu> References: <200903271456.n2REunqD026396@zion.cs.uiuc.edu> Message-ID: On Mar 27, 2009, at 7:56 AM, Duncan Sands wrote: > Author: baldrick > Date: Fri Mar 27 09:56:47 2009 > New Revision: 67839 > > URL: http://llvm.org/viewvc/llvm-project?rev=67839&view=rev > Log: > Revert r67798: it breaks llvm-gcc bootstrap on x86-64-linux, > presumably due to > a miscompilation. Thanks Duncan. Devang, r67798 also breaks MultiSource/Benchmarks/FreeBench/distray MultiSource/Benchmarks/McCat/18-imp/imp and probably others. Dan From rafael.espindola at gmail.com Fri Mar 27 10:26:33 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 27 Mar 2009 15:26:33 -0000 Subject: [llvm-commits] [llvm] r67843 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200903271526.n2RFQYA9028661@zion.cs.uiuc.edu> Author: rafael Date: Fri Mar 27 10:26:30 2009 New Revision: 67843 URL: http://llvm.org/viewvc/llvm-project?rev=67843&view=rev Log: I am trying to add a segment to the X86 addresses matching to improve TLS support (see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090309/075220.html), but that code is VERY brittle. This patch just makes it a bit more resistant. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67843&r1=67842&r2=67843&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Mar 27 10:26:30 2009 @@ -41,6 +41,8 @@ #include "llvm/Support/CommandLine.h" using namespace llvm; +const int X86AddrNumOperands = 4; + static cl::opt DisableMMX("disable-mmx", cl::Hidden, cl::desc("Disable use of MMX")); @@ -7337,17 +7339,18 @@ newMBB->addSuccessor(newMBB); // Insert instructions into newMBB based on incoming instruction - assert(bInstr->getNumOperands() < 8 && "unexpected number of operands"); + assert(bInstr->getNumOperands() < X86AddrNumOperands + 4 && + "unexpected number of operands"); DebugLoc dl = bInstr->getDebugLoc(); MachineOperand& destOper = bInstr->getOperand(0); - MachineOperand* argOpers[6]; + MachineOperand* argOpers[2 + X86AddrNumOperands]; int numArgs = bInstr->getNumOperands() - 1; for (int i=0; i < numArgs; ++i) argOpers[i] = &bInstr->getOperand(i+1); // x86 address has 4 operands: base, index, scale, and displacement - int lastAddrIndx = 3; // [0,3] - int valArgIndx = 4; + int lastAddrIndx = X86AddrNumOperands - 1; // [0,3] + int valArgIndx = lastAddrIndx + 1; unsigned t1 = F->getRegInfo().createVirtualRegister(RC); MachineInstrBuilder MIB = BuildMI(newMBB, dl, TII->get(LoadOpc), t1); @@ -7446,15 +7449,16 @@ DebugLoc dl = bInstr->getDebugLoc(); // Insert instructions into newMBB based on incoming instruction // There are 8 "real" operands plus 9 implicit def/uses, ignored here. - assert(bInstr->getNumOperands() < 18 && "unexpected number of operands"); + assert(bInstr->getNumOperands() < X86AddrNumOperands + 14 && + "unexpected number of operands"); MachineOperand& dest1Oper = bInstr->getOperand(0); MachineOperand& dest2Oper = bInstr->getOperand(1); - MachineOperand* argOpers[6]; - for (int i=0; i < 6; ++i) + MachineOperand* argOpers[2 + X86AddrNumOperands]; + for (int i=0; i < 2 + X86AddrNumOperands; ++i) argOpers[i] = &bInstr->getOperand(i+2); // x86 address has 4 operands: base, index, scale, and displacement - int lastAddrIndx = 3; // [0,3] + int lastAddrIndx = X86AddrNumOperands - 1; // [0,3] unsigned t1 = F->getRegInfo().createVirtualRegister(RC); MachineInstrBuilder MIB = BuildMI(thisMBB, dl, TII->get(LoadOpc), t1); @@ -7490,26 +7494,30 @@ tt2 = t2; } - assert((argOpers[4]->isReg() || argOpers[4]->isImm()) && + int valArgIndx = lastAddrIndx + 1; + assert((argOpers[valArgIndx]->isReg() || + argOpers[valArgIndx]->isImm()) && "invalid operand"); unsigned t5 = F->getRegInfo().createVirtualRegister(RC); unsigned t6 = F->getRegInfo().createVirtualRegister(RC); - if (argOpers[4]->isReg()) + if (argOpers[valArgIndx]->isReg()) MIB = BuildMI(newMBB, dl, TII->get(regOpcL), t5); else MIB = BuildMI(newMBB, dl, TII->get(immOpcL), t5); if (regOpcL != X86::MOV32rr) MIB.addReg(tt1); - (*MIB).addOperand(*argOpers[4]); - assert(argOpers[5]->isReg() == argOpers[4]->isReg()); - assert(argOpers[5]->isImm() == argOpers[4]->isImm()); - if (argOpers[5]->isReg()) + (*MIB).addOperand(*argOpers[valArgIndx]); + assert(argOpers[valArgIndx + 1]->isReg() == + argOpers[valArgIndx]->isReg()); + assert(argOpers[valArgIndx + 1]->isImm() == + argOpers[valArgIndx]->isImm()); + if (argOpers[valArgIndx + 1]->isReg()) MIB = BuildMI(newMBB, dl, TII->get(regOpcH), t6); else MIB = BuildMI(newMBB, dl, TII->get(immOpcH), t6); if (regOpcH != X86::MOV32rr) MIB.addReg(tt2); - (*MIB).addOperand(*argOpers[5]); + (*MIB).addOperand(*argOpers[valArgIndx + 1]); MIB = BuildMI(newMBB, dl, TII->get(copyOpc), X86::EAX); MIB.addReg(t1); @@ -7582,16 +7590,17 @@ DebugLoc dl = mInstr->getDebugLoc(); // Insert instructions into newMBB based on incoming instruction - assert(mInstr->getNumOperands() < 8 && "unexpected number of operands"); + assert(mInstr->getNumOperands() < X86AddrNumOperands + 4 && + "unexpected number of operands"); MachineOperand& destOper = mInstr->getOperand(0); - MachineOperand* argOpers[6]; + MachineOperand* argOpers[2 + X86AddrNumOperands]; int numArgs = mInstr->getNumOperands() - 1; for (int i=0; i < numArgs; ++i) argOpers[i] = &mInstr->getOperand(i+1); // x86 address has 4 operands: base, index, scale, and displacement - int lastAddrIndx = 3; // [0,3] - int valArgIndx = 4; + int lastAddrIndx = X86AddrNumOperands - 1; // [0,3] + int valArgIndx = lastAddrIndx + 1; unsigned t1 = F->getRegInfo().createVirtualRegister(X86::GR32RegisterClass); MachineInstrBuilder MIB = BuildMI(newMBB, dl, TII->get(X86::MOV32rm), t1); From baldrick at free.fr Fri Mar 27 10:29:55 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 27 Mar 2009 15:29:55 -0000 Subject: [llvm-commits] [llvm] r67844 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h Message-ID: <200903271530.n2RFU05g028909@zion.cs.uiuc.edu> Author: baldrick Date: Fri Mar 27 10:29:38 2009 New Revision: 67844 URL: http://llvm.org/viewvc/llvm-project?rev=67844&view=rev Log: Reapply r66415, which was reverted in r66426 for causing a bootstrap failure. Bootstraps here on x86-32-linux and x86-64-linux. Requested by the author Gabor Greif who says that a bug that might have been causing the failure has since been fixed. Modified: llvm/trunk/include/llvm/ADT/ilist_node.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/ADT/ilist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=67844&r1=67843&r2=67844&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) +++ llvm/trunk/include/llvm/ADT/ilist_node.h Fri Mar 27 10:29:38 2009 @@ -18,30 +18,49 @@ namespace llvm { template -struct ilist_nextprev_traits; +struct ilist_traits; +/// ilist_half_node - Base class that provides prev services for sentinels. +/// template -struct ilist_traits; +class ilist_half_node { + friend struct ilist_traits; + NodeTy *Prev; +protected: + NodeTy *getPrev() { return Prev; } + const NodeTy *getPrev() const { return Prev; } + void setPrev(NodeTy *P) { Prev = P; } + ilist_half_node() : Prev(0) {} +}; + +template +struct ilist_nextprev_traits; /// ilist_node - Base class that provides next/prev services for nodes /// that use ilist_nextprev_traits or ilist_default_traits. /// template -class ilist_node { -private: +class ilist_node : ilist_half_node { friend struct ilist_nextprev_traits; friend struct ilist_traits; - NodeTy *Prev, *Next; - NodeTy *getPrev() { return Prev; } + NodeTy *Next; NodeTy *getNext() { return Next; } - const NodeTy *getPrev() const { return Prev; } const NodeTy *getNext() const { return Next; } - void setPrev(NodeTy *N) { Prev = N; } void setNext(NodeTy *N) { Next = N; } protected: - ilist_node() : Prev(0), Next(0) {} + ilist_node() : Next(0) {} }; +/// When assertions are off, the Next field of sentinels +/// will not be accessed. So it is not necessary to allocate +/// space for it. The following macro selects the most +/// efficient trais class. +#ifndef NDEBUG +# define ILIST_NODE ilist_node +#else +# define ILIST_NODE ilist_half_node +#endif + } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=67844&r1=67843&r2=67844&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Fri Mar 27 10:29:38 2009 @@ -46,7 +46,7 @@ Instruction *ensureHead(Instruction*) const { return createSentinel(); } static void noteHead(Instruction*, Instruction*) {} private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; /// This represents a single basic block in LLVM. A basic block is simply a Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=67844&r1=67843&r2=67844&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Fri Mar 27 10:29:38 2009 @@ -26,7 +26,7 @@ template <> struct ilist_traits : public ilist_default_traits { private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=67844&r1=67843&r2=67844&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Fri Mar 27 10:29:38 2009 @@ -37,7 +37,7 @@ template <> struct ilist_traits : public ilist_default_traits { - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; public: MachineBasicBlock *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=67844&r1=67843&r2=67844&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Mar 27 10:29:38 2009 @@ -39,7 +39,7 @@ template<> struct ilist_traits : public ilist_default_traits { private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; public: SDNode *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=67844&r1=67843&r2=67844&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Fri Mar 27 10:29:38 2009 @@ -45,7 +45,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; template<> struct ilist_traits @@ -62,7 +62,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ilist_node Sentinel; + mutable ILIST_NODE Sentinel; }; class Function : public GlobalValue, public Annotable, From rafael.espindola at gmail.com Fri Mar 27 10:45:22 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 27 Mar 2009 15:45:22 -0000 Subject: [llvm-commits] [llvm] r67846 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200903271545.n2RFjPct029833@zion.cs.uiuc.edu> Author: rafael Date: Fri Mar 27 10:45:05 2009 New Revision: 67846 URL: http://llvm.org/viewvc/llvm-project?rev=67846&view=rev Log: Use less hard coded constants to make the code less brittle. Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=67846&r1=67845&r2=67846&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Fri Mar 27 10:45:05 2009 @@ -1212,8 +1212,9 @@ return NULL; SDValue LSI = Node->getOperand(4); // MemOperand const SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, In2L, In2H, LSI, Chain }; - return CurDAG->getTargetNode(Opc, Node->getDebugLoc(), - MVT::i32, MVT::i32, MVT::Other, Ops, 8); + return CurDAG->getTargetNode(Opc, Node->getDebugLoc(), + MVT::i32, MVT::i32, MVT::Other, Ops, + sizeof(Ops)/sizeof(SDValue)); } SDNode *X86DAGToDAGISel::Select(SDValue N) { @@ -1307,7 +1308,8 @@ if (foldedLoad) { SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag }; SDNode *CNode = - CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, 6); + CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, + sizeof(Ops)/sizeof(SDValue)); InFlag = SDValue(CNode, 1); // Update the chain. ReplaceUses(N1.getValue(1), SDValue(CNode, 0)); @@ -1426,7 +1428,8 @@ SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N0.getOperand(0) }; Move = SDValue(CurDAG->getTargetNode(X86::MOVZX16rm8, dl, MVT::i16, - MVT::Other, Ops, 5), 0); + MVT::Other, Ops, + sizeof(Ops)/sizeof(SDValue)), 0); Chain = Move.getValue(1); ReplaceUses(N0.getValue(1), Chain); } else { @@ -1456,7 +1459,8 @@ if (foldedLoad) { SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag }; SDNode *CNode = - CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, 6); + CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, + sizeof(Ops)/sizeof(SDValue)); InFlag = SDValue(CNode, 1); // Update the chain. ReplaceUses(N1.getValue(1), SDValue(CNode, 0)); @@ -1599,7 +1603,8 @@ TLI.getPointerTy()); SDValue Ops[] = { Tmp1, Tmp2, Chain }; return CurDAG->getTargetNode(TargetInstrInfo::DECLARE, dl, - MVT::Other, Ops, 3); + MVT::Other, Ops, + sizeof(Ops)/sizeof(SDValue)); } } From rafael.espindola at gmail.com Fri Mar 27 10:57:59 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 27 Mar 2009 15:57:59 -0000 Subject: [llvm-commits] [llvm] r67848 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <200903271558.n2RFw0GZ030708@zion.cs.uiuc.edu> Author: rafael Date: Fri Mar 27 10:57:50 2009 New Revision: 67848 URL: http://llvm.org/viewvc/llvm-project?rev=67848&view=rev Log: Avoid hardcoding that X86 addresses have 4 operands. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=67848&r1=67847&r2=67848&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Fri Mar 27 10:57:50 2009 @@ -31,6 +31,9 @@ using namespace llvm; +// FIXME: This should be some header +static const int X86AddrNumOperands = 4; + namespace { cl::opt NoFusing("disable-spill-fusing", @@ -2196,7 +2199,7 @@ } else { // Folding a normal load. Just copy the load's address operands. unsigned NumOps = LoadMI->getDesc().getNumOperands(); - for (unsigned i = NumOps - 4; i != NumOps; ++i) + for (unsigned i = NumOps - X86AddrNumOperands; i != NumOps; ++i) MOs.push_back(LoadMI->getOperand(i)); } return foldMemoryOperandImpl(MF, MI, Ops[0], MOs); @@ -2283,13 +2286,13 @@ const TargetOperandInfo &TOI = TID.OpInfo[Index]; const TargetRegisterClass *RC = TOI.isLookupPtrRegClass() ? RI.getPointerRegClass() : RI.getRegClass(TOI.RegClass); - SmallVector AddrOps; + SmallVector AddrOps; SmallVector BeforeOps; SmallVector AfterOps; SmallVector ImpOps; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { MachineOperand &Op = MI->getOperand(i); - if (i >= Index && i < Index+4) + if (i >= Index && i < Index + X86AddrNumOperands) AddrOps.push_back(Op); else if (Op.isReg() && Op.isImplicit()) ImpOps.push_back(Op); @@ -2304,7 +2307,7 @@ loadRegFromAddr(MF, Reg, AddrOps, RC, NewMIs); if (UnfoldStore) { // Address operands cannot be marked isKill. - for (unsigned i = 1; i != 5; ++i) { + for (unsigned i = 1; i != 1 + X86AddrNumOperands; ++i) { MachineOperand &MO = NewMIs[0]->getOperand(i); if (MO.isReg()) MO.setIsKill(false); @@ -2390,7 +2393,7 @@ unsigned NumOps = N->getNumOperands(); for (unsigned i = 0; i != NumOps-1; ++i) { SDValue Op = N->getOperand(i); - if (i >= Index-NumDefs && i < Index-NumDefs+4) + if (i >= Index-NumDefs && i < Index-NumDefs + X86AddrNumOperands) AddrOps.push_back(Op); else if (i < Index-NumDefs) BeforeOps.push_back(Op); From gohman at apple.com Fri Mar 27 11:17:34 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 16:17:34 -0000 Subject: [llvm-commits] [llvm] r67849 - /llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll Message-ID: <200903271617.n2RGHboQ032209@zion.cs.uiuc.edu> Author: djg Date: Fri Mar 27 11:17:22 2009 New Revision: 67849 URL: http://llvm.org/viewvc/llvm-project?rev=67849&view=rev Log: Fix this test so that it doesn't spuriously fail due to some unrelated debugging output happening to contain the string "store". Modified: llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll Modified: llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll?rev=67849&r1=67848&r2=67849&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll Fri Mar 27 11:17:22 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc64 -debug |& not grep store +; RUN: llvm-as < %s | llc -march=ppc64 -debug |& not grep {= store} ; RUN: llvm-as < %s | llc -march=ppc64 > %t ; RUN: grep __floattitf %t ; RUN: grep __fixunstfti %t From jlerouge at apple.com Fri Mar 27 12:05:30 2009 From: jlerouge at apple.com (Julien Lerouge) Date: Fri, 27 Mar 2009 10:05:30 -0700 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <8C545F46-5A2A-4287-AF4C-42AF540DB59D@apple.com> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> <20090327061830.GC1152@pom.apple.com> <8C545F46-5A2A-4287-AF4C-42AF540DB59D@apple.com> Message-ID: <20090327170529.GB22684@pom.apple.com> On Fri, Mar 27, 2009 at 08:01:23AM -0700, Mike Stump wrote: > On Mar 26, 2009, at 11:18 PM, Julien Lerouge wrote: > > Here is the output on ppc, it seems to be the same thing on intel. > > > > g++ -I/Users/buildbot/buildbot/llvm-src/include -I/Users/buildbot/ > > buildbot/llvm-src/lib/Transforms/Hello -I/Users/buildbot/buildbot/ > > llvm/llvm-build/include -I/Users/buildbot/buildbot/llvm/llvm-build/ > > lib/Transforms/Hello -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS - > > D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -fno-common - > > Woverloaded-virtual -mmacosx-version-min=10.4 -pedantic -Wall -W - > > Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter - > > fstrict-aliasing -Wstrict-aliasing -O3 -module -L/Users/buildbot/ > > buildbot/llvm/llvm-build/Release/lib -L/Users/buildbot/buildbot/llvm/ > > llvm-build/Release/lib -Wl,-flat_namespace -Wl,-undefined - > > Wl,suppress -Wl,-dylib > > Ick, this is wrong, try just -dynamiclib instead. > > >>>> - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined - > >>>> Wl,suppress -dylib \ > >>>> + SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined - > >>>> Wl,suppress -Wl,-dylib \ > >>>> -mmacosx-version-min=$(DARWIN_VERSION) > > Yup, right there. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits I tried: =================================================================== --- Makefile.rules (revision 67820) +++ Makefile.rules (working copy) @@ -435,7 +435,7 @@ # Get "4" out of 10.4 for later pieces in the makefile. DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ + SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -dynamiclib \ -mmacosx-version-min=$(DARWIN_VERSION) TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) else SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -dynamiclib \ -mmacosx-version-min=$(DARWIN_VERSION) and it worked. Can we commit this change ? Thanks, Julien -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com From clattner at apple.com Fri Mar 27 12:21:00 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 27 Mar 2009 10:21:00 -0700 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <20090327170529.GB22684@pom.apple.com> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> <20090327061830.GC1152@pom.apple.com> <8C545F46-5A2A-4287-AF4C-42AF540DB59D@apple.com> <20090327170529.GB22684@pom.apple.com> Message-ID: <38355EA5-32A5-4468-9740-F4EBBDC6254C@apple.com> On Mar 27, 2009, at 10:05 AM, Julien Lerouge wrote: > DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10. > ([0-9]).*/\1/') > > - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress > -Wl,-dylib \ > + SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress > -dynamiclib \ > -mmacosx-version-min=$(DARWIN_VERSION) > TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) > else > SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress - > dynamiclib \ > -mmacosx-version-min=$(DARWIN_VERSION) > > and it worked. > > Can we commit this change ? > If it works on both 10.4 and 10.5, please do! Thanks Julien, -Chris From ggreif at gmail.com Fri Mar 27 12:40:19 2009 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 27 Mar 2009 10:40:19 -0700 (PDT) Subject: [llvm-commits] [llvm] r67844 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: <200903271530.n2RFU05g028909@zion.cs.uiuc.edu> References: <200903271530.n2RFU05g028909@zion.cs.uiuc.edu> Message-ID: <5537ef28-620b-446b-a2dc-d50ef521be51@w9g2000yqa.googlegroups.com> On Mar 27, 4:29?pm, Duncan Sands wrote: > Author: baldrick > Date: Fri Mar 27 10:29:38 2009 > New Revision: 67844 > > URL:http://llvm.org/viewvc/llvm-project?rev=67844&view=rev > Log: > Reapply r66415, which was reverted in r66426 for > causing a bootstrap failure. ?Bootstraps here on > x86-32-linux and x86-64-linux. ?Requested by the > author Gabor Greif who says that a bug that might > have been causing the failure has since been fixed. Thanks, Duncan! Now, let's see whether it breaks again on Leopard... (with fingers firmly crossed) Cheers, Gabor > > Modified: > ? ? llvm/trunk/include/llvm/ADT/ilist_node.h > ? ? llvm/trunk/include/llvm/BasicBlock.h > ? ? llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h > ? ? llvm/trunk/include/llvm/CodeGen/MachineFunction.h > ? ? llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > ? ? llvm/trunk/include/llvm/Function.h > > Modified: llvm/trunk/include/llvm/ADT/ilist_node.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist... > > ============================================================================== > --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) > +++ llvm/trunk/include/llvm/ADT/ilist_node.h Fri Mar 27 10:29:38 2009 > @@ -18,30 +18,49 @@ > ?namespace llvm { > > ?template > -struct ilist_nextprev_traits; > +struct ilist_traits; > > +/// ilist_half_node - Base class that provides prev services for sentinels. > +/// > ?template > -struct ilist_traits; > +class ilist_half_node { > + ?friend struct ilist_traits; > + ?NodeTy *Prev; > +protected: > + ?NodeTy *getPrev() { return Prev; } > + ?const NodeTy *getPrev() const { return Prev; } > + ?void setPrev(NodeTy *P) { Prev = P; } > + ?ilist_half_node() : Prev(0) {} > +}; > + > +template > +struct ilist_nextprev_traits; > > ?/// ilist_node - Base class that provides next/prev services for nodes > ?/// that use ilist_nextprev_traits or ilist_default_traits. > ?/// > ?template > -class ilist_node { > -private: > +class ilist_node : ilist_half_node { > ? ?friend struct ilist_nextprev_traits; > ? ?friend struct ilist_traits; > - ?NodeTy *Prev, *Next; > - ?NodeTy *getPrev() { return Prev; } > + ?NodeTy *Next; > ? ?NodeTy *getNext() { return Next; } > - ?const NodeTy *getPrev() const { return Prev; } > ? ?const NodeTy *getNext() const { return Next; } > - ?void setPrev(NodeTy *N) { Prev = N; } > ? ?void setNext(NodeTy *N) { Next = N; } > ?protected: > - ?ilist_node() : Prev(0), Next(0) {} > + ?ilist_node() : Next(0) {} > ?}; > > +/// When assertions are off, the Next field of sentinels > +/// will not be accessed. So it is not necessary to allocate > +/// space for it. The following macro selects the most > +/// efficient trais class. > +#ifndef NDEBUG > +# ? define ILIST_NODE ilist_node > +#else > +# ? define ILIST_NODE ilist_half_node > +#endif > + > ?} // End llvm namespace > > ?#endif > > Modified: llvm/trunk/include/llvm/BasicBlock.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBloc... > > ============================================================================== > --- llvm/trunk/include/llvm/BasicBlock.h (original) > +++ llvm/trunk/include/llvm/BasicBlock.h Fri Mar 27 10:29:38 2009 > @@ -46,7 +46,7 @@ > ? ?Instruction *ensureHead(Instruction*) const { return createSentinel(); } > ? ?static void noteHead(Instruction*, Instruction*) {} > ?private: > - ?mutable ilist_node Sentinel; > + ?mutable ILIST_NODE Sentinel; > ?}; > > ?/// This represents a single basic block in LLVM. A basic block is simply a > > Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/M... > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Fri Mar 27 10:29:38 2009 > @@ -26,7 +26,7 @@ > ?template <> > ?struct ilist_traits : public ilist_default_traits { > ?private: > - ?mutable ilist_node Sentinel; > + ?mutable ILIST_NODE Sentinel; > > ? ?// this is only set by the MachineBasicBlock owning the LiveList > ? ?friend class MachineBasicBlock; > > Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/M... > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Fri Mar 27 10:29:38 2009 > @@ -37,7 +37,7 @@ > ?template <> > ?struct ilist_traits > ? ? ?: public ilist_default_traits { > - ?mutable ilist_node Sentinel; > + ?mutable ILIST_NODE Sentinel; > ?public: > ? ?MachineBasicBlock *createSentinel() const { > ? ? ?return static_cast(&Sentinel); > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/S... > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Mar 27 10:29:38 2009 > @@ -39,7 +39,7 @@ > > ?template<> struct ilist_traits : public ilist_default_traits { > ?private: > - ?mutable ilist_node Sentinel; > + ?mutable ILIST_NODE Sentinel; > ?public: > ? ?SDNode *createSentinel() const { > ? ? ?return static_cast(&Sentinel); > > Modified: llvm/trunk/include/llvm/Function.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.... > > ============================================================================== > --- llvm/trunk/include/llvm/Function.h (original) > +++ llvm/trunk/include/llvm/Function.h Fri Mar 27 10:29:38 2009 > @@ -45,7 +45,7 @@ > > ? ?static ValueSymbolTable *getSymTab(Function *ItemParent); > ?private: > - ?mutable ilist_node Sentinel; > + ?mutable ILIST_NODE Sentinel; > ?}; > > ?template<> struct ilist_traits > @@ -62,7 +62,7 @@ > > ? ?static ValueSymbolTable *getSymTab(Function *ItemParent); > ?private: > - ?mutable ilist_node Sentinel; > + ?mutable ILIST_NODE Sentinel; > ?}; > > ?class Function : public GlobalValue, public Annotable, > > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Fri Mar 27 13:05:29 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 11:05:29 -0700 Subject: [llvm-commits] [llvm] r67844 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: <5537ef28-620b-446b-a2dc-d50ef521be51@w9g2000yqa.googlegroups.com> References: <200903271530.n2RFU05g028909@zion.cs.uiuc.edu> <5537ef28-620b-446b-a2dc-d50ef521be51@w9g2000yqa.googlegroups.com> Message-ID: <3E3BCF01-4F9B-46EF-B1F7-DF41720042E7@apple.com> On Mar 27, 2009, at 10:40 AM, Gabor Greif wrote: > On Mar 27, 4:29 pm, Duncan Sands wrote: >> Author: baldrick >> Date: Fri Mar 27 10:29:38 2009 >> New Revision: 67844 >> >> URL:http://llvm.org/viewvc/llvm-project?rev=67844&view=rev >> Log: >> Reapply r66415, which was reverted in r66426 for >> causing a bootstrap failure. Bootstraps here on >> x86-32-linux and x86-64-linux. Requested by the >> author Gabor Greif who says that a bug that might >> have been causing the failure has since been fixed. > > Thanks, Duncan! Now, let's see whether it breaks again > on Leopard... (with fingers firmly crossed) llvm-gcc is getting errors on Leopard currently. I haven't definitely confirmed the cause, but it's aborting while building crtbegin.o, and with some debugging I got it to do this: __sputc _OSSwapInt16 _OSSwapInt32 _OSSwapInt64 __darwin_fd_isset cxa_atexit_check_2cc1(73643) malloc: *** error for object 0x41301c40: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug Setting a breakpoint in malloc_error_break stops here: (gdb) where #0 0x95ef34a9 in malloc_error_break () #1 0x95eee497 in szone_error () #2 0x95e1bb4e in tiny_free_list_add_ptr () #3 0x95e18bda in szone_free () #4 0x95e182cd in free () #5 0x00cb76a3 in llvm::FunctionType::get () #6 0x00c9c553 in llvm::ilist_traits::createSentinel () #7 0x00c654d6 in llvm::Function::Function () #8 0x0038f9b2 in TreeToLLVM::StartFunctionBody (this=0xbffff458) at llvm-gcc-4.2/gcc/llvm-convert.cpp:440 #9 0x00398b57 in TreeToLLVM::EmitFunction (this=0xbffff458) at llvm- gcc-4.2/gcc/llvm-convert.cpp:718 #10 0x0036b843 in llvm_emit_code_for_current_function (fndecl=0xf7f400) at llvm-gcc-4.2/gcc/llvm-backend.cpp:959 #11 0x0008ceee in tree_rest_of_compilation (fndecl=0xbffff458) at llvm- gcc-4.2/gcc/tree-optimize.c:479 #12 0x0000bad2 in c_expand_body (fndecl=0xf7f400) at llvm-gcc-4.2/gcc/ c-decl.c:7583 #13 0x003ed637 in cgraph_expand_function (node=0xf814d0) at llvm- gcc-4.2/gcc/cgraphunit.c:1336 #14 0x003ef523 in cgraph_assemble_pending_functions () at llvm-gcc-4.2/ gcc/cgraphunit.c:390 #15 0x003ef1c5 in cgraph_finalize_function (decl=0xf7f400, nested=false) at llvm-gcc-4.2/gcc/cgraphunit.c:539 #16 0x0000bee1 in finish_function () at llvm-gcc-4.2/gcc/c-decl.c:7552 #17 0x00053c94 in c_parser_declaration_or_fndef (parser=0x42014870, fndef_ok=true, empty_ok=, nested=false, start_attr_ok=true, foreach_elem=0x0) at llvm-gcc-4.2/gcc/c-parser.c:1632 #18 0x00061211 in c_parser_external_declaration (parser=0x42014870) at llvm-gcc-4.2/gcc/c-parser.c:1341 #19 0x00061b7e in c_parser_translation_unit [inlined] () at llvm- gcc-4.2/gcc/c-parser.c:1227 #20 0x00061b7e in c_parse_file () at llvm-gcc-4.2/gcc/c-parser.c:8884 #21 0x00047d14 in c_common_parse_file (set_yydebug=-1780407866) at llvm-gcc-4.2/gcc/c-opts.c:1326 #22 0x0032718a in compile_file [inlined] () at llvm-gcc-4.2/gcc/ toplev.c:1115 #23 0x0032718a in do_compile [inlined] () at llvm-gcc-4.2/gcc/toplev.c: 2269 #24 0x0032718a in toplev_main (argc=0, argv=0xbffff864) at llvm- gcc-4.2/gcc/toplev.c:2301 #25 0x00069aad in main (argc=4, argv=0xbffff864) at llvm-gcc-4.2/gcc/ llvm-main.cpp:38 createSentinel is suspicious here. Dan From jlerouge at apple.com Fri Mar 27 13:18:05 2009 From: jlerouge at apple.com (Julien Lerouge) Date: Fri, 27 Mar 2009 18:18:05 -0000 Subject: [llvm-commits] [llvm] r67855 - /llvm/trunk/Makefile.rules Message-ID: <200903271818.n2RII6G9008656@zion.cs.uiuc.edu> Author: jlerouge Date: Fri Mar 27 13:18:00 2009 New Revision: 67855 URL: http://llvm.org/viewvc/llvm-project?rev=67855&view=rev Log: Fix build on MacOS 10.4 systems (suggested by Mike Smith). Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=67855&r1=67854&r2=67855&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Fri Mar 27 13:18:00 2009 @@ -436,8 +436,8 @@ # Get "4" out of 10.4 for later pieces in the makefile. DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ - -mmacosx-version-min=$(DARWIN_VERSION) + SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \ + -dynamiclib -mmacosx-version-min=$(DARWIN_VERSION) TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) else ifeq ($(OS),Cygwin) From gohman at apple.com Fri Mar 27 13:37:14 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 18:37:14 -0000 Subject: [llvm-commits] [llvm] r67856 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h Message-ID: <200903271837.n2RIbEZ8009957@zion.cs.uiuc.edu> Author: djg Date: Fri Mar 27 13:37:13 2009 New Revision: 67856 URL: http://llvm.org/viewvc/llvm-project?rev=67856&view=rev Log: Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin. Modified: llvm/trunk/include/llvm/ADT/ilist_node.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/ADT/ilist_node.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=67856&r1=67855&r2=67856&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) +++ llvm/trunk/include/llvm/ADT/ilist_node.h Fri Mar 27 13:37:13 2009 @@ -18,49 +18,30 @@ namespace llvm { template -struct ilist_traits; - -/// ilist_half_node - Base class that provides prev services for sentinels. -/// -template -class ilist_half_node { - friend struct ilist_traits; - NodeTy *Prev; -protected: - NodeTy *getPrev() { return Prev; } - const NodeTy *getPrev() const { return Prev; } - void setPrev(NodeTy *P) { Prev = P; } - ilist_half_node() : Prev(0) {} -}; +struct ilist_nextprev_traits; template -struct ilist_nextprev_traits; +struct ilist_traits; /// ilist_node - Base class that provides next/prev services for nodes /// that use ilist_nextprev_traits or ilist_default_traits. /// template -class ilist_node : ilist_half_node { +class ilist_node { +private: friend struct ilist_nextprev_traits; friend struct ilist_traits; - NodeTy *Next; + NodeTy *Prev, *Next; + NodeTy *getPrev() { return Prev; } NodeTy *getNext() { return Next; } + const NodeTy *getPrev() const { return Prev; } const NodeTy *getNext() const { return Next; } + void setPrev(NodeTy *N) { Prev = N; } void setNext(NodeTy *N) { Next = N; } protected: - ilist_node() : Next(0) {} + ilist_node() : Prev(0), Next(0) {} }; -/// When assertions are off, the Next field of sentinels -/// will not be accessed. So it is not necessary to allocate -/// space for it. The following macro selects the most -/// efficient trais class. -#ifndef NDEBUG -# define ILIST_NODE ilist_node -#else -# define ILIST_NODE ilist_half_node -#endif - } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=67856&r1=67855&r2=67856&view=diff ============================================================================== --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Fri Mar 27 13:37:13 2009 @@ -46,7 +46,7 @@ Instruction *ensureHead(Instruction*) const { return createSentinel(); } static void noteHead(Instruction*, Instruction*) {} private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; }; /// This represents a single basic block in LLVM. A basic block is simply a Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=67856&r1=67855&r2=67856&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Fri Mar 27 13:37:13 2009 @@ -26,7 +26,7 @@ template <> struct ilist_traits : public ilist_default_traits { private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=67856&r1=67855&r2=67856&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Fri Mar 27 13:37:13 2009 @@ -37,7 +37,7 @@ template <> struct ilist_traits : public ilist_default_traits { - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; public: MachineBasicBlock *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=67856&r1=67855&r2=67856&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Mar 27 13:37:13 2009 @@ -39,7 +39,7 @@ template<> struct ilist_traits : public ilist_default_traits { private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; public: SDNode *createSentinel() const { return static_cast(&Sentinel); Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=67856&r1=67855&r2=67856&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Fri Mar 27 13:37:13 2009 @@ -45,7 +45,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; }; template<> struct ilist_traits @@ -62,7 +62,7 @@ static ValueSymbolTable *getSymTab(Function *ItemParent); private: - mutable ILIST_NODE Sentinel; + mutable ilist_node Sentinel; }; class Function : public GlobalValue, public Annotable, From ggreif at gmail.com Fri Mar 27 13:40:01 2009 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 27 Mar 2009 11:40:01 -0700 (PDT) Subject: [llvm-commits] [llvm] r67844 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: <3E3BCF01-4F9B-46EF-B1F7-DF41720042E7@apple.com> References: <200903271530.n2RFU05g028909@zion.cs.uiuc.edu> <5537ef28-620b-446b-a2dc-d50ef521be51@w9g2000yqa.googlegroups.com> <3E3BCF01-4F9B-46EF-B1F7-DF41720042E7@apple.com> Message-ID: On 27 Mrz., 19:05, Dan Gohman wrote: > On Mar 27, 2009, at 10:40 AM, Gabor Greif wrote: > > > On Mar 27, 4:29 pm, Duncan Sands wrote: > >> Author: baldrick > >> Date: Fri Mar 27 10:29:38 2009 > >> New Revision: 67844 > > >> URL:http://llvm.org/viewvc/llvm-project?rev=67844&view=rev > >> Log: > >> Reapply r66415, which was reverted in r66426 for > >> causing a bootstrap failure. ?Bootstraps here on > >> x86-32-linux and x86-64-linux. ?Requested by the > >> author Gabor Greif who says that a bug that might > >> have been causing the failure has since been fixed. > > > Thanks, Duncan! Now, let's see whether it breaks again > > on Leopard... (with fingers firmly crossed) > > llvm-gcc is getting errors on Leopard currently. I haven't > definitely confirmed the cause, but it's aborting while > building crtbegin.o, and with some debugging I got it to > do this: > > ? __sputc _OSSwapInt16 _OSSwapInt32 _OSSwapInt64 __darwin_fd_isset ? > cxa_atexit_check_2cc1(73643) malloc: *** error for object 0x41301c40: ? > incorrect checksum for freed object - object was probably modified ? > after being freed. > *** set a breakpoint in malloc_error_break to debug > > Setting a breakpoint in malloc_error_break stops here: Dan, thanks for the stack trace! Everything till > #6 0x00c9c553 in llvm::ilist_traits::createSentinel () looks reasonable. But: createSentinel should not call FunctionType::get() and even less free() !!! I'll have a look into the code and come back in a bit. Cheers, Gabor > > (gdb) where > #0 ?0x95ef34a9 in malloc_error_break () > #1 ?0x95eee497 in szone_error () > #2 ?0x95e1bb4e in tiny_free_list_add_ptr () > #3 ?0x95e18bda in szone_free () > #4 ?0x95e182cd in free () > #5 ?0x00cb76a3 in llvm::FunctionType::get () > #6 ?0x00c9c553 in llvm::ilist_traits::createSentinel () > #7 ?0x00c654d6 in llvm::Function::Function () > #8 ?0x0038f9b2 in TreeToLLVM::StartFunctionBody (this=0xbffff458) at ? > llvm-gcc-4.2/gcc/llvm-convert.cpp:440 > #9 ?0x00398b57 in TreeToLLVM::EmitFunction (this=0xbffff458) at llvm- > gcc-4.2/gcc/llvm-convert.cpp:718 > #10 0x0036b843 in llvm_emit_code_for_current_function ? > (fndecl=0xf7f400) at llvm-gcc-4.2/gcc/llvm-backend.cpp:959 > #11 0x0008ceee in tree_rest_of_compilation (fndecl=0xbffff458) at llvm- > gcc-4.2/gcc/tree-optimize.c:479 > #12 0x0000bad2 in c_expand_body (fndecl=0xf7f400) at llvm-gcc-4.2/gcc/ > c-decl.c:7583 > #13 0x003ed637 in cgraph_expand_function (node=0xf814d0) at llvm- > gcc-4.2/gcc/cgraphunit.c:1336 > #14 0x003ef523 in cgraph_assemble_pending_functions () at llvm-gcc-4.2/ > gcc/cgraphunit.c:390 > #15 0x003ef1c5 in cgraph_finalize_function (decl=0xf7f400, ? > nested=false) at llvm-gcc-4.2/gcc/cgraphunit.c:539 > #16 0x0000bee1 in finish_function () at llvm-gcc-4.2/gcc/c-decl.c:7552 > #17 0x00053c94 in c_parser_declaration_or_fndef (parser=0x42014870, ? > fndef_ok=true, empty_ok= optimizations>, nested=false, start_attr_ok=true, foreach_elem=0x0) at ? > llvm-gcc-4.2/gcc/c-parser.c:1632 > #18 0x00061211 in c_parser_external_declaration (parser=0x42014870) at ? > llvm-gcc-4.2/gcc/c-parser.c:1341 > #19 0x00061b7e in c_parser_translation_unit [inlined] () at llvm- > gcc-4.2/gcc/c-parser.c:1227 > #20 0x00061b7e in c_parse_file () at llvm-gcc-4.2/gcc/c-parser.c:8884 > #21 0x00047d14 in c_common_parse_file (set_yydebug=-1780407866) at ? > llvm-gcc-4.2/gcc/c-opts.c:1326 > #22 0x0032718a in compile_file [inlined] () at llvm-gcc-4.2/gcc/ > toplev.c:1115 > #23 0x0032718a in do_compile [inlined] () at llvm-gcc-4.2/gcc/toplev.c: > 2269 > #24 0x0032718a in toplev_main (argc=0, argv=0xbffff864) at llvm- > gcc-4.2/gcc/toplev.c:2301 > #25 0x00069aad in main (argc=4, argv=0xbffff864) at llvm-gcc-4.2/gcc/ > llvm-main.cpp:38 > > createSentinel is suspicious here. > > Dan > > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ggreif at gmail.com Fri Mar 27 13:57:46 2009 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 27 Mar 2009 11:57:46 -0700 (PDT) Subject: [llvm-commits] [llvm] r67844 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: References: <200903271530.n2RFU05g028909@zion.cs.uiuc.edu> <5537ef28-620b-446b-a2dc-d50ef521be51@w9g2000yqa.googlegroups.com> <3E3BCF01-4F9B-46EF-B1F7-DF41720042E7@apple.com> Message-ID: On 27 Mrz., 19:40, Gabor Greif wrote: > On 27 Mrz., 19:05, Dan Gohman wrote: > > > > > On Mar 27, 2009, at 10:40 AM, Gabor Greif wrote: > > > > On Mar 27, 4:29 pm, Duncan Sands wrote: > > >> Author: baldrick > > >> Date: Fri Mar 27 10:29:38 2009 > > >> New Revision: 67844 > > > >> URL:http://llvm.org/viewvc/llvm-project?rev=67844&view=rev > > >> Log: > > >> Reapply r66415, which was reverted in r66426 for > > >> causing a bootstrap failure. ?Bootstraps here on > > >> x86-32-linux and x86-64-linux. ?Requested by the > > >> author Gabor Greif who says that a bug that might > > >> have been causing the failure has since been fixed. > > > > Thanks, Duncan! Now, let's see whether it breaks again > > > on Leopard... (with fingers firmly crossed) > > > llvm-gcc is getting errors on Leopard currently. I haven't > > definitely confirmed the cause, but it's aborting while > > building crtbegin.o, and with some debugging I got it to > > do this: > > > ? __sputc _OSSwapInt16 _OSSwapInt32 _OSSwapInt64 __darwin_fd_isset ? > > cxa_atexit_check_2cc1(73643) malloc: *** error for object 0x41301c40: ? > > incorrect checksum for freed object - object was probably modified ? > > after being freed. > > *** set a breakpoint in malloc_error_break to debug > > > Setting a breakpoint in malloc_error_break stops here: > > Dan, thanks for the stack trace! > Everything till> #6 ?0x00c9c553 in llvm::ilist_traits::createSentinel () > > looks reasonable. > > But: createSentinel should not call FunctionType::get() > and even less free() !!! > > I'll have a look into the code and come back in a bit. Following up myself, ilist_traits::createSentinel in VMCore/Module.cpp *does* call FunctionType::get()! Nevertheless it looks like a grand kludge, I should better convert it to a "ghostly" sentinel anyway... I guess the crash is something of a memory effect of a previous Module creation/destruction. Working on it. Cheers, Gabor > > Cheers, > > ? ? ?Gabor From mrs at apple.com Fri Mar 27 15:12:55 2009 From: mrs at apple.com (Mike Stump) Date: Fri, 27 Mar 2009 20:12:55 -0000 Subject: [llvm-commits] [llvm] r67862 - /llvm/trunk/include/llvm/Support/CommandLine.h Message-ID: <200903272012.n2RKCtCG016270@zion.cs.uiuc.edu> Author: mrs Date: Fri Mar 27 15:12:55 2009 New Revision: 67862 URL: http://llvm.org/viewvc/llvm-project?rev=67862&view=rev Log: Allow invertable -xno- style optins as well. Modified: llvm/trunk/include/llvm/Support/CommandLine.h Modified: llvm/trunk/include/llvm/Support/CommandLine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=67862&r1=67861&r2=67862&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CommandLine.h (original) +++ llvm/trunk/include/llvm/Support/CommandLine.h Fri Mar 27 15:12:55 2009 @@ -544,10 +544,14 @@ if (IsInvertable) { char *s = new char [strlen(ArgStr) + 3 + 1]; s[0] = ArgStr[0]; - s[1] = 'n'; - s[2] = 'o'; - s[3] = '-'; - strcpy(&s[4], ArgStr+1); + if (strncmp(ArgStr+1, "no-", 3) == 0) + strcpy(&s[1], &ArgStr[4]); + else { + s[1] = 'n'; + s[2] = 'o'; + s[3] = '-'; + strcpy(&s[4], ArgStr+1); + } OptionNames.push_back(s); } } From isanbard at gmail.com Fri Mar 27 15:17:47 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 13:17:47 -0700 Subject: [llvm-commits] [llvm] r67469 - /llvm/trunk/Makefile.rules In-Reply-To: <38355EA5-32A5-4468-9740-F4EBBDC6254C@apple.com> References: <200903220856.n2M8uVcE015702@zion.cs.uiuc.edu> <16e5fdf90903261307v7c80fb6bjdecd6bf02bc89f91@mail.gmail.com> <20090327061830.GC1152@pom.apple.com> <8C545F46-5A2A-4287-AF4C-42AF540DB59D@apple.com> <20090327170529.GB22684@pom.apple.com> <38355EA5-32A5-4468-9740-F4EBBDC6254C@apple.com> Message-ID: <16e5fdf90903271317r4f7d9773r20a8ea9c5eb9065f@mail.gmail.com> On Fri, Mar 27, 2009 at 10:21 AM, Chris Lattner wrote: > > On Mar 27, 2009, at 10:05 AM, Julien Lerouge wrote: > >> ? DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10. >> ([0-9]).*/\1/') >> >> - ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress >> -Wl,-dylib \ >> + ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress >> -dynamiclib \ >> ? ? ? ? ? ? ? ? ? ? -mmacosx-version-min=$(DARWIN_VERSION) >> ? TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) >> else >> ?SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress - >> dynamiclib \ >> ? ? ? ? ? ? ? ? ? ?-mmacosx-version-min=$(DARWIN_VERSION) >> >> and it worked. >> >> Can we commit this change ? >> > > If it works on both 10.4 and 10.5, please do! ?Thanks Julien, > Yes, thanks, and sorry for the breakage. -bw From isanbard at gmail.com Fri Mar 27 15:18:58 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 20:18:58 -0000 Subject: [llvm-commits] [llvm] r67865 - /llvm/branches/Apple/Dib/Makefile.rules Message-ID: <200903272018.n2RKIw44016749@zion.cs.uiuc.edu> Author: void Date: Fri Mar 27 15:18:58 2009 New Revision: 67865 URL: http://llvm.org/viewvc/llvm-project?rev=67865&view=rev Log: --- Merging (from foreign repository) r67855 into '.': U Makefile.rules Use correct flag to create a dylib. Modified: llvm/branches/Apple/Dib/Makefile.rules Modified: llvm/branches/Apple/Dib/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/Makefile.rules?rev=67865&r1=67864&r2=67865&view=diff ============================================================================== --- llvm/branches/Apple/Dib/Makefile.rules (original) +++ llvm/branches/Apple/Dib/Makefile.rules Fri Mar 27 15:18:58 2009 @@ -435,8 +435,8 @@ # Get "4" out of 10.4 for later pieces in the makefile. DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress -Wl,-dylib \ - -mmacosx-version-min=$(DARWIN_VERSION) + SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \ + -dynamiclib -mmacosx-version-min=$(DARWIN_VERSION) TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) else ifeq ($(OS),Cygwin) From jlerouge at apple.com Fri Mar 27 15:40:27 2009 From: jlerouge at apple.com (Julien Lerouge) Date: Fri, 27 Mar 2009 13:40:27 -0700 Subject: [llvm-commits] [llvm] r67855 - /llvm/trunk/Makefile.rules In-Reply-To: <200903271818.n2RII6G9008656@zion.cs.uiuc.edu> References: <200903271818.n2RII6G9008656@zion.cs.uiuc.edu> Message-ID: <20090327204026.GC22684@pom.apple.com> On Fri, Mar 27, 2009 at 06:18:05PM +0000, Julien Lerouge wrote: > Fix build on MacOS 10.4 systems (suggested by Mike Smith). Uh. Sorry, that should really read "Mike Stump" ;-) -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com From ggreif at gmail.com Fri Mar 27 17:28:33 2009 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 27 Mar 2009 22:28:33 -0000 Subject: [llvm-commits] [llvm] r67872 - in /llvm/trunk: include/llvm/Module.h lib/VMCore/Module.cpp Message-ID: <200903272228.n2RMSYOr027634@zion.cs.uiuc.edu> Author: ggreif Date: Fri Mar 27 17:28:33 2009 New Revision: 67872 URL: http://llvm.org/viewvc/llvm-project?rev=67872&view=rev Log: "ghostify" the ilist sentinel Modified: llvm/trunk/include/llvm/Module.h llvm/trunk/lib/VMCore/Module.cpp Modified: llvm/trunk/include/llvm/Module.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=67872&r1=67871&r2=67872&view=diff ============================================================================== --- llvm/trunk/include/llvm/Module.h (original) +++ llvm/trunk/include/llvm/Module.h Fri Mar 27 17:28:33 2009 @@ -28,9 +28,20 @@ template<> struct ilist_traits : public SymbolTableListTraits { - // createSentinel is used to create a node that marks the end of the list. - static Function *createSentinel(); - static void destroySentinel(Function *F) { delete F; } + + // createSentinel is used to get hold of the node that marks the end of the + // list... (same trick used here as in ilist_traits) + Function *createSentinel() const { + return static_cast(&Sentinel); + } + static void destroySentinel(Function*) {} + + Function *provideInitialHead() const { return createSentinel(); } + Function *ensureHead(Function*) const { return createSentinel(); } + static void noteHead(Function*, Function*) {} + +private: + mutable ilist_node Sentinel; }; template<> struct ilist_traits : public SymbolTableListTraits { Modified: llvm/trunk/lib/VMCore/Module.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=67872&r1=67871&r2=67872&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Module.cpp (original) +++ llvm/trunk/lib/VMCore/Module.cpp Fri Mar 27 17:28:33 2009 @@ -29,14 +29,6 @@ // Methods to implement the globals and functions lists. // -Function *ilist_traits::createSentinel() { - FunctionType *FTy = - FunctionType::get(Type::VoidTy, std::vector(), false); - Function *Ret = Function::Create(FTy, GlobalValue::ExternalLinkage); - // This should not be garbage monitored. - LeakDetector::removeGarbageObject(Ret); - return Ret; -} GlobalVariable *ilist_traits::createSentinel() { GlobalVariable *Ret = new GlobalVariable(Type::Int32Ty, false, GlobalValue::ExternalLinkage); From ggreif at gmail.com Fri Mar 27 17:57:57 2009 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 27 Mar 2009 15:57:57 -0700 (PDT) Subject: [llvm-commits] [llvm] r67856 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: <200903271837.n2RIbEZ8009957@zion.cs.uiuc.edu> References: <200903271837.n2RIbEZ8009957@zion.cs.uiuc.edu> Message-ID: On 27 Mrz., 19:37, Dan Gohman wrote: > Author: djg > Date: Fri Mar 27 13:37:13 2009 > New Revision: 67856 > > URL:http://llvm.org/viewvc/llvm-project?rev=67856&view=rev > Log: > Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin. Hi Dan, as of r67872 this function cannot crash any more, could you give this patch another try locally? Thanks, and cheers, Gabor > > Modified: > ? ? llvm/trunk/include/llvm/ADT/ilist_node.h > ? ? llvm/trunk/include/llvm/BasicBlock.h > ? ? llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h > ? ? llvm/trunk/include/llvm/CodeGen/MachineFunction.h > ? ? llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > ? ? llvm/trunk/include/llvm/Function.h > > Modified: llvm/trunk/include/llvm/ADT/ilist_node.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist... > > =========================================================================== === > --- llvm/trunk/include/llvm/ADT/ilist_node.h (original) > +++ llvm/trunk/include/llvm/ADT/ilist_node.h Fri Mar 27 13:37:13 2009 > @@ -18,49 +18,30 @@ > ?namespace llvm { > > ?template > -struct ilist_traits; > - > -/// ilist_half_node - Base class that provides prev services for sentinels. > -/// > -template > -class ilist_half_node { > - ?friend struct ilist_traits; > - ?NodeTy *Prev; > -protected: > - ?NodeTy *getPrev() { return Prev; } > - ?const NodeTy *getPrev() const { return Prev; } > - ?void setPrev(NodeTy *P) { Prev = P; } > - ?ilist_half_node() : Prev(0) {} > -}; > +struct ilist_nextprev_traits; > > ?template > -struct ilist_nextprev_traits; > +struct ilist_traits; > > ?/// ilist_node - Base class that provides next/prev services for nodes > ?/// that use ilist_nextprev_traits or ilist_default_traits. > ?/// > ?template > -class ilist_node : ilist_half_node { > +class ilist_node { > +private: > ? ?friend struct ilist_nextprev_traits; > ? ?friend struct ilist_traits; > - ?NodeTy *Next; > + ?NodeTy *Prev, *Next; > + ?NodeTy *getPrev() { return Prev; } > ? ?NodeTy *getNext() { return Next; } > + ?const NodeTy *getPrev() const { return Prev; } > ? ?const NodeTy *getNext() const { return Next; } > + ?void setPrev(NodeTy *N) { Prev = N; } > ? ?void setNext(NodeTy *N) { Next = N; } > ?protected: > - ?ilist_node() : Next(0) {} > + ?ilist_node() : Prev(0), Next(0) {} > ?}; > > -/// When assertions are off, the Next field of sentinels > -/// will not be accessed. So it is not necessary to allocate > -/// space for it. The following macro selects the most > -/// efficient trais class. > -#ifndef NDEBUG > -# ? define ILIST_NODE ilist_node > -#else > -# ? define ILIST_NODE ilist_half_node > -#endif > - > ?} // End llvm namespace > > ?#endif > > Modified: llvm/trunk/include/llvm/BasicBlock.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBloc... > > =========================================================================== === > --- llvm/trunk/include/llvm/BasicBlock.h (original) > +++ llvm/trunk/include/llvm/BasicBlock.h Fri Mar 27 13:37:13 2009 > @@ -46,7 +46,7 @@ > ? ?Instruction *ensureHead(Instruction*) const { return createSentinel(); } > ? ?static void noteHead(Instruction*, Instruction*) {} > ?private: > - ?mutable ILIST_NODE Sentinel; > + ?mutable ilist_node Sentinel; > ?}; > > ?/// This represents a single basic block in LLVM. A basic block is simply a > > Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/M... > > =========================================================================== === > --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Fri Mar 27 13:37:13 2009 > @@ -26,7 +26,7 @@ > ?template <> > ?struct ilist_traits : public ilist_default_traits { > ?private: > - ?mutable ILIST_NODE Sentinel; > + ?mutable ilist_node Sentinel; > > ? ?// this is only set by the MachineBasicBlock owning the LiveList > ? ?friend class MachineBasicBlock; > > Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/M... > > =========================================================================== === > --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Fri Mar 27 13:37:13 2009 > @@ -37,7 +37,7 @@ > ?template <> > ?struct ilist_traits > ? ? ?: public ilist_default_traits { > - ?mutable ILIST_NODE Sentinel; > + ?mutable ilist_node Sentinel; > ?public: > ? ?MachineBasicBlock *createSentinel() const { > ? ? ?return static_cast(&Sentinel); > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/S... > > =========================================================================== === > --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Mar 27 13:37:13 2009 > @@ -39,7 +39,7 @@ > > ?template<> struct ilist_traits : public ilist_default_traits { > ?private: > - ?mutable ILIST_NODE Sentinel; > + ?mutable ilist_node Sentinel; > ?public: > ? ?SDNode *createSentinel() const { > ? ? ?return static_cast(&Sentinel); > > Modified: llvm/trunk/include/llvm/Function.h > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.... > > =========================================================================== === > --- llvm/trunk/include/llvm/Function.h (original) > +++ llvm/trunk/include/llvm/Function.h Fri Mar 27 13:37:13 2009 > @@ -45,7 +45,7 @@ > > ? ?static ValueSymbolTable *getSymTab(Function *ItemParent); > ?private: > - ?mutable ILIST_NODE Sentinel; > + ?mutable ilist_node Sentinel; > ?}; > > ?template<> struct ilist_traits > @@ -62,7 +62,7 @@ > > ? ?static ValueSymbolTable *getSymTab(Function *ItemParent); > ?private: > - ?mutable ILIST_NODE Sentinel; > + ?mutable ilist_node Sentinel; > ?}; > > ?class Function : public GlobalValue, public Annotable, > > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Fri Mar 27 17:58:27 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 22:58:27 -0000 Subject: [llvm-commits] [llvm] r67873 - /llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp Message-ID: <200903272258.n2RMwREJ029852@zion.cs.uiuc.edu> Author: void Date: Fri Mar 27 17:58:27 2009 New Revision: 67873 URL: http://llvm.org/viewvc/llvm-project?rev=67873&view=rev Log: --- Merging (from foreign repository) r67839 into '.': U lib/Transforms/Scalar/LICM.cpp Revert r67798. Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp?rev=67873&r1=67872&r2=67873&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/LICM.cpp Fri Mar 27 17:58:27 2009 @@ -605,7 +605,6 @@ // Remove the instruction from its current basic block... but don't delete the // instruction. - CurAST->deleteValue(&I); I.removeFromParent(); // Insert the new node in Preheader, before the terminator. From grosbach at apple.com Fri Mar 27 18:06:28 2009 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 27 Mar 2009 23:06:28 -0000 Subject: [llvm-commits] [llvm] r67874 - /llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Message-ID: <200903272306.n2RN6SEc030355@zion.cs.uiuc.edu> Author: grosbach Date: Fri Mar 27 18:06:27 2009 New Revision: 67874 URL: http://llvm.org/viewvc/llvm-project?rev=67874&view=rev Log: remove trailing whitespace Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=67874&r1=67873&r2=67874&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Fri Mar 27 18:06:27 2009 @@ -121,7 +121,7 @@ "@ tADJCALLSTACKUP $amt1", [(ARMcallseq_end imm:$amt1, imm:$amt2)]>, Requires<[IsThumb]>; -def tADJCALLSTACKDOWN : +def tADJCALLSTACKDOWN : PseudoInst<(outs), (ins i32imm:$amt), "@ tADJCALLSTACKDOWN $amt", [(ARMcallseq_start imm:$amt)]>, Requires<[IsThumb]>; @@ -147,7 +147,7 @@ def tPOP_RET : TI<(outs reglist:$dst1, variable_ops), (ins), "pop $dst1", []>; -let isCall = 1, +let isCall = 1, Defs = [R0, R1, R2, R3, LR, D0, D1, D2, D3, D4, D5, D6, D7] in { def tBL : TIx2<(outs), (ins i32imm:$func, variable_ops), @@ -183,7 +183,7 @@ } // FIXME: should be able to write a pattern for ARMBrcond, but can't use -// a two-value operand where a dag node expects two operands. :( +// a two-value operand where a dag node expects two operands. :( let isBranch = 1, isTerminator = 1 in def tBcc : TI<(outs), (ins brtarget:$target, pred:$cc), "b$cc $target", [/*(ARMbrcond bb:$target, imm:$cc)*/]>; @@ -407,7 +407,7 @@ def tREV : TI<(outs GPR:$dst), (ins GPR:$src), "rev $dst, $src", - [(set GPR:$dst, (bswap GPR:$src))]>, + [(set GPR:$dst, (bswap GPR:$src))]>, Requires<[IsThumb, HasV6]>; def tREV16 : TI<(outs GPR:$dst), (ins GPR:$src), @@ -447,11 +447,11 @@ def tSUBi3 : TI<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs), "sub $dst, $lhs, $rhs", [(set GPR:$dst, (add GPR:$lhs, imm0_7_neg:$rhs))]>; - + def tSUBi8 : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs), "sub $dst, $rhs", [(set GPR:$dst, (add GPR:$lhs, imm8_255_neg:$rhs))]>; - + def tSUBrr : TI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), "sub $dst, $lhs, $rhs", [(set GPR:$dst, (sub GPR:$lhs, GPR:$rhs))]>; @@ -475,7 +475,7 @@ Requires<[IsThumb, HasV6]>; def tUXTH : TI<(outs GPR:$dst), (ins GPR:$src), "uxth $dst, $src", - [(set GPR:$dst, (and GPR:$src, 0xFFFF))]>, + [(set GPR:$dst, (and GPR:$src, 0xFFFF))]>, Requires<[IsThumb, HasV6]>; @@ -537,7 +537,7 @@ // zextload i1 -> zextload i8 def : ThumbPat<(zextloadi1 t_addrmode_s1:$addr), (tLDRB t_addrmode_s1:$addr)>; - + // extload -> zextload def : ThumbPat<(extloadi1 t_addrmode_s1:$addr), (tLDRB t_addrmode_s1:$addr)>; def : ThumbPat<(extloadi8 t_addrmode_s1:$addr), (tLDRB t_addrmode_s1:$addr)>; From gohman at apple.com Fri Mar 27 18:51:02 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 23:51:02 -0000 Subject: [llvm-commits] [llvm] r67879 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h Message-ID: <200903272351.n2RNp3h6001260@zion.cs.uiuc.edu> Author: djg Date: Fri Mar 27 18:51:02 2009 New Revision: 67879 URL: http://llvm.org/viewvc/llvm-project?rev=67879&view=rev Log: Initialize LiveOutInfo's APInt members to zero, as APInt's default constructor produces an uninitialized APInt. This fixes PR3896. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h?rev=67879&r1=67878&r2=67879&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h Fri Mar 27 18:51:02 2009 @@ -135,7 +135,7 @@ struct LiveOutInfo { unsigned NumSignBits; APInt KnownOne, KnownZero; - LiveOutInfo() : NumSignBits(0) {} + LiveOutInfo() : NumSignBits(0), KnownOne(1, 0), KnownZero(1, 0) {} }; /// LiveOutRegInfo - Information about live out vregs, indexed by their From gohman at apple.com Fri Mar 27 18:55:05 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 23:55:05 -0000 Subject: [llvm-commits] [llvm] r67881 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200903272355.n2RNt58L001640@zion.cs.uiuc.edu> Author: djg Date: Fri Mar 27 18:55:04 2009 New Revision: 67881 URL: http://llvm.org/viewvc/llvm-project?rev=67881&view=rev Log: Fix what surely must be a copy+pasto. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=67881&r1=67880&r2=67881&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Mar 27 18:55:04 2009 @@ -548,8 +548,8 @@ FLI.LiveOutRegInfo.resize(DestReg+1); FunctionLoweringInfo::LiveOutInfo &LOI = FLI.LiveOutRegInfo[DestReg]; LOI.NumSignBits = NumSignBits; - LOI.KnownOne = NumSignBits; - LOI.KnownZero = NumSignBits; + LOI.KnownOne = KnownOne; + LOI.KnownZero = KnownZero; } } } From isanbard at gmail.com Fri Mar 27 18:58:18 2009 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 27 Mar 2009 23:58:18 -0000 Subject: [llvm-commits] [llvm] r67882 - in /llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG: SelectionDAGBuild.h SelectionDAGISel.cpp Message-ID: <200903272358.n2RNwIXq001841@zion.cs.uiuc.edu> Author: void Date: Fri Mar 27 18:58:18 2009 New Revision: 67882 URL: http://llvm.org/viewvc/llvm-project?rev=67882&view=rev Log: --- Merging (from foreign repository) r67879 into '.': U lib/CodeGen/SelectionDAG/SelectionDAGBuild.h --- Merging (from foreign repository) r67881 into '.': U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h?rev=67882&r1=67881&r2=67882&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h Fri Mar 27 18:58:18 2009 @@ -135,7 +135,7 @@ struct LiveOutInfo { unsigned NumSignBits; APInt KnownOne, KnownZero; - LiveOutInfo() : NumSignBits(0) {} + LiveOutInfo() : NumSignBits(0), KnownOne(1, 0), KnownZero(1, 0) {} }; /// LiveOutRegInfo - Information about live out vregs, indexed by their Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=67882&r1=67881&r2=67882&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Mar 27 18:58:18 2009 @@ -548,8 +548,8 @@ FLI.LiveOutRegInfo.resize(DestReg+1); FunctionLoweringInfo::LiveOutInfo &LOI = FLI.LiveOutRegInfo[DestReg]; LOI.NumSignBits = NumSignBits; - LOI.KnownOne = NumSignBits; - LOI.KnownZero = NumSignBits; + LOI.KnownOne = KnownOne; + LOI.KnownZero = KnownZero; } } } From dalej at apple.com Fri Mar 27 19:32:18 2009 From: dalej at apple.com (Dale Johannesen) Date: Sat, 28 Mar 2009 00:32:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67884 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200903280032.n2S0WJ0k003992@zion.cs.uiuc.edu> Author: johannes Date: Fri Mar 27 19:32:17 2009 New Revision: 67884 URL: http://llvm.org/viewvc/llvm-project?rev=67884&view=rev Log: Enable debug info at -O. I've fixed a lot of bugs where -g affects optimization recently; there are currently no such cases in the llvm testsuite or a substantial amount of other code on Darwin, which seems sufficient to turn it on. Woot. I make no claims about the quality of the generated debug info. Any cases where you see -g affecting optimization can now usefully be reported as bugs. TEST=ipodbgopt should test this in the llvm testsuite. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67884&r1=67883&r2=67884&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Mar 27 19:32:17 2009 @@ -307,13 +307,9 @@ } /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of -/// source line - "llvm.dbg.stoppoint." +/// source line - "llvm.dbg.stoppoint." Now enabled with -O. void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { - // Do not emit line number info, for now. - if (optimize) - return; - // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && PrevBB == CurBB && From clattner at apple.com Fri Mar 27 19:43:35 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 27 Mar 2009 17:43:35 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r67884 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp In-Reply-To: <200903280032.n2S0WJ0k003992@zion.cs.uiuc.edu> References: <200903280032.n2S0WJ0k003992@zion.cs.uiuc.edu> Message-ID: <321FDC19-B377-400D-855F-BB9985E85B03@apple.com> woot indeed! Congrats Dale (and others)! -Chris On Mar 27, 2009, at 5:32 PM, Dale Johannesen wrote: > Author: johannes > Date: Fri Mar 27 19:32:17 2009 > New Revision: 67884 > > URL: http://llvm.org/viewvc/llvm-project?rev=67884&view=rev > Log: > Enable debug info at -O. I've fixed a lot of > bugs where -g affects optimization recently; there > are currently no such cases in the llvm testsuite or > a substantial amount of other code on Darwin, which > seems sufficient to turn it on. Woot. I make > no claims about the quality of the generated debug > info. > > Any cases where you see -g affecting optimization can > now usefully be reported as bugs. TEST=ipodbgopt should > test this in the llvm testsuite. > > > Modified: > llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67884&r1=67883&r2=67884&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Mar 27 19:32:17 2009 > @@ -307,13 +307,9 @@ > } > > /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a > change of > -/// source line - "llvm.dbg.stoppoint." > +/// source line - "llvm.dbg.stoppoint." Now enabled with -O. > void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { > > - // Do not emit line number info, for now. > - if (optimize) > - return; > - > // Don't bother if things are the same as last time. > if (PrevLineNo == CurLineNo && > PrevBB == CurBB && > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Fri Mar 27 20:09:35 2009 From: dalej at apple.com (Dale Johannesen) Date: Sat, 28 Mar 2009 01:09:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67888 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200903280109.n2S19Zix006543@zion.cs.uiuc.edu> Author: johannes Date: Fri Mar 27 20:09:34 2009 New Revision: 67888 URL: http://llvm.org/viewvc/llvm-project?rev=67888&view=rev Log: Revert previous patch while I check out bootstrap breakage. Funny, worked last night. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67888&r1=67887&r2=67888&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Mar 27 20:09:34 2009 @@ -307,9 +307,13 @@ } /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of -/// source line - "llvm.dbg.stoppoint." Now enabled with -O. +/// source line - "llvm.dbg.stoppoint." void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { + // Do not emit line number info, for now. + if (optimize) + return; + // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && PrevBB == CurBB && From gohman at apple.com Fri Mar 27 20:16:59 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 27 Mar 2009 18:16:59 -0700 Subject: [llvm-commits] [llvm] r67856 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: References: <200903271837.n2RIbEZ8009957@zion.cs.uiuc.edu> Message-ID: <2DDA9A02-C880-4991-B2CE-96D2F558EE27@apple.com> On Mar 27, 2009, at 3:57 PM, Gabor Greif wrote: > On 27 Mrz., 19:37, Dan Gohman wrote: >> Author: djg >> Date: Fri Mar 27 13:37:13 2009 >> New Revision: 67856 >> >> URL:http://llvm.org/viewvc/llvm-project?rev=67856&view=rev >> Log: >> Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin. > > > Hi Dan, > > as of r67872 this function cannot crash any more, could > you give this patch another try locally? Hi Gabor, It still fails. And FWIW, I have a report of a failure with this patch on x86_64-unknown-linux-gnu in an llvm-gcc bootstrap, in case that helps. Dan From sabre at nondot.org Fri Mar 27 21:08:47 2009 From: sabre at nondot.org (Chris Lattner) Date: Sat, 28 Mar 2009 02:08:47 -0000 Subject: [llvm-commits] [llvm] r67892 - in /llvm/trunk: include/llvm/Support/CommandLine.h lib/Support/CommandLine.cpp Message-ID: <200903280208.n2S28lQ4010375@zion.cs.uiuc.edu> Author: lattner Date: Fri Mar 27 21:08:47 2009 New Revision: 67892 URL: http://llvm.org/viewvc/llvm-project?rev=67892&view=rev Log: move a large method out of line. Modified: llvm/trunk/include/llvm/Support/CommandLine.h llvm/trunk/lib/Support/CommandLine.cpp Modified: llvm/trunk/include/llvm/Support/CommandLine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=67892&r1=67891&r2=67892&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CommandLine.h (original) +++ llvm/trunk/include/llvm/Support/CommandLine.h Fri Mar 27 21:08:47 2009 @@ -540,22 +540,8 @@ bool IsInvertable; // Should we synthezise a -xno- style option? const char *ArgStr; public: - void getExtraOptionNames(std::vector &OptionNames) { - if (IsInvertable) { - char *s = new char [strlen(ArgStr) + 3 + 1]; - s[0] = ArgStr[0]; - if (strncmp(ArgStr+1, "no-", 3) == 0) - strcpy(&s[1], &ArgStr[4]); - else { - s[1] = 'n'; - s[2] = 'o'; - s[3] = '-'; - strcpy(&s[4], ArgStr+1); - } - OptionNames.push_back(s); - } - } - + void getExtraOptionNames(std::vector &OptionNames); + // parse - Return true on error. bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val); Modified: llvm/trunk/lib/Support/CommandLine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=67892&r1=67891&r2=67892&view=diff ============================================================================== --- llvm/trunk/lib/Support/CommandLine.cpp (original) +++ llvm/trunk/lib/Support/CommandLine.cpp Fri Mar 27 21:08:47 2009 @@ -877,6 +877,25 @@ return false; } +void parser::getExtraOptionNames(std::vector &OptionNames) { + if (!IsInvertable) + return; + + char *s = new char [strlen(ArgStr) + 3 + 1]; + s[0] = ArgStr[0]; + if (strncmp(ArgStr+1, "no-", 3) == 0) + strcpy(&s[1], &ArgStr[4]); + else { + s[1] = 'n'; + s[2] = 'o'; + s[3] = '-'; + strcpy(&s[4], ArgStr+1); + } + OptionNames.push_back(s); +} + + + // parser implementation // bool parser::parse(Option &O, const char *ArgName, From clattner at apple.com Fri Mar 27 21:09:52 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 27 Mar 2009 19:09:52 -0700 Subject: [llvm-commits] [llvm] r67892 - in /llvm/trunk: include/llvm/Support/CommandLine.h lib/Support/CommandLine.cpp In-Reply-To: <200903280208.n2S28lQ4010375@zion.cs.uiuc.edu> References: <200903280208.n2S28lQ4010375@zion.cs.uiuc.edu> Message-ID: <0EAEDD00-16A2-4847-8C24-315B87661232@apple.com> Mike, who delete[]'s the string that is new'd in this code? I would really really like to rip this out and move this logic to the clang driver. Why should this exist? -Chris On Mar 27, 2009, at 7:08 PM, Chris Lattner wrote: > Author: lattner > Date: Fri Mar 27 21:08:47 2009 > New Revision: 67892 > > URL: http://llvm.org/viewvc/llvm-project?rev=67892&view=rev > Log: > move a large method out of line. > > Modified: > llvm/trunk/include/llvm/Support/CommandLine.h > llvm/trunk/lib/Support/CommandLine.cpp > > Modified: llvm/trunk/include/llvm/Support/CommandLine.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=67892&r1=67891&r2=67892&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Support/CommandLine.h (original) > +++ llvm/trunk/include/llvm/Support/CommandLine.h Fri Mar 27 > 21:08:47 2009 > @@ -540,22 +540,8 @@ > bool IsInvertable; // Should we synthezise a -xno- style option? > const char *ArgStr; > public: > - void getExtraOptionNames(std::vector &OptionNames) { > - if (IsInvertable) { > - char *s = new char [strlen(ArgStr) + 3 + 1]; > - s[0] = ArgStr[0]; > - if (strncmp(ArgStr+1, "no-", 3) == 0) > - strcpy(&s[1], &ArgStr[4]); > - else { > - s[1] = 'n'; > - s[2] = 'o'; > - s[3] = '-'; > - strcpy(&s[4], ArgStr+1); > - } > - OptionNames.push_back(s); > - } > - } > - > + void getExtraOptionNames(std::vector &OptionNames); > + > // parse - Return true on error. > bool parse(Option &O, const char *ArgName, const std::string &Arg, > bool &Val); > > > Modified: llvm/trunk/lib/Support/CommandLine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=67892&r1=67891&r2=67892&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Support/CommandLine.cpp (original) > +++ llvm/trunk/lib/Support/CommandLine.cpp Fri Mar 27 21:08:47 2009 > @@ -877,6 +877,25 @@ > return false; > } > > +void parser::getExtraOptionNames(std::vector > &OptionNames) { > + if (!IsInvertable) > + return; > + > + char *s = new char [strlen(ArgStr) + 3 + 1]; > + s[0] = ArgStr[0]; > + if (strncmp(ArgStr+1, "no-", 3) == 0) > + strcpy(&s[1], &ArgStr[4]); > + else { > + s[1] = 'n'; > + s[2] = 'o'; > + s[3] = '-'; > + strcpy(&s[4], ArgStr+1); > + } > + OptionNames.push_back(s); > +} > + > + > + > // parser implementation > // > bool parser::parse(Option &O, const char *ArgName, > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Sat Mar 28 00:57:30 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 28 Mar 2009 05:57:30 -0000 Subject: [llvm-commits] [llvm] r67917 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/imul-lea-2.ll Message-ID: <200903280557.n2S5vUkD023571@zion.cs.uiuc.edu> Author: evancheng Date: Sat Mar 28 00:57:29 2009 New Revision: 67917 URL: http://llvm.org/viewvc/llvm-project?rev=67917&view=rev Log: Optimize some 64-bit multiplication by constants into two lea's or one lea + shl since imulq is slow (latency 5). e.g. x * 40 => shlq $3, %rdi leaq (%rdi,%rdi,4), %rax This has the added benefit of allowing more multiply to be folded into addressing mode. e.g. a * 24 + b => leaq (%rdi,%rdi,2), %rax leaq (%rsi,%rax,8), %rax Added: llvm/trunk/test/CodeGen/X86/imul-lea-2.ll Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=67917&r1=67916&r2=67917&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Sat Mar 28 00:57:29 2009 @@ -791,9 +791,10 @@ bool isCalledByLegalizer() const { return CalledByLegalizer; } void AddToWorklist(SDNode *N); - SDValue CombineTo(SDNode *N, const std::vector &To); - SDValue CombineTo(SDNode *N, SDValue Res); - SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1); + SDValue CombineTo(SDNode *N, const std::vector &To, + bool AddTo = true); + SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true); + SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1, bool AddTo = true); void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO); }; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=67917&r1=67916&r2=67917&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Mar 28 00:57:29 2009 @@ -93,14 +93,14 @@ } SDValue CombineTo(SDNode *N, const SDValue *To, unsigned NumTo, - bool AddTo = true); + bool AddTo = true); SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true) { return CombineTo(N, &Res, 1, AddTo); } SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1, - bool AddTo = true) { + bool AddTo = true) { SDValue To[] = { Res0, Res1 }; return CombineTo(N, To, 2, AddTo); } @@ -293,19 +293,19 @@ } SDValue TargetLowering::DAGCombinerInfo:: -CombineTo(SDNode *N, const std::vector &To) { - return ((DAGCombiner*)DC)->CombineTo(N, &To[0], To.size()); +CombineTo(SDNode *N, const std::vector &To, bool AddTo) { + return ((DAGCombiner*)DC)->CombineTo(N, &To[0], To.size(), AddTo); } SDValue TargetLowering::DAGCombinerInfo:: -CombineTo(SDNode *N, SDValue Res) { - return ((DAGCombiner*)DC)->CombineTo(N, Res); +CombineTo(SDNode *N, SDValue Res, bool AddTo) { + return ((DAGCombiner*)DC)->CombineTo(N, Res, AddTo); } SDValue TargetLowering::DAGCombinerInfo:: -CombineTo(SDNode *N, SDValue Res0, SDValue Res1) { - return ((DAGCombiner*)DC)->CombineTo(N, Res0, Res1); +CombineTo(SDNode *N, SDValue Res0, SDValue Res1, bool AddTo) { + return ((DAGCombiner*)DC)->CombineTo(N, Res0, Res1, AddTo); } void TargetLowering::DAGCombinerInfo:: Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67917&r1=67916&r2=67917&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Mar 28 00:57:29 2009 @@ -826,6 +826,8 @@ setTargetDAGCombine(ISD::SRA); setTargetDAGCombine(ISD::SRL); setTargetDAGCombine(ISD::STORE); + if (Subtarget->is64Bit()) + setTargetDAGCombine(ISD::MUL); computeRegisterProperties(); @@ -8407,6 +8409,74 @@ } +/// PerformMulCombine - Optimize a single multiply with constant into two +/// in order to implement it with two cheaper instructions, e.g. +/// LEA + SHL, LEA + LEA. +static SDValue PerformMulCombine(SDNode *N, SelectionDAG &DAG, + TargetLowering::DAGCombinerInfo &DCI) { + if (DAG.getMachineFunction(). + getFunction()->hasFnAttr(Attribute::OptimizeForSize)) + return SDValue(); + + if (DCI.isBeforeLegalize() || DCI.isCalledByLegalizer()) + return SDValue(); + + MVT VT = N->getValueType(0); + if (VT != MVT::i64) + return SDValue(); + + ConstantSDNode *C = dyn_cast(N->getOperand(1)); + if (!C) + return SDValue(); + uint64_t MulAmt = C->getZExtValue(); + if (isPowerOf2_64(MulAmt) || MulAmt == 3 || MulAmt == 5 || MulAmt == 9) + return SDValue(); + + uint64_t MulAmt1 = 0; + uint64_t MulAmt2 = 0; + if ((MulAmt % 9) == 0) { + MulAmt1 = 9; + MulAmt2 = MulAmt / 9; + } else if ((MulAmt % 5) == 0) { + MulAmt1 = 5; + MulAmt2 = MulAmt / 5; + } else if ((MulAmt % 3) == 0) { + MulAmt1 = 3; + MulAmt2 = MulAmt / 3; + } + if (MulAmt2 && + (isPowerOf2_64(MulAmt2) || MulAmt2 == 3 || MulAmt2 == 5 || MulAmt2 == 9)){ + DebugLoc DL = N->getDebugLoc(); + + if (isPowerOf2_64(MulAmt2) && + !(N->hasOneUse() && N->use_begin()->getOpcode() == ISD::ADD)) + // If second multiplifer is pow2, issue it first. We want the multiply by + // 3, 5, or 9 to be folded into the addressing mode unless the lone use + // is an add. + std::swap(MulAmt1, MulAmt2); + + SDValue NewMul; + if (isPowerOf2_64(MulAmt1)) + NewMul = DAG.getNode(ISD::SHL, DL, VT, N->getOperand(0), + DAG.getConstant(Log2_64(MulAmt1), MVT::i8)); + else + NewMul = DAG.getNode(ISD::MUL, DL, VT, N->getOperand(0), + DAG.getConstant(MulAmt1, VT)); + + if (isPowerOf2_64(MulAmt2)) + NewMul = DAG.getNode(ISD::SHL, DL, VT, NewMul, + DAG.getConstant(Log2_64(MulAmt2), MVT::i8)); + else + NewMul = DAG.getNode(ISD::MUL, DL, VT, NewMul, + DAG.getConstant(MulAmt2, VT)); + + // Do not add new nodes to DAG combiner worklist. + DCI.CombineTo(N, NewMul, false); + } + return SDValue(); +} + + /// PerformShiftCombine - Transforms vector shift nodes to use vector shifts /// when possible. static SDValue PerformShiftCombine(SDNode* N, SelectionDAG &DAG, @@ -8668,6 +8738,7 @@ return PerformBuildVectorCombine(N, DAG, DCI, Subtarget, *this); case ISD::SELECT: return PerformSELECTCombine(N, DAG, Subtarget); case X86ISD::CMOV: return PerformCMOVCombine(N, DAG, DCI); + case ISD::MUL: return PerformMulCombine(N, DAG, DCI); case ISD::SHL: case ISD::SRA: case ISD::SRL: return PerformShiftCombine(N, DAG, Subtarget); Added: llvm/trunk/test/CodeGen/X86/imul-lea-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/imul-lea-2.ll?rev=67917&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/imul-lea-2.ll (added) +++ llvm/trunk/test/CodeGen/X86/imul-lea-2.ll Sat Mar 28 00:57:29 2009 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | count 3 +; RUN: llvm-as < %s | llc -march=x86-64 | grep shl | count 1 +; RUN: llvm-as < %s | llc -march=x86-64 | not grep imul + +define i64 @t1(i64 %a) nounwind readnone { +entry: + %0 = mul i64 %a, 81 ; [#uses=1] + ret i64 %0 +} + +define i64 @t2(i64 %a) nounwind readnone { +entry: + %0 = mul i64 %a, 40 ; [#uses=1] + ret i64 %0 +} From ggreif at gmail.com Sat Mar 28 02:01:45 2009 From: ggreif at gmail.com (Gabor Greif) Date: Sat, 28 Mar 2009 00:01:45 -0700 (PDT) Subject: [llvm-commits] [llvm] r67856 - in /llvm/trunk/include/llvm: ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h In-Reply-To: <2DDA9A02-C880-4991-B2CE-96D2F558EE27@apple.com> References: <200903271837.n2RIbEZ8009957@zion.cs.uiuc.edu> <2DDA9A02-C880-4991-B2CE-96D2F558EE27@apple.com> Message-ID: <65d34413-a79f-4d8f-9f62-5ee28af4074f@w34g2000yqm.googlegroups.com> On 28 Mrz., 02:16, Dan Gohman wrote: > On Mar 27, 2009, at 3:57 PM, Gabor Greif wrote: > > > On 27 Mrz., 19:37, Dan Gohman wrote: > >> Author: djg > >> Date: Fri Mar 27 13:37:13 2009 > >> New Revision: 67856 > > >> URL:http://llvm.org/viewvc/llvm-project?rev=67856&view=rev > >> Log: > >> Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin. > > > Hi Dan, > > > as of r67872 this function cannot crash any more, could > > you give this patch another try locally? > > Hi Gabor, > > It still fails. And FWIW, I have a report of a failure with this > patch on x86_64-unknown-linux-gnu in an llvm-gcc bootstrap, in case > that helps. Sure it does! It should be possible to find somebody with x86_64-linux to try bootstrap under valgrind. That said, I am cooking up an evil plan... Its 5th line has the words "wife's" "Leopard" "iBook" :-) Thanks for having this tried, Dan! Cheers, Gabor > > Dan > > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Sat Mar 28 02:44:54 2009 From: sabre at nondot.org (Chris Lattner) Date: Sat, 28 Mar 2009 07:44:54 -0000 Subject: [llvm-commits] [llvm] r67930 - /llvm/trunk/include/llvm/ADT/SmallPtrSet.h Message-ID: <200903280744.n2S7itvd031825@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 02:44:53 2009 New Revision: 67930 URL: http://llvm.org/viewvc/llvm-project?rev=67930&view=rev Log: add a traits class for SmallPtrSet that allows us to stick things that are "basically pointers" into it. Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=67930&r1=67929&r2=67930&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Sat Mar 28 02:44:53 2009 @@ -20,6 +20,29 @@ #include "llvm/Support/DataTypes.h" namespace llvm { + +/// PointerLikeTypeInfo - This is a traits object that is used to handle pointer +/// types and things that are just wrappers for pointers as a uniform entity. +template +class PointerLikeTypeInfo { + //getAsVoidPointer/getFromVoidPointer +}; + +// Provide PointerLikeTypeInfo for all pointers. +template +struct PointerLikeTypeInfo { + static inline void *getAsVoidPointer(T* P) { return P; } + static inline T *getFromVoidPointer(void *P) { + return static_cast(P); + } +}; +template +struct PointerLikeTypeInfo { + static inline const void *getAsVoidPointer(const T* P) { return P; } + static inline const T *getFromVoidPointer(const void *P) { + return static_cast(P); + } +}; class SmallPtrSetIteratorImpl; @@ -168,6 +191,7 @@ /// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet. template class SmallPtrSetIterator : public SmallPtrSetIteratorImpl { + typedef PointerLikeTypeInfo PtrTraits; public: explicit SmallPtrSetIterator(const void *const *BP) : SmallPtrSetIteratorImpl(BP) {} @@ -175,7 +199,7 @@ // Most methods provided by baseclass. const PtrTy operator*() const { - return static_cast(const_cast(*Bucket)); + return PtrTraits::getFromVoidPointer(const_cast(*Bucket)); } inline SmallPtrSetIterator& operator++() { // Preincrement @@ -213,7 +237,7 @@ struct NextPowerOfTwo { enum { Val = NextPowerOfTwoH::Val }; }; - + /// SmallPtrSet - This class implements a set which is optimizer for holding /// SmallSize or less elements. This internally rounds up SmallSize to the next @@ -224,6 +248,7 @@ // Make sure that SmallSize is a power of two, round up if not. enum { SmallSizePowTwo = NextPowerOfTwo::Val }; void *SmallArray[SmallSizePowTwo]; + typedef PointerLikeTypeInfo PtrTraits; public: SmallPtrSet() : SmallPtrSetImpl(NextPowerOfTwo::Val) {} SmallPtrSet(const SmallPtrSet &that) : SmallPtrSetImpl(that) {} @@ -236,14 +261,20 @@ /// insert - This returns true if the pointer was new to the set, false if it /// was already in the set. - bool insert(PtrType Ptr) { return insert_imp(Ptr); } + bool insert(PtrType Ptr) { + return insert_imp(PtrTraits::getAsVoidPointer(Ptr)); + } /// erase - If the set contains the specified pointer, remove it and return /// true, otherwise return false. - bool erase(PtrType Ptr) { return erase_imp(Ptr); } + bool erase(PtrType Ptr) { + return erase_imp(PtrTraits::getAsVoidPointer(Ptr)); + } /// count - Return true if the specified pointer is in the set. - bool count(PtrType Ptr) const { return count_imp(Ptr); } + bool count(PtrType Ptr) const { + return count_imp(PtrTraits::getAsVoidPointer(Ptr)); + } template void insert(IterT I, IterT E) { From sabre at nondot.org Sat Mar 28 02:48:04 2009 From: sabre at nondot.org (Chris Lattner) Date: Sat, 28 Mar 2009 07:48:04 -0000 Subject: [llvm-commits] [llvm] r67931 - /llvm/trunk/include/llvm/ADT/SmallPtrSet.h Message-ID: <200903280748.n2S7m4T4032630@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 02:48:03 2009 New Revision: 67931 URL: http://llvm.org/viewvc/llvm-project?rev=67931&view=rev Log: declare everything as class to avoid angering the VC++ gods. Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=67931&r1=67930&r2=67931&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Sat Mar 28 02:48:03 2009 @@ -30,14 +30,16 @@ // Provide PointerLikeTypeInfo for all pointers. template -struct PointerLikeTypeInfo { +class PointerLikeTypeInfo { +public: static inline void *getAsVoidPointer(T* P) { return P; } static inline T *getFromVoidPointer(void *P) { return static_cast(P); } }; template -struct PointerLikeTypeInfo { +class PointerLikeTypeInfo { +public: static inline const void *getAsVoidPointer(const T* P) { return P; } static inline const T *getFromVoidPointer(const void *P) { return static_cast(P); From arnold.schwaighofer at gmail.com Sat Mar 28 03:33:28 2009 From: arnold.schwaighofer at gmail.com (Arnold Schwaighofer) Date: Sat, 28 Mar 2009 08:33:28 -0000 Subject: [llvm-commits] [llvm] r67934 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/tailcall-i1.ll test/CodeGen/X86/tailcall-structret.ll Message-ID: <200903280833.n2S8XTYA010601@zion.cs.uiuc.edu> Author: arnolds Date: Sat Mar 28 03:33:27 2009 New Revision: 67934 URL: http://llvm.org/viewvc/llvm-project?rev=67934&view=rev Log: Enable tail call optimization for functions that return a struct (bug 3664) and for functions that return types that need extending (e.g i1). Added: llvm/trunk/test/CodeGen/X86/tailcall-i1.ll llvm/trunk/test/CodeGen/X86/tailcall-structret.ll Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=67934&r1=67933&r2=67934&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Sat Mar 28 03:33:27 2009 @@ -1206,18 +1206,7 @@ /// preceeds the RET node and whether the return uses the result of the node /// or is a void return. This function can be used by the target to determine /// eligiblity of tail call optimization. - static bool CheckTailCallReturnConstraints(CallSDNode *TheCall, SDValue Ret) { - unsigned NumOps = Ret.getNumOperands(); - if ((NumOps == 1 && - (Ret.getOperand(0) == SDValue(TheCall,1) || - Ret.getOperand(0) == SDValue(TheCall,0))) || - (NumOps > 1 && - Ret.getOperand(0) == SDValue(TheCall, - TheCall->getNumValues()-1) && - Ret.getOperand(1) == SDValue(TheCall,0))) - return true; - return false; - } + static bool CheckTailCallReturnConstraints(CallSDNode *TheCall, SDValue Ret); /// GetPossiblePreceedingTailCall - Get preceeding TailCallNodeOpCode node if /// it exists. Skip a possible ISD::TokenFactor. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=67934&r1=67933&r2=67934&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sat Mar 28 03:33:27 2009 @@ -2571,3 +2571,27 @@ DAG.getConstant(magics.s-1, getShiftAmountTy())); } } + +bool TargetLowering::CheckTailCallReturnConstraints(CallSDNode *TheCall, SDValue Ret) { + unsigned NumOps = Ret.getNumOperands(); + // Struct return. + if(NumOps >= 5&& + Ret.getOperand(1).getOpcode()==ISD::MERGE_VALUES && + Ret.getOperand(1).getOperand(0) == SDValue(TheCall, 0)) + return true; + if ((NumOps == 1 && + (Ret.getOperand(0) == SDValue(TheCall,1) || + Ret.getOperand(0) == SDValue(TheCall,0))) || + (NumOps == 3 && + Ret.getOperand(1).getOpcode() == ISD::ANY_EXTEND && + Ret.getOperand(1).getNumOperands()>0 && + Ret.getOperand(1).getOperand(0).getOpcode() == ISD::TRUNCATE && + Ret.getOperand(1).getOperand(0).getNumOperands()>0 && + Ret.getOperand(1).getOperand(0).getOperand(0) == SDValue(TheCall, 0)) || + (NumOps > 1 && + Ret.getOperand(0) == SDValue(TheCall, + TheCall->getNumValues()-1) && + Ret.getOperand(1) == SDValue(TheCall,0))) + return true; + return false; +} Added: llvm/trunk/test/CodeGen/X86/tailcall-i1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-i1.ll?rev=67934&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/tailcall-i1.ll (added) +++ llvm/trunk/test/CodeGen/X86/tailcall-i1.ll Sat Mar 28 03:33:27 2009 @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL +define fastcc i1 @i1test(i32, i32, i32, i32) { + entry: + %4 = tail call fastcc i1 @i1test( i32 %0, i32 %1, i32 %2, i32 %3) + ret i1 %4 +} Added: llvm/trunk/test/CodeGen/X86/tailcall-structret.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-structret.ll?rev=67934&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/tailcall-structret.ll (added) +++ llvm/trunk/test/CodeGen/X86/tailcall-structret.ll Sat Mar 28 03:33:27 2009 @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL +define fastcc { { i8*, i8* }*, i8*} @init({ { i8*, i8* }*, i8*}, i32) { +entry: + %2 = tail call fastcc { { i8*, i8* }*, i8* } @init({ { i8*, i8*}*, i8*} %0, i32 %1) + ret { { i8*, i8* }*, i8*} %2 +} From isanbard at gmail.com Sat Mar 28 04:09:02 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 09:09:02 -0000 Subject: [llvm-commits] [llvm] r67935 - in /llvm/branches/Apple/Dib: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/imul-lea-2.ll Message-ID: <200903280909.n2S99382013091@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 04:08:59 2009 New Revision: 67935 URL: http://llvm.org/viewvc/llvm-project?rev=67935&view=rev Log: --- Merging (from foreign repository) r67917 into '.': A test/CodeGen/X86/imul-lea-2.ll U include/llvm/Target/TargetLowering.h U lib/CodeGen/SelectionDAG/DAGCombiner.cpp U lib/Target/X86/X86ISelLowering.cpp Optimize some 64-bit multiplication by constants into two lea's or one lea + shl since imulq is slow (latency 5). e.g. x * 40 => shlq $3, %rdi leaq (%rdi,%rdi,4), %rax This has the added benefit of allowing more multiply to be folded into addressing mode. e.g. a * 24 + b => leaq (%rdi,%rdi,2), %rax leaq (%rsi,%rax,8), %rax Added: llvm/branches/Apple/Dib/test/CodeGen/X86/imul-lea-2.ll Modified: llvm/branches/Apple/Dib/include/llvm/Target/TargetLowering.h llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/branches/Apple/Dib/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/Target/TargetLowering.h?rev=67935&r1=67934&r2=67935&view=diff ============================================================================== --- llvm/branches/Apple/Dib/include/llvm/Target/TargetLowering.h (original) +++ llvm/branches/Apple/Dib/include/llvm/Target/TargetLowering.h Sat Mar 28 04:08:59 2009 @@ -791,9 +791,10 @@ bool isCalledByLegalizer() const { return CalledByLegalizer; } void AddToWorklist(SDNode *N); - SDValue CombineTo(SDNode *N, const std::vector &To); - SDValue CombineTo(SDNode *N, SDValue Res); - SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1); + SDValue CombineTo(SDNode *N, const std::vector &To, + bool AddTo = true); + SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true); + SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1, bool AddTo = true); void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO); }; Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=67935&r1=67934&r2=67935&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Mar 28 04:08:59 2009 @@ -93,14 +93,14 @@ } SDValue CombineTo(SDNode *N, const SDValue *To, unsigned NumTo, - bool AddTo = true); + bool AddTo = true); SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true) { return CombineTo(N, &Res, 1, AddTo); } SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1, - bool AddTo = true) { + bool AddTo = true) { SDValue To[] = { Res0, Res1 }; return CombineTo(N, To, 2, AddTo); } @@ -293,19 +293,19 @@ } SDValue TargetLowering::DAGCombinerInfo:: -CombineTo(SDNode *N, const std::vector &To) { - return ((DAGCombiner*)DC)->CombineTo(N, &To[0], To.size()); +CombineTo(SDNode *N, const std::vector &To, bool AddTo) { + return ((DAGCombiner*)DC)->CombineTo(N, &To[0], To.size(), AddTo); } SDValue TargetLowering::DAGCombinerInfo:: -CombineTo(SDNode *N, SDValue Res) { - return ((DAGCombiner*)DC)->CombineTo(N, Res); +CombineTo(SDNode *N, SDValue Res, bool AddTo) { + return ((DAGCombiner*)DC)->CombineTo(N, Res, AddTo); } SDValue TargetLowering::DAGCombinerInfo:: -CombineTo(SDNode *N, SDValue Res0, SDValue Res1) { - return ((DAGCombiner*)DC)->CombineTo(N, Res0, Res1); +CombineTo(SDNode *N, SDValue Res0, SDValue Res1, bool AddTo) { + return ((DAGCombiner*)DC)->CombineTo(N, Res0, Res1, AddTo); } void TargetLowering::DAGCombinerInfo:: Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp?rev=67935&r1=67934&r2=67935&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Sat Mar 28 04:08:59 2009 @@ -824,6 +824,8 @@ setTargetDAGCombine(ISD::SRA); setTargetDAGCombine(ISD::SRL); setTargetDAGCombine(ISD::STORE); + if (Subtarget->is64Bit()) + setTargetDAGCombine(ISD::MUL); computeRegisterProperties(); @@ -8398,6 +8400,74 @@ } +/// PerformMulCombine - Optimize a single multiply with constant into two +/// in order to implement it with two cheaper instructions, e.g. +/// LEA + SHL, LEA + LEA. +static SDValue PerformMulCombine(SDNode *N, SelectionDAG &DAG, + TargetLowering::DAGCombinerInfo &DCI) { + if (DAG.getMachineFunction(). + getFunction()->hasFnAttr(Attribute::OptimizeForSize)) + return SDValue(); + + if (DCI.isBeforeLegalize() || DCI.isCalledByLegalizer()) + return SDValue(); + + MVT VT = N->getValueType(0); + if (VT != MVT::i64) + return SDValue(); + + ConstantSDNode *C = dyn_cast(N->getOperand(1)); + if (!C) + return SDValue(); + uint64_t MulAmt = C->getZExtValue(); + if (isPowerOf2_64(MulAmt) || MulAmt == 3 || MulAmt == 5 || MulAmt == 9) + return SDValue(); + + uint64_t MulAmt1 = 0; + uint64_t MulAmt2 = 0; + if ((MulAmt % 9) == 0) { + MulAmt1 = 9; + MulAmt2 = MulAmt / 9; + } else if ((MulAmt % 5) == 0) { + MulAmt1 = 5; + MulAmt2 = MulAmt / 5; + } else if ((MulAmt % 3) == 0) { + MulAmt1 = 3; + MulAmt2 = MulAmt / 3; + } + if (MulAmt2 && + (isPowerOf2_64(MulAmt2) || MulAmt2 == 3 || MulAmt2 == 5 || MulAmt2 == 9)){ + DebugLoc DL = N->getDebugLoc(); + + if (isPowerOf2_64(MulAmt2) && + !(N->hasOneUse() && N->use_begin()->getOpcode() == ISD::ADD)) + // If second multiplifer is pow2, issue it first. We want the multiply by + // 3, 5, or 9 to be folded into the addressing mode unless the lone use + // is an add. + std::swap(MulAmt1, MulAmt2); + + SDValue NewMul; + if (isPowerOf2_64(MulAmt1)) + NewMul = DAG.getNode(ISD::SHL, DL, VT, N->getOperand(0), + DAG.getConstant(Log2_64(MulAmt1), MVT::i8)); + else + NewMul = DAG.getNode(ISD::MUL, DL, VT, N->getOperand(0), + DAG.getConstant(MulAmt1, VT)); + + if (isPowerOf2_64(MulAmt2)) + NewMul = DAG.getNode(ISD::SHL, DL, VT, NewMul, + DAG.getConstant(Log2_64(MulAmt2), MVT::i8)); + else + NewMul = DAG.getNode(ISD::MUL, DL, VT, NewMul, + DAG.getConstant(MulAmt2, VT)); + + // Do not add new nodes to DAG combiner worklist. + DCI.CombineTo(N, NewMul, false); + } + return SDValue(); +} + + /// PerformShiftCombine - Transforms vector shift nodes to use vector shifts /// when possible. static SDValue PerformShiftCombine(SDNode* N, SelectionDAG &DAG, @@ -8659,6 +8729,7 @@ return PerformBuildVectorCombine(N, DAG, DCI, Subtarget, *this); case ISD::SELECT: return PerformSELECTCombine(N, DAG, Subtarget); case X86ISD::CMOV: return PerformCMOVCombine(N, DAG, DCI); + case ISD::MUL: return PerformMulCombine(N, DAG, DCI); case ISD::SHL: case ISD::SRA: case ISD::SRL: return PerformShiftCombine(N, DAG, Subtarget); Added: llvm/branches/Apple/Dib/test/CodeGen/X86/imul-lea-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/imul-lea-2.ll?rev=67935&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/X86/imul-lea-2.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/X86/imul-lea-2.ll Sat Mar 28 04:08:59 2009 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | count 3 +; RUN: llvm-as < %s | llc -march=x86-64 | grep shl | count 1 +; RUN: llvm-as < %s | llc -march=x86-64 | not grep imul + +define i64 @t1(i64 %a) nounwind readnone { +entry: + %0 = mul i64 %a, 81 ; [#uses=1] + ret i64 %0 +} + +define i64 @t2(i64 %a) nounwind readnone { +entry: + %0 = mul i64 %a, 40 ; [#uses=1] + ret i64 %0 +} From isanbard at gmail.com Sat Mar 28 04:58:56 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 09:58:56 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67936 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c Message-ID: <200903280958.n2S9wvZM016290@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 04:58:50 2009 New Revision: 67936 URL: http://llvm.org/viewvc/llvm-project?rev=67936&view=rev Log: Add LLVM LOCAL markers. Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c?rev=67936&r1=67935&r2=67936&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/libgcov.c Sat Mar 28 04:58:50 2009 @@ -35,6 +35,7 @@ #include "tm.h" /* APPLE LOCAL begin instant off 6414141 */ +/* LLVM LOCAL - not __arm__ */ #if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #include #if defined(VPROC_HAS_TRANSACTIONS) @@ -160,6 +161,7 @@ } /* APPLE LOCAL begin instant off 6414141 */ +/* LLVM LOCAL - not __arm__ */ #if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #if defined(VPROC_HAS_TRANSACTIONS) static vproc_transaction_t gcov_trans; From isanbard at gmail.com Sat Mar 28 05:00:17 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 10:00:17 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67937 - /llvm-gcc-4.2/trunk/gcc/libgcov.c Message-ID: <200903281000.n2SA0HKu016373@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 05:00:16 2009 New Revision: 67937 URL: http://llvm.org/viewvc/llvm-project?rev=67937&view=rev Log: Add LLVM LOCAL markers. Modified: llvm-gcc-4.2/trunk/gcc/libgcov.c Modified: llvm-gcc-4.2/trunk/gcc/libgcov.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/libgcov.c?rev=67937&r1=67936&r2=67937&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/libgcov.c (original) +++ llvm-gcc-4.2/trunk/gcc/libgcov.c Sat Mar 28 05:00:16 2009 @@ -35,6 +35,7 @@ #include "tm.h" /* APPLE LOCAL begin instant off 6414141 */ +/* LLVM LOCAL - not __arm__ */ #if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #include #if defined(VPROC_HAS_TRANSACTIONS) @@ -160,6 +161,7 @@ } /* APPLE LOCAL begin instant off 6414141 */ +/* LLVM LOCAL - not __arm__ */ #if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__) #if defined(VPROC_HAS_TRANSACTIONS) static vproc_transaction_t gcov_trans; From isanbard at gmail.com Sat Mar 28 05:01:51 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 10:01:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67938 - in /llvm-gcc-4.2/branches/Apple/Dib/gcc: c-typeck.c cp/pt.c cp/typeck.c fold-const.c testsuite/ChangeLog.apple testsuite/g++.apple/asm-block-68.C version.c Message-ID: <200903281001.n2SA1qOs016482@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 05:01:51 2009 New Revision: 67938 URL: http://llvm.org/viewvc/llvm-project?rev=67938&view=rev Log: Update to Apple GCC 5644. Very small changes. Added: llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/g++.apple/asm-block-68.C Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/c-typeck.c llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/pt.c llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/typeck.c llvm-gcc-4.2/branches/Apple/Dib/gcc/fold-const.c llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/ChangeLog.apple llvm-gcc-4.2/branches/Apple/Dib/gcc/version.c Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/c-typeck.c?rev=67938&r1=67937&r2=67938&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/c-typeck.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/c-typeck.c Sat Mar 28 05:01:51 2009 @@ -4179,8 +4179,6 @@ STRIP_TYPE_NOPS (rhs); - newrhs = rhs; - /* APPLE LOCAL begin __block assign sequence point 6639533 */ /* For byref = x;, we have to transform this into {( typeof(x) x' = x; byref = x`; )} to ensure there is a sequence point before the @@ -4207,7 +4205,7 @@ /* then we save the rhs. */ rhs = save_expr (rhs); if (rhs != old_rhs) - /* And arrage for the sequence point to be inserted. */ + /* And arrange for the sequence point to be inserted. */ insert_sequence_point = true; } } @@ -4215,6 +4213,8 @@ } /* APPLE LOCAL end __block assign sequence point 6639533 */ + newrhs = rhs; + /* If a binary op has been requested, combine the old LHS value with the RHS producing the value we should actually store into the LHS. */ Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/pt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/pt.c?rev=67938&r1=67937&r2=67938&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/pt.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/pt.c Sat Mar 28 05:01:51 2009 @@ -8752,6 +8752,26 @@ if (TREE_CODE (asm_expr) == CLEANUP_POINT_EXPR) asm_expr = TREE_OPERAND (asm_expr, 0); ASM_INPUT_P (asm_expr) = ASM_INPUT_P (t); + /* APPLE LOCAL begin inline asm labels in templates 6606502 */ + /* We have to check to see if we have a CW style inline assembly + label, and mark it as defined, if this asm defines it. */ + if (TREE_CODE (TREE_OPERAND (asm_expr, 0)) == STRING_CST + && TREE_STRING_LENGTH (TREE_OPERAND (asm_expr, 0)) >= 5 + && strncmp (TREE_STRING_POINTER (TREE_OPERAND (asm_expr, 0)), + "%l0:", 4)) + { + tree inner = TREE_OPERAND (asm_expr, 2); + if (inner && TREE_CODE (inner) == TREE_LIST) + { + inner = TREE_VALUE (inner); + if (inner && TREE_CODE (inner) == ADDR_EXPR) { + inner = TREE_OPERAND (inner, 0); + if (TREE_CODE (inner) == LABEL_DECL) + DECL_INITIAL (inner) = error_mark_node; + } + } + } + /* APPLE LOCAL end inline asm labels in templates 6606502 */ } break; Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/typeck.c?rev=67938&r1=67937&r2=67938&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/typeck.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/cp/typeck.c Sat Mar 28 05:01:51 2009 @@ -6263,7 +6263,7 @@ /* then we save the rhs. */ rhs = save_expr (rhs); if (rhs != old_rhs) - /* And arrage for the sequence point to be inserted. */ + /* And arrange for the sequence point to be inserted. */ insert_sequence_point = true; } } Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/fold-const.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/fold-const.c?rev=67938&r1=67937&r2=67938&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/fold-const.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/fold-const.c Sat Mar 28 05:01:51 2009 @@ -5842,9 +5842,11 @@ (C * 8) % 4 since we know that's zero. */ if ((code == TRUNC_MOD_EXPR || code == CEIL_MOD_EXPR || code == FLOOR_MOD_EXPR || code == ROUND_MOD_EXPR) + /* APPLE LOCAL begin mod overflow 6486153 */ && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t)) || (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE && TYPE_IS_SIZETYPE (TREE_TYPE (t)))) + /* APPLE LOCAL end mod overflow 6486153 */ && TREE_CODE (TREE_OPERAND (t, 1)) == INTEGER_CST && integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c, 0))) return omit_one_operand (type, integer_zero_node, op0); @@ -10574,13 +10576,13 @@ /* bool_var != 1 becomes !bool_var. */ if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_onep (arg1) && code == NE_EXPR) - /* APPLE LOCAL file radar 6286881 */ + /* APPLE LOCAL radar 6286881 */ return fold_build1 (TRUTH_NOT_EXPR, type, fold_convert (type, arg0)); /* bool_var == 0 becomes !bool_var. */ if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_zerop (arg1) && code == EQ_EXPR) - /* APPLE LOCAL file radar 6286881 */ + /* APPLE LOCAL radar 6286881 */ return fold_build1 (TRUTH_NOT_EXPR, type, fold_convert (type, arg0)); /* ~a != C becomes a != ~C where C is a constant. Likewise for ==. */ Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/ChangeLog.apple?rev=67938&r1=67937&r2=67938&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/ChangeLog.apple (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/ChangeLog.apple Sat Mar 28 05:01:51 2009 @@ -1,3 +1,7 @@ +2009-03-24 Stuart Hastings + + gcc.apple/5774346.c: Add -maltivec. + 2009-02-11 Fariborz Jahanian Radar 6545782 Added: llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/g++.apple/asm-block-68.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/g%2B%2B.apple/asm-block-68.C?rev=67938&view=auto ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/g++.apple/asm-block-68.C (added) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/testsuite/g++.apple/asm-block-68.C Sat Mar 28 05:01:51 2009 @@ -0,0 +1,30 @@ +/* APPLE LOCAL file inline asm labels in templates 6606502 */ +/* { dg-do run } */ +/* { dg-options "-fasm-blocks" } */ +/* Radar 6606502 */ + +class Foo { +public: + static void dummy(){} +}; + +class Foo1 { +public: + static void dummy(){} +}; + +template +static void MyFunc() { + asm { + jmp $mylabel + $mylabel: + } + T::dummy(); +} + +int main(int argc, char** argv) +{ + MyFunc(); + MyFunc(); + return 0; +} Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/version.c?rev=67938&r1=67937&r2=67938&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/version.c (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/version.c Sat Mar 28 05:01:51 2009 @@ -11,12 +11,12 @@ /* APPLE LOCAL begin Apple version */ #ifdef ENABLE_LLVM #ifdef LLVM_VERSION_INFO -#define VERSUFFIX " (Based on Apple Inc. build 5643) (LLVM build " LLVM_VERSION_INFO ")" +#define VERSUFFIX " (Based on Apple Inc. build 5644) (LLVM build " LLVM_VERSION_INFO ")" #else -#define VERSUFFIX " (Based on Apple Inc. build 5643) (LLVM build)" +#define VERSUFFIX " (Based on Apple Inc. build 5644) (LLVM build)" #endif #else -#define VERSUFFIX " (Based on Apple Inc. build 5643)" +#define VERSUFFIX " (Based on Apple Inc. build 5644)" #endif /* APPLE LOCAL end Apple version */ From isanbard at gmail.com Sat Mar 28 05:03:28 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 10:03:28 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67939 - in /llvm-gcc-4.2/trunk/gcc: c-typeck.c cp/pt.c cp/typeck.c fold-const.c testsuite/ChangeLog.apple testsuite/g++.apple/asm-block-68.C version.c Message-ID: <200903281003.n2SA3Sbm016621@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 05:03:27 2009 New Revision: 67939 URL: http://llvm.org/viewvc/llvm-project?rev=67939&view=rev Log: Merge to Apple GCC 5644. Mostly minor changes. Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-68.C Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c llvm-gcc-4.2/trunk/gcc/cp/pt.c llvm-gcc-4.2/trunk/gcc/cp/typeck.c llvm-gcc-4.2/trunk/gcc/fold-const.c llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=67939&r1=67938&r2=67939&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Sat Mar 28 05:03:27 2009 @@ -4179,8 +4179,6 @@ STRIP_TYPE_NOPS (rhs); - newrhs = rhs; - /* APPLE LOCAL begin __block assign sequence point 6639533 */ /* For byref = x;, we have to transform this into {( typeof(x) x' = x; byref = x`; )} to ensure there is a sequence point before the @@ -4207,7 +4205,7 @@ /* then we save the rhs. */ rhs = save_expr (rhs); if (rhs != old_rhs) - /* And arrage for the sequence point to be inserted. */ + /* And arrange for the sequence point to be inserted. */ insert_sequence_point = true; } } @@ -4215,6 +4213,8 @@ } /* APPLE LOCAL end __block assign sequence point 6639533 */ + newrhs = rhs; + /* If a binary op has been requested, combine the old LHS value with the RHS producing the value we should actually store into the LHS. */ Modified: llvm-gcc-4.2/trunk/gcc/cp/pt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/pt.c?rev=67939&r1=67938&r2=67939&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/pt.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/pt.c Sat Mar 28 05:03:27 2009 @@ -8752,6 +8752,26 @@ if (TREE_CODE (asm_expr) == CLEANUP_POINT_EXPR) asm_expr = TREE_OPERAND (asm_expr, 0); ASM_INPUT_P (asm_expr) = ASM_INPUT_P (t); + /* APPLE LOCAL begin inline asm labels in templates 6606502 */ + /* We have to check to see if we have a CW style inline assembly + label, and mark it as defined, if this asm defines it. */ + if (TREE_CODE (TREE_OPERAND (asm_expr, 0)) == STRING_CST + && TREE_STRING_LENGTH (TREE_OPERAND (asm_expr, 0)) >= 5 + && strncmp (TREE_STRING_POINTER (TREE_OPERAND (asm_expr, 0)), + "%l0:", 4)) + { + tree inner = TREE_OPERAND (asm_expr, 2); + if (inner && TREE_CODE (inner) == TREE_LIST) + { + inner = TREE_VALUE (inner); + if (inner && TREE_CODE (inner) == ADDR_EXPR) { + inner = TREE_OPERAND (inner, 0); + if (TREE_CODE (inner) == LABEL_DECL) + DECL_INITIAL (inner) = error_mark_node; + } + } + } + /* APPLE LOCAL end inline asm labels in templates 6606502 */ } break; Modified: llvm-gcc-4.2/trunk/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/typeck.c?rev=67939&r1=67938&r2=67939&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/typeck.c Sat Mar 28 05:03:27 2009 @@ -6263,7 +6263,7 @@ /* then we save the rhs. */ rhs = save_expr (rhs); if (rhs != old_rhs) - /* And arrage for the sequence point to be inserted. */ + /* And arrange for the sequence point to be inserted. */ insert_sequence_point = true; } } Modified: llvm-gcc-4.2/trunk/gcc/fold-const.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/fold-const.c?rev=67939&r1=67938&r2=67939&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/fold-const.c (original) +++ llvm-gcc-4.2/trunk/gcc/fold-const.c Sat Mar 28 05:03:27 2009 @@ -5842,9 +5842,11 @@ (C * 8) % 4 since we know that's zero. */ if ((code == TRUNC_MOD_EXPR || code == CEIL_MOD_EXPR || code == FLOOR_MOD_EXPR || code == ROUND_MOD_EXPR) + /* APPLE LOCAL begin mod overflow 6486153 */ && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t)) || (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE && TYPE_IS_SIZETYPE (TREE_TYPE (t)))) + /* APPLE LOCAL end mod overflow 6486153 */ && TREE_CODE (TREE_OPERAND (t, 1)) == INTEGER_CST && integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c, 0))) return omit_one_operand (type, integer_zero_node, op0); @@ -10574,13 +10576,13 @@ /* bool_var != 1 becomes !bool_var. */ if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_onep (arg1) && code == NE_EXPR) - /* APPLE LOCAL file radar 6286881 */ + /* APPLE LOCAL radar 6286881 */ return fold_build1 (TRUTH_NOT_EXPR, type, fold_convert (type, arg0)); /* bool_var == 0 becomes !bool_var. */ if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_zerop (arg1) && code == EQ_EXPR) - /* APPLE LOCAL file radar 6286881 */ + /* APPLE LOCAL radar 6286881 */ return fold_build1 (TRUTH_NOT_EXPR, type, fold_convert (type, arg0)); /* ~a != C becomes a != ~C where C is a constant. Likewise for ==. */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple?rev=67939&r1=67938&r2=67939&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Sat Mar 28 05:03:27 2009 @@ -1,3 +1,7 @@ +2009-03-24 Stuart Hastings + + gcc.apple/5774346.c: Add -maltivec. + 2009-02-11 Fariborz Jahanian Radar 6545782 Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-68.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/asm-block-68.C?rev=67939&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-68.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-68.C Sat Mar 28 05:03:27 2009 @@ -0,0 +1,30 @@ +/* APPLE LOCAL file inline asm labels in templates 6606502 */ +/* { dg-do run } */ +/* { dg-options "-fasm-blocks" } */ +/* Radar 6606502 */ + +class Foo { +public: + static void dummy(){} +}; + +class Foo1 { +public: + static void dummy(){} +}; + +template +static void MyFunc() { + asm { + jmp $mylabel + $mylabel: + } + T::dummy(); +} + +int main(int argc, char** argv) +{ + MyFunc(); + MyFunc(); + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=67939&r1=67938&r2=67939&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Sat Mar 28 05:03:27 2009 @@ -11,12 +11,12 @@ /* APPLE LOCAL begin Apple version */ #ifdef ENABLE_LLVM #ifdef LLVM_VERSION_INFO -#define VERSUFFIX " (Based on Apple Inc. build 5643) (LLVM build " LLVM_VERSION_INFO ")" +#define VERSUFFIX " (Based on Apple Inc. build 5644) (LLVM build " LLVM_VERSION_INFO ")" #else -#define VERSUFFIX " (Based on Apple Inc. build 5643) (LLVM build)" +#define VERSUFFIX " (Based on Apple Inc. build 5644) (LLVM build)" #endif #else -#define VERSUFFIX " (Based on Apple Inc. build 5643)" +#define VERSUFFIX " (Based on Apple Inc. build 5644)" #endif /* APPLE LOCAL end Apple version */ From isanbard at gmail.com Sat Mar 28 05:07:52 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 03:07:52 -0700 Subject: [llvm-commits] [llvm] r67849 - /llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll In-Reply-To: <200903271617.n2RGHboQ032209@zion.cs.uiuc.edu> References: <200903271617.n2RGHboQ032209@zion.cs.uiuc.edu> Message-ID: On Mar 27, 2009, at 9:17 AM, Dan Gohman wrote: > Author: djg > Date: Fri Mar 27 11:17:22 2009 > New Revision: 67849 > > URL: http://llvm.org/viewvc/llvm-project?rev=67849&view=rev > Log: > Fix this test so that it doesn't spuriously fail due to some > unrelated debugging output happening to contain the string "store". > > Modified: > llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll > > Modified: llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll?rev=67849&r1=67848&r2=67849&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll (original) > +++ llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll Fri Mar 27 > 11:17:22 2009 > @@ -1,4 +1,4 @@ > -; RUN: llvm-as < %s | llc -march=ppc64 -debug |& not grep store > +; RUN: llvm-as < %s | llc -march=ppc64 -debug |& not grep {= store} I thought that "store" instructions were never assigned to a variable... -bw From isanbard at gmail.com Sat Mar 28 05:24:34 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 10:24:34 -0000 Subject: [llvm-commits] [llvm] r67940 - /llvm/trunk/docs/GettingStartedVS.html Message-ID: <200903281024.n2SAOcE9017952@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 05:24:15 2009 New Revision: 67940 URL: http://llvm.org/viewvc/llvm-project?rev=67940&view=rev Log: Update the Visual Studio docs. Patch by Stefanus! Modified: llvm/trunk/docs/GettingStartedVS.html Modified: llvm/trunk/docs/GettingStartedVS.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStartedVS.html?rev=67940&r1=67939&r2=67940&view=diff ============================================================================== --- llvm/trunk/docs/GettingStartedVS.html (original) +++ llvm/trunk/docs/GettingStartedVS.html Sat Mar 28 05:24:15 2009 @@ -337,9 +337,9 @@ -

    Note: this will only work for trivial C programs. Non-trivial programs - (and any C++ program) will have dependencies on the GCC runtime that - won't be satisfied by the Microsoft runtime libraries.

    +

    Note: this will only work for trivial C programs. Non-trivial programs + (and any C++ program) will have dependencies on the GCC runtime that won't + be satisfied by the Microsoft runtime libraries.

  • Execute the native code program:

    @@ -360,6 +360,17 @@
    +
      +
    • In Visual C++, if you are linking with the x86 target statically, the + linker will remove the x86 target library from your generated executable or + shared library because there are no references to it. You can force the + linker to include these references by using + "/INCLUDE:_X86TargetMachineModule" when linking. In the Visual + Studio IDE, this can be added in +Project Properties->Linker->Input->Force Symbol References. +
    • +
    +

    If you are having problems building or using LLVM, or if you have any other general questions about LLVM, please consult the Frequently Asked Questions page.

    From isanbard at gmail.com Sat Mar 28 05:24:54 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 03:24:54 -0700 Subject: [llvm-commits] Ping! [PATCH] Fwd: Docs:added: fix for missing x86 target library in windows In-Reply-To: <89CDBFD4-DCDA-4550-B3D6-9E1698B8BACE@rapidmind.com> References: <49B59097.3080502@rapidmind.com> <89CDBFD4-DCDA-4550-B3D6-9E1698B8BACE@rapidmind.com> Message-ID: <6835870A-D899-4046-94D9-D73D1E22E6C7@gmail.com> Committed. Thanks! Sending docs/GettingStartedVS.html Transmitting file data . Committed revision 67940. -bw On Mar 26, 2009, at 7:05 AM, Stefanus Du Toit wrote: > Just thought I would ping this patch in the hopes that someone might > apply it. It's a simple docs patch that points out a step necessary > to make Visual Studio projects work with LLVM if one wants to use > the JIT. Figuring this out caused us some frustration, so hopefully > this will help others in the same boat. > > Begin forwarded message: >> From: Tareq Siraj >> Date: March 9, 2009 5:56:39 PM GMT-04:00 >> To: "llvm-commits at cs.uiuc.edu" >> Subject: [llvm-commits] Docs:added: fix for missing x86 target >> library in windows >> Reply-To: Commit Messages and Patches for LLVM > > >> >> As discussed in #llvm, added documentation about the fix for >> missing x86 >> target library in windows under the "Common problems" section. >> >> -- >> Regards, >> Tareq Ahmed Siraj >> RapidMind Inc. >> http://www.rapidmind.com >> > > -- > Stefanus Du Toit > RapidMind Inc. > phone: +1 519 885 5455 x116 -- fax: +1 519 885 1463 > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Sat Mar 28 05:28:30 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 10:28:30 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67941 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Message-ID: <200903281028.n2SASa6c018206@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 05:28:09 2009 New Revision: 67941 URL: http://llvm.org/viewvc/llvm-project?rev=67941&view=rev Log: --- Merging (from foreign repository) r67814 into '.': U gcc/llvm-convert.cpp __builtin_memset_chk has an extra integer argument. Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp?rev=67941&r1=67940&r2=67941&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Sat Mar 28 05:28:09 2009 @@ -5176,9 +5176,15 @@ bool TreeToLLVM::EmitBuiltinMemSet(tree exp, Value *&Result, bool SizeCheck) { tree arglist = TREE_OPERAND(exp, 1); - if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, - INTEGER_TYPE, VOID_TYPE)) - return false; + if (SizeCheck) { + if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, + INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return false; + } else { + if (!validate_arglist(arglist, POINTER_TYPE, INTEGER_TYPE, + INTEGER_TYPE, VOID_TYPE)) + return false; + } tree Dst = TREE_VALUE(arglist); unsigned DstAlign = getPointerAlignment(Dst); From isanbard at gmail.com Sat Mar 28 05:29:09 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 10:29:09 -0000 Subject: [llvm-commits] [llvm] r67942 - /llvm/branches/Apple/Dib/test/FrontendC/memset_chk.c Message-ID: <200903281029.n2SATAJp018248@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 05:29:09 2009 New Revision: 67942 URL: http://llvm.org/viewvc/llvm-project?rev=67942&view=rev Log: Add a __builtin___memset_chk test. Added: llvm/branches/Apple/Dib/test/FrontendC/memset_chk.c Added: llvm/branches/Apple/Dib/test/FrontendC/memset_chk.c URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/FrontendC/memset_chk.c?rev=67942&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/FrontendC/memset_chk.c (added) +++ llvm/branches/Apple/Dib/test/FrontendC/memset_chk.c Sat Mar 28 05:29:09 2009 @@ -0,0 +1,6 @@ +// RUN: %llvmgcc -S -emit-llvm -O1 %s -o - | grep call | not grep memset_chk +// rdar://6728562 + +void t(void *ptr) { + __builtin___memset_chk(ptr, 0, 32, __builtin_object_size (ptr, 0)); +} From baldrick at free.fr Sat Mar 28 05:50:08 2009 From: baldrick at free.fr (Duncan Sands) Date: Sat, 28 Mar 2009 11:50:08 +0100 Subject: [llvm-commits] [llvm] r67934 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/tailcall-i1.ll test/CodeGen/X86/tailcall-structret.ll In-Reply-To: <200903280833.n2S8XTYA010601@zion.cs.uiuc.edu> References: <200903280833.n2S8XTYA010601@zion.cs.uiuc.edu> Message-ID: <200903281150.08444.baldrick@free.fr> Hi Arnold, > + if(NumOps >= 5&& missing space before && > + Ret.getOperand(1).getOpcode()==ISD::MERGE_VALUES && missing spaces around == > + Ret.getOperand(1).getOperand(0) == SDValue(TheCall, 0)) > + return true; I've no idea whether the above logic is the right way (tm) to do this, but it looks rather fragile. > + if ((NumOps == 1 && > + (Ret.getOperand(0) == SDValue(TheCall,1) || > + Ret.getOperand(0) == SDValue(TheCall,0))) || > + (NumOps == 3 && > + Ret.getOperand(1).getOpcode() == ISD::ANY_EXTEND && > + Ret.getOperand(1).getNumOperands()>0 && > + Ret.getOperand(1).getOperand(0).getOpcode() == ISD::TRUNCATE && > + Ret.getOperand(1).getOperand(0).getNumOperands()>0 && > + Ret.getOperand(1).getOperand(0).getOperand(0) == SDValue(TheCall, 0)) || > + (NumOps > 1 && > + Ret.getOperand(0) == SDValue(TheCall, > + TheCall->getNumValues()-1) && > + Ret.getOperand(1) == SDValue(TheCall,0))) > + return true; > + return false; This also looks fragile. Perhaps you could make a more generic way of not worrying about harmless instructions. Ciao, Duncan. > +} > > Added: llvm/trunk/test/CodeGen/X86/tailcall-i1.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-i1.ll?rev=67934&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/tailcall-i1.ll (added) > +++ llvm/trunk/test/CodeGen/X86/tailcall-i1.ll Sat Mar 28 03:33:27 2009 > @@ -0,0 +1,6 @@ > +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL > +define fastcc i1 @i1test(i32, i32, i32, i32) { > + entry: > + %4 = tail call fastcc i1 @i1test( i32 %0, i32 %1, i32 %2, i32 %3) > + ret i1 %4 > +} > > Added: llvm/trunk/test/CodeGen/X86/tailcall-structret.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-structret.ll?rev=67934&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/tailcall-structret.ll (added) > +++ llvm/trunk/test/CodeGen/X86/tailcall-structret.ll Sat Mar 28 03:33:27 2009 > @@ -0,0 +1,6 @@ > +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL > +define fastcc { { i8*, i8* }*, i8*} @init({ { i8*, i8* }*, i8*}, i32) { > +entry: > + %2 = tail call fastcc { { i8*, i8* }*, i8* } @init({ { i8*, i8*}*, i8*} %0, i32 %1) > + ret { { i8*, i8* }*, i8*} %2 > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From baldrick at free.fr Sat Mar 28 05:55:08 2009 From: baldrick at free.fr (Duncan Sands) Date: Sat, 28 Mar 2009 11:55:08 +0100 Subject: [llvm-commits] [llvm] r67879 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h In-Reply-To: <200903272351.n2RNp3h6001260@zion.cs.uiuc.edu> References: <200903272351.n2RNp3h6001260@zion.cs.uiuc.edu> Message-ID: <200903281155.09133.baldrick@free.fr> Hi Dan, > Initialize LiveOutInfo's APInt members to zero, as APInt's > default constructor produces an uninitialized APInt. > This fixes PR3896. is this the correct fix? If LiveOutInfo was default constructed, doesn't this mean it doesn't contain anything useful. If so, why is it being examined? Also, will the code that uses it come to the right conclusions given this initialization? Ciao, Duncan. From arnold.schwaighofer at gmail.com Sat Mar 28 07:36:38 2009 From: arnold.schwaighofer at gmail.com (Arnold Schwaighofer) Date: Sat, 28 Mar 2009 12:36:38 -0000 Subject: [llvm-commits] [llvm] r67943 - in /llvm/trunk: lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/tailcall-void.ll Message-ID: <200903281236.n2SCafFU025575@zion.cs.uiuc.edu> Author: arnolds Date: Sat Mar 28 07:36:29 2009 New Revision: 67943 URL: http://llvm.org/viewvc/llvm-project?rev=67943&view=rev Log: Make check in CheckTailCallReturnConstraints for ignorable instructions between a CALL and a RET node more generic. Add a test for tail calls with a void return. Added: llvm/trunk/test/CodeGen/X86/tailcall-void.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=67943&r1=67942&r2=67943&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sat Mar 28 07:36:29 2009 @@ -2572,26 +2572,40 @@ } } -bool TargetLowering::CheckTailCallReturnConstraints(CallSDNode *TheCall, SDValue Ret) { +/// IgnoreHarmlessInstructions - Ignore instructions between a CALL and RET +/// node that don't prevent tail call optimization. +static SDValue IgnoreHarmlessInstructions(SDValue node) { + // Found call return. + if (node.getOpcode() == ISD::CALL) return node; + // Ignore MERGE_VALUES. Will have at least one operand. + if (node.getOpcode() == ISD::MERGE_VALUES) + return IgnoreHarmlessInstructions(node.getOperand(0)); + // Ignore ANY_EXTEND node. + if (node.getOpcode() == ISD::ANY_EXTEND) + return IgnoreHarmlessInstructions(node.getOperand(0)); + if (node.getOpcode() == ISD::TRUNCATE) + return IgnoreHarmlessInstructions(node.getOperand(0)); + // Any other node type. + return node; +} + +bool TargetLowering::CheckTailCallReturnConstraints(CallSDNode *TheCall, + SDValue Ret) { unsigned NumOps = Ret.getNumOperands(); - // Struct return. - if(NumOps >= 5&& - Ret.getOperand(1).getOpcode()==ISD::MERGE_VALUES && - Ret.getOperand(1).getOperand(0) == SDValue(TheCall, 0)) + // ISD::CALL results:(value0, ..., valuen, chain) + // ISD::RET operands:(chain, value0, flag0, ..., valuen, flagn) + // Value return: + // Check that operand of the RET node sources from the CALL node. The RET node + // has at least two operands. Operand 0 holds the chain. Operand 1 holds the + // value. + if (NumOps > 1 && + IgnoreHarmlessInstructions(Ret.getOperand(1)) == SDValue(TheCall,0)) return true; - if ((NumOps == 1 && - (Ret.getOperand(0) == SDValue(TheCall,1) || - Ret.getOperand(0) == SDValue(TheCall,0))) || - (NumOps == 3 && - Ret.getOperand(1).getOpcode() == ISD::ANY_EXTEND && - Ret.getOperand(1).getNumOperands()>0 && - Ret.getOperand(1).getOperand(0).getOpcode() == ISD::TRUNCATE && - Ret.getOperand(1).getOperand(0).getNumOperands()>0 && - Ret.getOperand(1).getOperand(0).getOperand(0) == SDValue(TheCall, 0)) || - (NumOps > 1 && - Ret.getOperand(0) == SDValue(TheCall, - TheCall->getNumValues()-1) && - Ret.getOperand(1) == SDValue(TheCall,0))) + // void return: The RET node has the chain result value of the CALL node as + // input. + if (NumOps == 1 && + Ret.getOperand(0) == SDValue(TheCall, TheCall->getNumValues()-1)) return true; + return false; } Added: llvm/trunk/test/CodeGen/X86/tailcall-void.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-void.ll?rev=67943&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/tailcall-void.ll (added) +++ llvm/trunk/test/CodeGen/X86/tailcall-void.ll Sat Mar 28 07:36:29 2009 @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL +define fastcc void @i1test(i32, i32, i32, i32) { + entry: + tail call fastcc void @i1test( i32 %0, i32 %1, i32 %2, i32 %3) + ret void +} From arnold.schwaighofer at gmail.com Sat Mar 28 07:37:56 2009 From: arnold.schwaighofer at gmail.com (Arnold Schwaighofer) Date: Sat, 28 Mar 2009 13:37:56 +0100 Subject: [llvm-commits] [llvm] r67934 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/tailcall-i1.ll test/CodeGen/X86/tailcall-structret.ll In-Reply-To: <200903281150.08444.baldrick@free.fr> References: <200903280833.n2S8XTYA010601@zion.cs.uiuc.edu> <200903281150.08444.baldrick@free.fr> Message-ID: Hi Duncan, thanks for the comments. I made the check more generic see revision 67943. regards arnold On Sat, Mar 28, 2009 at 11:50 AM, Duncan Sands wrote: > > Hi Arnold, > >> + ?if(NumOps >= 5&& > > missing space before && > >> + ? ? ?Ret.getOperand(1).getOpcode()==ISD::MERGE_VALUES && > > missing spaces around == > >> + ? ? ?Ret.getOperand(1).getOperand(0) == SDValue(TheCall, 0)) >> + ? ?return true; > > I've no idea whether the above logic is the right way (tm) to do this, > but it looks rather fragile. > >> + ?if ((NumOps == 1 && >> + ? ? ? ?(Ret.getOperand(0) == SDValue(TheCall,1) || >> + ? ? ? ? Ret.getOperand(0) == SDValue(TheCall,0))) || >> + ? ? ?(NumOps == 3 && >> + ? ? ? Ret.getOperand(1).getOpcode() == ISD::ANY_EXTEND && >> + ? ? ? Ret.getOperand(1).getNumOperands()>0 && >> + ? ? ? Ret.getOperand(1).getOperand(0).getOpcode() == ISD::TRUNCATE && >> + ? ? ? Ret.getOperand(1).getOperand(0).getNumOperands()>0 && >> + ? ? ? Ret.getOperand(1).getOperand(0).getOperand(0) == SDValue(TheCall, 0)) || >> + ? ? ?(NumOps > 1 && >> + ? ? ? Ret.getOperand(0) == SDValue(TheCall, >> + ? ? ? ? TheCall->getNumValues()-1) && >> + ? ? ? Ret.getOperand(1) == SDValue(TheCall,0))) >> + ? ?return true; >> + ?return false; > > This also looks fragile. ?Perhaps you could make a more generic > way of not worrying about harmless instructions. > > Ciao, > > Duncan. > >> +} >> >> Added: llvm/trunk/test/CodeGen/X86/tailcall-i1.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-i1.ll?rev=67934&view=auto >> >> ============================================================================== >> --- llvm/trunk/test/CodeGen/X86/tailcall-i1.ll (added) >> +++ llvm/trunk/test/CodeGen/X86/tailcall-i1.ll Sat Mar 28 03:33:27 2009 >> @@ -0,0 +1,6 @@ >> +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL >> +define fastcc i1 @i1test(i32, i32, i32, i32) { >> + ?entry: >> + ?%4 = tail call fastcc i1 @i1test( i32 %0, i32 %1, i32 %2, i32 %3) >> + ?ret i1 %4 >> +} >> >> Added: llvm/trunk/test/CodeGen/X86/tailcall-structret.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcall-structret.ll?rev=67934&view=auto >> >> ============================================================================== >> --- llvm/trunk/test/CodeGen/X86/tailcall-structret.ll (added) >> +++ llvm/trunk/test/CodeGen/X86/tailcall-structret.ll Sat Mar 28 03:33:27 2009 >> @@ -0,0 +1,6 @@ >> +; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL >> +define fastcc { { i8*, i8* }*, i8*} @init({ { i8*, i8* }*, i8*}, i32) { >> +entry: >> + ? ? ?%2 = tail call fastcc { { i8*, i8* }*, i8* } @init({ { i8*, i8*}*, i8*} %0, i32 %1) >> + ? ? ?ret { { i8*, i8* }*, i8*} %2 >> +} >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > From baldrick at free.fr Sat Mar 28 07:43:35 2009 From: baldrick at free.fr (Duncan Sands) Date: Sat, 28 Mar 2009 13:43:35 +0100 Subject: [llvm-commits] [llvm] r67943 - in /llvm/trunk: lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/tailcall-void.ll In-Reply-To: <200903281236.n2SCafFU025575@zion.cs.uiuc.edu> References: <200903281236.n2SCafFU025575@zion.cs.uiuc.edu> Message-ID: <200903281343.35747.baldrick@free.fr> Hi Arnold, thanks for doing this. > + // Ignore MERGE_VALUES. Will have at least one operand. > + if (node.getOpcode() == ISD::MERGE_VALUES) > + return IgnoreHarmlessInstructions(node.getOperand(0)); The order of operands in a MERGE_VALUES node has no significance: permuting them does not change the meaning of the node. Thus only checking the first operand has to be wrong, even if it works in practice... Ciao, Duncan. From baldrick at free.fr Sat Mar 28 08:05:19 2009 From: baldrick at free.fr (Duncan Sands) Date: Sat, 28 Mar 2009 14:05:19 +0100 Subject: [llvm-commits] [llvm] r67943 - in /llvm/trunk: lib/CodeGen/SelectionDAG/TargetLowering.cpp test/CodeGen/X86/tailcall-void.ll In-Reply-To: <200903281343.35747.baldrick@free.fr> References: <200903281236.n2SCafFU025575@zion.cs.uiuc.edu> <200903281343.35747.baldrick@free.fr> Message-ID: <200903281405.20356.baldrick@free.fr> On Saturday 28 March 2009 13:43:35 Duncan Sands wrote: > Hi Arnold, thanks for doing this. > > > + // Ignore MERGE_VALUES. Will have at least one operand. > > + if (node.getOpcode() == ISD::MERGE_VALUES) > > + return IgnoreHarmlessInstructions(node.getOperand(0)); > > The order of operands in a MERGE_VALUES node has no significance: > permuting them does not change the meaning of the node. Thus only > checking the first operand has to be wrong, even if it works in > practice... Sorry, I was confusing MERGE_VALUES with TokenFactor, please ignore me! Ciao, Duncan. From rafael.espindola at gmail.com Sat Mar 28 12:03:32 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 28 Mar 2009 17:03:32 -0000 Subject: [llvm-commits] [llvm] r67945 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86FloatingPoint.cpp X86InstrInfo.cpp Message-ID: <200903281703.n2SH3Y4a009580@zion.cs.uiuc.edu> Author: rafael Date: Sat Mar 28 12:03:24 2009 New Revision: 67945 URL: http://llvm.org/viewvc/llvm-project?rev=67945&view=rev Log: Make code a bit less brittle by no hardcoding the number of operands in an address in so many places. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=67945&r1=67944&r2=67945&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sat Mar 28 12:03:24 2009 @@ -32,6 +32,9 @@ #include "llvm/Target/TargetOptions.h" using namespace llvm; +// FIXME: This should be some header +static const int X86AddrNumOperands = 4; + STATISTIC(NumEmitted, "Number of machine instructions emitted"); namespace { @@ -642,8 +645,10 @@ } case X86II::MRMDestMem: { MCE.emitByte(BaseOpcode); - emitMemModRMByte(MI, CurOp, getX86RegNum(MI.getOperand(CurOp+4).getReg())); - CurOp += 5; + emitMemModRMByte(MI, CurOp, + getX86RegNum(MI.getOperand(CurOp + X86AddrNumOperands) + .getReg())); + CurOp += X86AddrNumOperands + 1; if (CurOp != NumOps) emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc)); break; @@ -659,12 +664,13 @@ break; case X86II::MRMSrcMem: { - intptr_t PCAdj = (CurOp+5 != NumOps) ? X86InstrInfo::sizeOfImm(Desc) : 0; + intptr_t PCAdj = (CurOp + X86AddrNumOperands + 1 != NumOps) ? + X86InstrInfo::sizeOfImm(Desc) : 0; MCE.emitByte(BaseOpcode); emitMemModRMByte(MI, CurOp+1, getX86RegNum(MI.getOperand(CurOp).getReg()), PCAdj); - CurOp += 5; + CurOp += X86AddrNumOperands + 1; if (CurOp != NumOps) emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc)); break; @@ -714,13 +720,13 @@ case X86II::MRM2m: case X86II::MRM3m: case X86II::MRM4m: case X86II::MRM5m: case X86II::MRM6m: case X86II::MRM7m: { - intptr_t PCAdj = (CurOp+4 != NumOps) ? + intptr_t PCAdj = (CurOp + X86AddrNumOperands != NumOps) ? (MI.getOperand(CurOp+4).isImm() ? X86InstrInfo::sizeOfImm(Desc) : 4) : 0; MCE.emitByte(BaseOpcode); emitMemModRMByte(MI, CurOp, (Desc->TSFlags & X86II::FormMask)-X86II::MRM0m, PCAdj); - CurOp += 4; + CurOp += X86AddrNumOperands; if (CurOp != NumOps) { const MachineOperand &MO = MI.getOperand(CurOp++); Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=67945&r1=67944&r2=67945&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Sat Mar 28 12:03:24 2009 @@ -616,9 +616,10 @@ /// handleOneArgFP - fst , ST(0) /// void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) { + const int X86AddrNumOperands = 4; MachineInstr *MI = I; unsigned NumOps = MI->getDesc().getNumOperands(); - assert((NumOps == 5 || NumOps == 1) && + assert((NumOps == X86AddrNumOperands + 1 || NumOps == 1) && "Can only handle fst* & ftst instructions!"); // Is this the last use of the source register? Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=67945&r1=67944&r2=67945&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sat Mar 28 12:03:24 2009 @@ -763,7 +763,7 @@ MI->getOperand(2).getReg() == 0 && MI->getOperand(3).getImm() == 0) { FrameIndex = MI->getOperand(0).getIndex(); - return MI->getOperand(4).getReg(); + return MI->getOperand(X86AddrNumOperands).getReg(); } break; } From rafael.espindola at gmail.com Sat Mar 28 13:55:32 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 28 Mar 2009 18:55:32 -0000 Subject: [llvm-commits] [llvm] r67949 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86FloatingPoint.cpp X86ISelLowering.cpp X86InstrInfo.cpp X86InstrInfo.h Message-ID: <200903281855.n2SItWpT016634@zion.cs.uiuc.edu> Author: rafael Date: Sat Mar 28 13:55:31 2009 New Revision: 67949 URL: http://llvm.org/viewvc/llvm-project?rev=67949&view=rev Log: Have only one definition of X86AddrNumOperands. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=67949&r1=67948&r2=67949&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sat Mar 28 13:55:31 2009 @@ -32,9 +32,6 @@ #include "llvm/Target/TargetOptions.h" using namespace llvm; -// FIXME: This should be some header -static const int X86AddrNumOperands = 4; - STATISTIC(NumEmitted, "Number of machine instructions emitted"); namespace { Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=67949&r1=67948&r2=67949&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Sat Mar 28 13:55:31 2009 @@ -616,7 +616,6 @@ /// handleOneArgFP - fst , ST(0) /// void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) { - const int X86AddrNumOperands = 4; MachineInstr *MI = I; unsigned NumOps = MI->getDesc().getNumOperands(); assert((NumOps == X86AddrNumOperands + 1 || NumOps == 1) && Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=67949&r1=67948&r2=67949&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Mar 28 13:55:31 2009 @@ -41,8 +41,6 @@ #include "llvm/Support/CommandLine.h" using namespace llvm; -const int X86AddrNumOperands = 4; - static cl::opt DisableMMX("disable-mmx", cl::Hidden, cl::desc("Disable use of MMX")); Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=67949&r1=67948&r2=67949&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sat Mar 28 13:55:31 2009 @@ -31,9 +31,6 @@ using namespace llvm; -// FIXME: This should be some header -static const int X86AddrNumOperands = 4; - namespace { cl::opt NoFusing("disable-spill-fusing", Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=67949&r1=67948&r2=67949&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Sat Mar 28 13:55:31 2009 @@ -243,6 +243,8 @@ }; } +const int X86AddrNumOperands = 4; + inline static bool isScale(const MachineOperand &MO) { return MO.isImm() && (MO.getImm() == 1 || MO.getImm() == 2 || From rafael.espindola at gmail.com Sat Mar 28 14:02:18 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 28 Mar 2009 19:02:18 -0000 Subject: [llvm-commits] [llvm] r67950 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200903281902.n2SJ2IfH017102@zion.cs.uiuc.edu> Author: rafael Date: Sat Mar 28 14:02:18 2009 New Revision: 67950 URL: http://llvm.org/viewvc/llvm-project?rev=67950&view=rev Log: Use array_lengthof Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=67950&r1=67949&r2=67950&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Sat Mar 28 14:02:18 2009 @@ -1214,7 +1214,7 @@ const SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, In2L, In2H, LSI, Chain }; return CurDAG->getTargetNode(Opc, Node->getDebugLoc(), MVT::i32, MVT::i32, MVT::Other, Ops, - sizeof(Ops)/sizeof(SDValue)); + array_lengthof(Ops)); } SDNode *X86DAGToDAGISel::Select(SDValue N) { @@ -1309,7 +1309,7 @@ SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag }; SDNode *CNode = CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, - sizeof(Ops)/sizeof(SDValue)); + array_lengthof(Ops)); InFlag = SDValue(CNode, 1); // Update the chain. ReplaceUses(N1.getValue(1), SDValue(CNode, 0)); @@ -1429,7 +1429,7 @@ Move = SDValue(CurDAG->getTargetNode(X86::MOVZX16rm8, dl, MVT::i16, MVT::Other, Ops, - sizeof(Ops)/sizeof(SDValue)), 0); + array_lengthof(Ops)), 0); Chain = Move.getValue(1); ReplaceUses(N0.getValue(1), Chain); } else { @@ -1460,7 +1460,7 @@ SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, N1.getOperand(0), InFlag }; SDNode *CNode = CurDAG->getTargetNode(MOpc, dl, MVT::Other, MVT::Flag, Ops, - sizeof(Ops)/sizeof(SDValue)); + array_lengthof(Ops)); InFlag = SDValue(CNode, 1); // Update the chain. ReplaceUses(N1.getValue(1), SDValue(CNode, 0)); @@ -1604,7 +1604,7 @@ SDValue Ops[] = { Tmp1, Tmp2, Chain }; return CurDAG->getTargetNode(TargetInstrInfo::DECLARE, dl, MVT::Other, Ops, - sizeof(Ops)/sizeof(SDValue)); + array_lengthof(Ops)); } } From clattner at apple.com Sat Mar 28 14:12:25 2009 From: clattner at apple.com (Chris Lattner) Date: Sat, 28 Mar 2009 12:12:25 -0700 Subject: [llvm-commits] [llvm] r67849 - /llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll In-Reply-To: References: <200903271617.n2RGHboQ032209@zion.cs.uiuc.edu> Message-ID: <9E5354E0-33DF-4FF0-B386-423FC427F844@apple.com> On Mar 28, 2009, at 3:07 AM, Bill Wendling wrote: >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll (original) >> +++ llvm/trunk/test/CodeGen/PowerPC/int-fp-conv-0.ll Fri Mar 27 >> 11:17:22 2009 >> @@ -1,4 +1,4 @@ >> -; RUN: llvm-as < %s | llc -march=ppc64 -debug |& not grep store >> +; RUN: llvm-as < %s | llc -march=ppc64 -debug |& not grep {= store} > > I thought that "store" instructions were never assigned to a > variable... Bill is right, this will never match. -Chris From sabre at nondot.org Sat Mar 28 14:26:55 2009 From: sabre at nondot.org (Chris Lattner) Date: Sat, 28 Mar 2009 19:26:55 -0000 Subject: [llvm-commits] [llvm] r67953 - /llvm/trunk/lib/Target/README.txt Message-ID: <200903281926.n2SJQtCq018680@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 14:26:55 2009 New Revision: 67953 URL: http://llvm.org/viewvc/llvm-project?rev=67953&view=rev Log: add a note Modified: llvm/trunk/lib/Target/README.txt Modified: llvm/trunk/lib/Target/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=67953&r1=67952&r2=67953&view=diff ============================================================================== --- llvm/trunk/lib/Target/README.txt (original) +++ llvm/trunk/lib/Target/README.txt Sat Mar 28 14:26:55 2009 @@ -1721,3 +1721,7 @@ //===---------------------------------------------------------------------===// +The arg promotion pass should make use of nocapture to make its alias analysis +stuff much more precise. + +//===---------------------------------------------------------------------===// From espindola at google.com Sat Mar 28 15:21:27 2009 From: espindola at google.com (Rafael Espindola) Date: Sat, 28 Mar 2009 21:21:27 +0100 Subject: [llvm-commits] [llvm] r66922 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/tls13.ll test/CodeGen/X86/tls14.ll In-Reply-To: References: <200903131837.n2DIb7PC008719@zion.cs.uiuc.edu> Message-ID: <38a0d8450903281321n5853d007vf3d7447cab6eb2b8@mail.gmail.com> > Instead of making it TLS specific, I'd just make that operand "specify > the segment". ?Even though we do nothing with FS or ES or DS etc, it > would be nice to be able to have a clean model where the instructions > think about these machine level things, and isel lowering handles the > translation of "TLS to GS" I have started to work on it, but there lots of places in the code that assume that addresses are made of 4 components. I did a bit of code factoring, but the real problem is that there no C++ class that corresponds to an address. The real solution I can think is to make an instruction like movl %gs:0, %eax have 2 operands. The first one is the address, the second one is the register. The address is then a C++ object with the needed fields. Is there a reason for the current design? Efficiency maybe? Anyway. My work in progress patch is attached. It fails only the TLS tests, as expected :-) Will do a tiny bit more factoring and then actually set the segment correctly. Comments? > -Chris Cheers, -- Rafael Avila de Espindola Google | Gordon House | Barrow Street | Dublin 4 | Ireland Registered in Dublin, Ireland | Registration Number: 368047 -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-wip.patch Type: application/octet-stream Size: 23575 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090328/0cf3c30b/attachment.obj From kremenek at apple.com Sat Mar 28 16:01:47 2009 From: kremenek at apple.com (Ted Kremenek) Date: Sat, 28 Mar 2009 21:01:47 -0000 Subject: [llvm-commits] [llvm] r67955 - /llvm/tags/checker/checker-0.181/ Message-ID: <200903282101.n2SL1lXb024622@zion.cs.uiuc.edu> Author: kremenek Date: Sat Mar 28 16:01:47 2009 New Revision: 67955 URL: http://llvm.org/viewvc/llvm-project?rev=67955&view=rev Log: Tagging checker-0.181. Added: llvm/tags/checker/checker-0.181/ - copied from r67954, llvm/trunk/ From isanbard at gmail.com Sat Mar 28 16:13:14 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 21:13:14 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67957 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Message-ID: <200903282113.n2SLDE2J025309@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 16:13:14 2009 New Revision: 67957 URL: http://llvm.org/viewvc/llvm-project?rev=67957&view=rev Log: --- Merging (from foreign repository) r67884 into '.': U gcc/llvm-debug.cpp Enable debug info at -O. I've fixed a lot of bugs where -g affects optimization recently; there are currently no such cases in the llvm testsuite or a substantial amount of other code on Darwin, which seems sufficient to turn it on. Woot. I make no claims about the quality of the generated debug info. Any cases where you see -g affecting optimization can now usefully be reported as bugs. TEST=ipodbgopt should test this in the llvm testsuite. Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp?rev=67957&r1=67956&r2=67957&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Sat Mar 28 16:13:14 2009 @@ -307,13 +307,9 @@ } /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of -/// source line - "llvm.dbg.stoppoint." +/// source line - "llvm.dbg.stoppoint." Now enabled with -O. void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { - // Do not emit line number info, for now. - if (optimize) - return; - // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && PrevBB == CurBB && From isanbard at gmail.com Sat Mar 28 16:15:57 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 21:15:57 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67958 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200903282115.n2SLFviK025463@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 16:15:56 2009 New Revision: 67958 URL: http://llvm.org/viewvc/llvm-project?rev=67958&view=rev Log: Re-enable r67884. There was a flaw in my buildbots that Dale pointed out to me. --- Merging (from foreign repository) r67884 into '.': U gcc/llvm-debug.cpp Enable debug info at -O. I've fixed a lot of bugs where -g affects optimization recently; there are currently no such cases in the llvm testsuite or a substantial amount of other code on Darwin, which seems sufficient to turn it on. Woot. I make no claims about the quality of the generated debug info. Any cases where you see -g affecting optimization can now usefully be reported as bugs. TEST=ipodbgopt should test this in the llvm testsuite. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67958&r1=67957&r2=67958&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Sat Mar 28 16:15:56 2009 @@ -307,13 +307,9 @@ } /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of -/// source line - "llvm.dbg.stoppoint." +/// source line - "llvm.dbg.stoppoint." Now enabled with -O. void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { - // Do not emit line number info, for now. - if (optimize) - return; - // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && PrevBB == CurBB && From isanbard at gmail.com Sat Mar 28 16:16:25 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 14:16:25 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r67888 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp In-Reply-To: <200903280109.n2S19Zix006543@zion.cs.uiuc.edu> References: <200903280109.n2S19Zix006543@zion.cs.uiuc.edu> Message-ID: I recommitted this. Dale pointed out a flaw in my build bot scripts. -bw On Mar 27, 2009, at 6:09 PM, Dale Johannesen wrote: > Author: johannes > Date: Fri Mar 27 20:09:34 2009 > New Revision: 67888 > > URL: http://llvm.org/viewvc/llvm-project?rev=67888&view=rev > Log: > Revert previous patch while I check out bootstrap > breakage. Funny, worked last night. > > > Modified: > llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67888&r1=67887&r2=67888&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Mar 27 20:09:34 2009 > @@ -307,9 +307,13 @@ > } > > /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a > change of > -/// source line - "llvm.dbg.stoppoint." Now enabled with -O. > +/// source line - "llvm.dbg.stoppoint." > void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { > > + // Do not emit line number info, for now. > + if (optimize) > + return; > + > // Don't bother if things are the same as last time. > if (PrevLineNo == CurLineNo && > PrevBB == CurBB && > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Sat Mar 28 16:38:25 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 21:38:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67959 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <200903282138.n2SLcP8l026828@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 16:38:23 2009 New Revision: 67959 URL: http://llvm.org/viewvc/llvm-project?rev=67959&view=rev Log: --- Reverse-merging (from foreign repository) r67884 into '.': U gcc/llvm-debug.cpp Doh! I jumped too soon. Apologies. :-( Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=67959&r1=67958&r2=67959&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Sat Mar 28 16:38:23 2009 @@ -307,9 +307,13 @@ } /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of -/// source line - "llvm.dbg.stoppoint." Now enabled with -O. +/// source line - "llvm.dbg.stoppoint." void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { + // Do not emit line number info, for now. + if (optimize) + return; + // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && PrevBB == CurBB && From isanbard at gmail.com Sat Mar 28 16:40:00 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 21:40:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r67960 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Message-ID: <200903282140.n2SLe0Zj026934@zion.cs.uiuc.edu> Author: void Date: Sat Mar 28 16:40:00 2009 New Revision: 67960 URL: http://llvm.org/viewvc/llvm-project?rev=67960&view=rev Log: --- Reverse-merging (from foreign repository) r67884 into '.': U gcc/llvm-debug.cpp Not yet ready. m(._.)m (gomen) Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp?rev=67960&r1=67959&r2=67960&view=diff ============================================================================== --- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Sat Mar 28 16:40:00 2009 @@ -307,9 +307,13 @@ } /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of -/// source line - "llvm.dbg.stoppoint." Now enabled with -O. +/// source line - "llvm.dbg.stoppoint." void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) { + // Do not emit line number info, for now. + if (optimize) + return; + // Don't bother if things are the same as last time. if (PrevLineNo == CurLineNo && PrevBB == CurBB && From dalej at apple.com Sat Mar 28 16:47:00 2009 From: dalej at apple.com (Dale Johannesen) Date: Sat, 28 Mar 2009 14:47:00 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r67959 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp In-Reply-To: <200903282138.n2SLcP8l026828@zion.cs.uiuc.edu> References: <200903282138.n2SLcP8l026828@zion.cs.uiuc.edu> Message-ID: <8372DE6A-0D76-45FE-A4C2-6A62E778A29E@apple.com> On Mar 28, 2009, at 2:38 PM, Bill Wendling wrote: > Author: void > Date: Sat Mar 28 16:38:23 2009 > New Revision: 67959 > > URL: http://llvm.org/viewvc/llvm-project?rev=67959&view=rev > Log: > --- Reverse-merging (from foreign repository) r67884 into '.': > U gcc/llvm-debug.cpp > > Doh! I jumped too soon. Apologies. :-( Yep. And the list of miscompares is different from what it was before, and both are different from what I get. More nondeterminististic behavior for sure:( From sabre at nondot.org Sat Mar 28 19:18:43 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 00:18:43 -0000 Subject: [llvm-commits] [llvm] r67970 - /llvm/trunk/include/llvm/ADT/PointerIntPair.h Message-ID: <200903290018.n2T0IhhA003773@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 19:18:42 2009 New Revision: 67970 URL: http://llvm.org/viewvc/llvm-project?rev=67970&view=rev Log: teach SmallPtrSet that PointerIntPair is "basically a pointer". Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67970&r1=67969&r2=67970&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sat Mar 28 19:18:42 2009 @@ -21,6 +21,8 @@ template struct DenseMapInfo; +template +class PointerLikeTypeInfo; /// PointerIntPair - This class implements a pair of a pointer and small /// integer. It is designed to represent this in the space required by one @@ -62,6 +64,10 @@ void *getOpaqueValue() const { return reinterpret_cast(Value); } void setFromOpaqueValue(void *Val) { Value = reinterpret_cast(Val);} + static PointerIntPair getFromOpaqueValue(void *V) { + PointerIntPair P; P.setFromOpaqueValue(V); return P; + } + bool operator==(const PointerIntPair &RHS) const {return Value == RHS.Value;} bool operator!=(const PointerIntPair &RHS) const {return Value != RHS.Value;} bool operator<(const PointerIntPair &RHS) const {return Value < RHS.Value;} @@ -89,5 +95,19 @@ static bool isPod() { return true; } }; +// Teach SmallPtrSet that PointerIntPair is "basically a pointer". +template +class PointerLikeTypeInfo > { +public: + static inline void * + getAsVoidPointer(const PointerIntPair &P) { + return P.getOpaqueValue(); + } + static inline PointerIntPair + getFromVoidPointer(void *P) { + return PointerIntPair::getFromOpaqueValue(P); + } +}; + } // end namespace llvm #endif From sabre at nondot.org Sat Mar 28 19:24:04 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 00:24:04 -0000 Subject: [llvm-commits] [llvm] r67971 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200903290024.n2T0O4Cw004104@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 19:24:04 2009 New Revision: 67971 URL: http://llvm.org/viewvc/llvm-project?rev=67971&view=rev Log: now that you can put a PointerIntPair in a SmallPtrSet, remove some hackish workarounds from memdep Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=67971&r1=67970&r2=67971&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Sat Mar 28 19:24:04 2009 @@ -171,9 +171,8 @@ CachedNonLocalPointerInfo NonLocalPointerDeps; // A map from instructions to their non-local pointer dependencies. - // The elements of the SmallPtrSet are ValueIsLoadPair's. typedef DenseMap > ReverseNonLocalPtrDepTy; + SmallPtrSet > ReverseNonLocalPtrDepTy; ReverseNonLocalPtrDepTy ReverseNonLocalPtrDeps; Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=67971&r1=67970&r2=67971&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Sat Mar 28 19:24:04 2009 @@ -86,9 +86,9 @@ /// 'Inst's set in ReverseMap. If the set becomes empty, remove Inst's entry. template static void RemoveFromReverseMap(DenseMap > &ReverseMap, - Instruction *Inst, KeyTy *Val) { - typename DenseMap >::iterator + SmallPtrSet > &ReverseMap, + Instruction *Inst, KeyTy Val) { + typename DenseMap >::iterator InstIt = ReverseMap.find(Inst); assert(InstIt != ReverseMap.end() && "Reverse map out of sync?"); bool Found = InstIt->second.erase(Val); @@ -560,8 +560,7 @@ // Eliminating the dirty entry from 'Cache', so update the reverse info. ValueIsLoadPair CacheKey(Pointer, isLoad); - RemoveFromReverseMap(ReverseNonLocalPtrDeps, ScanPos, - CacheKey.getOpaqueValue()); + RemoveFromReverseMap(ReverseNonLocalPtrDeps, ScanPos, CacheKey); } else { ++NumUncacheNonLocalPtr; } @@ -588,7 +587,7 @@ Instruction *Inst = Dep.getInst(); assert(Inst && "Didn't depend on anything?"); ValueIsLoadPair CacheKey(Pointer, isLoad); - ReverseNonLocalPtrDeps[Inst].insert(CacheKey.getOpaqueValue()); + ReverseNonLocalPtrDeps[Inst].insert(CacheKey); return Dep; } @@ -827,7 +826,7 @@ assert(I->second.isNonLocal() && "Should only be here with transparent block"); I->second = MemDepResult::getClobber(BB->begin()); - ReverseNonLocalPtrDeps[BB->begin()].insert(CacheKey.getOpaqueValue()); + ReverseNonLocalPtrDeps[BB->begin()].insert(CacheKey); Result.push_back(*I); break; } @@ -883,7 +882,7 @@ assert(Target->getParent() == PInfo[i].first); // Eliminating the dirty entry from 'Cache', so update the reverse info. - RemoveFromReverseMap(ReverseNonLocalPtrDeps, Target, P.getOpaqueValue()); + RemoveFromReverseMap(ReverseNonLocalPtrDeps, Target, P); } // Remove P from NonLocalPointerDeps (which deletes NonLocalDepInfo). @@ -1030,13 +1029,12 @@ ReverseNonLocalPtrDepTy::iterator ReversePtrDepIt = ReverseNonLocalPtrDeps.find(RemInst); if (ReversePtrDepIt != ReverseNonLocalPtrDeps.end()) { - SmallPtrSet &Set = ReversePtrDepIt->second; + SmallPtrSet &Set = ReversePtrDepIt->second; SmallVector,8> ReversePtrDepsToAdd; - for (SmallPtrSet::iterator I = Set.begin(), E = Set.end(); - I != E; ++I) { - ValueIsLoadPair P; - P.setFromOpaqueValue(*I); + for (SmallPtrSet::iterator I = Set.begin(), + E = Set.end(); I != E; ++I) { + ValueIsLoadPair P = *I; assert(P.getPointer() != RemInst && "Already removed NonLocalPointerDeps info for RemInst"); @@ -1066,7 +1064,7 @@ while (!ReversePtrDepsToAdd.empty()) { ReverseNonLocalPtrDeps[ReversePtrDepsToAdd.back().first] - .insert(ReversePtrDepsToAdd.back().second.getOpaqueValue()); + .insert(ReversePtrDepsToAdd.back().second); ReversePtrDepsToAdd.pop_back(); } } @@ -1126,10 +1124,10 @@ E = ReverseNonLocalPtrDeps.end(); I != E; ++I) { assert(I->first != D && "Inst occurs in rev NLPD map"); - for (SmallPtrSet::const_iterator II = I->second.begin(), + for (SmallPtrSet::const_iterator II = I->second.begin(), E = I->second.end(); II != E; ++II) - assert(*II != ValueIsLoadPair(D, false).getOpaqueValue() && - *II != ValueIsLoadPair(D, true).getOpaqueValue() && + assert(*II != ValueIsLoadPair(D, false) && + *II != ValueIsLoadPair(D, true) && "Inst occurs in ReverseNonLocalPtrDeps map"); } From sabre at nondot.org Sat Mar 28 19:39:30 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 00:39:30 -0000 Subject: [llvm-commits] [llvm] r67973 - in /llvm/trunk/include/llvm: ADT/PointerIntPair.h ADT/SmallPtrSet.h Support/PointerLikeTypeTraits.h Message-ID: <200903290039.n2T0dU1m005023@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 19:39:30 2009 New Revision: 67973 URL: http://llvm.org/viewvc/llvm-project?rev=67973&view=rev Log: rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for # low bits free, and move to its own header. Added: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h llvm/trunk/include/llvm/ADT/SmallPtrSet.h Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67973&r1=67972&r2=67973&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sat Mar 28 19:39:30 2009 @@ -22,7 +22,7 @@ template struct DenseMapInfo; template -class PointerLikeTypeInfo; +class PointerLikeTypeTraits; /// PointerIntPair - This class implements a pair of a pointer and small /// integer. It is designed to represent this in the space required by one @@ -97,7 +97,7 @@ // Teach SmallPtrSet that PointerIntPair is "basically a pointer". template -class PointerLikeTypeInfo > { +class PointerLikeTypeTraits > { public: static inline void * getAsVoidPointer(const PointerIntPair &P) { @@ -107,6 +107,7 @@ getFromVoidPointer(void *P) { return PointerIntPair::getFromOpaqueValue(P); } + static inline unsigned getNumLowBitsAvailable() { return 0; } }; } // end namespace llvm Modified: llvm/trunk/include/llvm/ADT/SmallPtrSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallPtrSet.h?rev=67973&r1=67972&r2=67973&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallPtrSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h Sat Mar 28 19:39:30 2009 @@ -18,33 +18,9 @@ #include #include #include "llvm/Support/DataTypes.h" +#include "llvm/Support/PointerLikeTypeTraits.h" namespace llvm { - -/// PointerLikeTypeInfo - This is a traits object that is used to handle pointer -/// types and things that are just wrappers for pointers as a uniform entity. -template -class PointerLikeTypeInfo { - //getAsVoidPointer/getFromVoidPointer -}; - -// Provide PointerLikeTypeInfo for all pointers. -template -class PointerLikeTypeInfo { -public: - static inline void *getAsVoidPointer(T* P) { return P; } - static inline T *getFromVoidPointer(void *P) { - return static_cast(P); - } -}; -template -class PointerLikeTypeInfo { -public: - static inline const void *getAsVoidPointer(const T* P) { return P; } - static inline const T *getFromVoidPointer(const void *P) { - return static_cast(P); - } -}; class SmallPtrSetIteratorImpl; @@ -193,7 +169,7 @@ /// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet. template class SmallPtrSetIterator : public SmallPtrSetIteratorImpl { - typedef PointerLikeTypeInfo PtrTraits; + typedef PointerLikeTypeTraits PtrTraits; public: explicit SmallPtrSetIterator(const void *const *BP) : SmallPtrSetIteratorImpl(BP) {} @@ -250,7 +226,7 @@ // Make sure that SmallSize is a power of two, round up if not. enum { SmallSizePowTwo = NextPowerOfTwo::Val }; void *SmallArray[SmallSizePowTwo]; - typedef PointerLikeTypeInfo PtrTraits; + typedef PointerLikeTypeTraits PtrTraits; public: SmallPtrSet() : SmallPtrSetImpl(NextPowerOfTwo::Val) {} SmallPtrSet(const SmallPtrSet &that) : SmallPtrSetImpl(that) {} Added: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h?rev=67973&view=auto ============================================================================== --- llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h (added) +++ llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Sat Mar 28 19:39:30 2009 @@ -0,0 +1,61 @@ +//===- llvm/Support/PointerLikeTypeTraits.h - Pointer Traits ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the PointerLikeTypeTraits class. This allows data +// structures to reason about pointers and other things that are pointer sized. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H +#define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H + +namespace llvm { + +/// PointerLikeTypeTraits - This is a traits object that is used to handle +/// pointer types and things that are just wrappers for pointers as a uniform +/// entity. +template +class PointerLikeTypeTraits { + // getAsVoidPointer + // getFromVoidPointer + // getNumLowBitsAvailable +}; + +// Provide PointerLikeTypeTraits for non-cvr pointers. +template +class PointerLikeTypeTraits { +public: + static inline void *getAsVoidPointer(T* P) { return P; } + static inline T *getFromVoidPointer(void *P) { + return static_cast(P); + } + + /// Note, we assume here that malloc returns objects at least 8-byte aligned. + /// However, this may be wrong, or pointers may be from something other than + /// malloc. In this case, you should specialize this template to reduce this. + /// + /// All clients should use assertions to do a run-time check to ensure that + /// this is actually true. + static inline unsigned getNumLowBitsAvailable() { return 3; } +}; + +// Provide PointerLikeTypeTraits for const pointers. +template +class PointerLikeTypeTraits { +public: + static inline const void *getAsVoidPointer(const T* P) { return P; } + static inline const T *getFromVoidPointer(const void *P) { + return static_cast(P); + } + static inline unsigned getNumLowBitsAvailable() { return 3; } +}; + +} // end namespace llvm + +#endif From dalej at apple.com Sat Mar 28 21:17:12 2009 From: dalej at apple.com (Dale Johannesen) Date: Sat, 28 Mar 2009 19:17:12 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r67959 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp In-Reply-To: <8372DE6A-0D76-45FE-A4C2-6A62E778A29E@apple.com> References: <200903282138.n2SLcP8l026828@zion.cs.uiuc.edu> <8372DE6A-0D76-45FE-A4C2-6A62E778A29E@apple.com> Message-ID: <3D005463-49CA-44CB-B82E-76ABF7B18DB6@apple.com> On Mar 28, 2009, at 2:47 PM, Dale Johannesen wrote: > > On Mar 28, 2009, at 2:38 PM, Bill Wendling wrote: > >> Author: void >> Date: Sat Mar 28 16:38:23 2009 >> New Revision: 67959 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=67959&view=rev >> Log: >> --- Reverse-merging (from foreign repository) r67884 into '.': >> U gcc/llvm-debug.cpp >> >> Doh! I jumped too soon. Apologies. :-( > > Yep. And the list of miscompares is different from what it was > before, and both are different from what I get. More > nondeterminististic behavior for sure:( The differences are in the debug_line section, not in code. We haven't been testing that so it's not too surprising, somewhat unfortunate that buildbot needs it working to pass....so far I haven't been able to reproduce it outside the build-gcc environment. From sabre at nondot.org Sat Mar 28 23:32:38 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 04:32:38 -0000 Subject: [llvm-commits] [llvm] r67979 - in /llvm/trunk/include/llvm: ADT/PointerIntPair.h Instruction.h Support/PointerLikeTypeTraits.h Use.h Message-ID: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> Author: lattner Date: Sat Mar 28 23:32:37 2009 New Revision: 67979 URL: http://llvm.org/viewvc/llvm-project?rev=67979&view=rev Log: Replace the PointerLikeTypeTraits::getNumLowBitsAvailable function with a new NumLowBitsAvailable enum, which makes the value available as an integer constant expression. Add PointerLikeTypeTraits specializations for Instruction* and Use** since they are only guaranteed 4-byte aligned. Enhance PointerIntPair to know about (and enforce) the alignment specified by PointerLikeTypeTraits. This should allow things like PointerIntPair, 1, bool> because the inner one knows that 2 low bits are free. Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h llvm/trunk/include/llvm/Instruction.h llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h llvm/trunk/include/llvm/Use.h Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67979&r1=67978&r2=67979&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sat Mar 28 23:32:37 2009 @@ -15,50 +15,77 @@ #define LLVM_ADT_POINTERINTPAIR_H #include "llvm/Support/DataTypes.h" +#include "llvm/Support/PointerLikeTypeTraits.h" #include namespace llvm { template struct DenseMapInfo; -template -class PointerLikeTypeTraits; /// PointerIntPair - This class implements a pair of a pointer and small /// integer. It is designed to represent this in the space required by one /// pointer by bitmangling the integer into the low part of the pointer. This /// can only be done for small integers: typically up to 3 bits, but it depends -/// on the alignment returned by the allocator in use. +/// on the number of bits available according to PointerLikeTypeTraits for the +/// type. +/// +/// Note that PointerIntPair always puts the Int part in the highest bits +/// possible. For example, PointerIntPair will put the bit for +/// the bool into bit #2, not bit #0, which allows the low two bits to be used +/// for something else. For example, this allows: +/// PointerIntPair, 1, bool> +/// ... and the two bools will land in different bits. /// template class PointerIntPair { intptr_t Value; + typedef PointerLikeTypeTraits PtrTraits; + enum { + /// PointerBitMask - The bits that come from the pointer. + PointerBitMask = ~(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1), + /// IntShift - The number of low bits that we reserve for other uses, and + /// keep zero. + IntShift = PtrTraits::NumLowBitsAvailable-IntBits, + + /// IntMask - This is the unshifted mask for valid bits of the int type. + IntMask = ((intptr_t)1 << IntBits)-1, + + // ShiftedIntMask - This is the bits for the integer shifted in place. + ShiftedIntMask = IntMask << IntShift + }; public: PointerIntPair() : Value(0) {} PointerIntPair(PointerTy Ptr, IntType Int) : Value(0) { + assert(IntBits <= PtrTraits::NumLowBitsAvailable && + "PointerIntPair formed with integer size too large for pointer"); setPointer(Ptr); setInt(Int); } PointerTy getPointer() const { - return reinterpret_cast(Value & ~((1 << IntBits)-1)); + return reinterpret_cast(Value & PointerBitMask); } IntType getInt() const { - return (IntType)(Value & ((1 << IntBits)-1)); + return (IntType)((Value >> IntShift) & IntMask); } void setPointer(PointerTy Ptr) { intptr_t PtrVal = reinterpret_cast(Ptr); - assert((PtrVal & ((1 << IntBits)-1)) == 0 && + assert((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 && "Pointer is not sufficiently aligned"); - Value = PtrVal | (intptr_t)getInt(); + // Preserve all low bits, just update the pointer. + Value = PtrVal | (Value & ~PointerBitMask); } void setInt(IntType Int) { intptr_t IntVal = Int; assert(IntVal < (1 << IntBits) && "Integer too large for field"); - Value = reinterpret_cast(getPointer()) | IntVal; + + // Preserve all bits other than the ones we are updating. + Value &= ~ShiftedIntMask; // Remove integer field. + Value |= IntVal << IntShift; // Set new integer. } void *getOpaqueValue() const { return reinterpret_cast(Value); } @@ -107,7 +134,10 @@ getFromVoidPointer(void *P) { return PointerIntPair::getFromOpaqueValue(P); } - static inline unsigned getNumLowBitsAvailable() { return 0; } + enum { + NumLowBitsAvailable = + PointerLikeTypeTraits::NumLowBitsAvailable - IntBits + }; }; } // end namespace llvm Modified: llvm/trunk/include/llvm/Instruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=67979&r1=67978&r2=67979&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.h (original) +++ llvm/trunk/include/llvm/Instruction.h Sat Mar 28 23:32:37 2009 @@ -227,6 +227,18 @@ }; }; +// Instruction* is only 4-byte aligned. +template<> +class PointerLikeTypeTraits { + typedef Instruction* PT; +public: + static inline void *getAsVoidPointer(PT P) { return P; } + static inline PT getFromVoidPointer(void *P) { + return static_cast(P); + } + enum { NumLowBitsAvailable = 2 }; +}; + } // End llvm namespace #endif Modified: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h?rev=67979&r1=67978&r2=67979&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h (original) +++ llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Sat Mar 28 23:32:37 2009 @@ -42,7 +42,7 @@ /// /// All clients should use assertions to do a run-time check to ensure that /// this is actually true. - static inline unsigned getNumLowBitsAvailable() { return 3; } + enum { NumLowBitsAvailable = 3 }; }; // Provide PointerLikeTypeTraits for const pointers. @@ -53,7 +53,7 @@ static inline const T *getFromVoidPointer(const void *P) { return static_cast(P); } - static inline unsigned getNumLowBitsAvailable() { return 3; } + enum { NumLowBitsAvailable = 3 }; }; } // end namespace llvm Modified: llvm/trunk/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Use.h?rev=67979&r1=67978&r2=67979&view=diff ============================================================================== --- llvm/trunk/include/llvm/Use.h (original) +++ llvm/trunk/include/llvm/Use.h Sat Mar 28 23:32:37 2009 @@ -24,11 +24,21 @@ class Value; class User; - +class Use; /// Tag - generic tag type for (at least 32 bit) pointers enum Tag { noTag, tagOne, tagTwo, tagThree }; +// Use** is only 4-byte aligned. +template<> +class PointerLikeTypeTraits { +public: + static inline void *getAsVoidPointer(Use** P) { return P; } + static inline Use **getFromVoidPointer(void *P) { + return static_cast(P); + } + enum { NumLowBitsAvailable = 2 }; +}; //===----------------------------------------------------------------------===// // Use Class @@ -212,7 +222,7 @@ template<> struct simplify_type > : public simplify_type > {}; - + } // End llvm namespace #endif From isanbard at gmail.com Sat Mar 28 23:57:16 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sat, 28 Mar 2009 21:57:16 -0700 Subject: [llvm-commits] [llvm] r67979 - in /llvm/trunk/include/llvm: ADT/PointerIntPair.h Instruction.h Support/PointerLikeTypeTraits.h Use.h In-Reply-To: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> References: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> Message-ID: Hi Chris, This is breaking the builds: http://blamebot.apple.com:8020/builders/full-llvm-OSX/builds/958/steps/shell/logs/stdio Could you investigate please? :-) -bw On Mar 28, 2009, at 9:32 PM, Chris Lattner wrote: > Author: lattner > Date: Sat Mar 28 23:32:37 2009 > New Revision: 67979 > > URL: http://llvm.org/viewvc/llvm-project?rev=67979&view=rev > Log: > Replace the PointerLikeTypeTraits::getNumLowBitsAvailable > function with a new NumLowBitsAvailable enum, which makes the > value available as an integer constant expression. > > Add PointerLikeTypeTraits specializations for Instruction* and > Use** since they are only guaranteed 4-byte aligned. > > Enhance PointerIntPair to know about (and enforce) the alignment > specified by PointerLikeTypeTraits. This should allow things > like PointerIntPair, 1, bool> > because the inner one knows that 2 low bits are free. > > > Modified: > llvm/trunk/include/llvm/ADT/PointerIntPair.h > llvm/trunk/include/llvm/Instruction.h > llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h > llvm/trunk/include/llvm/Use.h > > Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67979&r1=67978&r2=67979&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) > +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sat Mar 28 23:32:37 > 2009 > @@ -15,50 +15,77 @@ > #define LLVM_ADT_POINTERINTPAIR_H > > #include "llvm/Support/DataTypes.h" > +#include "llvm/Support/PointerLikeTypeTraits.h" > #include > > namespace llvm { > > template > struct DenseMapInfo; > -template > -class PointerLikeTypeTraits; > > /// PointerIntPair - This class implements a pair of a pointer and > small > /// integer. It is designed to represent this in the space required > by one > /// pointer by bitmangling the integer into the low part of the > pointer. This > /// can only be done for small integers: typically up to 3 bits, but > it depends > -/// on the alignment returned by the allocator in use. > +/// on the number of bits available according to > PointerLikeTypeTraits for the > +/// type. > +/// > +/// Note that PointerIntPair always puts the Int part in the > highest bits > +/// possible. For example, PointerIntPair will put > the bit for > +/// the bool into bit #2, not bit #0, which allows the low two bits > to be used > +/// for something else. For example, this allows: > +/// PointerIntPair, 1, bool> > +/// ... and the two bools will land in different bits. > /// > template IntType=unsigned> > class PointerIntPair { > intptr_t Value; > + typedef PointerLikeTypeTraits PtrTraits; > + enum { > + /// PointerBitMask - The bits that come from the pointer. > + PointerBitMask = ~(((intptr_t)1 << > PtrTraits::NumLowBitsAvailable)-1), > + /// IntShift - The number of low bits that we reserve for other > uses, and > + /// keep zero. > + IntShift = PtrTraits::NumLowBitsAvailable-IntBits, > + > + /// IntMask - This is the unshifted mask for valid bits of the > int type. > + IntMask = ((intptr_t)1 << IntBits)-1, > + > + // ShiftedIntMask - This is the bits for the integer shifted in > place. > + ShiftedIntMask = IntMask << IntShift > + }; > public: > PointerIntPair() : Value(0) {} > PointerIntPair(PointerTy Ptr, IntType Int) : Value(0) { > + assert(IntBits <= PtrTraits::NumLowBitsAvailable && > + "PointerIntPair formed with integer size too large for > pointer"); > setPointer(Ptr); > setInt(Int); > } > > PointerTy getPointer() const { > - return reinterpret_cast(Value & ~((1 << IntBits)-1)); > + return reinterpret_cast(Value & PointerBitMask); > } > > IntType getInt() const { > - return (IntType)(Value & ((1 << IntBits)-1)); > + return (IntType)((Value >> IntShift) & IntMask); > } > > void setPointer(PointerTy Ptr) { > intptr_t PtrVal = reinterpret_cast(Ptr); > - assert((PtrVal & ((1 << IntBits)-1)) == 0 && > + assert((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == > 0 && > "Pointer is not sufficiently aligned"); > - Value = PtrVal | (intptr_t)getInt(); > + // Preserve all low bits, just update the pointer. > + Value = PtrVal | (Value & ~PointerBitMask); > } > > void setInt(IntType Int) { > intptr_t IntVal = Int; > assert(IntVal < (1 << IntBits) && "Integer too large for field"); > - Value = reinterpret_cast(getPointer()) | IntVal; > + > + // Preserve all bits other than the ones we are updating. > + Value &= ~ShiftedIntMask; // Remove integer field. > + Value |= IntVal << IntShift; // Set new integer. > } > > void *getOpaqueValue() const { return > reinterpret_cast(Value); } > @@ -107,7 +134,10 @@ > getFromVoidPointer(void *P) { > return PointerIntPair IntType>::getFromOpaqueValue(P); > } > - static inline unsigned getNumLowBitsAvailable() { return 0; } > + enum { > + NumLowBitsAvailable = > + PointerLikeTypeTraits::NumLowBitsAvailable - > IntBits > + }; > }; > > } // end namespace llvm > > Modified: llvm/trunk/include/llvm/Instruction.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=67979&r1=67978&r2=67979&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Instruction.h (original) > +++ llvm/trunk/include/llvm/Instruction.h Sat Mar 28 23:32:37 2009 > @@ -227,6 +227,18 @@ > }; > }; > > +// Instruction* is only 4-byte aligned. > +template<> > +class PointerLikeTypeTraits { > + typedef Instruction* PT; > +public: > + static inline void *getAsVoidPointer(PT P) { return P; } > + static inline PT getFromVoidPointer(void *P) { > + return static_cast(P); > + } > + enum { NumLowBitsAvailable = 2 }; > +}; > + > } // End llvm namespace > > #endif > > Modified: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h?rev=67979&r1=67978&r2=67979&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h (original) > +++ llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Sat Mar > 28 23:32:37 2009 > @@ -42,7 +42,7 @@ > /// > /// All clients should use assertions to do a run-time check to > ensure that > /// this is actually true. > - static inline unsigned getNumLowBitsAvailable() { return 3; } > + enum { NumLowBitsAvailable = 3 }; > }; > > // Provide PointerLikeTypeTraits for const pointers. > @@ -53,7 +53,7 @@ > static inline const T *getFromVoidPointer(const void *P) { > return static_cast(P); > } > - static inline unsigned getNumLowBitsAvailable() { return 3; } > + enum { NumLowBitsAvailable = 3 }; > }; > > } // end namespace llvm > > Modified: llvm/trunk/include/llvm/Use.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Use.h?rev=67979&r1=67978&r2=67979&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Use.h (original) > +++ llvm/trunk/include/llvm/Use.h Sat Mar 28 23:32:37 2009 > @@ -24,11 +24,21 @@ > > class Value; > class User; > - > +class Use; > > /// Tag - generic tag type for (at least 32 bit) pointers > enum Tag { noTag, tagOne, tagTwo, tagThree }; > > +// Use** is only 4-byte aligned. > +template<> > +class PointerLikeTypeTraits { > +public: > + static inline void *getAsVoidPointer(Use** P) { return P; } > + static inline Use **getFromVoidPointer(void *P) { > + return static_cast(P); > + } > + enum { NumLowBitsAvailable = 2 }; > +}; > > // > = > = > = > ----------------------------------------------------------------------= > ==// > // Use Class > @@ -212,7 +222,7 @@ > > template<> struct simplify_type > > : public simplify_type > {}; > - > + > } // End llvm namespace > > #endif > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Sun Mar 29 00:45:44 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 05:45:44 -0000 Subject: [llvm-commits] [llvm] r67984 - /llvm/trunk/include/llvm/Value.h Message-ID: <200903290545.n2T5jiHQ022220@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 00:45:43 2009 New Revision: 67984 URL: http://llvm.org/viewvc/llvm-project?rev=67984&view=rev Log: Value* only has 2 bits free as well. Modified: llvm/trunk/include/llvm/Value.h Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=67984&r1=67983&r2=67984&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Sun Mar 29 00:45:43 2009 @@ -303,6 +303,19 @@ return isa(Val) || isa(Val) || isa(Val); } + + +// Value* is only 4-byte aligned. +template<> +class PointerLikeTypeTraits { + typedef Value* PT; +public: + static inline void *getAsVoidPointer(PT P) { return P; } + static inline PT getFromVoidPointer(void *P) { + return static_cast(P); + } + enum { NumLowBitsAvailable = 2 }; +}; } // End llvm namespace From sabre at nondot.org Sun Mar 29 01:00:21 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 06:00:21 -0000 Subject: [llvm-commits] [llvm] r67985 - /llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Message-ID: <200903290600.n2T60LSe023053@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 01:00:21 2009 New Revision: 67985 URL: http://llvm.org/viewvc/llvm-project?rev=67985&view=rev Log: Add a PointerLikeTypeTraits specialization for uintptr_t Modified: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Modified: llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h?rev=67985&r1=67984&r2=67985&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h (original) +++ llvm/trunk/include/llvm/Support/PointerLikeTypeTraits.h Sun Mar 29 01:00:21 2009 @@ -15,6 +15,8 @@ #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H +#include "llvm/Support/DataTypes.h" + namespace llvm { /// PointerLikeTypeTraits - This is a traits object that is used to handle @@ -55,6 +57,20 @@ } enum { NumLowBitsAvailable = 3 }; }; + +// Provide PointerLikeTypeTraits for uintptr_t. +template<> +class PointerLikeTypeTraits { +public: + static inline void *getAsVoidPointer(uintptr_t P) { + return reinterpret_cast(P); + } + static inline uintptr_t getFromVoidPointer(void *P) { + return reinterpret_cast(P); + } + // No bits are available! + enum { NumLowBitsAvailable = 0 }; +}; } // end namespace llvm From sabre at nondot.org Sun Mar 29 01:02:20 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 06:02:20 -0000 Subject: [llvm-commits] [llvm] r67986 - /llvm/trunk/include/llvm/ADT/PointerIntPair.h Message-ID: <200903290602.n2T62KrP023167@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 01:02:20 2009 New Revision: 67986 URL: http://llvm.org/viewvc/llvm-project?rev=67986&view=rev Log: Allow a specific PointerIntPair instance to use a specific Pointer trait: some pointer instances have properties that not all of a type have. Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67986&r1=67985&r2=67986&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sun Mar 29 01:02:20 2009 @@ -14,7 +14,6 @@ #ifndef LLVM_ADT_POINTERINTPAIR_H #define LLVM_ADT_POINTERINTPAIR_H -#include "llvm/Support/DataTypes.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include @@ -37,10 +36,10 @@ /// PointerIntPair, 1, bool> /// ... and the two bools will land in different bits. /// -template +template > class PointerIntPair { intptr_t Value; - typedef PointerLikeTypeTraits PtrTraits; enum { /// PointerBitMask - The bits that come from the pointer. PointerBitMask = ~(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1), From sabre at nondot.org Sun Mar 29 01:06:02 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 06:06:02 -0000 Subject: [llvm-commits] [llvm] r67987 - /llvm/trunk/include/llvm/ADT/PointerUnion.h Message-ID: <200903290606.n2T662M1023373@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 01:06:02 2009 New Revision: 67987 URL: http://llvm.org/viewvc/llvm-project?rev=67987&view=rev Log: Add a simple type-safe bit-mangling pointer union class. This allows you to do things like: /// PointerUnion P; /// P = (int*)0; /// printf("%d %d", P.is(), P.is()); // prints "1 0" /// X = P.get(); // ok. /// Y = P.get(); // runtime assertion failure. /// Z = P.get(); // does not compile. /// P = (float*)0; /// Y = P.get(); // ok. /// X = P.get(); // runtime assertion failure. Added: llvm/trunk/include/llvm/ADT/PointerUnion.h Added: llvm/trunk/include/llvm/ADT/PointerUnion.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerUnion.h?rev=67987&view=auto ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerUnion.h (added) +++ llvm/trunk/include/llvm/ADT/PointerUnion.h Sun Mar 29 01:06:02 2009 @@ -0,0 +1,132 @@ +//===- llvm/ADT/PointerUnion.h - Discriminated Union of 2 Ptrs --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the PointerUnion class, which is a discriminated union of +// pointer types. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_POINTERUNION_H +#define LLVM_ADT_POINTERUNION_H + +#include "llvm/ADT/PointerIntPair.h" + +namespace llvm { + + /// getPointerUnionTypeNum - If the argument has type PT1* or PT2* return + /// false or true respectively. + template + static inline bool getPointerUnionTypeNum(PT1 *P) { return false; } + template + static inline bool getPointerUnionTypeNum(PT2 *P) { return true; } + // Enable, if we could use static_assert. + //template + //static inline bool getPointerUnionTypeNum(...) { abort() } + + + /// Provide PointerLikeTypeTraits for void* that is used by PointerUnion + /// for the two template arguments. + template + class PointerUnionUIntTraits { + public: + static inline void *getAsVoidPointer(void *P) { return P; } + static inline void *getFromVoidPointer(void *P) { return P; } + enum { + PT1BitsAv = PointerLikeTypeTraits::NumLowBitsAvailable, + PT2BitsAv = PointerLikeTypeTraits::NumLowBitsAvailable, + NumLowBitsAvailable = PT1BitsAv < PT2BitsAv ? PT1BitsAv : PT2BitsAv + }; + }; + + /// PointerUnion - This implements a discriminated union of two pointer types, + /// and keeps the discriminator bit-mangled into the low bits of the pointer. + /// This allows the implementation to be extremely efficient in space, but + /// permits a very natural and type-safe API. + /// + /// Common use patterns would be something like this: + /// PointerUnion P; + /// P = (int*)0; + /// printf("%d %d", P.is(), P.is()); // prints "1 0" + /// X = P.get(); // ok. + /// Y = P.get(); // runtime assertion failure. + /// Z = P.get(); // does not compile. + /// P = (float*)0; + /// Y = P.get(); // ok. + /// X = P.get(); // runtime assertion failure. + template + class PointerUnion { + public: + typedef PointerIntPair > ValTy; + private: + ValTy Val; + public: + PointerUnion() {} + + PointerUnion(PT1 V) { + Val.setPointer(V); + Val.setInt(0); + } + PointerUnion(PT2 V) { + Val.setPointer(V); + Val.setInt(1); + } + + template + int is() const { + return Val.getInt() == ::llvm::getPointerUnionTypeNum((T*)0); + } + template + T get() const { + assert(is() && "Invalid accessor called"); + return static_cast(Val.getPointer()); + } + + const PointerUnion &operator=(const PT1 &RHS) { + Val.setPointer(RHS); + Val.setInt(0); + return *this; + } + const PointerUnion &operator=(const PT2 &RHS) { + Val.setPointer(RHS); + Val.setInt(1); + return *this; + } + + void *getOpaqueValue() const { return Val.getOpaqueValue(); } + static PointerUnion getFromOpaqueValue(void *VP) { + PointerUnion V; + V.Val = ValTy::getFromOpaqueValue(VP); + return V; + } + }; + + // Teach SmallPtrSet that PointerIntPair is "basically a pointer", that has + // # low bits available = min(PT1bits,PT2bits)-1. + template + class PointerLikeTypeTraits > { + public: + static inline void * + getAsVoidPointer(const PointerUnion &P) { + return P.getOpaqueValue(); + } + static inline PointerUnion + getFromVoidPointer(void *P) { + return PointerUnion::getFromOpaqueValue(P); + } + + // The number of bits available are the min of the two pointer types. + enum { + NumLowBitsAvailable = + PointerUnion::ValTy::NumLowBitsAvailable + }; + }; +} + +#endif From clattner at apple.com Sun Mar 29 01:14:33 2009 From: clattner at apple.com (Chris Lattner) Date: Sat, 28 Mar 2009 23:14:33 -0700 Subject: [llvm-commits] [llvm] r67979 - in /llvm/trunk/include/llvm: ADT/PointerIntPair.h Instruction.h Support/PointerLikeTypeTraits.h Use.h In-Reply-To: References: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> Message-ID: <32A0704E-F617-4C47-94DD-89A8C5818394@apple.com> On Mar 28, 2009, at 9:57 PM, Bill Wendling wrote: > Hi Chris, > > This is breaking the builds: > > http://blamebot.apple.com:8020/builders/full-llvm-OSX/builds/958/steps/shell/logs/stdio > > Could you investigate please? :-) Yes absolutely. I didn't see this when I ran make check because apparently some .o files didn't rebuild. A clean rebuild shows it though. Will fix ASAP! -Chris From sabre at nondot.org Sun Mar 29 01:32:47 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 06:32:47 -0000 Subject: [llvm-commits] [llvm] r67989 - /llvm/trunk/include/llvm/ADT/PointerUnion.h Message-ID: <200903290632.n2T6Wlu7024939@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 01:32:46 2009 New Revision: 67989 URL: http://llvm.org/viewvc/llvm-project?rev=67989&view=rev Log: add helper method. Modified: llvm/trunk/include/llvm/ADT/PointerUnion.h Modified: llvm/trunk/include/llvm/ADT/PointerUnion.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerUnion.h?rev=67989&r1=67988&r2=67989&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerUnion.h (original) +++ llvm/trunk/include/llvm/ADT/PointerUnion.h Sun Mar 29 01:32:46 2009 @@ -78,6 +78,8 @@ Val.setInt(1); } + bool isNull() const { return Val.getPointer() == 0; } + template int is() const { return Val.getInt() == ::llvm::getPointerUnionTypeNum((T*)0); From sabre at nondot.org Sun Mar 29 01:33:23 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 06:33:23 -0000 Subject: [llvm-commits] [llvm] r67990 - in /llvm/trunk/include/llvm/ADT: DenseMap.h PointerIntPair.h Message-ID: <200903290633.n2T6XNG4024990@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 01:33:22 2009 New Revision: 67990 URL: http://llvm.org/viewvc/llvm-project?rev=67990&view=rev Log: When forming sentinels for empty/tombstone, make sure to respect the pointer's expected number of zero low-bits. This should fix the breakage I introduced recently. Modified: llvm/trunk/include/llvm/ADT/DenseMap.h llvm/trunk/include/llvm/ADT/PointerIntPair.h Modified: llvm/trunk/include/llvm/ADT/DenseMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=67990&r1=67989&r2=67990&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/DenseMap.h (original) +++ llvm/trunk/include/llvm/ADT/DenseMap.h Sun Mar 29 01:33:22 2009 @@ -14,7 +14,7 @@ #ifndef LLVM_ADT_DENSEMAP_H #define LLVM_ADT_DENSEMAP_H -#include "llvm/Support/DataTypes.h" +#include "llvm/Support/PointerLikeTypeTraits.h" #include "llvm/Support/MathExtras.h" #include #include @@ -33,8 +33,16 @@ // Provide DenseMapInfo for all pointers. template struct DenseMapInfo { - static inline T* getEmptyKey() { return reinterpret_cast(-1); } - static inline T* getTombstoneKey() { return reinterpret_cast(-2); } + static inline T* getEmptyKey() { + intptr_t Val = -1; + Val <<= PointerLikeTypeTraits::NumLowBitsAvailable; + return reinterpret_cast(Val); + } + static inline T* getTombstoneKey() { + intptr_t Val = -2; + Val <<= PointerLikeTypeTraits::NumLowBitsAvailable; + return reinterpret_cast(Val); + } static unsigned getHashValue(const T *PtrVal) { return (unsigned((uintptr_t)PtrVal) >> 4) ^ (unsigned((uintptr_t)PtrVal) >> 9); Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67990&r1=67989&r2=67990&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sun Mar 29 01:33:22 2009 @@ -107,11 +107,14 @@ struct DenseMapInfo > { typedef PointerIntPair Ty; static Ty getEmptyKey() { - return Ty(reinterpret_cast(-1 << IntBits), - IntType((1 << IntBits)-1)); + intptr_t Val = -1; + Val <<= PointerLikeTypeTraits::NumLowBitsAvailable; + return Ty(reinterpret_cast(Val), IntType((1 << IntBits)-1)); } static Ty getTombstoneKey() { - return Ty(reinterpret_cast(-2 << IntBits), IntType(0)); + intptr_t Val = -2; + Val <<= PointerLikeTypeTraits::NumLowBitsAvailable; + return Ty(reinterpret_cast(Val), IntType(0)); } static unsigned getHashValue(Ty V) { uintptr_t IV = reinterpret_cast(V.getOpaqueValue()); From sabre at nondot.org Sun Mar 29 01:46:29 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 01:46:29 -0500 Subject: [llvm-commits] CVS: llvm-www/Features.html Message-ID: <200903290646.n2T6kTxA025749@zion.cs.uiuc.edu> Changes in directory llvm-www: Features.html updated: 1.21 -> 1.22 --- Log message: update this slightly. --- Diffs of the changes: (+2 -1) Features.html | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-www/Features.html diff -u llvm-www/Features.html:1.21 llvm-www/Features.html:1.22 --- llvm-www/Features.html:1.21 Tue Sep 30 10:23:58 2008 +++ llvm-www/Features.html Sun Mar 29 01:45:28 2009 @@ -5,7 +5,8 @@ following:

      -
    • Front-ends for C and C++ based on the GCC 3.4 and 4.0.1 parsers. +
    • Front-ends for C, C++, Objective-C, Fortran, etc based on the GCC 4.2 + parsers. They support the ANSI-standard C and C++ languages to the same degree that GCC supports them. Additionally, many GCC extensions are supported. From sabre at nondot.org Sun Mar 29 02:03:31 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 07:03:31 -0000 Subject: [llvm-commits] [llvm] r67992 - /llvm/trunk/include/llvm/ADT/PointerUnion.h Message-ID: <200903290703.n2T73VS7026797@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 02:03:30 2009 New Revision: 67992 URL: http://llvm.org/viewvc/llvm-project?rev=67992&view=rev Log: add some comments, add a dyn_cast method. Modified: llvm/trunk/include/llvm/ADT/PointerUnion.h Modified: llvm/trunk/include/llvm/ADT/PointerUnion.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerUnion.h?rev=67992&r1=67991&r2=67992&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerUnion.h (original) +++ llvm/trunk/include/llvm/ADT/PointerUnion.h Sun Mar 29 02:03:30 2009 @@ -78,18 +78,34 @@ Val.setInt(1); } + /// isNull - Return true if the pointer help in the union is null, + /// regardless of which type it is. bool isNull() const { return Val.getPointer() == 0; } + /// is() return true if the Union currently holds the type matching T. template int is() const { return Val.getInt() == ::llvm::getPointerUnionTypeNum((T*)0); } + + /// get() - Return the value of the specified pointer type. If the + /// specified pointer type is incorrect, assert. template T get() const { assert(is() && "Invalid accessor called"); return static_cast(Val.getPointer()); } + /// dyn_cast() - If the current value is of the specified pointer type, + /// return it, otherwise return null. + template + T dyn_cast() const { + if (is()) return static_cast(Val.getPointer()); + return T(); + } + + /// Assignment operators - Allow assigning into this union from either + /// pointer type, setting the discriminator to remember what it came from. const PointerUnion &operator=(const PT1 &RHS) { Val.setPointer(RHS); Val.setInt(0); From clattner at apple.com Sun Mar 29 02:15:28 2009 From: clattner at apple.com (Chris Lattner) Date: Sun, 29 Mar 2009 00:15:28 -0700 Subject: [llvm-commits] [llvm] r66922 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/tls13.ll test/CodeGen/X86/tls14.ll In-Reply-To: <38a0d8450903281321n5853d007vf3d7447cab6eb2b8@mail.gmail.com> References: <200903131837.n2DIb7PC008719@zion.cs.uiuc.edu> <38a0d8450903281321n5853d007vf3d7447cab6eb2b8@mail.gmail.com> Message-ID: <76D5C23E-6C42-479A-A71B-0B7C96B0AACB@apple.com> On Mar 28, 2009, at 1:21 PM, Rafael Espindola wrote: >> Instead of making it TLS specific, I'd just make that operand >> "specify >> the segment". Even though we do nothing with FS or ES or DS etc, it >> would be nice to be able to have a clean model where the instructions >> think about these machine level things, and isel lowering handles the >> translation of "TLS to GS" > > I have started to work on it, but there lots of places in the code > that > assume that addresses are made of 4 components. I did a bit > of code factoring, but the real problem is that there no C++ > class that corresponds to an address. Yes! Your code factoring has looked great FWIW. This issue (memory operands being a random target-specific number of machine operands is also really annoying for InlineAsm nodes, which have to use a machine operand flag before each "logical operand" that notes how many machine operands there are for them. This is really gross. Another annoying detail is that we have no good way to know that some unit is a "memory reference" at the machineinstr level (we can reference the group of 4 as one operand at the dag level though!). For this reason, we can't attach MEMOPERAND information to the specific operand, we have to attach it at a random place in the operand list. This is annoying. > The real solution I can think is to make an instruction like > > movl %gs:0, %eax > > have 2 operands. The first one is the address, the > second one is the register. The address is then a C++ > object with the needed fields. > > Is there a reason for the current design? Efficiency maybe? I'd really like to get here, but I also really like having a flat list of operands. I haven't figured out a way to do this without making a machine operand that is a pointer to a separately allocated "memory operand thing". Having them be separately allocated like this is bad for a couple of reasons 1) memory use/allocation cost, 2) traversals of "all operands" is a tree walk, not a linear scan. 3) locality of the walk is much less, because it isn't linear walk anymore. I'd really like to fix this somehow though. Do you have any ideas? -Chris From isanbard at gmail.com Sun Mar 29 02:28:47 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 29 Mar 2009 00:28:47 -0700 Subject: [llvm-commits] [llvm] r67979 - in /llvm/trunk/include/llvm: ADT/PointerIntPair.h Instruction.h Support/PointerLikeTypeTraits.h Use.h In-Reply-To: <32A0704E-F617-4C47-94DD-89A8C5818394@apple.com> References: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> <32A0704E-F617-4C47-94DD-89A8C5818394@apple.com> Message-ID: On Mar 28, 2009, at 11:14 PM, Chris Lattner wrote: > On Mar 28, 2009, at 9:57 PM, Bill Wendling wrote: > >> Hi Chris, >> >> This is breaking the builds: >> >> http://blamebot.apple.com:8020/builders/full-llvm-OSX/builds/958/steps/shell/logs/stdio >> >> Could you investigate please? :-) > > Yes absolutely. I didn't see this when I ran make check because > apparently some .o files didn't rebuild. A clean rebuild shows it > though. > > Will fix ASAP! > Thanks! :-) -bw From baldrick at free.fr Sun Mar 29 03:40:13 2009 From: baldrick at free.fr (Duncan Sands) Date: Sun, 29 Mar 2009 09:40:13 +0100 Subject: [llvm-commits] [llvm] r67979 - in /llvm/trunk/include/llvm: ADT/PointerIntPair.h Instruction.h Support/PointerLikeTypeTraits.h Use.h In-Reply-To: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> References: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> Message-ID: <200903291040.13929.baldrick@free.fr> Hi Chris, > ... PointerIntPair, 1, bool> you are missing a space before the first "bool" (occurs twice). Very important this whitespace stuff! :) Ciao, Duncan. From sabre at nondot.org Sun Mar 29 08:26:23 2009 From: sabre at nondot.org (Chris Lattner) Date: Sun, 29 Mar 2009 13:26:23 -0000 Subject: [llvm-commits] [llvm] r67995 - /llvm/trunk/include/llvm/ADT/PointerIntPair.h Message-ID: <200903291326.n2TDQPRF017833@zion.cs.uiuc.edu> Author: lattner Date: Sun Mar 29 08:26:05 2009 New Revision: 67995 URL: http://llvm.org/viewvc/llvm-project?rev=67995&view=rev Log: add missing space. Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67995&r1=67994&r2=67995&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original) +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sun Mar 29 08:26:05 2009 @@ -30,10 +30,10 @@ /// type. /// /// Note that PointerIntPair always puts the Int part in the highest bits -/// possible. For example, PointerIntPair will put the bit for +/// possible. For example, PointerIntPair will put the bit for /// the bool into bit #2, not bit #0, which allows the low two bits to be used /// for something else. For example, this allows: -/// PointerIntPair, 1, bool> +/// PointerIntPair, 1, bool> /// ... and the two bools will land in different bits. /// template References: <200903290432.n2T4WcMX018022@zion.cs.uiuc.edu> <200903291040.13929.baldrick@free.fr> Message-ID: <7CC0A235-FF69-4B81-9088-49D2AB7833CD@nondot.org> On Mar 29, 2009, at 1:40 AM, Duncan Sands wrote: > Hi Chris, > >> ... PointerIntPair, 1, bool> > > you are missing a space before the first "bool" (occurs twice). > Very important this whitespace stuff! :) Thanks, fixed. Next time, please include some bit of context (like the +++ file marker) so I know what header it is in. -Chris From baldrick at free.fr Sun Mar 29 08:51:10 2009 From: baldrick at free.fr (Duncan Sands) Date: Sun, 29 Mar 2009 13:51:10 -0000 Subject: [llvm-commits] [llvm] r67996 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll Message-ID: <200903291351.n2TDpC0A019019@zion.cs.uiuc.edu> Author: baldrick Date: Sun Mar 29 08:51:06 2009 New Revision: 67996 URL: http://llvm.org/viewvc/llvm-project?rev=67996&view=rev Log: Fix PR3899: add support for extracting floats from vectors when using -soft-float. Based on a patch by Jakob Stoklund Olesen. Added: llvm/trunk/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=67996&r1=67995&r2=67996&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Sun Mar 29 08:51:06 2009 @@ -59,6 +59,8 @@ case ISD::ConstantFP: R = SoftenFloatRes_ConstantFP(cast(N)); break; + case ISD::EXTRACT_VECTOR_ELT: + R = SoftenFloatRes_EXTRACT_VECTOR_ELT(N); break; case ISD::FABS: R = SoftenFloatRes_FABS(N); break; case ISD::FADD: R = SoftenFloatRes_FADD(N); break; case ISD::FCEIL: R = SoftenFloatRes_FCEIL(N); break; @@ -113,6 +115,13 @@ TLI.getTypeToTransformTo(N->getValueType(0))); } +SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *N) { + SDValue NewOp = BitConvertVectorToIntegerVector(N->getOperand(0)); + return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, N->getDebugLoc(), + NewOp.getValueType().getVectorElementType(), + NewOp, N->getOperand(1)); +} + SDValue DAGTypeLegalizer::SoftenFloatRes_FABS(SDNode *N) { MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); unsigned Size = NVT.getSizeInBits(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=67996&r1=67995&r2=67996&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Sun Mar 29 08:51:06 2009 @@ -858,6 +858,17 @@ MVT::getIntegerVT(BitWidth), Op); } +/// BitConvertVectorToIntegerVector - Convert to a vector of integers of the +/// same size. +SDValue DAGTypeLegalizer::BitConvertVectorToIntegerVector(SDValue Op) { + assert(Op.getValueType().isVector() && "Only applies to vectors!"); + unsigned EltWidth = Op.getValueType().getVectorElementType().getSizeInBits(); + MVT EltNVT = MVT::getIntegerVT(EltWidth); + unsigned NumElts = Op.getValueType().getVectorNumElements(); + return DAG.getNode(ISD::BIT_CONVERT, Op.getDebugLoc(), + MVT::getVectorVT(EltNVT, NumElts), Op); +} + SDValue DAGTypeLegalizer::CreateStackStoreLoad(SDValue Op, MVT DestVT) { DebugLoc dl = Op.getDebugLoc(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=67996&r1=67995&r2=67996&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Sun Mar 29 08:51:06 2009 @@ -190,6 +190,7 @@ // Common routines. SDValue BitConvertToInteger(SDValue Op); + SDValue BitConvertVectorToIntegerVector(SDValue Op); SDValue CreateStackStoreLoad(SDValue Op, MVT DestVT); bool CustomLowerResults(SDNode *N, MVT VT, bool LegalizeResult); SDValue GetVectorElementPointer(SDValue VecPtr, MVT EltVT, SDValue Index); @@ -392,6 +393,7 @@ SDValue SoftenFloatRes_BIT_CONVERT(SDNode *N); SDValue SoftenFloatRes_BUILD_PAIR(SDNode *N); SDValue SoftenFloatRes_ConstantFP(ConstantFPSDNode *N); + SDValue SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *N); SDValue SoftenFloatRes_FABS(SDNode *N); SDValue SoftenFloatRes_FADD(SDNode *N); SDValue SoftenFloatRes_FCEIL(SDNode *N); Added: llvm/trunk/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll?rev=67996&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll (added) +++ llvm/trunk/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll Sun Mar 29 08:51:06 2009 @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | llc -soft-float +; PR3899 + + at m = external global <2 x double>; + +define double @vector_ex() nounwind { + %v = load <2 x double>* @m + %x = extractelement <2 x double> %v, i32 1 + ret double %x +} From asl at math.spbu.ru Sun Mar 29 12:13:21 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sun, 29 Mar 2009 17:13:21 -0000 Subject: [llvm-commits] [llvm] r68004 - in /llvm/trunk: include/llvm/Constant.h lib/VMCore/Constants.cpp Message-ID: <200903291713.n2THDLls031259@zion.cs.uiuc.edu> Author: asl Date: Sun Mar 29 12:13:18 2009 New Revision: 68004 URL: http://llvm.org/viewvc/llvm-project?rev=68004&view=rev Log: Extend the relocation tracker handler, so we can filter on different 'kinds' of relocations required. Modified: llvm/trunk/include/llvm/Constant.h llvm/trunk/lib/VMCore/Constants.cpp Modified: llvm/trunk/include/llvm/Constant.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constant.h?rev=68004&r1=68003&r2=68004&view=diff ============================================================================== --- llvm/trunk/include/llvm/Constant.h (original) +++ llvm/trunk/include/llvm/Constant.h Sun Mar 29 12:13:18 2009 @@ -19,6 +19,12 @@ namespace llvm { template class SmallVectorImpl; + namespace Reloc { + const unsigned Local = 1 << 0; ///< Local relocations are required + const unsigned Global = 1 << 1; ///< Global relocations are required + const unsigned LocalOrGlobal = Local | Global; + } + /// This is an important base class in LLVM. It provides the common facilities /// of all constant values in an LLVM program. A constant is a value that is /// immutable at runtime. Functions are constants because their address is @@ -62,9 +68,9 @@ /// true for things like constant expressions that could divide by zero. bool canTrap() const; - /// ContaintsRelocations - Return true if the constant value contains + /// ContainsRelocations - Return true if the constant value contains /// relocations which cannot be resolved at compile time. - bool ContainsRelocations() const; + bool ContainsRelocations(unsigned Kind = Reloc::LocalOrGlobal) const; // Specialize get/setOperand for Constants as their operands are always // constants as well. Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=68004&r1=68003&r2=68004&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Sun Mar 29 12:13:18 2009 @@ -90,14 +90,29 @@ } } -/// ContaintsRelocations - Return true if the constant value contains -/// relocations which cannot be resolved at compile time. -bool Constant::ContainsRelocations() const { - if (isa(this)) - return true; +/// ContainsRelocations - Return true if the constant value contains relocations +/// which cannot be resolved at compile time. Kind argument is used to filter +/// only 'interesting' sorts of relocations. +bool Constant::ContainsRelocations(unsigned Kind) const { + if (const GlobalValue* GV = dyn_cast(this)) { + bool isLocal = GV->hasLocalLinkage(); + if ((Kind & Reloc::Local) && isLocal) { + // Global has local linkage and 'local' kind of relocations are + // requested + return true; + } + + if ((Kind & Reloc::Global) && !isLocal) { + // Global has non-local linkage and 'global' kind of relocations are + // requested + return true; + } + } + for (unsigned i = 0, e = getNumOperands(); i != e; ++i) if (getOperand(i)->ContainsRelocations()) return true; + return false; } From asl at math.spbu.ru Sun Mar 29 12:13:52 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sun, 29 Mar 2009 17:13:52 -0000 Subject: [llvm-commits] [llvm] r68005 - in /llvm/trunk: include/llvm/Constant.h include/llvm/Target/TargetAsmInfo.h lib/Target/TargetAsmInfo.cpp Message-ID: <200903291713.n2THDrgY031296@zion.cs.uiuc.edu> Author: asl Date: Sun Mar 29 12:13:49 2009 New Revision: 68005 URL: http://llvm.org/viewvc/llvm-project?rev=68005&view=rev Log: Honour relocation behaviour stuff for ro objects Modified: llvm/trunk/include/llvm/Constant.h llvm/trunk/include/llvm/Target/TargetAsmInfo.h llvm/trunk/lib/Target/TargetAsmInfo.cpp Modified: llvm/trunk/include/llvm/Constant.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constant.h?rev=68005&r1=68004&r2=68005&view=diff ============================================================================== --- llvm/trunk/include/llvm/Constant.h (original) +++ llvm/trunk/include/llvm/Constant.h Sun Mar 29 12:13:49 2009 @@ -20,6 +20,7 @@ template class SmallVectorImpl; namespace Reloc { + const unsigned None = 0; const unsigned Local = 1 << 0; ///< Local relocations are required const unsigned Global = 1 << 1; ///< Global relocations are required const unsigned LocalOrGlobal = Local | Global; Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=68005&r1=68004&r2=68005&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Sun Mar 29 12:13:49 2009 @@ -577,6 +577,12 @@ virtual SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const; + /// RelocBehaviour - Describes how relocations should be treated when + /// selecting sections. Reloc::Global bit should be set if global + /// relocations should force object to be placed in read-write + /// sections. Reloc::Local bit should be set if local relocations should + /// force object to be placed in read-write sections. + virtual unsigned RelocBehaviour() const; /// SectionFlagsForGlobal - This hook allows the target to select proper /// section flags either for given global or for section. Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=68005&r1=68004&r2=68005&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Sun Mar 29 12:13:49 2009 @@ -19,6 +19,7 @@ #include "llvm/Module.h" #include "llvm/Type.h" #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/Dwarf.h" #include @@ -189,6 +190,12 @@ return false; } +unsigned TargetAsmInfo::RelocBehaviour() const { + // By default - all relocations in PIC mode would force symbol to be + // placed in r/w section. + return (TM.getRelocationModel() != Reloc::Static ? + Reloc::LocalOrGlobal : Reloc::None); +} SectionKind::Kind TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { @@ -208,9 +215,21 @@ // check its initializer to decide, which section to output it into. Also // note, there is no thread-local r/o section. Constant *C = GVar->getInitializer(); - if (C->ContainsRelocations()) - return SectionKind::ROData; - else { + if (C->ContainsRelocations(Reloc::LocalOrGlobal)) { + // Decide, whether it is still possible to put symbol into r/o section. + unsigned Reloc = RelocBehaviour(); + + // We already did a query for 'all' relocs, thus - early exits. + if (Reloc == Reloc::LocalOrGlobal) + return SectionKind::Data; + else if (Reloc == Reloc::None) + return SectionKind::ROData; + else { + // Ok, target wants something funny. Honour it. + return (C->ContainsRelocations(Reloc) ? + SectionKind::Data : SectionKind::ROData); + } + } else { // Check, if initializer is a null-terminated string if (isConstantString(C)) return SectionKind::RODataMergeStr; From asl at math.spbu.ru Sun Mar 29 12:14:14 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sun, 29 Mar 2009 17:14:14 -0000 Subject: [llvm-commits] [llvm] r68006 - in /llvm/trunk/lib/Target/Alpha: AlphaTargetAsmInfo.cpp AlphaTargetAsmInfo.h Message-ID: <200903291714.n2THEFi5031339@zion.cs.uiuc.edu> Author: asl Date: Sun Mar 29 12:14:14 2009 New Revision: 68006 URL: http://llvm.org/viewvc/llvm-project?rev=68006&view=rev Log: Alpha always requires global relocations to be r/w regardless of PIC. Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.h Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp?rev=68006&r1=68005&r2=68006&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp Sun Mar 29 12:14:14 2009 @@ -16,7 +16,7 @@ using namespace llvm; -AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) +AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) : TargetAsmInfo(TM) { AlignmentIsInBytes = false; PrivateGlobalPrefix = "$"; @@ -24,3 +24,8 @@ JumpTableDataSection = "\t.section .rodata\n"; WeakRefDirective = "\t.weak\t"; } + +unsigned AlphaTargetAsmInfo::RelocBehaviour() const { + return (TM.getRelocationModel() != Reloc::Static ? + Reloc::LocalOrGlobal : Reloc::Global); +} Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.h?rev=68006&r1=68005&r2=68006&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.h Sun Mar 29 12:14:14 2009 @@ -23,6 +23,8 @@ struct AlphaTargetAsmInfo : public TargetAsmInfo { explicit AlphaTargetAsmInfo(const AlphaTargetMachine &TM); + + virtual unsigned RelocBehaviour() const; }; } // namespace llvm From asl at math.spbu.ru Sun Mar 29 12:14:35 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sun, 29 Mar 2009 17:14:35 -0000 Subject: [llvm-commits] [llvm] r68007 - in /llvm/trunk/lib/Target/IA64: IA64TargetAsmInfo.cpp IA64TargetAsmInfo.h Message-ID: <200903291714.n2THEZT6031371@zion.cs.uiuc.edu> Author: asl Date: Sun Mar 29 12:14:35 2009 New Revision: 68007 URL: http://llvm.org/viewvc/llvm-project?rev=68007&view=rev Log: IA64 is as weird as Alpha wrt r/o relocs :) Modified: llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.cpp llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.h Modified: llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.cpp?rev=68007&r1=68006&r2=68007&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.cpp Sun Mar 29 12:14:35 2009 @@ -12,6 +12,8 @@ //===----------------------------------------------------------------------===// #include "IA64TargetAsmInfo.h" +#include "llvm/Constants.h" +#include "llvm/Target/TargetMachine.h" using namespace llvm; @@ -34,4 +36,9 @@ ConstantPoolSection = "\n\t.section .data, \"aw\", \"progbits\"\n"; } +unsigned IA64TargetAsmInfo::RelocBehaviour() const { + return (TM.getRelocationModel() != Reloc::Static ? + Reloc::LocalOrGlobal : Reloc::Global); +} + // FIXME: Support small data/bss/rodata sections someday. Modified: llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.h?rev=68007&r1=68006&r2=68007&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetAsmInfo.h Sun Mar 29 12:14:35 2009 @@ -24,6 +24,7 @@ struct IA64TargetAsmInfo : public ELFTargetAsmInfo { explicit IA64TargetAsmInfo(const TargetMachine &TM); + virtual unsigned RelocBehaviour() const; }; From asl at math.spbu.ru Sun Mar 29 12:14:57 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sun, 29 Mar 2009 17:14:57 -0000 Subject: [llvm-commits] [llvm] r68008 - /llvm/trunk/test/CodeGen/X86/rodata-relocs.ll Message-ID: <200903291714.n2THEvnU031425@zion.cs.uiuc.edu> Author: asl Date: Sun Mar 29 12:14:57 2009 New Revision: 68008 URL: http://llvm.org/viewvc/llvm-project?rev=68008&view=rev Log: Testcase for recent ro/relocs stuff Added: llvm/trunk/test/CodeGen/X86/rodata-relocs.ll Added: llvm/trunk/test/CodeGen/X86/rodata-relocs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/rodata-relocs.ll?rev=68008&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/rodata-relocs.ll (added) +++ llvm/trunk/test/CodeGen/X86/rodata-relocs.ll Sun Mar 29 12:14:57 2009 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -relocation-model=static | grep rodata | count 3 +; RUN: llvm-as < %s | llc -relocation-model=static | grep -F "rodata.cst" | count 2 +; RUN: llvm-as < %s | llc -relocation-model=pic | grep rodata | count 2 +; RUN: llvm-as < %s | llc -relocation-model=pic | grep -F ".data" | count 1 + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-unknown-linux-gnu" + at a = internal constant [2 x i32] [i32 1, i32 2] ; <[2 x i32]*> [#uses=1] + at a1 = constant [2 x i32] [i32 1, i32 2] ; <[2 x i32]*> [#uses=1] + at e = internal constant [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]], align 16 ; <[2 x [2 x i32]]*> [#uses=1] + at e1 = constant [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]], align 16 ; <[2 x [2 x i32]]*> [#uses=1] + at p = constant i8* bitcast ([2 x i32]* @a to i8*) ; [#uses=0] + at t = constant i8* bitcast ([2 x [2 x i32]]* @e to i8*) ; [#uses=0] + at p1 = constant i8* bitcast ([2 x i32]* @a1 to i8*) ; [#uses=0] + at t1 = constant i8* bitcast ([2 x [2 x i32]]* @e1 to i8*) ; [#uses=0] From nicholas at mxc.ca Sun Mar 29 13:52:26 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Sun, 29 Mar 2009 13:52:26 -0500 Subject: [llvm-commits] CVS: llvm-www/Users.html Message-ID: <200903291852.n2TIqQNG005263@zion.cs.uiuc.edu> Changes in directory llvm-www: Users.html updated: 1.49 -> 1.50 --- Log message: Add unladen-swallow to LLVM users list. --- Diffs of the changes: (+7 -1) Users.html | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm-www/Users.html diff -u llvm-www/Users.html:1.49 llvm-www/Users.html:1.50 --- llvm-www/Users.html:1.49 Thu Mar 26 11:45:50 2009 +++ llvm-www/Users.html Sun Mar 29 13:47:42 2009 @@ -420,6 +420,12 @@ D compiler with LLVM backend. + + + + Unladen Swallow + A faster implementation of Python. +
    @@ -434,6 +440,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
    LLVM Development List
    - Last modified: $Date: 2009/03/26 16:45:50 $ + Last modified: $Date: 2009/03/29 18:47:42 $ From isanbard at gmail.com Sun Mar 29 15:09:08 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 29 Mar 2009 20:09:08 -0000 Subject: [llvm-commits] [llvm] r68013 - /llvm/trunk/include/llvm/Support/CommandLine.h Message-ID: <200903292009.n2TK9AUh008682@zion.cs.uiuc.edu> Author: void Date: Sun Mar 29 15:08:56 2009 New Revision: 68013 URL: http://llvm.org/viewvc/llvm-project?rev=68013&view=rev Log: Constify check. This fixes PR3900. Modified: llvm/trunk/include/llvm/Support/CommandLine.h Modified: llvm/trunk/include/llvm/Support/CommandLine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=68013&r1=68012&r2=68013&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CommandLine.h (original) +++ llvm/trunk/include/llvm/Support/CommandLine.h Sun Mar 29 15:08:56 2009 @@ -744,7 +744,7 @@ class opt_storage { DataType *Location; // Where to store the object... - void check() { + void check() const { assert(Location != 0 && "cl::location(...) not specified for a command " "line option with external storage, " "or cl::init specified before cl::location()!!"); From espindola at google.com Sun Mar 29 15:22:13 2009 From: espindola at google.com (Rafael Espindola) Date: Sun, 29 Mar 2009 22:22:13 +0200 Subject: [llvm-commits] [llvm] r66922 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/tls13.ll test/CodeGen/X86/tls14.ll In-Reply-To: <76D5C23E-6C42-479A-A71B-0B7C96B0AACB@apple.com> References: <200903131837.n2DIb7PC008719@zion.cs.uiuc.edu> <38a0d8450903281321n5853d007vf3d7447cab6eb2b8@mail.gmail.com> <76D5C23E-6C42-479A-A71B-0B7C96B0AACB@apple.com> Message-ID: <38a0d8450903291322g22af1782j5d5331f89bd38ad6@mail.gmail.com> >> The real solution I can think is to make an instruction like >> >> movl ? ? ? %gs:0, %eax >> >> have 2 operands. The first one is the address, the >> second one is the register. The address is then a C++ >> object with the needed fields. >> >> Is there a reason for the current design? Efficiency maybe? > > I'd really like to get here, but I also really like having a flat list of > operands. ?I haven't figured out a way to do this without making a machine > operand that is a pointer to a separately allocated "memory operand thing". > ?Having them be separately allocated like this is bad for a couple of > reasons 1) memory use/allocation cost, 2) traversals of "all operands" is a > tree walk, not a linear scan. ?3) locality of the walk is much less, because > it isn't linear walk anymore. > > I'd really like to fix this somehow though. ?Do you have any ideas? There are some low hanging fruits: *) Having fewer places is the code that do things like ".addImm(foo).addReg(bar).add..." *) Having auxiliary functions like getDisplacement and getSegment that are given the first operand number and just return .getOperand(Num + K) If we represent a X86 address with a struct that has just 4 (or 5) pointers we could probably still use a liner representation for the instructions, but have higher lever access functions that just return a pointer to the middle of the instruction? For example the instruction "movl %gs:0, %eax" would still have 5 (or 6) operands, but could have a higher level method "getSomething" that would return the register or the memory position. The register is just a regular operand. The memory position has 4 or 5 operands. > -Chris > Cheers, -- Rafael Avila de Espindola Google | Gordon House | Barrow Street | Dublin 4 | Ireland Registered in Dublin, Ireland | Registration Number: 368047 From isanbard at gmail.com Sun Mar 29 15:26:16 2009 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 29 Mar 2009 20:26:16 -0000 Subject: [llvm-commits] [llvm] r68014 - in /llvm/branches/Apple/Dib: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll Message-ID: <200903292026.n2TKQG2i009223@zion.cs.uiuc.edu> Author: void Date: Sun Mar 29 15:26:14 2009 New Revision: 68014 URL: http://llvm.org/viewvc/llvm-project?rev=68014&view=rev Log: --- Merging (from foreign repository) r67996 into '.': A test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll U lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp U lib/CodeGen/SelectionDAG/LegalizeTypes.cpp U lib/CodeGen/SelectionDAG/LegalizeTypes.h Fix PR3899: add support for extracting floats from vectors when using -soft-float. Based on a patch by Jakob Stoklund Olesen. Added: llvm/branches/Apple/Dib/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=68014&r1=68013&r2=68014&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Sun Mar 29 15:26:14 2009 @@ -59,6 +59,8 @@ case ISD::ConstantFP: R = SoftenFloatRes_ConstantFP(cast(N)); break; + case ISD::EXTRACT_VECTOR_ELT: + R = SoftenFloatRes_EXTRACT_VECTOR_ELT(N); break; case ISD::FABS: R = SoftenFloatRes_FABS(N); break; case ISD::FADD: R = SoftenFloatRes_FADD(N); break; case ISD::FCEIL: R = SoftenFloatRes_FCEIL(N); break; @@ -113,6 +115,13 @@ TLI.getTypeToTransformTo(N->getValueType(0))); } +SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *N) { + SDValue NewOp = BitConvertVectorToIntegerVector(N->getOperand(0)); + return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, N->getDebugLoc(), + NewOp.getValueType().getVectorElementType(), + NewOp, N->getOperand(1)); +} + SDValue DAGTypeLegalizer::SoftenFloatRes_FABS(SDNode *N) { MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); unsigned Size = NVT.getSizeInBits(); Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=68014&r1=68013&r2=68014&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Sun Mar 29 15:26:14 2009 @@ -858,6 +858,17 @@ MVT::getIntegerVT(BitWidth), Op); } +/// BitConvertVectorToIntegerVector - Convert to a vector of integers of the +/// same size. +SDValue DAGTypeLegalizer::BitConvertVectorToIntegerVector(SDValue Op) { + assert(Op.getValueType().isVector() && "Only applies to vectors!"); + unsigned EltWidth = Op.getValueType().getVectorElementType().getSizeInBits(); + MVT EltNVT = MVT::getIntegerVT(EltWidth); + unsigned NumElts = Op.getValueType().getVectorNumElements(); + return DAG.getNode(ISD::BIT_CONVERT, Op.getDebugLoc(), + MVT::getVectorVT(EltNVT, NumElts), Op); +} + SDValue DAGTypeLegalizer::CreateStackStoreLoad(SDValue Op, MVT DestVT) { DebugLoc dl = Op.getDebugLoc(); Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=68014&r1=68013&r2=68014&view=diff ============================================================================== --- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/LegalizeTypes.h Sun Mar 29 15:26:14 2009 @@ -190,6 +190,7 @@ // Common routines. SDValue BitConvertToInteger(SDValue Op); + SDValue BitConvertVectorToIntegerVector(SDValue Op); SDValue CreateStackStoreLoad(SDValue Op, MVT DestVT); bool CustomLowerResults(SDNode *N, MVT VT, bool LegalizeResult); SDValue GetVectorElementPointer(SDValue VecPtr, MVT EltVT, SDValue Index); @@ -392,6 +393,7 @@ SDValue SoftenFloatRes_BIT_CONVERT(SDNode *N); SDValue SoftenFloatRes_BUILD_PAIR(SDNode *N); SDValue SoftenFloatRes_ConstantFP(ConstantFPSDNode *N); + SDValue SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *N); SDValue SoftenFloatRes_FABS(SDNode *N); SDValue SoftenFloatRes_FADD(SDNode *N); SDValue SoftenFloatRes_FCEIL(SDNode *N); Added: llvm/branches/Apple/Dib/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll?rev=68014&view=auto ============================================================================== --- llvm/branches/Apple/Dib/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll (added) +++ llvm/branches/Apple/Dib/test/CodeGen/Generic/2009-03-29-SoftFloatVectorExtract.ll Sun Mar 29 15:26:14 2009 @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | llc -soft-float +; PR3899 + + at m = external global <2 x double>; + +define double @vector_ex() nounwind { + %v = load <2 x double>* @m + %x = extractelement <2 x double> %v, i32 1 + ret double %x +} From brukman+llvm at gmail.com Sun Mar 29 15:41:38 2009 From: brukman+llvm at gmail.com (Misha Brukman) Date: Sun, 29 Mar 2009 20:41:38 -0000 Subject: [llvm-commits] [llvm] r68016 - /llvm/trunk/include/llvm/Instruction.h Message-ID: <200903292041.n2TKfc8g009882@zion.cs.uiuc.edu> Author: brukman Date: Sun Mar 29 15:41:38 2009 New Revision: 68016 URL: http://llvm.org/viewvc/llvm-project?rev=68016&view=rev Log: Updated the comment for isArithmeticShift() to match reality. Modified: llvm/trunk/include/llvm/Instruction.h Modified: llvm/trunk/include/llvm/Instruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=68016&r1=68015&r2=68016&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.h (original) +++ llvm/trunk/include/llvm/Instruction.h Sun Mar 29 15:41:38 2009 @@ -144,8 +144,7 @@ return getOpcode() == Shl || getOpcode() == LShr; } - /// isLogicalShift - Return true if this is a logical shift left or a logical - /// shift right. + /// isArithmeticShift - Return true if this is an arithmetic shift right. inline bool isArithmeticShift() const { return getOpcode() == AShr; } From ojomojo at gmail.com Sun Mar 29 23:37:53 2009 From: ojomojo at gmail.com (John Mosby) Date: Mon, 30 Mar 2009 04:37:53 -0000 Subject: [llvm-commits] [llvm] r68023 - /llvm/trunk/docs/TestingGuide.html Message-ID: <200903300437.n2U4bsT6002346@zion.cs.uiuc.edu> Author: jdm Date: Sun Mar 29 23:37:51 2009 New Revision: 68023 URL: http://llvm.org/viewvc/llvm-project?rev=68023&view=rev Log: Clarify section on setting up and running test-suite Modified: llvm/trunk/docs/TestingGuide.html Modified: llvm/trunk/docs/TestingGuide.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TestingGuide.html?rev=68023&r1=68022&r2=68023&view=diff ============================================================================== --- llvm/trunk/docs/TestingGuide.html (original) +++ llvm/trunk/docs/TestingGuide.html Sun Mar 29 23:37:51 2009 @@ -695,12 +695,14 @@

    First, all tests are executed within the LLVM object directory tree. They are not executed inside of the LLVM source tree. This is because the -test suite creates temporary files during execution.

    +test suite creates temporary files during execution. This means you must create +a build tree separate from the LLVM source tree in which to run the test suite.

    To run the test suite, you need to use the following steps:

      -
    1. cd into the llvm/projects directory
    2. +
    3. cd into the llvm/projects directory in your source tree. +
    4. Check out the test-suite module with:

      @@ -709,24 +711,35 @@ % svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite - -

      This will get the test suite into llvm/projects/llvm-test

      - -
    5. Configure the test suite using llvm configure. This will automatically - configure test-suite. You must do it from the top level otherwise llvm-gcc - will not be set which is required to run llvm-test:

      +

      This will get the test suite into llvm/projects/test-suite. +
      [The Makefiles expect the test suite directory to be named either + test-suite or llvm-test. To be safe, use + test-suite as in the above svn command line.]

      +
    6. +
    7. Configure llvm from the top level of each build tree (LLVM object directory tree) + in which you want to run the test suite, just like what you do before building LLVM.

      +

      When running configure, you must either: (1) have llvm-gcc + in your path, or (2) specify the directory where llvm-gcc is + installed using --with-llvmgccdir=$LLVM_GCC_DIR.

      +

      This step tells the configure machinery that the test suite + is now available so it can be configured for your build tree:

      -% cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure --with-llvmgccdir=$LLVM_GCC_DIR
      +% cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure [--with-llvmgccdir=$LLVM_GCC_DIR]
       
      -

      Note that that $LLVM_GCC_DIR is the directory where you - installed llvm-gcc, not its src or obj directory.

      +

      [Remember that $LLVM_GCC_DIR is the directory where you + installed llvm-gcc, not its src or obj directory.]

    8. -
    9. Change back to the llvm/projects/test-suite directory you created before - and run gmake (or just "make" on systems where GNU make is - the default, such as linux.

    10. +
    11. You can now run the test suite from your build tree as follows:

      +
      +
      +% cd $LLVM_OBJ_ROOT/projects/test-suite
      +% make
      +
      +
      +

    Note that the second and third steps only need to be done once. After you have the suite checked out and configured, you don't need to do it again (unless