From sabre at nondot.org Mon Jul 5 00:36:21 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 05 Jul 2010 05:36:21 -0000 Subject: [llvm-commits] [llvm] r107612 - in /llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAGBuilder.cpp TargetLowering.cpp Message-ID: <20100705053621.736DC2A6C12C@llvm.org> Author: lattner Date: Mon Jul 5 00:36:21 2010 New Revision: 107612 URL: http://llvm.org/viewvc/llvm-project?rev=107612&view=rev Log: random tidying Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107612&r1=107611&r2=107612&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Mon Jul 5 00:36:21 2010 @@ -4858,11 +4858,16 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) { + // Handle inline assembly differently. + if (isa(I.getCalledValue())) { + visitInlineAsm(&I); + return; + } + const char *RenameFn = 0; if (Function *F = I.getCalledFunction()) { if (F->isDeclaration()) { - const TargetIntrinsicInfo *II = TM.getIntrinsicInfo(); - if (II) { + if (const TargetIntrinsicInfo *II = TM.getIntrinsicInfo()) { if (unsigned IID = II->getIntrinsicID(F)) { RenameFn = visitIntrinsicCall(I, IID); if (!RenameFn) @@ -4935,11 +4940,8 @@ return; } } - } else if (isa(I.getCalledValue())) { - visitInlineAsm(&I); - return; } - + SDValue Callee; if (!RenameFn) Callee = getValue(I.getCalledValue()); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=107612&r1=107611&r2=107612&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jul 5 00:36:21 2010 @@ -609,9 +609,9 @@ static unsigned getVectorTypeBreakdownMVT(MVT VT, MVT &IntermediateVT, - unsigned &NumIntermediates, - EVT &RegisterVT, - TargetLowering* TLI) { + unsigned &NumIntermediates, + EVT &RegisterVT, + TargetLowering *TLI) { // Figure out the right, legal destination reg to copy into. unsigned NumElts = VT.getVectorNumElements(); MVT EltTy = VT.getVectorElementType(); @@ -736,39 +736,39 @@ for (unsigned i = MVT::FIRST_VECTOR_VALUETYPE; i <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++i) { MVT VT = (MVT::SimpleValueType)i; - if (!isTypeLegal(VT)) { - MVT IntermediateVT; - EVT RegisterVT; - unsigned NumIntermediates; - NumRegistersForVT[i] = - getVectorTypeBreakdownMVT(VT, IntermediateVT, NumIntermediates, - RegisterVT, this); - RegisterTypeForVT[i] = RegisterVT; - - // Determine if there is a legal wider type. - bool IsLegalWiderType = false; - EVT EltVT = VT.getVectorElementType(); - unsigned NElts = VT.getVectorNumElements(); - for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) { - EVT SVT = (MVT::SimpleValueType)nVT; - if (isTypeSynthesizable(SVT) && SVT.getVectorElementType() == EltVT && - SVT.getVectorNumElements() > NElts && NElts != 1) { - TransformToType[i] = SVT; - ValueTypeActions.setTypeAction(VT, Promote); - IsLegalWiderType = true; - break; - } + if (isTypeLegal(VT)) continue; + + MVT IntermediateVT; + EVT RegisterVT; + unsigned NumIntermediates; + NumRegistersForVT[i] = + getVectorTypeBreakdownMVT(VT, IntermediateVT, NumIntermediates, + RegisterVT, this); + RegisterTypeForVT[i] = RegisterVT; + + // Determine if there is a legal wider type. + bool IsLegalWiderType = false; + EVT EltVT = VT.getVectorElementType(); + unsigned NElts = VT.getVectorNumElements(); + for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) { + EVT SVT = (MVT::SimpleValueType)nVT; + if (isTypeSynthesizable(SVT) && SVT.getVectorElementType() == EltVT && + SVT.getVectorNumElements() > NElts && NElts != 1) { + TransformToType[i] = SVT; + ValueTypeActions.setTypeAction(VT, Promote); + IsLegalWiderType = true; + break; } - if (!IsLegalWiderType) { - EVT NVT = VT.getPow2VectorType(); - if (NVT == VT) { - // Type is already a power of 2. The default action is to split. - TransformToType[i] = MVT::Other; - ValueTypeActions.setTypeAction(VT, Expand); - } else { - TransformToType[i] = NVT; - ValueTypeActions.setTypeAction(VT, Promote); - } + } + if (!IsLegalWiderType) { + EVT NVT = VT.getPow2VectorType(); + if (NVT == VT) { + // Type is already a power of 2. The default action is to split. + TransformToType[i] = MVT::Other; + ValueTypeActions.setTypeAction(VT, Expand); + } else { + TransformToType[i] = NVT; + ValueTypeActions.setTypeAction(VT, Promote); } } } From sabre at nondot.org Mon Jul 5 00:48:41 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 05 Jul 2010 05:48:41 -0000 Subject: [llvm-commits] [llvm] r107613 - /llvm/trunk/lib/Target/X86/README-SSE.txt Message-ID: <20100705054841.9FC8C2A6C12C@llvm.org> Author: lattner Date: Mon Jul 5 00:48:41 2010 New Revision: 107613 URL: http://llvm.org/viewvc/llvm-project?rev=107613&view=rev Log: some notes about suboptimal insertps's Modified: llvm/trunk/lib/Target/X86/README-SSE.txt Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=107613&r1=107612&r2=107613&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Mon Jul 5 00:48:41 2010 @@ -846,3 +846,34 @@ doing a shuffle from v[1] to v[0] then a float store. //===---------------------------------------------------------------------===// + +On SSE4 machines, we compile this code: + +define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, + <2 x float> *%P) nounwind { + %Z = fadd <2 x float> %Q, %R + + store <2 x float> %Z, <2 x float> *%P + ret <2 x float> %Z +} + +into: + +_test2: ## @test2 +## BB#0: + insertps $0, %xmm2, %xmm2 + insertps $16, %xmm3, %xmm2 + insertps $0, %xmm0, %xmm3 + insertps $16, %xmm1, %xmm3 + addps %xmm2, %xmm3 + movq %xmm3, (%rdi) + movaps %xmm3, %xmm0 + pshufd $1, %xmm3, %xmm1 + ## kill: XMM1 XMM1 + ret + +The insertps's of $0 are pointless complex copies. + +//===---------------------------------------------------------------------===// + + From sabre at nondot.org Mon Jul 5 00:52:56 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 05 Jul 2010 05:52:56 -0000 Subject: [llvm-commits] [llvm] r107614 - /llvm/trunk/test/CodeGen/X86/v2f32.ll Message-ID: <20100705055256.E776D2A6C12C@llvm.org> Author: lattner Date: Mon Jul 5 00:52:56 2010 New Revision: 107614 URL: http://llvm.org/viewvc/llvm-project?rev=107614&view=rev Log: another v2f32 case, in this case showing poor codegen. Modified: llvm/trunk/test/CodeGen/X86/v2f32.ll Modified: llvm/trunk/test/CodeGen/X86/v2f32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/v2f32.ll?rev=107614&r1=107613&r2=107614&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/v2f32.ll (original) +++ llvm/trunk/test/CodeGen/X86/v2f32.ll Mon Jul 5 00:52:56 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86-64 -asm-verbose=0 -o - | FileCheck %s -check-prefix=X64 +; RUN: llc < %s -march=x86-64 -mcpu=penryn -asm-verbose=0 -o - | FileCheck %s -check-prefix=X64 ; RUN: llc < %s -mcpu=yonah -march=x86 -asm-verbose=0 -o - | FileCheck %s -check-prefix=X32 ; PR7518 @@ -22,3 +22,18 @@ ; X32-NEXT: ret } + +define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, <2 x float> *%P) nounwind { + %Z = fadd <2 x float> %Q, %R + ret <2 x float> %Z + +; X64: test2: +; X64-NEXT: insertps $0 +; X64-NEXT: insertps $16 +; X64-NEXT: insertps $0 +; X64-NEXT: insertps $16 +; X64-NEXT: addps +; X64-NEXT: movaps +; X64-NEXT: pshufd +; X64-NEXT: ret +} From sabre at nondot.org Mon Jul 5 00:53:14 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 05 Jul 2010 05:53:14 -0000 Subject: [llvm-commits] [llvm] r107615 - in /llvm/trunk/lib: CodeGen/SelectionDAG/TargetLowering.cpp Target/X86/X86ISelLowering.cpp Message-ID: <20100705055314.BC1E92A6C12C@llvm.org> Author: lattner Date: Mon Jul 5 00:53:14 2010 New Revision: 107615 URL: http://llvm.org/viewvc/llvm-project?rev=107615&view=rev Log: more tidying. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=107615&r1=107614&r2=107615&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jul 5 00:53:14 2010 @@ -641,16 +641,12 @@ EVT DestVT = TLI->getRegisterType(NewVT); RegisterVT = DestVT; - if (EVT(DestVT).bitsLT(NewVT)) { - // Value is expanded, e.g. i64 -> i16. + if (EVT(DestVT).bitsLT(NewVT)) // Value is expanded, e.g. i64 -> i16. return NumVectorRegs*(NewVT.getSizeInBits()/DestVT.getSizeInBits()); - } else { - // Otherwise, promotion or legal types use the same number of registers as - // the vector decimated to the appropriate level. - return NumVectorRegs; - } - return 1; + // Otherwise, promotion or legal types use the same number of registers as + // the vector decimated to the appropriate level. + return NumVectorRegs; } /// computeRegisterProperties - Once all of the register classes are added, Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107615&r1=107614&r2=107615&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jul 5 00:53:14 2010 @@ -793,9 +793,8 @@ EVT VT = SVT; // Do not attempt to promote non-128-bit vectors - if (!VT.is128BitVector()) { + if (!VT.is128BitVector()) continue; - } setOperationAction(ISD::AND, SVT, Promote); AddPromotedToType (ISD::AND, SVT, MVT::v2i64); From baldrick at free.fr Mon Jul 5 09:12:49 2010 From: baldrick at free.fr (Duncan Sands) Date: Mon, 05 Jul 2010 14:12:49 -0000 Subject: [llvm-commits] [dragonegg] r107618 - in /dragonegg/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <20100705141249.90DFB2A6C12C@llvm.org> Author: baldrick Date: Mon Jul 5 09:12:49 2010 New Revision: 107618 URL: http://llvm.org/viewvc/llvm-project?rev=107618&view=rev Log: Add support for TARGET_MEM_REF, which is generated by the GCC optimizers when they are turned on using -fplugin-arg-dragonegg-enable-gcc-optzns. Modified: dragonegg/trunk/llvm-convert.cpp dragonegg/trunk/llvm-internal.h Modified: dragonegg/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=107618&r1=107617&r2=107618&view=diff ============================================================================== --- dragonegg/trunk/llvm-convert.cpp (original) +++ dragonegg/trunk/llvm-convert.cpp Mon Jul 5 09:12:49 2010 @@ -1254,6 +1254,9 @@ case SSA_NAME: LV = EmitLV_SSA_NAME(exp); break; + case TARGET_MEM_REF: + LV = EmitLV_TARGET_MEM_REF(exp); + break; // Constants. case LABEL_DECL: { @@ -5647,6 +5650,51 @@ return LValue(Temp, 1); } +LValue TreeToLLVM::EmitLV_TARGET_MEM_REF(tree exp) { + // TODO: Take the address space into account. + // TODO: Improve the alignment estimate. + struct mem_address addr; + get_address_description (exp, &addr); + + LValue Ref; + Value *Delta = 0; // Offset from base pointer in units + if (addr.symbol) { + Ref = EmitLV(addr.symbol); + if (addr.base && !integer_zerop (addr.base)) + Delta = EmitRegister(addr.base); + } else { + assert(addr.base && "TARGET_MEM_REF has neither base nor symbol!"); + Ref = LValue(EmitRegister(addr.base), 1); + } + + if (addr.index) { + Value *Index = EmitRegister(addr.index); + if (addr.step && !integer_onep (addr.step)) + Index = Builder.CreateMul(Index, EmitRegisterConstant(addr.step)); + Delta = Delta ? Builder.CreateAdd(Delta, Index) : Index; + } + + if (addr.offset && !integer_zerop (addr.offset)) { + Constant *Offset = EmitRegisterConstant(addr.offset); + Delta = Delta ? Builder.CreateAdd(Delta, Offset) : Offset; + } + + if (Delta) { + // Advance the base pointer by the given number of units. + Ref.Ptr = Builder.CreateBitCast(Ref.Ptr, GetUnitPointerType(Context)); + Ref.Ptr = POINTER_TYPE_OVERFLOW_UNDEFINED ? + Builder.CreateInBoundsGEP(Ref.Ptr, Delta) + : Builder.CreateGEP(Ref.Ptr, Delta); + Ref.setAlignment(1); // Let the optimizers compute the alignment. + } + + // The result can be of a different pointer type even if we didn't advance it. + Ref.Ptr = UselesslyTypeConvert(Ref.Ptr, + GetRegType(TREE_TYPE(exp))->getPointerTo()); + + return Ref; +} + Constant *TreeToLLVM::EmitLV_LABEL_DECL(tree exp) { return BlockAddress::get(Fn, getLabelDeclBlock(exp)); } @@ -7503,6 +7551,7 @@ case IMAGPART_EXPR: case INDIRECT_REF: case REALPART_EXPR: + case TARGET_MEM_REF: case VIEW_CONVERT_EXPR: return EmitLoadOfLValue(rhs); // Load from memory. Modified: dragonegg/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-internal.h?rev=107618&r1=107617&r2=107618&view=diff ============================================================================== --- dragonegg/trunk/llvm-internal.h (original) +++ dragonegg/trunk/llvm-internal.h Mon Jul 5 09:12:49 2010 @@ -222,6 +222,14 @@ return TheTypeConverter->ConvertType(type); } +/// GetUnitPointerType - Returns an LLVM pointer type which points to memory one +/// address unit wide. For example, on a machine which has 16 bit bytes returns +/// an i16*. +inline const Type *GetUnitPointerType(LLVMContext &C, unsigned AddrSpace = 0) { + assert(!(BITS_PER_UNIT & 7) && "Unit size not a multiple of 8 bits!"); + return IntegerType::get(C, BITS_PER_UNIT)->getPointerTo(AddrSpace); +} + /// GetFieldIndex - Return the index of the field in the given LLVM type that /// corresponds to the GCC field declaration 'decl'. This means that the LLVM /// and GCC fields start in the same byte (if 'decl' is a bitfield, this means @@ -327,6 +335,10 @@ uint32_t getAlignment() const { return 1U << LogAlign; } + + void setAlignment(uint32_t A) { + LogAlign = Log2_32(A); + } }; /// LValue - This struct represents an lvalue in the program. In particular, @@ -780,6 +792,7 @@ LValue EmitLV_WITH_SIZE_EXPR(tree_node *exp); LValue EmitLV_XXXXPART_EXPR(tree_node *exp, unsigned Idx); LValue EmitLV_SSA_NAME(tree_node *exp); + LValue EmitLV_TARGET_MEM_REF(tree_node *exp); // Constant Expressions. Value *EmitINTEGER_CST(tree_node *exp); From espindola at google.com Mon Jul 5 10:21:11 2010 From: espindola at google.com (Rafael Espindola) Date: Mon, 5 Jul 2010 11:21:11 -0400 Subject: [llvm-commits] [patch] Don't create neon moves in CopyRegToReg, instead trust NEONMoveFixPass to do the conversion Message-ID: A recent patch caused a regression on ARM: we would create NEON copy instructions when a VFP one would be more profitable. Two options were discussed: *) Represent the NEON registers as distinct from the VFP registers and have explicit copies from one to the other. *) Figure out why NEONMoveFixPass was not fixing this. Currently NEONMoveFixPass only converts VFP moves to NEON moves. This looks reasonable, we just have to avoid creating NEON moves early. This is what the attached patch does. It fixes the previous regression. Is there a case I am missing? That is, a case where CopyRegToReg was correctly creating a NEON move but NEONMoveFixPass fails to convert? The tests found nothing. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: neon.patch Type: text/x-diff Size: 1919 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/bacfe5cc/attachment.bin From jan_sjodin at yahoo.com Mon Jul 5 12:06:53 2010 From: jan_sjodin at yahoo.com (Jan Sjodin) Date: Mon, 5 Jul 2010 10:06:53 -0700 (PDT) Subject: [llvm-commits] Issue with Win64 local area stack offset In-Reply-To: <489333.28347.qm@web55604.mail.re4.yahoo.com> References: <489333.28347.qm@web55604.mail.re4.yahoo.com> Message-ID: <832540.73670.qm@web55606.mail.re4.yahoo.com> Any comments about the revised patch? Ok for someone to commit? Thanks, Jan ----- Original Message ---- > From: Jan Sjodin > To: Anton Korobeynikov > Cc: llvm-commits at cs.uiuc.edu > Sent: Tue, June 22, 2010 6:37:37 PM > Subject: Re: [llvm-commits] Issue with Win64 local area stack offset > > I did another experiment and made sure the slow isel was exercised. With the > example below we need to push two arguments on the stack which should be > above the shadow area. I updated the patch to do the right thing and it now > does the same thing as fast isel. The shadow area is simply pushed before any > arguments are analyzed on the caller/callee side. Example: > %structType = type <{ <16 x i32> }> define i64 @myfun(i64 > %arg0, i64 %arg1, i64 %arg2, i64 %arg3, i64 %arg4, i64 %arg5) nounwind > { entry: %test.i = alloca %structType, align 64 %conv4.i > = ptrtoint %structType* %test.i to i64 %tmp0 = add i64 %conv4.i, > %arg0 %tmp1 = add i64 %tmp0, %arg1 %tmp2 = add i64 %tmp1, > %arg2 %tmp3 = add i64 %tmp2, %arg3 %tmp4 = add i64 %tmp3, > %arg4 %tmp5 = add i64 %tmp4, %arg5 ret i64 > %tmp5 } define i64 @myfuncaller() nounwind { %temp = > call i64 @myfun(i64 0, i64 0, i64 0, i64 0, i64 0, i64 0) > ret i64 %temp } Generated code with new > patch: _myfun: > # @myfun # > BB#0: > # %entry > pushq %rbp movq %rsp, > %rbp subq $112, %rsp > leaq -112(%rbp,%rcx), %rax > addq %rdx, %rax > addq %r8, %rax addq > %r9, %rax addq 48(%rbp), > %rax addq 56(%rbp), %rax > addq $112, %rsp > popq %rbp ret > .def _myfuncaller; .scl 2; > .type 32; .endef > .globl _myfuncaller .align 16, > 0x90 _myfuncaller: > # @myfuncaller # BB#0: > pushq %rbp movq > %rsp, %rbp subq $48, %rsp # > <-- 16 bytes arg + 32 bytes shadow area > xorl %ecx, %ecx xorl > %edx, %edx xorl %r8d, %r8d > xorl %r9d, %r9d > movq $0, 40(%rsp) # <-- offsets above shadow area > movq $0, 32(%rsp) > call _myfun addq > $48, %rsp popq %rbp > ret Index: > lib/Target/X86/X86RegisterInfo.cpp =================================================================== --- > lib/Target/X86/X86RegisterInfo.cpp (revision 106454) +++ > lib/Target/X86/X86RegisterInfo.cpp (working copy) @@ -914,9 +914,6 > @@ StackSize = std::max(MinSize, StackSize > 128 ? > StackSize - 128 : 0); > MFI->setStackSize(StackSize); } else if > (Subtarget->isTargetWin64()) { - // We need to always > allocate 32 bytes as register spill area. - // FIXME: We might > reuse these 32 bytes for leaf functions. - StackSize += > 32; MFI->setStackSize(StackSize); } > Index: > lib/Target/X86/X86ISelLowering.cpp =================================================================== --- > lib/Target/X86/X86ISelLowering.cpp (revision 106454) +++ > lib/Target/X86/X86ISelLowering.cpp (working copy) @@ -1521,6 +1521,12 > @@ SmallVector ArgLocs; CCState > CCInfo(CallConv, isVarArg, getTargetMachine(), > ArgLocs, *DAG.getContext()); + + > // Allocate shadow area for Win64 + if (IsWin64) { + > CCInfo.AllocateStack(32, 8); + } + > CCInfo.AnalyzeFormalArguments(Ins, CCAssignFnForNode(CallConv)); > unsigned LastVal = ~0U; @@ -1746,8 +1752,7 @@ > > DebugLoc dl, SelectionDAG &DAG, > > const CCValAssign &VA, > > ISD::ArgFlagsTy Flags) const { - > const unsigned FirstStackArgOffset = (Subtarget->isTargetWin64() ? 32 : > 0); - unsigned LocMemOffset = FirstStackArgOffset + > VA.getLocMemOffset(); + unsigned LocMemOffset = > VA.getLocMemOffset(); SDValue PtrOff = > DAG.getIntPtrConstant(LocMemOffset); PtrOff = DAG.getNode(ISD::ADD, > dl, getPointerTy(), StackPtr, PtrOff); if (Flags.isByVal()) { @@ > -1829,6 +1834,12 @@ SmallVector > ArgLocs; CCState CCInfo(CallConv, isVarArg, > getTargetMachine(), > ArgLocs, *DAG.getContext()); + + // Allocate shadow area for > Win64 + if (Subtarget->isTargetWin64()) { + > CCInfo.AllocateStack(32, 8); + } + > CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForNode(CallConv)); > // Get a count of how many bytes are to be pushed on the stack. Index: > lib/Target/X86/X86TargetMachine.cpp =================================================================== --- > lib/Target/X86/X86TargetMachine.cpp (revision 106454) +++ > lib/Target/X86/X86TargetMachine.cpp (working copy) @@ -100,7 +100,7 > @@ DataLayout(Subtarget.getDataLayout()), > FrameInfo(TargetFrameInfo::StackGrowsDown, > Subtarget.getStackAlignment(), - > (Subtarget.isTargetWin64() ? -40 : + > (Subtarget.isTargetWin64() ? -8 : > (Subtarget.is64Bit() ? -8 : > -4))), InstrInfo(*this), JITInfo(*this), TLInfo(*this), > TSInfo(*this), ELFWriterInfo(*this) > { _______________________________________________ llvm-commits mailing > list > href="mailto:llvm-commits at cs.uiuc.edu">llvm-commits at cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nelhage at nelhage.com Mon Jul 5 13:11:46 2010 From: nelhage at nelhage.com (Nelson Elhage) Date: Mon, 05 Jul 2010 14:11:46 -0400 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <201006190247.o5J2lCxL009172@outgoing.mit.edu> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> Message-ID: <87wrt9ssrh.fsf@mit.edu> A non-text attachment was scrubbed... Name: stack-protector-linux.diff Type: text/x-diff Size: 8055 bytes Desc: Fix -fstack-protector on Linux/x86 Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/2422b78d/attachment.bin From echristo at apple.com Mon Jul 5 13:16:51 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 11:16:51 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <87wrt9ssrh.fsf@mit.edu> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> Message-ID: <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> On Jul 5, 2010, at 11:11 AM, Nelson Elhage wrote: > I'm not against this way in general. You can use "isELF" in the Subtarget area instead of including triple though. If you can make that change real fast that would be great. -eric From echristo at apple.com Mon Jul 5 13:22:52 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 11:22:52 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> Message-ID: <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> On Jul 5, 2010, at 11:16 AM, Eric Christopher wrote: > > On Jul 5, 2010, at 11:11 AM, Nelson Elhage wrote: > >> > > I'm not against this way in general. > > You can use "isELF" in the Subtarget area instead of including triple though. If you can make that change real fast that would be great. As has been pointed out BSD is also elf. I need to fix some comments and then give me a second to get things set up as far as the subtarget. -eric From kalle.raiskila at nokia.com Mon Jul 5 13:40:09 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 05 Jul 2010 18:40:09 -0000 Subject: [llvm-commits] [llvm] r107622 - in /llvm/trunk/lib/Target/CellSPU: SPUFrameInfo.h SPUISelLowering.cpp Message-ID: <20100705184009.8B9572A6C12C@llvm.org> Author: kraiskil Date: Mon Jul 5 13:40:09 2010 New Revision: 107622 URL: http://llvm.org/viewvc/llvm-project?rev=107622&view=rev Log: Remove some unused/redundant code. Modified: llvm/trunk/lib/Target/CellSPU/SPUFrameInfo.h llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUFrameInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUFrameInfo.h?rev=107622&r1=107621&r2=107622&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUFrameInfo.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUFrameInfo.h Mon Jul 5 13:40:09 2010 @@ -53,10 +53,6 @@ static int minStackSize() { return (2 * stackSlotSize()); } - //! Frame size required to spill all registers plus frame info - static int fullSpillSize() { - return (SPURegisterInfo::getNumArgRegs() * stackSlotSize()); - } //! Convert frame index to stack offset static int FItoStackOffset(int frame_index) { return frame_index * stackSlotSize(); Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=107622&r1=107621&r2=107622&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jul 5 13:40:09 2010 @@ -1179,24 +1179,8 @@ case MVT::i32: case MVT::i64: case MVT::i128: - if (ArgRegIdx != NumArgRegs) { - RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg)); - } else { - MemOpChains.push_back(DAG.getStore(Chain, dl, Arg, PtrOff, NULL, 0, - false, false, 0)); - ArgOffset += StackSlotSize; - } - break; case MVT::f32: case MVT::f64: - if (ArgRegIdx != NumArgRegs) { - RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg)); - } else { - MemOpChains.push_back(DAG.getStore(Chain, dl, Arg, PtrOff, NULL, 0, - false, false, 0)); - ArgOffset += StackSlotSize; - } - break; case MVT::v2i64: case MVT::v2f64: case MVT::v4f32: From echristo at apple.com Mon Jul 5 14:26:33 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 05 Jul 2010 19:26:33 -0000 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h Message-ID: <20100705192633.7AFDF2A6C12C@llvm.org> Author: echristo Date: Mon Jul 5 14:26:33 2010 New Revision: 107625 URL: http://llvm.org/viewvc/llvm-project?rev=107625&view=rev Log: Have the X86 backend use Triple instead of a string and some enums. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Subtarget.cpp llvm/trunk/lib/Target/X86/X86Subtarget.h Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107625&r1=107624&r2=107625&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jul 5 14:26:33 2010 @@ -62,21 +62,19 @@ SDValue V2); static TargetLoweringObjectFile *createTLOF(X86TargetMachine &TM) { - switch (TM.getSubtarget().TargetType) { - default: llvm_unreachable("unknown subtarget type"); - case X86Subtarget::isDarwin: - if (TM.getSubtarget().is64Bit()) - return new X8664_MachoTargetObjectFile(); + + bool is64Bit = TM.getSubtarget().is64Bit(); + + if (TM.getSubtarget().isTargetDarwin()) { + if (is64Bit) return new X8664_MachoTargetObjectFile(); return new TargetLoweringObjectFileMachO(); - case X86Subtarget::isELF: - if (TM.getSubtarget().is64Bit()) - return new X8664_ELFTargetObjectFile(TM); + } else if (TM.getSubtarget().isTargetELF() ){ + if (is64Bit) return new X8664_ELFTargetObjectFile(TM); return new X8632_ELFTargetObjectFile(TM); - case X86Subtarget::isMingw: - case X86Subtarget::isCygwin: - case X86Subtarget::isWindows: + } else if (TM.getSubtarget().isTargetCOFF()) { return new TargetLoweringObjectFileCOFF(); - } + } + llvm_unreachable("unknown subtarget type"); } X86TargetLowering::X86TargetLowering(X86TargetMachine &TM) Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=107625&r1=107624&r2=107625&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon Jul 5 14:26:33 2010 @@ -296,12 +296,11 @@ , IsBTMemSlow(false) , IsUAMemFast(false) , HasVectorUAMem(false) - , DarwinVers(0) , stackAlignment(8) // FIXME: this is a known good value for Yonah. How about others? , MaxInlineSizeThreshold(128) - , Is64Bit(is64Bit) - , TargetType(isELF) { // Default to ELF unless otherwise specified. + , TargetTriple(TT) + , Is64Bit(is64Bit) { // default to hard float ABI if (FloatABIType == FloatABI::Default) @@ -331,45 +330,15 @@ HasCMov = true; } - DEBUG(dbgs() << "Subtarget features: SSELevel " << X86SSELevel << ", 3DNowLevel " << X863DNowLevel << ", 64bit " << HasX86_64 << "\n"); assert((!Is64Bit || HasX86_64) && "64-bit code requested on a subtarget that doesn't support it!"); - // Set the boolean corresponding to the current target triple, or the default - // if one cannot be determined, to true. - if (TT.length() > 5) { - size_t Pos; - if ((Pos = TT.find("-darwin")) != std::string::npos) { - TargetType = isDarwin; - - // Compute the darwin version number. - if (isdigit(TT[Pos+7])) - DarwinVers = atoi(&TT[Pos+7]); - else - DarwinVers = 8; // Minimum supported darwin is Tiger. - } else if (TT.find("linux") != std::string::npos) { - // Linux doesn't imply ELF, but we don't currently support anything else. - TargetType = isELF; - } else if (TT.find("cygwin") != std::string::npos) { - TargetType = isCygwin; - } else if (TT.find("mingw") != std::string::npos) { - TargetType = isMingw; - } else if (TT.find("win32") != std::string::npos) { - TargetType = isWindows; - } else if (TT.find("windows") != std::string::npos) { - TargetType = isWindows; - } else if (TT.find("-cl") != std::string::npos) { - TargetType = isDarwin; - DarwinVers = 9; - } - } - // Stack alignment is 16 bytes on Darwin (both 32 and 64 bit) and for all 64 // bit targets. - if (TargetType == isDarwin || Is64Bit) + if (isTargetDarwin() || Is64Bit) stackAlignment = 16; if (StackAlignment) Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=107625&r1=107624&r2=107625&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.h (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.h Mon Jul 5 14:26:33 2010 @@ -14,6 +14,7 @@ #ifndef X86SUBTARGET_H #define X86SUBTARGET_H +#include "llvm/ADT/Triple.h" #include "llvm/Target/TargetSubtarget.h" #include "llvm/CallingConv.h" #include @@ -89,10 +90,6 @@ /// operands. This may require setting a feature bit in the processor. bool HasVectorUAMem; - /// DarwinVers - Nonzero if this is a darwin platform: the numeric - /// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc. - unsigned char DarwinVers; // Is any darwin-x86 platform. - /// stackAlignment - The minimum alignment known to hold of the stack frame on /// entry to the function and which must be maintained by every function. unsigned stackAlignment; @@ -100,6 +97,9 @@ /// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops. /// unsigned MaxInlineSizeThreshold; + + /// TargetTriple - What processor and OS we're targeting. + Triple TargetTriple; private: /// Is64Bit - True if the processor supports 64-bit instructions and @@ -107,9 +107,6 @@ bool Is64Bit; public: - enum { - isELF, isCygwin, isDarwin, isWindows, isMingw - } TargetType; /// This constructor initializes the data members to match that /// of the specified triple. @@ -158,24 +155,31 @@ bool isUnalignedMemAccessFast() const { return IsUAMemFast; } bool hasVectorUAMem() const { return HasVectorUAMem; } - bool isTargetDarwin() const { return TargetType == isDarwin; } - bool isTargetELF() const { return TargetType == isELF; } - - bool isTargetWindows() const { return TargetType == isWindows; } - bool isTargetMingw() const { return TargetType == isMingw; } - bool isTargetCygwin() const { return TargetType == isCygwin; } + bool isTargetDarwin() const { return TargetTriple.getOS() == Triple::Darwin; } + + // ELF is a reasonably sane default and the only other X86 targets we + // support are Darwin and Windows. Just use "not those". + bool isTargetELF() const { + return !isTargetDarwin() && !isTargetWindows() && !isTargetCygMing(); + } + bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; } + + bool isTargetWindows() const { return TargetTriple.getOS() == Triple::Win32; } + bool isTargetMingw() const { + return TargetTriple.getOS() == Triple::MinGW32 || + TargetTriple.getOS() == Triple::MinGW64; } + bool isTargetCygwin() const { return TargetTriple.getOS() == Triple::Cygwin; } bool isTargetCygMing() const { - return TargetType == isMingw || TargetType == isCygwin; + return isTargetMingw() || isTargetCygwin(); } - + /// isTargetCOFF - Return true if this is any COFF/Windows target variant. bool isTargetCOFF() const { - return TargetType == isMingw || TargetType == isCygwin || - TargetType == isWindows; + return isTargetMingw() || isTargetCygwin() || isTargetWindows(); } bool isTargetWin64() const { - return Is64Bit && (TargetType == isMingw || TargetType == isWindows); + return Is64Bit && (isTargetMingw() || isTargetWindows()); } std::string getDataLayout() const { @@ -209,7 +213,10 @@ /// getDarwinVers - Return the darwin version number, 8 = Tiger, 9 = Leopard, /// 10 = Snow Leopard, etc. - unsigned getDarwinVers() const { return DarwinVers; } + unsigned getDarwinVers() const { + if (isTargetDarwin()) return TargetTriple.getDarwinMajorNumber(); + return 0; + } /// ClassifyGlobalReference - Classify a global variable reference for the /// current subtarget according to how we should reference it in a non-pcrel From anton at korobeynikov.info Mon Jul 5 14:51:50 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 5 Jul 2010 23:51:50 +0400 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <20100705192633.7AFDF2A6C12C@llvm.org> References: <20100705192633.7AFDF2A6C12C@llvm.org> Message-ID: Hi, Eric > Have the X86 backend use Triple instead of a string and some enums. Will it recognize triple of i386-mingw32? iirc there were some problems with Triple and such "short" target triplets. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From echristo at apple.com Mon Jul 5 14:53:07 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 12:53:07 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> Message-ID: <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> On Jul 5, 2010, at 12:51 PM, Anton Korobeynikov wrote: > Hi, Eric > >> Have the X86 backend use Triple instead of a string and some enums. > Will it recognize triple of i386-mingw32? iirc there were some > problems with Triple and such "short" target triplets. > If not we should fix it in triple. (and for now just "don't do that" if it is a problem) -eric From nelhage at nelhage.com Mon Jul 5 14:53:44 2010 From: nelhage at nelhage.com (Nelson Elhage) Date: Mon, 05 Jul 2010 15:53:44 -0400 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> Message-ID: <87sk3xso1j.fsf@mit.edu> A non-text attachment was scrubbed... Name: stack-protector-linux.diff Type: text/x-diff Size: 6551 bytes Desc: Fix -fstack-protector on Linux/x86 Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/7320adb5/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: stack-protector-linux.diff Type: text/x-diff Size: 6551 bytes Desc: Fix -fstack-protector on Linux/x86 Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/7320adb5/attachment-0001.bin From anton at korobeynikov.info Mon Jul 5 14:54:08 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 5 Jul 2010 23:54:08 +0400 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: > If not we should fix it in triple. (and for now just "don't do that" if it is a problem) Well, Daniel one day was strongly opposed to this. He thought that such "short triplets" should not exist... -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From echristo at apple.com Mon Jul 5 14:55:20 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 12:55:20 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: On Jul 5, 2010, at 12:54 PM, Anton Korobeynikov wrote: >> If not we should fix it in triple. (and for now just "don't do that" if it is a problem) > Well, Daniel one day was strongly opposed to this. He thought that > such "short triplets" should not exist... They should be translated by something yes. -eric From clattner at apple.com Mon Jul 5 14:58:28 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 5 Jul 2010 12:58:28 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> On Jul 5, 2010, at 12:54 PM, Anton Korobeynikov wrote: >> If not we should fix it in triple. (and for now just "don't do that" if it is a problem) > Well, Daniel one day was strongly opposed to this. He thought that > such "short triplets" should not exist... I agree with Daniel, the frontend should provide a canonical triple, even if the user doesn't. -Chris From echristo at apple.com Mon Jul 5 14:59:33 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 12:59:33 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> Message-ID: <6FFB7096-F6AB-48E1-867C-5773BCABF958@apple.com> On Jul 5, 2010, at 12:58 PM, Chris Lattner wrote: > > On Jul 5, 2010, at 12:54 PM, Anton Korobeynikov wrote: > >>> If not we should fix it in triple. (and for now just "don't do that" if it is a problem) >> Well, Daniel one day was strongly opposed to this. He thought that >> such "short triplets" should not exist... > > I agree with Daniel, the frontend should provide a canonical triple, even if the user doesn't. Yep. I agree as well. -eric From anton at korobeynikov.info Mon Jul 5 15:00:21 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 6 Jul 2010 00:00:21 +0400 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> Message-ID: > I agree with Daniel, the frontend should provide a canonical triple, even if the user doesn't. Ok, then both llvm-gcc and clang should be fixed before this commit :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Mon Jul 5 15:01:41 2010 From: baldrick at free.fr (Duncan Sands) Date: Mon, 05 Jul 2010 22:01:41 +0200 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> Message-ID: <4C323A25.8080702@free.fr> >> Have the X86 backend use Triple instead of a string and some enums. > Will it recognize triple of i386-mingw32? iirc there were some > problems with Triple and such "short" target triplets. There are some examples in PR6688, see http://llvm.org/bugs/show_bug.cgi?id=6688 Ciao, Duncan. From baldrick at free.fr Mon Jul 5 15:08:46 2010 From: baldrick at free.fr (Duncan Sands) Date: Mon, 05 Jul 2010 22:08:46 +0200 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: <4C323BCE.5060505@free.fr> On 05/07/10 21:54, Anton Korobeynikov wrote: >> If not we should fix it in triple. (and for now just "don't do that" if it is a problem) > Well, Daniel one day was strongly opposed to this. He thought that > such "short triplets" should not exist... I never really understood Daniel's argument. Clearly we should not *produce* bogus triples, but I think we should *accept* odd "triples" that people pass to us. People (including major distributions) regularly configure gcc etc with non-normalized triples, so correctly handling them seems important. It's not surprising that people get this wrong: the web is filled with contradictory descriptions of how triples are "supposed" to be [*], not to mention examples of wild triples with the components in any order etc. Ciao, Duncan. [*] The definitive description seems to be: a correct triple is what is produced by GCC's config.sub. From baldrick at free.fr Mon Jul 5 15:11:37 2010 From: baldrick at free.fr (Duncan Sands) Date: Mon, 05 Jul 2010 22:11:37 +0200 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> Message-ID: <4C323C79.4020301@free.fr> > I agree with Daniel, the frontend should provide a canonical triple, even if the user doesn't. They could do this using a utility class that accepts just about anything, but produces a correct, normalized triple. We could even call this class Triple, what do you think? :) Ciao, Duncan. From clattner at apple.com Mon Jul 5 15:25:00 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 5 Jul 2010 13:25:00 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <4C323C79.4020301@free.fr> References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> <472440FF-EB98-492C-8719-C8C5EE866E55@apple.com> <4C323C79.4020301@free.fr> Message-ID: <527EC357-267F-4066-A5C6-185F432A4243@apple.com> On Jul 5, 2010, at 1:11 PM, Duncan Sands wrote: >> I agree with Daniel, the frontend should provide a canonical triple, even if the user doesn't. > > They could do this using a utility class that accepts just about anything, but > produces a correct, normalized triple. We could even call this class Triple, > what do you think? :) I would be fine with a static Triple::normalize function that takes a StringRef and returns a Triple. -Chris From echristo at apple.com Mon Jul 5 15:41:19 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 13:41:19 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: On Jul 5, 2010, at 12:54 PM, Anton Korobeynikov wrote: >> If not we should fix it in triple. (and for now just "don't do that" if it is a problem) > Well, Daniel one day was strongly opposed to this. He thought that > such "short triplets" should not exist... Try this llvm-gcc patch for now. It seems to output what it should. -eric -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-gcc.diff Type: application/octet-stream Size: 1167 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/bf0d8ae8/attachment.obj From wendling at apple.com Mon Jul 5 16:28:49 2010 From: wendling at apple.com (Bill Wendling) Date: Mon, 5 Jul 2010 14:28:49 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <87sk3xso1j.fsf@mit.edu> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> Message-ID: <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> This is in the "Generic" folder. Please don't change it like this. If the test as is can no longer be done generically, then we should find another solution. --- a/test/CodeGen/Generic/stack-protector.ll +++ b/test/CodeGen/Generic/stack-protector.ll @@ -1,5 +1,7 @@ -; RUN: llc < %s -o - | grep {__stack_chk_guard} -; RUN: llc < %s -o - | grep {__stack_chk_fail} +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_guard} +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_fail} +; Linux/x86 stores the stack cookie in a weird place. So we force an arbitrary +; non-x86 test to make sure codegen uses the generic case. @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] -bw On Jul 5, 2010, at 12:53 PM, Nelson Elhage wrote: > Rebased to current mainline. > > - Nelson > > > On Mon, 5 Jul 2010 11:22:52 -0700, Eric Christopher wrote: >> >> On Jul 5, 2010, at 11:16 AM, Eric Christopher wrote: >> >>> >>> On Jul 5, 2010, at 11:11 AM, Nelson Elhage wrote: >>> >>>> >>> >>> I'm not against this way in general. >>> >>> You can use "isELF" in the Subtarget area instead of including triple though. If you can make that change real fast that would be great. >> >> As has been pointed out BSD is also elf. I need to fix some comments and then give me a second to get things set up as far as the subtarget. >> >> -eric > From: Nelson Elhage > Subject: Re: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 > To: Eric Christopher > Cc: llvm-commits at cs.uiuc.edu > Bcc: nelhage at mit.edu > In-Reply-To: <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF at apple.com> > References: <201006190247.o5J2lCxL009172 at outgoing.mit.edu> <87wrt9ssrh.fsf at mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF at apple.com> > > On Mon, 5 Jul 2010 11:16:51 -0700, Eric Christopher wrote: >> >> On Jul 5, 2010, at 11:11 AM, Nelson Elhage wrote: >> >>> >> >> I'm not against this way in general. >> >> You can use "isELF" in the Subtarget area instead of including triple though. If you can make that change real fast that would be great. >> >> -eric > From: Nelson Elhage > Subject: Re: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 > To: llvm-commits at cs.uiuc.edu > Bcc: nelhage at mit.edu > In-Reply-To: <87wrt9ssrh.fsf at mit.edu> > References: <201006190247.o5J2lCxL009172 at outgoing.mit.edu> <87wrt9ssrh.fsf at mit.edu> > > On Mon, 05 Jul 2010 14:11:46 -0400, Nelson Elhage wrote: >> [bump] I haven't gotten an reply to this, and IRC suggested a reminder >> would be appropriate. >> >> I'm happy to rewrite this using a different approach if something else >> would be more appropriate, but I'd love to see this bug fixed since it >> affects my ability to compile projects I work on with clang. >> > From: Nelson Elhage > Subject: Re: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 > To: llvm-commits at cs.uiuc.edu > Bcc: nelhage at mit.edu > In-Reply-To: <201006190247.o5J2lCxL009172 at outgoing.mit.edu> > References: <201006190247.o5J2lCxL009172 at outgoing.mit.edu> > > On Fri, 18 Jun 2010 22:47:17 -0400 (EDT), Nelson Elhage wrote: >> This patch adds a hook to TargetLowering to indicate whether the stack protector >> cookie is stored in a non-standard place. >> >> Code-diving glibc, it appears that in general it stores the stack cookie off of >> the TCB header. I'm not sure if there's a more generic solution than the >> address-space/offset approach in this patch for accessing the TCB header in the >> generated IR. >> > >> >> _______________________________________________ >> 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 echristo at apple.com Mon Jul 5 17:26:05 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 15:26:05 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> Message-ID: <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> On Jul 5, 2010, at 2:28 PM, Bill Wendling wrote: > This is in the "Generic" folder. Please don't change it like this. If the test as is can no longer be done generically, then we should find another solution. > > --- a/test/CodeGen/Generic/stack-protector.ll > +++ b/test/CodeGen/Generic/stack-protector.ll > @@ -1,5 +1,7 @@ > -; RUN: llc < %s -o - | grep {__stack_chk_guard} > -; RUN: llc < %s -o - | grep {__stack_chk_fail} > +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_guard} > +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_fail} > +; Linux/x86 stores the stack cookie in a weird place. So we force an arbitrary > +; non-x86 test to make sure codegen uses the generic case. > > @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] Yeah, we should probably move it to x86 and ppc so that each of them have their own stack protector tests. -eric From nelhage at nelhage.com Mon Jul 5 18:07:11 2010 From: nelhage at nelhage.com (Nelson Elhage) Date: Mon, 05 Jul 2010 19:07:11 -0400 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> Message-ID: <87pqz1sf34.fsf@mit.edu> On Mon, 5 Jul 2010 15:26:05 -0700, Eric Christopher wrote: > > On Jul 5, 2010, at 2:28 PM, Bill Wendling wrote: > > > This is in the "Generic" folder. Please don't change it like > > this. If the test as is can no longer be done generically, then we > > should find another solution. > > > > --- a/test/CodeGen/Generic/stack-protector.ll > > +++ b/test/CodeGen/Generic/stack-protector.ll > > @@ -1,5 +1,7 @@ > > -; RUN: llc < %s -o - | grep {__stack_chk_guard} > > -; RUN: llc < %s -o - | grep {__stack_chk_fail} > > +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_guard} > > +; RUN: llc -march=arm < %s -o - | grep {__stack_chk_fail} > > +; Linux/x86 stores the stack cookie in a weird place. So we force an arbitrary > > +; non-x86 test to make sure codegen uses the generic case. > > > > @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] > > Yeah, we should probably move it to x86 and ppc so that each of them > have their own stack protector tests. > > -eric Ok, I can split this into arch-specific tests. Would you prefer if I make a (nearly-identical) copy of this test for each architecture, or just pick one or a handful, and let developers add more if appropriate if and when they implement glibc stack cookie support for those targets? I guess I should also add a case to the X86 test with -mtriple=x86_64-apple-darwin or such, to check that we still use __stack_chk_guard in that case. - Nelson From echristo at apple.com Mon Jul 5 18:08:39 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 16:08:39 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <87pqz1sf34.fsf@mit.edu> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> <87pqz1sf34.fsf@mit.edu> Message-ID: <6CFF3139-F42B-4CFE-9763-5C4E96F4C16F@apple.com> On Jul 5, 2010, at 4:07 PM, Nelson Elhage wrote: > Ok, I can split this into arch-specific tests. Would you prefer if I > make a (nearly-identical) copy of this test for each architecture, or > just pick one or a handful, and let developers add more if appropriate > if and when they implement glibc stack cookie support for those targets? > > I guess I should also add a case to the X86 test with > -mtriple=x86_64-apple-darwin or such, to check that we still use > __stack_chk_guard in that case. x86(-64) and ppc would probably be sufficient. But yes, one for each of the linux and darwin options. -eric From echristo at apple.com Mon Jul 5 18:20:59 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 16:20:59 -0700 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: <07DAF9ED-5831-4299-BDCC-D1614B09C66F@apple.com> On Jul 5, 2010, at 1:41 PM, Eric Christopher wrote: > > On Jul 5, 2010, at 12:54 PM, Anton Korobeynikov wrote: > >>> If not we should fix it in triple. (and for now just "don't do that" if it is a problem) >> Well, Daniel one day was strongly opposed to this. He thought that >> such "short triplets" should not exist... > > Try this llvm-gcc patch for now. It seems to output what it should. The patch worked for llvm-gcc configured with --target=i686-darwin and output i386-pc-darwin10.4 into the module which seems to be the desired behavior. :) -eric From echristo at apple.com Mon Jul 5 18:23:34 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 05 Jul 2010 23:23:34 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r107629 - in /llvm-gcc-4.2/trunk/gcc: Makefile.in llvm-backend.cpp Message-ID: <20100705232334.33F062A6C12C@llvm.org> Author: echristo Date: Mon Jul 5 18:23:33 2010 New Revision: 107629 URL: http://llvm.org/viewvc/llvm-project?rev=107629&view=rev Log: Use the normalized target, not the one we were configured with for the TargetTriple. Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp 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=107629&r1=107628&r2=107629&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Mon Jul 5 18:23:33 2010 @@ -965,6 +965,7 @@ ALL_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes \ -Wold-style-definition -Wno-overlength-strings, $(ALL_CFLAGS)) -Wno-unused ALL_CXXFLAGS += -DTARGET_NAME=\"$(target_noncanonical)\" +ALL_CXXFLAGS += -DTARGET_CANONICAL_NAME=\"$(target)\" ALL_CXXFLAGS += -frandom-seed=0 # Turn off LLVM assertions in a non-checking build. 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=107629&r1=107628&r2=107629&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Jul 5 18:23:33 2010 @@ -478,7 +478,7 @@ // If the target wants to override the architecture, e.g. turning // powerpc-darwin-... into powerpc64-darwin-... when -m64 is enabled, do so // now. - std::string TargetTriple = TARGET_NAME; + std::string TargetTriple = TARGET_CANONICAL_NAME; #ifdef LLVM_OVERRIDE_TARGET_ARCH std::string Arch = LLVM_OVERRIDE_TARGET_ARCH(); if (!Arch.empty()) { From espindola at google.com Mon Jul 5 18:45:56 2010 From: espindola at google.com (Rafael Espindola) Date: Mon, 5 Jul 2010 19:45:56 -0400 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: <07DAF9ED-5831-4299-BDCC-D1614B09C66F@apple.com> References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> <07DAF9ED-5831-4299-BDCC-D1614B09C66F@apple.com> Message-ID: > The patch worked for llvm-gcc configured with --target=i686-darwin and output i386-pc-darwin10.4 into the module which seems to be the desired behavior. :) A baby step for clang is in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100628/031676.html. This is *very* incomplete, as it only works if not crosscompiling and will use a non normalized value, but at least it can be set a build time :-) > -eric Cheers, -- Rafael ?vila de Esp?ndola From wendling at apple.com Mon Jul 5 19:06:01 2010 From: wendling at apple.com (Bill Wendling) Date: Mon, 5 Jul 2010 17:06:01 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <6CFF3139-F42B-4CFE-9763-5C4E96F4C16F@apple.com> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> <87pqz1sf34.fsf@mit.edu> <6CFF3139-F42B-4CFE-9763-5C4E96F4C16F@apple.com> Message-ID: <756AF35D-ECB0-43C7-A05F-7405C537705C@apple.com> On Jul 5, 2010, at 4:08 PM, Eric Christopher wrote: > On Jul 5, 2010, at 4:07 PM, Nelson Elhage wrote: > >> Ok, I can split this into arch-specific tests. Would you prefer if I >> make a (nearly-identical) copy of this test for each architecture, or >> just pick one or a handful, and let developers add more if appropriate >> if and when they implement glibc stack cookie support for those targets? >> >> I guess I should also add a case to the X86 test with >> -mtriple=x86_64-apple-darwin or such, to check that we still use >> __stack_chk_guard in that case. > > x86(-64) and ppc would probably be sufficient. But yes, one for each of the linux and darwin options. > Ditto. The use of FileCheck will help in that of course. :) Please include ARM in the list of architectures. Thanks! -bw From eli.friedman at gmail.com Mon Jul 5 20:27:34 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 5 Jul 2010 18:27:34 -0700 Subject: [llvm-commits] [llvm] r107613 - /llvm/trunk/lib/Target/X86/README-SSE.txt In-Reply-To: <20100705054841.9FC8C2A6C12C@llvm.org> References: <20100705054841.9FC8C2A6C12C@llvm.org> Message-ID: On Sun, Jul 4, 2010 at 10:48 PM, Chris Lattner wrote: > Author: lattner > Date: Mon Jul ?5 00:48:41 2010 > New Revision: 107613 > > URL: http://llvm.org/viewvc/llvm-project?rev=107613&view=rev > Log: > some notes about suboptimal insertps's > > Modified: > ? ?llvm/trunk/lib/Target/X86/README-SSE.txt > > Modified: llvm/trunk/lib/Target/X86/README-SSE.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=107613&r1=107612&r2=107613&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) > +++ llvm/trunk/lib/Target/X86/README-SSE.txt Mon Jul ?5 00:48:41 2010 > @@ -846,3 +846,34 @@ > ?doing a shuffle from v[1] to v[0] then a float store. > > ?//===---------------------------------------------------------------------===// > + > +On SSE4 machines, we compile this code: > + > +define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, > + ? ? ? <2 x float> *%P) nounwind { > + ?%Z = fadd <2 x float> %Q, %R > + > + ?store <2 x float> %Z, <2 x float> *%P > + ?ret <2 x float> %Z > +} > + > +into: > + > +_test2: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ## @test2 > +## BB#0: > + ? ? ? insertps ? ? ? ?$0, %xmm2, %xmm2 > + ? ? ? insertps ? ? ? ?$16, %xmm3, %xmm2 > + ? ? ? insertps ? ? ? ?$0, %xmm0, %xmm3 > + ? ? ? insertps ? ? ? ?$16, %xmm1, %xmm3 > + ? ? ? addps ? %xmm2, %xmm3 > + ? ? ? movq ? ?%xmm3, (%rdi) > + ? ? ? movaps ?%xmm3, %xmm0 > + ? ? ? pshufd ?$1, %xmm3, %xmm1 > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?## kill: XMM1 XMM1 > + ? ? ? ret > + > +The insertps's of $0 are pointless complex copies. I'm also concerned about the pshufd at the end; is the ABI stuff really working the way you want it to? -Eli From nelhage at nelhage.com Mon Jul 5 20:29:18 2010 From: nelhage at nelhage.com (Nelson Elhage) Date: Mon, 05 Jul 2010 21:29:18 -0400 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <756AF35D-ECB0-43C7-A05F-7405C537705C@apple.com> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> <87pqz1sf34.fsf@mit.edu> <6CFF3139-F42B-4CFE-9763-5C4E96F4C16F@apple.com> <756AF35D-ECB0-43C7-A05F-7405C537705C@apple.com> Message-ID: <87mxu5s8i9.fsf@mit.edu> A non-text attachment was scrubbed... Name: stack-protector-linux.diff Type: text/x-diff Size: 9491 bytes Desc: Fix -fstack-protector on Linux/x86 Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/2e6a7a66/attachment.bin From evan.cheng at apple.com Mon Jul 5 20:35:01 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 5 Jul 2010 18:35:01 -0700 Subject: [llvm-commits] [patch] Don't create neon moves in CopyRegToReg, instead trust NEONMoveFixPass to do the conversion In-Reply-To: References: Message-ID: I have no problem with the patch. But I would feel a lot better if we are sure NEONMoveFix pass does not miss some important cases. I thought Jakob pointed out (in an earlier) thread that it's missing a case? Evan On Jul 5, 2010, at 8:21 AM, Rafael Espindola wrote: > A recent patch caused a regression on ARM: we would create NEON copy > instructions when a VFP one would be more profitable. Two options were > discussed: > > *) Represent the NEON registers as distinct from the VFP registers and > have explicit copies from one to the other. > *) Figure out why NEONMoveFixPass was not fixing this. > > Currently NEONMoveFixPass only converts VFP moves to NEON moves. This > looks reasonable, we just have to avoid creating NEON moves early. > This is what the attached patch does. It fixes the previous > regression. > > Is there a case I am missing? That is, a case where CopyRegToReg was > correctly creating a NEON move but NEONMoveFixPass fails to convert? > The tests found nothing. > > Cheers, > -- > Rafael ?vila de Esp?ndola > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From eli.friedman at gmail.com Mon Jul 5 21:15:37 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 5 Jul 2010 19:15:37 -0700 Subject: [llvm-commits] [llvm] r107613 - /llvm/trunk/lib/Target/X86/README-SSE.txt In-Reply-To: References: <20100705054841.9FC8C2A6C12C@llvm.org> Message-ID: On Mon, Jul 5, 2010 at 6:27 PM, Eli Friedman wrote: > On Sun, Jul 4, 2010 at 10:48 PM, Chris Lattner wrote: >> Author: lattner >> Date: Mon Jul ?5 00:48:41 2010 >> New Revision: 107613 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=107613&view=rev >> Log: >> some notes about suboptimal insertps's >> >> Modified: >> ? ?llvm/trunk/lib/Target/X86/README-SSE.txt >> >> Modified: llvm/trunk/lib/Target/X86/README-SSE.txt >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=107613&r1=107612&r2=107613&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) >> +++ llvm/trunk/lib/Target/X86/README-SSE.txt Mon Jul ?5 00:48:41 2010 >> @@ -846,3 +846,34 @@ >> ?doing a shuffle from v[1] to v[0] then a float store. >> >> ?//===---------------------------------------------------------------------===// >> + >> +On SSE4 machines, we compile this code: >> + >> +define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, >> + ? ? ? <2 x float> *%P) nounwind { >> + ?%Z = fadd <2 x float> %Q, %R >> + >> + ?store <2 x float> %Z, <2 x float> *%P >> + ?ret <2 x float> %Z >> +} >> + >> +into: >> + >> +_test2: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ## @test2 >> +## BB#0: >> + ? ? ? insertps ? ? ? ?$0, %xmm2, %xmm2 >> + ? ? ? insertps ? ? ? ?$16, %xmm3, %xmm2 >> + ? ? ? insertps ? ? ? ?$0, %xmm0, %xmm3 >> + ? ? ? insertps ? ? ? ?$16, %xmm1, %xmm3 >> + ? ? ? addps ? %xmm2, %xmm3 >> + ? ? ? movq ? ?%xmm3, (%rdi) >> + ? ? ? movaps ?%xmm3, %xmm0 >> + ? ? ? pshufd ?$1, %xmm3, %xmm1 >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?## kill: XMM1 XMM1 >> + ? ? ? ret >> + >> +The insertps's of $0 are pointless complex copies. > > I'm also concerned about the pshufd at the end; is the ABI stuff > really working the way you want it to? Nevermind; I read this before your email to llvmdev. -Eli From espindola at google.com Mon Jul 5 22:11:11 2010 From: espindola at google.com (Rafael Espindola) Date: Mon, 5 Jul 2010 23:11:11 -0400 Subject: [llvm-commits] [patch] Don't create neon moves in CopyRegToReg, instead trust NEONMoveFixPass to do the conversion In-Reply-To: References: Message-ID: On 5 July 2010 21:35, Evan Cheng wrote: > I have no problem with the patch. But I ?would feel a lot better if we are sure NEONMoveFix pass does not miss some important cases. I thought Jakob pointed out (in an earlier) thread that it's missing a case? It was (and is) missing the ability to convert form NEON to VFP when it is profitable to do so. What this patch does is avoid creating a case where that ability is necessary. I tested in a debugger that the pass is doing the right thing, it finds that a register has been used with VFP and avoids converting a move from it to NEON. I also did a make check, but I did no extra testing to find if NEONMoveFix handles all the cases we might care about. > Evan Cheers, -- Rafael ?vila de Esp?ndola From echristo at apple.com Mon Jul 5 22:44:16 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 20:44:16 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <87mxu5s8i9.fsf@mit.edu> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> <87pqz1sf34.fsf@mit.edu> <6CFF3139-F42B-4CFE-9763-5C4E96F4C16F@apple.com> <756AF35D-ECB0-43C7-A05F-7405C537705C@apple.com> <87mxu5s8i9.fsf@mit.edu> Message-ID: On Jul 5, 2010, at 6:29 PM, Nelson Elhage wrote: > Here's a patch which splits the test out for ARM, X86, and PPC. > > For ARM and PPC, I'm leaving a single test (triple unspecified). From > browsing glibc, it looks like PPC has a weird stack cookie on Linux, > too, but I don't have a build env set up to verify, so I'll let someone > who knows more about PPC deal if appropriate. > > FileCheck didn't seem to be necessary for these tests; Did you intend > that I check something more complex than the simple grep's that were > already there? Nope, but FileCheck is TheOneTrueWay(tm). I'll grab it though. -eric From nicholas at mxc.ca Mon Jul 5 22:52:38 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 06 Jul 2010 03:52:38 -0000 Subject: [llvm-commits] [llvm] r107635 - /llvm/trunk/include/llvm/Support/CallSite.h Message-ID: <20100706035238.0FEA52A6C12C@llvm.org> Author: nicholas Date: Mon Jul 5 22:52:37 2010 New Revision: 107635 URL: http://llvm.org/viewvc/llvm-project?rev=107635&view=rev Log: Fix typo 'getter' where 'setter' was intended. Modified: llvm/trunk/include/llvm/Support/CallSite.h Modified: llvm/trunk/include/llvm/Support/CallSite.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=107635&r1=107634&r2=107635&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CallSite.h (original) +++ llvm/trunk/include/llvm/Support/CallSite.h Mon Jul 5 22:52:37 2010 @@ -204,9 +204,9 @@ CALLSITE_DELEGATE_GETTER(isNoInline()); } void setIsNoInline(bool Value = true) { - CALLSITE_DELEGATE_GETTER(setIsNoInline(Value)); + CALLSITE_DELEGATE_SETTER(setIsNoInline(Value)); } - + /// @brief Determine if the call does not access memory. bool doesNotAccessMemory() const { CALLSITE_DELEGATE_GETTER(doesNotAccessMemory()); From nicholas at mxc.ca Mon Jul 5 22:53:22 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 06 Jul 2010 03:53:22 -0000 Subject: [llvm-commits] [llvm] r107636 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <20100706035322.2E89F2A6C12C@llvm.org> Author: nicholas Date: Mon Jul 5 22:53:22 2010 New Revision: 107636 URL: http://llvm.org/viewvc/llvm-project?rev=107636&view=rev Log: Add default value to setIsNoInline for parity with the other methods of its kind. Also fold some functions that fit on a line to a single line. 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=107636&r1=107635&r2=107636&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon Jul 5 22:53:22 2010 @@ -993,7 +993,7 @@ /// @brief Return true if the call should not be inlined. bool isNoInline() const { return paramHasAttr(~0, Attribute::NoInline); } - void setIsNoInline(bool Value) { + void setIsNoInline(bool Value = true) { if (Value) addAttribute(~0, Attribute::NoInline); else removeAttribute(~0, Attribute::NoInline); } @@ -1017,18 +1017,14 @@ } /// @brief Determine if the call cannot return. - bool doesNotReturn() const { - return paramHasAttr(~0, Attribute::NoReturn); - } + bool doesNotReturn() const { return paramHasAttr(~0, Attribute::NoReturn); } void setDoesNotReturn(bool DoesNotReturn = true) { if (DoesNotReturn) addAttribute(~0, Attribute::NoReturn); else removeAttribute(~0, Attribute::NoReturn); } /// @brief Determine if the call cannot unwind. - bool doesNotThrow() const { - return paramHasAttr(~0, Attribute::NoUnwind); - } + bool doesNotThrow() const { return paramHasAttr(~0, Attribute::NoUnwind); } void setDoesNotThrow(bool DoesNotThrow = true) { if (DoesNotThrow) addAttribute(~0, Attribute::NoUnwind); else removeAttribute(~0, Attribute::NoUnwind); @@ -2488,11 +2484,11 @@ /// @brief Return true if the call should not be inlined. bool isNoInline() const { return paramHasAttr(~0, Attribute::NoInline); } - void setIsNoInline(bool Value) { + void setIsNoInline(bool Value = true) { if (Value) addAttribute(~0, Attribute::NoInline); else removeAttribute(~0, Attribute::NoInline); } - + /// @brief Determine if the call does not access memory. bool doesNotAccessMemory() const { return paramHasAttr(~0, Attribute::ReadNone); @@ -2512,18 +2508,14 @@ } /// @brief Determine if the call cannot return. - bool doesNotReturn() const { - return paramHasAttr(~0, Attribute::NoReturn); - } + bool doesNotReturn() const { return paramHasAttr(~0, Attribute::NoReturn); } void setDoesNotReturn(bool DoesNotReturn = true) { if (DoesNotReturn) addAttribute(~0, Attribute::NoReturn); else removeAttribute(~0, Attribute::NoReturn); } /// @brief Determine if the call cannot unwind. - bool doesNotThrow() const { - return paramHasAttr(~0, Attribute::NoUnwind); - } + bool doesNotThrow() const { return paramHasAttr(~0, Attribute::NoUnwind); } void setDoesNotThrow(bool DoesNotThrow = true) { if (DoesNotThrow) addAttribute(~0, Attribute::NoUnwind); else removeAttribute(~0, Attribute::NoUnwind); From nicholas at mxc.ca Mon Jul 5 22:53:43 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 06 Jul 2010 03:53:43 -0000 Subject: [llvm-commits] [llvm] r107637 - /llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Message-ID: <20100706035343.9686F2A6C12C@llvm.org> Author: nicholas Date: Mon Jul 5 22:53:43 2010 New Revision: 107637 URL: http://llvm.org/viewvc/llvm-project?rev=107637&view=rev Log: Detabify this file. Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=107637&r1=107636&r2=107637&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Mon Jul 5 22:53:43 2010 @@ -279,7 +279,7 @@ // Verify the "strcmp" function prototype. const FunctionType *FT = Callee->getFunctionType(); if (FT->getNumParams() != 2 || - !FT->getReturnType()->isIntegerTy(32) || + !FT->getReturnType()->isIntegerTy(32) || FT->getParamType(0) != FT->getParamType(1) || FT->getParamType(0) != Type::getInt8PtrTy(*Context)) return 0; @@ -327,7 +327,7 @@ // Verify the "strncmp" function prototype. const FunctionType *FT = Callee->getFunctionType(); if (FT->getNumParams() != 3 || - !FT->getReturnType()->isIntegerTy(32) || + !FT->getReturnType()->isIntegerTy(32) || FT->getParamType(0) != FT->getParamType(1) || FT->getParamType(0) != Type::getInt8PtrTy(*Context) || !FT->getParamType(2)->isIntegerTy()) @@ -682,7 +682,7 @@ // memset(p, v, n) -> llvm.memset(p, v, n, 1) Value *Val = B.CreateIntCast(CI->getArgOperand(1), Type::getInt8Ty(*Context), - false); + false); EmitMemSet(CI->getArgOperand(0), Val, CI->getArgOperand(2), false, B, TD); return CI->getArgOperand(0); } @@ -766,11 +766,11 @@ if (SIToFPInst *OpC = dyn_cast(Op)) { if (OpC->getOperand(0)->getType()->getPrimitiveSizeInBits() <= 32) LdExpArg = B.CreateSExt(OpC->getOperand(0), - Type::getInt32Ty(*Context), "tmp"); + Type::getInt32Ty(*Context), "tmp"); } else if (UIToFPInst *OpC = dyn_cast(Op)) { if (OpC->getOperand(0)->getType()->getPrimitiveSizeInBits() < 32) LdExpArg = B.CreateZExt(OpC->getOperand(0), - Type::getInt32Ty(*Context), "tmp"); + Type::getInt32Ty(*Context), "tmp"); } if (LdExpArg) { @@ -836,7 +836,7 @@ // Just make sure this has 2 arguments of the same FP type, which match the // result type. if (FT->getNumParams() != 1 || - !FT->getReturnType()->isIntegerTy(32) || + !FT->getReturnType()->isIntegerTy(32) || !FT->getParamType(0)->isIntegerTy()) return 0; @@ -860,7 +860,7 @@ Value *Cond = B.CreateICmpNE(Op, Constant::getNullValue(ArgType), "tmp"); return B.CreateSelect(Cond, V, - ConstantInt::get(Type::getInt32Ty(*Context), 0)); + ConstantInt::get(Type::getInt32Ty(*Context), 0)); } }; From nicholas at mxc.ca Mon Jul 5 23:33:31 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 05 Jul 2010 21:33:31 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute Message-ID: <4C32B21B.7070304@mxc.ca> The attached patch adds a function attribute, "halting", which models the assertion that a function does not have the side-effect of looping indefinitely. This is for llvm.org/PR965 * modifies the asm printer and parser, LangRef and VMCore to support the new bit * all intrinsics are marked with 'halting' as they are with 'nounwind' * the -simplify-libcalls pass now marks certain (non-I/O) library functions as being halting * a new pass named HaltingAttr is added to mark up functions with the halting attribute. If necessary, it queries SCEV for an upper bound on the loop trip count. It is not an SCC pass. * Instruction::mayHaveSideEffects considers not halting to be a side-effect * Instruction::isSafeToSpeculativelyExecute will now return true for some call instructions (only for intrinsics marked 'readnone nounwind halting'). LLVM was audited to make sure this was safe, the only change made for it is in lib/Transforms/Scalar/Sink.cpp. Please review! Nick -------------- next part -------------- A non-text attachment was scrubbed... Name: halting-1.patch Type: text/x-patch Size: 37162 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100705/2a72acd8/attachment.bin From echristo at apple.com Tue Jul 6 00:18:56 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 06 Jul 2010 05:18:56 -0000 Subject: [llvm-commits] [llvm] r107640 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/StackProtector.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h test/CodeGen/Generic/stack-protector.ll test/CodeGen/PowerPC/stack-protector.ll test/CodeGen/X86/stack-protector-linux.ll test/CodeGen/X86/stack-protector.ll Message-ID: <20100706051856.7B0902A6C12C@llvm.org> Author: echristo Date: Tue Jul 6 00:18:56 2010 New Revision: 107640 URL: http://llvm.org/viewvc/llvm-project?rev=107640&view=rev Log: Fix up -fstack-protector on linux to use the segment registers. Split out testcases per architecture and os now. Patch from Nelson Elhage. Added: llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll llvm/trunk/test/CodeGen/X86/stack-protector.ll Removed: llvm/trunk/test/CodeGen/Generic/stack-protector.ll Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/StackProtector.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107640&r1=107639&r2=107640&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Tue Jul 6 00:18:56 2010 @@ -749,6 +749,14 @@ /// getFunctionAlignment - Return the Log2 alignment of this function. virtual unsigned getFunctionAlignment(const Function *) const = 0; + /// getStackCookieLocation - Return true if the target stores stack + /// protector cookies at a fixed offset in some non-standard address + /// space, and populates the address space and offset as + /// appropriate. + virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const { + return false; + } + //===--------------------------------------------------------------------===// // TargetLowering Optimization Methods // Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=107640&r1=107639&r2=107640&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Jul 6 00:18:56 2010 @@ -136,7 +136,7 @@ bool StackProtector::InsertStackProtectors() { BasicBlock *FailBB = 0; // The basic block to jump to if check fails. AllocaInst *AI = 0; // Place on stack that stores the stack guard. - Constant *StackGuardVar = 0; // The stack guard variable. + Value *StackGuardVar = 0; // The stack guard variable. for (Function::iterator I = F->begin(), E = F->end(); I != E; ) { BasicBlock *BB = I++; @@ -155,7 +155,20 @@ // PointerType *PtrTy = PointerType::getUnqual( Type::getInt8Ty(RI->getContext())); - StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); + + unsigned AddressSpace, Offset; + if (TLI->getStackCookieLocation(AddressSpace, Offset)) { + Constant *ASPtr = Constant::getNullValue( + PointerType::get(Type::getInt8Ty(RI->getContext()), AddressSpace)); + APInt OffsetInt(32, Offset); + Constant *OffsetVal = Constant::getIntegerValue( + Type::getInt32Ty(RI->getContext()), OffsetInt); + StackGuardVar = ConstantExpr::getPointerCast( + ConstantExpr::getGetElementPtr(ASPtr, &OffsetVal, 1), + PointerType::get(PtrTy, AddressSpace)); + } else { + StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); + } BasicBlock &Entry = F->getEntryBlock(); Instruction *InsPt = &Entry.front(); Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107640&r1=107639&r2=107640&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 00:18:56 2010 @@ -1189,6 +1189,27 @@ return F->hasFnAttr(Attribute::OptimizeForSize) ? 0 : 4; } +bool X86TargetLowering::getStackCookieLocation(unsigned &AddressSpace, + unsigned &Offset) const { + if (!Subtarget->isTargetLinux()) + return false; + + if (Subtarget->is64Bit()) { + // %fs:0x28, unless we're using a Kernel code model, in which case it's %gs: + Offset = 0x28; + if (getTargetMachine().getCodeModel() == CodeModel::Kernel) + AddressSpace = 256; + else + AddressSpace = 257; + } else { + // %gs:0x14 on i386 + Offset = 0x14; + AddressSpace = 256; + } + return true; +} + + //===----------------------------------------------------------------------===// // Return Value Calling Convention Implementation //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107640&r1=107639&r2=107640&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Jul 6 00:18:56 2010 @@ -593,6 +593,12 @@ /// getFunctionAlignment - Return the Log2 alignment of this function. virtual unsigned getFunctionAlignment(const Function *F) const; + /// getStackCookieLocation - Return true if the target stores stack + /// protector cookies at a fixed offset in some non-standard address + /// space, and populates the address space and offset as + /// appropriate. + virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const; + private: /// Subtarget - Keep a pointer to the X86Subtarget around so that we can /// make the right decision when generating code for different targets. Removed: llvm/trunk/test/CodeGen/Generic/stack-protector.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/stack-protector.ll?rev=107639&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/stack-protector.ll (original) +++ llvm/trunk/test/CodeGen/Generic/stack-protector.ll (removed) @@ -1,25 +0,0 @@ -; RUN: llc < %s -o - | grep {__stack_chk_guard} -; RUN: llc < %s -o - | grep {__stack_chk_fail} - -@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] - -define void @test(i8* %a) nounwind ssp { -entry: - %a_addr = alloca i8* ; [#uses=2] - %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - store i8* %a, i8** %a_addr - %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] - %0 = load i8** %a_addr, align 4 ; [#uses=1] - %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] - %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] - %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] - br label %return - -return: ; preds = %entry - ret void -} - -declare i8* @strcpy(i8*, i8*) nounwind - -declare i32 @printf(i8*, ...) nounwind Added: llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll?rev=107640&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll Tue Jul 6 00:18:56 2010 @@ -0,0 +1,25 @@ +; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_guard} +; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_fail} + +@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] + +define void @test(i8* %a) nounwind ssp { +entry: + %a_addr = alloca i8* ; [#uses=2] + %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i8* %a, i8** %a_addr + %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] + %0 = load i8** %a_addr, align 4 ; [#uses=1] + %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] + %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +declare i8* @strcpy(i8*, i8*) nounwind + +declare i32 @printf(i8*, ...) nounwind Added: llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll?rev=107640&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll (added) +++ llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll Tue Jul 6 00:18:56 2010 @@ -0,0 +1,28 @@ +; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | grep %gs: +; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %fs: +; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %gs: +; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_guard} +; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_fail} + +@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] + +define void @test(i8* %a) nounwind ssp { +entry: + %a_addr = alloca i8* ; [#uses=2] + %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i8* %a, i8** %a_addr + %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] + %0 = load i8** %a_addr, align 4 ; [#uses=1] + %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] + %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +declare i8* @strcpy(i8*, i8*) nounwind + +declare i32 @printf(i8*, ...) nounwind Added: llvm/trunk/test/CodeGen/X86/stack-protector.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-protector.ll?rev=107640&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/stack-protector.ll (added) +++ llvm/trunk/test/CodeGen/X86/stack-protector.ll Tue Jul 6 00:18:56 2010 @@ -0,0 +1,25 @@ +; RUN: llc -march=x86 < %s -o - | grep {__stack_chk_guard} +; RUN: llc -march=x86 < %s -o - | grep {__stack_chk_fail} + +@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] + +define void @test(i8* %a) nounwind ssp { +entry: + %a_addr = alloca i8* ; [#uses=2] + %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i8* %a, i8** %a_addr + %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] + %0 = load i8** %a_addr, align 4 ; [#uses=1] + %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] + %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +declare i8* @strcpy(i8*, i8*) nounwind + +declare i32 @printf(i8*, ...) nounwind From echristo at apple.com Tue Jul 6 00:20:13 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 06 Jul 2010 05:20:13 -0000 Subject: [llvm-commits] [llvm] r107641 - /llvm/trunk/test/CodeGen/X86/stack-protector.ll Message-ID: <20100706052013.6C5382A6C12C@llvm.org> Author: echristo Date: Tue Jul 6 00:20:13 2010 New Revision: 107641 URL: http://llvm.org/viewvc/llvm-project?rev=107641&view=rev Log: Remove mistakenly added test. Removed: llvm/trunk/test/CodeGen/X86/stack-protector.ll Removed: llvm/trunk/test/CodeGen/X86/stack-protector.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-protector.ll?rev=107640&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/stack-protector.ll (original) +++ llvm/trunk/test/CodeGen/X86/stack-protector.ll (removed) @@ -1,25 +0,0 @@ -; RUN: llc -march=x86 < %s -o - | grep {__stack_chk_guard} -; RUN: llc -march=x86 < %s -o - | grep {__stack_chk_fail} - -@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] - -define void @test(i8* %a) nounwind ssp { -entry: - %a_addr = alloca i8* ; [#uses=2] - %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - store i8* %a, i8** %a_addr - %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] - %0 = load i8** %a_addr, align 4 ; [#uses=1] - %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] - %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] - %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] - br label %return - -return: ; preds = %entry - ret void -} - -declare i8* @strcpy(i8*, i8*) nounwind - -declare i32 @printf(i8*, ...) nounwind From echristo at apple.com Tue Jul 6 00:21:05 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 5 Jul 2010 22:21:05 -0700 Subject: [llvm-commits] [patch] Fix PR5094: -fstack-protector fails to link on Linux/x86 In-Reply-To: <87mxu5s8i9.fsf@mit.edu> References: <201006190247.o5J2lCxL009172@outgoing.mit.edu> <87wrt9ssrh.fsf@mit.edu> <9396FE2A-1D59-4AAC-A5A8-F10DB3FA34FF@apple.com> <2CA575D8-6B79-4509-8A10-390F87D7891B@apple.com> <87sk3xso1j.fsf@mit.edu> <5BF2853E-0F4D-47C4-AA9A-787A847DD64A@apple.com> <70578487-0E58-4075-8319-0B0A73182A4A@apple.com> <87pqz1sf34.fsf@mit.edu> <6CFF3139-F42B-4CFE-9763-5C4E96F4C16F@apple.com> <756AF35D-ECB0-43C7-A05F-7405C537705C@apple.com> <87mxu5s8i9.fsf@mit.edu> Message-ID: <2738C67C-D310-4847-AE4A-8B543AC7D9D0@apple.com> On Jul 5, 2010, at 6:29 PM, Nelson Elhage wrote: > FileCheck didn't seem to be necessary for these tests; Did you intend > that I check something more complex than the simple grep's that were > already there? > > Committed as r107640, the tests still need to be FileCheck'ized and I haven't done that yet. -eric From anton at korobeynikov.info Tue Jul 6 03:41:20 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 6 Jul 2010 12:41:20 +0400 Subject: [llvm-commits] [llvm] r107625 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h In-Reply-To: References: <20100705192633.7AFDF2A6C12C@llvm.org> <1A201091-31E0-4BA8-A89A-6AF04B9EBDD2@apple.com> Message-ID: > Try this llvm-gcc patch for now. ?It seems to output what it should. Seems to work for me, thanks alot! -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Tue Jul 6 03:48:30 2010 From: baldrick at free.fr (Duncan Sands) Date: Tue, 06 Jul 2010 10:48:30 +0200 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <4C32B21B.7070304@mxc.ca> References: <4C32B21B.7070304@mxc.ca> Message-ID: <4C32EDDE.50600@free.fr> Hi Nick, > The attached patch adds a function attribute, "halting", which models > the assertion that a function does not have the side-effect of looping > indefinitely. This is for llvm.org/PR965 yay! > +
halting
> +
This attribute specifies that the function may be assumed to halt. This > + does not necessarily imply that it will return (it may terminate the > + program instead), -> This does not necessarily imply that it will return, since terminating the program and unwinding an exception are also considered halting. Also, I think here you should end this sentence, and the following should be a new sentence: but the attribute may be applied for any language where > + infinite loops are not considered a visible side-effect. -> A function that loops forever is not halting. However languages where infinite loops are not considered a visible side-effect can indicate this by applying the halting attribute to such functions anyway. A loop is known > + to be halting only if an upper limit on iterations is known before the > + loop begins.
This sounds like an implementation detail - should it be here? > - } else if (Name == "uname" || > - Name == "unlink" || > + } else if (Name == "uname") { > + if (FTy->getNumParams() != 1 || > + !FTy->getParamType(0)->isPointerTy()) > + continue; > + setIsHalting(F); strange indentation. > + // Definitions with weak linkage may be overridden at linktime with > + // something that writes memory, so treat them like declarations. -> something that infinite loops, so treat them like declarations. Otherwise looks good to me. Ciao, Duncan. From ggreif at gmail.com Tue Jul 6 04:15:29 2010 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 6 Jul 2010 02:15:29 -0700 (PDT) Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <4C32EDDE.50600@free.fr> References: <4C32B21B.7070304@mxc.ca> <4C32EDDE.50600@free.fr> Message-ID: <314922bf-822f-4d88-a2c4-772d1bd1e264@j4g2000yqh.googlegroups.com> On Jul 6, 10:48?am, Duncan Sands wrote: > Hi Nick, > > > The attached patch adds a function attribute, "halting", which models > > the assertion that a function does not have the side-effect of looping > > indefinitely. This is for llvm.org/PR965 Hi Nick, Duncan, I assume by "looping" you also mean (mutually) recursive tail-calling without ever returning? What about recursive non-tail calling without return? This will exhaust the stack and probably terminate then. Does "halting" cover this situation? Just my 2 cents! Gabor > > yay! > > > + ?
halting
> > + ?
This attribute specifies that the function may be assumed to halt. ?This > > + ? ? ?does not necessarily imply that it will return (it may terminate the > > + ? ? ?program instead), > > -> This does not necessarily imply that it will return, since terminating the > program and unwinding an exception are also considered halting. > > Also, I think here you should end this sentence, and the following should be a > new sentence: > > but the attribute may be applied for any language where > > > + ? ? ?infinite loops are not considered a visible side-effect. > > -> A function that loops forever is not halting. ?However languages where > infinite loops are not considered a visible side-effect can indicate this > by applying the halting attribute to such functions anyway. > > A loop is known > > > + ? ? ?to be halting only if an upper limit on iterations is known before the > > + ? ? ?loop begins.
> > This sounds like an implementation detail - should it be here? > > > - ? ? ? ?} else if (Name == "uname" || > > - ? ? ? ? ? ? ? ? ? Name == "unlink" || > > + ? ? ? ?} else if (Name == "uname") { > > + ? ? ? ? ?if (FTy->getNumParams() != 1 || > > + ? ? ? ? ? ? ?!FTy->getParamType(0)->isPointerTy()) > > + ? ? ? ? ? ?continue; > > + ? ?setIsHalting(F); > > strange indentation. > > > + ?// Definitions with weak linkage may be overridden at linktime with > > + ?// something that writes memory, so treat them like declarations. > > -> something that infinite loops, so treat them like declarations. > > Otherwise looks good to me. > > Ciao, > > Duncan. > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Tue Jul 6 04:29:51 2010 From: baldrick at free.fr (Duncan Sands) Date: Tue, 06 Jul 2010 11:29:51 +0200 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <314922bf-822f-4d88-a2c4-772d1bd1e264@j4g2000yqh.googlegroups.com> References: <4C32B21B.7070304@mxc.ca> <4C32EDDE.50600@free.fr> <314922bf-822f-4d88-a2c4-772d1bd1e264@j4g2000yqh.googlegroups.com> Message-ID: <4C32F78F.7090207@free.fr> Hi Gabor, >>> The attached patch adds a function attribute, "halting", which models >>> the assertion that a function does not have the side-effect of looping >>> indefinitely. This is for llvm.org/PR965 > > Hi Nick, Duncan, > > I assume by "looping" you also mean (mutually) recursive > tail-calling without ever returning? from my reading of the transform, such a function will not be assigned the halting attribute (just like a function that contains an infinite loop). > What about recursive non-tail calling without return? This > will exhaust the stack and probably terminate then. Does > "halting" cover this situation? Likewise. Ciao, Duncan. From gohman at apple.com Tue Jul 6 10:18:19 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:18:19 -0000 Subject: [llvm-commits] [llvm] r107655 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <20100706151820.2CD122A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:18:19 2010 New Revision: 107655 URL: http://llvm.org/viewvc/llvm-project?rev=107655&view=rev Log: Fix a bunch of custom-inserter functions to handle the case where the pseudo instruction is not at the end of the block. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Tue Jul 6 10:18:19 2010 @@ -259,6 +259,11 @@ /// machine basic block (i.e., copies all the successors fromMBB and /// remove all the successors from fromMBB). void transferSuccessors(MachineBasicBlock *fromMBB); + + /// transferSuccessorsAndUpdatePHIs - Transfers all the successors, as + /// in transferSuccessors, and update PHI operands in the successor blocks + /// which refer to fromMBB to refer to this. + void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB); /// isSuccessor - Return true if the specified MBB is a successor of this /// block. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Tue Jul 6 10:18:19 2010 @@ -335,12 +335,32 @@ if (this == fromMBB) return; - for (MachineBasicBlock::succ_iterator I = fromMBB->succ_begin(), - E = fromMBB->succ_end(); I != E; ++I) - addSuccessor(*I); + while (!fromMBB->succ_empty()) { + MachineBasicBlock *Succ = *fromMBB->succ_begin(); + addSuccessor(Succ); + fromMBB->removeSuccessor(Succ); + } +} + +void +MachineBasicBlock::transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB) { + if (this == fromMBB) + return; - while (!fromMBB->succ_empty()) - fromMBB->removeSuccessor(fromMBB->succ_begin()); + while (!fromMBB->succ_empty()) { + MachineBasicBlock *Succ = *fromMBB->succ_begin(); + addSuccessor(Succ); + fromMBB->removeSuccessor(Succ); + + // Fix up any PHI nodes in the successor. + for (MachineBasicBlock::iterator MI = Succ->begin(), ME = Succ->end(); + MI != ME && MI->isPHI(); ++MI) + for (unsigned i = 2, e = MI->getNumOperands()+1; i != e; i += 2) { + MachineOperand &MO = MI->getOperand(i); + if (MO.getMBB() == fromMBB) + MO.setMBB(this); + } + } } bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const { Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -3637,7 +3637,12 @@ MF->insert(It, loop1MBB); MF->insert(It, loop2MBB); MF->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + + // Transfer the remainder of BB and its successor edges to exitMBB. + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); // thisMBB: // ... @@ -3675,7 +3680,7 @@ // ... BB = exitMBB; - MF->DeleteMachineInstr(MI); // The instruction is gone now. + MI->eraseFromParent(); // The instruction is gone now. return BB; } @@ -3718,7 +3723,12 @@ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB); MF->insert(It, loopMBB); MF->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + + // Transfer the remainder of BB and its successor edges to exitMBB. + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = MF->getRegInfo(); unsigned scratch = RegInfo.createVirtualRegister(ARM::GPRRegisterClass); @@ -3763,7 +3773,7 @@ // ... BB = exitMBB; - MF->DeleteMachineInstr(MI); // The instruction is gone now. + MI->eraseFromParent(); // The instruction is gone now. return BB; } @@ -3848,22 +3858,21 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, dl, TII->get(ARM::tBcc)).addMBB(sinkMBB) - .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg()); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII->get(ARM::tBcc)).addMBB(sinkMBB) + .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg()); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -3876,11 +3885,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII->get(ARM::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII->get(ARM::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } @@ -3901,7 +3911,7 @@ const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(SrcReg); unsigned CopyOpc = (RC == ARM::tGPRRegisterClass) ? ARM::tMOVtgpr2gpr : ARM::tMOVgpr2gpr; - BuildMI(BB, dl, TII->get(CopyOpc), ARM::SP) + BuildMI(*BB, MI, dl, TII->get(CopyOpc), ARM::SP) .addReg(SrcReg, getKillRegState(SrcIsKill)); } @@ -3933,7 +3943,7 @@ NeedPred = true; NeedCC = true; NeedOp3 = true; break; } - MachineInstrBuilder MIB = BuildMI(BB, dl, TII->get(OpOpc), ARM::SP); + MachineInstrBuilder MIB = BuildMI(*BB, MI, dl, TII->get(OpOpc), ARM::SP); if (OpOpc == ARM::tAND) AddDefaultT1CC(MIB); MIB.addReg(ARM::SP); @@ -3949,10 +3959,10 @@ const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(DstReg); unsigned CopyOpc = (RC == ARM::tGPRRegisterClass) ? ARM::tMOVgpr2tgpr : ARM::tMOVgpr2gpr; - BuildMI(BB, dl, TII->get(CopyOpc)) + BuildMI(*BB, MI, dl, TII->get(CopyOpc)) .addReg(DstReg, getDefRegState(true) | getDeadRegState(DstIsDead)) .addReg(ARM::SP); - MF->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } } Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -863,7 +863,10 @@ MachineBasicBlock *llscMBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - sinkMBB->transferSuccessors(thisMBB); + sinkMBB->splice(sinkMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(MI)), + thisMBB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(thisMBB); F->insert(It, llscMBB); F->insert(It, sinkMBB); @@ -912,7 +915,7 @@ thisMBB->addSuccessor(llscMBB); llscMBB->addSuccessor(llscMBB); llscMBB->addSuccessor(sinkMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return sinkMBB; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -234,6 +234,24 @@ MachineRegisterInfo &R = F->getRegInfo(); MachineBasicBlock *loop = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *finish = F->CreateMachineBasicBlock(LLVM_BB); + F->insert(It, loop); + F->insert(It, finish); + + // Update machine-CFG edges by transfering adding all successors and + // remaining instructions from the current block to the new block which + // will contain the Phi node for the select. + finish->splice(finish->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + finish->transferSuccessorsAndUpdatePHIs(BB); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(loop); + BB->addSuccessor(finish); + + // Next, add the finish block as a successor of the loop block + loop->addSuccessor(finish); + loop->addSuccessor(loop); unsigned IAMT = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); BuildMI(BB, dl, TII->get(MBlaze::ANDI), IAMT) @@ -249,26 +267,6 @@ .addReg(IAMT) .addMBB(finish); - F->insert(It, loop); - F->insert(It, finish); - - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - finish->addSuccessor(*i); - - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - BB->addSuccessor(loop); - BB->addSuccessor(finish); - - // Next, add the finish block as a successor of the loop block - loop->addSuccessor(finish); - loop->addSuccessor(loop); - unsigned DST = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); unsigned NDST = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); BuildMI(loop, dl, TII->get(MBlaze::PHI), DST) @@ -298,12 +296,13 @@ .addReg(NAMT) .addMBB(loop); - BuildMI(finish, dl, TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) + BuildMI(*finish, finish->begin(), dl, + TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) .addReg(IVAL).addMBB(BB) .addReg(NDST).addMBB(loop); // The pseudo instruction is no longer needed so remove it - F->DeleteMachineInstr(MI); + MI->eraseFromParent(); return finish; } @@ -338,27 +337,23 @@ case MBlazeCC::LE: Opc = MBlaze::BGTID; break; } - BuildMI(BB, dl, TII->get(Opc)) - .addReg(MI->getOperand(3).getReg()) - .addMBB(dneBB); - F->insert(It, flsBB); F->insert(It, dneBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - dneBB->addSuccessor(*i); - - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + // Transfer the remainder of BB and its successor edges to dneBB. + dneBB->splice(dneBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + dneBB->transferSuccessorsAndUpdatePHIs(BB); + BB->addSuccessor(flsBB); BB->addSuccessor(dneBB); flsBB->addSuccessor(dneBB); + BuildMI(BB, dl, TII->get(Opc)) + .addReg(MI->getOperand(3).getReg()) + .addMBB(dneBB); + // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... @@ -366,11 +361,12 @@ // .addReg(MI->getOperand(1).getReg()).addMBB(flsBB) // .addReg(MI->getOperand(2).getReg()).addMBB(BB); - BuildMI(dneBB, dl, TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) + BuildMI(*dneBB, dneBB->begin(), dl, + TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(flsBB) .addReg(MI->getOperand(1).getReg()).addMBB(BB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return dneBB; } } Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -1070,7 +1070,10 @@ // Update machine-CFG edges by transferring all successors of the current // block to the block containing instructions after shift. - RemBB->transferSuccessors(BB); + RemBB->splice(RemBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + RemBB->transferSuccessorsAndUpdatePHIs(BB); // Add adges BB => LoopBB => RemBB, BB => RemBB, LoopBB => LoopBB BB->addSuccessor(LoopBB); @@ -1116,11 +1119,11 @@ // RemBB: // DestReg = phi [%SrcReg, BB], [%ShiftReg, LoopBB] - BuildMI(RemBB, dl, TII.get(MSP430::PHI), DstReg) + BuildMI(*RemBB, RemBB->begin(), dl, TII.get(MSP430::PHI), DstReg) .addReg(SrcReg).addMBB(BB) .addReg(ShiftReg2).addMBB(LoopBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return RemBB; } @@ -1158,18 +1161,22 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *copy1MBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, dl, TII.get(MSP430::JCC)) - .addMBB(copy1MBB) - .addImm(MI->getOperand(3).getImm()); F->insert(I, copy0MBB); F->insert(I, copy1MBB); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. - copy1MBB->transferSuccessors(BB); + copy1MBB->splice(copy1MBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + copy1MBB->transferSuccessorsAndUpdatePHIs(BB); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(copy1MBB); + BuildMI(BB, dl, TII.get(MSP430::JCC)) + .addMBB(copy1MBB) + .addImm(MI->getOperand(3).getImm()); + // copy0MBB: // %FalseValue = ... // # fallthrough to copy1MBB @@ -1182,11 +1189,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = copy1MBB; - BuildMI(BB, dl, TII.get(MSP430::PHI), + BuildMI(*BB, BB->begin(), dl, TII.get(MSP430::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -284,6 +284,18 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + F->insert(It, copy0MBB); + F->insert(It, sinkMBB); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + + // Next, add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); // Emit the right instruction according to the type of the operands compared if (isFPCmp) { @@ -296,20 +308,6 @@ BuildMI(BB, dl, TII->get(Mips::BNE)).addReg(MI->getOperand(1).getReg()) .addReg(Mips::ZERO).addMBB(sinkMBB); - F->insert(It, copy0MBB); - F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - sinkMBB->addSuccessor(*i); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -322,11 +320,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII->get(Mips::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII->get(Mips::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(3).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } } Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -1928,15 +1928,12 @@ F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); @@ -1953,11 +1950,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII.get(PIC16::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII.get(PIC16::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -4513,7 +4513,10 @@ MachineBasicBlock *exitMBB = F->CreateMachineBasicBlock(LLVM_BB); F->insert(It, loopMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); unsigned TmpReg = (!BinOpcode) ? incr : @@ -4578,7 +4581,10 @@ MachineBasicBlock *exitMBB = F->CreateMachineBasicBlock(LLVM_BB); F->insert(It, loopMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = @@ -4711,23 +4717,22 @@ MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); unsigned SelectPred = MI->getOperand(4).getImm(); DebugLoc dl = MI->getDebugLoc(); - BuildMI(BB, dl, TII->get(PPC::BCC)) - .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII->get(PPC::BCC)) + .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -4740,7 +4745,8 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII->get(PPC::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII->get(PPC::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); } @@ -4826,7 +4832,10 @@ F->insert(It, loop2MBB); F->insert(It, midMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); // thisMBB: // ... @@ -4894,7 +4903,10 @@ F->insert(It, loop2MBB); F->insert(It, midMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = @@ -5020,7 +5032,7 @@ llvm_unreachable("Unexpected instr type to insert"); } - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -1007,21 +1007,20 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII.get(BROpcode)).addMBB(sinkMBB).addImm(CC); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - // Next, add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); // copy0MBB: // %FalseValue = ... @@ -1035,11 +1034,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII.get(SP::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, TII.get(SP::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -827,16 +827,20 @@ MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *copy1MBB = F->CreateMachineBasicBlock(LLVM_BB); SystemZCC::CondCodes CC = (SystemZCC::CondCodes)MI->getOperand(3).getImm(); - BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); F->insert(I, copy0MBB); F->insert(I, copy1MBB); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. - copy1MBB->transferSuccessors(BB); + copy1MBB->splice(copy1MBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + copy1MBB->transferSuccessorsAndUpdatePHIs(BB); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(copy1MBB); + BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to copy1MBB @@ -849,11 +853,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = copy1MBB; - BuildMI(BB, dl, TII.get(SystemZ::PHI), + BuildMI(*BB, BB->begin(), dl, TII.get(SystemZ::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -8023,8 +8023,11 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Move all successors to thisMBB to nextMBB - nextMBB->transferSuccessors(thisMBB); + // Transfer the remainder of thisMBB and its successor edges to nextMBB. + nextMBB->splice(nextMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(bInstr)), + thisMBB->end()); + nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8087,7 +8090,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - F->DeleteMachineInstr(bInstr); // The pseudo instruction is gone now. + bInstr->eraseFromParent(); // The pseudo instruction is gone now. return nextMBB; } @@ -8132,8 +8135,11 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Move all successors to thisMBB to nextMBB - nextMBB->transferSuccessors(thisMBB); + // Transfer the remainder of thisMBB and its successor edges to nextMBB. + nextMBB->splice(nextMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(bInstr)), + thisMBB->end()); + nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8250,7 +8256,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - F->DeleteMachineInstr(bInstr); // The pseudo instruction is gone now. + bInstr->eraseFromParent(); // The pseudo instruction is gone now. return nextMBB; } @@ -8284,8 +8290,11 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Move all successors of thisMBB to nextMBB - nextMBB->transferSuccessors(thisMBB); + // Transfer the remainder of thisMBB and its successor edges to nextMBB. + nextMBB->splice(nextMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(mInstr)), + thisMBB->end()); + nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8353,7 +8362,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - F->DeleteMachineInstr(mInstr); // The pseudo instruction is gone now. + mInstr->eraseFromParent(); // The pseudo instruction is gone now. return nextMBB; } @@ -8363,7 +8372,6 @@ X86TargetLowering::EmitPCMP(MachineInstr *MI, MachineBasicBlock *BB, unsigned numArgs, bool memArg) const { - MachineFunction *F = BB->getParent(); DebugLoc dl = MI->getDebugLoc(); const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); @@ -8385,7 +8393,7 @@ BuildMI(BB, dl, TII->get(X86::MOVAPSrr), MI->getOperand(0).getReg()) .addReg(X86::XMM0); - F->DeleteMachineInstr(MI); + MI->eraseFromParent(); return BB; } @@ -8414,9 +8422,12 @@ F->insert(MBBIter, XMMSaveMBB); F->insert(MBBIter, EndMBB); - // Set up the CFG. - // Move any original successors of MBB to the end block. - EndMBB->transferSuccessors(MBB); + // Transfer the remainder of MBB and its successor edges to EndMBB. + EndMBB->splice(EndMBB->begin(), MBB, + llvm::next(MachineBasicBlock::iterator(MI)), + MBB->end()); + EndMBB->transferSuccessorsAndUpdatePHIs(MBB); + // The original block will now fall through to the XMM save block. MBB->addSuccessor(XMMSaveMBB); // The XMMSaveMBB will fall through to the end block. @@ -8455,7 +8466,7 @@ .addMemOperand(MMO); } - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return EndMBB; } @@ -8484,37 +8495,17 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - unsigned Opc = - X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); - - BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - - // Add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - // If the EFLAGS register isn't dead in the terminator, then claim that it's // live into the sink and copy blocks. const MachineFunction *MF = BB->getParent(); const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo(); BitVector ReservedRegs = TRI->getReservedRegs(*MF); - const MachineInstr *Term = BB->getFirstTerminator(); - for (unsigned I = 0, E = Term->getNumOperands(); I != E; ++I) { - const MachineOperand &MO = Term->getOperand(I); + for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) { + const MachineOperand &MO = MI->getOperand(I); if (!MO.isReg() || MO.isKill() || MO.isDead()) continue; unsigned Reg = MO.getReg(); if (Reg != X86::EFLAGS) continue; @@ -8522,6 +8513,21 @@ sinkMBB->addLiveIn(Reg); } + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + + // Create the conditional branch instruction. + unsigned Opc = + X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); + BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -8530,11 +8536,12 @@ // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... - BuildMI(sinkMBB, DL, TII->get(X86::PHI), MI->getOperand(0).getReg()) + BuildMI(*sinkMBB, sinkMBB->begin(), DL, + TII->get(X86::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return sinkMBB; } @@ -8543,21 +8550,20 @@ MachineBasicBlock *BB) const { const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); DebugLoc DL = MI->getDebugLoc(); - MachineFunction *F = BB->getParent(); // The lowering is pretty easy: we're just emitting the call to _alloca. The // non-trivial part is impdef of ESP. // FIXME: The code should be tweaked as soon as we'll try to do codegen for // mingw-w64. - BuildMI(BB, DL, TII->get(X86::CALLpcrel32)) + BuildMI(*BB, MI, DL, TII->get(X86::CALLpcrel32)) .addExternalSymbol("_alloca") .addReg(X86::EAX, RegState::Implicit) .addReg(X86::ESP, RegState::Implicit) .addReg(X86::EAX, RegState::Define | RegState::Implicit) .addReg(X86::ESP, RegState::Define | RegState::Implicit); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } @@ -8576,35 +8582,38 @@ assert(MI->getOperand(3).isGlobal() && "This should be a global"); if (Subtarget->is64Bit()) { - MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV64rm), X86::RDI) + MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, + TII->get(X86::MOV64rm), X86::RDI) .addReg(X86::RIP) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(BB, DL, TII->get(X86::CALL64m)); + MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL64m)); addDirectMem(MIB, X86::RDI).addReg(0); } else if (getTargetMachine().getRelocationModel() != Reloc::PIC_) { - MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV32rm), X86::EAX) + MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, + TII->get(X86::MOV32rm), X86::EAX) .addReg(0) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(BB, DL, TII->get(X86::CALL32m)); + MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL32m)); addDirectMem(MIB, X86::EAX).addReg(0); } else { - MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV32rm), X86::EAX) + MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, + TII->get(X86::MOV32rm), X86::EAX) .addReg(TII->getGlobalBaseReg(F)) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(BB, DL, TII->get(X86::CALL32m)); + MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL32m)); addDirectMem(MIB, X86::EAX).addReg(0); } - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } @@ -8648,23 +8657,25 @@ // mode when truncating to an integer value. MachineFunction *F = BB->getParent(); int CWFrameIdx = F->getFrameInfo()->CreateStackObject(2, 2, false); - addFrameReference(BuildMI(BB, DL, TII->get(X86::FNSTCW16m)), CWFrameIdx); + addFrameReference(BuildMI(*BB, MI, DL, + TII->get(X86::FNSTCW16m)), CWFrameIdx); // Load the old value of the high byte of the control word... unsigned OldCW = F->getRegInfo().createVirtualRegister(X86::GR16RegisterClass); - addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16rm), OldCW), + addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16rm), OldCW), CWFrameIdx); // Set the high part to be round to zero... - addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16mi)), CWFrameIdx) + addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16mi)), CWFrameIdx) .addImm(0xC7F); // Reload the modified control word now... - addFrameReference(BuildMI(BB, DL, TII->get(X86::FLDCW16m)), CWFrameIdx); + addFrameReference(BuildMI(*BB, MI, DL, + TII->get(X86::FLDCW16m)), CWFrameIdx); // Restore the memory image of control word to original value - addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16mr)), CWFrameIdx) + addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16mr)), CWFrameIdx) .addReg(OldCW); // Get the X86 opcode to use. @@ -8703,13 +8714,14 @@ } else { AM.Disp = Op.getImm(); } - addFullAddress(BuildMI(BB, DL, TII->get(Opc)), AM) + addFullAddress(BuildMI(*BB, MI, DL, TII->get(Opc)), AM) .addReg(MI->getOperand(X86AddrNumOperands).getReg()); // Reload the original control word now. - addFrameReference(BuildMI(BB, DL, TII->get(X86::FLDCW16m)), CWFrameIdx); + addFrameReference(BuildMI(*BB, MI, DL, + TII->get(X86::FLDCW16m)), CWFrameIdx); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } // String/text processing lowering. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue Jul 6 10:18:19 2010 @@ -173,14 +173,14 @@ // Install an instruction selector. PM.add(createX86ISelDag(*this, OptLevel)); - // Install a pass to insert x87 FP_REG_KILL instructions, as needed. - PM.add(createX87FPRegKillInserterPass()); - return false; } bool X86TargetMachine::addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { + // Install a pass to insert x87 FP_REG_KILL instructions, as needed. + PM.add(createX87FPRegKillInserterPass()); + PM.add(createX86MaxStackAlignmentHeuristicPass()); return false; // -print-machineinstr shouldn't print after this. } Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107655&r1=107654&r2=107655&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Tue Jul 6 10:18:19 2010 @@ -1221,23 +1221,22 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, dl, TII.get(XCore::BRFT_lru6)) - .addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII.get(XCore::BRFT_lru6)) + .addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -1250,11 +1249,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII.get(XCore::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII.get(XCore::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } From gohman at apple.com Tue Jul 6 10:21:57 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:21:57 -0000 Subject: [llvm-commits] [llvm] r107656 - /llvm/trunk/lib/Analysis/Lint.cpp Message-ID: <20100706152157.818842A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:21:57 2010 New Revision: 107656 URL: http://llvm.org/viewvc/llvm-project?rev=107656&view=rev Log: Add a comment. Modified: llvm/trunk/lib/Analysis/Lint.cpp Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=107656&r1=107655&r2=107656&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Jul 6 10:21:57 2010 @@ -19,7 +19,8 @@ // // Another limitation is that it assumes all code will be executed. A store // through a null pointer in a basic block which is never reached is harmless, -// but this pass will warn about it anyway. +// but this pass will warn about it anyway. This is the main reason why most +// of these checks live here instead of in the Verifier pass. // // Optimization passes may make conditions that this pass checks for more or // less obvious. If an optimization pass appears to be introducing a warning, From gohman at apple.com Tue Jul 6 10:23:00 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:23:00 -0000 Subject: [llvm-commits] [llvm] r107657 - /llvm/trunk/lib/Analysis/Lint.cpp Message-ID: <20100706152300.635CA2A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:23:00 2010 New Revision: 107657 URL: http://llvm.org/viewvc/llvm-project?rev=107657&view=rev Log: Add some more TODO comments. Modified: llvm/trunk/lib/Analysis/Lint.cpp Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=107657&r1=107656&r2=107657&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Jul 6 10:23:00 2010 @@ -201,6 +201,8 @@ // fairly common mistake to neglect to name a function. Assert1(F.hasName() || F.hasLocalLinkage(), "Unusual: Unnamed function with non-local linkage", &F); + + // TODO: Check for irreducible control flow. } void Lint::visitCallSite(CallSite CS) { @@ -224,6 +226,7 @@ "argument count", &I); // Check argument types (in case the callee was casted) and attributes. + // TODO: Verify that caller and callee attributes are compatible. Function::arg_iterator PI = F->arg_begin(), PE = F->arg_end(); CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); for (; AI != AE; ++AI) { @@ -361,6 +364,7 @@ } // TODO: Check that the reference is in bounds. +// TODO: Check readnone/readonly function attributes. void Lint::visitMemoryReference(Instruction &I, Value *Ptr, unsigned Size, unsigned Align, const Type *Ty, unsigned Flags) { @@ -501,6 +505,8 @@ // This isn't undefined behavior, it's just an obvious pessimization. Assert1(&I.getParent()->getParent()->getEntryBlock() == I.getParent(), "Pessimization: Static alloca outside of entry block", &I); + + // TODO: Check for an unusual size (MSB set?) } void Lint::visitVAArgInst(VAArgInst &I) { From asl at math.spbu.ru Tue Jul 6 10:24:56 2010 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 06 Jul 2010 15:24:56 -0000 Subject: [llvm-commits] [llvm] r107658 - /llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Message-ID: <20100706152456.E0D9F2A6C12C@llvm.org> Author: asl Date: Tue Jul 6 10:24:56 2010 New Revision: 107658 URL: http://llvm.org/viewvc/llvm-project?rev=107658&view=rev Log: Fix a major regression on COFF targets introduced by r103267: 'discardable' section means that it is used only during the program load and can be discarded afterwards. This way *only* debug sections can be discarded, but not the opposite. Seems like the copy-and-pasto from ELF code, since there it contains the reverse flag ('alloc'). Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=107658&r1=107657&r2=107658&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Tue Jul 6 10:24:56 2010 @@ -936,7 +936,7 @@ getCOFFSectionFlags(SectionKind K) { unsigned Flags = 0; - if (!K.isMetadata()) + if (K.isMetadata()) Flags |= COFF::IMAGE_SCN_MEM_DISCARDABLE; else if (K.isText()) From gohman at apple.com Tue Jul 6 10:26:33 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:26:33 -0000 Subject: [llvm-commits] [llvm] r107659 - in /llvm/trunk/docs: GetElementPtr.html LangRef.html Message-ID: <20100706152634.32EC42A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:26:33 2010 New Revision: 107659 URL: http://llvm.org/viewvc/llvm-project?rev=107659&view=rev Log: Note the relationship between C99 restrict and LLVM noalias, and clarify a few other things. Modified: llvm/trunk/docs/GetElementPtr.html llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/GetElementPtr.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GetElementPtr.html?rev=107659&r1=107658&r2=107659&view=diff ============================================================================== --- llvm/trunk/docs/GetElementPtr.html (original) +++ llvm/trunk/docs/GetElementPtr.html Tue Jul 6 10:26:33 2010 @@ -64,7 +64,8 @@

This document seeks to dispel the mystery and confusion surrounding LLVM's - GetElementPtr (GEP) instruction. Questions about the wily GEP instruction are + GetElementPtr (GEP) instruction. + Questions about the wily GEP instruction are probably the most frequently occurring questions once a developer gets down to coding with LLVM. Here we lay out the sources of confusion and show that the GEP instruction is really quite simple. @@ -653,7 +654,8 @@

  • Support C, C-like languages, and languages which can be conceptually lowered into C (this covers a lot).
  • Support optimizations such as those that are common in - C compilers.
  • + C compilers. In particular, GEP is a cornerstone of LLVM's + pointer aliasing model.
  • Provide a consistent method for computing addresses so that address computations don't need to be a part of load and store instructions in the IR.
  • Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=107659&r1=107658&r2=107659&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 6 10:26:33 2010 @@ -1062,7 +1062,15 @@ The caller shares the responsibility with the callee for ensuring that these requirements are met. For further details, please see the discussion of the NoAlias response in - alias analysis. + alias analysis.
    +
    + Note that this definition of noalias is intentionally + similar to the definition of restrict in C99 for function + arguments, thought it is slightly weaker. +
    + For function return values, C99's restrict is not meaningful, + while LLVM's noalias is. +
    nocapture
    This indicates that the callee does not make any copies of the pointer @@ -2397,7 +2405,8 @@
  • An instruction with externally visible side effects depends on the most recent preceding instruction with externally visible side effects, following - the order in the IR. (This includes volatile loads and stores.)
  • + the order in the IR. (This includes + volatile operations.)
  • An instruction control-depends on a terminator instruction From gohman at apple.com Tue Jul 6 10:31:55 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:31:55 -0000 Subject: [llvm-commits] [llvm] r107660 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/Target/TargetRegisterInfo.cpp Message-ID: <20100706153155.8A9C22A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:31:55 2010 New Revision: 107660 URL: http://llvm.org/viewvc/llvm-project?rev=107660&view=rev Log: Make getMinimalPhysRegClass' comment mention what makes it different from getPhysicalRegisterRegClass. Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/lib/Target/TargetRegisterInfo.cpp Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=107660&r1=107659&r2=107660&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Tue Jul 6 10:31:55 2010 @@ -320,7 +320,8 @@ getPhysicalRegisterRegClass(unsigned Reg, EVT VT = MVT::Other) const; /// getMinimalPhysRegClass - Returns the Register Class of a physical - /// register of the given type. + /// register of the given type, picking the most sub register class of + /// the right type that contains this physreg. const TargetRegisterClass * getMinimalPhysRegClass(unsigned Reg, EVT VT = MVT::Other) const; Modified: llvm/trunk/lib/Target/TargetRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetRegisterInfo.cpp?rev=107660&r1=107659&r2=107660&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/TargetRegisterInfo.cpp Tue Jul 6 10:31:55 2010 @@ -61,7 +61,8 @@ } /// getMinimalPhysRegClass - Returns the Register Class of a physical -/// register of the given type. +/// register of the given type, picking the most sub register class of +/// the right type that contains this physreg. const TargetRegisterClass * TargetRegisterInfo::getMinimalPhysRegClass(unsigned reg, EVT VT) const { assert(isPhysicalRegister(reg) && "reg must be a physical register"); From gohman at apple.com Tue Jul 6 10:35:07 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:35:07 -0000 Subject: [llvm-commits] [llvm] r107661 - /llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Message-ID: <20100706153507.210D92A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:35:06 2010 New Revision: 107661 URL: http://llvm.org/viewvc/llvm-project?rev=107661&view=rev Log: Add a new CCValAssign LocInfo value, and a comment explaining what it should be used for. Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107661&r1=107660&r2=107661&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Tue Jul 6 10:35:06 2010 @@ -35,6 +35,9 @@ ZExt, // The value is zero extended in the location. AExt, // The value is extended with undefined upper bits. BCvt, // The value is bit-converted in the location. + VExt, // The value is vector-widened in the location. + // FIXME: Not implemented yet. Code that uses AExt to mean + // vector-widen should be fixed to use VExt instead. Indirect // The location contains pointer to the value. // TODO: a subset of the value is in the location. }; From gohman at apple.com Tue Jul 6 10:39:54 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:39:54 -0000 Subject: [llvm-commits] [llvm] r107666 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/CallingConvLower.cpp Message-ID: <20100706153954.E33152A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:39:54 2010 New Revision: 107666 URL: http://llvm.org/viewvc/llvm-project?rev=107666&view=rev Log: Add versions of OutputArgReg, AnalyzeReturn, and AnalyzeCallOperands which do not depend on SelectionDAG. Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107666&r1=107665&r2=107666&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Tue Jul 6 10:39:54 2010 @@ -185,6 +185,8 @@ /// incorporating info about the result values into this state. void AnalyzeReturn(const SmallVectorImpl &Outs, CCAssignFn Fn); + void AnalyzeReturn(const SmallVectorImpl &Outs, + CCAssignFn Fn); /// CheckReturn - Analyze the return values of a function, returning /// true if the return can be performed without sret-demotion, and @@ -197,6 +199,8 @@ /// incorporating info about the passed values into this state. void AnalyzeCallOperands(const SmallVectorImpl &Outs, CCAssignFn Fn); + void AnalyzeCallOperands(const SmallVectorImpl &Outs, + CCAssignFn Fn); /// AnalyzeCallOperands - Same as above except it takes vectors of types /// and argument flags. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=107666&r1=107665&r2=107666&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Jul 6 10:39:54 2010 @@ -1583,6 +1583,23 @@ "OutputArg value type must be Simple!"); } }; + + /// OutputArgReg - This struct carries flags and a register value for a + /// single outgoing (actual) argument or outgoing (from the perspective + /// of the caller) return value virtual register. + /// + struct OutputArgReg { + ArgFlagsTy Flags; + EVT VT; + unsigned Reg; + + /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". + bool IsFixed; + + OutputArgReg() : IsFixed(false) {} + OutputArgReg(ISD::ArgFlagsTy flags, EVT vt, unsigned reg, bool isfixed) + : Flags(flags), VT(vt), Reg(reg), IsFixed(isfixed) {} + }; } /// VTSDNode - This class is used to represent EVT's, which are used Modified: llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp?rev=107666&r1=107665&r2=107666&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp Tue Jul 6 10:39:54 2010 @@ -111,6 +111,22 @@ } } +void CCState::AnalyzeReturn(const SmallVectorImpl &Outs, + CCAssignFn Fn) { + // Determine which register each value should be copied into. + for (unsigned i = 0, e = Outs.size(); i != e; ++i) { + EVT VT = Outs[i].VT; + ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; + if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) { +#ifndef NDEBUG + dbgs() << "Return operand #" << i << " has unhandled type " + << VT.getEVTString(); +#endif + llvm_unreachable(0); + } + } +} + /// AnalyzeCallOperands - Analyze the outgoing arguments to a call, /// incorporating info about the passed values into this state. @@ -130,6 +146,25 @@ } } +/// AnalyzeCallOperands - Analyze the outgoing arguments to a call, +/// incorporating info about the passed values into this state. +void +CCState::AnalyzeCallOperands(const SmallVectorImpl &Outs, + CCAssignFn Fn) { + unsigned NumOps = Outs.size(); + for (unsigned i = 0; i != NumOps; ++i) { + EVT ArgVT = Outs[i].VT; + ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; + if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { +#ifndef NDEBUG + dbgs() << "Call operand #" << i << " has unhandled type " + << ArgVT.getEVTString(); +#endif + llvm_unreachable(0); + } + } +} + /// AnalyzeCallOperands - Same as above except it takes vectors of types /// and argument flags. void CCState::AnalyzeCallOperands(SmallVectorImpl &ArgVTs, From ggreif at gmail.com Tue Jul 6 10:44:11 2010 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 06 Jul 2010 15:44:11 -0000 Subject: [llvm-commits] [llvm] r107667 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <20100706154411.CC51C2A6C12C@llvm.org> Author: ggreif Date: Tue Jul 6 10:44:11 2010 New Revision: 107667 URL: http://llvm.org/viewvc/llvm-project?rev=107667&view=rev Log: second round of low-level interface squeeze-out: making all of CallInst's low-level operand accessors private If you get compile errors I strongly urge you to update your code. I tried to write the necessary clues into the header where the compiler may point to, but no guarantees. It works for my GCC. You have several options to update your code: - you can use the v2.8 ArgOperand accessors - you can go via a temporary CallSite - you can upcast to, say, User and call its low-level accessors if your code is definitely operand-order agnostic. If you run into serious problems, please comment in below thread (and back out this revision only if absolutely necessary): 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=107667&r1=107666&r2=107667&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue Jul 6 10:44:11 2010 @@ -940,8 +940,25 @@ unsigned(isTC)); } + /// @deprecated these "define hacks" will go away soon + /// @brief coerce out-of-tree code to abandon the low-level interfaces + /// @detail see below comments and update your code to high-level interfaces + /// in LLVM v2.8-only code + /// - getOperand(N+1) ---> getArgOperand(N) + /// - setOperand(N+1, V) ---> setArgOperand(N, V) + /// - getNumOperands() ---> getNumArgOperands()+1 // note the "+1"! + /// + /// in backward compatible code please consult llvm/Support/CallSite.h, + /// you should create a callsite using the CallInst pointer and call its + /// methods + /// +# define public private +# define protected private /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); +# undef public +# undef protected +public: enum { ArgOffset = 1 }; ///< temporary, do not use for new code! unsigned getNumArgOperands() const { return getNumOperands() - 1; } @@ -951,11 +968,12 @@ /// Provide compile-time errors for accessing operand 0 /// @deprecated these will go away soon /// @detail see below comments and update your code to high-level interfaces - /// - getOperand(0) ---> getCalledValue() + /// - getOperand(0) ---> getCalledValue(), or possibly getCalledFunction /// - setOperand(0, V) ---> setCalledFunction(V) /// private: - void getOperand(void*); // NO IMPL ---> use getCalledValue (or possibly getCalledFunction) instead + void getOperand(void*); // NO IMPL ---> use getCalledValue (or possibly + // getCalledFunction) instead void setOperand(void*, Value*); // NO IMPL ---> use setCalledFunction instead public: @@ -1103,6 +1121,10 @@ typename std::iterator_traits::iterator_category()); } + +// Note: if you get compile errors about private methods then +// please update your code to use the high-level operand +// interfaces. See line 943 above. DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CallInst, Value) //===----------------------------------------------------------------------===// From gohman at apple.com Tue Jul 6 10:49:49 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 15:49:49 -0000 Subject: [llvm-commits] [llvm] r107668 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <20100706154949.877042A6C12C@llvm.org> Author: djg Date: Tue Jul 6 10:49:48 2010 New Revision: 107668 URL: http://llvm.org/viewvc/llvm-project?rev=107668&view=rev Log: Revert r107655. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Tue Jul 6 10:49:48 2010 @@ -259,11 +259,6 @@ /// machine basic block (i.e., copies all the successors fromMBB and /// remove all the successors from fromMBB). void transferSuccessors(MachineBasicBlock *fromMBB); - - /// transferSuccessorsAndUpdatePHIs - Transfers all the successors, as - /// in transferSuccessors, and update PHI operands in the successor blocks - /// which refer to fromMBB to refer to this. - void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB); /// isSuccessor - Return true if the specified MBB is a successor of this /// block. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Tue Jul 6 10:49:48 2010 @@ -335,32 +335,12 @@ if (this == fromMBB) return; - while (!fromMBB->succ_empty()) { - MachineBasicBlock *Succ = *fromMBB->succ_begin(); - addSuccessor(Succ); - fromMBB->removeSuccessor(Succ); - } -} - -void -MachineBasicBlock::transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB) { - if (this == fromMBB) - return; + for (MachineBasicBlock::succ_iterator I = fromMBB->succ_begin(), + E = fromMBB->succ_end(); I != E; ++I) + addSuccessor(*I); - while (!fromMBB->succ_empty()) { - MachineBasicBlock *Succ = *fromMBB->succ_begin(); - addSuccessor(Succ); - fromMBB->removeSuccessor(Succ); - - // Fix up any PHI nodes in the successor. - for (MachineBasicBlock::iterator MI = Succ->begin(), ME = Succ->end(); - MI != ME && MI->isPHI(); ++MI) - for (unsigned i = 2, e = MI->getNumOperands()+1; i != e; i += 2) { - MachineOperand &MO = MI->getOperand(i); - if (MO.getMBB() == fromMBB) - MO.setMBB(this); - } - } + while (!fromMBB->succ_empty()) + fromMBB->removeSuccessor(fromMBB->succ_begin()); } bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const { Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -3637,12 +3637,7 @@ MF->insert(It, loop1MBB); MF->insert(It, loop2MBB); MF->insert(It, exitMBB); - - // Transfer the remainder of BB and its successor edges to exitMBB. - exitMBB->splice(exitMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - exitMBB->transferSuccessorsAndUpdatePHIs(BB); + exitMBB->transferSuccessors(BB); // thisMBB: // ... @@ -3680,7 +3675,7 @@ // ... BB = exitMBB; - MI->eraseFromParent(); // The instruction is gone now. + MF->DeleteMachineInstr(MI); // The instruction is gone now. return BB; } @@ -3723,12 +3718,7 @@ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB); MF->insert(It, loopMBB); MF->insert(It, exitMBB); - - // Transfer the remainder of BB and its successor edges to exitMBB. - exitMBB->splice(exitMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - exitMBB->transferSuccessorsAndUpdatePHIs(BB); + exitMBB->transferSuccessors(BB); MachineRegisterInfo &RegInfo = MF->getRegInfo(); unsigned scratch = RegInfo.createVirtualRegister(ARM::GPRRegisterClass); @@ -3773,7 +3763,7 @@ // ... BB = exitMBB; - MI->eraseFromParent(); // The instruction is gone now. + MF->DeleteMachineInstr(MI); // The instruction is gone now. return BB; } @@ -3858,21 +3848,22 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + BuildMI(BB, dl, TII->get(ARM::tBcc)).addMBB(sinkMBB) + .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg()); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) + sinkMBB->addSuccessor(*I); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while (!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); - BuildMI(BB, dl, TII->get(ARM::tBcc)).addMBB(sinkMBB) - .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg()); - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -3885,12 +3876,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(*BB, BB->begin(), dl, - TII->get(ARM::PHI), MI->getOperand(0).getReg()) + BuildMI(BB, dl, TII->get(ARM::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } @@ -3911,7 +3901,7 @@ const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(SrcReg); unsigned CopyOpc = (RC == ARM::tGPRRegisterClass) ? ARM::tMOVtgpr2gpr : ARM::tMOVgpr2gpr; - BuildMI(*BB, MI, dl, TII->get(CopyOpc), ARM::SP) + BuildMI(BB, dl, TII->get(CopyOpc), ARM::SP) .addReg(SrcReg, getKillRegState(SrcIsKill)); } @@ -3943,7 +3933,7 @@ NeedPred = true; NeedCC = true; NeedOp3 = true; break; } - MachineInstrBuilder MIB = BuildMI(*BB, MI, dl, TII->get(OpOpc), ARM::SP); + MachineInstrBuilder MIB = BuildMI(BB, dl, TII->get(OpOpc), ARM::SP); if (OpOpc == ARM::tAND) AddDefaultT1CC(MIB); MIB.addReg(ARM::SP); @@ -3959,10 +3949,10 @@ const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(DstReg); unsigned CopyOpc = (RC == ARM::tGPRRegisterClass) ? ARM::tMOVgpr2tgpr : ARM::tMOVgpr2gpr; - BuildMI(*BB, MI, dl, TII->get(CopyOpc)) + BuildMI(BB, dl, TII->get(CopyOpc)) .addReg(DstReg, getDefRegState(true) | getDeadRegState(DstIsDead)) .addReg(ARM::SP); - MI->eraseFromParent(); // The pseudo instruction is gone now. + MF->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } } Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -863,10 +863,7 @@ MachineBasicBlock *llscMBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - sinkMBB->splice(sinkMBB->begin(), thisMBB, - llvm::next(MachineBasicBlock::iterator(MI)), - thisMBB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(thisMBB); + sinkMBB->transferSuccessors(thisMBB); F->insert(It, llscMBB); F->insert(It, sinkMBB); @@ -915,7 +912,7 @@ thisMBB->addSuccessor(llscMBB); llscMBB->addSuccessor(llscMBB); llscMBB->addSuccessor(sinkMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return sinkMBB; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -234,24 +234,6 @@ MachineRegisterInfo &R = F->getRegInfo(); MachineBasicBlock *loop = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *finish = F->CreateMachineBasicBlock(LLVM_BB); - F->insert(It, loop); - F->insert(It, finish); - - // Update machine-CFG edges by transfering adding all successors and - // remaining instructions from the current block to the new block which - // will contain the Phi node for the select. - finish->splice(finish->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - finish->transferSuccessorsAndUpdatePHIs(BB); - - // Add the true and fallthrough blocks as its successors. - BB->addSuccessor(loop); - BB->addSuccessor(finish); - - // Next, add the finish block as a successor of the loop block - loop->addSuccessor(finish); - loop->addSuccessor(loop); unsigned IAMT = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); BuildMI(BB, dl, TII->get(MBlaze::ANDI), IAMT) @@ -267,6 +249,26 @@ .addReg(IAMT) .addMBB(finish); + F->insert(It, loop); + F->insert(It, finish); + + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), + e = BB->succ_end(); i != e; ++i) + finish->addSuccessor(*i); + + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while(!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); + BB->addSuccessor(loop); + BB->addSuccessor(finish); + + // Next, add the finish block as a successor of the loop block + loop->addSuccessor(finish); + loop->addSuccessor(loop); + unsigned DST = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); unsigned NDST = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); BuildMI(loop, dl, TII->get(MBlaze::PHI), DST) @@ -296,13 +298,12 @@ .addReg(NAMT) .addMBB(loop); - BuildMI(*finish, finish->begin(), dl, - TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) + BuildMI(finish, dl, TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) .addReg(IVAL).addMBB(BB) .addReg(NDST).addMBB(loop); // The pseudo instruction is no longer needed so remove it - MI->eraseFromParent(); + F->DeleteMachineInstr(MI); return finish; } @@ -337,23 +338,27 @@ case MBlazeCC::LE: Opc = MBlaze::BGTID; break; } + BuildMI(BB, dl, TII->get(Opc)) + .addReg(MI->getOperand(3).getReg()) + .addMBB(dneBB); + F->insert(It, flsBB); F->insert(It, dneBB); - // Transfer the remainder of BB and its successor edges to dneBB. - dneBB->splice(dneBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - dneBB->transferSuccessorsAndUpdatePHIs(BB); - + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), + e = BB->succ_end(); i != e; ++i) + dneBB->addSuccessor(*i); + + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while(!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); BB->addSuccessor(flsBB); BB->addSuccessor(dneBB); flsBB->addSuccessor(dneBB); - BuildMI(BB, dl, TII->get(Opc)) - .addReg(MI->getOperand(3).getReg()) - .addMBB(dneBB); - // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... @@ -361,12 +366,11 @@ // .addReg(MI->getOperand(1).getReg()).addMBB(flsBB) // .addReg(MI->getOperand(2).getReg()).addMBB(BB); - BuildMI(*dneBB, dneBB->begin(), dl, - TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) + BuildMI(dneBB, dl, TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(flsBB) .addReg(MI->getOperand(1).getReg()).addMBB(BB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return dneBB; } } Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -1070,10 +1070,7 @@ // Update machine-CFG edges by transferring all successors of the current // block to the block containing instructions after shift. - RemBB->splice(RemBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - RemBB->transferSuccessorsAndUpdatePHIs(BB); + RemBB->transferSuccessors(BB); // Add adges BB => LoopBB => RemBB, BB => RemBB, LoopBB => LoopBB BB->addSuccessor(LoopBB); @@ -1119,11 +1116,11 @@ // RemBB: // DestReg = phi [%SrcReg, BB], [%ShiftReg, LoopBB] - BuildMI(*RemBB, RemBB->begin(), dl, TII.get(MSP430::PHI), DstReg) + BuildMI(RemBB, dl, TII.get(MSP430::PHI), DstReg) .addReg(SrcReg).addMBB(BB) .addReg(ShiftReg2).addMBB(LoopBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return RemBB; } @@ -1161,22 +1158,18 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *copy1MBB = F->CreateMachineBasicBlock(LLVM_BB); + BuildMI(BB, dl, TII.get(MSP430::JCC)) + .addMBB(copy1MBB) + .addImm(MI->getOperand(3).getImm()); F->insert(I, copy0MBB); F->insert(I, copy1MBB); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. - copy1MBB->splice(copy1MBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - copy1MBB->transferSuccessorsAndUpdatePHIs(BB); + copy1MBB->transferSuccessors(BB); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(copy1MBB); - BuildMI(BB, dl, TII.get(MSP430::JCC)) - .addMBB(copy1MBB) - .addImm(MI->getOperand(3).getImm()); - // copy0MBB: // %FalseValue = ... // # fallthrough to copy1MBB @@ -1189,11 +1182,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = copy1MBB; - BuildMI(*BB, BB->begin(), dl, TII.get(MSP430::PHI), + BuildMI(BB, dl, TII.get(MSP430::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -284,18 +284,6 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - F->insert(It, copy0MBB); - F->insert(It, sinkMBB); - - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - - // Next, add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); // Emit the right instruction according to the type of the operands compared if (isFPCmp) { @@ -308,6 +296,20 @@ BuildMI(BB, dl, TII->get(Mips::BNE)).addReg(MI->getOperand(1).getReg()) .addReg(Mips::ZERO).addMBB(sinkMBB); + F->insert(It, copy0MBB); + F->insert(It, sinkMBB); + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), + e = BB->succ_end(); i != e; ++i) + sinkMBB->addSuccessor(*i); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while(!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -320,12 +322,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(*BB, BB->begin(), dl, - TII->get(Mips::PHI), MI->getOperand(0).getReg()) + BuildMI(BB, dl, TII->get(Mips::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(3).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } } Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -1928,12 +1928,15 @@ F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) + sinkMBB->addSuccessor(*I); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while (!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); @@ -1950,12 +1953,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(*BB, BB->begin(), dl, - TII.get(PIC16::PHI), MI->getOperand(0).getReg()) + BuildMI(BB, dl, TII.get(PIC16::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -4513,10 +4513,7 @@ MachineBasicBlock *exitMBB = F->CreateMachineBasicBlock(LLVM_BB); F->insert(It, loopMBB); F->insert(It, exitMBB); - exitMBB->splice(exitMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - exitMBB->transferSuccessorsAndUpdatePHIs(BB); + exitMBB->transferSuccessors(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); unsigned TmpReg = (!BinOpcode) ? incr : @@ -4581,10 +4578,7 @@ MachineBasicBlock *exitMBB = F->CreateMachineBasicBlock(LLVM_BB); F->insert(It, loopMBB); F->insert(It, exitMBB); - exitMBB->splice(exitMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - exitMBB->transferSuccessorsAndUpdatePHIs(BB); + exitMBB->transferSuccessors(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = @@ -4717,22 +4711,23 @@ MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); unsigned SelectPred = MI->getOperand(4).getImm(); DebugLoc dl = MI->getDebugLoc(); + BuildMI(BB, dl, TII->get(PPC::BCC)) + .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) + sinkMBB->addSuccessor(*I); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while (!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); - BuildMI(BB, dl, TII->get(PPC::BCC)) - .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -4745,8 +4740,7 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(*BB, BB->begin(), dl, - TII->get(PPC::PHI), MI->getOperand(0).getReg()) + BuildMI(BB, dl, TII->get(PPC::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); } @@ -4832,10 +4826,7 @@ F->insert(It, loop2MBB); F->insert(It, midMBB); F->insert(It, exitMBB); - exitMBB->splice(exitMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - exitMBB->transferSuccessorsAndUpdatePHIs(BB); + exitMBB->transferSuccessors(BB); // thisMBB: // ... @@ -4903,10 +4894,7 @@ F->insert(It, loop2MBB); F->insert(It, midMBB); F->insert(It, exitMBB); - exitMBB->splice(exitMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - exitMBB->transferSuccessorsAndUpdatePHIs(BB); + exitMBB->transferSuccessors(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = @@ -5032,7 +5020,7 @@ llvm_unreachable("Unexpected instr type to insert"); } - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -1007,20 +1007,21 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - - // Add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - BuildMI(BB, dl, TII.get(BROpcode)).addMBB(sinkMBB).addImm(CC); F->insert(It, copy0MBB); F->insert(It, sinkMBB); + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) + sinkMBB->addSuccessor(*I); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while (!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); + // Next, add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); // copy0MBB: // %FalseValue = ... @@ -1034,11 +1035,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(*BB, BB->begin(), dl, TII.get(SP::PHI), MI->getOperand(0).getReg()) + BuildMI(BB, dl, TII.get(SP::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -827,20 +827,16 @@ MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *copy1MBB = F->CreateMachineBasicBlock(LLVM_BB); SystemZCC::CondCodes CC = (SystemZCC::CondCodes)MI->getOperand(3).getImm(); + BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); F->insert(I, copy0MBB); F->insert(I, copy1MBB); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. - copy1MBB->splice(copy1MBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - copy1MBB->transferSuccessorsAndUpdatePHIs(BB); + copy1MBB->transferSuccessors(BB); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(copy1MBB); - BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); - // copy0MBB: // %FalseValue = ... // # fallthrough to copy1MBB @@ -853,11 +849,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = copy1MBB; - BuildMI(*BB, BB->begin(), dl, TII.get(SystemZ::PHI), + BuildMI(BB, dl, TII.get(SystemZ::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -8023,11 +8023,8 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Transfer the remainder of thisMBB and its successor edges to nextMBB. - nextMBB->splice(nextMBB->begin(), thisMBB, - llvm::next(MachineBasicBlock::iterator(bInstr)), - thisMBB->end()); - nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); + // Move all successors to thisMBB to nextMBB + nextMBB->transferSuccessors(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8090,7 +8087,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - bInstr->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(bInstr); // The pseudo instruction is gone now. return nextMBB; } @@ -8135,11 +8132,8 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Transfer the remainder of thisMBB and its successor edges to nextMBB. - nextMBB->splice(nextMBB->begin(), thisMBB, - llvm::next(MachineBasicBlock::iterator(bInstr)), - thisMBB->end()); - nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); + // Move all successors to thisMBB to nextMBB + nextMBB->transferSuccessors(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8256,7 +8250,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - bInstr->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(bInstr); // The pseudo instruction is gone now. return nextMBB; } @@ -8290,11 +8284,8 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Transfer the remainder of thisMBB and its successor edges to nextMBB. - nextMBB->splice(nextMBB->begin(), thisMBB, - llvm::next(MachineBasicBlock::iterator(mInstr)), - thisMBB->end()); - nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); + // Move all successors of thisMBB to nextMBB + nextMBB->transferSuccessors(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8362,7 +8353,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - mInstr->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(mInstr); // The pseudo instruction is gone now. return nextMBB; } @@ -8372,6 +8363,7 @@ X86TargetLowering::EmitPCMP(MachineInstr *MI, MachineBasicBlock *BB, unsigned numArgs, bool memArg) const { + MachineFunction *F = BB->getParent(); DebugLoc dl = MI->getDebugLoc(); const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); @@ -8393,7 +8385,7 @@ BuildMI(BB, dl, TII->get(X86::MOVAPSrr), MI->getOperand(0).getReg()) .addReg(X86::XMM0); - MI->eraseFromParent(); + F->DeleteMachineInstr(MI); return BB; } @@ -8422,12 +8414,9 @@ F->insert(MBBIter, XMMSaveMBB); F->insert(MBBIter, EndMBB); - // Transfer the remainder of MBB and its successor edges to EndMBB. - EndMBB->splice(EndMBB->begin(), MBB, - llvm::next(MachineBasicBlock::iterator(MI)), - MBB->end()); - EndMBB->transferSuccessorsAndUpdatePHIs(MBB); - + // Set up the CFG. + // Move any original successors of MBB to the end block. + EndMBB->transferSuccessors(MBB); // The original block will now fall through to the XMM save block. MBB->addSuccessor(XMMSaveMBB); // The XMMSaveMBB will fall through to the end block. @@ -8466,7 +8455,7 @@ .addMemOperand(MMO); } - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return EndMBB; } @@ -8495,17 +8484,37 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + unsigned Opc = + X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); + + BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) + sinkMBB->addSuccessor(*I); + + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while (!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + // If the EFLAGS register isn't dead in the terminator, then claim that it's // live into the sink and copy blocks. const MachineFunction *MF = BB->getParent(); const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo(); BitVector ReservedRegs = TRI->getReservedRegs(*MF); + const MachineInstr *Term = BB->getFirstTerminator(); - for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) { - const MachineOperand &MO = MI->getOperand(I); + for (unsigned I = 0, E = Term->getNumOperands(); I != E; ++I) { + const MachineOperand &MO = Term->getOperand(I); if (!MO.isReg() || MO.isKill() || MO.isDead()) continue; unsigned Reg = MO.getReg(); if (Reg != X86::EFLAGS) continue; @@ -8513,21 +8522,6 @@ sinkMBB->addLiveIn(Reg); } - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - - // Add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - - // Create the conditional branch instruction. - unsigned Opc = - X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); - BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -8536,12 +8530,11 @@ // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... - BuildMI(*sinkMBB, sinkMBB->begin(), DL, - TII->get(X86::PHI), MI->getOperand(0).getReg()) + BuildMI(sinkMBB, DL, TII->get(X86::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return sinkMBB; } @@ -8550,20 +8543,21 @@ MachineBasicBlock *BB) const { const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); DebugLoc DL = MI->getDebugLoc(); + MachineFunction *F = BB->getParent(); // The lowering is pretty easy: we're just emitting the call to _alloca. The // non-trivial part is impdef of ESP. // FIXME: The code should be tweaked as soon as we'll try to do codegen for // mingw-w64. - BuildMI(*BB, MI, DL, TII->get(X86::CALLpcrel32)) + BuildMI(BB, DL, TII->get(X86::CALLpcrel32)) .addExternalSymbol("_alloca") .addReg(X86::EAX, RegState::Implicit) .addReg(X86::ESP, RegState::Implicit) .addReg(X86::EAX, RegState::Define | RegState::Implicit) .addReg(X86::ESP, RegState::Define | RegState::Implicit); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } @@ -8582,38 +8576,35 @@ assert(MI->getOperand(3).isGlobal() && "This should be a global"); if (Subtarget->is64Bit()) { - MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, - TII->get(X86::MOV64rm), X86::RDI) + MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV64rm), X86::RDI) .addReg(X86::RIP) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL64m)); + MIB = BuildMI(BB, DL, TII->get(X86::CALL64m)); addDirectMem(MIB, X86::RDI).addReg(0); } else if (getTargetMachine().getRelocationModel() != Reloc::PIC_) { - MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, - TII->get(X86::MOV32rm), X86::EAX) + MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV32rm), X86::EAX) .addReg(0) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL32m)); + MIB = BuildMI(BB, DL, TII->get(X86::CALL32m)); addDirectMem(MIB, X86::EAX).addReg(0); } else { - MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, - TII->get(X86::MOV32rm), X86::EAX) + MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV32rm), X86::EAX) .addReg(TII->getGlobalBaseReg(F)) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL32m)); + MIB = BuildMI(BB, DL, TII->get(X86::CALL32m)); addDirectMem(MIB, X86::EAX).addReg(0); } - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } @@ -8657,25 +8648,23 @@ // mode when truncating to an integer value. MachineFunction *F = BB->getParent(); int CWFrameIdx = F->getFrameInfo()->CreateStackObject(2, 2, false); - addFrameReference(BuildMI(*BB, MI, DL, - TII->get(X86::FNSTCW16m)), CWFrameIdx); + addFrameReference(BuildMI(BB, DL, TII->get(X86::FNSTCW16m)), CWFrameIdx); // Load the old value of the high byte of the control word... unsigned OldCW = F->getRegInfo().createVirtualRegister(X86::GR16RegisterClass); - addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16rm), OldCW), + addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16rm), OldCW), CWFrameIdx); // Set the high part to be round to zero... - addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16mi)), CWFrameIdx) + addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16mi)), CWFrameIdx) .addImm(0xC7F); // Reload the modified control word now... - addFrameReference(BuildMI(*BB, MI, DL, - TII->get(X86::FLDCW16m)), CWFrameIdx); + addFrameReference(BuildMI(BB, DL, TII->get(X86::FLDCW16m)), CWFrameIdx); // Restore the memory image of control word to original value - addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16mr)), CWFrameIdx) + addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16mr)), CWFrameIdx) .addReg(OldCW); // Get the X86 opcode to use. @@ -8714,14 +8703,13 @@ } else { AM.Disp = Op.getImm(); } - addFullAddress(BuildMI(*BB, MI, DL, TII->get(Opc)), AM) + addFullAddress(BuildMI(BB, DL, TII->get(Opc)), AM) .addReg(MI->getOperand(X86AddrNumOperands).getReg()); // Reload the original control word now. - addFrameReference(BuildMI(*BB, MI, DL, - TII->get(X86::FLDCW16m)), CWFrameIdx); + addFrameReference(BuildMI(BB, DL, TII->get(X86::FLDCW16m)), CWFrameIdx); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } // String/text processing lowering. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue Jul 6 10:49:48 2010 @@ -173,14 +173,14 @@ // Install an instruction selector. PM.add(createX86ISelDag(*this, OptLevel)); + // Install a pass to insert x87 FP_REG_KILL instructions, as needed. + PM.add(createX87FPRegKillInserterPass()); + return false; } bool X86TargetMachine::addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { - // Install a pass to insert x87 FP_REG_KILL instructions, as needed. - PM.add(createX87FPRegKillInserterPass()); - PM.add(createX86MaxStackAlignmentHeuristicPass()); return false; // -print-machineinstr shouldn't print after this. } Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107668&r1=107667&r2=107668&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Tue Jul 6 10:49:48 2010 @@ -1221,22 +1221,23 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + BuildMI(BB, dl, TII.get(XCore::BRFT_lru6)) + .addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - - // Transfer the remainder of BB and its successor edges to sinkMBB. - sinkMBB->splice(sinkMBB->begin(), BB, - llvm::next(MachineBasicBlock::iterator(MI)), - BB->end()); - sinkMBB->transferSuccessorsAndUpdatePHIs(BB); - + // Update machine-CFG edges by first adding all successors of the current + // block to the new block which will contain the Phi node for the select. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) + sinkMBB->addSuccessor(*I); + // Next, remove all successors of the current block, and add the true + // and fallthrough blocks as its successors. + while (!BB->succ_empty()) + BB->removeSuccessor(BB->succ_begin()); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); - BuildMI(BB, dl, TII.get(XCore::BRFT_lru6)) - .addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -1249,12 +1250,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(*BB, BB->begin(), dl, - TII.get(XCore::PHI), MI->getOperand(0).getReg()) + BuildMI(BB, dl, TII.get(XCore::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - MI->eraseFromParent(); // The pseudo instruction is gone now. + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } From baldrick at free.fr Tue Jul 6 10:52:15 2010 From: baldrick at free.fr (Duncan Sands) Date: Tue, 06 Jul 2010 15:52:15 -0000 Subject: [llvm-commits] [llvm] r107669 - /llvm/trunk/docs/Passes.html Message-ID: <20100706155216.202C42A6C12C@llvm.org> Author: baldrick Date: Tue Jul 6 10:52:15 2010 New Revision: 107669 URL: http://llvm.org/viewvc/llvm-project?rev=107669&view=rev Log: Bring the list of passes and their descriptions up to date. Patch by Kenneth Hoste. Modified: llvm/trunk/docs/Passes.html Modified: llvm/trunk/docs/Passes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=107669&r1=107668&r2=107669&view=diff ============================================================================== --- llvm/trunk/docs/Passes.html (original) +++ llvm/trunk/docs/Passes.html Tue Jul 6 10:52:15 2010 @@ -27,7 +27,7 @@ my $o = $order{$1}; $o = "000" unless defined $o; push @x, "$o-$1$2\n"; - push @y, "$o $2\n"; + push @y, "$o -$1: $2\n"; } @x = map { s/^\d\d\d//; $_ } sort @x; @y = map { s/^\d\d\d//; $_ } sort @y; @@ -91,29 +91,46 @@ -dot-postdom-onlyPrint post dominator tree of function to 'dot' file (with no function bodies) -globalsmodref-aaSimple mod/ref analysis for globals -instcountCounts the various types of Instructions +-interprocedural-aa-evalExhaustive Interprocedural Alias Analysis Precision Evaluator +-interprocedural-basic-aaInterprocedural Basic Alias Analysis -intervalsInterval Partition Construction --loopsNatural Loop Construction +-iv-usersInduction Variable Users +-lazy-value-infoLazy Value Information Analysis +-ldaLoop Dependence Analysis +-libcall-aaLibCall Alias Analysis +-lintCheck for common errors in LLVM IR +-live-valuesValue Liveness Analysis +-loopsNatural Loop Information -memdepMemory Dependence Analysis +-module-debuginfoPrints module debug info metadata -no-aaNo Alias Analysis (always returns 'may' alias) -no-profileNo Profile Information +-pointertrackingTrack pointer bounds -postdomfrontierPost-Dominance Frontier Construction -postdomtreePost-Dominator Tree Construction -print-alias-setsAlias Set Printer -print-callgraphPrint a call graph -print-callgraph-sccsPrint SCCs of the Call Graph -print-cfg-sccsPrint SCCs of each function CFG +-print-dbginfoPrint debug info in human readable form +-print-dom-infoDominator Info Printer -print-externalfnconstantsPrint external fn callsites passed constants -print-functionPrint function to stderr -print-modulePrint module to stderr -print-used-typesFind Used Types +-profile-estimatorEstimate profiling information -profile-loaderLoad profile information from llvmprof.out +-profile-verifierVerify profiling information -scalar-evolutionScalar Evolution Analysis +-scev-aaScalarEvolution-based Alias Analysis -targetdataTarget Data Layout TRANSFORM PASSES OptionName +-abcdRemove redundant conditional branches -adceAggressive Dead Code Elimination +-always-inlineInliner for always_inline functions -argpromotionPromote 'by reference' arguments to scalars -block-placementProfile Guided Basic Block Placement -break-crit-edgesBreak critical edges in CFG @@ -125,16 +142,14 @@ -deadtypeelimDead Type Elimination -dieDead Instruction Elimination -dseDead Store Elimination +-functionattrsDeduce function attributes -globaldceDead Global Elimination -globaloptGlobal Variable Optimizer -gvnGlobal Value Numbering -indvarsCanonicalize Induction Variables -inlineFunction Integration/Inlining --insert-block-profilingInsert instrumentation for block profiling -insert-edge-profilingInsert instrumentation for edge profiling --insert-function-profilingInsert instrumentation for function profiling --insert-null-profiling-rsMeasure profiling framework overhead --insert-rs-profiling-frameworkInsert random sampling instrumentation framework +-insert-optimal-edge-profilingInsert optimal instrumentation for edge profiling -instcombineCombine redundant instructions -internalizeInternalize Global Symbols -ipconstpropInterprocedural constant propagation @@ -156,16 +171,27 @@ -lowerswitchLower SwitchInst's to branches -mem2regPromote Memory to Register -memcpyoptOptimize use of memcpy and friends +-mergefuncMerge Functions -mergereturnUnify function exit nodes +-partial-inlinerPartial Inliner +-partialspecializationPartial Specialization -prune-ehRemove unused exception handling info -reassociateReassociate expressions -reg2memDemote all values to stack slots -scalarreplScalar Replacement of Aggregates -sccpSparse Conditional Constant Propagation +-sinkCode Sinking -simplify-libcallsSimplify well-known library calls +-simplify-libcalls-halfpowrSimplify half_powr library calls -simplifycfgSimplify the CFG +-split-gepsSplit complex GEPs into simple GEPs +-ssiStatic Single Information Construction +-ssi-everythingStatic Single Information Construction (everything, intended for debugging) -stripStrip all symbols from a module +-strip-dead-debug-infoStrip debug info for unused symbols -strip-dead-prototypesRemove unused function declarations +-strip-debug-declareStrip all llvm.dbg.declare intrinsics +-strip-nondebugStrip all symbols, except dbg symbols, from a module -sretpromotionPromote sret arguments -tailcallelimTail Call Elimination -tailduplicateTail Duplication @@ -175,6 +201,7 @@ OptionName -deadarghaX0rDead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE) -extract-blocksExtract Basic Blocks From Module (for bugpoint use) +-instnamerAssign names to anonymous instructions -preverifyPreliminary module verification -verifyModule Verifier -view-cfgView CFG of function @@ -194,7 +221,7 @@

    This is a simple N^2 alias analysis accuracy evaluator. @@ -208,7 +235,7 @@

    @@ -220,7 +247,7 @@

    Yet to be written.

    @@ -228,7 +255,7 @@

    @@ -240,7 +267,7 @@

    @@ -251,7 +278,7 @@

    @@ -268,7 +295,7 @@

    @@ -279,7 +306,7 @@

    @@ -290,7 +317,7 @@

    @@ -302,7 +329,7 @@

    @@ -314,7 +341,7 @@

    @@ -327,7 +354,7 @@

    @@ -339,7 +366,7 @@

    @@ -353,7 +380,7 @@

    @@ -365,7 +392,7 @@

    @@ -379,7 +406,7 @@

    @@ -392,7 +419,7 @@

    @@ -402,7 +429,30 @@

    +
    +

    This pass implements a simple N^2 alias analysis accuracy evaluator. + Basically, for each function in the program, it simply queries to see how the + alias analysis implementation answers alias queries between each pair of + pointers in the function. +

    +
    + + + +
    +

    This pass defines the default implementation of the Alias Analysis interface + that simply implements a few identities (two different globals cannot alias, + etc), but otherwise does no analysis. +

    +
    + + +

    @@ -418,7 +468,80 @@

    +
    +

    Bookkeeping for "interesting" users of expressions computed from + induction variables.

    +
    + + + +
    +

    Interface for lazy computation of value constraint information.

    +
    + + + +
    +

    Loop dependence analysis framework, which is used to detect dependences in + memory accesses in loops.

    +
    + + + +
    +

    LibCall Alias Analysis.

    +
    + + + +
    +

    This pass statically checks for common and easily-identified constructs + which produce undefined or likely unintended behavior in LLVM IR.

    + +

    It is not a guarantee of correctness, in two ways. First, it isn't + comprehensive. There are checks which could be done statically which are + not yet implemented. Some of these are indicated by TODO comments, but + those aren't comprehensive either. Second, many conditions cannot be + checked statically. This pass does no dynamic instrumentation, so it + can't check for all possible problems.

    + +

    Another limitation is that it assumes all code will be executed. A store + through a null pointer in a basic block which is never reached is harmless, + but this pass will warn about it anyway.

    + +

    Optimization passes may make conditions that this pass checks for more or + less obvious. If an optimization pass appears to be introducing a warning, + it may be that the optimization pass is merely exposing an existing + condition in the code.

    + +

    This code may be run before instcombine. In many cases, instcombine checks + for the same kinds of things and turns instructions with undefined behavior + into unreachable (or equivalent). Because of this, this pass makes some + effort to look through bitcasts and so on. +

    +
    + + + +
    +

    LLVM IR Value liveness analysis pass.

    +
    + + +

    @@ -431,7 +554,7 @@

    @@ -444,7 +567,20 @@

    +
    +

    This pass decodes the debug info metadata in a module and prints in a + (sufficiently-prepared-) human-readable form. + + For example, run this pass from opt along with the -analyze option, and + it'll print to standard output. +

    +
    + + +

    @@ -456,7 +592,7 @@

    @@ -467,7 +603,16 @@

    +
    +

    Tracking of pointer bounds. +

    +
    + + +

    @@ -478,7 +623,7 @@

    @@ -489,7 +634,7 @@

    Yet to be written.

    @@ -497,7 +642,7 @@

    @@ -508,7 +653,7 @@

    @@ -519,7 +664,7 @@

    @@ -530,7 +675,31 @@

    +
    +

    Pass that prints instructions, and associated debug info: +

      + +
    • source/line/col information
    • +
    • original variable name
    • +
    • original type name
    • +
    + +

    +
    + + + +
    +

    Dominator Info Printer.

    +
    + + +

    @@ -543,7 +712,7 @@

    @@ -555,7 +724,7 @@

    @@ -565,7 +734,7 @@

    @@ -576,7 +745,17 @@

    +
    +

    Profiling information that estimates the profiling information + in a very crude and unimaginative way. +

    +
    + + +

    @@ -587,7 +766,15 @@

    +
    +

    Pass that checks profiling information for plausibility.

    +
    + + +

    @@ -606,7 +793,45 @@

    +
    +

    Simple alias analysis implemented in terms of ScalarEvolution queries. + + This differs from traditional loop dependence analysis in that it tests + for dependencies within a single iteration of a loop, rather than + dependencies between different iterations. + + ScalarEvolution has a more complete understanding of pointer arithmetic + than BasicAliasAnalysis' collection of ad-hoc analyses. +

    +
    + + + +
    +

    + performs code stripping. this transformation can delete: +

    + +
      +
    1. names for virtual registers
    2. +
    3. symbols for internal globals and functions
    4. +
    5. debug information
    6. +
    + +

    + note that this transformation makes code much less readable, so it should + only be used in situations where the strip utility would be used, + such as reducing code size or making it harder to reverse engineer code. +

    +
    + + +

    Provides other passes access to information on how the size and alignment @@ -621,7 +846,22 @@

    +
    +

    ABCD removes conditional branch instructions that can be proved redundant. + With the SSI representation, each variable has a constraint. By analyzing these + constraints we can prove that a branch is redundant. When a branch is proved + redundant it means that one direction will always be taken; thus, we can change + this branch into an unconditional jump.

    +

    It is advisable to run SimplifyCFG and + Aggressive Dead Code Elimination after ABCD + to clean up the code.

    +
    + + +

    ADCE aggressively tries to eliminate code. This pass is similar to @@ -632,7 +872,16 @@

    +
    +

    A custom inliner that handles only functions that are marked as + "always inline".

    +
    + + +

    @@ -663,7 +912,7 @@

    This pass is a very simple profile guided basic block placement algorithm. @@ -675,7 +924,7 @@

    @@ -688,7 +937,7 @@

    This pass munges the code in the input function to better prepare it for @@ -698,7 +947,7 @@

    @@ -711,7 +960,7 @@

    This file implements constant propagation and merging. It looks for @@ -727,7 +976,7 @@

    @@ -739,7 +988,7 @@

    @@ -757,7 +1006,7 @@

    @@ -769,7 +1018,7 @@

    @@ -780,7 +1029,7 @@

    @@ -791,7 +1040,22 @@

    +
    +

    A simple interprocedural pass which walks the call-graph, looking for + functions which do not access or only read non-local memory, and marking them + readnone/readonly. In addition, it marks function arguments (of pointer type) + 'nocapture' if a call to the function does not create any copies of the pointer + value that outlive the call. This more or less means that the pointer is only + dereferenced, and not returned from the function or stored in a global. + This pass is implemented as a bottom-up traversal of the call-graph. +

    +
    + + +

    @@ -805,7 +1069,7 @@

    @@ -817,7 +1081,7 @@

    @@ -826,10 +1090,9 @@

    -

    @@ -880,7 +1143,7 @@

    @@ -890,26 +1153,7 @@

    -
    -

    - This pass instruments the specified program with counters for basic block - profiling, which counts the number of times each basic block executes. This - is the most basic form of profiling, which can tell which blocks are hot, but - cannot reliably detect hot paths through the CFG. -

    - -

    - Note that this implementation is very na??ve. Control equivalent regions of - the CFG should not require duplicate counters, but it does put duplicate - counters in. -

    -
    - - -

    @@ -927,51 +1171,18 @@

    -

    - This pass instruments the specified program with counters for function - profiling, which counts the number of times each function is called. -

    -
    - - - -
    -

    - The basic profiler that does nothing. It is the default profiler and thus - terminates RSProfiler chains. It is useful for measuring - framework overhead. -

    -
    - - - -
    -

    - The second stage of the random-sampling instrumentation framework, duplicates - all instructions in a function, ignoring the profiling code, then connects the - two versions together at the entry and at backedges. At each connection point - a choice is made as to whether to jump to the profiled code (take a sample) or - execute the unprofiled code. -

    - -

    - After this pass, it is highly recommended to runmem2reg - and adce. instcombine, - load-vn, gdce, and - dse also are good to run afterwards. +

    This pass instruments the specified program with counters for edge profiling. + Edge profiling can give a reasonable approximation of the hot paths through a + program, and is used for a wide variety of program transformations.

    @@ -1025,7 +1236,7 @@

    @@ -1037,7 +1248,7 @@

    @@ -1051,7 +1262,7 @@

    @@ -1062,7 +1273,7 @@

    @@ -1091,7 +1302,7 @@

    @@ -1120,7 +1331,7 @@

    @@ -1156,7 +1367,7 @@

    @@ -1169,7 +1380,7 @@

    @@ -1182,7 +1393,7 @@

    @@ -1194,7 +1405,7 @@

    @@ -1205,7 +1416,7 @@

    @@ -1219,7 +1430,7 @@

    A simple loop rotation transformation.

    @@ -1227,7 +1438,7 @@

    @@ -1239,7 +1450,7 @@

    @@ -1269,7 +1480,7 @@

    @@ -1310,7 +1521,23 @@

    +
    +

    + Turn malloc and free instructions into @malloc and + @free calls. +

    + +

    + This is a target-dependent tranformation because it depends on the size of + data types and alignment constraints. +

    +
    + + +

    @@ -1351,7 +1578,7 @@

    @@ -1380,7 +1607,7 @@

    @@ -1392,7 +1619,7 @@

    @@ -1408,7 +1635,7 @@

    @@ -1419,7 +1646,28 @@

    +
    +

    This pass looks for equivalent functions that are mergable and folds them. + + A hash is computed from the function, based on its type and number of + basic blocks. + + Once all hashes are computed, we perform an expensive equality comparison + on each function pair. This takes n^2/2 comparisons per bucket, so it's + important that the hash function be high quality. The equality comparison + iterates through each instruction in each basic block. + + When a match is found the functions are folded. If both functions are + overridable, we move the functionality into a new internal function and + leave two overridable thunks to it. +

    +
    + + +

    @@ -1430,7 +1678,33 @@

    +
    +

    This pass performs partial inlining, typically by inlining an if + statement that surrounds the body of the function. +

    +
    + + + +
    +

    This pass finds function arguments that are often a common constant and + specializes a version of the called function for that constant. + + This pass simply does the cloning for functions it specializes. It depends + on IPSCCP and DAE to clean up the results. + + The initial heuristic favors constant arguments that are used in control + flow. +

    +
    + + +

    @@ -1443,7 +1717,7 @@

    @@ -1466,7 +1740,7 @@

    @@ -1483,7 +1757,7 @@

    @@ -1505,7 +1779,7 @@

    @@ -1528,7 +1802,17 @@

    +
    +

    This pass moves instructions into successor blocks, when possible, so that + they aren't executed on paths where their results aren't needed. +

    +
    + + +

    @@ -1541,7 +1825,17 @@

    +
    +

    Simple pass that applies an experimental transformation on calls + to specific functions. +

    +
    + + +

    @@ -1560,11 +1854,48 @@

    +
    +

    This function breaks GEPs with more than 2 non-zero operands into smaller + GEPs each with no more than 2 non-zero operands. This exposes redundancy + between GEPs with common initial operand sequences. +

    +
    + + + +
    +

    This pass converts a list of variables to the Static Single Information + form. + + We are building an on-demand representation, that is, we do not convert + every single variable in the target function to SSI form. Rather, we receive + a list of target variables that must be converted. We also do not + completely convert a target variable to the SSI format. Instead, we only + change the variable in the points where new information can be attached + to its live range, that is, at branch points. +

    +
    + + + +
    +

    A pass that runs SSI on every non-void variable, intended for debugging. +

    +
    + + +

    - Performs code stripping. This transformation can delete: + performs code stripping. this transformation can delete:

      @@ -1574,7 +1905,7 @@

    - Note that this transformation makes code much less readable, so it should + note that this transformation makes code much less readable, so it should only be used in situations where the strip utility would be used, such as reducing code size or making it harder to reverse engineer code.

    @@ -1582,7 +1913,7 @@

    @@ -1595,7 +1926,41 @@

    +
    +

    This pass implements code stripping. Specifically, it can delete: +

      +
    • names for virtual registers
    • +
    • symbols for internal globals and functions
    • +
    • debug information
    • +
    + Note that this transformation makes code much less readable, so it should + only be used in situations where the 'strip' utility would be used, such as + reducing code size or making it harder to reverse engineer code. +

    +
    + + + +
    +

    This pass implements code stripping. Specifically, it can delete: +

      +
    • names for virtual registers
    • +
    • symbols for internal globals and functions
    • +
    • debug information
    • +
    + Note that this transformation makes code much less readable, so it should + only be used in situations where the 'strip' utility would be used, such as + reducing code size or making it harder to reverse engineer code. +

    +
    + + +

    @@ -1618,7 +1983,7 @@

    @@ -1650,7 +2015,7 @@

    @@ -1670,7 +2035,7 @@

    @@ -1681,7 +2046,7 @@

    @@ -1691,7 +2056,19 @@

    +
    +

    This is a little utility pass that gives instructions names, this is mostly + useful when diffing the effect of an optimization because deleting an + unnamed instruction can change all other instruction numbering, making the + diff very noisy. +

    +
    + + +

    @@ -1707,7 +2084,7 @@

    @@ -1758,7 +2135,7 @@

    @@ -1768,7 +2145,7 @@

    @@ -1779,7 +2156,7 @@

    @@ -1789,7 +2166,7 @@

    @@ -1802,7 +2179,7 @@

    @@ -1812,7 +2189,7 @@

    From clattner at apple.com Tue Jul 6 10:56:34 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 6 Jul 2010 08:56:34 -0700 Subject: [llvm-commits] [llvm] r107667 - /llvm/trunk/include/llvm/Instructions.h In-Reply-To: <20100706154411.CC51C2A6C12C@llvm.org> References: <20100706154411.CC51C2A6C12C@llvm.org> Message-ID: On Jul 6, 2010, at 8:44 AM, Gabor Greif wrote: > Author: ggreif > Date: Tue Jul 6 10:44:11 2010 > New Revision: 107667 > > URL: http://llvm.org/viewvc/llvm-project?rev=107667&view=rev > Log: > second round of low-level interface squeeze-out: > making all of CallInst's low-level operand accessors > private > > If you get compile errors I strongly urge you to > update your code. Hi Gabor, I'm all for the spirit of this patch, however, this is really really gross: > > +# define public private > +# define protected private > /// Provide fast operand accessors > DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); > +# undef public > +# undef protected How about declaring a different macro, named DECLARE_PRIVATE_TRANSPARENT_OPERAND_ACCESSORS or something? -Chris From sabre at nondot.org Tue Jul 6 10:59:27 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 06 Jul 2010 15:59:27 -0000 Subject: [llvm-commits] [llvm] r107670 - /llvm/trunk/lib/CodeGen/StackProtector.cpp Message-ID: <20100706155927.4EFE62A6C12C@llvm.org> Author: lattner Date: Tue Jul 6 10:59:27 2010 New Revision: 107670 URL: http://llvm.org/viewvc/llvm-project?rev=107670&view=rev Log: tighten up this code. Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=107670&r1=107669&r2=107670&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Jul 6 10:59:27 2010 @@ -153,21 +153,16 @@ // StackGuard = load __stack_chk_guard // call void @llvm.stackprotect.create(StackGuard, StackGuardSlot) // - PointerType *PtrTy = PointerType::getUnqual( - Type::getInt8Ty(RI->getContext())); - + const PointerType *PtrTy = Type::getInt8PtrTy(RI->getContext()); unsigned AddressSpace, Offset; if (TLI->getStackCookieLocation(AddressSpace, Offset)) { - Constant *ASPtr = Constant::getNullValue( - PointerType::get(Type::getInt8Ty(RI->getContext()), AddressSpace)); - APInt OffsetInt(32, Offset); - Constant *OffsetVal = Constant::getIntegerValue( - Type::getInt32Ty(RI->getContext()), OffsetInt); - StackGuardVar = ConstantExpr::getPointerCast( - ConstantExpr::getGetElementPtr(ASPtr, &OffsetVal, 1), - PointerType::get(PtrTy, AddressSpace)); + Constant *OffsetVal = + ConstantInt::get(Type::getInt32Ty(RI->getContext()), Offset); + + StackGuardVar = ConstantExpr::getIntToPtr(OffsetVal, + PointerType::get(PtrTy, AddressSpace)); } else { - StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); + StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); } BasicBlock &Entry = F->getEntryBlock(); From stoklund at 2pi.dk Tue Jul 6 11:16:12 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 6 Jul 2010 09:16:12 -0700 Subject: [llvm-commits] [patch] Don't create neon moves in CopyRegToReg, instead trust NEONMoveFixPass to do the conversion In-Reply-To: References: Message-ID: <4097B32E-6F0D-45A3-8C8A-40EBCA3F03F6@2pi.dk> On Jul 5, 2010, at 8:21 AM, Rafael Espindola wrote: > A recent patch caused a regression on ARM: we would create NEON copy > instructions when a VFP one would be more profitable. Two options were > discussed: > > *) Represent the NEON registers as distinct from the VFP registers and > have explicit copies from one to the other. > *) Figure out why NEONMoveFixPass was not fixing this. > > Currently NEONMoveFixPass only converts VFP moves to NEON moves. This > looks reasonable, we just have to avoid creating NEON moves early. > This is what the attached patch does. It fixes the previous > regression. That sounds like the right approach to me. > Is there a case I am missing? That is, a case where CopyRegToReg was > correctly creating a NEON move but NEONMoveFixPass fails to convert? > The tests found nothing. Go ahead and commit. If there are any cases like that, we'll fix NEONMoveFixPass. /jakob From rafael.espindola at gmail.com Tue Jul 6 11:24:34 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 06 Jul 2010 16:24:34 -0000 Subject: [llvm-commits] [llvm] r107673 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp test/CodeGen/ARM/vget_lane.ll Message-ID: <20100706162434.D46BE2A6C12C@llvm.org> Author: rafael Date: Tue Jul 6 11:24:34 2010 New Revision: 107673 URL: http://llvm.org/viewvc/llvm-project?rev=107673&view=rev Log: Don't create neon moves in CopyRegToReg. NEONMoveFixPass will do the conversion if profitable. Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/test/CodeGen/ARM/vget_lane.ll Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=107673&r1=107672&r2=107673&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Jul 6 11:24:34 2010 @@ -718,6 +718,12 @@ if (SrcRC == ARM::DPR_8RegisterClass) SrcRC = ARM::DPR_VFP2RegisterClass; + // NEONMoveFixPass will convert VFP moves to NEON moves when profitable. + if (DestRC == ARM::DPR_VFP2RegisterClass) + DestRC = ARM::DPRRegisterClass; + if (SrcRC == ARM::DPR_VFP2RegisterClass) + SrcRC = ARM::DPRRegisterClass; + // Allow QPR / QPR_VFP2 / QPR_8 cross-class copies. if (DestRC == ARM::QPR_VFP2RegisterClass || DestRC == ARM::QPR_8RegisterClass) @@ -750,10 +756,6 @@ Opc = (SrcRC == ARM::GPRRegisterClass ? ARM::VMOVSR : ARM::VMOVS); else if (DestRC == ARM::DPRRegisterClass) Opc = ARM::VMOVD; - else if (DestRC == ARM::DPR_VFP2RegisterClass || - SrcRC == ARM::DPR_VFP2RegisterClass) - // Always use neon reg-reg move if source or dest is NEON-only regclass. - Opc = ARM::VMOVDneon; else if (DestRC == ARM::QPRRegisterClass) Opc = ARM::VMOVQ; else if (DestRC == ARM::QQPRRegisterClass) Modified: llvm/trunk/test/CodeGen/ARM/vget_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vget_lane.ll?rev=107673&r1=107672&r2=107673&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vget_lane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vget_lane.ll Tue Jul 6 11:24:34 2010 @@ -205,7 +205,7 @@ define arm_aapcs_vfpcc <2 x float> @test_vset_lanef32(float %arg0_float32_t, <2 x float> %arg1_float32x2_t) nounwind { ;CHECK: test_vset_lanef32: ;CHECK: vmov.f32 s3, s0 -;CHECK: vmov d0, d1 +;CHECK: vmov.f64 d0, d1 entry: %0 = insertelement <2 x float> %arg1_float32x2_t, float %arg0_float32_t, i32 1 ; <<2 x float>> [#uses=1] ret <2 x float> %0 From wdietz2 at illinois.edu Tue Jul 6 12:10:37 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 17:10:37 -0000 Subject: [llvm-commits] [poolalloc] r107674 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <20100706171037.864502A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 12:10:37 2010 New Revision: 107674 URL: http://llvm.org/viewvc/llvm-project?rev=107674&view=rev Log: Added comments on what to fix from today's code review. Removed unnecessary whitespace. No functionality changes. Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=107674&r1=107673&r2=107674&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Tue Jul 6 12:10:37 2010 @@ -54,7 +54,7 @@ // alloca instruction because it is allocated within the current function. std::multimap &PoolUses; - // PoolDestroys - For each pool, keep track of the actual poolfree calls + // PoolFrees - For each pool, keep track of the actual poolfree calls // inserted into the code. This is seperated out from PoolUses. std::multimap &PoolFrees; @@ -67,10 +67,12 @@ template void AddPoolUse(InstType &I, Value *PoolHandle, SetType &Set) { + // FIXME: Strip away pointer casts if (AllocaInst *AI = dyn_cast(PoolHandle)) Set.insert(std::make_pair(AI, &I)); } + // FIXME: Factor out assumptions about c stdlib function names void visitInstruction(Instruction &I); //void visitMallocInst(MallocInst &MI); void visitAllocaInst(AllocaInst &MI); @@ -129,6 +131,7 @@ return G->getScalarMap()[getOldValueIfAvailable(V)]; } + // FIXME: Does this get global (or just local) pools? Value *getPoolHandle(Value *V) { DSNode *Node = getDSNodeHFor(V).getNode(); // Get the pool handle for this DSNode... @@ -136,7 +139,7 @@ FI.PoolDescriptors.find(Node); return I != FI.PoolDescriptors.end() ? I->second : 0; } - + Function* retCloneIfFunc(Value *V); }; } @@ -152,6 +155,9 @@ // Returns the clone if V is a static function (not a pointer) and belongs // to an equivalence class i.e. is pool allocated +// FIXME: Rename this to 'getCloneIfFunc' (or similar)? +// FIXME: Strip pointer casts +// FIXME: Comment this? Function* FuncTransform::retCloneIfFunc(Value *V) { if (Function *F = dyn_cast(V)) if (FuncInfo *FI = PAInfo.getFuncInfo(*F)) @@ -174,28 +180,32 @@ Instruction *FuncTransform::TransformAllocationInstr(Instruction *I, Value *Size) { + // Ensure that the new instruction has the same name as the old one + // and the that the old one has no name. std::string Name = I->getName(); I->setName(""); + // FIXME: Don't assume allocation sizes are 32bit--this differs per architecture! if (!Size->getType()->isIntegerTy(32)) Size = CastInst::CreateIntegerCast(Size, Type::getInt32Ty(Size->getType()->getContext()), false, Size->getName(), I); - // Insert a call to poolalloc - Value *PH = getPoolHandle(I); + // Get the pool handle-- // Do not change the instruction into a poolalloc() call unless we have a // real pool descriptor + Value *PH = getPoolHandle(I); if (PH == 0 || isa(PH)) return I; - + + // Create call to poolalloc, and record the use of the pool Value* Opts[2] = {PH, Size}; Instruction *V = CallInst::Create(PAInfo.PoolAlloc, Opts, Opts + 2, Name, I); - AddPoolUse(*V, PH, PoolUses); // Cast to the appropriate type if necessary + // FIXME: Make use of "castTo" utility function Instruction *Casted = V; if (V->getType() != I->getType()) Casted = CastInst::CreatePointerCast(V, I->getType(), V->getName(), I); - + // Update def-use info I->replaceAllUsesWith(Casted); @@ -211,6 +221,7 @@ // If this was an invoke, fix up the CFG. if (InvokeInst *II = dyn_cast(I)) { + // FIXME: Assert out since we potentially don't handle "invoke" correctly BranchInst::Create (II->getNormalDest(), I); II->getUnwindDest()->removePredecessor(II->getParent(), true); } @@ -278,7 +289,7 @@ #endif void FuncTransform::visitAllocaInst(AllocaInst &MI) { - // + // FIXME: We should remove SAFECode-specific functionality (and comments) // SAFECode will register alloca instructions with the run-time, so do not // do that here. // @@ -303,6 +314,7 @@ // // Return value: // NULL - No call to poolfree() was inserted. +// This may be possible if PoolAlloc has decided not to pool-allocate this. // Otherwise, a pointer to the call instruction that calls poolfree() will be // returned. // @@ -318,6 +330,7 @@ // // Cast the pointer to be freed to a void pointer type if necessary. // + // FIXME: Change this to make use of "castTo" utility. Value *Casted = Arg; if (Arg->getType() != PointerType::getUnqual(Type::getInt8Ty(Arg->getContext()))) { Casted = CastInst::CreatePointerCast(Arg, PointerType::getUnqual(Type::getInt8Ty(Arg->getContext())), @@ -326,7 +339,7 @@ } // - // Insert a call to poolfree() + // Insert a call to poolfree(), and mark that memory was deallocated from the pool. // Value* Opts[2] = {PH, Casted}; CallInst *FreeI = CallInst::Create(PAInfo.PoolFree, Opts, Opts + 2, "", Where); @@ -339,7 +352,7 @@ if (Instruction *I = InsertPoolFreeInstr(FrI.getOperand(0), &FrI)) { // Delete the now obsolete free instruction... FrI.getParent()->getInstList().erase(&FrI); - + // Update the NewToOldValueMap if this is a clone if (!FI.NewToOldValueMap.empty()) { std::map::iterator II = @@ -361,9 +374,11 @@ Instruction * InsertPt = CS.getInstruction(); if (Instruction *I = InsertPoolFreeInstr (CS.getArgument(0), InsertPt)) { // Delete the now obsolete free instruction... + // FIXME: use "eraseFromParent"? (Note this might require a refactoring) InsertPt->getParent()->getInstList().erase(InsertPt); // Update the NewToOldValueMap if this is a clone + // FIXME: Use of utility function UpdateNewToOldValueMap if (!FI.NewToOldValueMap.empty()) { std::map::iterator II = FI.NewToOldValueMap.find(InsertPt); @@ -385,6 +400,7 @@ // // Get the pool handle for the node that this contributes to... // + // FIXME: This check may be redundant Value *PH = getPoolHandle(MI); if (PH == 0 || isa(PH)) return; @@ -396,7 +412,7 @@ // // Transform the allocation site to use poolalloc(). // - TransformAllocationInstr(MI, AllocSize); + TransformAllocationInstr(MI, AllocSize); } @@ -406,8 +422,13 @@ const Type* Int32Type = Type::getInt32Ty(CS.getInstruction()->getContext()); const Type* Int64Type = Type::getInt64Ty(CS.getInstruction()->getContext()); + // FIXME: Ensure that we use 32/64-bit object length sizes consistently + // FIXME: Rename 'useLong' to something more descriptive? + // FIXME: Introduce 'ObjectAllocationSize' variable + // or similar instead of repeatedly using same expression + // XXX: Start new review session here *** bool useLong = TD.getTypeAllocSize(PointerType::getUnqual(Int8Type)) != 4; - + Module *M = CS.getInstruction()->getParent()->getParent()->getParent(); assert(CS.arg_end()-CS.arg_begin() == 2 && "calloc takes two arguments!"); Value *V1 = CS.getArgument(0); @@ -955,6 +976,8 @@ // transformed calls. Many instructions can "take the address of" a function, // and we must make sure to catch each of these uses, and transform it into a // reference to the new, transformed, function. +// FIXME: Don't rename uses of function names that escape +// FIXME: Special-case when external user is pthread_create (or similar)? void FuncTransform::visitInstruction(Instruction &I) { for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) if (Function *clonedFunc = retCloneIfFunc(I.getOperand(i))) { From rjmccall at apple.com Tue Jul 6 13:07:52 2010 From: rjmccall at apple.com (John McCall) Date: Tue, 06 Jul 2010 18:07:52 -0000 Subject: [llvm-commits] [llvm] r107677 - /llvm/trunk/include/llvm/Support/IRBuilder.h Message-ID: <20100706180752.B856D2A6C12C@llvm.org> Author: rjmccall Date: Tue Jul 6 13:07:52 2010 New Revision: 107677 URL: http://llvm.org/viewvc/llvm-project?rev=107677&view=rev Log: Provide an abstraction to save and restore the current insertion point of an IRBuilder. Modified: llvm/trunk/include/llvm/Support/IRBuilder.h Modified: llvm/trunk/include/llvm/Support/IRBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=107677&r1=107676&r2=107677&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) +++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Jul 6 13:07:52 2010 @@ -97,6 +97,48 @@ I->setDebugLoc(CurDbgLocation); } + /// InsertPoint - A saved insertion point. + class InsertPoint { + BasicBlock *Block; + BasicBlock::iterator Point; + + public: + /// Creates a new insertion point which doesn't point to anything. + InsertPoint() : Block(0) {} + + /// Creates a new insertion point at the given location. + InsertPoint(BasicBlock *InsertBlock, BasicBlock::iterator InsertPoint) + : Block(InsertBlock), Point(InsertPoint) {} + + /// isSet - Returns true if this insert point is set. + bool isSet() const { return (Block != 0); } + + llvm::BasicBlock *getBlock() const { return Block; } + llvm::BasicBlock::iterator getPoint() const { return Point; } + }; + + /// saveIP - Returns the current insert point. + InsertPoint saveIP() const { + return InsertPoint(GetInsertBlock(), GetInsertPoint()); + } + + /// saveAndClearIP - Returns the current insert point, clearing it + /// in the process. + InsertPoint saveAndClearIP() { + InsertPoint IP(GetInsertBlock(), GetInsertPoint()); + ClearInsertionPoint(); + return IP; + } + + /// restoreIP - Sets the current insert point to a previously-saved + /// location. + void restoreIP(InsertPoint IP) { + if (IP.isSet()) + SetInsertPoint(IP.getBlock(), IP.getPoint()); + else + ClearInsertionPoint(); + } + //===--------------------------------------------------------------------===// // Miscellaneous creation methods. //===--------------------------------------------------------------------===// From dpatel at apple.com Tue Jul 6 13:18:32 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 06 Jul 2010 18:18:32 -0000 Subject: [llvm-commits] [llvm] r107678 - in /llvm/trunk: lib/Target/X86/AsmPrinter/X86MCInstLower.cpp test/CodeGen/X86/2010-07-06-DbgCrash.ll Message-ID: <20100706181832.4A4402A6C12C@llvm.org> Author: dpatel Date: Tue Jul 6 13:18:32 2010 New Revision: 107678 URL: http://llvm.org/viewvc/llvm-project?rev=107678&view=rev Log: Fix PR7545 crash. Added: llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=107678&r1=107677&r2=107678&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue Jul 6 13:18:32 2010 @@ -505,7 +505,6 @@ O << V.getName(); O << " <- "; // Frame address. Currently handles register +- offset only. - assert(MI->getOperand(0).isReg() && MI->getOperand(3).isImm()); O << '['; printOperand(MI, 0, O); O << '+'; printOperand(MI, 3, O); O << ']'; O << "+"; @@ -517,8 +516,9 @@ MachineLocation Location; assert (MI->getNumOperands() == 7 && "Invalid no. of machine operands!"); // Frame address. Currently handles register +- offset only. - assert(MI->getOperand(0).isReg() && MI->getOperand(3).isImm()); - Location.set(MI->getOperand(0).getReg(), MI->getOperand(3).getImm()); + + if (MI->getOperand(0).isReg() && MI->getOperand(3).isImm()) + Location.set(MI->getOperand(0).getReg(), MI->getOperand(3).getImm()); return Location; } Added: llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll?rev=107678&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll (added) +++ llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll Tue Jul 6 13:18:32 2010 @@ -0,0 +1,29 @@ +; RUN: llc -O0 -relocation-model pic -o /dev/null +; PR7545 + at .str = private constant [4 x i8] c"one\00", align 1 ; <[4 x i8]*> [#uses=1] + at .str1 = private constant [4 x i8] c"two\00", align 1 ; <[5 x i8]*> [#uses=1] + at C.9.2167 = internal constant [2 x i8*] [i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str1, i64 0, i64 0)] +!38 = metadata !{i32 524329, metadata !"pbmsrch.c", metadata !"/Users/grawp/LLVM/test-suite/MultiSource/Benchmarks/MiBench/office-stringsearch", metadata !39} ; [ DW_TAG_file_type ] +!39 = metadata !{i32 524305, i32 0, i32 1, metadata !"pbmsrch.c", metadata !"/Users/grawp/LLVM/test-suite/MultiSource/Benchmarks/MiBench/office-stringsearch", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] +!46 = metadata !{i32 524303, metadata !38, metadata !"", metadata !38, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !47} ; [ DW_TAG_pointer_type ]!97 = metadata !{i32 524334, i32 0, metadata !38, metadata !"main", metadata !"main", metadata !"main", metadata !38, i32 73, metadata !98, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false, null} ; [ DW_TAG_subprogram ]!101 = metadata !{[2 x i8*]* @C.9.2167} +!47 = metadata !{i32 524324, metadata !38, metadata !"char", metadata !38, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] +!97 = metadata !{i32 524334, i32 0, metadata !38, metadata !"main", metadata !"main", metadata !"main", metadata !38, i32 73, metadata !98, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false, null} ; [ DW_TAG_subprogram ] +!98 = metadata !{i32 524309, metadata !38, metadata !"", metadata !38, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !99, i32 0, null} ; [ DW_TAG_subroutine_type ] +!99 = metadata !{metadata !100} +!100 = metadata !{i32 524324, metadata !38, metadata !"int", metadata !38, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] +!101 = metadata !{[2 x i8*]* @C.9.2167} +!102 = metadata !{i32 524544, metadata !103, metadata !"find_strings", metadata !38, i32 75, metadata !104} ; [ DW_TAG_auto_variable ] +!103 = metadata !{i32 524299, metadata !97, i32 73, i32 0} ; [ DW_TAG_lexical_block ] +!104 = metadata !{i32 524289, metadata !38, metadata !"", metadata !38, i32 0, i64 85312, i64 64, i64 0, i32 0, metadata !46, metadata !105, i32 0, null} ; [ DW_TAG_array_type ] +!105 = metadata !{metadata !106} +!106 = metadata !{i32 524321, i64 0, i64 1332} ; [ DW_TAG_subrange_type ] +!107 = metadata !{i32 73, i32 0, metadata !103, null} + +define i32 @main() nounwind ssp { +bb.nph: + tail call void @llvm.dbg.declare(metadata !101, metadata !102), !dbg !107 + ret i32 0, !dbg !107 +} + +declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone + From nicholas at mxc.ca Tue Jul 6 13:24:09 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 06 Jul 2010 18:24:09 -0000 Subject: [llvm-commits] [llvm] r107680 - /llvm/trunk/docs/LangRef.html Message-ID: <20100706182410.2CBF42A6C12C@llvm.org> Author: nicholas Date: Tue Jul 6 13:24:09 2010 New Revision: 107680 URL: http://llvm.org/viewvc/llvm-project?rev=107680&view=rev Log: Alphabetize the list of function parameters. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=107680&r1=107679&r2=107680&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 6 13:24:09 2010 @@ -1147,15 +1147,21 @@ this function is desirable (such as the "inline" keyword in C/C++). It is just a hint; it imposes no requirements on the inliner.
  • +
    naked
    +
    This attribute disables prologue / epilogue emission for the function. + This can have very system-specific consequences.
    + +
    noimplicitfloat
    +
    This attributes disables implicit floating point instructions.
    +
    noinline
    This attribute indicates that the inliner should never inline this function in any situation. This attribute may not be used together with the alwaysinline attribute.
    -
    optsize
    -
    This attribute suggests that optimization passes and code generator passes - make choices that keep the code size of this function low, and otherwise - do optimizations specifically to reduce code size.
    +
    noredzone
    +
    This attribute indicates that the code generator should not use a red + zone, even if the target-specific ABI normally permits it.
    noreturn
    This function attribute indicates that the function never returns @@ -1167,6 +1173,11 @@ unwind or exceptional control flow. If the function does unwind, its runtime behavior is undefined.
    +
    optsize
    +
    This attribute suggests that optimization passes and code generator passes + make choices that keep the code size of this function low, and otherwise + do optimizations specifically to reduce code size.
    +
    readnone
    This attribute indicates that the function computes its result (or decides to unwind an exception) based strictly on its arguments, without @@ -1209,17 +1220,6 @@ function that doesn't have an sspreq attribute or which has an ssp attribute, then the resulting function will have an sspreq attribute.
    - -
    noredzone
    -
    This attribute indicates that the code generator should not use a red - zone, even if the target-specific ABI normally permits it.
    - -
    noimplicitfloat
    -
    This attributes disables implicit floating point instructions.
    - -
    naked
    -
    This attribute disables prologue / epilogue emission for the function. - This can have very system-specific consequences.
    From rjmccall at apple.com Tue Jul 6 13:34:50 2010 From: rjmccall at apple.com (John McCall) Date: Tue, 06 Jul 2010 18:34:50 -0000 Subject: [llvm-commits] [llvm] r107683 - /llvm/trunk/include/llvm/Support/IRBuilder.h Message-ID: <20100706183450.0ADB42A6C12C@llvm.org> Author: rjmccall Date: Tue Jul 6 13:34:49 2010 New Revision: 107683 URL: http://llvm.org/viewvc/llvm-project?rev=107683&view=rev Log: Provide IRBuilder conveniences for creating integer constants at common widths, and give a more precise return type for some of the type-creation methods. Modified: llvm/trunk/include/llvm/Support/IRBuilder.h Modified: llvm/trunk/include/llvm/Support/IRBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=107683&r1=107682&r2=107683&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) +++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Jul 6 13:34:49 2010 @@ -148,33 +148,88 @@ /// specified. If Name is specified, it is the name of the global variable /// created. Value *CreateGlobalString(const char *Str = "", const Twine &Name = ""); + + /// getInt1 - Get a constant value representing either true or false. + ConstantInt *getInt1(bool V) { + return ConstantInt::get(getInt1Ty(), V); + } + + /// getTrue - Get the constant value for i1 true. + ConstantInt *getTrue() { + return ConstantInt::getTrue(Context); + } + + /// getFalse - Get the constant value for i1 false. + ConstantInt *getFalse() { + return ConstantInt::getFalse(Context); + } + + /// getInt8 - Get a constant 8-bit value. + ConstantInt *getInt8(int8_t C) { + return ConstantInt::getSigned(getInt8Ty(), C); + } + + /// getInt8 - Get a constant 8-bit value. + ConstantInt *getInt8(uint8_t C) { + return ConstantInt::get(getInt8Ty(), C); + } + + /// getInt16 - Get a constant 16-bit value. + ConstantInt *getInt16(int16_t C) { + return ConstantInt::getSigned(getInt16Ty(), C); + } + + /// getInt16 - Get a constant 16-bit value. + ConstantInt *getInt16(uint16_t C) { + return ConstantInt::get(getInt16Ty(), C); + } + + /// getInt32 - Get a constant 32-bit value. + ConstantInt *getInt32(int32_t C) { + return ConstantInt::getSigned(getInt32Ty(), C); + } + + /// getInt32 - Get a constant 32-bit value. + ConstantInt *getInt32(uint32_t C) { + return ConstantInt::get(getInt32Ty(), C); + } + + /// getInt64 - Get a constant 64-bit value. + ConstantInt *getInt64(int64_t C) { + return ConstantInt::getSigned(getInt64Ty(), C); + } + + /// getInt64 - Get a constant 64-bit value. + ConstantInt *getInt64(uint64_t C) { + return ConstantInt::get(getInt64Ty(), C); + } //===--------------------------------------------------------------------===// // Type creation methods //===--------------------------------------------------------------------===// /// getInt1Ty - Fetch the type representing a single bit - const Type *getInt1Ty() { + const IntegerType *getInt1Ty() { return Type::getInt1Ty(Context); } /// getInt8Ty - Fetch the type representing an 8-bit integer. - const Type *getInt8Ty() { + const IntegerType *getInt8Ty() { return Type::getInt8Ty(Context); } /// getInt16Ty - Fetch the type representing a 16-bit integer. - const Type *getInt16Ty() { + const IntegerType *getInt16Ty() { return Type::getInt16Ty(Context); } /// getInt32Ty - Fetch the type resepresenting a 32-bit integer. - const Type *getInt32Ty() { + const IntegerType *getInt32Ty() { return Type::getInt32Ty(Context); } /// getInt64Ty - Fetch the type representing a 64-bit integer. - const Type *getInt64Ty() { + const IntegerType *getInt64Ty() { return Type::getInt64Ty(Context); } @@ -193,7 +248,7 @@ return Type::getVoidTy(Context); } - const Type *getInt8PtrTy() { + const PointerType *getInt8PtrTy() { return Type::getInt8PtrTy(Context); } From echristo at apple.com Tue Jul 6 13:35:20 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 06 Jul 2010 18:35:20 -0000 Subject: [llvm-commits] [llvm] r107684 - /llvm/trunk/lib/CodeGen/Spiller.cpp Message-ID: <20100706183520.DC1F02A6C12C@llvm.org> Author: echristo Date: Tue Jul 6 13:35:20 2010 New Revision: 107684 URL: http://llvm.org/viewvc/llvm-project?rev=107684&view=rev Log: Fix to 80-col. Modified: llvm/trunk/lib/CodeGen/Spiller.cpp Modified: llvm/trunk/lib/CodeGen/Spiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Spiller.cpp?rev=107684&r1=107683&r2=107684&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/Spiller.cpp (original) +++ llvm/trunk/lib/CodeGen/Spiller.cpp Tue Jul 6 13:35:20 2010 @@ -55,8 +55,8 @@ const TargetInstrInfo *tii; const TargetRegisterInfo *tri; VirtRegMap *vrm; - - /// Construct a spiller base. + + /// Construct a spiller base. SpillerBase(MachineFunction *mf, LiveIntervals *lis, VirtRegMap *vrm) : mf(mf), lis(lis), vrm(vrm) { @@ -97,7 +97,7 @@ do { ++regItr; } while (regItr != mri->reg_end() && (&*regItr == mi)); - + // Collect uses & defs for this instr. SmallVector indices; bool hasUse = false; @@ -117,7 +117,7 @@ vrm->assignVirt2StackSlot(newVReg, ss); LiveInterval *newLI = &lis->getOrCreateInterval(newVReg); newLI->weight = HUGE_VALF; - + // Update the reg operands & kill flags. for (unsigned i = 0; i < indices.size(); ++i) { unsigned mopIdx = indices[i]; @@ -217,7 +217,7 @@ /// When a call to spill is placed this spiller will first try to break the /// interval up into its component values (one new interval per value). /// If this fails, or if a call is placed to spill a previously split interval -/// then the spiller falls back on the standard spilling mechanism. +/// then the spiller falls back on the standard spilling mechanism. class SplittingSpiller : public StandardSpiller { public: SplittingSpiller(MachineFunction *mf, LiveIntervals *lis, @@ -243,7 +243,7 @@ MachineRegisterInfo *mri; const TargetInstrInfo *tii; - const TargetRegisterInfo *tri; + const TargetRegisterInfo *tri; DenseSet alreadySplit; bool worthTryingToSplit(LiveInterval *li) const { @@ -260,18 +260,18 @@ SmallVector vnis; std::copy(li->vni_begin(), li->vni_end(), std::back_inserter(vnis)); - + for (SmallVectorImpl::iterator vniItr = vnis.begin(), vniEnd = vnis.end(); vniItr != vniEnd; ++vniItr) { VNInfo *vni = *vniItr; - + // Skip unused VNIs. if (vni->isUnused()) continue; DEBUG(dbgs() << " Extracted Val #" << vni->id << " as "); LiveInterval *splitInterval = extractVNI(li, vni); - + if (splitInterval != 0) { DEBUG(dbgs() << *splitInterval << "\n"); added.push_back(splitInterval); @@ -283,12 +283,12 @@ } else { DEBUG(dbgs() << "0\n"); } - } + } DEBUG(dbgs() << "Original LI: " << *li << "\n"); // If there original interval still contains some live ranges - // add it to added and alreadySplit. + // add it to added and alreadySplit. if (!li->empty()) { added.push_back(li); alreadySplit.insert(li); @@ -312,7 +312,7 @@ LiveInterval *newLI = &lis->getOrCreateInterval(newVReg); VNInfo *newVNI = newLI->createValueCopy(vni, lis->getVNInfoAllocator()); - // Start by copying all live ranges in the VN to the new interval. + // Start by copying all live ranges in the VN to the new interval. for (LiveInterval::iterator rItr = li->begin(), rEnd = li->end(); rItr != rEnd; ++rItr) { if (rItr->valno == vni) { @@ -320,7 +320,7 @@ } } - // Erase the old VNI & ranges. + // Erase the old VNI & ranges. li->removeValNo(vni); // Collect all current uses of the register belonging to the given VNI. @@ -367,8 +367,8 @@ newVNI->setIsPHIDef(false); // not a PHI def anymore. newVNI->setIsDefAccurate(true); } else { - // non-PHI def. Rename the def. If it's two-addr that means renaming the use - // and inserting a new copy too. + // non-PHI def. Rename the def. If it's two-addr that means renaming the + // use and inserting a new copy too. MachineInstr *defInst = lis->getInstructionFromIndex(newVNI->def); // We'll rename this now, so we can remove it from uses. uses.erase(defInst); @@ -384,7 +384,7 @@ twoAddrUseIsUndef = true; } } - + SlotIndex defIdx = lis->getInstructionIndex(defInst); newVNI->def = defIdx.getDefIndex(); @@ -402,9 +402,9 @@ true, lis->getVNInfoAllocator()); LiveRange copyRange(copyIdx.getDefIndex(),defIdx.getDefIndex(),copyVNI); newLI->addRange(copyRange); - } + } } - + for (std::set::iterator usesItr = uses.begin(), usesEnd = uses.end(); usesItr != usesEnd; ++usesItr) { @@ -424,7 +424,7 @@ // Check if this instr is two address. unsigned useOpIdx = useInst->findRegisterUseOperandIdx(li->reg); bool isTwoAddress = useInst->isRegTiedToDefOperand(useOpIdx); - + // Rename uses (and defs for two-address instrs). for (unsigned i = 0; i < useInst->getNumOperands(); ++i) { MachineOperand &mo = useInst->getOperand(i); @@ -440,8 +440,8 @@ // reg. MachineBasicBlock *useMBB = useInst->getParent(); MachineBasicBlock::iterator useItr(useInst); - tii->copyRegToReg(*useMBB, llvm::next(useItr), li->reg, newVReg, trc, trc, - DebugLoc()); + tii->copyRegToReg(*useMBB, llvm::next(useItr), li->reg, newVReg, trc, + trc, DebugLoc()); MachineInstr *copyMI = llvm::next(useItr); copyMI->addRegisterKilled(newVReg, tri); SlotIndex copyIdx = lis->InsertMachineInstrInMaps(copyMI); From matt at console-pimps.org Tue Jul 6 13:36:57 2010 From: matt at console-pimps.org (Matt Fleming) Date: Tue, 06 Jul 2010 18:36:57 -0000 Subject: [llvm-commits] [llvm] r107685 - /llvm/trunk/include/llvm/Support/ELF.h Message-ID: <20100706183657.D4D9D2A6C12C@llvm.org> Author: mfleming Date: Tue Jul 6 13:36:57 2010 New Revision: 107685 URL: http://llvm.org/viewvc/llvm-project?rev=107685&view=rev Log: Add some more ELF OSABI values as found in the System V Application Binary Interface specification. Modified: llvm/trunk/include/llvm/Support/ELF.h Modified: llvm/trunk/include/llvm/Support/ELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ELF.h?rev=107685&r1=107684&r2=107685&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ELF.h (original) +++ llvm/trunk/include/llvm/Support/ELF.h Tue Jul 6 13:36:57 2010 @@ -135,9 +135,28 @@ ELFDATA2MSB = 2 // Big-endian object file }; -// OS ABI identification -- unused. +// OS ABI identification. enum { - ELFOSABI_NONE = 0 + ELFOSABI_NONE = 0, // UNIX System V ABI + ELFOSABI_HPUX = 1, // HP-UX operating system + ELFOSABI_NETBSD = 2, // NetBSD + ELFOSABI_LINUX = 3, // GNU/Linux + ELFOSABI_HURD = 4, // GNU/Hurd + ELFOSABI_SOLARIS = 6, // Solaris + ELFOSABI_AIX = 7, // AIX + ELFOSABI_IRIX = 8, // IRIX + ELFOSABI_FREEBSD = 9, // FreeBSD + ELFOSABI_TRU64 = 10, // TRU64 UNIX + ELFOSABI_MODESTO = 11, // Novell Modesto + ELFOSABI_OPENBSD = 12, // OpenBSD + ELFOSABI_OPENVMS = 13, // OpenVMS + ELFOSABI_NSK = 14, // Hewlett-Packard Non-Stop Kernel + ELFOSABI_AROS = 15, // AROS + ELFOSABI_FENIXOS = 16, // FenixOS + ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000 + ELFOSABI_C6000_LINUX = 65, // Linux TMS320C6000 + ELFOSABI_ARM = 97, // ARM + ELFOSABI_STANDALONE = 255 // Standalone (embedded) application }; // Section header. From matt at console-pimps.org Tue Jul 6 13:44:03 2010 From: matt at console-pimps.org (Matt Fleming) Date: Tue, 06 Jul 2010 18:44:03 -0000 Subject: [llvm-commits] [llvm] r107688 - /llvm/trunk/include/llvm/Support/ELF.h Message-ID: <20100706184403.111502A6C12C@llvm.org> Author: mfleming Date: Tue Jul 6 13:44:02 2010 New Revision: 107688 URL: http://llvm.org/viewvc/llvm-project?rev=107688&view=rev Log: Add X86_64 ELF relocation values and ELF64 relocation classes. Patch from Roman Divacky. Modified: llvm/trunk/include/llvm/Support/ELF.h Modified: llvm/trunk/include/llvm/Support/ELF.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ELF.h?rev=107688&r1=107687&r2=107688&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ELF.h (original) +++ llvm/trunk/include/llvm/Support/ELF.h Tue Jul 6 13:44:02 2010 @@ -159,6 +159,42 @@ ELFOSABI_STANDALONE = 255 // Standalone (embedded) application }; +// X86_64 relocations. +enum { + R_X86_64_NONE = 0, + R_X86_64_64 = 1, + R_X86_64_PC32 = 2, + R_X86_64_GOT32 = 3, + R_X86_64_PLT32 = 4, + R_X86_64_COPY = 5, + R_X86_64_GLOB_DAT = 6, + R_X86_64_JUMP_SLOT = 7, + R_X86_64_RELATIVE = 8, + R_X86_64_GOTPCREL = 9, + R_X86_64_32 = 10, + R_X86_64_32S = 11, + R_X86_64_16 = 12, + R_X86_64_PC16 = 13, + R_X86_64_8 = 14, + R_X86_64_PC8 = 15, + R_X86_64_DTPMOD64 = 16, + R_X86_64_DTPOFF64 = 17, + R_X86_64_TPOFF64 = 18, + R_X86_64_TLSGD = 19, + R_X86_64_TLSLD = 20, + R_X86_64_DTPOFF32 = 21, + R_X86_64_GOTTPOFF = 22, + R_X86_64_TPOFF32 = 23, + R_X86_64_PC64 = 24, + R_X86_64_GOTOFF64 = 25, + R_X86_64_GOTPC32 = 26, + R_X86_64_SIZE32 = 32, + R_X86_64_SIZE64 = 33, + R_X86_64_GOTPC32_TLSDESC = 34, + R_X86_64_TLSDESC_CALL = 35, + R_X86_64_TLSDESC = 36 +}; + // Section header. struct Elf32_Shdr { Elf32_Word sh_name; // Section name (index into string table) @@ -299,6 +335,43 @@ }; }; +// Relocation entry, without explicit addend. +struct Elf64_Rel { + Elf64_Addr r_offset; // Location (file byte offset, or program virtual addr). + Elf64_Xword r_info; // Symbol table index and type of relocation to apply. + + // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE, + // and ELF64_R_INFO macros defined in the ELF specification: + Elf64_Xword getSymbol () const { return (r_info >> 32); } + unsigned char getType () const { + return (unsigned char) (r_info & 0xffffffffL); + } + void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); } + void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); } + void setSymbolAndType (Elf64_Xword s, unsigned char t) { + r_info = (s << 32) + (t&0xffffffffL); + }; +}; + +// Relocation entry with explicit addend. +struct Elf64_Rela { + Elf64_Addr r_offset; // Location (file byte offset, or program virtual addr). + Elf64_Xword r_info; // Symbol table index and type of relocation to apply. + Elf64_Sxword r_addend; // Compute value for relocatable field by adding this. + + // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE, + // and ELF64_R_INFO macros defined in the ELF specification: + Elf64_Xword getSymbol () const { return (r_info >> 32); } + unsigned char getType () const { + return (unsigned char) (r_info & 0xffffffffL); + } + void setSymbol (Elf64_Xword s) { setSymbolAndType (s, getType ()); } + void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); } + void setSymbolAndType (Elf64_Xword s, unsigned char t) { + r_info = (s << 32) + (t&0xffffffffL); + }; +}; + // Program header. struct Elf32_Phdr { Elf32_Word p_type; // Type of segment From nicholas at mxc.ca Tue Jul 6 13:47:00 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 6 Jul 2010 11:47:00 -0700 Subject: [llvm-commits] [llvm] r107677 - /llvm/trunk/include/llvm/Support/IRBuilder.h In-Reply-To: <20100706180752.B856D2A6C12C@llvm.org> References: <20100706180752.B856D2A6C12C@llvm.org> Message-ID: On Tue, Jul 6, 2010 at 11:07 AM, John McCall wrote: > Author: rjmccall > Date: Tue Jul 6 13:07:52 2010 > New Revision: 107677 > > URL: http://llvm.org/viewvc/llvm-project?rev=107677&view=rev > Log: > Provide an abstraction to save and restore the current insertion point of > an IRBuilder. > > > Modified: > llvm/trunk/include/llvm/Support/IRBuilder.h > > Modified: llvm/trunk/include/llvm/Support/IRBuilder.h > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=107677&r1=107676&r2=107677&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) > +++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Jul 6 13:07:52 2010 > @@ -97,6 +97,48 @@ > I->setDebugLoc(CurDbgLocation); > } > > + /// InsertPoint - A saved insertion point. > + class InsertPoint { > + BasicBlock *Block; > + BasicBlock::iterator Point; > Can't we just store the BasicBlock::iterator? You can always walk from it (aka. Instruction*) to its parent BasicBlock. Nick + > + public: > + /// Creates a new insertion point which doesn't point to anything. > + InsertPoint() : Block(0) {} > + > + /// Creates a new insertion point at the given location. > + InsertPoint(BasicBlock *InsertBlock, BasicBlock::iterator InsertPoint) > + : Block(InsertBlock), Point(InsertPoint) {} > + > + /// isSet - Returns true if this insert point is set. > + bool isSet() const { return (Block != 0); } > + > + llvm::BasicBlock *getBlock() const { return Block; } > + llvm::BasicBlock::iterator getPoint() const { return Point; } > + }; > + > + /// saveIP - Returns the current insert point. > + InsertPoint saveIP() const { > + return InsertPoint(GetInsertBlock(), GetInsertPoint()); > + } > + > + /// saveAndClearIP - Returns the current insert point, clearing it > + /// in the process. > + InsertPoint saveAndClearIP() { > + InsertPoint IP(GetInsertBlock(), GetInsertPoint()); > + ClearInsertionPoint(); > + return IP; > + } > + > + /// restoreIP - Sets the current insert point to a previously-saved > + /// location. > + void restoreIP(InsertPoint IP) { > + if (IP.isSet()) > + SetInsertPoint(IP.getBlock(), IP.getPoint()); > + else > + ClearInsertionPoint(); > + } > + > > //===--------------------------------------------------------------------===// > // Miscellaneous creation methods. > > //===--------------------------------------------------------------------===// > > > _______________________________________________ > 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/20100706/b9003c38/attachment.html From rjmccall at apple.com Tue Jul 6 13:51:51 2010 From: rjmccall at apple.com (John McCall) Date: Tue, 6 Jul 2010 11:51:51 -0700 Subject: [llvm-commits] [llvm] r107677 - /llvm/trunk/include/llvm/Support/IRBuilder.h In-Reply-To: References: <20100706180752.B856D2A6C12C@llvm.org> Message-ID: <6D898228-CD4B-42D7-86DB-E6BC2D979D51@apple.com> On Jul 6, 2010, at 11:47 AM, Nick Lewycky wrote: > On Tue, Jul 6, 2010 at 11:07 AM, John McCall wrote: > Author: rjmccall > Date: Tue Jul 6 13:07:52 2010 > New Revision: 107677 > > URL: http://llvm.org/viewvc/llvm-project?rev=107677&view=rev > Log: > Provide an abstraction to save and restore the current insertion point of > an IRBuilder. > > > Modified: > llvm/trunk/include/llvm/Support/IRBuilder.h > > Modified: llvm/trunk/include/llvm/Support/IRBuilder.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=107677&r1=107676&r2=107677&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) > +++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Jul 6 13:07:52 2010 > @@ -97,6 +97,48 @@ > I->setDebugLoc(CurDbgLocation); > } > > + /// InsertPoint - A saved insertion point. > + class InsertPoint { > + BasicBlock *Block; > + BasicBlock::iterator Point; > > Can't we just store the BasicBlock::iterator? You can always walk from it (aka. Instruction*) to its parent BasicBlock. AFAIK this has two problems: there's no supported way to represent the null insertion point, and there's no way to get from BB->end() to BB. The former can be easily fixed, but the latter can't. If I'm wrong, then absolutely we should just store an iterator. John. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/976ccbe2/attachment.html From baldrick at free.fr Tue Jul 6 14:31:25 2010 From: baldrick at free.fr (Duncan Sands) Date: Tue, 06 Jul 2010 19:31:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r107689 - in /llvm-gcc-4.2/trunk/gcc: configure configure.ac Message-ID: <20100706193125.E04182A6C12C@llvm.org> Author: baldrick Date: Tue Jul 6 14:31:25 2010 New Revision: 107689 URL: http://llvm.org/viewvc/llvm-project?rev=107689&view=rev Log: Recognize Release+Asserts and Debug+Asserts as valid build types. This is in preparation for an upcoming change which makes Release mean optimized without assertions; optimized with assertions will become Release+Asserts. Modified: llvm-gcc-4.2/trunk/gcc/configure llvm-gcc-4.2/trunk/gcc/configure.ac Modified: llvm-gcc-4.2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure?rev=107689&r1=107688&r2=107689&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure (original) +++ llvm-gcc-4.2/trunk/gcc/configure Tue Jul 6 14:31:25 2010 @@ -8931,6 +8931,12 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Asserts/bin/llc$EXEEXT"; then + echo Found Release+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts" + elif test -x "$LLVMBASEPATH/Debug+Asserts/bin/llc$EXEEXT"; then + echo Found Debug+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts" elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then echo Found Release+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Release+Checks" @@ -8943,6 +8949,12 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Release+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts+Checks" elif test -x "$LLVMBASEPATH/bin/llc$EXEEXT"; then echo Found Installed LLVM Tree in $LLVMBASEPATH elif test x$LLVMBUILDMODE = x; then Modified: llvm-gcc-4.2/trunk/gcc/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure.ac?rev=107689&r1=107688&r2=107689&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure.ac (original) +++ llvm-gcc-4.2/trunk/gcc/configure.ac Tue Jul 6 14:31:25 2010 @@ -864,6 +864,12 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Asserts/bin/llc$EXEEXT"; then + echo Found Release+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts" + elif test -x "$LLVMBASEPATH/Debug+Asserts/bin/llc$EXEEXT"; then + echo Found Debug+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts" elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then echo Found Release+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Release+Checks" @@ -876,6 +882,12 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Release+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts+Checks" elif test -x "$LLVMBASEPATH/bin/llc$EXEEXT"; then echo Found Installed LLVM Tree in $LLVMBASEPATH elif test x$LLVMBUILDMODE = x; then From gohman at apple.com Tue Jul 6 15:24:04 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 20:24:04 -0000 Subject: [llvm-commits] [llvm] r107691 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <20100706202405.64EBB2A6C12C@llvm.org> Author: djg Date: Tue Jul 6 15:24:04 2010 New Revision: 107691 URL: http://llvm.org/viewvc/llvm-project?rev=107691&view=rev Log: Reapply r107655 with fixes; insert the pseudo instruction into the block before calling the expansion hook. And don't put EFLAGS in a mbb's live-in list twice. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Tue Jul 6 15:24:04 2010 @@ -259,6 +259,11 @@ /// machine basic block (i.e., copies all the successors fromMBB and /// remove all the successors from fromMBB). void transferSuccessors(MachineBasicBlock *fromMBB); + + /// transferSuccessorsAndUpdatePHIs - Transfers all the successors, as + /// in transferSuccessors, and update PHI operands in the successor blocks + /// which refer to fromMBB to refer to this. + void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB); /// isSuccessor - Return true if the specified MBB is a successor of this /// block. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Tue Jul 6 15:24:04 2010 @@ -335,12 +335,32 @@ if (this == fromMBB) return; - for (MachineBasicBlock::succ_iterator I = fromMBB->succ_begin(), - E = fromMBB->succ_end(); I != E; ++I) - addSuccessor(*I); + while (!fromMBB->succ_empty()) { + MachineBasicBlock *Succ = *fromMBB->succ_begin(); + addSuccessor(Succ); + fromMBB->removeSuccessor(Succ); + } +} + +void +MachineBasicBlock::transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB) { + if (this == fromMBB) + return; - while (!fromMBB->succ_empty()) - fromMBB->removeSuccessor(fromMBB->succ_begin()); + while (!fromMBB->succ_empty()) { + MachineBasicBlock *Succ = *fromMBB->succ_begin(); + addSuccessor(Succ); + fromMBB->removeSuccessor(Succ); + + // Fix up any PHI nodes in the successor. + for (MachineBasicBlock::iterator MI = Succ->begin(), ME = Succ->end(); + MI != ME && MI->isPHI(); ++MI) + for (unsigned i = 2, e = MI->getNumOperands()+1; i != e; i += 2) { + MachineOperand &MO = MI->getOperand(i); + if (MO.getMBB() == fromMBB) + MO.setMBB(this); + } + } } bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Tue Jul 6 15:24:04 2010 @@ -723,6 +723,11 @@ MI->setMemRefs(cast(Node)->memoperands_begin(), cast(Node)->memoperands_end()); + // Insert the instruction into position in the block. This needs to + // happen before any custom inserter hook is called so that the + // hook knows where in the block to insert the replacement code. + MBB->insert(InsertPos, MI); + if (II.usesCustomInsertionHook()) { // Insert this instruction into the basic block using a target // specific inserter which may returns a new basic block. @@ -731,8 +736,6 @@ return; } - MBB->insert(InsertPos, MI); - // Additional results must be an physical register def. if (HasPhysRegOuts) { for (unsigned i = II.getNumDefs(); i < NumResults; ++i) { Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -3637,7 +3637,12 @@ MF->insert(It, loop1MBB); MF->insert(It, loop2MBB); MF->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + + // Transfer the remainder of BB and its successor edges to exitMBB. + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); // thisMBB: // ... @@ -3675,7 +3680,7 @@ // ... BB = exitMBB; - MF->DeleteMachineInstr(MI); // The instruction is gone now. + MI->eraseFromParent(); // The instruction is gone now. return BB; } @@ -3718,7 +3723,12 @@ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB); MF->insert(It, loopMBB); MF->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + + // Transfer the remainder of BB and its successor edges to exitMBB. + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = MF->getRegInfo(); unsigned scratch = RegInfo.createVirtualRegister(ARM::GPRRegisterClass); @@ -3763,7 +3773,7 @@ // ... BB = exitMBB; - MF->DeleteMachineInstr(MI); // The instruction is gone now. + MI->eraseFromParent(); // The instruction is gone now. return BB; } @@ -3848,22 +3858,21 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, dl, TII->get(ARM::tBcc)).addMBB(sinkMBB) - .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg()); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII->get(ARM::tBcc)).addMBB(sinkMBB) + .addImm(MI->getOperand(3).getImm()).addReg(MI->getOperand(4).getReg()); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -3876,11 +3885,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII->get(ARM::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII->get(ARM::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } @@ -3901,7 +3911,7 @@ const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(SrcReg); unsigned CopyOpc = (RC == ARM::tGPRRegisterClass) ? ARM::tMOVtgpr2gpr : ARM::tMOVgpr2gpr; - BuildMI(BB, dl, TII->get(CopyOpc), ARM::SP) + BuildMI(*BB, MI, dl, TII->get(CopyOpc), ARM::SP) .addReg(SrcReg, getKillRegState(SrcIsKill)); } @@ -3933,7 +3943,7 @@ NeedPred = true; NeedCC = true; NeedOp3 = true; break; } - MachineInstrBuilder MIB = BuildMI(BB, dl, TII->get(OpOpc), ARM::SP); + MachineInstrBuilder MIB = BuildMI(*BB, MI, dl, TII->get(OpOpc), ARM::SP); if (OpOpc == ARM::tAND) AddDefaultT1CC(MIB); MIB.addReg(ARM::SP); @@ -3949,10 +3959,10 @@ const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(DstReg); unsigned CopyOpc = (RC == ARM::tGPRRegisterClass) ? ARM::tMOVgpr2tgpr : ARM::tMOVgpr2gpr; - BuildMI(BB, dl, TII->get(CopyOpc)) + BuildMI(*BB, MI, dl, TII->get(CopyOpc)) .addReg(DstReg, getDefRegState(true) | getDeadRegState(DstIsDead)) .addReg(ARM::SP); - MF->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } } Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -863,7 +863,10 @@ MachineBasicBlock *llscMBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - sinkMBB->transferSuccessors(thisMBB); + sinkMBB->splice(sinkMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(MI)), + thisMBB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(thisMBB); F->insert(It, llscMBB); F->insert(It, sinkMBB); @@ -912,7 +915,7 @@ thisMBB->addSuccessor(llscMBB); llscMBB->addSuccessor(llscMBB); llscMBB->addSuccessor(sinkMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return sinkMBB; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -234,6 +234,24 @@ MachineRegisterInfo &R = F->getRegInfo(); MachineBasicBlock *loop = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *finish = F->CreateMachineBasicBlock(LLVM_BB); + F->insert(It, loop); + F->insert(It, finish); + + // Update machine-CFG edges by transfering adding all successors and + // remaining instructions from the current block to the new block which + // will contain the Phi node for the select. + finish->splice(finish->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + finish->transferSuccessorsAndUpdatePHIs(BB); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(loop); + BB->addSuccessor(finish); + + // Next, add the finish block as a successor of the loop block + loop->addSuccessor(finish); + loop->addSuccessor(loop); unsigned IAMT = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); BuildMI(BB, dl, TII->get(MBlaze::ANDI), IAMT) @@ -249,26 +267,6 @@ .addReg(IAMT) .addMBB(finish); - F->insert(It, loop); - F->insert(It, finish); - - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - finish->addSuccessor(*i); - - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - BB->addSuccessor(loop); - BB->addSuccessor(finish); - - // Next, add the finish block as a successor of the loop block - loop->addSuccessor(finish); - loop->addSuccessor(loop); - unsigned DST = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); unsigned NDST = R.createVirtualRegister(MBlaze::CPURegsRegisterClass); BuildMI(loop, dl, TII->get(MBlaze::PHI), DST) @@ -298,12 +296,13 @@ .addReg(NAMT) .addMBB(loop); - BuildMI(finish, dl, TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) + BuildMI(*finish, finish->begin(), dl, + TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) .addReg(IVAL).addMBB(BB) .addReg(NDST).addMBB(loop); // The pseudo instruction is no longer needed so remove it - F->DeleteMachineInstr(MI); + MI->eraseFromParent(); return finish; } @@ -338,27 +337,23 @@ case MBlazeCC::LE: Opc = MBlaze::BGTID; break; } - BuildMI(BB, dl, TII->get(Opc)) - .addReg(MI->getOperand(3).getReg()) - .addMBB(dneBB); - F->insert(It, flsBB); F->insert(It, dneBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - dneBB->addSuccessor(*i); - - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + // Transfer the remainder of BB and its successor edges to dneBB. + dneBB->splice(dneBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + dneBB->transferSuccessorsAndUpdatePHIs(BB); + BB->addSuccessor(flsBB); BB->addSuccessor(dneBB); flsBB->addSuccessor(dneBB); + BuildMI(BB, dl, TII->get(Opc)) + .addReg(MI->getOperand(3).getReg()) + .addMBB(dneBB); + // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... @@ -366,11 +361,12 @@ // .addReg(MI->getOperand(1).getReg()).addMBB(flsBB) // .addReg(MI->getOperand(2).getReg()).addMBB(BB); - BuildMI(dneBB, dl, TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) + BuildMI(*dneBB, dneBB->begin(), dl, + TII->get(MBlaze::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(flsBB) .addReg(MI->getOperand(1).getReg()).addMBB(BB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return dneBB; } } Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -1070,7 +1070,10 @@ // Update machine-CFG edges by transferring all successors of the current // block to the block containing instructions after shift. - RemBB->transferSuccessors(BB); + RemBB->splice(RemBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + RemBB->transferSuccessorsAndUpdatePHIs(BB); // Add adges BB => LoopBB => RemBB, BB => RemBB, LoopBB => LoopBB BB->addSuccessor(LoopBB); @@ -1116,11 +1119,11 @@ // RemBB: // DestReg = phi [%SrcReg, BB], [%ShiftReg, LoopBB] - BuildMI(RemBB, dl, TII.get(MSP430::PHI), DstReg) + BuildMI(*RemBB, RemBB->begin(), dl, TII.get(MSP430::PHI), DstReg) .addReg(SrcReg).addMBB(BB) .addReg(ShiftReg2).addMBB(LoopBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return RemBB; } @@ -1158,18 +1161,22 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *copy1MBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, dl, TII.get(MSP430::JCC)) - .addMBB(copy1MBB) - .addImm(MI->getOperand(3).getImm()); F->insert(I, copy0MBB); F->insert(I, copy1MBB); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. - copy1MBB->transferSuccessors(BB); + copy1MBB->splice(copy1MBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + copy1MBB->transferSuccessorsAndUpdatePHIs(BB); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(copy1MBB); + BuildMI(BB, dl, TII.get(MSP430::JCC)) + .addMBB(copy1MBB) + .addImm(MI->getOperand(3).getImm()); + // copy0MBB: // %FalseValue = ... // # fallthrough to copy1MBB @@ -1182,11 +1189,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = copy1MBB; - BuildMI(BB, dl, TII.get(MSP430::PHI), + BuildMI(*BB, BB->begin(), dl, TII.get(MSP430::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -284,6 +284,18 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + F->insert(It, copy0MBB); + F->insert(It, sinkMBB); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + + // Next, add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); // Emit the right instruction according to the type of the operands compared if (isFPCmp) { @@ -296,20 +308,6 @@ BuildMI(BB, dl, TII->get(Mips::BNE)).addReg(MI->getOperand(1).getReg()) .addReg(Mips::ZERO).addMBB(sinkMBB); - F->insert(It, copy0MBB); - F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - sinkMBB->addSuccessor(*i); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while(!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -322,11 +320,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII->get(Mips::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII->get(Mips::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(3).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } } Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -1928,15 +1928,12 @@ F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); @@ -1953,11 +1950,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII.get(PIC16::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII.get(PIC16::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -4513,7 +4513,10 @@ MachineBasicBlock *exitMBB = F->CreateMachineBasicBlock(LLVM_BB); F->insert(It, loopMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); unsigned TmpReg = (!BinOpcode) ? incr : @@ -4578,7 +4581,10 @@ MachineBasicBlock *exitMBB = F->CreateMachineBasicBlock(LLVM_BB); F->insert(It, loopMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = @@ -4711,23 +4717,22 @@ MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); unsigned SelectPred = MI->getOperand(4).getImm(); DebugLoc dl = MI->getDebugLoc(); - BuildMI(BB, dl, TII->get(PPC::BCC)) - .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII->get(PPC::BCC)) + .addImm(SelectPred).addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -4740,7 +4745,8 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII->get(PPC::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII->get(PPC::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); } @@ -4826,7 +4832,10 @@ F->insert(It, loop2MBB); F->insert(It, midMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); // thisMBB: // ... @@ -4894,7 +4903,10 @@ F->insert(It, loop2MBB); F->insert(It, midMBB); F->insert(It, exitMBB); - exitMBB->transferSuccessors(BB); + exitMBB->splice(exitMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + exitMBB->transferSuccessorsAndUpdatePHIs(BB); MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = @@ -5020,7 +5032,7 @@ llvm_unreachable("Unexpected instr type to insert"); } - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -1007,21 +1007,20 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII.get(BROpcode)).addMBB(sinkMBB).addImm(CC); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - // Next, add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); // copy0MBB: // %FalseValue = ... @@ -1035,11 +1034,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII.get(SP::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, TII.get(SP::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -827,16 +827,20 @@ MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *copy1MBB = F->CreateMachineBasicBlock(LLVM_BB); SystemZCC::CondCodes CC = (SystemZCC::CondCodes)MI->getOperand(3).getImm(); - BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); F->insert(I, copy0MBB); F->insert(I, copy1MBB); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. - copy1MBB->transferSuccessors(BB); + copy1MBB->splice(copy1MBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + copy1MBB->transferSuccessorsAndUpdatePHIs(BB); // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(copy1MBB); + BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to copy1MBB @@ -849,11 +853,11 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = copy1MBB; - BuildMI(BB, dl, TII.get(SystemZ::PHI), + BuildMI(*BB, BB->begin(), dl, TII.get(SystemZ::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -8023,8 +8023,11 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Move all successors to thisMBB to nextMBB - nextMBB->transferSuccessors(thisMBB); + // Transfer the remainder of thisMBB and its successor edges to nextMBB. + nextMBB->splice(nextMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(bInstr)), + thisMBB->end()); + nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8087,7 +8090,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - F->DeleteMachineInstr(bInstr); // The pseudo instruction is gone now. + bInstr->eraseFromParent(); // The pseudo instruction is gone now. return nextMBB; } @@ -8132,8 +8135,11 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Move all successors to thisMBB to nextMBB - nextMBB->transferSuccessors(thisMBB); + // Transfer the remainder of thisMBB and its successor edges to nextMBB. + nextMBB->splice(nextMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(bInstr)), + thisMBB->end()); + nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8250,7 +8256,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - F->DeleteMachineInstr(bInstr); // The pseudo instruction is gone now. + bInstr->eraseFromParent(); // The pseudo instruction is gone now. return nextMBB; } @@ -8284,8 +8290,11 @@ F->insert(MBBIter, newMBB); F->insert(MBBIter, nextMBB); - // Move all successors of thisMBB to nextMBB - nextMBB->transferSuccessors(thisMBB); + // Transfer the remainder of thisMBB and its successor edges to nextMBB. + nextMBB->splice(nextMBB->begin(), thisMBB, + llvm::next(MachineBasicBlock::iterator(mInstr)), + thisMBB->end()); + nextMBB->transferSuccessorsAndUpdatePHIs(thisMBB); // Update thisMBB to fall through to newMBB thisMBB->addSuccessor(newMBB); @@ -8353,7 +8362,7 @@ // insert branch BuildMI(newMBB, dl, TII->get(X86::JNE_4)).addMBB(newMBB); - F->DeleteMachineInstr(mInstr); // The pseudo instruction is gone now. + mInstr->eraseFromParent(); // The pseudo instruction is gone now. return nextMBB; } @@ -8363,7 +8372,6 @@ X86TargetLowering::EmitPCMP(MachineInstr *MI, MachineBasicBlock *BB, unsigned numArgs, bool memArg) const { - MachineFunction *F = BB->getParent(); DebugLoc dl = MI->getDebugLoc(); const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); @@ -8385,7 +8393,7 @@ BuildMI(BB, dl, TII->get(X86::MOVAPSrr), MI->getOperand(0).getReg()) .addReg(X86::XMM0); - F->DeleteMachineInstr(MI); + MI->eraseFromParent(); return BB; } @@ -8414,9 +8422,12 @@ F->insert(MBBIter, XMMSaveMBB); F->insert(MBBIter, EndMBB); - // Set up the CFG. - // Move any original successors of MBB to the end block. - EndMBB->transferSuccessors(MBB); + // Transfer the remainder of MBB and its successor edges to EndMBB. + EndMBB->splice(EndMBB->begin(), MBB, + llvm::next(MachineBasicBlock::iterator(MI)), + MBB->end()); + EndMBB->transferSuccessorsAndUpdatePHIs(MBB); + // The original block will now fall through to the XMM save block. MBB->addSuccessor(XMMSaveMBB); // The XMMSaveMBB will fall through to the end block. @@ -8455,7 +8466,7 @@ .addMemOperand(MMO); } - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return EndMBB; } @@ -8484,44 +8495,39 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - unsigned Opc = - X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); - - BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); - - // Add the true and fallthrough blocks as its successors. - BB->addSuccessor(copy0MBB); - BB->addSuccessor(sinkMBB); - // If the EFLAGS register isn't dead in the terminator, then claim that it's // live into the sink and copy blocks. const MachineFunction *MF = BB->getParent(); const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo(); BitVector ReservedRegs = TRI->getReservedRegs(*MF); - const MachineInstr *Term = BB->getFirstTerminator(); - for (unsigned I = 0, E = Term->getNumOperands(); I != E; ++I) { - const MachineOperand &MO = Term->getOperand(I); - if (!MO.isReg() || MO.isKill() || MO.isDead()) continue; + for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) { + const MachineOperand &MO = MI->getOperand(I); + if (!MO.isReg() || !MO.isUse() || MO.isKill()) continue; unsigned Reg = MO.getReg(); if (Reg != X86::EFLAGS) continue; copy0MBB->addLiveIn(Reg); sinkMBB->addLiveIn(Reg); } + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + + // Add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + + // Create the conditional branch instruction. + unsigned Opc = + X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); + BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -8530,11 +8536,12 @@ // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... - BuildMI(sinkMBB, DL, TII->get(X86::PHI), MI->getOperand(0).getReg()) + BuildMI(*sinkMBB, sinkMBB->begin(), DL, + TII->get(X86::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(1).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return sinkMBB; } @@ -8543,21 +8550,20 @@ MachineBasicBlock *BB) const { const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); DebugLoc DL = MI->getDebugLoc(); - MachineFunction *F = BB->getParent(); // The lowering is pretty easy: we're just emitting the call to _alloca. The // non-trivial part is impdef of ESP. // FIXME: The code should be tweaked as soon as we'll try to do codegen for // mingw-w64. - BuildMI(BB, DL, TII->get(X86::CALLpcrel32)) + BuildMI(*BB, MI, DL, TII->get(X86::CALLpcrel32)) .addExternalSymbol("_alloca") .addReg(X86::EAX, RegState::Implicit) .addReg(X86::ESP, RegState::Implicit) .addReg(X86::EAX, RegState::Define | RegState::Implicit) .addReg(X86::ESP, RegState::Define | RegState::Implicit); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } @@ -8576,35 +8582,38 @@ assert(MI->getOperand(3).isGlobal() && "This should be a global"); if (Subtarget->is64Bit()) { - MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV64rm), X86::RDI) + MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, + TII->get(X86::MOV64rm), X86::RDI) .addReg(X86::RIP) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(BB, DL, TII->get(X86::CALL64m)); + MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL64m)); addDirectMem(MIB, X86::RDI).addReg(0); } else if (getTargetMachine().getRelocationModel() != Reloc::PIC_) { - MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV32rm), X86::EAX) + MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, + TII->get(X86::MOV32rm), X86::EAX) .addReg(0) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(BB, DL, TII->get(X86::CALL32m)); + MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL32m)); addDirectMem(MIB, X86::EAX).addReg(0); } else { - MachineInstrBuilder MIB = BuildMI(BB, DL, TII->get(X86::MOV32rm), X86::EAX) + MachineInstrBuilder MIB = BuildMI(*BB, MI, DL, + TII->get(X86::MOV32rm), X86::EAX) .addReg(TII->getGlobalBaseReg(F)) .addImm(0).addReg(0) .addGlobalAddress(MI->getOperand(3).getGlobal(), 0, MI->getOperand(3).getTargetFlags()) .addReg(0); - MIB = BuildMI(BB, DL, TII->get(X86::CALL32m)); + MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL32m)); addDirectMem(MIB, X86::EAX).addReg(0); } - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } @@ -8648,23 +8657,25 @@ // mode when truncating to an integer value. MachineFunction *F = BB->getParent(); int CWFrameIdx = F->getFrameInfo()->CreateStackObject(2, 2, false); - addFrameReference(BuildMI(BB, DL, TII->get(X86::FNSTCW16m)), CWFrameIdx); + addFrameReference(BuildMI(*BB, MI, DL, + TII->get(X86::FNSTCW16m)), CWFrameIdx); // Load the old value of the high byte of the control word... unsigned OldCW = F->getRegInfo().createVirtualRegister(X86::GR16RegisterClass); - addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16rm), OldCW), + addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16rm), OldCW), CWFrameIdx); // Set the high part to be round to zero... - addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16mi)), CWFrameIdx) + addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16mi)), CWFrameIdx) .addImm(0xC7F); // Reload the modified control word now... - addFrameReference(BuildMI(BB, DL, TII->get(X86::FLDCW16m)), CWFrameIdx); + addFrameReference(BuildMI(*BB, MI, DL, + TII->get(X86::FLDCW16m)), CWFrameIdx); // Restore the memory image of control word to original value - addFrameReference(BuildMI(BB, DL, TII->get(X86::MOV16mr)), CWFrameIdx) + addFrameReference(BuildMI(*BB, MI, DL, TII->get(X86::MOV16mr)), CWFrameIdx) .addReg(OldCW); // Get the X86 opcode to use. @@ -8703,13 +8714,14 @@ } else { AM.Disp = Op.getImm(); } - addFullAddress(BuildMI(BB, DL, TII->get(Opc)), AM) + addFullAddress(BuildMI(*BB, MI, DL, TII->get(Opc)), AM) .addReg(MI->getOperand(X86AddrNumOperands).getReg()); // Reload the original control word now. - addFrameReference(BuildMI(BB, DL, TII->get(X86::FLDCW16m)), CWFrameIdx); + addFrameReference(BuildMI(*BB, MI, DL, + TII->get(X86::FLDCW16m)), CWFrameIdx); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } // String/text processing lowering. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Tue Jul 6 15:24:04 2010 @@ -173,14 +173,14 @@ // Install an instruction selector. PM.add(createX86ISelDag(*this, OptLevel)); - // Install a pass to insert x87 FP_REG_KILL instructions, as needed. - PM.add(createX87FPRegKillInserterPass()); - return false; } bool X86TargetMachine::addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { + // Install a pass to insert x87 FP_REG_KILL instructions, as needed. + PM.add(createX87FPRegKillInserterPass()); + PM.add(createX86MaxStackAlignmentHeuristicPass()); return false; // -print-machineinstr shouldn't print after this. } Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107691&r1=107690&r2=107691&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Tue Jul 6 15:24:04 2010 @@ -1221,23 +1221,22 @@ MachineFunction *F = BB->getParent(); MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); - BuildMI(BB, dl, TII.get(XCore::BRFT_lru6)) - .addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current - // block to the new block which will contain the Phi node for the select. - for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), - E = BB->succ_end(); I != E; ++I) - sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true - // and fallthrough blocks as its successors. - while (!BB->succ_empty()) - BB->removeSuccessor(BB->succ_begin()); + + // Transfer the remainder of BB and its successor edges to sinkMBB. + sinkMBB->splice(sinkMBB->begin(), BB, + llvm::next(MachineBasicBlock::iterator(MI)), + BB->end()); + sinkMBB->transferSuccessorsAndUpdatePHIs(BB); + // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); + BuildMI(BB, dl, TII.get(XCore::BRFT_lru6)) + .addReg(MI->getOperand(1).getReg()).addMBB(sinkMBB); + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB @@ -1250,11 +1249,12 @@ // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; - BuildMI(BB, dl, TII.get(XCore::PHI), MI->getOperand(0).getReg()) + BuildMI(*BB, BB->begin(), dl, + TII.get(XCore::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(3).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(2).getReg()).addMBB(thisMBB); - F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + MI->eraseFromParent(); // The pseudo instruction is gone now. return BB; } From stoklund at 2pi.dk Tue Jul 6 15:31:52 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 06 Jul 2010 20:31:52 -0000 Subject: [llvm-commits] [llvm] r107695 - in /llvm/trunk: include/llvm/CodeGen/RegisterCoalescer.h lib/CodeGen/RegisterCoalescer.cpp lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/X86/pic.ll Message-ID: <20100706203152.1DFE02A6C12C@llvm.org> Author: stoklund Date: Tue Jul 6 15:31:51 2010 New Revision: 107695 URL: http://llvm.org/viewvc/llvm-project?rev=107695&view=rev Log: Be more forgiving when calculating alias interference for physreg coalescing. It is OK for an alias live range to overlap if there is a copy to or from the physical register. CoalescerPair can work out if the copy is coalescable independently of the alias. This means that we can join with the actual destination interval instead of using the getOrigDstReg() hack. It is no longer necessary to merge clobber ranges into subregisters. Modified: llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/test/CodeGen/X86/pic.ll Modified: llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h?rev=107695&r1=107694&r2=107695&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h (original) +++ llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h Tue Jul 6 15:31:51 2010 @@ -165,9 +165,6 @@ /// virtual register. unsigned subIdx_; - /// origDstReg_ - dstReg_ without subreg adjustments. - unsigned origDstReg_; - /// partial_ - True when the original copy was a partial subregister copy. bool partial_; @@ -192,8 +189,7 @@ public: CoalescerPair(const TargetInstrInfo &tii, const TargetRegisterInfo &tri) : tii_(tii), tri_(tri), dstReg_(0), srcReg_(0), subIdx_(0), - origDstReg_(0), partial_(false), crossClass_(false), flipped_(false), - newRC_(0) {} + partial_(false), crossClass_(false), flipped_(false), newRC_(0) {} /// setRegisters - set registers to match the copy instruction MI. Return /// false if MI is not a coalescable copy instruction. @@ -232,10 +228,6 @@ /// coalesced into, or 0. unsigned getSubIdx() const { return subIdx_; } - /// getOrigDstReg - Return DstReg as it appeared in the original copy - /// instruction before any subreg adjustments. - unsigned getOrigDstReg() const { return isPhys() ? origDstReg_ : dstReg_; } - /// getNewRC - Return the register class of the coalesced register. const TargetRegisterClass *getNewRC() const { return newRC_; } }; Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=107695&r1=107694&r2=107695&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Tue Jul 6 15:31:51 2010 @@ -83,7 +83,6 @@ std::swap(SrcSub, DstSub); flipped_ = true; } - origDstReg_ = Dst; const MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107695&r1=107694&r2=107695&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jul 6 15:31:51 2010 @@ -101,6 +101,11 @@ /// bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(const CoalescerPair &CP, MachineInstr *CopyMI) { + // Bail if there is no dst interval - can happen when merging physical subreg + // operations. + if (!li_->hasInterval(CP.getDstReg())) + return false; + LiveInterval &IntA = li_->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); LiveInterval &IntB = @@ -110,7 +115,7 @@ // BValNo is a value number in B that is defined by a copy from A. 'B3' in // the example above. LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); - assert(BLR != IntB.end() && "Live range not found!"); + if (BLR == IntB.end()) return false; VNInfo *BValNo = BLR->valno; // Get the location that B is defined at. Two options: either this value has @@ -301,23 +306,31 @@ /// /// This returns true if an interval was modified. /// -bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA, - LiveInterval &IntB, +bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, MachineInstr *CopyMI) { - SlotIndex CopyIdx = - li_->getInstructionIndex(CopyMI).getDefIndex(); - // FIXME: For now, only eliminate the copy by commuting its def when the // source register is a virtual register. We want to guard against cases // where the copy is a back edge copy and commuting the def lengthen the // live interval of the source register to the entire loop. - if (TargetRegisterInfo::isPhysicalRegister(IntA.reg)) + if (CP.isPhys() && CP.isFlipped()) + return false; + + // Bail if there is no dst interval. + if (!li_->hasInterval(CP.getDstReg())) return false; + SlotIndex CopyIdx = + li_->getInstructionIndex(CopyMI).getDefIndex(); + + LiveInterval &IntA = + li_->getInterval(CP.isFlipped() ? CP.getDstReg() : CP.getSrcReg()); + LiveInterval &IntB = + li_->getInterval(CP.isFlipped() ? CP.getSrcReg() : CP.getDstReg()); + // BValNo is a value number in B that is defined by a copy from A. 'B3' in // the example above. LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); - assert(BLR != IntB.end() && "Live range not found!"); + if (BLR == IntB.end()) return false; VNInfo *BValNo = BLR->valno; // Get the location that B is defined at. Two options: either this value has @@ -505,16 +518,6 @@ if (EI != BExtend.end()) End = EI->second; IntB.addRange(LiveRange(AI->start, End, ValNo)); - - // If the IntB live range is assigned to a physical register, and if that - // physreg has sub-registers, update their live intervals as well. - if (BHasSubRegs) { - for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { - LiveInterval &SRLI = li_->getInterval(*SR); - SRLI.MergeInClobberRange(*li_, AI->start, End, - li_->getVNInfoAllocator()); - } - } } ValNo->setHasPHIKill(BHasPHIKill); @@ -1134,11 +1137,6 @@ } } - // We may need the source interval after JoinIntervals has destroyed it. - OwningPtr SavedLI; - if (CP.getOrigDstReg() != CP.getDstReg()) - SavedLI.reset(li_->dupInterval(&li_->getInterval(CP.getSrcReg()))); - // Okay, attempt to join these two intervals. On failure, this returns false. // Otherwise, if one of the intervals being joined is a physreg, this method // always canonicalizes DstInt to be it. The output "SrcInt" will not have @@ -1155,12 +1153,8 @@ // If we can eliminate the copy without merging the live ranges, do so now. if (!CP.isPartial()) { - LiveInterval *UseInt = &li_->getInterval(CP.getSrcReg()); - LiveInterval *DefInt = &li_->getInterval(CP.getDstReg()); - if (CP.isFlipped()) - std::swap(UseInt, DefInt); if (AdjustCopiesBackFrom(CP, CopyMI) || - RemoveCopyByCommutingDef(*UseInt, *DefInt, CopyMI)) { + RemoveCopyByCommutingDef(CP, CopyMI)) { JoinedCopies.insert(CopyMI); DEBUG(dbgs() << "\tTrivial!\n"); return true; @@ -1173,38 +1167,6 @@ return false; } - if (CP.isPhys()) { - // If this is a extract_subreg where dst is a physical register, e.g. - // cl = EXTRACT_SUBREG reg1024, 1 - // then create and update the actual physical register allocated to RHS. - unsigned LargerDstReg = CP.getDstReg(); - if (CP.getOrigDstReg() != CP.getDstReg()) { - if (tri_->isSubRegister(CP.getOrigDstReg(), LargerDstReg)) - LargerDstReg = CP.getOrigDstReg(); - LiveInterval &RealInt = li_->getOrCreateInterval(CP.getDstReg()); - for (LiveInterval::const_vni_iterator I = SavedLI->vni_begin(), - E = SavedLI->vni_end(); I != E; ++I) { - const VNInfo *ValNo = *I; - VNInfo *NewValNo = RealInt.getNextValue(ValNo->def, ValNo->getCopy(), - false, // updated at * - li_->getVNInfoAllocator()); - NewValNo->setFlags(ValNo->getFlags()); // * updated here. - RealInt.MergeValueInAsValue(*SavedLI, ValNo, NewValNo); - } - RealInt.weight += SavedLI->weight; - } - - // Update the liveintervals of sub-registers. - LiveInterval &LargerInt = li_->getInterval(LargerDstReg); - for (const unsigned *AS = tri_->getSubRegisters(LargerDstReg); *AS; ++AS) { - LiveInterval &SRI = li_->getOrCreateInterval(*AS); - SRI.MergeInClobberRanges(*li_, LargerInt, li_->getVNInfoAllocator()); - DEBUG({ - dbgs() << "\t\tsubreg: "; SRI.print(dbgs(), tri_); dbgs() << "\n"; - }); - } - } - // Coalescing to a virtual register that is of a sub-register class of the // other. Make sure the resulting register is set to the right register class. if (CP.isCrossClass()) { @@ -1311,50 +1273,44 @@ LiveInterval &RHS = li_->getInterval(CP.getSrcReg()); DEBUG({ dbgs() << "\t\tRHS = "; RHS.print(dbgs(), tri_); dbgs() << "\n"; }); - // FIXME: Join into CP.getDstReg instead of CP.getOrigDstReg. - // When looking at - // %reg2000 = EXTRACT_SUBREG %EAX, sub_16bit - // we really want to join %reg2000 with %AX ( = CP.getDstReg). We are actually - // joining into %EAX ( = CP.getOrigDstReg) because it is guaranteed to have an - // existing live interval, and we are better equipped to handle interference. - // JoinCopy cleans up the mess by taking a copy of RHS before calling here, - // and merging that copy into CP.getDstReg after. - - // If a live interval is a physical register, conservatively check if any - // of its sub-registers is overlapping the live interval of the virtual - // register. If so, do not coalesce. - if (CP.isPhys() && *tri_->getSubRegisters(CP.getOrigDstReg())) { - // If it's coalescing a virtual register to a physical register, estimate - // its live interval length. This is the *cost* of scanning an entire live - // interval. If the cost is low, we'll do an exhaustive check instead. - - // If this is something like this: - // BB1: - // v1024 = op - // ... - // BB2: - // ... - // RAX = v1024 - // - // That is, the live interval of v1024 crosses a bb. Then we can't rely on - // less conservative check. It's possible a sub-register is defined before - // v1024 (or live in) and live out of BB1. - if (RHS.containsOneValue() && - li_->intervalIsInOneMBB(RHS) && - li_->getApproximateInstructionCount(RHS) <= 10) { - // Perform a more exhaustive check for some common cases. - if (li_->conflictsWithAliasRef(RHS, CP.getOrigDstReg(), JoinedCopies)) - return false; - } else { - for (const unsigned* SR = tri_->getAliasSet(CP.getOrigDstReg()); *SR; - ++SR) - if (li_->hasInterval(*SR) && RHS.overlaps(li_->getInterval(*SR))) { + // If a live interval is a physical register, check for interference with any + // aliases. The interference check implemented here is a bit more conservative + // than the full interfeence check below. We allow overlapping live ranges + // only when one is a copy of the other. + if (CP.isPhys()) { + for (const unsigned *AS = tri_->getAliasSet(CP.getDstReg()); *AS; ++AS){ + if (!li_->hasInterval(*AS)) + continue; + const LiveInterval &LHS = li_->getInterval(*AS); + LiveInterval::const_iterator LI = LHS.begin(); + for (LiveInterval::const_iterator RI = RHS.begin(), RE = RHS.end(); + RI != RE; ++RI) { + LI = std::lower_bound(LI, LHS.end(), RI->start); + // Does LHS have an overlapping live range starting before RI? + if ((LI != LHS.begin() && LI[-1].end > RI->start) && + (RI->start != RI->valno->def || + !CP.isCoalescable(li_->getInstructionFromIndex(RI->start)))) { DEBUG({ - dbgs() << "\tInterfere with sub-register "; - li_->getInterval(*SR).print(dbgs(), tri_); - }); + dbgs() << "\t\tInterference from alias: "; + LHS.print(dbgs(), tri_); + dbgs() << "\n\t\tOverlap at " << RI->start << " and no copy.\n"; + }); return false; } + + // Check that LHS ranges beginning in this range are copies. + for (; LI != LHS.end() && LI->start < RI->end; ++LI) { + if (LI->start != LI->valno->def || + !CP.isCoalescable(li_->getInstructionFromIndex(LI->start))) { + DEBUG({ + dbgs() << "\t\tInterference from alias: "; + LHS.print(dbgs(), tri_); + dbgs() << "\n\t\tDef at " << LI->start << " is not a copy.\n"; + }); + return false; + } + } + } } } @@ -1366,7 +1322,7 @@ DenseMap RHSValsDefinedFromLHS; SmallVector NewVNInfo; - LiveInterval &LHS = li_->getInterval(CP.getOrigDstReg()); + LiveInterval &LHS = li_->getOrCreateInterval(CP.getDstReg()); DEBUG({ dbgs() << "\t\tLHS = "; LHS.print(dbgs(), tri_); dbgs() << "\n"; }); // Loop over the value numbers of the LHS, seeing if any are defined from Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=107695&r1=107694&r2=107695&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Tue Jul 6 15:31:51 2010 @@ -130,8 +130,7 @@ /// If the source value number is defined by a commutable instruction and /// its other operand is coalesced to the copy dest register, see if we /// can transform the copy into a noop by commuting the definition. - bool RemoveCopyByCommutingDef(LiveInterval &IntA, LiveInterval &IntB, - MachineInstr *CopyMI); + bool RemoveCopyByCommutingDef(const CoalescerPair &CP,MachineInstr *CopyMI); /// TrimLiveIntervalToLastUse - If there is a last use in the same basic /// block as the copy instruction, trim the ive interval to the last use Modified: llvm/trunk/test/CodeGen/X86/pic.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic.ll?rev=107695&r1=107694&r2=107695&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic.ll Tue Jul 6 15:31:51 2010 @@ -78,8 +78,8 @@ ; LINUX: call .L3$pb ; LINUX-NEXT: .L3$pb: ; LINUX: popl -; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L3$pb), -; LINUX: movl pfoo at GOT(%esi), +; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L3$pb), %[[REG3:e..]] +; LINUX: movl pfoo at GOT(%[[REG3]]), ; LINUX: call afoo at PLT ; LINUX: call * } From clattner at apple.com Tue Jul 6 15:47:26 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 6 Jul 2010 13:47:26 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <4C32B21B.7070304@mxc.ca> References: <4C32B21B.7070304@mxc.ca> Message-ID: <27420030-D9F3-4313-8950-5E7528203E56@apple.com> On Jul 5, 2010, at 9:33 PM, Nick Lewycky wrote: > The attached patch adds a function attribute, "halting", which models the assertion that a function does not have the side-effect of looping indefinitely. This is for llvm.org/PR965 Hi Nick, I haven't had a chance to look at the patch yet, some thoughts: > * modifies the asm printer and parser, LangRef and VMCore to support the new bit > * all intrinsics are marked with 'halting' as they are with 'nounwind' > * the -simplify-libcalls pass now marks certain (non-I/O) library functions as being halting Ok. > * a new pass named HaltingAttr is added to mark up functions with the halting attribute. If necessary, it queries SCEV for an upper bound on the loop trip count. It is not an SCC pass. Why can't this be done in the existing bottom-up pass for inferring this? > * Instruction::mayHaveSideEffects considers not halting to be a side-effect > * Instruction::isSafeToSpeculativelyExecute will now return true for some call instructions (only for intrinsics marked 'readnone nounwind halting'). LLVM was audited to make sure this was safe, the only change made for it is in lib/Transforms/Scalar/Sink.cpp. Makes sense. -Chris From nicholas at mxc.ca Tue Jul 6 15:50:50 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 6 Jul 2010 13:50:50 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <27420030-D9F3-4313-8950-5E7528203E56@apple.com> References: <4C32B21B.7070304@mxc.ca> <27420030-D9F3-4313-8950-5E7528203E56@apple.com> Message-ID: On Tue, Jul 6, 2010 at 1:47 PM, Chris Lattner wrote: > > On Jul 5, 2010, at 9:33 PM, Nick Lewycky wrote: > > > The attached patch adds a function attribute, "halting", which models the > assertion that a function does not have the side-effect of looping > indefinitely. This is for llvm.org/PR965 > > Hi Nick, > > I haven't had a chance to look at the patch yet, some thoughts: > > > * modifies the asm printer and parser, LangRef and VMCore to support the > new bit > > * all intrinsics are marked with 'halting' as they are with 'nounwind' > > * the -simplify-libcalls pass now marks certain (non-I/O) library > functions as being halting > > Ok. > > > * a new pass named HaltingAttr is added to mark up functions with the > halting attribute. If necessary, it queries SCEV for an upper bound on the > loop trip count. It is not an SCC pass. > > Why can't this be done in the existing bottom-up pass for inferring this? > SCC passes can't depend on FunctionPasses like LoopInfo and SCEV. Also, we can't make use of SCC anyhow because two functions that halt locally but also call each other aren't necessarily halting; they could recurse infinitely. However, having the CallGraphNode* is useful to avoid a linear scan looking for CallInst's as it already has the list. Finally, my patch was missing the part where I actually add HaltingAttr to the list of standard passes. I need to think more about where I want to schedule this; I really want it after the loop optimizations but before the inliner makes its decision. A CGSCCPass would be perfect, were it not for the inability to depend on LoopInfo and SCEV. Nick > > > * Instruction::mayHaveSideEffects considers not halting to be a > side-effect > > * Instruction::isSafeToSpeculativelyExecute will now return true for > some call instructions (only for intrinsics marked 'readnone nounwind > halting'). LLVM was audited to make sure this was safe, the only change made > for it is in lib/Transforms/Scalar/Sink.cpp. > > Makes sense. > > -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/e5ce8e42/attachment.html From sabre at nondot.org Tue Jul 6 15:51:35 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 06 Jul 2010 20:51:35 -0000 Subject: [llvm-commits] [llvm] r107696 - /llvm/trunk/docs/LangRef.html Message-ID: <20100706205135.D043E2A6C12C@llvm.org> Author: lattner Date: Tue Jul 6 15:51:35 2010 New Revision: 107696 URL: http://llvm.org/viewvc/llvm-project?rev=107696&view=rev Log: minor typo Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=107696&r1=107695&r2=107696&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 6 15:51:35 2010 @@ -1066,7 +1066,7 @@
    Note that this definition of noalias is intentionally similar to the definition of restrict in C99 for function - arguments, thought it is slightly weaker. + arguments, though it is slightly weaker.
    For function return values, C99's restrict is not meaningful, while LLVM's noalias is. From clattner at apple.com Tue Jul 6 15:54:33 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 6 Jul 2010 13:54:33 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: References: <4C32B21B.7070304@mxc.ca> <27420030-D9F3-4313-8950-5E7528203E56@apple.com> Message-ID: <0A84B0C8-14C6-4066-A25E-1FD58E314E9B@apple.com> On Jul 6, 2010, at 1:50 PM, Nick Lewycky wrote: > > * a new pass named HaltingAttr is added to mark up functions with the halting attribute. If necessary, it queries SCEV for an upper bound on the loop trip count. It is not an SCC pass. > > Why can't this be done in the existing bottom-up pass for inferring this? > > SCC passes can't depend on FunctionPasses like LoopInfo and SCEV. I think that having the existing SCC pass propagate the bit from callee to caller where possible makes sense. How does a function pass know it is going to visit a callee before a caller? For a function to be "halting" all called functions also have to be known to halt. > Also, we can't make use of SCC anyhow because two functions that halt locally but also call each other aren't necessarily halting; they could recurse infinitely. However, having the CallGraphNode* is useful to avoid a linear scan looking for CallInst's as it already has the list. Are you saying that you really have to give up on any non-leaf function? > Finally, my patch was missing the part where I actually add HaltingAttr to the list of standard passes. I need to think more about where I want to schedule this; I really want it after the loop optimizations but before the inliner makes its decision. A CGSCCPass would be perfect, were it not for the inability to depend on LoopInfo and SCEV. At the high level, this is the part I'm most concerned with. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/b6a158ca/attachment.html From nicholas at mxc.ca Tue Jul 6 15:56:44 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 6 Jul 2010 13:56:44 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <4C32EDDE.50600@free.fr> References: <4C32B21B.7070304@mxc.ca> <4C32EDDE.50600@free.fr> Message-ID: On Tue, Jul 6, 2010 at 1:48 AM, Duncan Sands wrote: > Hi Nick, > > > The attached patch adds a function attribute, "halting", which models > > the assertion that a function does not have the side-effect of looping > > indefinitely. This is for llvm.org/PR965 > > yay! > > > +
    halting
    > > +
    This attribute specifies that the function may be assumed to halt. > This > > + does not necessarily imply that it will return (it may terminate > the > > + program instead), > -> This does not necessarily imply that it will return, since terminating > the > program and unwinding an exception are also considered halting. > > Also, I think here you should end this sentence, and the following should > be a > new sentence: > > but the attribute may be applied for any language where > > + infinite loops are not considered a visible side-effect. > > -> A function that loops forever is not halting. However languages where > infinite loops are not considered a visible side-effect can indicate this > by applying the halting attribute to such functions anyway. > > A loop is known > > + to be halting only if an upper limit on iterations is known before > the > > + loop begins.
    > > This sounds like an implementation detail - should it be here? > Is it? Consider an I/O function that reads from the network until it receives "00000", the 'end of communication' sigil. Is that function halting? The current definition makes the answer a clear no, because you can't set an upper bound on the iteration count before entering the loop. Now what if we did consider such a function halting? Do we risk having the program being miscompiled? For some reason I thought there was a case that came up like this where the answer was yes, but I can't think of it right now. Nick > > - } else if (Name == "uname" || > > - Name == "unlink" || > > + } else if (Name == "uname") { > > + if (FTy->getNumParams() != 1 || > > + !FTy->getParamType(0)->isPointerTy()) > > + continue; > > + setIsHalting(F); > > strange indentation. > > > + // Definitions with weak linkage may be overridden at linktime with > > + // something that writes memory, so treat them like declarations. > > -> something that infinite loops, so treat them like declarations. > > Otherwise looks good to me. > > Ciao, > > Duncan. > _______________________________________________ > 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/20100706/86bf1809/attachment.html From nicholas at mxc.ca Tue Jul 6 16:03:11 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 6 Jul 2010 14:03:11 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: <0A84B0C8-14C6-4066-A25E-1FD58E314E9B@apple.com> References: <4C32B21B.7070304@mxc.ca> <27420030-D9F3-4313-8950-5E7528203E56@apple.com> <0A84B0C8-14C6-4066-A25E-1FD58E314E9B@apple.com> Message-ID: On Tue, Jul 6, 2010 at 1:54 PM, Chris Lattner wrote: > On Jul 6, 2010, at 1:50 PM, Nick Lewycky wrote: > > > * a new pass named HaltingAttr is added to mark up functions with the >> halting attribute. If necessary, it queries SCEV for an upper bound on the >> loop trip count. It is not an SCC pass. >> >> Why can't this be done in the existing bottom-up pass for inferring this? >> > > SCC passes can't depend on FunctionPasses like LoopInfo and SCEV. > > > I think that having the existing SCC pass propagate the bit from callee to > caller where possible makes sense. How does a function pass know it is > going to visit a callee before a caller? For a function to be "halting" all > called functions also have to be known to halt. > I tried that. The problem with splitting it into two passes is that the pass doing the local analysis can't safely mark any non-leaf function since the callees haven't been tagged 'halting' yet, and the SCC pass can't mark anything halting since it doesn't have a local analysis to check for loops inside the function itself. Hence they need to be merged. > Also, we can't make use of SCC anyhow because two functions that halt > locally but also call each other aren't necessarily halting; they could > recurse infinitely. However, having the CallGraphNode* is useful to avoid a > linear scan looking for CallInst's as it already has the list. > > > Are you saying that you really have to give up on any non-leaf function? > It's still a bottom-up walk of the call graph, it's just that we can't take advantage of SCCs to infer the property. > Finally, my patch was missing the part where I actually add HaltingAttr to > the list of standard passes. I need to think more about where I want to > schedule this; I really want it after the loop optimizations but before the > inliner makes its decision. A CGSCCPass would be perfect, were it not for > the inability to depend on LoopInfo and SCEV. > > > At the high level, this is the part I'm most concerned with. > Likewise, I hadn't realized how bad it was before sending out the original patch. Once I figure this out I'll send out an patch update. It's possible that there's no good solution here and we just plain need to run the -haltingattr pass before the inliner and loop passes. That would be sad, but not the end of the world. We could deal with the cause of that (undesirable pass manager constraints) separately. Since CallGraph is in lib/Analysis, it's yet another hard problem. Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/43a012cb/attachment.html From dpatel at apple.com Tue Jul 6 16:05:17 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 06 Jul 2010 21:05:17 -0000 Subject: [llvm-commits] [llvm] r107697 - /llvm/trunk/lib/VMCore/Metadata.cpp Message-ID: <20100706210517.B41232A6C12C@llvm.org> Author: dpatel Date: Tue Jul 6 16:05:17 2010 New Revision: 107697 URL: http://llvm.org/viewvc/llvm-project?rev=107697&view=rev Log: Add fixme. Modified: llvm/trunk/lib/VMCore/Metadata.cpp Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=107697&r1=107696&r2=107697&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Jul 6 16:05:17 2010 @@ -133,6 +133,7 @@ static const Function *assertLocalFunction(const MDNode *N) { if (!N->isFunctionLocal()) return 0; + // FIXME: This does not handle cyclic function local metadata. const Function *F = 0, *NewF = 0; for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { if (Value *V = N->getOperand(i)) { From stoklund at 2pi.dk Tue Jul 6 16:06:39 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 06 Jul 2010 21:06:39 -0000 Subject: [llvm-commits] [llvm] r107698 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <20100706210639.B736E2A6C12C@llvm.org> Author: stoklund Date: Tue Jul 6 16:06:39 2010 New Revision: 107698 URL: http://llvm.org/viewvc/llvm-project?rev=107698&view=rev Log: Fix buildbot breakage where a def is missing. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107698&r1=107697&r2=107698&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jul 6 16:06:39 2010 @@ -352,6 +352,8 @@ AValNo->isUnused() || AValNo->hasPHIKill()) return false; MachineInstr *DefMI = li_->getInstructionFromIndex(AValNo->def); + if (!DefMI) + return false; const TargetInstrDesc &TID = DefMI->getDesc(); if (!TID.isCommutable()) return false; From rjmccall at apple.com Tue Jul 6 16:07:14 2010 From: rjmccall at apple.com (John McCall) Date: Tue, 06 Jul 2010 21:07:14 -0000 Subject: [llvm-commits] [llvm] r107699 - /llvm/trunk/docs/LangRef.html Message-ID: <20100706210715.051A52A6C12C@llvm.org> Author: rjmccall Date: Tue Jul 6 16:07:14 2010 New Revision: 107699 URL: http://llvm.org/viewvc/llvm-project?rev=107699&view=rev Log: Closing tags start with slashes. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=107699&r1=107698&r2=107699&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jul 6 16:07:14 2010 @@ -1064,8 +1064,8 @@ For further details, please see the discussion of the NoAlias response in alias analysis.

    - Note that this definition of noalias is intentionally - similar to the definition of restrict in C99 for function + Note that this definition of noalias is intentionally + similar to the definition of restrict in C99 for function arguments, though it is slightly weaker.
    For function return values, C99's restrict is not meaningful, From stoklund at 2pi.dk Tue Jul 6 16:13:03 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 06 Jul 2010 21:13:03 -0000 Subject: [llvm-commits] [llvm] r107700 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <20100706211303.ED3992A6C12C@llvm.org> Author: stoklund Date: Tue Jul 6 16:13:03 2010 New Revision: 107700 URL: http://llvm.org/viewvc/llvm-project?rev=107700&view=rev Log: One more case assuming that subregs have live ranges. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107700&r1=107699&r2=107700&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jul 6 16:13:03 2010 @@ -499,8 +499,8 @@ if (BHasSubRegs) { for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { LiveInterval &SRLI = li_->getInterval(*SR); - const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def); - SRLI.removeValNo(SRLR->valno); + if (const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def)) + SRLI.removeValNo(SRLR->valno); } } IntB.removeValNo(BDeadValNos[i]); From clattner at apple.com Tue Jul 6 16:21:36 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 6 Jul 2010 14:21:36 -0700 Subject: [llvm-commits] patch: add 'halting' function attribute In-Reply-To: References: <4C32B21B.7070304@mxc.ca> <27420030-D9F3-4313-8950-5E7528203E56@apple.com> <0A84B0C8-14C6-4066-A25E-1FD58E314E9B@apple.com> Message-ID: On Jul 6, 2010, at 2:03 PM, Nick Lewycky wrote: > On Tue, Jul 6, 2010 at 1:54 PM, Chris Lattner wrote: > On Jul 6, 2010, at 1:50 PM, Nick Lewycky wrote: >> > * a new pass named HaltingAttr is added to mark up functions with the halting attribute. If necessary, it queries SCEV for an upper bound on the loop trip count. It is not an SCC pass. >> >> Why can't this be done in the existing bottom-up pass for inferring this? >> >> SCC passes can't depend on FunctionPasses like LoopInfo and SCEV. > > I think that having the existing SCC pass propagate the bit from callee to caller where possible makes sense. How does a function pass know it is going to visit a callee before a caller? For a function to be "halting" all called functions also have to be known to halt. > > I tried that. The problem with splitting it into two passes is that the pass doing the local analysis can't safely mark any non-leaf function since the callees haven't been tagged 'halting' yet, and the SCC pass can't mark anything halting since it doesn't have a local analysis to check for loops inside the function itself. Hence they need to be merged. >> Also, we can't make use of SCC anyhow because two functions that halt locally but also call each other aren't necessarily halting; they could recurse infinitely. However, having the CallGraphNode* is useful to avoid a linear scan looking for CallInst's as it already has the list. > > Are you saying that you really have to give up on any non-leaf function? > > It's still a bottom-up walk of the call graph, it's just that we can't take advantage of SCCs to infer the property. Is this still useful in practice, or is this realistically something that just gets marked on intrinsics? Also, are potentially blocking operations (mutex lock, 'write', etc) considered to be halting? >> Finally, my patch was missing the part where I actually add HaltingAttr to the list of standard passes. I need to think more about where I want to schedule this; I really want it after the loop optimizations but before the inliner makes its decision. A CGSCCPass would be perfect, were it not for the inability to depend on LoopInfo and SCEV. > > At the high level, this is the part I'm most concerned with. > > Likewise, I hadn't realized how bad it was before sending out the original patch. Once I figure this out I'll send out an patch update. > > It's possible that there's no good solution here and we just plain need to run the -haltingattr pass before the inliner and loop passes. That would be sad, but not the end of the world. We could deal with the cause of that (undesirable pass manager constraints) separately. Since CallGraph is in lib/Analysis, it's yet another hard problem. The other thing that concerns me is that there is a lot of cases that really can't be handled. Iterating over an std::map or another node-based container can't be handled with this. If you have some sort of front-end attributes (like the halting attribute you proposed for clang) or other language semantics that would be useful, then it makes sense. Some thoughts on the patch: +++ lib/VMCore/Instruction.cpp (working copy) @@ -410,10 +424,14 @@ return false; } case Call: + // A user-defined function could have undefined behavior, even if it's + // readnone nounwind and halting. + if (const IntrinsicInst *II = dyn_cast(this)) { + // FIXME: We should special-case some more intrinsics (bswap, + // overflow-checking arithmetic, etc.) + return II->doesNotAccessMemory() && II->doesNotThrow() && II->isHalting(); + } + return false; I don't understand the fixme here. +++ lib/Transforms/Scalar/Sink.cpp (working copy) @@ -234,7 +234,7 @@ if (SuccToSinkTo->getUniquePredecessor() != ParentBlock) { // We cannot sink a load across a critical edge - there may be stores in // other code paths. - if (!Inst->isSafeToSpeculativelyExecute()) { + if (Inst->mayReadFromMemory()) { DEBUG(dbgs() << " *** PUNTING: Wont sink load along critical edge.\n"); return false; } Why is this safe? I really don't like the halting pass being a modulepass. This isn't going to fit into the compiler well. It either needs to be a cgsccpass, a function pass, or a combination of the two. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/e193b292/attachment.html From bob.wilson at apple.com Tue Jul 6 16:26:18 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 06 Jul 2010 21:26:18 -0000 Subject: [llvm-commits] [llvm] r107701 - in /llvm/trunk/lib/Target/ARM: ARMAddressingModes.h ARMBaseInstrInfo.cpp AsmPrinter/ARMAsmPrinter.cpp Message-ID: <20100706212618.D57F42A6C12C@llvm.org> Author: bwilson Date: Tue Jul 6 16:26:18 2010 New Revision: 107701 URL: http://llvm.org/viewvc/llvm-project?rev=107701&view=rev Log: Represent NEON load/store alignments in bytes, not bits. Modified: llvm/trunk/lib/Target/ARM/ARMAddressingModes.h llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMAddressingModes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAddressingModes.h?rev=107701&r1=107700&r2=107701&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMAddressingModes.h (original) +++ llvm/trunk/lib/Target/ARM/ARMAddressingModes.h Tue Jul 6 16:26:18 2010 @@ -520,6 +520,8 @@ // This is stored in two operands [regaddr, align]. The first is the // address register. The second operand is the value of the alignment // specifier to use or zero if no explicit alignment. + // Valid alignments are: 0, 8, 16, and 32 bytes, depending on the specific + // instruction. } // end namespace ARM_AM } // end namespace llvm Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=107701&r1=107700&r2=107701&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Jul 6 16:26:18 2010 @@ -832,7 +832,7 @@ // FIXME: Neon instructions should support predicates if (Align >= 16 && getRegisterInfo().canRealignStack(MF)) { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::VST1q)) - .addFrameIndex(FI).addImm(128) + .addFrameIndex(FI).addImm(16) .addReg(SrcReg, getKillRegState(isKill)) .addMemOperand(MMO)); } else { @@ -849,7 +849,7 @@ // FIXME: It's possible to only store part of the QQ register if the // spilled def has a sub-register index. MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(ARM::VST2q32)) - .addFrameIndex(FI).addImm(128); + .addFrameIndex(FI).addImm(16); MIB = AddDReg(MIB, SrcReg, ARM::dsub_0, getKillRegState(isKill), TRI); MIB = AddDReg(MIB, SrcReg, ARM::dsub_1, 0, TRI); MIB = AddDReg(MIB, SrcReg, ARM::dsub_2, 0, TRI); @@ -929,7 +929,7 @@ case ARM::QPR_8RegClassID: if (Align >= 16 && getRegisterInfo().canRealignStack(MF)) { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::VLD1q), DestReg) - .addFrameIndex(FI).addImm(128) + .addFrameIndex(FI).addImm(16) .addMemOperand(MMO)); } else { AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::VLDMQ), DestReg) @@ -946,7 +946,7 @@ MIB = AddDReg(MIB, DestReg, ARM::dsub_1, RegState::Define, TRI); MIB = AddDReg(MIB, DestReg, ARM::dsub_2, RegState::Define, TRI); MIB = AddDReg(MIB, DestReg, ARM::dsub_3, RegState::Define, TRI); - AddDefaultPred(MIB.addFrameIndex(FI).addImm(128).addMemOperand(MMO)); + AddDefaultPred(MIB.addFrameIndex(FI).addImm(16).addMemOperand(MMO)); } else { MachineInstrBuilder MIB = AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::VLDMD)) @@ -1131,7 +1131,7 @@ if (MFI.getObjectAlignment(FI) >= 16 && getRegisterInfo().canRealignStack(MF)) { NewMI = BuildMI(MF, MI->getDebugLoc(), get(ARM::VST1q)) - .addFrameIndex(FI).addImm(128) + .addFrameIndex(FI).addImm(16) .addReg(SrcReg, getKillRegState(isKill) | getUndefRegState(isUndef), SrcSubReg) @@ -1157,7 +1157,7 @@ getDeadRegState(isDead) | getUndefRegState(isUndef), DstSubReg) - .addFrameIndex(FI).addImm(128).addImm(Pred).addReg(PredReg); + .addFrameIndex(FI).addImm(16).addImm(Pred).addReg(PredReg); } else { NewMI = BuildMI(MF, MI->getDebugLoc(), get(ARM::VLDMQ)) .addReg(DstReg, 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=107701&r1=107700&r2=107701&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Jul 6 16:26:18 2010 @@ -602,8 +602,12 @@ O << "[" << getRegisterName(MO1.getReg()); if (MO2.getImm()) { + unsigned Align = MO2.getImm(); + assert((Align == 8 || Align == 16 || Align == 32) && + "unexpected NEON load/store alignment"); + Align <<= 3; // FIXME: Both darwin as and GNU as violate ARM docs here. - O << ", :" << MO2.getImm(); + O << ", :" << Align; } O << "]"; } From criswell at uiuc.edu Tue Jul 6 16:26:54 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 06 Jul 2010 21:26:54 -0000 Subject: [llvm-commits] [poolalloc] r107702 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <20100706212654.A157E2A6C12C@llvm.org> Author: criswell Date: Tue Jul 6 16:26:54 2010 New Revision: 107702 URL: http://llvm.org/viewvc/llvm-project?rev=107702&view=rev Log: When transforming call sites, ignore those call sites that use an undef value as the function pointer to call. This is needed to get poolalloc to work properly in bugpoint. This fixes PR#7579. Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=107702&r1=107701&r2=107702&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Tue Jul 6 16:26:54 2010 @@ -654,7 +654,6 @@ const Type* Int32Type = Type::getInt32Ty(CS.getInstruction()->getContext()); - // If the called function is casted from one function type to another, peer // into the cast instruction and pull out the actual function being called. if (ConstantExpr *CE = dyn_cast(CS.getCalledValue())) @@ -667,8 +666,11 @@ return; } - // Ignore calls to NULL pointers. - if (isa(CS.getCalledValue())) { + // + // Ignore calls to NULL pointers or undefined values. + // + if ((isa(CS.getCalledValue())) || + (isa(CS.getCalledValue()))) { errs() << "WARNING: Ignoring call using NULL function pointer.\n"; return; } From ggreif at gmail.com Tue Jul 6 16:29:10 2010 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 6 Jul 2010 14:29:10 -0700 (PDT) Subject: [llvm-commits] [llvm] r107667 - /llvm/trunk/include/llvm/Instructions.h In-Reply-To: References: <20100706154411.CC51C2A6C12C@llvm.org> Message-ID: On 6 Jul., 17:56, Chris Lattner wrote: > On Jul 6, 2010, at 8:44 AM, Gabor Greif wrote: > > > Author: ggreif > > Date: Tue Jul ?6 10:44:11 2010 > > New Revision: 107667 > > > URL:http://llvm.org/viewvc/llvm-project?rev=107667&view=rev > > Log: > > second round of low-level interface squeeze-out: > > making all of CallInst's low-level operand accessors > > private > > > If you get compile errors I strongly urge you to > > update your code. > > Hi Gabor, > > I'm all for the spirit of this patch, however, this is really really gross: > > > > > +# define public private > > +# define protected private > > ? /// Provide fast operand accessors > > ? DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); > > +# undef public > > +# undef protected > > How about declaring a different macro, named DECLARE_PRIVATE_TRANSPARENT_OPERAND_ACCESSORS or something? > Heh, here is my answer from IRC: gabor: sabre: re. gross, yes, but I wanted to minimize the patch. Actually, my first attempt did just what you suggest, but it touched OperandTraits.h, and that appeared too much to me. This hack is strictly transitional, but if we think it should be in v2.8 (and be removed from v2.9) then I am all for rephrasing in a less gross way :-) Classical case of most bang for the buck... ...but it basically boils down to: 1) remove this hack before 2.8 branches and warn external users by release notes 2) keep in 2.8 release and remove from trunk then 3) keep well into the future. I am hesitant with 1) as people often only track the changes when releases come around. 3) seems to be overly rude by breaking the Liskov substitutionality (do not take away what you have promised in the baseclass). So I am all for 2). This means I'll reformulate as soon as my actual patch has finally landed and stuck. Ok? Cheers, Gabor > -Chris > > _______________________________________________ > llvm-commits mailing list > llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From wdietz2 at illinois.edu Tue Jul 6 16:30:46 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 21:30:46 -0000 Subject: [llvm-commits] [poolalloc] r107703 - in /poolalloc/trunk: include/dsa/DataStructure.h lib/DSA/DSTest.cpp lib/DSA/Printer.cpp Message-ID: <20100706213046.D5E1C2A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 16:30:46 2010 New Revision: 107703 URL: http://llvm.org/viewvc/llvm-project?rev=107703&view=rev Log: Added "DSTest" code to facilitate tests querying DSA information. Added: poolalloc/trunk/lib/DSA/DSTest.cpp Modified: poolalloc/trunk/include/dsa/DataStructure.h poolalloc/trunk/lib/DSA/Printer.cpp Modified: poolalloc/trunk/include/dsa/DataStructure.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=107703&r1=107702&r2=107703&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DataStructure.h (original) +++ poolalloc/trunk/include/dsa/DataStructure.h Tue Jul 6 16:30:46 2010 @@ -98,6 +98,10 @@ void print(llvm::raw_ostream &O, const Module *M) const; void dumpCallGraph() const; + /// printTestInfo - Print answers to queries made by tests + /// + void printTestInfo(llvm::raw_ostream &O, const Module *M) const; + virtual void releaseMemory(); virtual bool hasDSGraph(const Function &F) const { Added: poolalloc/trunk/lib/DSA/DSTest.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=107703&view=auto ============================================================================== --- poolalloc/trunk/lib/DSA/DSTest.cpp (added) +++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Jul 6 16:30:46 2010 @@ -0,0 +1,320 @@ +//===- DSTest.cpp - Code for quering DSA results for testing --------------===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by the LLVM research group and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements a few basic operations that allow tests to query +// properties of the DSGraph, with an emphasis on making results something +// that is can be easily verified by 'grep' or similar basic commands. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "dsgraph-test" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" +#include "dsa/DSNode.h" +#include "llvm/Module.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/ValueSymbolTable.h" +#include "llvm/Assembly/Writer.h" +using namespace llvm; + +namespace { + //FIXME: being able to separate -print-node-for-value options with commas would be nice... + cl::list PrintNodesForValues("print-node-for-value", cl::ReallyHidden); + cl::opt OnlyPrintFlags("print-only-flags", cl::ReallyHidden); + cl::opt OnlyPrintValues("print-only-values", cl::ReallyHidden); + cl::opt OnlyPrintTypes("print-only-types", cl::ReallyHidden); +} + +/// NodeValue -- represents a particular node in a DSGraph +/// constructed from a serialized string representation of a value +/// +/// FIXME: Make this integrated into cl parsing, as mentioned: +/// http://llvm.org/docs/CommandLine.html#customparser +/// +/// Supported formats (so far) +/// graph:value[:offset]* +/// Examples: +/// "value" specifies 'value' in the globals graph +/// "func:value" specifies 'value' in graph for function 'func' +/// "func:value:0" the node pointed to at offset 0 from the above +/// "func:value:0:1" the node pointed to at offset 1 from the above +/// ..etc +/// We are also robust to "@value" and "@func" notation for convenience +/// FIXME: Support querying special nodes like return nodes, VANodes, etc +class NodeValue { + // Containing Function, if applicable. + Function *F; + // Value in that graph's scalarmap that we base off of + // (note that the NH we have below could be indexed a few times + // from this value, only corresponds directly if no offsets) + Value *V; + // DSNodehandle + DSNodeHandle NH; + + // String version (that we were given) + StringRef serialized; + + // Parsed list of offsets + typedef SmallVector OffsetVectorTy; + OffsetVectorTy offsets; + + NodeValue() {}; + void operator=(const NodeValue&); + NodeValue(const NodeValue&); + + void initialize(const Module *M, const DataStructures *DS) { + parseValue(M); + assert(V && "Failed to parse value?"); + if (isa(V)) { + DSGraph *G = DS->getGlobalsGraph(); + assert(G->hasNodeForValue(V) && "Node not in specified graph!"); + NH = G->getNodeForValue(V); + } else { + assert(F && "No function?"); + DSGraph *G = DS->getDSGraph(*F); + assert(G->hasNodeForValue(V) && "Node not in specified graph!"); + NH = G->getNodeForValue(V); + } + // Handle offsets, if any + // For each offset in the offsets vector, follow the link at that offset + for (OffsetVectorTy::const_iterator I = offsets.begin(), E = offsets.end(); + I != E; ++I ) { + assert(!NH.isNull() && "Null NodeHandle?"); + assert(NH.hasLink(*I) && "Handle doesn't have link?"); + // Follow the offset + NH = NH.getLink(*I); + } + } + + /// parseValue -- sets value for the string we were constructed on, + /// using the provided module as the context to find the value + void parseValue(const Module *M) { + unsigned count = serialized.count(':'); + if (count == 0) { + // Global case + // format: "[@]value" + StringRef globalName = stripAtIfRequired(serialized); + + V = M->getNamedValue(globalName); + assert(V && "Unable to find specified global!"); + } else { // count >= 1 + // Function-specific case + // format: "[@]func:value" + // format: "[@]func:value:offset0:offset1:offset2" + + std::pair split = serialized.split(':'); + StringRef func = stripAtIfRequired(split.first); + StringRef value = split.second; + + if (count > 1) { + //If we have more semicolons, split them off to get the value and offsets + std::pair tmp = value.split(':'); + value = tmp.first; + StringRef offStrings = tmp.second; + + //Small detour--parse offsets into vector + unsigned offset; + while(offStrings.count(':') > 0) { + tmp = offStrings.split(':'); + assert(!tmp.first.getAsInteger(0,offset) && "failed to parse offset!"); + offsets.push_back(offset); + offStrings = tmp.second; + } + assert(!offStrings.getAsInteger(0,offset) && "failed to parse offset!"); + offsets.push_back(offset); + } + // Now back to your regularly scheduled programming... + + // First, find the function + F = M->getFunction(func); + assert(F && "Unable to find function specified!"); + + // Now we try to find the value... + // FIXME: This only works for named values, things like "%1" don't work. + // That might not be a deal breaker, but should be clear. + V = F->getValueSymbolTable().lookup(value); + + assert(V && "Unable to find value in specified function!"); + + } + + assert(V && "Parsing value failed!"); + } + + /// stripAtIfRequired -- removes the leading '@' character if one exists + /// + StringRef stripAtIfRequired(StringRef v) { + if (!v.startswith("@")) + return v; + + assert(v.size() > 1 && "String too short"); + + return v.substr(1); + } +public: + /// Constructor (from string) + NodeValue(std::string & raw, const Module * M, const DataStructures *DS) + : F(NULL), V(NULL), serialized(raw) { + initialize(M,DS); + assert(V && NH.getNode() && "Parse failed!"); + }; + + /// Accessors + DSNodeHandle & getNodeH() { return NH; } + DSGraph * getGraph() { return getNode()->getParentGraph(); } + // FIXME: These two (value/function) aren't used presently, and furthermore + // are a bit confusing in the context of offsets. Make this not lame. + Value * getValue() { return V; } + Function * getFunction() { return F; } + + //Helper to fetch the node from the nodehandle + DSNode * getNode() { + assert(NH.getNode() && "NULL node?"); + return NH.getNode(); + } +}; + +/// printAllValuesForNode -- prints all values for a given node, without a newline +/// (meant to be a helper) +static void printAllValuesForNode(llvm::raw_ostream &O, NodeValue &NV) { + // We only consider other values that are in the graph + // containing the specified node (by design) + + // Look for values that have an equivalent NH + DSNodeHandle &NH = NV.getNodeH(); + const DSGraph::ScalarMapTy &SM = NV.getGraph()->getScalarMap(); + bool first = true; + + for (DSGraph::ScalarMapTy::const_iterator I = SM.begin(), E = SM.end(); + I != E; ++I ) + if (NH == I->second) { + //Found one! + const Value *V = I->first; + + //Print them out, separated by commas + if (!first) O << ","; + first = false; + + // Print out name, if it has one. + // FIXME: Get "%0, "%1", naming like the .ll has? + if (V->hasName()) + O << V->getName(); + else + O << ""; + } + + //FIXME: Search globals in this graph too (not just scalarMap)? +} + +// printTypesForNode --prints all the types for the given NodeValue, without a newline +// (meant to be called as a helper) +static void printTypesForNode(llvm::raw_ostream &O, NodeValue &NV) { + DSNode *N = NV.getNode(); + Module *M = NV.getFunction()->getParent(); + + if (N->isNodeCompletelyFolded()) { + O << "Folded"; + } + + // Go through all the types, and just dump them. + // FIXME: Lifted from Printer.cpp, probably should be shared + if (N->type_begin() != N->type_end()) + for (DSNode::TyMapTy::const_iterator ii = N->type_begin(), + ee = N->type_end(); ii != ee; ++ii) { + O << ii->first << ": "; + if (ii->second) { + bool first = true; + for (svset::const_iterator ni = ii->second->begin(), + ne = ii->second->end(); ni != ne; ++ni) { + if (!first) O << ","; + WriteTypeSymbolic(O, *ni, M); + first = false; + } + } + else + O << "VOID"; + O << " "; + } + else + O << "VOID"; + + if (N->isArrayNode()) + O << " array"; +} + +static void printFlags(llvm::raw_ostream &O, DSNode *N) { + // FIXME: This code is lifted directly from Printer.cpp + // Probably would be good to make this code shared... + // Leaving it separate for now to minimize invasiveness + if (unsigned NodeType = N->getNodeFlags()) { + if (NodeType & DSNode::AllocaNode ) O << "S"; + if (NodeType & DSNode::HeapNode ) O << "H"; + if (NodeType & DSNode::GlobalNode ) O << "G"; + if (NodeType & DSNode::UnknownNode ) O << "U"; + if (NodeType & DSNode::IncompleteNode ) O << "I"; + if (NodeType & DSNode::ModifiedNode ) O << "M"; + if (NodeType & DSNode::ReadNode ) O << "R"; + if (NodeType & DSNode::ExternalNode ) O << "E"; + if (NodeType & DSNode::IntToPtrNode ) O << "P"; + if (NodeType & DSNode::PtrToIntNode ) O << "2"; + if (NodeType & DSNode::VAStartNode ) O << "V"; + } +} + +/// printNodes -- print the node specified by NV +/// +/// Format: +/// (can a type include '{}'s, etc?) +/// "flags:{value(s)}:{type(s)}" +/// +/// Additionally, the user can specify to print just one piece +static void printNode(llvm::raw_ostream &O, NodeValue &NV) { + assert( + ((!OnlyPrintFlags && !OnlyPrintValues)|| + (!OnlyPrintFlags && !OnlyPrintTypes) || + (!OnlyPrintValues && !OnlyPrintTypes)) && + "Only one \"Only\" option allowed!"); + + if (OnlyPrintFlags) { + printFlags(O,NV.getNode()); + } else if (OnlyPrintValues) { + printAllValuesForNode(O, NV); + } else if (OnlyPrintTypes) { + printTypesForNode(O,NV); + } else { + //Print all of them + printFlags(O,NV.getNode()); + O << ":{"; + printAllValuesForNode(O, NV); + O << "}:{"; + printTypesForNode(O,NV); + O << "}"; + } + + O << "\n"; +} + +/// printTestInfo -- runs through the user-specified testing arguments (if any) +/// and prints the requested information. +void DataStructures::printTestInfo(llvm::raw_ostream &O, const Module *M) const { + + // For each node the user indicated, print the node. + // See 'printNode' for more details. + for (cl::list::iterator I = PrintNodesForValues.begin(), + E = PrintNodesForValues.end(); I != E; ++I ) { + // Make sense of what the user gave us + NodeValue NV(*I, M, this); + // Print corresponding node + printNode(O, NV); + } +} + Modified: poolalloc/trunk/lib/DSA/Printer.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=107703&r1=107702&r2=107703&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Printer.cpp (original) +++ poolalloc/trunk/lib/DSA/Printer.cpp Tue Jul 6 16:30:46 2010 @@ -34,6 +34,7 @@ cl::list OnlyPrint("dsa-only-print", cl::ReallyHidden); cl::opt DontPrintAnything("dont-print-ds", cl::ReallyHidden); cl::opt LimitPrint("dsa-limit-print", cl::Hidden); + cl::opt PrintDSATest("dstest", cl::ReallyHidden); STATISTIC (MaxGraphSize , "Maximum graph size"); STATISTIC (NumFoldedNodes , "Number of folded nodes (in final graph)"); } @@ -401,6 +402,10 @@ // print - Print out the analysis results... void DataStructures::print(llvm::raw_ostream &O, const Module *M) const { if (DontPrintAnything) return; + if (PrintDSATest) { + printTestInfo(O, M); + return; + } printCollection(*this, O, M, printname); //dumpCallGraph(); } From wdietz2 at illinois.edu Tue Jul 6 16:38:15 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 21:38:15 -0000 Subject: [llvm-commits] [poolalloc] r107704 - in /poolalloc/trunk/test: dsa/ dsa/var_arg/ var_arg/ Message-ID: <20100706213815.C44782A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 16:38:15 2010 New Revision: 107704 URL: http://llvm.org/viewvc/llvm-project?rev=107704&view=rev Log: Move "var_arg" tests to test/dsa/var_arg. Added: poolalloc/trunk/test/dsa/ poolalloc/trunk/test/dsa/var_arg/ - copied from r107700, poolalloc/trunk/test/var_arg/ Removed: poolalloc/trunk/test/var_arg/ From echristo at apple.com Tue Jul 6 16:38:44 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 6 Jul 2010 14:38:44 -0700 Subject: [llvm-commits] [llvm] r107640 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/StackProtector.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h test/CodeGen/Generic/stack-protector.ll test/CodeGen/PowerPC/stack-protector.ll test/CodeGen/X86/stack-protector-linux.ll test/CodeGen/X86/stack-protector.ll In-Reply-To: <87k4p8s36f.fsf@mit.edu> References: <20100706051856.7B0902A6C12C@llvm.org> <87k4p8s36f.fsf@mit.edu> Message-ID: <1BFCAAA5-C835-44B1-B009-9302C654E79F@apple.com> On Jul 6, 2010, at 2:36 PM, Nelson Elhage wrote: > I take it you dropped the X86 tests (in r107641) until you could get > around to FileCheck-izing them, but was it intentional that you > committed the PPC test case but not the arm one? I thought I put them in? Though I didn't see the arm one. The new files didn't apply cleanly for some reason. If you send me the files I'll commit them though. -eric From wdietz2 at illinois.edu Tue Jul 6 16:39:30 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 21:39:30 -0000 Subject: [llvm-commits] [poolalloc] r107705 - in /poolalloc/trunk/test/dsa/local: ./ malloc.ll Message-ID: <20100706213930.CA99F2A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 16:39:30 2010 New Revision: 107705 URL: http://llvm.org/viewvc/llvm-project?rev=107705&view=rev Log: Added test to verify DSA detects 'malloc' as a heap allocator. Added: poolalloc/trunk/test/dsa/local/ poolalloc/trunk/test/dsa/local/malloc.ll Added: poolalloc/trunk/test/dsa/local/malloc.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/malloc.ll?rev=107705&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/malloc.ll (added) +++ poolalloc/trunk/test/dsa/local/malloc.ll Tue Jul 6 16:39:30 2010 @@ -0,0 +1,35 @@ +;--check that local detects call to malloc properly (marks them heap) +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-flags | grep "H" +;--check that local has b pointing to node containing c and d +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-values | grep "^c,d$" +;--check that td/bu don't mark such nodes as incomplete +;RUN: dsaopt %s -dsa-td -analyze -dstest -print-node-for-value "main:c" -print-only-flags | not grep "I" +;RUN: dsaopt %s -dsa-bu -analyze -dstest -print-node-for-value "main:c" -print-only-flags | not grep "I" + +; ModuleID = 'malloc_free.ll' +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-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +define i32 @main() nounwind { +entry: + %retval = alloca i32 ; [#uses=2] + %a = alloca i32 ; [#uses=2] + %b = alloca i8* ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %c = call noalias i8* @malloc(i64 100) nounwind ; [#uses=1] + store i8* %c, i8** %b, align 8 + %d = load i8** %b, align 8 ; [#uses=1] + call void @free(i8* %d) nounwind + store i32 0, i32* %a, align 4 + %e = load i32* %a, align 4 ; [#uses=1] + store i32 %e, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} + +declare noalias i8* @malloc(i64) nounwind + +declare void @free(i8*) nounwind From espindola at google.com Tue Jul 6 16:41:03 2010 From: espindola at google.com (Rafael Espindola) Date: Tue, 6 Jul 2010 17:41:03 -0400 Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups Message-ID: The attached patch fixes va_arg for double on ARM. Since f64 is valid, the VAARG node is never split. The best fix is probably to always set the alignment. This also simplifies DAGTypeLegalizer::ExpandRes_VAARG since it now doesn't need to compute the max. One issues is that we would produce silly code like add r0, r0, #3 bfc r0, #0, #2 for the vaarg of i32. What is the correct way to find the minimum alignment of an argument? This is not the same as the stack alignment at function entry. For example, for ARM the correct value is 4, since values smaller than 32 bits are promoted (see 5.2.1.1 and 5.2.1.2 in AAPCS). Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: vaarg.patch Type: text/x-diff Size: 5772 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/68ac8854/attachment.bin From wdietz2 at illinois.edu Tue Jul 6 16:44:14 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 21:44:14 -0000 Subject: [llvm-commits] [poolalloc] r107707 - in /poolalloc/trunk/test/dsa/local: dg.exp flags.c flags.ll Message-ID: <20100706214414.1B1A32A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 16:44:13 2010 New Revision: 107707 URL: http://llvm.org/viewvc/llvm-project?rev=107707&view=rev Log: Add tests to verify Local sets the G/S/H/M/R flags correctly on some basic cases. Also demonstrates how to use the -dstest options somewhat. Added: poolalloc/trunk/test/dsa/local/dg.exp poolalloc/trunk/test/dsa/local/flags.c poolalloc/trunk/test/dsa/local/flags.ll Added: poolalloc/trunk/test/dsa/local/dg.exp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/dg.exp?rev=107707&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/dg.exp (added) +++ poolalloc/trunk/test/dsa/local/dg.exp Tue Jul 6 16:44:13 2010 @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] Added: poolalloc/trunk/test/dsa/local/flags.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/flags.c?rev=107707&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/flags.c (added) +++ poolalloc/trunk/test/dsa/local/flags.c Tue Jul 6 16:44:13 2010 @@ -0,0 +1,52 @@ +// Go through at least one of every operation to verify flags are set appropriately... + +//--Make sure we can run DSA on it! +//RUN: llvm-gcc %s -c --emit-llvm -o - | \ +//RUN: dsaopt -dsa-bu -dsa-td -disable-output + +//H, S, G, R, M + +#include + +//Not touched +int global_a; +//M +int global_b; +//R +int global_c; +//M/R +int global_d; + +void func() { + //Don't mod/ref + int stack_a; + int * heap_a = malloc(sizeof(int)); + + //Mod + int stack_b; + int * heap_b = malloc(sizeof(int)); + + //Ref + int stack_c; + int * heap_c = malloc(sizeof(int)); + + //Mod/Ref + int stack_d; + int * heap_d = malloc(sizeof(int)); + + //Mod the b's, ref the c's + stack_b = stack_c; + *heap_b = *heap_c; + global_b = global_c; + + //Mod/ref all the d's + stack_d = global_d; + global_d = *heap_d; + *heap_d = stack_d; + + free(heap_a); + free(heap_b); + free(heap_c); + free(heap_d); +} + Added: poolalloc/trunk/test/dsa/local/flags.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/flags.ll?rev=107707&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/local/flags.ll (added) +++ poolalloc/trunk/test/dsa/local/flags.ll Tue Jul 6 16:44:13 2010 @@ -0,0 +1,103 @@ +; ModuleID = 'flags.c' +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-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +;Test flag assignment on globals/stack/heap, as well as mod/ref. +;a's are none, b's are mod, c'd as ref, d's are mod/ref. + +;--Stack: +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:stack_a" | grep "S" | grep -v "M" | grep -v "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:stack_b" | grep "S" | grep "M" | grep -v "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:stack_c" | grep "S" | grep -v "M" | grep -v "M" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:stack_d" | grep "S" | grep "M" | grep "R" + +;--Heap: +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:heap_a:0" | grep "H" | grep -v "M" | grep -v "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:heap_b:0" | grep "H" | grep "M" | grep -v "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:heap_c:0" | grep "H" | grep -v "M" | grep "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "func:heap_d:0" | grep "H" | grep "M" | grep "R" + +;--Globals: +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "global_a" | grep "G" | grep -v "M" | grep -v "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "global_b" | grep "G" | grep "M" | grep -v "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "global_c" | grep "G" | grep -v "M" | grep "R" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-only-flags -print-node-for-value \ +;RUN: "global_d" | grep "G" | grep "M" | grep "R" + + + at global_c = common global i32 0 ; [#uses=1] + at global_b = common global i32 0 ; [#uses=1] + at global_d = common global i32 0 ; [#uses=2] + at global_a = common global i32 0 ; [#uses=0] + +define void @func() nounwind { +entry: + %stack_a = alloca i32 ; [#uses=0] + %heap_a = alloca i32* ; [#uses=2] + %stack_b = alloca i32 ; [#uses=1] + %heap_b = alloca i32* ; [#uses=3] + %stack_c = alloca i32 ; [#uses=1] + %heap_c = alloca i32* ; [#uses=3] + %stack_d = alloca i32 ; [#uses=2] + %heap_d = alloca i32* ; [#uses=4] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %1 = bitcast i8* %0 to i32* ; [#uses=1] + store i32* %1, i32** %heap_a, align 8 + %2 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %3 = bitcast i8* %2 to i32* ; [#uses=1] + store i32* %3, i32** %heap_b, align 8 + %4 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %5 = bitcast i8* %4 to i32* ; [#uses=1] + store i32* %5, i32** %heap_c, align 8 + %6 = call noalias i8* @malloc(i64 4) nounwind ; [#uses=1] + %7 = bitcast i8* %6 to i32* ; [#uses=1] + store i32* %7, i32** %heap_d, align 8 + %8 = load i32* %stack_c, align 4 ; [#uses=1] + store i32 %8, i32* %stack_b, align 4 + %9 = load i32** %heap_c, align 8 ; [#uses=1] + %10 = load i32* %9, align 4 ; [#uses=1] + %11 = load i32** %heap_b, align 8 ; [#uses=1] + store i32 %10, i32* %11, align 4 + %12 = load i32* @global_c, align 4 ; [#uses=1] + store i32 %12, i32* @global_b, align 4 + %13 = load i32* @global_d, align 4 ; [#uses=1] + store i32 %13, i32* %stack_d, align 4 + %14 = load i32** %heap_d, align 8 ; [#uses=1] + %15 = load i32* %14, align 4 ; [#uses=1] + store i32 %15, i32* @global_d, align 4 + %16 = load i32** %heap_d, align 8 ; [#uses=1] + %17 = load i32* %stack_d, align 4 ; [#uses=1] + store i32 %17, i32* %16, align 4 + %18 = load i32** %heap_a, align 8 ; [#uses=1] + %19 = bitcast i32* %18 to i8* ; [#uses=1] + call void @free(i8* %19) nounwind + %20 = load i32** %heap_b, align 8 ; [#uses=1] + %21 = bitcast i32* %20 to i8* ; [#uses=1] + call void @free(i8* %21) nounwind + %22 = load i32** %heap_c, align 8 ; [#uses=1] + %23 = bitcast i32* %22 to i8* ; [#uses=1] + call void @free(i8* %23) nounwind + %24 = load i32** %heap_d, align 8 ; [#uses=1] + %25 = bitcast i32* %24 to i8* ; [#uses=1] + call void @free(i8* %25) nounwind + br label %return + +return: ; preds = %entry + ret void +} + +declare noalias i8* @malloc(i64) nounwind + +declare void @free(i8*) nounwind From wdietz2 at illinois.edu Tue Jul 6 16:51:58 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 21:51:58 -0000 Subject: [llvm-commits] [poolalloc] r107708 - /poolalloc/trunk/test/dsa/var_arg/context.c Message-ID: <20100706215159.0137E2A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 16:51:58 2010 New Revision: 107708 URL: http://llvm.org/viewvc/llvm-project?rev=107708&view=rev Log: Added another var_arg test that makes sure context-sensitivity works with VA changes. Added: poolalloc/trunk/test/dsa/var_arg/context.c Added: poolalloc/trunk/test/dsa/var_arg/context.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/var_arg/context.c?rev=107708&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/var_arg/context.c (added) +++ poolalloc/trunk/test/dsa/var_arg/context.c Tue Jul 6 16:51:58 2010 @@ -0,0 +1,53 @@ +#include +#include +//This is a test of context-sensitive var-arg handling + +//--build the code into a .bc +//RUN: llvm-gcc -O0 %s -S --emit-llvm -o - | llvm-as > %t.bc +//--check if ds-aa breaks, breaks opts, or results in miscompiled code +//RUN: lli %t.bc > %t.refout +//RUN: dsaopt %t.bc -ds-aa -O3 -o - | lli > %t.out +//RUN: dsaopt %t.bc -ds-aa -gvn -o - | lli > %t.out2 +//RUN: diff %t.refout %t.out +//RUN: diff %t.refout %t.out2 +//--check properties of this particular test +//RUN: dsaopt %t.bc -ds-aa -aa-eval -o /dev/null \ +// RUN: -print-all-alias-modref-info >& %t.aa + +//FIXME: Find a better way to get at this information... +//--get the registers loaded from ret1 and ret2 +//RUN: llvm-dis %t.bc -f -o %t.ll +//RUN: cat %t.ll | grep load | grep "ret1" | sed -e {s/ =.*$//} -e {s/^\[ \]*//} > %t.ret1 +//RUN: cat %t.ll | grep load | grep "ret2" | sed -e {s/ =.*$//} -e {s/^\[ \]*//} > %t.ret2 + + +static int * get( int unused, ... ) +{ + va_list ap; + va_start( ap, unused ); + + int * ret = va_arg( ap, int * ); + + va_end( ap ); + + return ret; +} + +int main() +{ + int val1 = 1, val2 = 2; + int *p1 = &val1, *p2 = &val2; + int *ret1, *ret2; + + //ret1 and ret2 should explicitly /not/ alias + //RUN: cat %t.aa | grep -f %t.ret1 | grep -f %t.ret2 | grep NoAlias + ret1 = get( 0, p1 ); + ret2 = get( 0, p2 ); + + if ( *ret1 + 1 == *ret2 ) + { + return 0; + } + + return -1; +} From nelhage at nelhage.com Tue Jul 6 16:59:33 2010 From: nelhage at nelhage.com (Nelson Elhage) Date: Tue, 06 Jul 2010 17:59:33 -0400 Subject: [llvm-commits] [llvm] r107640 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/StackProtector.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h test/CodeGen/Generic/stack-protector.ll test/CodeGen/PowerPC/stack-protector.ll test/CodeGen/X86/stack-protector-linux.ll test/CodeGen/X86/stack-protector.ll In-Reply-To: <1BFCAAA5-C835-44B1-B009-9302C654E79F@apple.com> References: <20100706051856.7B0902A6C12C@llvm.org> <87k4p8s36f.fsf@mit.edu> <1BFCAAA5-C835-44B1-B009-9302C654E79F@apple.com> Message-ID: <87hbkcs24a.fsf@mit.edu> A non-text attachment was scrubbed... Name: stack-protector-arm.diff Type: text/x-diff Size: 1162 bytes Desc: ARM -fstack-protector tests Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100706/417ead79/attachment.bin From dpatel at apple.com Tue Jul 6 17:08:15 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 06 Jul 2010 22:08:15 -0000 Subject: [llvm-commits] [llvm] r107710 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/Blackfin/ lib/Target/CellSPU/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <20100706220815.F2A742A6C12C@llvm.org> Author: dpatel Date: Tue Jul 6 17:08:15 2010 New Revision: 107710 URL: http://llvm.org/viewvc/llvm-project?rev=107710&view=rev Log: Propagate debug loc. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Jul 6 17:08:15 2010 @@ -348,13 +348,13 @@ SDValue getTargetConstantFP(const ConstantFP &Val, EVT VT) { return getConstantFP(Val, VT, true); } - SDValue getGlobalAddress(const GlobalValue *GV, EVT VT, + SDValue getGlobalAddress(const GlobalValue *GV, DebugLoc DL, EVT VT, int64_t offset = 0, bool isTargetGA = false, unsigned char TargetFlags = 0); - SDValue getTargetGlobalAddress(const GlobalValue *GV, EVT VT, + SDValue getTargetGlobalAddress(const GlobalValue *GV, DebugLoc DL, EVT VT, int64_t offset = 0, unsigned char TargetFlags = 0) { - return getGlobalAddress(GV, VT, offset, true, TargetFlags); + return getGlobalAddress(GV, DL, VT, offset, true, TargetFlags); } SDValue getFrameIndex(int FI, EVT VT, bool isTarget = false); SDValue getTargetFrameIndex(int FI, EVT VT) { Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Jul 6 17:08:15 2010 @@ -1154,7 +1154,7 @@ int64_t Offset; unsigned char TargetFlags; friend class SelectionDAG; - GlobalAddressSDNode(unsigned Opc, const GlobalValue *GA, EVT VT, + GlobalAddressSDNode(unsigned Opc, DebugLoc DL, const GlobalValue *GA, EVT VT, int64_t o, unsigned char TargetFlags); public: Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jul 6 17:08:15 2010 @@ -1315,7 +1315,7 @@ if (GlobalAddressSDNode *GA = dyn_cast(N0)) if (!LegalOperations && TLI.isOffsetFoldingLegal(GA) && N1C && GA->getOpcode() == ISD::GlobalAddress) - return DAG.getGlobalAddress(GA->getGlobal(), VT, + return DAG.getGlobalAddress(GA->getGlobal(), N1C->getDebugLoc(), VT, GA->getOffset() + (uint64_t)N1C->getSExtValue()); // fold ((c1-A)+c2) -> (c1+c2)-A @@ -1552,7 +1552,7 @@ if (!LegalOperations && TLI.isOffsetFoldingLegal(GA)) { // fold (sub Sym, c) -> Sym-c if (N1C && GA->getOpcode() == ISD::GlobalAddress) - return DAG.getGlobalAddress(GA->getGlobal(), VT, + return DAG.getGlobalAddress(GA->getGlobal(), N1C->getDebugLoc(), VT, GA->getOffset() - (uint64_t)N1C->getSExtValue()); // fold (sub Sym+c1, Sym+c2) -> c1-c2 Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jul 6 17:08:15 2010 @@ -975,7 +975,7 @@ } } -SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, +SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, DebugLoc DL, EVT VT, int64_t Offset, bool isTargetGA, unsigned char TargetFlags) { @@ -1010,7 +1010,7 @@ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); - SDNode *N = new (NodeAllocator) GlobalAddressSDNode(Opc, GV, VT, + SDNode *N = new (NodeAllocator) GlobalAddressSDNode(Opc, DL, GV, VT, Offset, TargetFlags); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); @@ -5375,9 +5375,10 @@ DropOperands(); } -GlobalAddressSDNode::GlobalAddressSDNode(unsigned Opc, const GlobalValue *GA, +GlobalAddressSDNode::GlobalAddressSDNode(unsigned Opc, DebugLoc DL, + const GlobalValue *GA, EVT VT, int64_t o, unsigned char TF) - : SDNode(Opc, DebugLoc(), getSDVTList(VT)), Offset(o), TargetFlags(TF) { + : SDNode(Opc, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) { TheGlobal = GA; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Jul 6 17:08:15 2010 @@ -852,7 +852,7 @@ return DAG.getConstant(*CI, VT); if (const GlobalValue *GV = dyn_cast(C)) - return DAG.getGlobalAddress(GV, VT); + return DAG.getGlobalAddress(GV, getCurDebugLoc(), VT); if (isa(C)) return DAG.getConstant(0, TLI.getPointerTy()); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Jul 6 17:08:15 2010 @@ -2414,7 +2414,8 @@ if (ConstraintLetter != 'n') { int64_t Offs = GA->getOffset(); if (C) Offs += C->getZExtValue(); - Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(), + Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(), + C->getDebugLoc(), Op.getValueType(), Offs)); return; } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -1238,7 +1238,7 @@ Callee = DAG.getNode(ARMISD::PIC_ADD, dl, getPointerTy(), Callee, PICLabel); } else - Callee = DAG.getTargetGlobalAddress(GV, getPointerTy()); + Callee = DAG.getTargetGlobalAddress(GV, dl, getPointerTy()); } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) { isDirect = true; bool isStub = Subtarget->isTargetDarwin() && @@ -1769,7 +1769,7 @@ // pair. This is always cheaper. if (Subtarget->useMovt()) { return DAG.getNode(ARMISD::Wrapper, dl, PtrVT, - DAG.getTargetGlobalAddress(GV, PtrVT)); + DAG.getTargetGlobalAddress(GV, dl, PtrVT)); } else { SDValue CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 4); CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr); Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -643,10 +643,12 @@ case ISD::GlobalAddress: { GlobalAddressSDNode *GSDN = cast(Op); const GlobalValue *GV = GSDN->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset()); + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i64, + GSDN->getOffset()); // FIXME there isn't really any debug info here - // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) { + // if (!GV->hasWeakLinkage() && !GV->isDeclaration() + // && !GV->hasLinkOnceLinkage()) { if (GV->hasLocalLinkage()) { SDValue Hi = DAG.getNode(AlphaISD::GPRelHi, dl, MVT::i64, GA, DAG.getGLOBAL_OFFSET_TABLE(MVT::i64)); Modified: llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -143,7 +143,7 @@ DebugLoc DL = Op.getDebugLoc(); const GlobalValue *GV = cast(Op)->getGlobal(); - Op = DAG.getTargetGlobalAddress(GV, MVT::i32); + Op = DAG.getTargetGlobalAddress(GV, DL, MVT::i32); return DAG.getNode(BFISD::Wrapper, DL, MVT::i32, Op); } @@ -356,7 +356,7 @@ // turn it into a TargetGlobalAddress node so that legalize doesn't hack it. // Likewise ExternalSymbol -> TargetExternalSymbol. if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i32); + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, MVT::i32); else if (ExternalSymbolSDNode *E = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(E->getSymbol(), MVT::i32); Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -953,7 +953,8 @@ EVT PtrVT = Op.getValueType(); GlobalAddressSDNode *GSDN = cast(Op); const GlobalValue *GV = GSDN->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, PtrVT, GSDN->getOffset()); + SDValue GA = DAG.getTargetGlobalAddress(GV, Op.getDebugLoc(), + PtrVT, GSDN->getOffset()); const TargetMachine &TM = DAG.getTarget(); SDValue Zero = DAG.getConstant(0, PtrVT); // FIXME there is no actual debug info here @@ -1232,7 +1233,7 @@ const GlobalValue *GV = G->getGlobal(); EVT CalleeVT = Callee.getValueType(); SDValue Zero = DAG.getConstant(0, PtrVT); - SDValue GA = DAG.getTargetGlobalAddress(GV, CalleeVT); + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, CalleeVT); if (!ST->usingLargeMem()) { // Turn calls to targets that are defined (i.e., have bodies) into BRSL Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -404,7 +404,7 @@ // FIXME there isn't actually debug info here DebugLoc dl = Op.getDebugLoc(); const GlobalValue *GV = cast(Op)->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32); return DAG.getNode(MBlazeISD::Wrap, dl, MVT::i32, GA); } @@ -617,7 +617,7 @@ // node so that legalize doesn't hack it. unsigned char OpFlag = MBlazeII::MO_NO_FLAG; if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, getPointerTy(), 0, OpFlag); else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Tue Jul 6 17:08:15 2010 @@ -272,7 +272,8 @@ AM.Base.Reg; if (AM.GV) - Disp = CurDAG->getTargetGlobalAddress(AM.GV, MVT::i16, AM.Disp, + Disp = CurDAG->getTargetGlobalAddress(AM.GV, Op->getDebugLoc(), + MVT::i16, AM.Disp, 0/*AM.SymbolFlags*/); else if (AM.CP) Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i16, Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -529,7 +529,7 @@ // turn it into a TargetGlobalAddress node so that legalize doesn't hack it. // Likewise ExternalSymbol -> TargetExternalSymbol. if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i16); + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, MVT::i16); else if (ExternalSymbolSDNode *E = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(E->getSymbol(), MVT::i16); @@ -642,7 +642,8 @@ int64_t Offset = cast(Op)->getOffset(); // Create the TargetGlobalAddress node, folding in the constant offset. - SDValue Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset); + SDValue Result = DAG.getTargetGlobalAddress(GV, Op.getDebugLoc(), + getPointerTy(), Offset); return DAG.getNode(MSP430ISD::Wrapper, Op.getDebugLoc(), getPointerTy(), Result); } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -489,21 +489,21 @@ // %gp_rel relocation if (TLOF.IsGlobalInSmallSection(GV, getTargetMachine())) { - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32, 0, + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0, MipsII::MO_GPREL); SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, dl, VTs, &GA, 1); SDValue GOT = DAG.getGLOBAL_OFFSET_TABLE(MVT::i32); return DAG.getNode(ISD::ADD, dl, MVT::i32, GOT, GPRelNode); } // %hi/%lo relocation - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32, 0, + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0, MipsII::MO_ABS_HILO); SDValue HiPart = DAG.getNode(MipsISD::Hi, dl, VTs, &GA, 1); SDValue Lo = DAG.getNode(MipsISD::Lo, dl, MVT::i32, GA); return DAG.getNode(ISD::ADD, dl, MVT::i32, HiPart, Lo); } else { - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32, 0, + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0, MipsII::MO_GOT); SDValue ResNode = DAG.getLoad(MVT::i32, dl, DAG.getEntryNode(), GA, NULL, 0, @@ -888,7 +888,7 @@ // node so that legalize doesn't hack it. unsigned char OpFlag = IsPIC ? MipsII::MO_GOT_CALL : MipsII::MO_NO_FLAG; if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, getPointerTy(), 0, OpFlag); else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -672,7 +672,8 @@ // FIXME there isn't really debug info here DebugLoc dl = G->getDebugLoc(); - SDValue TGA = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i8, + SDValue TGA = DAG.getTargetGlobalAddress(G->getGlobal(), N->getDebugLoc(), + MVT::i8, G->getOffset()); SDValue Offset = DAG.getConstant(0, MVT::i8); @@ -1428,7 +1429,7 @@ // Considering the GlobalAddressNode case here. if (GlobalAddressSDNode *G = dyn_cast(Callee)) { const GlobalValue *GV = G->getGlobal(); - Callee = DAG.getTargetGlobalAddress(GV, MVT::i8); + Callee = DAG.getTargetGlobalAddress(GV, dl, MVT::i8); Name = G->getGlobal()->getName(); } else {// Considering the ExternalSymbol case here ExternalSymbolSDNode *ES = dyn_cast(Callee); Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -1203,11 +1203,11 @@ SelectionDAG &DAG) const { EVT PtrVT = Op.getValueType(); GlobalAddressSDNode *GSDN = cast(Op); - const GlobalValue *GV = GSDN->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, PtrVT, GSDN->getOffset()); - SDValue Zero = DAG.getConstant(0, PtrVT); // FIXME there isn't really any debug info here DebugLoc dl = GSDN->getDebugLoc(); + const GlobalValue *GV = GSDN->getGlobal(); + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, PtrVT, GSDN->getOffset()); + SDValue Zero = DAG.getConstant(0, PtrVT); const TargetMachine &TM = DAG.getTarget(); @@ -2470,7 +2470,8 @@ // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol // node so that legalize doesn't hack it. if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), Callee.getValueType()); + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, + Callee.getValueType()); else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Callee.getValueType()); else if (SDNode *Dest = isBLACompatibleAddress(Callee, DAG)) Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -478,7 +478,7 @@ // turn it into a TargetGlobalAddress node so that legalize doesn't hack it. // Likewise ExternalSymbol -> TargetExternalSymbol. if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i32); + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, MVT::i32); else if (ExternalSymbolSDNode *E = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(E->getSymbol(), MVT::i32); @@ -759,7 +759,7 @@ const GlobalValue *GV = cast(Op)->getGlobal(); // FIXME there isn't really any debug info here DebugLoc dl = Op.getDebugLoc(); - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32); SDValue Hi = DAG.getNode(SPISD::Hi, dl, MVT::i32, GA); SDValue Lo = DAG.getNode(SPISD::Lo, dl, MVT::i32, GA); Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -464,7 +464,7 @@ // turn it into a TargetGlobalAddress node so that legalize doesn't hack it. // Likewise ExternalSymbol -> TargetExternalSymbol. if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), getPointerTy()); + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, getPointerTy()); else if (ExternalSymbolSDNode *E = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(E->getSymbol(), getPointerTy()); @@ -729,14 +729,14 @@ SDValue Result; if (!IsPic && !ExtraLoadRequired) { - Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset); + Result = DAG.getTargetGlobalAddress(GV, dl, getPointerTy(), Offset); Offset = 0; } else { unsigned char OpFlags = 0; if (ExtraLoadRequired) OpFlags = SystemZII::MO_GOTENT; - Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags); + Result = DAG.getTargetGlobalAddress(GV, dl, getPointerTy(), 0, OpFlags); } Result = DAG.getNode(SystemZISD::PCRelativeWrapper, dl, Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Jul 6 17:08:15 2010 @@ -223,7 +223,8 @@ // These are 32-bit even in 64-bit mode since RIP relative offset // is 32-bit. if (AM.GV) - Disp = CurDAG->getTargetGlobalAddress(AM.GV, MVT::i32, AM.Disp, + Disp = CurDAG->getTargetGlobalAddress(AM.GV, DebugLoc(), + MVT::i32, AM.Disp, AM.SymbolFlags); else if (AM.CP) Disp = CurDAG->getTargetConstantPool(AM.CP, MVT::i32, Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -2107,7 +2107,7 @@ OpFlags = X86II::MO_DARWIN_STUB; } - Callee = DAG.getTargetGlobalAddress(GV, getPointerTy(), + Callee = DAG.getTargetGlobalAddress(GV, dl, getPointerTy(), G->getOffset(), OpFlags); } } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) { @@ -5248,10 +5248,10 @@ if (OpFlags == X86II::MO_NO_FLAG && X86::isOffsetSuitableForCodeModel(Offset, M)) { // A direct static reference to a global. - Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset); + Result = DAG.getTargetGlobalAddress(GV, dl, getPointerTy(), Offset); Offset = 0; } else { - Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags); + Result = DAG.getTargetGlobalAddress(GV, dl, getPointerTy(), 0, OpFlags); } if (Subtarget->isPICStyleRIPRel() && @@ -5296,7 +5296,7 @@ MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Flag); DebugLoc dl = GA->getDebugLoc(); - SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), + SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl, GA->getValueType(0), GA->getOffset(), OperandFlags); @@ -5369,7 +5369,8 @@ // emit "addl x at ntpoff,%eax" (local exec) or "addl x at indntpoff,%eax" (initial // exec) - SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), GA->getValueType(0), + SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl, + GA->getValueType(0), GA->getOffset(), OperandFlags); SDValue Offset = DAG.getNode(WrapperKind, dl, PtrVT, TGA); @@ -5426,12 +5427,10 @@ OpFlag = X86II::MO_TLVP_PIC_BASE; else OpFlag = X86II::MO_TLVP; - - SDValue Result = DAG.getTargetGlobalAddress(GA->getGlobal(), + DebugLoc DL = Op.getDebugLoc(); + SDValue Result = DAG.getTargetGlobalAddress(GA->getGlobal(), DL, getPointerTy(), GA->getOffset(), OpFlag); - - DebugLoc DL = Op.getDebugLoc(); SDValue Offset = DAG.getNode(WrapperKind, DL, getPointerTy(), Result); // With PIC32, the address is actually $g + Offset. @@ -10304,7 +10303,8 @@ getTargetMachine()))) return; - Result = DAG.getTargetGlobalAddress(GV, GA->getValueType(0), Offset); + Result = DAG.getTargetGlobalAddress(GV, Op.getDebugLoc(), + GA->getValueType(0), Offset); break; } } Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107710&r1=107709&r2=107710&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Tue Jul 6 17:08:15 2010 @@ -245,7 +245,7 @@ LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const { const GlobalValue *GV = cast(Op)->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); + SDValue GA = DAG.getTargetGlobalAddress(GV, Op.getDebugLoc(), MVT::i32); // If it's a debug information descriptor, don't mess with it. if (DAG.isVerifiedDebugInfoDesc(Op)) return GA; @@ -269,7 +269,7 @@ DebugLoc dl = Op.getDebugLoc(); // transform to label + getid() * size const GlobalValue *GV = cast(Op)->getGlobal(); - SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); + SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32); const GlobalVariable *GVar = dyn_cast(GV); if (!GVar) { // If GV is an alias then use the aliasee to determine size @@ -919,7 +919,7 @@ // turn it into a TargetGlobalAddress node so that legalize doesn't hack it. // Likewise ExternalSymbol -> TargetExternalSymbol. if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i32); + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, MVT::i32); else if (ExternalSymbolSDNode *E = dyn_cast(Callee)) Callee = DAG.getTargetExternalSymbol(E->getSymbol(), MVT::i32); From wdietz2 at illinois.edu Tue Jul 6 17:12:33 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 22:12:33 -0000 Subject: [llvm-commits] [poolalloc] r107711 - /poolalloc/trunk/test/dsa/local/malloc.ll Message-ID: <20100706221233.52B382A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 17:12:33 2010 New Revision: 107711 URL: http://llvm.org/viewvc/llvm-project?rev=107711&view=rev Log: Make malloc test robust to arbitrary value ordering in node. Modified: poolalloc/trunk/test/dsa/local/malloc.ll Modified: poolalloc/trunk/test/dsa/local/malloc.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/malloc.ll?rev=107711&r1=107710&r2=107711&view=diff ============================================================================== --- poolalloc/trunk/test/dsa/local/malloc.ll (original) +++ poolalloc/trunk/test/dsa/local/malloc.ll Tue Jul 6 17:12:33 2010 @@ -1,7 +1,9 @@ ;--check that local detects call to malloc properly (marks them heap) ;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-flags | grep "H" + +;RUNX: dsaopt %s -dsa-td -analyze -dstest -print-node-for-value "main:c" -print-only-flags -print-node-for-value "main:d" -print-node-for-value "main:b:0" >& /tmp/test.log ;--check that local has b pointing to node containing c and d -;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-values | grep "^c,d$" +;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-values | grep {^c,d$\\|^d,c$} ;--check that td/bu don't mark such nodes as incomplete ;RUN: dsaopt %s -dsa-td -analyze -dstest -print-node-for-value "main:c" -print-only-flags | not grep "I" ;RUN: dsaopt %s -dsa-bu -analyze -dstest -print-node-for-value "main:c" -print-only-flags | not grep "I" From gohman at apple.com Tue Jul 6 17:19:37 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 06 Jul 2010 22:19:37 -0000 Subject: [llvm-commits] [llvm] r107712 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGISel.h include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/XCore/XCoreISelLowering.cpp lib/Target/XCore/XCoreISelLowering.h Message-ID: <20100706221937.F2F462A6C12C@llvm.org> Author: djg Date: Tue Jul 6 17:19:37 2010 New Revision: 107712 URL: http://llvm.org/viewvc/llvm-project?rev=107712&view=rev Log: CanLowerReturn doesn't need a SelectionDAG; it just needs an LLVMContext. SelectBasicBlock doesn't needs its BasicBlock argument. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Tue Jul 6 17:19:37 2010 @@ -285,7 +285,6 @@ void FinishBasicBlock(MachineBasicBlock *BB); MachineBasicBlock *SelectBasicBlock(MachineBasicBlock *BB, - const BasicBlock *LLVMBB, BasicBlock::const_iterator Begin, BasicBlock::const_iterator End, bool &HadTailCall); Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Tue Jul 6 17:19:37 2010 @@ -1158,7 +1158,7 @@ virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &OutTys, const SmallVectorImpl &ArgsFlags, - SelectionDAG &DAG) const + LLVMContext &Context) const { // Return true by default to get preexisting behavior. return true; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Jul 6 17:19:37 2010 @@ -4562,7 +4562,7 @@ OutVTs, OutsFlags, TLI, &Offsets); bool CanLowerReturn = TLI.CanLowerReturn(CS.getCallingConv(), - FTy->isVarArg(), OutVTs, OutsFlags, DAG); + FTy->isVarArg(), OutVTs, OutsFlags, FTy->getContext()); SDValue DemoteStackSlot; @@ -5959,7 +5959,8 @@ FuncInfo->CanLowerReturn = TLI.CanLowerReturn(F.getCallingConv(), F.isVarArg(), - OutVTs, OutsFlags, DAG); + OutVTs, OutsFlags, + F.getContext()); if (!FuncInfo->CanLowerReturn) { // Put in an sret pointer parameter before all the other parameters. SmallVector ValueVTs; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Jul 6 17:19:37 2010 @@ -321,7 +321,6 @@ MachineBasicBlock * SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB, - const BasicBlock *LLVMBB, BasicBlock::const_iterator Begin, BasicBlock::const_iterator End, bool &HadTailCall) { @@ -736,7 +735,7 @@ } bool HadTailCall = false; - BB = SelectBasicBlock(BB, LLVMBB, BI, llvm::next(BI), HadTailCall); + BB = SelectBasicBlock(BB, BI, llvm::next(BI), HadTailCall); // If the call was emitted as a tail call, we're done with the block. if (HadTailCall) { @@ -772,7 +771,7 @@ // block. if (BI != End) { bool HadTailCall; - BB = SelectBasicBlock(BB, LLVMBB, BI, End, HadTailCall); + BB = SelectBasicBlock(BB, BI, End, HadTailCall); } FinishBasicBlock(BB); Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 17:19:37 2010 @@ -1220,10 +1220,10 @@ X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &OutTys, const SmallVectorImpl &ArgsFlags, - SelectionDAG &DAG) const { + LLVMContext &Context) const { SmallVector RVLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), - RVLocs, *DAG.getContext()); + RVLocs, Context); return CCInfo.CheckReturn(OutTys, ArgsFlags, RetCC_X86); } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Jul 6 17:19:37 2010 @@ -748,7 +748,7 @@ CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &OutTys, const SmallVectorImpl &ArgsFlags, - SelectionDAG &DAG) const; + LLVMContext &Context) const; void ReplaceATOMIC_BINARY_64(SDNode *N, SmallVectorImpl &Results, SelectionDAG &DAG, unsigned NewOp) const; Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Tue Jul 6 17:19:37 2010 @@ -1135,10 +1135,10 @@ CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &OutTys, const SmallVectorImpl &ArgsFlags, - SelectionDAG &DAG) const { + LLVMContext &Context) const { SmallVector RVLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), - RVLocs, *DAG.getContext()); + RVLocs, Context); return CCInfo.CheckReturn(OutTys, ArgsFlags, RetCC_XCore); } Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.h?rev=107712&r1=107711&r2=107712&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.h (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.h Tue Jul 6 17:19:37 2010 @@ -192,7 +192,7 @@ CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &OutTys, const SmallVectorImpl &ArgsFlags, - SelectionDAG &DAG) const; + LLVMContext &Context) const; }; } From wdietz2 at illinois.edu Tue Jul 6 17:32:45 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 22:32:45 -0000 Subject: [llvm-commits] [poolalloc] r107713 - in /poolalloc/trunk: lib/DSA/DSTest.cpp test/dsa/local/malloc.ll Message-ID: <20100706223245.6FFD92A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 17:32:45 2010 New Revision: 107713 URL: http://llvm.org/viewvc/llvm-project?rev=107713&view=rev Log: Introduced "check-same-node" option that allows the user to specify a group of values that should have been merged. Allow both "print-node-for-value" and the new "check-same-node" options to accept comma-separated strings as input for convenience. Updated the malloc test to make use of "check-same-node" Modified: poolalloc/trunk/lib/DSA/DSTest.cpp poolalloc/trunk/test/dsa/local/malloc.ll Modified: poolalloc/trunk/lib/DSA/DSTest.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=107713&r1=107712&r2=107713&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSTest.cpp (original) +++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Jul 6 17:32:45 2010 @@ -27,11 +27,14 @@ using namespace llvm; namespace { - //FIXME: being able to separate -print-node-for-value options with commas would be nice... - cl::list PrintNodesForValues("print-node-for-value", cl::ReallyHidden); + cl::list PrintNodesForValues("print-node-for-value", + cl::CommaSeparated, cl::ReallyHidden); cl::opt OnlyPrintFlags("print-only-flags", cl::ReallyHidden); cl::opt OnlyPrintValues("print-only-values", cl::ReallyHidden); cl::opt OnlyPrintTypes("print-only-types", cl::ReallyHidden); + //Test if all mentioned values are in the same node + cl::list CheckNodesSame("check-same-node", + cl::CommaSeparated, cl::ReallyHidden); } /// NodeValue -- represents a particular node in a DSGraph @@ -316,5 +319,20 @@ // Print corresponding node printNode(O, NV); } + + // Verify all nodes listed in "CheckNodesSame" belong to the same node. + cl::list::iterator CI = CheckNodesSame.begin(), + CE = CheckNodesSame.end(); + // If the user specified that a set of values should be in the same node... + if (CI != CE) { + // Take the first such value as the reference to compare to the others + NodeValue NVReference(*CI++,M,this); + + // Iterate through the remaining to verify they're the same node. + for(; CI != CE; ++CI) { + NodeValue NV(*CI, M, this); + assert(NVReference.getNodeH()==NV.getNodeH() && "Nodes don't match!"); + } + } } Modified: poolalloc/trunk/test/dsa/local/malloc.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/malloc.ll?rev=107713&r1=107712&r2=107713&view=diff ============================================================================== --- poolalloc/trunk/test/dsa/local/malloc.ll (original) +++ poolalloc/trunk/test/dsa/local/malloc.ll Tue Jul 6 17:32:45 2010 @@ -1,9 +1,7 @@ ;--check that local detects call to malloc properly (marks them heap) ;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-flags | grep "H" - -;RUNX: dsaopt %s -dsa-td -analyze -dstest -print-node-for-value "main:c" -print-only-flags -print-node-for-value "main:d" -print-node-for-value "main:b:0" >& /tmp/test.log ;--check that local has b pointing to node containing c and d -;RUN: dsaopt %s -dsa-local -analyze -dstest -print-node-for-value "main:b:0" -print-only-values | grep {^c,d$\\|^d,c$} +;RUN: dsaopt %s -dsa-local -analyze -dstest -check-same-node=main:b:0,main:c,main:d ;--check that td/bu don't mark such nodes as incomplete ;RUN: dsaopt %s -dsa-td -analyze -dstest -print-node-for-value "main:c" -print-only-flags | not grep "I" ;RUN: dsaopt %s -dsa-bu -analyze -dstest -print-node-for-value "main:c" -print-only-flags | not grep "I" From wdietz2 at illinois.edu Tue Jul 6 17:34:36 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Tue, 06 Jul 2010 22:34:36 -0000 Subject: [llvm-commits] [poolalloc] r107714 - /poolalloc/trunk/lib/DSA/DSTest.cpp Message-ID: <20100706223436.DCE642A6C12C@llvm.org> Author: wdietz2 Date: Tue Jul 6 17:34:36 2010 New Revision: 107714 URL: http://llvm.org/viewvc/llvm-project?rev=107714&view=rev Log: Remove outdated comment line. Modified: poolalloc/trunk/lib/DSA/DSTest.cpp Modified: poolalloc/trunk/lib/DSA/DSTest.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=107714&r1=107713&r2=107714&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSTest.cpp (original) +++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Jul 6 17:34:36 2010 @@ -276,7 +276,6 @@ /// printNodes -- print the node specified by NV /// /// Format: -/// (can a type include '{}'s, etc?) /// "flags:{value(s)}:{type(s)}" /// /// Additionally, the user can specify to print just one piece From bruno.cardoso at gmail.com Tue Jul 6 17:36:24 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 06 Jul 2010 22:36:24 -0000 Subject: [llvm-commits] [llvm] r107715 - in /llvm/trunk: lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrInfo.h lib/Target/X86/X86InstrSSE.td lib/Target/X86/X86MCCodeEmitter.cpp test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100706223624.D813E2A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 17:36:24 2010 New Revision: 107715 URL: http://llvm.org/viewvc/llvm-project?rev=107715&view=rev Log: Add AVX vblendvpd, vblendvps and vpblendvb instructions Update VEX encoding to support those new instructions Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=107715&r1=107714&r2=107715&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Tue Jul 6 17:36:24 2010 @@ -104,6 +104,7 @@ class VEX { bit hasVEXPrefix = 1; } class VEX_W { bit hasVEX_WPrefix = 1; } class VEX_4V : VEX { bit hasVEX_4VPrefix = 1; } +class VEX_I8IMM { bit hasVEX_i8ImmReg = 1; } class X86Inst opcod, Format f, ImmType i, dag outs, dag ins, string AsmStr, Domain d = GenericDomain> @@ -134,6 +135,8 @@ bit hasVEXPrefix = 0; // Does this inst requires a VEX prefix? bit hasVEX_WPrefix = 0; // Does this inst set the VEX_W field? bit hasVEX_4VPrefix = 0; // Does this inst requires the VEX.VVVV field? + bit hasVEX_i8ImmReg = 0; // Does this inst requires the last source register + // to be encoded in a immediate field? // TSFlags layout should be kept in sync with X86InstrInfo.h. let TSFlags{5-0} = FormBits; @@ -150,6 +153,7 @@ let TSFlags{32} = hasVEXPrefix; let TSFlags{33} = hasVEX_WPrefix; let TSFlags{34} = hasVEX_4VPrefix; + let TSFlags{35} = hasVEX_i8ImmReg; } class I o, Format f, dag outs, dag ins, string asm, Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=107715&r1=107714&r2=107715&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Tue Jul 6 17:36:24 2010 @@ -424,14 +424,22 @@ // those enums below are used, TSFlags must be shifted right by 32 first. enum { //===------------------------------------------------------------------===// - // VEXPrefix - VEX prefixes are instruction prefixes used in AVX. + // VEX - A prefix used by AVX instructions + VEX = 1, + + // VEX_W is has a opcode specific functionality, but is used in the same + // way as REX_W is for regular SSE instructions. + VEX_W = 1 << 1, + // VEX_4V is used to specify an additional AVX/SSE register. Several 2 // address instructions in SSE are represented as 3 address ones in AVX // and the additional register is encoded in VEX_VVVV prefix. - // - VEX = 1, - VEX_W = 1 << 1, - VEX_4V = 1 << 2 + VEX_4V = 1 << 2, + + // VEX_I8IMM specifies that the last register used in a AVX instruction, + // must be encoded in the i8 immediate field. This usually happens in + // instructions with 4 operands. + VEX_I8IMM = 1 << 3 }; // getBaseOpcodeFor - This function returns the "base" X86 opcode for the Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107715&r1=107714&r2=107715&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 17:36:24 2010 @@ -4246,6 +4246,27 @@ defm DPPD : SS41I_binop_rmi_int<0x41, "dppd", int_x86_sse41_dppd>; } +/// SS41I_quaternary_int_avx - AVX SSE 4.1 with 4 operators +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { + multiclass SS41I_quaternary_int_avx opc, string OpcodeStr> { + def rr : I, OpSize, TA, VEX_4V, VEX_I8IMM; + + def rm : I, OpSize, TA, VEX_4V, VEX_I8IMM; + } +} + +defm VBLENDVPD : SS41I_quaternary_int_avx<0x4B, "vblendvpd">; +defm VBLENDVPS : SS41I_quaternary_int_avx<0x4A, "vblendvps">; +defm VPBLENDVB : SS41I_quaternary_int_avx<0x4C, "vpblendvb">; + /// SS41I_ternary_int - SSE 4.1 ternary operator let Uses = [XMM0], Constraints = "$src1 = $dst" in { multiclass SS41I_ternary_int opc, string OpcodeStr, Intrinsic IntId> { Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=107715&r1=107714&r2=107715&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Tue Jul 6 17:36:24 2010 @@ -501,6 +501,11 @@ CurOp++; } + // If the last register should be encoded in the immediate field + // ignored it here. + if ((TSFlags >> 32) & X86II::VEX_I8IMM) + NumOps--; + for (; CurOp != NumOps; ++CurOp) { const MCOperand &MO = MI.getOperand(CurOp); if (MO.isReg() && X86InstrInfo::isX86_64ExtendedReg(MO.getReg())) @@ -914,11 +919,24 @@ // If there is a remaining operand, it must be a trailing immediate. Emit it // according to the right size for the instruction. - if (CurOp != NumOps) - EmitImmediate(MI.getOperand(CurOp++), - X86II::getSizeOfImm(TSFlags), getImmFixupKind(TSFlags), - CurByte, OS, Fixups); - + if (CurOp != NumOps) { + // The last source register of a 4 operand instruction in AVX is encoded + // in bits[7:4] of a immediate byte, and bits[3:0] are ignored. + if ((TSFlags >> 32) & X86II::VEX_I8IMM) { + const MCOperand &MO = MI.getOperand(CurOp++); + bool IsExtReg = + X86InstrInfo::isX86_64ExtendedReg(MO.getReg()); + unsigned RegNum = (IsExtReg ? (1 << 7) : 0); + RegNum |= GetX86RegNum(MO) << 4; + EmitImmediate(MCOperand::CreateImm(RegNum), 1, FK_Data_1, CurByte, OS, + Fixups); + } else + EmitImmediate(MI.getOperand(CurOp++), + X86II::getSizeOfImm(TSFlags), getImmFixupKind(TSFlags), + CurByte, OS, Fixups); + } + + #ifndef NDEBUG // FIXME: Verify. if (/*!Desc.isVariadic() &&*/ CurOp != NumOps) { Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107715&r1=107714&r2=107715&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 17:36:24 2010 @@ -11926,4 +11926,27 @@ // CHECK: encoding: [0xc4,0xe3,0x51,0x41,0x08,0x03] vdppd $3, (%eax), %xmm5, %xmm1 +// CHECK: vblendvpd %xmm2, %xmm5, %xmm1, %xmm3 +// CHECK: encoding: [0xc4,0xe3,0x71,0x4b,0xdd,0x20] + vblendvpd %xmm2, %xmm5, %xmm1, %xmm3 + +// CHECK: vblendvpd %xmm2, (%eax), %xmm1, %xmm3 +// CHECK: encoding: [0xc4,0xe3,0x71,0x4b,0x18,0x20] + vblendvpd %xmm2, (%eax), %xmm1, %xmm3 + +// CHECK: vblendvps %xmm2, %xmm5, %xmm1, %xmm3 +// CHECK: encoding: [0xc4,0xe3,0x71,0x4a,0xdd,0x20] + vblendvps %xmm2, %xmm5, %xmm1, %xmm3 + +// CHECK: vblendvps %xmm2, (%eax), %xmm1, %xmm3 +// CHECK: encoding: [0xc4,0xe3,0x71,0x4a,0x18,0x20] + vblendvps %xmm2, (%eax), %xmm1, %xmm3 + +// CHECK: vpblendvb %xmm2, %xmm5, %xmm1, %xmm3 +// CHECK: encoding: [0xc4,0xe3,0x71,0x4c,0xdd,0x20] + vpblendvb %xmm2, %xmm5, %xmm1, %xmm3 + +// CHECK: vpblendvb %xmm2, (%eax), %xmm1, %xmm3 +// CHECK: encoding: [0xc4,0xe3,0x71,0x4c,0x18,0x20] + vpblendvb %xmm2, (%eax), %xmm1, %xmm3 Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107715&r1=107714&r2=107715&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 17:36:24 2010 @@ -1974,3 +1974,27 @@ // CHECK: encoding: [0xc4,0x63,0x51,0x41,0x18,0x03] vdppd $3, (%rax), %xmm5, %xmm11 +// CHECK: vblendvpd %xmm12, %xmm5, %xmm11, %xmm13 +// CHECK: encoding: [0xc4,0x63,0x21,0x4b,0xed,0xc0] + vblendvpd %xmm12, %xmm5, %xmm11, %xmm13 + +// CHECK: vblendvpd %xmm12, (%rax), %xmm11, %xmm13 +// CHECK: encoding: [0xc4,0x63,0x21,0x4b,0x28,0xc0] + vblendvpd %xmm12, (%rax), %xmm11, %xmm13 + +// CHECK: vblendvps %xmm12, %xmm5, %xmm11, %xmm13 +// CHECK: encoding: [0xc4,0x63,0x21,0x4a,0xed,0xc0] + vblendvps %xmm12, %xmm5, %xmm11, %xmm13 + +// CHECK: vblendvps %xmm12, (%rax), %xmm11, %xmm13 +// CHECK: encoding: [0xc4,0x63,0x21,0x4a,0x28,0xc0] + vblendvps %xmm12, (%rax), %xmm11, %xmm13 + +// CHECK: vpblendvb %xmm12, %xmm5, %xmm11, %xmm13 +// CHECK: encoding: [0xc4,0x63,0x21,0x4c,0xed,0xc0] + vpblendvb %xmm12, %xmm5, %xmm11, %xmm13 + +// CHECK: vpblendvb %xmm12, (%rax), %xmm11, %xmm13 +// CHECK: encoding: [0xc4,0x63,0x21,0x4c,0x28,0xc0] + vpblendvb %xmm12, (%rax), %xmm11, %xmm13 + From bruno.cardoso at gmail.com Tue Jul 6 17:38:32 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 06 Jul 2010 22:38:32 -0000 Subject: [llvm-commits] [llvm] r107717 - /llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Message-ID: <20100706223832.308AC2A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 17:38:32 2010 New Revision: 107717 URL: http://llvm.org/viewvc/llvm-project?rev=107717&view=rev Log: Fix comment from previous patch Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=107717&r1=107716&r2=107717&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Tue Jul 6 17:38:32 2010 @@ -502,7 +502,7 @@ } // If the last register should be encoded in the immediate field - // ignored it here. + // do not use any bit from VEX prefix to this register, ignore it if ((TSFlags >> 32) & X86II::VEX_I8IMM) NumOps--; From bruno.cardoso at gmail.com Tue Jul 6 18:01:41 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 06 Jul 2010 23:01:41 -0000 Subject: [llvm-commits] [llvm] r107720 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100706230142.172C22A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 18:01:41 2010 New Revision: 107720 URL: http://llvm.org/viewvc/llvm-project?rev=107720&view=rev Log: Add part of AVX SSE4.1 packed move with sign/zero extend instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107720&r1=107719&r2=107720&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 18:01:41 2010 @@ -4304,6 +4304,21 @@ OpSize; } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { +defm VPMOVSXBW : SS41I_binop_rm_int8<0x20, "vpmovsxbw", int_x86_sse41_pmovsxbw>, + VEX; +defm VPMOVSXWD : SS41I_binop_rm_int8<0x23, "vpmovsxwd", int_x86_sse41_pmovsxwd>, + VEX; +defm VPMOVSXDQ : SS41I_binop_rm_int8<0x25, "vpmovsxdq", int_x86_sse41_pmovsxdq>, + VEX; +defm VPMOVZXBW : SS41I_binop_rm_int8<0x30, "vpmovzxbw", int_x86_sse41_pmovzxbw>, + VEX; +defm VPMOVZXWD : SS41I_binop_rm_int8<0x33, "vpmovzxwd", int_x86_sse41_pmovzxwd>, + VEX; +defm VPMOVZXDQ : SS41I_binop_rm_int8<0x35, "vpmovzxdq", int_x86_sse41_pmovzxdq>, + VEX; +} + defm PMOVSXBW : SS41I_binop_rm_int8<0x20, "pmovsxbw", int_x86_sse41_pmovsxbw>; defm PMOVSXWD : SS41I_binop_rm_int8<0x23, "pmovsxwd", int_x86_sse41_pmovsxwd>; defm PMOVSXDQ : SS41I_binop_rm_int8<0x25, "pmovsxdq", int_x86_sse41_pmovsxdq>; Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107720&r1=107719&r2=107720&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 18:01:41 2010 @@ -11950,3 +11950,51 @@ // CHECK: encoding: [0xc4,0xe3,0x71,0x4c,0x18,0x20] vpblendvb %xmm2, (%eax), %xmm1, %xmm3 +// CHECK: vpmovsxbw %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x20,0xea] + vpmovsxbw %xmm2, %xmm5 + +// CHECK: vpmovsxbw (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x20,0x10] + vpmovsxbw (%eax), %xmm2 + +// CHECK: vpmovsxwd %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x23,0xea] + vpmovsxwd %xmm2, %xmm5 + +// CHECK: vpmovsxwd (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x23,0x10] + vpmovsxwd (%eax), %xmm2 + +// CHECK: vpmovsxdq %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x25,0xea] + vpmovsxdq %xmm2, %xmm5 + +// CHECK: vpmovsxdq (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x25,0x10] + vpmovsxdq (%eax), %xmm2 + +// CHECK: vpmovzxbw %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x30,0xea] + vpmovzxbw %xmm2, %xmm5 + +// CHECK: vpmovzxbw (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x30,0x10] + vpmovzxbw (%eax), %xmm2 + +// CHECK: vpmovzxwd %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x33,0xea] + vpmovzxwd %xmm2, %xmm5 + +// CHECK: vpmovzxwd (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x33,0x10] + vpmovzxwd (%eax), %xmm2 + +// CHECK: vpmovzxdq %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x35,0xea] + vpmovzxdq %xmm2, %xmm5 + +// CHECK: vpmovzxdq (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x35,0x10] + vpmovzxdq (%eax), %xmm2 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107720&r1=107719&r2=107720&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 18:01:41 2010 @@ -1998,3 +1998,52 @@ // CHECK: encoding: [0xc4,0x63,0x21,0x4c,0x28,0xc0] vpblendvb %xmm12, (%rax), %xmm11, %xmm13 +// CHECK: vpmovsxbw %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x20,0xd4] + vpmovsxbw %xmm12, %xmm10 + +// CHECK: vpmovsxbw (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x20,0x20] + vpmovsxbw (%rax), %xmm12 + +// CHECK: vpmovsxwd %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x23,0xd4] + vpmovsxwd %xmm12, %xmm10 + +// CHECK: vpmovsxwd (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x23,0x20] + vpmovsxwd (%rax), %xmm12 + +// CHECK: vpmovsxdq %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x25,0xd4] + vpmovsxdq %xmm12, %xmm10 + +// CHECK: vpmovsxdq (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x25,0x20] + vpmovsxdq (%rax), %xmm12 + +// CHECK: vpmovzxbw %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x30,0xd4] + vpmovzxbw %xmm12, %xmm10 + +// CHECK: vpmovzxbw (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x30,0x20] + vpmovzxbw (%rax), %xmm12 + +// CHECK: vpmovzxwd %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x33,0xd4] + vpmovzxwd %xmm12, %xmm10 + +// CHECK: vpmovzxwd (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x33,0x20] + vpmovzxwd (%rax), %xmm12 + +// CHECK: vpmovzxdq %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x35,0xd4] + vpmovzxdq %xmm12, %xmm10 + +// CHECK: vpmovzxdq (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x35,0x20] + vpmovzxdq (%rax), %xmm12 + + From dalej at apple.com Tue Jul 6 18:06:58 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 06 Jul 2010 23:06:58 -0000 Subject: [llvm-commits] [llvm] r107721 - /llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll Message-ID: <20100706230658.BC3D02A6C12C@llvm.org> Author: johannes Date: Tue Jul 6 18:06:58 2010 New Revision: 107721 URL: http://llvm.org/viewvc/llvm-project?rev=107721&view=rev Log: Make test not hang waiting for input. Modified: llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll Modified: llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll?rev=107721&r1=107720&r2=107721&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll (original) +++ llvm/trunk/test/CodeGen/X86/2010-07-06-DbgCrash.ll Tue Jul 6 18:06:58 2010 @@ -1,4 +1,4 @@ -; RUN: llc -O0 -relocation-model pic -o /dev/null +; RUN: llc -O0 -relocation-model pic < %s -o /dev/null ; PR7545 @.str = private constant [4 x i8] c"one\00", align 1 ; <[4 x i8]*> [#uses=1] @.str1 = private constant [4 x i8] c"two\00", align 1 ; <[5 x i8]*> [#uses=1] From bruno.cardoso at gmail.com Tue Jul 6 18:15:17 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 06 Jul 2010 23:15:17 -0000 Subject: [llvm-commits] [llvm] r107723 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100706231518.2570B2A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 18:15:17 2010 New Revision: 107723 URL: http://llvm.org/viewvc/llvm-project?rev=107723&view=rev Log: Add the rest of AVX SSE4.1 packed move with sign/zero extend instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107723&r1=107722&r2=107723&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 18:15:17 2010 @@ -4370,6 +4370,17 @@ OpSize; } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { +defm VPMOVSXBD : SS41I_binop_rm_int4<0x21, "vpmovsxbd", int_x86_sse41_pmovsxbd>, + VEX; +defm VPMOVSXWQ : SS41I_binop_rm_int4<0x24, "vpmovsxwq", int_x86_sse41_pmovsxwq>, + VEX; +defm VPMOVZXBD : SS41I_binop_rm_int4<0x31, "vpmovzxbd", int_x86_sse41_pmovzxbd>, + VEX; +defm VPMOVZXWQ : SS41I_binop_rm_int4<0x34, "vpmovzxwq", int_x86_sse41_pmovzxwq>, + VEX; +} + defm PMOVSXBD : SS41I_binop_rm_int4<0x21, "pmovsxbd", int_x86_sse41_pmovsxbd>; defm PMOVSXWQ : SS41I_binop_rm_int4<0x24, "pmovsxwq", int_x86_sse41_pmovsxwq>; defm PMOVZXBD : SS41I_binop_rm_int4<0x31, "pmovzxbd", int_x86_sse41_pmovzxbd>; @@ -4400,6 +4411,12 @@ OpSize; } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { +defm VPMOVSXBQ : SS41I_binop_rm_int2<0x22, "vpmovsxbq", int_x86_sse41_pmovsxbq>, + VEX; +defm VPMOVZXBQ : SS41I_binop_rm_int2<0x32, "vpmovzxbq", int_x86_sse41_pmovzxbq>, + VEX; +} defm PMOVSXBQ : SS41I_binop_rm_int2<0x22, "pmovsxbq", int_x86_sse41_pmovsxbq>; defm PMOVZXBQ : SS41I_binop_rm_int2<0x32, "pmovzxbq", int_x86_sse41_pmovzxbq>; Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107723&r1=107722&r2=107723&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 18:15:17 2010 @@ -11998,3 +11998,51 @@ // CHECK: encoding: [0xc4,0xe2,0x79,0x35,0x10] vpmovzxdq (%eax), %xmm2 +// CHECK: vpmovsxbq %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x22,0xea] + vpmovsxbq %xmm2, %xmm5 + +// CHECK: vpmovsxbq (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x22,0x10] + vpmovsxbq (%eax), %xmm2 + +// CHECK: vpmovzxbq %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x32,0xea] + vpmovzxbq %xmm2, %xmm5 + +// CHECK: vpmovzxbq (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x32,0x10] + vpmovzxbq (%eax), %xmm2 + +// CHECK: vpmovsxbd %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x21,0xea] + vpmovsxbd %xmm2, %xmm5 + +// CHECK: vpmovsxbd (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x21,0x10] + vpmovsxbd (%eax), %xmm2 + +// CHECK: vpmovsxwq %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x24,0xea] + vpmovsxwq %xmm2, %xmm5 + +// CHECK: vpmovsxwq (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x24,0x10] + vpmovsxwq (%eax), %xmm2 + +// CHECK: vpmovzxbd %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x31,0xea] + vpmovzxbd %xmm2, %xmm5 + +// CHECK: vpmovzxbd (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x31,0x10] + vpmovzxbd (%eax), %xmm2 + +// CHECK: vpmovzxwq %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x34,0xea] + vpmovzxwq %xmm2, %xmm5 + +// CHECK: vpmovzxwq (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x34,0x10] + vpmovzxwq (%eax), %xmm2 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107723&r1=107722&r2=107723&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 18:15:17 2010 @@ -2046,4 +2046,51 @@ // CHECK: encoding: [0xc4,0x62,0x79,0x35,0x20] vpmovzxdq (%rax), %xmm12 +// CHECK: vpmovsxbq %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x22,0xd4] + vpmovsxbq %xmm12, %xmm10 + +// CHECK: vpmovsxbq (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x22,0x20] + vpmovsxbq (%rax), %xmm12 + +// CHECK: vpmovzxbq %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x32,0xd4] + vpmovzxbq %xmm12, %xmm10 + +// CHECK: vpmovzxbq (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x32,0x20] + vpmovzxbq (%rax), %xmm12 + +// CHECK: vpmovsxbd %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x21,0xd4] + vpmovsxbd %xmm12, %xmm10 + +// CHECK: vpmovsxbd (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x21,0x20] + vpmovsxbd (%rax), %xmm12 + +// CHECK: vpmovsxwq %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x24,0xd4] + vpmovsxwq %xmm12, %xmm10 + +// CHECK: vpmovsxwq (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x24,0x20] + vpmovsxwq (%rax), %xmm12 + +// CHECK: vpmovzxbd %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x31,0xd4] + vpmovzxbd %xmm12, %xmm10 + +// CHECK: vpmovzxbd (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x31,0x20] + vpmovzxbd (%rax), %xmm12 + +// CHECK: vpmovzxwq %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x34,0xd4] + vpmovzxwq %xmm12, %xmm10 + +// CHECK: vpmovzxwq (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x34,0x20] + vpmovzxwq (%rax), %xmm12 From stoklund at 2pi.dk Tue Jul 6 18:26:23 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 06 Jul 2010 23:26:23 -0000 Subject: [llvm-commits] [llvm] r107725 - /llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp Message-ID: <20100706232623.346982A6C12D@llvm.org> Author: stoklund Date: Tue Jul 6 18:26:23 2010 New Revision: 107725 URL: http://llvm.org/viewvc/llvm-project?rev=107725&view=rev Log: Track defs for all aliases in NEONMoveFix. This means that an instruction defining an S register will affect the domain of the parent D register. Modified: llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp Modified: llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp?rev=107725&r1=107724&r2=107725&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp Tue Jul 6 18:26:23 2010 @@ -105,8 +105,8 @@ unsigned MOReg = MO.getReg(); Defs[MOReg] = MI; - // Catch subregs as well. - for (const unsigned *R = TRI->getSubRegisters(MOReg); *R; ++R) + // Catch aliases as well. + for (const unsigned *R = TRI->getAliasSet(MOReg); *R; ++R) Defs[*R] = MI; } } From stoklund at 2pi.dk Tue Jul 6 18:26:25 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 06 Jul 2010 23:26:25 -0000 Subject: [llvm-commits] [llvm] r107726 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp ProcessImplicitDefs.cpp TwoAddressInstructionPass.cpp Message-ID: <20100706232625.B71C62A6C12C@llvm.org> Author: stoklund Date: Tue Jul 6 18:26:25 2010 New Revision: 107726 URL: http://llvm.org/viewvc/llvm-project?rev=107726&view=rev Log: Convert INSERT_SUBREG to COPY in TwoAddressInstructionPass. INSERT_SUBREG will now only appear in SSA machine instructions. Fix the handling of partial redefs in ProcessImplicitDefs. This is now relevant since partial redef COPY instructions appear. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=107726&r1=107725&r2=107726&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Jul 6 18:26:25 2010 @@ -265,7 +265,7 @@ if (MO.getReg() == Reg && MO.isDef()) { assert(MI.getOperand(MOIdx).getSubReg() != MO.getSubReg() && MI.getOperand(MOIdx).getSubReg() && - MO.getSubReg()); + (MO.getSubReg() || MO.isImplicit())); return true; } } Modified: llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp?rev=107726&r1=107725&r2=107726&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp (original) +++ llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp Tue Jul 6 18:26:25 2010 @@ -117,10 +117,24 @@ } } + // Eliminate %reg1032:sub = COPY undef. + if (MI->isCopy() && MI->getOperand(0).getSubReg()) { + MachineOperand &MO = MI->getOperand(1); + if (ImpDefRegs.count(MO.getReg())) { + if (MO.isKill()) { + LiveVariables::VarInfo& vi = lv_->getVarInfo(MO.getReg()); + vi.removeKill(MI); + } + MI->eraseFromParent(); + Changed = true; + continue; + } + } + bool ChangedToImpDef = false; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { MachineOperand& MO = MI->getOperand(i); - if (!MO.isReg() || !MO.isUse() || MO.isUndef()) + if (!MO.isReg() || (MO.isDef() && !MO.getSubReg()) || MO.isUndef()) continue; unsigned Reg = MO.getReg(); if (!Reg) @@ -145,6 +159,12 @@ Changed = true; MO.setIsUndef(); + // This is a partial register redef of an implicit def. + // Make sure the whole register is defined by the instruction. + if (MO.isDef()) { + MI->addRegisterDefined(Reg); + continue; + } if (MO.isKill() || MI->isRegTiedToDefOperand(i)) { // Make sure other uses of for (unsigned j = i+1; j != e; ++j) { Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=107726&r1=107725&r2=107726&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Jul 6 18:26:25 2010 @@ -1218,6 +1218,19 @@ DEBUG(dbgs() << "\t\trewrite to:\t" << *mi); } + // Rewrite INSERT_SUBREG as COPY now that we no longer need SSA form. + if (mi->isInsertSubreg()) { + // From %reg = INSERT_SUBREG %reg, %subreg, subidx + // To %reg:subidx = COPY %subreg + unsigned SubIdx = mi->getOperand(3).getImm(); + mi->RemoveOperand(3); + assert(mi->getOperand(0).getSubReg() == 0 && "Unexpected subreg idx"); + mi->getOperand(0).setSubReg(SubIdx); + mi->RemoveOperand(1); + mi->setDesc(TII->get(TargetOpcode::COPY)); + DEBUG(dbgs() << "\t\tconvert to:\t" << *mi); + } + // Clear TiedOperands here instead of at the top of the loop // since most instructions do not have tied operands. TiedOperands.clear(); From dalej at apple.com Tue Jul 6 18:27:00 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 06 Jul 2010 23:27:00 -0000 Subject: [llvm-commits] [llvm] r107727 - in /llvm/trunk: lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2010-07-06-asm-RIP.ll Message-ID: <20100706232700.F40122A6C12C@llvm.org> Author: johannes Date: Tue Jul 6 18:27:00 2010 New Revision: 107727 URL: http://llvm.org/viewvc/llvm-project?rev=107727&view=rev Log: Accept RIP-relative symbols with 'i' constraint, and print the (%rip) only if the 'a' modifier is present. PR 7528. Added: llvm/trunk/test/CodeGen/X86/2010-07-06-asm-RIP.ll Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp 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=107727&r1=107726&r2=107727&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Tue Jul 6 18:27:00 2010 @@ -388,6 +388,8 @@ } if (MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isSymbol()) { printSymbolOperand(MO, O); + if (Subtarget->isPICStyleRIPRel()) + O << "(%rip)"; return false; } if (MO.isReg()) { Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107727&r1=107726&r2=107727&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 18:27:00 2010 @@ -10264,8 +10264,7 @@ // In any sort of PIC mode addresses need to be computed at runtime by // adding in a register or some sort of table lookup. These can't // be used as immediates. - if (Subtarget->isPICStyleGOT() || Subtarget->isPICStyleStubPIC() || - Subtarget->isPICStyleRIPRel()) + if (Subtarget->isPICStyleGOT() || Subtarget->isPICStyleStubPIC()) return; // If we are in non-pic codegen mode, we allow the address of a global (with Added: llvm/trunk/test/CodeGen/X86/2010-07-06-asm-RIP.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-07-06-asm-RIP.ll?rev=107727&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-07-06-asm-RIP.ll (added) +++ llvm/trunk/test/CodeGen/X86/2010-07-06-asm-RIP.ll Tue Jul 6 18:27:00 2010 @@ -0,0 +1,21 @@ +; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s +; PR 7528 + + at n = global i32 0 ; [#uses=2] + +define void @f(i32*) nounwind ssp { + ret void +} + +define void @g() nounwind ssp { +entry: +; CHECK: _g: +; CHECK: push $_f$_f +; CHECK: call _f(%rip) + call void asm sideeffect "push\09$1$1\0A\09call\09${1:a}\0A\09pop\09%edx", "imr,i,~{dirflag},~{fpsr},~{flags},~{memory},~{cc},~{edi},~{esi},~{edx},~{ecx},~{ebx},~{eax}"(i32* @n, void (i32*)* @f) nounwind + br label %return + +return: ; preds = %entry + ret void +} + From bob.wilson at apple.com Tue Jul 6 18:36:25 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 06 Jul 2010 23:36:25 -0000 Subject: [llvm-commits] [llvm] r107730 - in /llvm/trunk/lib/Target/ARM: ARMISelDAGToDAG.cpp ARMInstrNEON.td Message-ID: <20100706233625.AC22D2A6C12C@llvm.org> Author: bwilson Date: Tue Jul 6 18:36:25 2010 New Revision: 107730 URL: http://llvm.org/viewvc/llvm-project?rev=107730&view=rev Log: Use REG_SEQUENCE nodes to make the table registers for VTBL instructions be allocated to consecutive registers. Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=107730&r1=107729&r2=107730&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jul 6 18:36:25 2010 @@ -143,6 +143,11 @@ unsigned *DOpcodes, unsigned *QOpcodes0, unsigned *QOpcodes1); + /// SelectVTBL - Select NEON VTBL intrinsics. NumVecs should be 2, 3 or 4. + /// These are custom-selected so that a REG_SEQUENCE can be generated to + /// force the table registers to be consecutive. + SDNode *SelectVTBL(SDNode *N, unsigned NumVecs, unsigned Opc); + /// SelectV6T2BitfieldExtractOp - Select SBFX/UBFX instructions for ARM. SDNode *SelectV6T2BitfieldExtractOp(SDNode *N, bool isSigned); @@ -1197,7 +1202,7 @@ SDNode *ARMDAGToDAGISel::SelectVST(SDNode *N, unsigned NumVecs, unsigned *DOpcodes, unsigned *QOpcodes0, unsigned *QOpcodes1) { - assert(NumVecs >=1 && NumVecs <= 4 && "VST NumVecs out-of-range"); + assert(NumVecs >= 1 && NumVecs <= 4 && "VST NumVecs out-of-range"); DebugLoc dl = N->getDebugLoc(); SDValue MemAddr, Align; @@ -1524,6 +1529,42 @@ return NULL; } +SDNode *ARMDAGToDAGISel::SelectVTBL(SDNode *N, unsigned NumVecs, unsigned Opc) { + assert(NumVecs >= 2 && NumVecs <= 4 && "VTBL NumVecs out-of-range"); + DebugLoc dl = N->getDebugLoc(); + EVT VT = N->getValueType(0); + + // Form a REG_SEQUENCE to force register allocation. + SDValue RegSeq; + SDValue V0 = N->getOperand(1); + SDValue V1 = N->getOperand(2); + if (NumVecs == 2) + RegSeq = SDValue(PairDRegs(MVT::v16i8, V0, V1), 0); + else { + SDValue V2 = N->getOperand(3); + // If it's a vtbl3, form a quad D-register and leave the last part as + // an undef. + SDValue V3 = (NumVecs == 3) + ? SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, VT), 0) + : N->getOperand(4); + RegSeq = SDValue(QuadDRegs(MVT::v4i64, V0, V1, V2, V3), 0); + } + + // Now extract the D registers back out. + SmallVector Ops; + Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_0, dl, VT, RegSeq)); + Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_1, dl, VT, RegSeq)); + if (NumVecs > 2) + Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_2, dl, VT, RegSeq)); + if (NumVecs > 3) + Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_3, dl, VT, RegSeq)); + + Ops.push_back(N->getOperand(NumVecs+1)); + Ops.push_back(getAL(CurDAG)); // predicate + Ops.push_back(CurDAG->getRegister(0, MVT::i32)); // predicate register + return CurDAG->getMachineNode(Opc, dl, VT, Ops.data(), NumVecs+3); +} + SDNode *ARMDAGToDAGISel::SelectV6T2BitfieldExtractOp(SDNode *N, bool isSigned) { if (!Subtarget->hasV6T2Ops()) @@ -2281,6 +2322,22 @@ break; } + case ISD::INTRINSIC_WO_CHAIN: { + unsigned IntNo = cast(N->getOperand(0))->getZExtValue(); + switch (IntNo) { + default: + break; + + case Intrinsic::arm_neon_vtbl2: + return SelectVTBL(N, 2, ARM::VTBL2); + case Intrinsic::arm_neon_vtbl3: + return SelectVTBL(N, 3, ARM::VTBL3); + case Intrinsic::arm_neon_vtbl4: + return SelectVTBL(N, 4, ARM::VTBL4); + } + break; + } + case ISD::CONCAT_VECTORS: return SelectConcatVector(N); } Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=107730&r1=107729&r2=107730&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Tue Jul 6 18:36:25 2010 @@ -3291,22 +3291,16 @@ def VTBL2 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$dst), (ins DPR:$tbl1, DPR:$tbl2, DPR:$src), NVTBLFrm, IIC_VTB2, - "vtbl", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "", - [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl2 - DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>; + "vtbl", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "", []>; def VTBL3 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$dst), (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), NVTBLFrm, IIC_VTB3, - "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "", - [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl3 - DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>; + "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "", []>; def VTBL4 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$dst), (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), NVTBLFrm, IIC_VTB4, - "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src", "", - [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl4 DPR:$tbl1, DPR:$tbl2, - DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>; + "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src", "", []>; } // hasExtraSrcRegAllocReq = 1 // VTBX : Vector Table Extension From stoklund at 2pi.dk Tue Jul 6 18:40:35 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 06 Jul 2010 23:40:35 -0000 Subject: [llvm-commits] [llvm] r107732 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp LowerSubregs.cpp ProcessImplicitDefs.cpp RegisterCoalescer.cpp SimpleRegisterCoalescing.cpp StackSlotColoring.cpp TwoAddressInstructionPass.cpp Message-ID: <20100706234035.6D51B2A6C12C@llvm.org> Author: stoklund Date: Tue Jul 6 18:40:35 2010 New Revision: 107732 URL: http://llvm.org/viewvc/llvm-project?rev=107732&view=rev Log: Remove references to INSERT_SUBREG after de-SSA Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/StackSlotColoring.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Jul 6 18:40:35 2010 @@ -324,12 +324,6 @@ if (mi->isCopyLike() || tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) { CopyMI = mi; - - // Some of the REG_SEQUENCE lowering in TwoAddressInstrPass creates - // implicit defs without really knowing. It shows up as INSERT_SUBREG - // using an undefined register. - if (mi->isInsertSubreg()) - mi->getOperand(1).setIsUndef(); } VNInfo *ValNo = interval.getNextValue(defIndex, CopyMI, true, Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Tue Jul 6 18:40:35 2010 @@ -54,7 +54,6 @@ private: bool LowerExtract(MachineInstr *MI); - bool LowerInsert(MachineInstr *MI); bool LowerSubregToReg(MachineInstr *MI); bool LowerCopy(MachineInstr *MI); @@ -238,90 +237,6 @@ return true; } -bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) { - MachineBasicBlock *MBB = MI->getParent(); - assert((MI->getOperand(0).isReg() && MI->getOperand(0).isDef()) && - (MI->getOperand(1).isReg() && MI->getOperand(1).isUse()) && - (MI->getOperand(2).isReg() && MI->getOperand(2).isUse()) && - MI->getOperand(3).isImm() && "Invalid insert_subreg"); - - unsigned DstReg = MI->getOperand(0).getReg(); -#ifndef NDEBUG - unsigned SrcReg = MI->getOperand(1).getReg(); -#endif - unsigned InsReg = MI->getOperand(2).getReg(); - unsigned SubIdx = MI->getOperand(3).getImm(); - - assert(DstReg == SrcReg && "insert_subreg not a two-address instruction?"); - assert(SubIdx != 0 && "Invalid index for insert_subreg"); - unsigned DstSubReg = TRI->getSubReg(DstReg, SubIdx); - assert(DstSubReg && "invalid subregister index for register"); - assert(TargetRegisterInfo::isPhysicalRegister(SrcReg) && - "Insert superreg source must be in a physical register"); - assert(TargetRegisterInfo::isPhysicalRegister(InsReg) && - "Inserted value must be in a physical register"); - - DEBUG(dbgs() << "subreg: CONVERTING: " << *MI); - - if (DstSubReg == InsReg) { - // No need to insert an identity copy instruction. If the SrcReg was - // , we need to make sure it is alive by inserting a KILL - if (MI->getOperand(1).isUndef() && !MI->getOperand(0).isDead()) { - MachineInstrBuilder MIB = BuildMI(*MBB, MI, MI->getDebugLoc(), - TII->get(TargetOpcode::KILL), DstReg); - if (MI->getOperand(2).isUndef()) - MIB.addReg(InsReg, RegState::Undef); - else - MIB.addReg(InsReg, RegState::Kill); - } else { - DEBUG(dbgs() << "subreg: eliminated!\n"); - MBB->erase(MI); - return true; - } - } else { - // Insert sub-register copy - const TargetRegisterClass *TRC0= TRI->getPhysicalRegisterRegClass(DstSubReg); - const TargetRegisterClass *TRC1= TRI->getPhysicalRegisterRegClass(InsReg); - if (MI->getOperand(2).isUndef()) - // If the source register being inserted is undef, then this becomes a - // KILL. - BuildMI(*MBB, MI, MI->getDebugLoc(), - TII->get(TargetOpcode::KILL), DstSubReg); - else { - bool Emitted = TII->copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1, - MI->getDebugLoc()); - (void)Emitted; - assert(Emitted && "Subreg and Dst must be of compatible register class"); - } - MachineBasicBlock::iterator CopyMI = MI; - --CopyMI; - - // INSERT_SUBREG is a two-address instruction so it implicitly kills SrcReg. - if (!MI->getOperand(1).isUndef()) - CopyMI->addOperand(MachineOperand::CreateReg(DstReg, false, true, true)); - - // Transfer the kill/dead flags, if needed. - if (MI->getOperand(0).isDead()) { - TransferDeadFlag(MI, DstSubReg, TRI); - } else { - // Make sure the full DstReg is live after this replacement. - CopyMI->addOperand(MachineOperand::CreateReg(DstReg, true, true)); - } - - // Make sure the inserted register gets killed - if (MI->getOperand(2).isKill() && !MI->getOperand(2).isUndef()) - TransferKillFlag(MI, InsReg, TRI); - } - - DEBUG({ - MachineBasicBlock::iterator dMI = MI; - dbgs() << "subreg: " << *(--dMI) << "\n"; - }); - - MBB->erase(MI); - return true; -} - bool LowerSubregsInstructionPass::LowerCopy(MachineInstr *MI) { MachineOperand &DstMO = MI->getOperand(0); MachineOperand &SrcMO = MI->getOperand(1); @@ -387,10 +302,9 @@ mi != me;) { MachineBasicBlock::iterator nmi = llvm::next(mi); MachineInstr *MI = mi; + assert(!MI->isInsertSubreg() && "INSERT_SUBREG should no longer appear"); if (MI->isExtractSubreg()) { MadeChange |= LowerExtract(MI); - } else if (MI->isInsertSubreg()) { - MadeChange |= LowerInsert(MI); } else if (MI->isSubregToReg()) { MadeChange |= LowerSubregToReg(MI); } else if (MI->isCopy()) { Modified: llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp (original) +++ llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp Tue Jul 6 18:40:35 2010 @@ -102,21 +102,6 @@ continue; } - if (MI->isInsertSubreg()) { - MachineOperand &MO = MI->getOperand(2); - if (ImpDefRegs.count(MO.getReg())) { - // %reg1032 = INSERT_SUBREG %reg1032, undef, 2 - // This is an identity copy, eliminate it now. - if (MO.isKill()) { - LiveVariables::VarInfo& vi = lv_->getVarInfo(MO.getReg()); - vi.removeKill(MI); - } - MI->eraseFromParent(); - Changed = true; - continue; - } - } - // Eliminate %reg1032:sub = COPY undef. if (MI->isCopy() && MI->getOperand(0).getSubReg()) { MachineOperand &MO = MI->getOperand(1); Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Tue Jul 6 18:40:35 2010 @@ -54,7 +54,7 @@ DstSub = MI->getOperand(0).getSubReg(); Src = MI->getOperand(1).getReg(); SrcSub = compose(MI->getOperand(1).getSubReg(), MI->getOperand(2).getImm()); - } else if (MI->isInsertSubreg() || MI->isSubregToReg()) { + } else if (MI->isSubregToReg()) { Dst = MI->getOperand(0).getReg(); DstSub = compose(MI->getOperand(0).getSubReg(), MI->getOperand(3).getImm()); Src = MI->getOperand(2).getReg(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jul 6 18:40:35 2010 @@ -1523,12 +1523,7 @@ if (Inst->isCopy() || Inst->isExtractSubreg()) { DstReg = Inst->getOperand(0).getReg(); SrcReg = Inst->getOperand(1).getReg(); - } else if (Inst->isInsertSubreg()) { - DstReg = Inst->getOperand(0).getReg(); - SrcReg = Inst->getOperand(2).getReg(); - if (Inst->getOperand(1).isUndef()) - isInsUndef = true; - } else if (Inst->isInsertSubreg() || Inst->isSubregToReg()) { + } else if (Inst->isSubregToReg()) { DstReg = Inst->getOperand(0).getReg(); SrcReg = Inst->getOperand(2).getReg(); } else if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original) +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Tue Jul 6 18:40:35 2010 @@ -508,8 +508,7 @@ // Abort the use is actually a sub-register def. We don't have enough // information to figure out if it is really legal. - if (MO.getSubReg() || MII->isExtractSubreg() || - MII->isInsertSubreg() || MII->isSubregToReg()) + if (MO.getSubReg() || MII->isExtractSubreg() || MII->isSubregToReg()) return false; const TargetRegisterClass *RC = TID.OpInfo[i].getRegClass(TRI); Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=107732&r1=107731&r2=107732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Jul 6 18:40:35 2010 @@ -1359,25 +1359,11 @@ // Insert a copy or an extract to replace the original extracts. MachineBasicBlock::iterator InsertLoc = SomeMI; - if (NewSrcSubIdx) { - // Insert an extract subreg. - BuildMI(*SomeMI->getParent(), InsertLoc, SomeMI->getDebugLoc(), - TII->get(TargetOpcode::EXTRACT_SUBREG), DstReg) - .addReg(SrcReg).addImm(NewSrcSubIdx); - } else if (NewDstSubIdx) { - // Do a subreg insertion. - BuildMI(*SomeMI->getParent(), InsertLoc, SomeMI->getDebugLoc(), - TII->get(TargetOpcode::INSERT_SUBREG), DstReg) - .addReg(DstReg).addReg(SrcReg).addImm(NewDstSubIdx); - } else { - // Insert a copy. - bool Emitted = - TII->copyRegToReg(*SomeMI->getParent(), InsertLoc, DstReg, SrcReg, - MRI->getRegClass(DstReg), MRI->getRegClass(SrcReg), - SomeMI->getDebugLoc()); - (void)Emitted; - } - MachineBasicBlock::iterator CopyMI = prior(InsertLoc); + MachineInstr *CopyMI = BuildMI(*SomeMI->getParent(), SomeMI, + SomeMI->getDebugLoc(), + TII->get(TargetOpcode::COPY)) + .addReg(DstReg, RegState::Define, NewDstSubIdx) + .addReg(SrcReg, 0, NewSrcSubIdx); // Remove all the old extract instructions. for (MachineRegisterInfo::use_nodbg_iterator From grosbach at apple.com Tue Jul 6 18:44:52 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 06 Jul 2010 23:44:52 -0000 Subject: [llvm-commits] [llvm] r107734 - in /llvm/trunk/lib: CodeGen/SelectionDAG/LegalizeDAG.cpp Target/ARM/ARMISelLowering.cpp Message-ID: <20100706234452.C461C2A6C12C@llvm.org> Author: grosbach Date: Tue Jul 6 18:44:52 2010 New Revision: 107734 URL: http://llvm.org/viewvc/llvm-project?rev=107734&view=rev Log: By default, the eh.sjlj.setjmp/longjmp intrinsics should just do nothing rather than assuming a target will custom lower them. Targets which do so should exlicitly mark them as having custom lowerings. PR7454. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=107734&r1=107733&r2=107734&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 6 18:44:52 2010 @@ -859,6 +859,8 @@ case ISD::MERGE_VALUES: case ISD::EH_RETURN: case ISD::FRAME_TO_ARGS_OFFSET: + case ISD::EH_SJLJ_SETJMP: + case ISD::EH_SJLJ_LONGJMP: // These operations lie about being legal: when they claim to be legal, // they should actually be expanded. Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)); @@ -868,8 +870,6 @@ case ISD::TRAMPOLINE: case ISD::FRAMEADDR: case ISD::RETURNADDR: - case ISD::EH_SJLJ_SETJMP: - case ISD::EH_SJLJ_LONGJMP: // These operations lie about being legal: when they claim to be legal, // they should actually be custom-lowered. Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)); @@ -2507,6 +2507,11 @@ case ISD::EH_LABEL: case ISD::PREFETCH: case ISD::VAEND: + case ISD::EH_SJLJ_LONGJMP: + Results.push_back(Node->getOperand(0)); + break; + case ISD::EH_SJLJ_SETJMP: + Results.push_back(DAG.getConstant(0, MVT::i32)); Results.push_back(Node->getOperand(0)); break; case ISD::MEMBARRIER: { Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107734&r1=107733&r2=107734&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 6 18:44:52 2010 @@ -473,6 +473,8 @@ // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); + setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom); + setOperationAction(ISD::EH_SJLJ_LONGJMP, MVT::Other, Custom); setOperationAction(ISD::SETCC, MVT::i32, Expand); setOperationAction(ISD::SETCC, MVT::f32, Expand); From bruno.cardoso at gmail.com Tue Jul 6 19:07:24 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 00:07:24 -0000 Subject: [llvm-commits] [llvm] r107740 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100707000724.57A272A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 19:07:24 2010 New Revision: 107740 URL: http://llvm.org/viewvc/llvm-project?rev=107740&view=rev Log: Add AVX SSE4.1 Extract Integer instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107740&r1=107739&r2=107740&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 19:07:24 2010 @@ -4450,6 +4450,9 @@ // (store (i8 (trunc (X86pextrb (v16i8 VR128:$src1), imm:$src2))), addr:$dst) } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRB : SS41I_extract8<0x14, "vpextrb">, VEX; + defm PEXTRB : SS41I_extract8<0x14, "pextrb">; @@ -4465,6 +4468,9 @@ // (store (i16 (trunc (X86pextrw (v16i8 VR128:$src1), imm:$src2))), addr:$dst) } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRW : SS41I_extract16<0x15, "vpextrw">, VEX; + defm PEXTRW : SS41I_extract16<0x15, "pextrw">; @@ -4484,8 +4490,13 @@ addr:$dst)]>, OpSize; } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRD : SS41I_extract32<0x16, "vpextrd">, VEX; + defm PEXTRD : SS41I_extract32<0x16, "pextrd">; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRQ : SS41I_extract64<0x16, "vpextrq">, VEX, VEX_W; /// SS41I_extractf32 - SSE 4.1 extract 32 bits fp value to int reg or memory /// destination Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107740&r1=107739&r2=107740&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 19:07:24 2010 @@ -12046,3 +12046,27 @@ // CHECK: encoding: [0xc4,0xe2,0x79,0x34,0x10] vpmovzxwq (%eax), %xmm2 +// CHECK: vpextrw $7, %xmm2, %eax +// CHECK: encoding: [0xc5,0xf9,0xc5,0xc2,0x07] + vpextrw $7, %xmm2, %eax + +// CHECK: vpextrw $7, %xmm2, (%eax) +// CHECK: encoding: [0xc4,0xe3,0x79,0x15,0x10,0x07] + vpextrw $7, %xmm2, (%eax) + +// CHECK: vpextrd $7, %xmm2, %eax +// CHECK: encoding: [0xc4,0xe3,0x79,0x16,0xd0,0x07] + vpextrd $7, %xmm2, %eax + +// CHECK: vpextrd $7, %xmm2, (%eax) +// CHECK: encoding: [0xc4,0xe3,0x79,0x16,0x10,0x07] + vpextrd $7, %xmm2, (%eax) + +// CHECK: vpextrb $7, %xmm2, %eax +// CHECK: encoding: [0xc4,0xe3,0x79,0x14,0xd0,0x07] + vpextrb $7, %xmm2, %eax + +// CHECK: vpextrb $7, %xmm2, (%eax) +// CHECK: encoding: [0xc4,0xe3,0x79,0x14,0x10,0x07] + vpextrb $7, %xmm2, (%eax) + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107740&r1=107739&r2=107740&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 19:07:24 2010 @@ -2094,3 +2094,35 @@ // CHECK: encoding: [0xc4,0x62,0x79,0x34,0x20] vpmovzxwq (%rax), %xmm12 +// CHECK: vpextrw $7, %xmm12, %eax +// CHECK: encoding: [0xc4,0xc1,0x79,0xc5,0xc4,0x07] + vpextrw $7, %xmm12, %eax + +// CHECK: vpextrw $7, %xmm12, (%rax) +// CHECK: encoding: [0xc4,0x63,0x79,0x15,0x20,0x07] + vpextrw $7, %xmm12, (%rax) + +// CHECK: vpextrd $7, %xmm12, %eax +// CHECK: encoding: [0xc4,0x63,0x79,0x16,0xe0,0x07] + vpextrd $7, %xmm12, %eax + +// CHECK: vpextrd $7, %xmm12, (%rax) +// CHECK: encoding: [0xc4,0x63,0x79,0x16,0x20,0x07] + vpextrd $7, %xmm12, (%rax) + +// CHECK: vpextrb $7, %xmm12, %eax +// CHECK: encoding: [0xc4,0x63,0x79,0x14,0xe0,0x07] + vpextrb $7, %xmm12, %eax + +// CHECK: vpextrb $7, %xmm12, (%rax) +// CHECK: encoding: [0xc4,0x63,0x79,0x14,0x20,0x07] + vpextrb $7, %xmm12, (%rax) + +// CHECK: vpextrq $7, %xmm12, %rcx +// CHECK: encoding: [0xc4,0x63,0xf9,0x16,0xe1,0x07] + vpextrq $7, %xmm12, %rcx + +// CHECK: vpextrq $7, %xmm12, (%rcx) +// CHECK: encoding: [0xc4,0x63,0xf9,0x16,0x21,0x07] + vpextrq $7, %xmm12, (%rcx) + From grosbach at apple.com Tue Jul 6 19:07:57 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 07 Jul 2010 00:07:57 -0000 Subject: [llvm-commits] [llvm] r107742 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20100707000757.73E5A2A6C12C@llvm.org> Author: grosbach Date: Tue Jul 6 19:07:57 2010 New Revision: 107742 URL: http://llvm.org/viewvc/llvm-project?rev=107742&view=rev Log: Mark eh.sjlj.set/longjmp custom lowerings as Darwin-only since that's where they've been tested to work. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107742&r1=107741&r2=107742&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jul 6 19:07:57 2010 @@ -473,8 +473,10 @@ // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); - setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom); - setOperationAction(ISD::EH_SJLJ_LONGJMP, MVT::Other, Custom); + if (Subtarget->isTargetDarwin()) { + setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom); + setOperationAction(ISD::EH_SJLJ_LONGJMP, MVT::Other, Custom); + } setOperationAction(ISD::SETCC, MVT::i32, Expand); setOperationAction(ISD::SETCC, MVT::f32, Expand); From bob.wilson at apple.com Tue Jul 6 19:08:55 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 07 Jul 2010 00:08:55 -0000 Subject: [llvm-commits] [llvm] r107743 - in /llvm/trunk/lib/Target/ARM: ARMISelDAGToDAG.cpp ARMInstrNEON.td Message-ID: <20100707000855.33C062A6C12C@llvm.org> Author: bwilson Date: Tue Jul 6 19:08:54 2010 New Revision: 107743 URL: http://llvm.org/viewvc/llvm-project?rev=107743&view=rev Log: Also use REG_SEQUENCE for VTBX instructions. Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=107743&r1=107742&r2=107743&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jul 6 19:08:54 2010 @@ -143,10 +143,10 @@ unsigned *DOpcodes, unsigned *QOpcodes0, unsigned *QOpcodes1); - /// SelectVTBL - Select NEON VTBL intrinsics. NumVecs should be 2, 3 or 4. - /// These are custom-selected so that a REG_SEQUENCE can be generated to - /// force the table registers to be consecutive. - SDNode *SelectVTBL(SDNode *N, unsigned NumVecs, unsigned Opc); + /// SelectVTBL - Select NEON VTBL and VTBX intrinsics. NumVecs should be 2, + /// 3 or 4. These are custom-selected so that a REG_SEQUENCE can be + /// generated to force the table registers to be consecutive. + SDNode *SelectVTBL(SDNode *N, bool IsExt, unsigned NumVecs, unsigned Opc); /// SelectV6T2BitfieldExtractOp - Select SBFX/UBFX instructions for ARM. SDNode *SelectV6T2BitfieldExtractOp(SDNode *N, bool isSigned); @@ -1529,29 +1529,33 @@ return NULL; } -SDNode *ARMDAGToDAGISel::SelectVTBL(SDNode *N, unsigned NumVecs, unsigned Opc) { +SDNode *ARMDAGToDAGISel::SelectVTBL(SDNode *N, bool IsExt, unsigned NumVecs, + unsigned Opc) { assert(NumVecs >= 2 && NumVecs <= 4 && "VTBL NumVecs out-of-range"); DebugLoc dl = N->getDebugLoc(); EVT VT = N->getValueType(0); + unsigned FirstTblReg = IsExt ? 2 : 1; // Form a REG_SEQUENCE to force register allocation. SDValue RegSeq; - SDValue V0 = N->getOperand(1); - SDValue V1 = N->getOperand(2); + SDValue V0 = N->getOperand(FirstTblReg + 0); + SDValue V1 = N->getOperand(FirstTblReg + 1); if (NumVecs == 2) RegSeq = SDValue(PairDRegs(MVT::v16i8, V0, V1), 0); else { - SDValue V2 = N->getOperand(3); + SDValue V2 = N->getOperand(FirstTblReg + 2); // If it's a vtbl3, form a quad D-register and leave the last part as // an undef. SDValue V3 = (NumVecs == 3) ? SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, VT), 0) - : N->getOperand(4); + : N->getOperand(FirstTblReg + 3); RegSeq = SDValue(QuadDRegs(MVT::v4i64, V0, V1, V2, V3), 0); } // Now extract the D registers back out. - SmallVector Ops; + SmallVector Ops; + if (IsExt) + Ops.push_back(N->getOperand(1)); Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_0, dl, VT, RegSeq)); Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_1, dl, VT, RegSeq)); if (NumVecs > 2) @@ -1559,10 +1563,10 @@ if (NumVecs > 3) Ops.push_back(CurDAG->getTargetExtractSubreg(ARM::dsub_3, dl, VT, RegSeq)); - Ops.push_back(N->getOperand(NumVecs+1)); + Ops.push_back(N->getOperand(FirstTblReg + NumVecs)); Ops.push_back(getAL(CurDAG)); // predicate Ops.push_back(CurDAG->getRegister(0, MVT::i32)); // predicate register - return CurDAG->getMachineNode(Opc, dl, VT, Ops.data(), NumVecs+3); + return CurDAG->getMachineNode(Opc, dl, VT, Ops.data(), Ops.size()); } SDNode *ARMDAGToDAGISel::SelectV6T2BitfieldExtractOp(SDNode *N, @@ -2329,11 +2333,18 @@ break; case Intrinsic::arm_neon_vtbl2: - return SelectVTBL(N, 2, ARM::VTBL2); + return SelectVTBL(N, false, 2, ARM::VTBL2); case Intrinsic::arm_neon_vtbl3: - return SelectVTBL(N, 3, ARM::VTBL3); + return SelectVTBL(N, false, 3, ARM::VTBL3); case Intrinsic::arm_neon_vtbl4: - return SelectVTBL(N, 4, ARM::VTBL4); + return SelectVTBL(N, false, 4, ARM::VTBL4); + + case Intrinsic::arm_neon_vtbx2: + return SelectVTBL(N, true, 2, ARM::VTBX2); + case Intrinsic::arm_neon_vtbx3: + return SelectVTBL(N, true, 3, ARM::VTBX3); + case Intrinsic::arm_neon_vtbx4: + return SelectVTBL(N, true, 4, ARM::VTBX4); } break; } Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=107743&r1=107742&r2=107743&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Tue Jul 6 19:08:54 2010 @@ -3314,23 +3314,18 @@ def VTBX2 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src), NVTBLFrm, IIC_VTBX2, - "vtbx", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "$orig = $dst", - [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx2 - DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>; + "vtbx", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "$orig = $dst", []>; def VTBX3 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), NVTBLFrm, IIC_VTBX3, - "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "$orig = $dst", - [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx3 DPR:$orig, DPR:$tbl1, - DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>; + "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", + "$orig = $dst", []>; def VTBX4 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), NVTBLFrm, IIC_VTBX4, "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src", - "$orig = $dst", - [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx4 DPR:$orig, DPR:$tbl1, - DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>; + "$orig = $dst", []>; } // hasExtraSrcRegAllocReq = 1 //===----------------------------------------------------------------------===// From clattner at apple.com Tue Jul 6 19:13:56 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 6 Jul 2010 17:13:56 -0700 Subject: [llvm-commits] [llvm] r107667 - /llvm/trunk/include/llvm/Instructions.h In-Reply-To: References: <20100706154411.CC51C2A6C12C@llvm.org> Message-ID: <544A1DCD-E469-4E61-BC44-7053AE22B94A@apple.com> On Jul 6, 2010, at 2:29 PM, Gabor Greif wrote: >>> +# define public private >>> +# define protected private >>> /// Provide fast operand accessors >>> DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); >>> +# undef public >>> +# undef protected >> >> How about declaring a different macro, named DECLARE_PRIVATE_TRANSPARENT_OPERAND_ACCESSORS or something? >> > > Heh, here is my answer from IRC: > > gabor: sabre: re. gross, yes, but I wanted to minimize the patch. > Actually, my first attempt did just what > you suggest, but it touched OperandTraits.h, and that appeared too > much to me. This hack is strictly > transitional, but if we think it should be in v2.8 (and be removed > from v2.9) then I am all for rephrasing > in a less gross way :-) Alright. I don't think there is any need to keep this in for 2.8. We don't guarantee release-to-release API compatibility, I think it can be ripped out in a month or two, before 2.8 is branched. If it is just a short-term thing, I'm ok keeping it horrible :) -Chris From gohman at apple.com Tue Jul 6 19:16:23 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 6 Jul 2010 17:16:23 -0700 Subject: [llvm-commits] [llvm] r107109 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/Passes.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/interprocedural.ll In-Reply-To: <223AACF7-5C47-45C5-9432-5126BF018B71@apple.com> References: <20100629005039.39B192A6C12C@llvm.org> <4C298317.7050002@mxc.ca> <5E31E70D-BC94-4545-BE28-F8927D72097F@apple.com> <0EAA395C-1A7A-45D2-A6F9-F3B837A0F91C@apple.com> <92C98C7C-831E-4021-964E-B20289FB8BAB@apple.com> <223AACF7-5C47-45C5-9432-5126BF018B71@apple.com> Message-ID: <89EF37A2-1615-4605-967C-80819F9CD405@apple.com> On Jul 4, 2010, at 10:23 AM, Chris Lattner wrote: > On Jul 1, 2010, at 2:29 PM, Dan Gohman wrote: >>>> "noalias" is only meaningful from a single-procedure perspective. >>>> For example: >>>> >>>> @G = external global i32 >>>> define void @foo(i32* noalias %p) { >>>> ... >>>> } >>>> ... >>>> call void @foo(i32* @G) >>>> If you're working exclusively within the body of @foo, then alias(@G, %p) >>>> can be NoAlias. From an interprocedural perspective, it can be MustAlias. >>>> >>> >>> I don't buy this at all. The current interface to AA (even for interprocedural clients) is context insensitive. If you want a path or context-sensitive query interface, you'd need a substantially richer and more complex (aka slower) interface. DSA provides this sort of interface for example. >> >> You're right, I was mistaken about recursive functions; that's a class of >> cases which are a lot more complicated and do bring in context sensitivity >> concerns. I've removed these considerations in r107420. > > Thanks. I'm still confused about why we need a separate pass for IPA basicaa... It was useful as a theoretical reference point, to help define noalias and NoAlias better, at least. With the new wording in place now, it's a coherent concept. >> However, beyond classic path and context scoping, there's another sense of >> scope that an alias query can have, the scope of a noalias keyword. noalias >> on an argument indicates that argument's relationship with other pointers >> within that function, but it isn't meaningful when considering pointers >> from an interprocedural perspective. An example of this is this is the first >> example I gave above, with alias(@G, %p). > > I don't understand this. The interface provided by AliasAnalysis (which is independent of whether the implementation uses IP information or not) assumes the client is a) asking about relations between globals, or b) is in the context of a function. > > In the first example above, alias(@G, %p) is false whether the implementation is single or interprocedural. Because the client is asking about "p", the query is implicitly scoped to the body of the function. > > The AliasAnalysis *interface* has this implicit scoping. The treatment of noalias *cannot* be semantically different between two different implementations of AliasAnalysis, because the clients haven't changed. The contract of the AliasAnalysis interface is fixed. You right though, AliasAnalysis API implementations shouldn't have differing semantics. I'll probably remove interprocedural-basic-aa to resolve this, since I don't have a present practical use case for it. Dan From stoklund at 2pi.dk Tue Jul 6 19:32:25 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 07 Jul 2010 00:32:25 -0000 Subject: [llvm-commits] [llvm] r107744 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp LowerSubregs.cpp ProcessImplicitDefs.cpp RegisterCoalescer.cpp SimpleRegisterCoalescing.cpp StackSlotColoring.cpp TwoAddressInstructionPass.cpp Message-ID: <20100707003225.9CFD62A6C12C@llvm.org> Author: stoklund Date: Tue Jul 6 19:32:25 2010 New Revision: 107744 URL: http://llvm.org/viewvc/llvm-project?rev=107744&view=rev Log: Revert "Remove references to INSERT_SUBREG after de-SSA" r107725. Buildbot breakage. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/StackSlotColoring.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Jul 6 19:32:25 2010 @@ -324,6 +324,12 @@ if (mi->isCopyLike() || tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) { CopyMI = mi; + + // Some of the REG_SEQUENCE lowering in TwoAddressInstrPass creates + // implicit defs without really knowing. It shows up as INSERT_SUBREG + // using an undefined register. + if (mi->isInsertSubreg()) + mi->getOperand(1).setIsUndef(); } VNInfo *ValNo = interval.getNextValue(defIndex, CopyMI, true, Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Tue Jul 6 19:32:25 2010 @@ -54,6 +54,7 @@ private: bool LowerExtract(MachineInstr *MI); + bool LowerInsert(MachineInstr *MI); bool LowerSubregToReg(MachineInstr *MI); bool LowerCopy(MachineInstr *MI); @@ -237,6 +238,90 @@ return true; } +bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) { + MachineBasicBlock *MBB = MI->getParent(); + assert((MI->getOperand(0).isReg() && MI->getOperand(0).isDef()) && + (MI->getOperand(1).isReg() && MI->getOperand(1).isUse()) && + (MI->getOperand(2).isReg() && MI->getOperand(2).isUse()) && + MI->getOperand(3).isImm() && "Invalid insert_subreg"); + + unsigned DstReg = MI->getOperand(0).getReg(); +#ifndef NDEBUG + unsigned SrcReg = MI->getOperand(1).getReg(); +#endif + unsigned InsReg = MI->getOperand(2).getReg(); + unsigned SubIdx = MI->getOperand(3).getImm(); + + assert(DstReg == SrcReg && "insert_subreg not a two-address instruction?"); + assert(SubIdx != 0 && "Invalid index for insert_subreg"); + unsigned DstSubReg = TRI->getSubReg(DstReg, SubIdx); + assert(DstSubReg && "invalid subregister index for register"); + assert(TargetRegisterInfo::isPhysicalRegister(SrcReg) && + "Insert superreg source must be in a physical register"); + assert(TargetRegisterInfo::isPhysicalRegister(InsReg) && + "Inserted value must be in a physical register"); + + DEBUG(dbgs() << "subreg: CONVERTING: " << *MI); + + if (DstSubReg == InsReg) { + // No need to insert an identity copy instruction. If the SrcReg was + // , we need to make sure it is alive by inserting a KILL + if (MI->getOperand(1).isUndef() && !MI->getOperand(0).isDead()) { + MachineInstrBuilder MIB = BuildMI(*MBB, MI, MI->getDebugLoc(), + TII->get(TargetOpcode::KILL), DstReg); + if (MI->getOperand(2).isUndef()) + MIB.addReg(InsReg, RegState::Undef); + else + MIB.addReg(InsReg, RegState::Kill); + } else { + DEBUG(dbgs() << "subreg: eliminated!\n"); + MBB->erase(MI); + return true; + } + } else { + // Insert sub-register copy + const TargetRegisterClass *TRC0= TRI->getPhysicalRegisterRegClass(DstSubReg); + const TargetRegisterClass *TRC1= TRI->getPhysicalRegisterRegClass(InsReg); + if (MI->getOperand(2).isUndef()) + // If the source register being inserted is undef, then this becomes a + // KILL. + BuildMI(*MBB, MI, MI->getDebugLoc(), + TII->get(TargetOpcode::KILL), DstSubReg); + else { + bool Emitted = TII->copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1, + MI->getDebugLoc()); + (void)Emitted; + assert(Emitted && "Subreg and Dst must be of compatible register class"); + } + MachineBasicBlock::iterator CopyMI = MI; + --CopyMI; + + // INSERT_SUBREG is a two-address instruction so it implicitly kills SrcReg. + if (!MI->getOperand(1).isUndef()) + CopyMI->addOperand(MachineOperand::CreateReg(DstReg, false, true, true)); + + // Transfer the kill/dead flags, if needed. + if (MI->getOperand(0).isDead()) { + TransferDeadFlag(MI, DstSubReg, TRI); + } else { + // Make sure the full DstReg is live after this replacement. + CopyMI->addOperand(MachineOperand::CreateReg(DstReg, true, true)); + } + + // Make sure the inserted register gets killed + if (MI->getOperand(2).isKill() && !MI->getOperand(2).isUndef()) + TransferKillFlag(MI, InsReg, TRI); + } + + DEBUG({ + MachineBasicBlock::iterator dMI = MI; + dbgs() << "subreg: " << *(--dMI) << "\n"; + }); + + MBB->erase(MI); + return true; +} + bool LowerSubregsInstructionPass::LowerCopy(MachineInstr *MI) { MachineOperand &DstMO = MI->getOperand(0); MachineOperand &SrcMO = MI->getOperand(1); @@ -302,9 +387,10 @@ mi != me;) { MachineBasicBlock::iterator nmi = llvm::next(mi); MachineInstr *MI = mi; - assert(!MI->isInsertSubreg() && "INSERT_SUBREG should no longer appear"); if (MI->isExtractSubreg()) { MadeChange |= LowerExtract(MI); + } else if (MI->isInsertSubreg()) { + MadeChange |= LowerInsert(MI); } else if (MI->isSubregToReg()) { MadeChange |= LowerSubregToReg(MI); } else if (MI->isCopy()) { Modified: llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp (original) +++ llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp Tue Jul 6 19:32:25 2010 @@ -102,6 +102,21 @@ continue; } + if (MI->isInsertSubreg()) { + MachineOperand &MO = MI->getOperand(2); + if (ImpDefRegs.count(MO.getReg())) { + // %reg1032 = INSERT_SUBREG %reg1032, undef, 2 + // This is an identity copy, eliminate it now. + if (MO.isKill()) { + LiveVariables::VarInfo& vi = lv_->getVarInfo(MO.getReg()); + vi.removeKill(MI); + } + MI->eraseFromParent(); + Changed = true; + continue; + } + } + // Eliminate %reg1032:sub = COPY undef. if (MI->isCopy() && MI->getOperand(0).getSubReg()) { MachineOperand &MO = MI->getOperand(1); Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Tue Jul 6 19:32:25 2010 @@ -54,7 +54,7 @@ DstSub = MI->getOperand(0).getSubReg(); Src = MI->getOperand(1).getReg(); SrcSub = compose(MI->getOperand(1).getSubReg(), MI->getOperand(2).getImm()); - } else if (MI->isSubregToReg()) { + } else if (MI->isInsertSubreg() || MI->isSubregToReg()) { Dst = MI->getOperand(0).getReg(); DstSub = compose(MI->getOperand(0).getSubReg(), MI->getOperand(3).getImm()); Src = MI->getOperand(2).getReg(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jul 6 19:32:25 2010 @@ -1523,7 +1523,12 @@ if (Inst->isCopy() || Inst->isExtractSubreg()) { DstReg = Inst->getOperand(0).getReg(); SrcReg = Inst->getOperand(1).getReg(); - } else if (Inst->isSubregToReg()) { + } else if (Inst->isInsertSubreg()) { + DstReg = Inst->getOperand(0).getReg(); + SrcReg = Inst->getOperand(2).getReg(); + if (Inst->getOperand(1).isUndef()) + isInsUndef = true; + } else if (Inst->isInsertSubreg() || Inst->isSubregToReg()) { DstReg = Inst->getOperand(0).getReg(); SrcReg = Inst->getOperand(2).getReg(); } else if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original) +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Tue Jul 6 19:32:25 2010 @@ -508,7 +508,8 @@ // Abort the use is actually a sub-register def. We don't have enough // information to figure out if it is really legal. - if (MO.getSubReg() || MII->isExtractSubreg() || MII->isSubregToReg()) + if (MO.getSubReg() || MII->isExtractSubreg() || + MII->isInsertSubreg() || MII->isSubregToReg()) return false; const TargetRegisterClass *RC = TID.OpInfo[i].getRegClass(TRI); Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=107744&r1=107743&r2=107744&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Jul 6 19:32:25 2010 @@ -1359,11 +1359,25 @@ // Insert a copy or an extract to replace the original extracts. MachineBasicBlock::iterator InsertLoc = SomeMI; - MachineInstr *CopyMI = BuildMI(*SomeMI->getParent(), SomeMI, - SomeMI->getDebugLoc(), - TII->get(TargetOpcode::COPY)) - .addReg(DstReg, RegState::Define, NewDstSubIdx) - .addReg(SrcReg, 0, NewSrcSubIdx); + if (NewSrcSubIdx) { + // Insert an extract subreg. + BuildMI(*SomeMI->getParent(), InsertLoc, SomeMI->getDebugLoc(), + TII->get(TargetOpcode::EXTRACT_SUBREG), DstReg) + .addReg(SrcReg).addImm(NewSrcSubIdx); + } else if (NewDstSubIdx) { + // Do a subreg insertion. + BuildMI(*SomeMI->getParent(), InsertLoc, SomeMI->getDebugLoc(), + TII->get(TargetOpcode::INSERT_SUBREG), DstReg) + .addReg(DstReg).addReg(SrcReg).addImm(NewDstSubIdx); + } else { + // Insert a copy. + bool Emitted = + TII->copyRegToReg(*SomeMI->getParent(), InsertLoc, DstReg, SrcReg, + MRI->getRegClass(DstReg), MRI->getRegClass(SrcReg), + SomeMI->getDebugLoc()); + (void)Emitted; + } + MachineBasicBlock::iterator CopyMI = prior(InsertLoc); // Remove all the old extract instructions. for (MachineRegisterInfo::use_nodbg_iterator From clattner at apple.com Tue Jul 6 19:35:17 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 6 Jul 2010 17:35:17 -0700 Subject: [llvm-commits] [llvm] r107109 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/Passes.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/interprocedural.ll In-Reply-To: <89EF37A2-1615-4605-967C-80819F9CD405@apple.com> References: <20100629005039.39B192A6C12C@llvm.org> <4C298317.7050002@mxc.ca> <5E31E70D-BC94-4545-BE28-F8927D72097F@apple.com> <0EAA395C-1A7A-45D2-A6F9-F3B837A0F91C@apple.com> <92C98C7C-831E-4021-964E-B20289FB8BAB@apple.com> <223AACF7-5C47-45C5-9432-5126BF018B71@apple.com> <89EF37A2-1615-4605-967C-80819F9CD405@apple.com> Message-ID: <623D2723-D665-40C7-BDAE-892C4DD444E5@apple.com> On Jul 6, 2010, at 5:16 PM, Dan Gohman wrote: >>> However, beyond classic path and context scoping, there's another sense of >>> scope that an alias query can have, the scope of a noalias keyword. noalias >>> on an argument indicates that argument's relationship with other pointers >>> within that function, but it isn't meaningful when considering pointers >>> from an interprocedural perspective. An example of this is this is the first >>> example I gave above, with alias(@G, %p). >> >> I don't understand this. The interface provided by AliasAnalysis (which is independent of whether the implementation uses IP information or not) assumes the client is a) asking about relations between globals, or b) is in the context of a function. >> >> In the first example above, alias(@G, %p) is false whether the implementation is single or interprocedural. Because the client is asking about "p", the query is implicitly scoped to the body of the function. >> >> The AliasAnalysis *interface* has this implicit scoping. The treatment of noalias *cannot* be semantically different between two different implementations of AliasAnalysis, because the clients haven't changed. The contract of the AliasAnalysis interface is fixed. > > You right though, AliasAnalysis API implementations shouldn't have > differing semantics. I'll probably remove interprocedural-basic-aa > to resolve this, since I don't have a present practical use case > for it. Sounds good. It's good to raise these issues, and even better to document them well so that clients of the AA interface know what to expect. Thanks Dan, -Chris From bruno.cardoso at gmail.com Tue Jul 6 20:01:14 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 01:01:14 -0000 Subject: [llvm-commits] [llvm] r107746 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100707010114.4A0CC2A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 20:01:13 2010 New Revision: 107746 URL: http://llvm.org/viewvc/llvm-project?rev=107746&view=rev Log: Add AVX SSE4.1 extractps and pinsr instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107746&r1=107745&r2=107746&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 20:01:13 2010 @@ -4516,6 +4516,8 @@ addr:$dst)]>, OpSize; } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VEXTRACTPS : SS41I_extractf32<0x17, "vextractps">, VEX; defm EXTRACTPS : SS41I_extractf32<0x17, "extractps">; // Also match an EXTRACTPS store when the store is done as f32 instead of i32. @@ -4525,46 +4527,76 @@ (EXTRACTPSmr addr:$dst, VR128:$src1, imm:$src2)>, Requires<[HasSSE41]>; -let Constraints = "$src1 = $dst" in { - multiclass SS41I_insert8 opc, string OpcodeStr> { - def rr : SS4AIi8, OpSize; - def rm : SS4AIi8, OpSize; - } -} - -defm PINSRB : SS41I_insert8<0x20, "pinsrb">; - -let Constraints = "$src1 = $dst" in { - multiclass SS41I_insert32 opc, string OpcodeStr> { - def rr : SS4AIi8, - OpSize; - def rm : SS4AIi8, OpSize; - } +multiclass SS41I_insert8 opc, string asm, bit Is2Addr = 1> { + def rr : SS4AIi8, OpSize; + def rm : SS4AIi8, OpSize; +} + +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPINSRB : SS41I_insert8<0x20, "vpinsrb", 0>, VEX_4V; +let Constraints = "$src1 = $dst" in + defm PINSRB : SS41I_insert8<0x20, "pinsrb">; + +multiclass SS41I_insert32 opc, string asm, bit Is2Addr = 1> { + def rr : SS4AIi8, + OpSize; + def rm : SS4AIi8, OpSize; +} + +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPINSRD : SS41I_insert32<0x22, "vpinsrd", 0>, VEX_4V; +let Constraints = "$src1 = $dst" in + defm PINSRD : SS41I_insert32<0x22, "pinsrd">; + +multiclass SS41I_insert64_avx opc, string OpcodeStr> { + def rr : SS4AIi8, + OpSize, REX_W; + def rm : SS4AIi8, OpSize, REX_W; } -defm PINSRD : SS41I_insert32<0x22, "pinsrd">; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPINSRQ : SS41I_insert64_avx<0x22, "vpinsrq">, VEX_4V, VEX_W; // insertps has a few different modes, there's the first two here below which // are optimized inserts that won't zero arbitrary elements in the destination Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107746&r1=107745&r2=107746&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 20:01:13 2010 @@ -12070,3 +12070,35 @@ // CHECK: encoding: [0xc4,0xe3,0x79,0x14,0x10,0x07] vpextrb $7, %xmm2, (%eax) +// CHECK: vextractps $7, %xmm2, (%eax) +// CHECK: encoding: [0xc4,0xe3,0x79,0x17,0x10,0x07] + vextractps $7, %xmm2, (%eax) + +// CHECK: vextractps $7, %xmm2, %eax +// CHECK: encoding: [0xc4,0xe3,0x79,0x17,0xd0,0x07] + vextractps $7, %xmm2, %eax + +// CHECK: vpinsrw $7, %eax, %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xe9,0xc4,0xe8,0x07] + vpinsrw $7, %eax, %xmm2, %xmm5 + +// CHECK: vpinsrw $7, (%eax), %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xe9,0xc4,0x28,0x07] + vpinsrw $7, (%eax), %xmm2, %xmm5 + +// CHECK: vpinsrb $7, %eax, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x69,0x20,0xe8,0x07] + vpinsrb $7, %eax, %xmm2, %xmm5 + +// CHECK: vpinsrb $7, (%eax), %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x69,0x20,0x28,0x07] + vpinsrb $7, (%eax), %xmm2, %xmm5 + +// CHECK: vpinsrd $7, %eax, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x69,0x22,0xe8,0x07] + vpinsrd $7, %eax, %xmm2, %xmm5 + +// CHECK: vpinsrd $7, (%eax), %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x69,0x22,0x28,0x07] + vpinsrd $7, (%eax), %xmm2, %xmm5 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107746&r1=107745&r2=107746&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 20:01:13 2010 @@ -2126,3 +2126,43 @@ // CHECK: encoding: [0xc4,0x63,0xf9,0x16,0x21,0x07] vpextrq $7, %xmm12, (%rcx) +// CHECK: vextractps $7, %xmm12, (%rax) +// CHECK: encoding: [0xc4,0x63,0x79,0x17,0x20,0x07] + vextractps $7, %xmm12, (%rax) + +// CHECK: vextractps $7, %xmm12, %eax +// CHECK: encoding: [0xc4,0x63,0x79,0x17,0xe0,0x07] + vextractps $7, %xmm12, %eax + +// CHECK: vpinsrw $7, %eax, %xmm12, %xmm10 +// CHECK: encoding: [0xc5,0x19,0xc4,0xd0,0x07] + vpinsrw $7, %eax, %xmm12, %xmm10 + +// CHECK: vpinsrw $7, (%rax), %xmm12, %xmm10 +// CHECK: encoding: [0xc5,0x19,0xc4,0x10,0x07] + vpinsrw $7, (%rax), %xmm12, %xmm10 + +// CHECK: vpinsrb $7, %eax, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x63,0x19,0x20,0xd0,0x07] + vpinsrb $7, %eax, %xmm12, %xmm10 + +// CHECK: vpinsrb $7, (%rax), %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x63,0x19,0x20,0x10,0x07] + vpinsrb $7, (%rax), %xmm12, %xmm10 + +// CHECK: vpinsrd $7, %eax, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x63,0x19,0x22,0xd0,0x07] + vpinsrd $7, %eax, %xmm12, %xmm10 + +// CHECK: vpinsrd $7, (%rax), %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x63,0x19,0x22,0x10,0x07] + vpinsrd $7, (%rax), %xmm12, %xmm10 + +// CHECK: vpinsrq $7, %rax, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x63,0x99,0x22,0xd0,0x07] + vpinsrq $7, %rax, %xmm12, %xmm10 + +// CHECK: vpinsrq $7, (%rax), %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x63,0x99,0x22,0x10,0x07] + vpinsrq $7, (%rax), %xmm12, %xmm10 + From bruno.cardoso at gmail.com Tue Jul 6 20:14:57 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 01:14:57 -0000 Subject: [llvm-commits] [llvm] r107747 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100707011457.391A52A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 20:14:56 2010 New Revision: 107747 URL: http://llvm.org/viewvc/llvm-project?rev=107747&view=rev Log: Add AVX SSE4.1 insertps, ptest and movntdqa instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107747&r1=107746&r2=107747&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 20:14:56 2010 @@ -4602,33 +4602,49 @@ // are optimized inserts that won't zero arbitrary elements in the destination // vector. The next one matches the intrinsic and could zero arbitrary elements // in the target vector. -let Constraints = "$src1 = $dst" in { - multiclass SS41I_insertf32 opc, string OpcodeStr> { - def rr : SS4AIi8, +multiclass SS41I_insertf32 opc, string asm, bit Is2Addr = 1> { + def rr : SS4AIi8, OpSize; - def rm : SS4AIi8, OpSize; - } -} - -defm INSERTPS : SS41I_insertf32<0x21, "insertps">; + def rm : SS4AIi8, OpSize; +} + +let Constraints = "$src1 = $dst" in + defm INSERTPS : SS41I_insertf32<0x21, "insertps">; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VINSERTPS : SS41I_insertf32<0x21, "vinsertps", 0>, VEX_4V; def : Pat<(int_x86_sse41_insertps VR128:$src1, VR128:$src2, imm:$src3), (INSERTPSrr VR128:$src1, VR128:$src2, imm:$src3)>; // ptest instruction we'll lower to this in X86ISelLowering primarily from // the intel intrinsic that corresponds to this. +let Defs = [EFLAGS], isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { +def VPTESTrr : SS48I<0x17, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), + "vptest\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86ptest VR128:$src1, VR128:$src2))]>, + OpSize, VEX; +def VPTESTrm : SS48I<0x17, MRMSrcMem, (outs), (ins VR128:$src1, i128mem:$src2), + "vptest\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86ptest VR128:$src1, (load addr:$src2)))]>, + OpSize, VEX; +} + let Defs = [EFLAGS] in { def PTESTrr : SS48I<0x17, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), "ptest \t{$src2, $src1|$src1, $src2}", @@ -4640,6 +4656,11 @@ OpSize; } +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in +def VMOVNTDQArm : SS48I<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src), + "vmovntdqa\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse41_movntdqa addr:$src))]>, + OpSize, VEX; def MOVNTDQArm : SS48I<0x2A, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src), "movntdqa\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse41_movntdqa addr:$src))]>, Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107747&r1=107746&r2=107747&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 20:14:56 2010 @@ -12102,3 +12102,23 @@ // CHECK: encoding: [0xc4,0xe3,0x69,0x22,0x28,0x07] vpinsrd $7, (%eax), %xmm2, %xmm5 +// CHECK: vinsertps $7, %xmm2, %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe3,0x51,0x21,0xca,0x07] + vinsertps $7, %xmm2, %xmm5, %xmm1 + +// CHECK: vinsertps $7, (%eax), %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe3,0x51,0x21,0x08,0x07] + vinsertps $7, (%eax), %xmm5, %xmm1 + +// CHECK: vptest %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0x17,0xea] + vptest %xmm2, %xmm5 + +// CHECK: vptest (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x17,0x10] + vptest (%eax), %xmm2 + +// CHECK: vmovntdqa (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0x2a,0x10] + vmovntdqa (%eax), %xmm2 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107747&r1=107746&r2=107747&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 20:14:56 2010 @@ -2166,3 +2166,23 @@ // CHECK: encoding: [0xc4,0x63,0x99,0x22,0x10,0x07] vpinsrq $7, (%rax), %xmm12, %xmm10 +// CHECK: vinsertps $7, %xmm12, %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x43,0x29,0x21,0xdc,0x07] + vinsertps $7, %xmm12, %xmm10, %xmm11 + +// CHECK: vinsertps $7, (%rax), %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x63,0x29,0x21,0x18,0x07] + vinsertps $7, (%rax), %xmm10, %xmm11 + +// CHECK: vptest %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0x17,0xd4] + vptest %xmm12, %xmm10 + +// CHECK: vptest (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x17,0x20] + vptest (%rax), %xmm12 + +// CHECK: vmovntdqa (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0x2a,0x20] + vmovntdqa (%rax), %xmm12 + From bruno.cardoso at gmail.com Tue Jul 6 20:33:38 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 01:33:38 -0000 Subject: [llvm-commits] [llvm] r107749 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrSSE.td Message-ID: <20100707013338.7B7ED2A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 20:33:38 2010 New Revision: 107749 URL: http://llvm.org/viewvc/llvm-project?rev=107749&view=rev Log: Now that almost all SSE4.1 AVX instructions are added, move code around to more appropriate sections. No functionality changes Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=107749&r1=107748&r2=107749&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Jul 6 20:33:38 2010 @@ -2353,24 +2353,6 @@ // X86-64 SSE4.1 Instructions //===----------------------------------------------------------------------===// -/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination -multiclass SS41I_extract64 opc, string OpcodeStr> { - def rr : SS4AIi8, OpSize, REX_W; - def mr : SS4AIi8, OpSize, REX_W; -} - -defm PEXTRQ : SS41I_extract64<0x16, "pextrq">; - let Constraints = "$src1 = $dst" in { multiclass SS41I_insert64 opc, string OpcodeStr> { def rr : SS4AIi8; //===----------------------------------------------------------------------===// -// SSE4.1 - Misc Instructions +// SSE4.1 - Packed Move with Sign/Zero Extend //===----------------------------------------------------------------------===// -multiclass sse41_fp_unop_rm opcps, bits<8> opcpd, - string OpcodeStr, - Intrinsic V4F32Int, - Intrinsic V2F64Int> { - // Intrinsic operation, reg. - // Vector intrinsic operation, reg - def PSr_Int : SS4AIi8, - OpSize; - - // Vector intrinsic operation, mem - def PSm_Int : Ii8, - TA, OpSize, - Requires<[HasSSE41]>; +multiclass SS41I_binop_rm_int8 opc, string OpcodeStr, Intrinsic IntId> { + def rr : SS48I, OpSize; - // Vector intrinsic operation, reg - def PDr_Int : SS4AIi8, - OpSize; + def rm : SS48I, + OpSize; +} - // Vector intrinsic operation, mem - def PDm_Int : SS4AIi8, - OpSize; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { +defm VPMOVSXBW : SS41I_binop_rm_int8<0x20, "vpmovsxbw", int_x86_sse41_pmovsxbw>, + VEX; +defm VPMOVSXWD : SS41I_binop_rm_int8<0x23, "vpmovsxwd", int_x86_sse41_pmovsxwd>, + VEX; +defm VPMOVSXDQ : SS41I_binop_rm_int8<0x25, "vpmovsxdq", int_x86_sse41_pmovsxdq>, + VEX; +defm VPMOVZXBW : SS41I_binop_rm_int8<0x30, "vpmovzxbw", int_x86_sse41_pmovzxbw>, + VEX; +defm VPMOVZXWD : SS41I_binop_rm_int8<0x33, "vpmovzxwd", int_x86_sse41_pmovzxwd>, + VEX; +defm VPMOVZXDQ : SS41I_binop_rm_int8<0x35, "vpmovzxdq", int_x86_sse41_pmovzxdq>, + VEX; } -multiclass sse41_fp_unop_rm_avx opcps, bits<8> opcpd, - string OpcodeStr> { - // Intrinsic operation, reg. - // Vector intrinsic operation, reg - def PSr : SS4AIi8, OpSize; +defm PMOVSXBW : SS41I_binop_rm_int8<0x20, "pmovsxbw", int_x86_sse41_pmovsxbw>; +defm PMOVSXWD : SS41I_binop_rm_int8<0x23, "pmovsxwd", int_x86_sse41_pmovsxwd>; +defm PMOVSXDQ : SS41I_binop_rm_int8<0x25, "pmovsxdq", int_x86_sse41_pmovsxdq>; +defm PMOVZXBW : SS41I_binop_rm_int8<0x30, "pmovzxbw", int_x86_sse41_pmovzxbw>; +defm PMOVZXWD : SS41I_binop_rm_int8<0x33, "pmovzxwd", int_x86_sse41_pmovzxwd>; +defm PMOVZXDQ : SS41I_binop_rm_int8<0x35, "pmovzxdq", int_x86_sse41_pmovzxdq>; - // Vector intrinsic operation, mem - def PSm : Ii8, TA, OpSize, Requires<[HasSSE41]>; +// Common patterns involving scalar load. +def : Pat<(int_x86_sse41_pmovsxbw (vzmovl_v2i64 addr:$src)), + (PMOVSXBWrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovsxbw (vzload_v2i64 addr:$src)), + (PMOVSXBWrm addr:$src)>, Requires<[HasSSE41]>; - // Vector intrinsic operation, reg - def PDr : SS4AIi8, OpSize; +def : Pat<(int_x86_sse41_pmovsxwd (vzmovl_v2i64 addr:$src)), + (PMOVSXWDrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovsxwd (vzload_v2i64 addr:$src)), + (PMOVSXWDrm addr:$src)>, Requires<[HasSSE41]>; - // Vector intrinsic operation, mem - def PDm : SS4AIi8, OpSize; -} +def : Pat<(int_x86_sse41_pmovsxdq (vzmovl_v2i64 addr:$src)), + (PMOVSXDQrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovsxdq (vzload_v2i64 addr:$src)), + (PMOVSXDQrm addr:$src)>, Requires<[HasSSE41]>; -multiclass sse41_fp_binop_rm opcss, bits<8> opcsd, - string OpcodeStr, - Intrinsic F32Int, - Intrinsic F64Int, bit Is2Addr = 1> { - // Intrinsic operation, reg. - def SSr_Int : SS4AIi8, - OpSize; +def : Pat<(int_x86_sse41_pmovzxbw (vzmovl_v2i64 addr:$src)), + (PMOVZXBWrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovzxbw (vzload_v2i64 addr:$src)), + (PMOVZXBWrm addr:$src)>, Requires<[HasSSE41]>; - // Intrinsic operation, mem. - def SSm_Int : SS4AIi8, - OpSize; +def : Pat<(int_x86_sse41_pmovzxwd (vzmovl_v2i64 addr:$src)), + (PMOVZXWDrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovzxwd (vzload_v2i64 addr:$src)), + (PMOVZXWDrm addr:$src)>, Requires<[HasSSE41]>; - // Intrinsic operation, reg. - def SDr_Int : SS4AIi8, - OpSize; +def : Pat<(int_x86_sse41_pmovzxdq (vzmovl_v2i64 addr:$src)), + (PMOVZXDQrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovzxdq (vzload_v2i64 addr:$src)), + (PMOVZXDQrm addr:$src)>, Requires<[HasSSE41]>; - // Intrinsic operation, mem. - def SDm_Int : SS4AIi8, - OpSize; + +multiclass SS41I_binop_rm_int4 opc, string OpcodeStr, Intrinsic IntId> { + def rr : SS48I, OpSize; + + def rm : SS48I, + OpSize; } -multiclass sse41_fp_binop_rm_avx opcss, bits<8> opcsd, - string OpcodeStr> { - // Intrinsic operation, reg. - def SSr : SS4AIi8, OpSize; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { +defm VPMOVSXBD : SS41I_binop_rm_int4<0x21, "vpmovsxbd", int_x86_sse41_pmovsxbd>, + VEX; +defm VPMOVSXWQ : SS41I_binop_rm_int4<0x24, "vpmovsxwq", int_x86_sse41_pmovsxwq>, + VEX; +defm VPMOVZXBD : SS41I_binop_rm_int4<0x31, "vpmovzxbd", int_x86_sse41_pmovzxbd>, + VEX; +defm VPMOVZXWQ : SS41I_binop_rm_int4<0x34, "vpmovzxwq", int_x86_sse41_pmovzxwq>, + VEX; +} - // Intrinsic operation, mem. - def SSm : SS4AIi8, OpSize; +defm PMOVSXBD : SS41I_binop_rm_int4<0x21, "pmovsxbd", int_x86_sse41_pmovsxbd>; +defm PMOVSXWQ : SS41I_binop_rm_int4<0x24, "pmovsxwq", int_x86_sse41_pmovsxwq>; +defm PMOVZXBD : SS41I_binop_rm_int4<0x31, "pmovzxbd", int_x86_sse41_pmovzxbd>; +defm PMOVZXWQ : SS41I_binop_rm_int4<0x34, "pmovzxwq", int_x86_sse41_pmovzxwq>; - // Intrinsic operation, reg. - def SDr : SS4AIi8, OpSize; +// Common patterns involving scalar load +def : Pat<(int_x86_sse41_pmovsxbd (vzmovl_v4i32 addr:$src)), + (PMOVSXBDrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovsxwq (vzmovl_v4i32 addr:$src)), + (PMOVSXWQrm addr:$src)>, Requires<[HasSSE41]>; - // Intrinsic operation, mem. - def SDm : SS4AIi8, OpSize; +def : Pat<(int_x86_sse41_pmovzxbd (vzmovl_v4i32 addr:$src)), + (PMOVZXBDrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_pmovzxwq (vzmovl_v4i32 addr:$src)), + (PMOVZXWQrm addr:$src)>, Requires<[HasSSE41]>; + + +multiclass SS41I_binop_rm_int2 opc, string OpcodeStr, Intrinsic IntId> { + def rr : SS48I, OpSize; + + // Expecting a i16 load any extended to i32 value. + def rm : SS48I, + OpSize; } -// FP round - roundss, roundps, roundsd, roundpd let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { - // Intrinsic form - defm VROUND : sse41_fp_unop_rm<0x08, 0x09, "vround", - int_x86_sse41_round_ps, int_x86_sse41_round_pd>, - VEX; - defm VROUND : sse41_fp_binop_rm<0x0A, 0x0B, "vround", - int_x86_sse41_round_ss, int_x86_sse41_round_sd, - 0>, VEX_4V; - // Instructions for the assembler - defm VROUND : sse41_fp_unop_rm_avx<0x08, 0x09, "vround">, VEX; - defm VROUND : sse41_fp_binop_rm_avx<0x0A, 0x0B, "vround">, VEX_4V; +defm VPMOVSXBQ : SS41I_binop_rm_int2<0x22, "vpmovsxbq", int_x86_sse41_pmovsxbq>, + VEX; +defm VPMOVZXBQ : SS41I_binop_rm_int2<0x32, "vpmovzxbq", int_x86_sse41_pmovzxbq>, + VEX; } +defm PMOVSXBQ : SS41I_binop_rm_int2<0x22, "pmovsxbq", int_x86_sse41_pmovsxbq>; +defm PMOVZXBQ : SS41I_binop_rm_int2<0x32, "pmovzxbq", int_x86_sse41_pmovzxbq>; -defm ROUND : sse41_fp_unop_rm<0x08, 0x09, "round", - int_x86_sse41_round_ps, int_x86_sse41_round_pd>; -let Constraints = "$src1 = $dst" in -defm ROUND : sse41_fp_binop_rm<0x0A, 0x0B, "round", - int_x86_sse41_round_ss, int_x86_sse41_round_sd>; +// Common patterns involving scalar load +def : Pat<(int_x86_sse41_pmovsxbq + (bitconvert (v4i32 (X86vzmovl + (v4i32 (scalar_to_vector (loadi32 addr:$src))))))), + (PMOVSXBQrm addr:$src)>, Requires<[HasSSE41]>; -// SS41I_unop_rm_int_v16 - SSE 4.1 unary operator whose type is v8i16. -multiclass SS41I_unop_rm_int_v16 opc, string OpcodeStr, - Intrinsic IntId128> { - def rr128 : SS48I, OpSize; - def rm128 : SS48I, OpSize; -} +def : Pat<(int_x86_sse41_pmovzxbq + (bitconvert (v4i32 (X86vzmovl + (v4i32 (scalar_to_vector (loadi32 addr:$src))))))), + (PMOVZXBQrm addr:$src)>, Requires<[HasSSE41]>; -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in -defm VPHMINPOSUW : SS41I_unop_rm_int_v16 <0x41, "vphminposuw", - int_x86_sse41_phminposuw>, VEX; -defm PHMINPOSUW : SS41I_unop_rm_int_v16 <0x41, "phminposuw", - int_x86_sse41_phminposuw>; +//===----------------------------------------------------------------------===// +// SSE4.1 - Extract Instructions +//===----------------------------------------------------------------------===// -/// SS41I_binop_rm_int - Simple SSE 4.1 binary operator -multiclass SS41I_binop_rm_int opc, string OpcodeStr, - Intrinsic IntId128, bit Is2Addr = 1> { - let isCommutable = 1 in - def rr : SS48I, OpSize; - def rm : SS48I, OpSize; +/// SS41I_binop_ext8 - SSE 4.1 extract 8 bits to 32 bit reg or 8 bit mem +multiclass SS41I_extract8 opc, string OpcodeStr> { + def rr : SS4AIi8, + OpSize; + def mr : SS4AIi8, OpSize; +// FIXME: +// There's an AssertZext in the way of writing the store pattern +// (store (i8 (trunc (X86pextrb (v16i8 VR128:$src1), imm:$src2))), addr:$dst) } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { - let isCommutable = 0 in - defm VPACKUSDW : SS41I_binop_rm_int<0x2B, "vpackusdw", int_x86_sse41_packusdw, - 0>, VEX_4V; - defm VPCMPEQQ : SS41I_binop_rm_int<0x29, "vpcmpeqq", int_x86_sse41_pcmpeqq, - 0>, VEX_4V; - defm VPMINSB : SS41I_binop_rm_int<0x38, "vpminsb", int_x86_sse41_pminsb, - 0>, VEX_4V; - defm VPMINSD : SS41I_binop_rm_int<0x39, "vpminsd", int_x86_sse41_pminsd, - 0>, VEX_4V; - defm VPMINUD : SS41I_binop_rm_int<0x3B, "vpminud", int_x86_sse41_pminud, - 0>, VEX_4V; - defm VPMINUW : SS41I_binop_rm_int<0x3A, "vpminuw", int_x86_sse41_pminuw, - 0>, VEX_4V; - defm VPMAXSB : SS41I_binop_rm_int<0x3C, "vpmaxsb", int_x86_sse41_pmaxsb, - 0>, VEX_4V; - defm VPMAXSD : SS41I_binop_rm_int<0x3D, "vpmaxsd", int_x86_sse41_pmaxsd, - 0>, VEX_4V; - defm VPMAXUD : SS41I_binop_rm_int<0x3F, "vpmaxud", int_x86_sse41_pmaxud, - 0>, VEX_4V; - defm VPMAXUW : SS41I_binop_rm_int<0x3E, "vpmaxuw", int_x86_sse41_pmaxuw, - 0>, VEX_4V; - defm VPMULDQ : SS41I_binop_rm_int<0x28, "vpmuldq", int_x86_sse41_pmuldq, - 0>, VEX_4V; -} +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRB : SS41I_extract8<0x14, "vpextrb">, VEX; -let Constraints = "$src1 = $dst" in { - let isCommutable = 0 in - defm PACKUSDW : SS41I_binop_rm_int<0x2B, "packusdw", int_x86_sse41_packusdw>; - defm PCMPEQQ : SS41I_binop_rm_int<0x29, "pcmpeqq", int_x86_sse41_pcmpeqq>; - defm PMINSB : SS41I_binop_rm_int<0x38, "pminsb", int_x86_sse41_pminsb>; - defm PMINSD : SS41I_binop_rm_int<0x39, "pminsd", int_x86_sse41_pminsd>; - defm PMINUD : SS41I_binop_rm_int<0x3B, "pminud", int_x86_sse41_pminud>; - defm PMINUW : SS41I_binop_rm_int<0x3A, "pminuw", int_x86_sse41_pminuw>; - defm PMAXSB : SS41I_binop_rm_int<0x3C, "pmaxsb", int_x86_sse41_pmaxsb>; - defm PMAXSD : SS41I_binop_rm_int<0x3D, "pmaxsd", int_x86_sse41_pmaxsd>; - defm PMAXUD : SS41I_binop_rm_int<0x3F, "pmaxud", int_x86_sse41_pmaxud>; - defm PMAXUW : SS41I_binop_rm_int<0x3E, "pmaxuw", int_x86_sse41_pmaxuw>; - defm PMULDQ : SS41I_binop_rm_int<0x28, "pmuldq", int_x86_sse41_pmuldq>; -} +defm PEXTRB : SS41I_extract8<0x14, "pextrb">; -def : Pat<(v2i64 (X86pcmpeqq VR128:$src1, VR128:$src2)), - (PCMPEQQrr VR128:$src1, VR128:$src2)>; -def : Pat<(v2i64 (X86pcmpeqq VR128:$src1, (memop addr:$src2))), - (PCMPEQQrm VR128:$src1, addr:$src2)>; -/// SS48I_binop_rm - Simple SSE41 binary operator. -multiclass SS48I_binop_rm opc, string OpcodeStr, SDNode OpNode, - ValueType OpVT, bit Is2Addr = 1> { - let isCommutable = 1 in - def rr : SS48I, - OpSize; - def rm : SS48I, - OpSize; +/// SS41I_extract16 - SSE 4.1 extract 16 bits to memory destination +multiclass SS41I_extract16 opc, string OpcodeStr> { + def mr : SS4AIi8, OpSize; +// FIXME: +// There's an AssertZext in the way of writing the store pattern +// (store (i16 (trunc (X86pextrw (v16i8 VR128:$src1), imm:$src2))), addr:$dst) } let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPMULLD : SS48I_binop_rm<0x40, "vpmulld", mul, v4i32, 0>, VEX_4V; -let Constraints = "$src1 = $dst" in - defm PMULLD : SS48I_binop_rm<0x40, "pmulld", mul, v4i32>; + defm VPEXTRW : SS41I_extract16<0x15, "vpextrw">, VEX; -/// SS41I_binop_rmi_int - SSE 4.1 binary operator with 8-bit immediate -multiclass SS41I_binop_rmi_int opc, string OpcodeStr, - Intrinsic IntId128, bit Is2Addr = 1> { - let isCommutable = 1 in - def rri : SS4AIi8, - OpSize; - def rmi : SS4AIi8, - OpSize; -} +defm PEXTRW : SS41I_extract16<0x15, "pextrw">; -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { - let isCommutable = 0 in { - defm VBLENDPS : SS41I_binop_rmi_int<0x0C, "vblendps", int_x86_sse41_blendps, - 0>, VEX_4V; - defm VBLENDPD : SS41I_binop_rmi_int<0x0D, "vblendpd", int_x86_sse41_blendpd, - 0>, VEX_4V; - defm VPBLENDW : SS41I_binop_rmi_int<0x0E, "vpblendw", int_x86_sse41_pblendw, - 0>, VEX_4V; - defm VMPSADBW : SS41I_binop_rmi_int<0x42, "vmpsadbw", int_x86_sse41_mpsadbw, - 0>, VEX_4V; - } - defm VDPPS : SS41I_binop_rmi_int<0x40, "vdpps", int_x86_sse41_dpps, - 0>, VEX_4V; - defm VDPPD : SS41I_binop_rmi_int<0x41, "vdppd", int_x86_sse41_dppd, - 0>, VEX_4V; -} -let Constraints = "$src1 = $dst" in { - let isCommutable = 0 in { - defm BLENDPS : SS41I_binop_rmi_int<0x0C, "blendps", int_x86_sse41_blendps>; - defm BLENDPD : SS41I_binop_rmi_int<0x0D, "blendpd", int_x86_sse41_blendpd>; - defm PBLENDW : SS41I_binop_rmi_int<0x0E, "pblendw", int_x86_sse41_pblendw>; - defm MPSADBW : SS41I_binop_rmi_int<0x42, "mpsadbw", int_x86_sse41_mpsadbw>; - } - defm DPPS : SS41I_binop_rmi_int<0x40, "dpps", int_x86_sse41_dpps>; - defm DPPD : SS41I_binop_rmi_int<0x41, "dppd", int_x86_sse41_dppd>; +/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination +multiclass SS41I_extract32 opc, string OpcodeStr> { + def rr : SS4AIi8, OpSize; + def mr : SS4AIi8, OpSize; } -/// SS41I_quaternary_int_avx - AVX SSE 4.1 with 4 operators -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { - multiclass SS41I_quaternary_int_avx opc, string OpcodeStr> { - def rr : I, OpSize, TA, VEX_4V, VEX_I8IMM; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRD : SS41I_extract32<0x16, "vpextrd">, VEX; - def rm : I, OpSize, TA, VEX_4V, VEX_I8IMM; - } +defm PEXTRD : SS41I_extract32<0x16, "pextrd">; + +/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination +multiclass SS41I_extract64 opc, string OpcodeStr> { + def rr : SS4AIi8, OpSize, REX_W; + def mr : SS4AIi8, OpSize, REX_W; } -defm VBLENDVPD : SS41I_quaternary_int_avx<0x4B, "vblendvpd">; -defm VBLENDVPS : SS41I_quaternary_int_avx<0x4A, "vblendvps">; -defm VPBLENDVB : SS41I_quaternary_int_avx<0x4C, "vpblendvb">; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPEXTRQ : SS41I_extract64<0x16, "vpextrq">, VEX, VEX_W; -/// SS41I_ternary_int - SSE 4.1 ternary operator -let Uses = [XMM0], Constraints = "$src1 = $dst" in { - multiclass SS41I_ternary_int opc, string OpcodeStr, Intrinsic IntId> { - def rr0 : SS48I, - OpSize; +defm PEXTRQ : SS41I_extract64<0x16, "pextrq">; - def rm0 : SS48I, OpSize; - } +/// SS41I_extractf32 - SSE 4.1 extract 32 bits fp value to int reg or memory +/// destination +multiclass SS41I_extractf32 opc, string OpcodeStr> { + def rr : SS4AIi8, + OpSize; + def mr : SS4AIi8, OpSize; } -defm BLENDVPD : SS41I_ternary_int<0x15, "blendvpd", int_x86_sse41_blendvpd>; -defm BLENDVPS : SS41I_ternary_int<0x14, "blendvps", int_x86_sse41_blendvps>; -defm PBLENDVB : SS41I_ternary_int<0x10, "pblendvb", int_x86_sse41_pblendvb>; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VEXTRACTPS : SS41I_extractf32<0x17, "vextractps">, VEX; +defm EXTRACTPS : SS41I_extractf32<0x17, "extractps">; +// Also match an EXTRACTPS store when the store is done as f32 instead of i32. +def : Pat<(store (f32 (bitconvert (extractelt (bc_v4i32 (v4f32 VR128:$src1)), + imm:$src2))), + addr:$dst), + (EXTRACTPSmr addr:$dst, VR128:$src1, imm:$src2)>, + Requires<[HasSSE41]>; -multiclass SS41I_binop_rm_int8 opc, string OpcodeStr, Intrinsic IntId> { - def rr : SS48I, OpSize; +//===----------------------------------------------------------------------===// +// SSE4.1 - Insert Instructions +//===----------------------------------------------------------------------===// - def rm : SS48I, - OpSize; +multiclass SS41I_insert8 opc, string asm, bit Is2Addr = 1> { + def rr : SS4AIi8, OpSize; + def rm : SS4AIi8, OpSize; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { -defm VPMOVSXBW : SS41I_binop_rm_int8<0x20, "vpmovsxbw", int_x86_sse41_pmovsxbw>, - VEX; -defm VPMOVSXWD : SS41I_binop_rm_int8<0x23, "vpmovsxwd", int_x86_sse41_pmovsxwd>, - VEX; -defm VPMOVSXDQ : SS41I_binop_rm_int8<0x25, "vpmovsxdq", int_x86_sse41_pmovsxdq>, - VEX; -defm VPMOVZXBW : SS41I_binop_rm_int8<0x30, "vpmovzxbw", int_x86_sse41_pmovzxbw>, - VEX; -defm VPMOVZXWD : SS41I_binop_rm_int8<0x33, "vpmovzxwd", int_x86_sse41_pmovzxwd>, - VEX; -defm VPMOVZXDQ : SS41I_binop_rm_int8<0x35, "vpmovzxdq", int_x86_sse41_pmovzxdq>, - VEX; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPINSRB : SS41I_insert8<0x20, "vpinsrb", 0>, VEX_4V; +let Constraints = "$src1 = $dst" in + defm PINSRB : SS41I_insert8<0x20, "pinsrb">; + +multiclass SS41I_insert32 opc, string asm, bit Is2Addr = 1> { + def rr : SS4AIi8, + OpSize; + def rm : SS4AIi8, OpSize; } -defm PMOVSXBW : SS41I_binop_rm_int8<0x20, "pmovsxbw", int_x86_sse41_pmovsxbw>; -defm PMOVSXWD : SS41I_binop_rm_int8<0x23, "pmovsxwd", int_x86_sse41_pmovsxwd>; -defm PMOVSXDQ : SS41I_binop_rm_int8<0x25, "pmovsxdq", int_x86_sse41_pmovsxdq>; -defm PMOVZXBW : SS41I_binop_rm_int8<0x30, "pmovzxbw", int_x86_sse41_pmovzxbw>; -defm PMOVZXWD : SS41I_binop_rm_int8<0x33, "pmovzxwd", int_x86_sse41_pmovzxwd>; -defm PMOVZXDQ : SS41I_binop_rm_int8<0x35, "pmovzxdq", int_x86_sse41_pmovzxdq>; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPINSRD : SS41I_insert32<0x22, "vpinsrd", 0>, VEX_4V; +let Constraints = "$src1 = $dst" in + defm PINSRD : SS41I_insert32<0x22, "pinsrd">; -// Common patterns involving scalar load. -def : Pat<(int_x86_sse41_pmovsxbw (vzmovl_v2i64 addr:$src)), - (PMOVSXBWrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovsxbw (vzload_v2i64 addr:$src)), - (PMOVSXBWrm addr:$src)>, Requires<[HasSSE41]>; +multiclass SS41I_insert64_avx opc, string OpcodeStr> { + def rr : SS4AIi8, + OpSize, REX_W; + def rm : SS4AIi8, OpSize, REX_W; +} -def : Pat<(int_x86_sse41_pmovsxwd (vzmovl_v2i64 addr:$src)), - (PMOVSXWDrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovsxwd (vzload_v2i64 addr:$src)), - (PMOVSXWDrm addr:$src)>, Requires<[HasSSE41]>; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VPINSRQ : SS41I_insert64_avx<0x22, "vpinsrq">, VEX_4V, VEX_W; -def : Pat<(int_x86_sse41_pmovsxdq (vzmovl_v2i64 addr:$src)), - (PMOVSXDQrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovsxdq (vzload_v2i64 addr:$src)), - (PMOVSXDQrm addr:$src)>, Requires<[HasSSE41]>; +// insertps has a few different modes, there's the first two here below which +// are optimized inserts that won't zero arbitrary elements in the destination +// vector. The next one matches the intrinsic and could zero arbitrary elements +// in the target vector. +multiclass SS41I_insertf32 opc, string asm, bit Is2Addr = 1> { + def rr : SS4AIi8, + OpSize; + def rm : SS4AIi8, OpSize; +} -def : Pat<(int_x86_sse41_pmovzxbw (vzmovl_v2i64 addr:$src)), - (PMOVZXBWrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovzxbw (vzload_v2i64 addr:$src)), - (PMOVZXBWrm addr:$src)>, Requires<[HasSSE41]>; +let Constraints = "$src1 = $dst" in + defm INSERTPS : SS41I_insertf32<0x21, "insertps">; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in + defm VINSERTPS : SS41I_insertf32<0x21, "vinsertps", 0>, VEX_4V; -def : Pat<(int_x86_sse41_pmovzxwd (vzmovl_v2i64 addr:$src)), - (PMOVZXWDrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovzxwd (vzload_v2i64 addr:$src)), - (PMOVZXWDrm addr:$src)>, Requires<[HasSSE41]>; +def : Pat<(int_x86_sse41_insertps VR128:$src1, VR128:$src2, imm:$src3), + (INSERTPSrr VR128:$src1, VR128:$src2, imm:$src3)>; -def : Pat<(int_x86_sse41_pmovzxdq (vzmovl_v2i64 addr:$src)), - (PMOVZXDQrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovzxdq (vzload_v2i64 addr:$src)), - (PMOVZXDQrm addr:$src)>, Requires<[HasSSE41]>; +//===----------------------------------------------------------------------===// +// SSE4.1 - Round Instructions +//===----------------------------------------------------------------------===// + +multiclass sse41_fp_unop_rm opcps, bits<8> opcpd, + string OpcodeStr, + Intrinsic V4F32Int, + Intrinsic V2F64Int> { + // Intrinsic operation, reg. + // Vector intrinsic operation, reg + def PSr_Int : SS4AIi8, + OpSize; + // Vector intrinsic operation, mem + def PSm_Int : Ii8, + TA, OpSize, + Requires<[HasSSE41]>; -multiclass SS41I_binop_rm_int4 opc, string OpcodeStr, Intrinsic IntId> { - def rr : SS48I, OpSize; + // Vector intrinsic operation, reg + def PDr_Int : SS4AIi8, + OpSize; - def rm : SS48I, - OpSize; + // Vector intrinsic operation, mem + def PDm_Int : SS4AIi8, + OpSize; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { -defm VPMOVSXBD : SS41I_binop_rm_int4<0x21, "vpmovsxbd", int_x86_sse41_pmovsxbd>, - VEX; -defm VPMOVSXWQ : SS41I_binop_rm_int4<0x24, "vpmovsxwq", int_x86_sse41_pmovsxwq>, - VEX; -defm VPMOVZXBD : SS41I_binop_rm_int4<0x31, "vpmovzxbd", int_x86_sse41_pmovzxbd>, - VEX; -defm VPMOVZXWQ : SS41I_binop_rm_int4<0x34, "vpmovzxwq", int_x86_sse41_pmovzxwq>, - VEX; -} +multiclass sse41_fp_unop_rm_avx opcps, bits<8> opcpd, + string OpcodeStr> { + // Intrinsic operation, reg. + // Vector intrinsic operation, reg + def PSr : SS4AIi8, OpSize; -defm PMOVSXBD : SS41I_binop_rm_int4<0x21, "pmovsxbd", int_x86_sse41_pmovsxbd>; -defm PMOVSXWQ : SS41I_binop_rm_int4<0x24, "pmovsxwq", int_x86_sse41_pmovsxwq>; -defm PMOVZXBD : SS41I_binop_rm_int4<0x31, "pmovzxbd", int_x86_sse41_pmovzxbd>; -defm PMOVZXWQ : SS41I_binop_rm_int4<0x34, "pmovzxwq", int_x86_sse41_pmovzxwq>; + // Vector intrinsic operation, mem + def PSm : Ii8, TA, OpSize, Requires<[HasSSE41]>; -// Common patterns involving scalar load -def : Pat<(int_x86_sse41_pmovsxbd (vzmovl_v4i32 addr:$src)), - (PMOVSXBDrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovsxwq (vzmovl_v4i32 addr:$src)), - (PMOVSXWQrm addr:$src)>, Requires<[HasSSE41]>; + // Vector intrinsic operation, reg + def PDr : SS4AIi8, OpSize; -def : Pat<(int_x86_sse41_pmovzxbd (vzmovl_v4i32 addr:$src)), - (PMOVZXBDrm addr:$src)>, Requires<[HasSSE41]>; -def : Pat<(int_x86_sse41_pmovzxwq (vzmovl_v4i32 addr:$src)), - (PMOVZXWQrm addr:$src)>, Requires<[HasSSE41]>; + // Vector intrinsic operation, mem + def PDm : SS4AIi8, OpSize; +} +multiclass sse41_fp_binop_rm opcss, bits<8> opcsd, + string OpcodeStr, + Intrinsic F32Int, + Intrinsic F64Int, bit Is2Addr = 1> { + // Intrinsic operation, reg. + def SSr_Int : SS4AIi8, + OpSize; -multiclass SS41I_binop_rm_int2 opc, string OpcodeStr, Intrinsic IntId> { - def rr : SS48I, OpSize; + // Intrinsic operation, mem. + def SSm_Int : SS4AIi8, + OpSize; - // Expecting a i16 load any extended to i32 value. - def rm : SS48I, - OpSize; -} + // Intrinsic operation, reg. + def SDr_Int : SS4AIi8, + OpSize; -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { -defm VPMOVSXBQ : SS41I_binop_rm_int2<0x22, "vpmovsxbq", int_x86_sse41_pmovsxbq>, - VEX; -defm VPMOVZXBQ : SS41I_binop_rm_int2<0x32, "vpmovzxbq", int_x86_sse41_pmovzxbq>, - VEX; + // Intrinsic operation, mem. + def SDm_Int : SS4AIi8, + OpSize; } -defm PMOVSXBQ : SS41I_binop_rm_int2<0x22, "pmovsxbq", int_x86_sse41_pmovsxbq>; -defm PMOVZXBQ : SS41I_binop_rm_int2<0x32, "pmovzxbq", int_x86_sse41_pmovzxbq>; -// Common patterns involving scalar load -def : Pat<(int_x86_sse41_pmovsxbq - (bitconvert (v4i32 (X86vzmovl - (v4i32 (scalar_to_vector (loadi32 addr:$src))))))), - (PMOVSXBQrm addr:$src)>, Requires<[HasSSE41]>; +multiclass sse41_fp_binop_rm_avx opcss, bits<8> opcsd, + string OpcodeStr> { + // Intrinsic operation, reg. + def SSr : SS4AIi8, OpSize; -def : Pat<(int_x86_sse41_pmovzxbq - (bitconvert (v4i32 (X86vzmovl - (v4i32 (scalar_to_vector (loadi32 addr:$src))))))), - (PMOVZXBQrm addr:$src)>, Requires<[HasSSE41]>; + // Intrinsic operation, mem. + def SSm : SS4AIi8, OpSize; + // Intrinsic operation, reg. + def SDr : SS4AIi8, OpSize; -/// SS41I_binop_ext8 - SSE 4.1 extract 8 bits to 32 bit reg or 8 bit mem -multiclass SS41I_extract8 opc, string OpcodeStr> { - def rr : SS4AIi8, - OpSize; - def mr : SS4AIi8, OpSize; -// FIXME: -// There's an AssertZext in the way of writing the store pattern -// (store (i8 (trunc (X86pextrb (v16i8 VR128:$src1), imm:$src2))), addr:$dst) + // Intrinsic operation, mem. + def SDm : SS4AIi8, OpSize; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPEXTRB : SS41I_extract8<0x14, "vpextrb">, VEX; +// FP round - roundss, roundps, roundsd, roundpd +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { + // Intrinsic form + defm VROUND : sse41_fp_unop_rm<0x08, 0x09, "vround", + int_x86_sse41_round_ps, int_x86_sse41_round_pd>, + VEX; + defm VROUND : sse41_fp_binop_rm<0x0A, 0x0B, "vround", + int_x86_sse41_round_ss, int_x86_sse41_round_sd, + 0>, VEX_4V; + // Instructions for the assembler + defm VROUND : sse41_fp_unop_rm_avx<0x08, 0x09, "vround">, VEX; + defm VROUND : sse41_fp_binop_rm_avx<0x0A, 0x0B, "vround">, VEX_4V; +} -defm PEXTRB : SS41I_extract8<0x14, "pextrb">; +defm ROUND : sse41_fp_unop_rm<0x08, 0x09, "round", + int_x86_sse41_round_ps, int_x86_sse41_round_pd>; +let Constraints = "$src1 = $dst" in +defm ROUND : sse41_fp_binop_rm<0x0A, 0x0B, "round", + int_x86_sse41_round_ss, int_x86_sse41_round_sd>; +//===----------------------------------------------------------------------===// +// SSE4.1 - Misc Instructions +//===----------------------------------------------------------------------===// -/// SS41I_extract16 - SSE 4.1 extract 16 bits to memory destination -multiclass SS41I_extract16 opc, string OpcodeStr> { - def mr : SS4AIi8, OpSize; -// FIXME: -// There's an AssertZext in the way of writing the store pattern -// (store (i16 (trunc (X86pextrw (v16i8 VR128:$src1), imm:$src2))), addr:$dst) +// SS41I_unop_rm_int_v16 - SSE 4.1 unary operator whose type is v8i16. +multiclass SS41I_unop_rm_int_v16 opc, string OpcodeStr, + Intrinsic IntId128> { + def rr128 : SS48I, OpSize; + def rm128 : SS48I, OpSize; } let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPEXTRW : SS41I_extract16<0x15, "vpextrw">, VEX; - -defm PEXTRW : SS41I_extract16<0x15, "pextrw">; +defm VPHMINPOSUW : SS41I_unop_rm_int_v16 <0x41, "vphminposuw", + int_x86_sse41_phminposuw>, VEX; +defm PHMINPOSUW : SS41I_unop_rm_int_v16 <0x41, "phminposuw", + int_x86_sse41_phminposuw>; +/// SS41I_binop_rm_int - Simple SSE 4.1 binary operator +multiclass SS41I_binop_rm_int opc, string OpcodeStr, + Intrinsic IntId128, bit Is2Addr = 1> { + let isCommutable = 1 in + def rr : SS48I, OpSize; + def rm : SS48I, OpSize; +} -/// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination -multiclass SS41I_extract32 opc, string OpcodeStr> { - def rr : SS4AIi8, OpSize; - def mr : SS4AIi8, OpSize; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { + let isCommutable = 0 in + defm VPACKUSDW : SS41I_binop_rm_int<0x2B, "vpackusdw", int_x86_sse41_packusdw, + 0>, VEX_4V; + defm VPCMPEQQ : SS41I_binop_rm_int<0x29, "vpcmpeqq", int_x86_sse41_pcmpeqq, + 0>, VEX_4V; + defm VPMINSB : SS41I_binop_rm_int<0x38, "vpminsb", int_x86_sse41_pminsb, + 0>, VEX_4V; + defm VPMINSD : SS41I_binop_rm_int<0x39, "vpminsd", int_x86_sse41_pminsd, + 0>, VEX_4V; + defm VPMINUD : SS41I_binop_rm_int<0x3B, "vpminud", int_x86_sse41_pminud, + 0>, VEX_4V; + defm VPMINUW : SS41I_binop_rm_int<0x3A, "vpminuw", int_x86_sse41_pminuw, + 0>, VEX_4V; + defm VPMAXSB : SS41I_binop_rm_int<0x3C, "vpmaxsb", int_x86_sse41_pmaxsb, + 0>, VEX_4V; + defm VPMAXSD : SS41I_binop_rm_int<0x3D, "vpmaxsd", int_x86_sse41_pmaxsd, + 0>, VEX_4V; + defm VPMAXUD : SS41I_binop_rm_int<0x3F, "vpmaxud", int_x86_sse41_pmaxud, + 0>, VEX_4V; + defm VPMAXUW : SS41I_binop_rm_int<0x3E, "vpmaxuw", int_x86_sse41_pmaxuw, + 0>, VEX_4V; + defm VPMULDQ : SS41I_binop_rm_int<0x28, "vpmuldq", int_x86_sse41_pmuldq, + 0>, VEX_4V; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPEXTRD : SS41I_extract32<0x16, "vpextrd">, VEX; - -defm PEXTRD : SS41I_extract32<0x16, "pextrd">; - -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPEXTRQ : SS41I_extract64<0x16, "vpextrq">, VEX, VEX_W; - -/// SS41I_extractf32 - SSE 4.1 extract 32 bits fp value to int reg or memory -/// destination -multiclass SS41I_extractf32 opc, string OpcodeStr> { - def rr : SS4AIi8, - OpSize; - def mr : SS4AIi8, OpSize; +let Constraints = "$src1 = $dst" in { + let isCommutable = 0 in + defm PACKUSDW : SS41I_binop_rm_int<0x2B, "packusdw", int_x86_sse41_packusdw>; + defm PCMPEQQ : SS41I_binop_rm_int<0x29, "pcmpeqq", int_x86_sse41_pcmpeqq>; + defm PMINSB : SS41I_binop_rm_int<0x38, "pminsb", int_x86_sse41_pminsb>; + defm PMINSD : SS41I_binop_rm_int<0x39, "pminsd", int_x86_sse41_pminsd>; + defm PMINUD : SS41I_binop_rm_int<0x3B, "pminud", int_x86_sse41_pminud>; + defm PMINUW : SS41I_binop_rm_int<0x3A, "pminuw", int_x86_sse41_pminuw>; + defm PMAXSB : SS41I_binop_rm_int<0x3C, "pmaxsb", int_x86_sse41_pmaxsb>; + defm PMAXSD : SS41I_binop_rm_int<0x3D, "pmaxsd", int_x86_sse41_pmaxsd>; + defm PMAXUD : SS41I_binop_rm_int<0x3F, "pmaxud", int_x86_sse41_pmaxud>; + defm PMAXUW : SS41I_binop_rm_int<0x3E, "pmaxuw", int_x86_sse41_pmaxuw>; + defm PMULDQ : SS41I_binop_rm_int<0x28, "pmuldq", int_x86_sse41_pmuldq>; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VEXTRACTPS : SS41I_extractf32<0x17, "vextractps">, VEX; -defm EXTRACTPS : SS41I_extractf32<0x17, "extractps">; - -// Also match an EXTRACTPS store when the store is done as f32 instead of i32. -def : Pat<(store (f32 (bitconvert (extractelt (bc_v4i32 (v4f32 VR128:$src1)), - imm:$src2))), - addr:$dst), - (EXTRACTPSmr addr:$dst, VR128:$src1, imm:$src2)>, - Requires<[HasSSE41]>; +def : Pat<(v2i64 (X86pcmpeqq VR128:$src1, VR128:$src2)), + (PCMPEQQrr VR128:$src1, VR128:$src2)>; +def : Pat<(v2i64 (X86pcmpeqq VR128:$src1, (memop addr:$src2))), + (PCMPEQQrm VR128:$src1, addr:$src2)>; -multiclass SS41I_insert8 opc, string asm, bit Is2Addr = 1> { - def rr : SS4AIi8, OpSize; - def rm : SS4AIi8, OpSize; +/// SS48I_binop_rm - Simple SSE41 binary operator. +multiclass SS48I_binop_rm opc, string OpcodeStr, SDNode OpNode, + ValueType OpVT, bit Is2Addr = 1> { + let isCommutable = 1 in + def rr : SS48I, + OpSize; + def rm : SS48I, + OpSize; } let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPINSRB : SS41I_insert8<0x20, "vpinsrb", 0>, VEX_4V; + defm VPMULLD : SS48I_binop_rm<0x40, "vpmulld", mul, v4i32, 0>, VEX_4V; let Constraints = "$src1 = $dst" in - defm PINSRB : SS41I_insert8<0x20, "pinsrb">; + defm PMULLD : SS48I_binop_rm<0x40, "pmulld", mul, v4i32>; -multiclass SS41I_insert32 opc, string asm, bit Is2Addr = 1> { - def rr : SS4AIi8, - OpSize; - def rm : SS4AIi8, OpSize; +/// SS41I_binop_rmi_int - SSE 4.1 binary operator with 8-bit immediate +multiclass SS41I_binop_rmi_int opc, string OpcodeStr, + Intrinsic IntId128, bit Is2Addr = 1> { + let isCommutable = 1 in + def rri : SS4AIi8, + OpSize; + def rmi : SS4AIi8, + OpSize; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPINSRD : SS41I_insert32<0x22, "vpinsrd", 0>, VEX_4V; -let Constraints = "$src1 = $dst" in - defm PINSRD : SS41I_insert32<0x22, "pinsrd">; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { + let isCommutable = 0 in { + defm VBLENDPS : SS41I_binop_rmi_int<0x0C, "vblendps", int_x86_sse41_blendps, + 0>, VEX_4V; + defm VBLENDPD : SS41I_binop_rmi_int<0x0D, "vblendpd", int_x86_sse41_blendpd, + 0>, VEX_4V; + defm VPBLENDW : SS41I_binop_rmi_int<0x0E, "vpblendw", int_x86_sse41_pblendw, + 0>, VEX_4V; + defm VMPSADBW : SS41I_binop_rmi_int<0x42, "vmpsadbw", int_x86_sse41_mpsadbw, + 0>, VEX_4V; + } + defm VDPPS : SS41I_binop_rmi_int<0x40, "vdpps", int_x86_sse41_dpps, + 0>, VEX_4V; + defm VDPPD : SS41I_binop_rmi_int<0x41, "vdppd", int_x86_sse41_dppd, + 0>, VEX_4V; +} -multiclass SS41I_insert64_avx opc, string OpcodeStr> { - def rr : SS4AIi8, - OpSize, REX_W; - def rm : SS4AIi8, OpSize, REX_W; +let Constraints = "$src1 = $dst" in { + let isCommutable = 0 in { + defm BLENDPS : SS41I_binop_rmi_int<0x0C, "blendps", int_x86_sse41_blendps>; + defm BLENDPD : SS41I_binop_rmi_int<0x0D, "blendpd", int_x86_sse41_blendpd>; + defm PBLENDW : SS41I_binop_rmi_int<0x0E, "pblendw", int_x86_sse41_pblendw>; + defm MPSADBW : SS41I_binop_rmi_int<0x42, "mpsadbw", int_x86_sse41_mpsadbw>; + } + defm DPPS : SS41I_binop_rmi_int<0x40, "dpps", int_x86_sse41_dpps>; + defm DPPD : SS41I_binop_rmi_int<0x41, "dppd", int_x86_sse41_dppd>; } -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPINSRQ : SS41I_insert64_avx<0x22, "vpinsrq">, VEX_4V, VEX_W; +/// SS41I_quaternary_int_avx - AVX SSE 4.1 with 4 operators +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { + multiclass SS41I_quaternary_int_avx opc, string OpcodeStr> { + def rr : I, OpSize, TA, VEX_4V, VEX_I8IMM; -// insertps has a few different modes, there's the first two here below which -// are optimized inserts that won't zero arbitrary elements in the destination -// vector. The next one matches the intrinsic and could zero arbitrary elements -// in the target vector. -multiclass SS41I_insertf32 opc, string asm, bit Is2Addr = 1> { - def rr : SS4AIi8, - OpSize; - def rm : SS4AIi8, OpSize; + def rm : I, OpSize, TA, VEX_4V, VEX_I8IMM; + } } -let Constraints = "$src1 = $dst" in - defm INSERTPS : SS41I_insertf32<0x21, "insertps">; -let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VINSERTPS : SS41I_insertf32<0x21, "vinsertps", 0>, VEX_4V; +defm VBLENDVPD : SS41I_quaternary_int_avx<0x4B, "vblendvpd">; +defm VBLENDVPS : SS41I_quaternary_int_avx<0x4A, "vblendvps">; +defm VPBLENDVB : SS41I_quaternary_int_avx<0x4C, "vpblendvb">; -def : Pat<(int_x86_sse41_insertps VR128:$src1, VR128:$src2, imm:$src3), - (INSERTPSrr VR128:$src1, VR128:$src2, imm:$src3)>; +/// SS41I_ternary_int - SSE 4.1 ternary operator +let Uses = [XMM0], Constraints = "$src1 = $dst" in { + multiclass SS41I_ternary_int opc, string OpcodeStr, Intrinsic IntId> { + def rr0 : SS48I, + OpSize; + + def rm0 : SS48I, OpSize; + } +} + +defm BLENDVPD : SS41I_ternary_int<0x15, "blendvpd", int_x86_sse41_blendvpd>; +defm BLENDVPS : SS41I_ternary_int<0x14, "blendvps", int_x86_sse41_blendvps>; +defm PBLENDVB : SS41I_ternary_int<0x10, "pblendvb", int_x86_sse41_pblendvb>; // ptest instruction we'll lower to this in X86ISelLowering primarily from // the intel intrinsic that corresponds to this. @@ -4666,7 +4698,6 @@ [(set VR128:$dst, (int_x86_sse41_movntdqa addr:$src))]>, OpSize; - //===----------------------------------------------------------------------===// // SSE4.2 Instructions //===----------------------------------------------------------------------===// From bruno.cardoso at gmail.com Tue Jul 6 20:43:01 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 01:43:01 -0000 Subject: [llvm-commits] [llvm] r107750 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrSSE.td Message-ID: <20100707014301.506352A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 20:43:01 2010 New Revision: 107750 URL: http://llvm.org/viewvc/llvm-project?rev=107750&view=rev Log: Use only one multiclass to pinsrq instructions Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=107750&r1=107749&r2=107750&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Jul 6 20:43:01 2010 @@ -2349,27 +2349,3 @@ "movq\t{$src, $dst|$dst, $src}", [(store (i64 (bitconvert FR64:$src)), addr:$dst)]>; -//===----------------------------------------------------------------------===// -// X86-64 SSE4.1 Instructions -//===----------------------------------------------------------------------===// - -let Constraints = "$src1 = $dst" in { - multiclass SS41I_insert64 opc, string OpcodeStr> { - def rr : SS4AIi8, - OpSize, REX_W; - def rm : SS4AIi8, OpSize, REX_W; - } -} // Constraints = "$src1 = $dst" - -defm PINSRQ : SS41I_insert64<0x22, "pinsrq">; Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107750&r1=107749&r2=107750&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 20:43:01 2010 @@ -4214,25 +4214,31 @@ let Constraints = "$src1 = $dst" in defm PINSRD : SS41I_insert32<0x22, "pinsrd">; -multiclass SS41I_insert64_avx opc, string OpcodeStr> { +multiclass SS41I_insert64 opc, string asm, bit Is2Addr = 1> { def rr : SS4AIi8, - OpSize, REX_W; + (ins VR128:$src1, GR64:$src2, i32i8imm:$src3), + !if(Is2Addr, + !strconcat(asm, "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), + !strconcat(asm, + "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}")), + [(set VR128:$dst, + (v2i64 (insertelt VR128:$src1, GR64:$src2, imm:$src3)))]>, + OpSize; def rm : SS4AIi8, OpSize, REX_W; + (ins VR128:$src1, i64mem:$src2, i32i8imm:$src3), + !if(Is2Addr, + !strconcat(asm, "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), + !strconcat(asm, + "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}")), + [(set VR128:$dst, + (v2i64 (insertelt VR128:$src1, (loadi64 addr:$src2), + imm:$src3)))]>, OpSize; } let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in - defm VPINSRQ : SS41I_insert64_avx<0x22, "vpinsrq">, VEX_4V, VEX_W; + defm VPINSRQ : SS41I_insert64<0x22, "vpinsrq", 0>, VEX_4V, VEX_W; +let Constraints = "$src1 = $dst" in + defm PINSRQ : SS41I_insert64<0x22, "pinsrq">, REX_W; // insertps has a few different modes, there's the first two here below which // are optimized inserts that won't zero arbitrary elements in the destination From bruno.cardoso at gmail.com Tue Jul 6 22:39:29 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 03:39:29 -0000 Subject: [llvm-commits] [llvm] r107752 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100707033929.848C02A6C12C@llvm.org> Author: bruno Date: Tue Jul 6 22:39:29 2010 New Revision: 107752 URL: http://llvm.org/viewvc/llvm-project?rev=107752&view=rev Log: Add AVX SSE4.2 instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107752&r1=107751&r2=107752&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jul 6 22:39:29 2010 @@ -4705,36 +4705,196 @@ OpSize; //===----------------------------------------------------------------------===// -// SSE4.2 Instructions +// SSE4.2 - Compare Instructions //===----------------------------------------------------------------------===// /// SS42I_binop_rm_int - Simple SSE 4.2 binary operator -let Constraints = "$src1 = $dst" in { - multiclass SS42I_binop_rm_int opc, string OpcodeStr, - Intrinsic IntId128, bit Commutable = 0> { - def rr : SS428I, - OpSize { - let isCommutable = Commutable; - } - def rm : SS428I, OpSize; - } +multiclass SS42I_binop_rm_int opc, string OpcodeStr, + Intrinsic IntId128, bit Is2Addr = 1> { + def rr : SS428I, + OpSize; + def rm : SS428I, OpSize; } -defm PCMPGTQ : SS42I_binop_rm_int<0x37, "pcmpgtq", int_x86_sse42_pcmpgtq>; +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE42] in + defm VPCMPGTQ : SS42I_binop_rm_int<0x37, "vpcmpgtq", int_x86_sse42_pcmpgtq, + 0>, VEX_4V; +let Constraints = "$src1 = $dst" in + defm PCMPGTQ : SS42I_binop_rm_int<0x37, "pcmpgtq", int_x86_sse42_pcmpgtq>; def : Pat<(v2i64 (X86pcmpgtq VR128:$src1, VR128:$src2)), (PCMPGTQrr VR128:$src1, VR128:$src2)>; def : Pat<(v2i64 (X86pcmpgtq VR128:$src1, (memop addr:$src2))), (PCMPGTQrm VR128:$src1, addr:$src2)>; +//===----------------------------------------------------------------------===// +// SSE4.2 - String/text Processing Instructions +//===----------------------------------------------------------------------===// + +// Packed Compare Implicit Length Strings, Return Mask +let Defs = [EFLAGS], usesCustomInserter = 1 in { + def PCMPISTRM128REG : SS42AI<0, Pseudo, (outs VR128:$dst), + (ins VR128:$src1, VR128:$src2, i8imm:$src3), + "#PCMPISTRM128rr PSEUDO!", + [(set VR128:$dst, (int_x86_sse42_pcmpistrm128 VR128:$src1, VR128:$src2, + imm:$src3))]>, OpSize; + def PCMPISTRM128MEM : SS42AI<0, Pseudo, (outs VR128:$dst), + (ins VR128:$src1, i128mem:$src2, i8imm:$src3), + "#PCMPISTRM128rm PSEUDO!", + [(set VR128:$dst, (int_x86_sse42_pcmpistrm128 + VR128:$src1, (load addr:$src2), imm:$src3))]>, OpSize; +} + +let Defs = [XMM0, EFLAGS], isAsmParserOnly = 1, + Predicates = [HasAVX, HasSSE42] in { + def VPCMPISTRM128rr : SS42AI<0x62, MRMSrcReg, (outs), + (ins VR128:$src1, VR128:$src2, i8imm:$src3), + "vpcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize, VEX; + def VPCMPISTRM128rm : SS42AI<0x62, MRMSrcMem, (outs), + (ins VR128:$src1, i128mem:$src2, i8imm:$src3), + "vpcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize, VEX; +} + +let Defs = [XMM0, EFLAGS] in { + def PCMPISTRM128rr : SS42AI<0x62, MRMSrcReg, (outs), + (ins VR128:$src1, VR128:$src2, i8imm:$src3), + "pcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize; + def PCMPISTRM128rm : SS42AI<0x62, MRMSrcMem, (outs), + (ins VR128:$src1, i128mem:$src2, i8imm:$src3), + "pcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize; +} + +// Packed Compare Explicit Length Strings, Return Mask +let Defs = [EFLAGS], Uses = [EAX, EDX], usesCustomInserter = 1 in { + def PCMPESTRM128REG : SS42AI<0, Pseudo, (outs VR128:$dst), + (ins VR128:$src1, VR128:$src3, i8imm:$src5), + "#PCMPESTRM128rr PSEUDO!", + [(set VR128:$dst, + (int_x86_sse42_pcmpestrm128 + VR128:$src1, EAX, VR128:$src3, EDX, imm:$src5))]>, OpSize; + + def PCMPESTRM128MEM : SS42AI<0, Pseudo, (outs VR128:$dst), + (ins VR128:$src1, i128mem:$src3, i8imm:$src5), + "#PCMPESTRM128rm PSEUDO!", + [(set VR128:$dst, (int_x86_sse42_pcmpestrm128 + VR128:$src1, EAX, (load addr:$src3), EDX, imm:$src5))]>, + OpSize; +} + +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE42], + Defs = [XMM0, EFLAGS], Uses = [EAX, EDX] in { + def VPCMPESTRM128rr : SS42AI<0x60, MRMSrcReg, (outs), + (ins VR128:$src1, VR128:$src3, i8imm:$src5), + "vpcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize, VEX; + def VPCMPESTRM128rm : SS42AI<0x60, MRMSrcMem, (outs), + (ins VR128:$src1, i128mem:$src3, i8imm:$src5), + "vpcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize, VEX; +} + +let Defs = [XMM0, EFLAGS], Uses = [EAX, EDX] in { + def PCMPESTRM128rr : SS42AI<0x60, MRMSrcReg, (outs), + (ins VR128:$src1, VR128:$src3, i8imm:$src5), + "pcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize; + def PCMPESTRM128rm : SS42AI<0x60, MRMSrcMem, (outs), + (ins VR128:$src1, i128mem:$src3, i8imm:$src5), + "pcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize; +} + +// Packed Compare Implicit Length Strings, Return Index +let Defs = [ECX, EFLAGS] in { + multiclass SS42AI_pcmpistri { + def rr : SS42AI<0x63, MRMSrcReg, (outs), + (ins VR128:$src1, VR128:$src2, i8imm:$src3), + !strconcat(asm, "\t{$src3, $src2, $src1|$src1, $src2, $src3}"), + [(set ECX, (IntId128 VR128:$src1, VR128:$src2, imm:$src3)), + (implicit EFLAGS)]>, OpSize; + def rm : SS42AI<0x63, MRMSrcMem, (outs), + (ins VR128:$src1, i128mem:$src2, i8imm:$src3), + !strconcat(asm, "\t{$src3, $src2, $src1|$src1, $src2, $src3}"), + [(set ECX, (IntId128 VR128:$src1, (load addr:$src2), imm:$src3)), + (implicit EFLAGS)]>, OpSize; + } +} + +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE42] in { +defm VPCMPISTRI : SS42AI_pcmpistri, + VEX; +defm VPCMPISTRIA : SS42AI_pcmpistri, + VEX; +defm VPCMPISTRIC : SS42AI_pcmpistri, + VEX; +defm VPCMPISTRIO : SS42AI_pcmpistri, + VEX; +defm VPCMPISTRIS : SS42AI_pcmpistri, + VEX; +defm VPCMPISTRIZ : SS42AI_pcmpistri, + VEX; +} + +defm PCMPISTRI : SS42AI_pcmpistri; +defm PCMPISTRIA : SS42AI_pcmpistri; +defm PCMPISTRIC : SS42AI_pcmpistri; +defm PCMPISTRIO : SS42AI_pcmpistri; +defm PCMPISTRIS : SS42AI_pcmpistri; +defm PCMPISTRIZ : SS42AI_pcmpistri; + +// Packed Compare Explicit Length Strings, Return Index +let Defs = [ECX, EFLAGS], Uses = [EAX, EDX] in { + multiclass SS42AI_pcmpestri { + def rr : SS42AI<0x61, MRMSrcReg, (outs), + (ins VR128:$src1, VR128:$src3, i8imm:$src5), + !strconcat(asm, "\t{$src5, $src3, $src1|$src1, $src3, $src5}"), + [(set ECX, (IntId128 VR128:$src1, EAX, VR128:$src3, EDX, imm:$src5)), + (implicit EFLAGS)]>, OpSize; + def rm : SS42AI<0x61, MRMSrcMem, (outs), + (ins VR128:$src1, i128mem:$src3, i8imm:$src5), + !strconcat(asm, "\t{$src5, $src3, $src1|$src1, $src3, $src5}"), + [(set ECX, + (IntId128 VR128:$src1, EAX, (load addr:$src3), EDX, imm:$src5)), + (implicit EFLAGS)]>, OpSize; + } +} + +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE42] in { +defm VPCMPESTRI : SS42AI_pcmpestri, + VEX; +defm VPCMPESTRIA : SS42AI_pcmpestri, + VEX; +defm VPCMPESTRIC : SS42AI_pcmpestri, + VEX; +defm VPCMPESTRIO : SS42AI_pcmpestri, + VEX; +defm VPCMPESTRIS : SS42AI_pcmpestri, + VEX; +defm VPCMPESTRIZ : SS42AI_pcmpestri, + VEX; +} + +defm PCMPESTRI : SS42AI_pcmpestri; +defm PCMPESTRIA : SS42AI_pcmpestri; +defm PCMPESTRIC : SS42AI_pcmpestri; +defm PCMPESTRIO : SS42AI_pcmpestri; +defm PCMPESTRIS : SS42AI_pcmpestri; +defm PCMPESTRIZ : SS42AI_pcmpestri; + +//===----------------------------------------------------------------------===// +// SSE4.2 - CRC Instructions +//===----------------------------------------------------------------------===// + +// No CRC instructions have AVX equivalents + // crc intrinsic instruction // This set of instructions are only rm, the only difference is the size // of r and m. @@ -4802,101 +4962,6 @@ REX_W; } -// String/text processing instructions. -let Defs = [EFLAGS], usesCustomInserter = 1 in { -def PCMPISTRM128REG : SS42AI<0, Pseudo, (outs VR128:$dst), - (ins VR128:$src1, VR128:$src2, i8imm:$src3), - "#PCMPISTRM128rr PSEUDO!", - [(set VR128:$dst, (int_x86_sse42_pcmpistrm128 VR128:$src1, VR128:$src2, - imm:$src3))]>, OpSize; -def PCMPISTRM128MEM : SS42AI<0, Pseudo, (outs VR128:$dst), - (ins VR128:$src1, i128mem:$src2, i8imm:$src3), - "#PCMPISTRM128rm PSEUDO!", - [(set VR128:$dst, (int_x86_sse42_pcmpistrm128 VR128:$src1, (load addr:$src2), - imm:$src3))]>, OpSize; -} - -let Defs = [XMM0, EFLAGS] in { -def PCMPISTRM128rr : SS42AI<0x62, MRMSrcReg, (outs), - (ins VR128:$src1, VR128:$src2, i8imm:$src3), - "pcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize; -def PCMPISTRM128rm : SS42AI<0x62, MRMSrcMem, (outs), - (ins VR128:$src1, i128mem:$src2, i8imm:$src3), - "pcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize; -} - -let Defs = [EFLAGS], Uses = [EAX, EDX], usesCustomInserter = 1 in { -def PCMPESTRM128REG : SS42AI<0, Pseudo, (outs VR128:$dst), - (ins VR128:$src1, VR128:$src3, i8imm:$src5), - "#PCMPESTRM128rr PSEUDO!", - [(set VR128:$dst, - (int_x86_sse42_pcmpestrm128 - VR128:$src1, EAX, VR128:$src3, EDX, imm:$src5))]>, OpSize; - -def PCMPESTRM128MEM : SS42AI<0, Pseudo, (outs VR128:$dst), - (ins VR128:$src1, i128mem:$src3, i8imm:$src5), - "#PCMPESTRM128rm PSEUDO!", - [(set VR128:$dst, (int_x86_sse42_pcmpestrm128 - VR128:$src1, EAX, (load addr:$src3), EDX, imm:$src5))]>, - OpSize; -} - -let Defs = [XMM0, EFLAGS], Uses = [EAX, EDX] in { -def PCMPESTRM128rr : SS42AI<0x60, MRMSrcReg, (outs), - (ins VR128:$src1, VR128:$src3, i8imm:$src5), - "pcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize; -def PCMPESTRM128rm : SS42AI<0x60, MRMSrcMem, (outs), - (ins VR128:$src1, i128mem:$src3, i8imm:$src5), - "pcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize; -} - -let Defs = [ECX, EFLAGS] in { - multiclass SS42AI_pcmpistri { - def rr : SS42AI<0x63, MRMSrcReg, (outs), - (ins VR128:$src1, VR128:$src2, i8imm:$src3), - "pcmpistri\t{$src3, $src2, $src1|$src1, $src2, $src3}", - [(set ECX, (IntId128 VR128:$src1, VR128:$src2, imm:$src3)), - (implicit EFLAGS)]>, OpSize; - def rm : SS42AI<0x63, MRMSrcMem, (outs), - (ins VR128:$src1, i128mem:$src2, i8imm:$src3), - "pcmpistri\t{$src3, $src2, $src1|$src1, $src2, $src3}", - [(set ECX, (IntId128 VR128:$src1, (load addr:$src2), imm:$src3)), - (implicit EFLAGS)]>, OpSize; - } -} - -defm PCMPISTRI : SS42AI_pcmpistri; -defm PCMPISTRIA : SS42AI_pcmpistri; -defm PCMPISTRIC : SS42AI_pcmpistri; -defm PCMPISTRIO : SS42AI_pcmpistri; -defm PCMPISTRIS : SS42AI_pcmpistri; -defm PCMPISTRIZ : SS42AI_pcmpistri; - -let Defs = [ECX, EFLAGS] in { -let Uses = [EAX, EDX] in { - multiclass SS42AI_pcmpestri { - def rr : SS42AI<0x61, MRMSrcReg, (outs), - (ins VR128:$src1, VR128:$src3, i8imm:$src5), - "pcmpestri\t{$src5, $src3, $src1|$src1, $src3, $src5}", - [(set ECX, (IntId128 VR128:$src1, EAX, VR128:$src3, EDX, imm:$src5)), - (implicit EFLAGS)]>, OpSize; - def rm : SS42AI<0x61, MRMSrcMem, (outs), - (ins VR128:$src1, i128mem:$src3, i8imm:$src5), - "pcmpestri\t{$src5, $src3, $src1|$src1, $src3, $src5}", - [(set ECX, - (IntId128 VR128:$src1, EAX, (load addr:$src3), EDX, imm:$src5)), - (implicit EFLAGS)]>, OpSize; - } -} -} - -defm PCMPESTRI : SS42AI_pcmpestri; -defm PCMPESTRIA : SS42AI_pcmpestri; -defm PCMPESTRIC : SS42AI_pcmpestri; -defm PCMPESTRIO : SS42AI_pcmpestri; -defm PCMPESTRIS : SS42AI_pcmpestri; -defm PCMPESTRIZ : SS42AI_pcmpestri; - //===----------------------------------------------------------------------===// // AES-NI Instructions //===----------------------------------------------------------------------===// Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107752&r1=107751&r2=107752&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jul 6 22:39:29 2010 @@ -12122,3 +12122,43 @@ // CHECK: encoding: [0xc4,0xe2,0x79,0x2a,0x10] vmovntdqa (%eax), %xmm2 +// CHECK: vpcmpgtq %xmm2, %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe2,0x51,0x37,0xca] + vpcmpgtq %xmm2, %xmm5, %xmm1 + +// CHECK: vpcmpgtq (%eax), %xmm5, %xmm3 +// CHECK: encoding: [0xc4,0xe2,0x51,0x37,0x18] + vpcmpgtq (%eax), %xmm5, %xmm3 + +// CHECK: vpcmpistrm $7, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x62,0xea,0x07] + vpcmpistrm $7, %xmm2, %xmm5 + +// CHECK: vpcmpistrm $7, (%eax), %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x62,0x28,0x07] + vpcmpistrm $7, (%eax), %xmm5 + +// CHECK: vpcmpestrm $7, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x60,0xea,0x07] + vpcmpestrm $7, %xmm2, %xmm5 + +// CHECK: vpcmpestrm $7, (%eax), %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x60,0x28,0x07] + vpcmpestrm $7, (%eax), %xmm5 + +// CHECK: vpcmpistri $7, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x63,0xea,0x07] + vpcmpistri $7, %xmm2, %xmm5 + +// CHECK: vpcmpistri $7, (%eax), %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x63,0x28,0x07] + vpcmpistri $7, (%eax), %xmm5 + +// CHECK: vpcmpestri $7, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x61,0xea,0x07] + vpcmpestri $7, %xmm2, %xmm5 + +// CHECK: vpcmpestri $7, (%eax), %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0x61,0x28,0x07] + vpcmpestri $7, (%eax), %xmm5 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107752&r1=107751&r2=107752&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jul 6 22:39:29 2010 @@ -2186,3 +2186,42 @@ // CHECK: encoding: [0xc4,0x62,0x79,0x2a,0x20] vmovntdqa (%rax), %xmm12 +// CHECK: vpcmpgtq %xmm12, %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x42,0x29,0x37,0xdc] + vpcmpgtq %xmm12, %xmm10, %xmm11 + +// CHECK: vpcmpgtq (%rax), %xmm10, %xmm13 +// CHECK: encoding: [0xc4,0x62,0x29,0x37,0x28] + vpcmpgtq (%rax), %xmm10, %xmm13 + +// CHECK: vpcmpistrm $7, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x43,0x79,0x62,0xd4,0x07] + vpcmpistrm $7, %xmm12, %xmm10 + +// CHECK: vpcmpistrm $7, (%rax), %xmm10 +// CHECK: encoding: [0xc4,0x63,0x79,0x62,0x10,0x07] + vpcmpistrm $7, (%rax), %xmm10 + +// CHECK: vpcmpestrm $7, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x43,0x79,0x60,0xd4,0x07] + vpcmpestrm $7, %xmm12, %xmm10 + +// CHECK: vpcmpestrm $7, (%rax), %xmm10 +// CHECK: encoding: [0xc4,0x63,0x79,0x60,0x10,0x07] + vpcmpestrm $7, (%rax), %xmm10 + +// CHECK: vpcmpistri $7, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x43,0x79,0x63,0xd4,0x07] + vpcmpistri $7, %xmm12, %xmm10 + +// CHECK: vpcmpistri $7, (%rax), %xmm10 +// CHECK: encoding: [0xc4,0x63,0x79,0x63,0x10,0x07] + vpcmpistri $7, (%rax), %xmm10 + +// CHECK: vpcmpestri $7, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x43,0x79,0x61,0xd4,0x07] + vpcmpestri $7, %xmm12, %xmm10 + +// CHECK: vpcmpestri $7, (%rax), %xmm10 +// CHECK: encoding: [0xc4,0x63,0x79,0x61,0x10,0x07] + vpcmpestri $7, (%rax), %xmm10 From nelhage at mit.edu Tue Jul 6 16:36:40 2010 From: nelhage at mit.edu (Nelson Elhage) Date: Tue, 06 Jul 2010 17:36:40 -0400 Subject: [llvm-commits] [llvm] r107640 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/StackProtector.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h test/CodeGen/Generic/stack-protector.ll test/CodeGen/PowerPC/stack-protector.ll test/CodeGen/X86/stack-protector-linux.ll test/CodeGen/X86/stack-protector.ll In-Reply-To: <20100706051856.7B0902A6C12C@llvm.org> References: <20100706051856.7B0902A6C12C@llvm.org> Message-ID: <87k4p8s36f.fsf@mit.edu> I take it you dropped the X86 tests (in r107641) until you could get around to FileCheck-izing them, but was it intentional that you committed the PPC test case but not the arm one? - Nelson On Tue, 06 Jul 2010 05:18:56 -0000, Eric Christopher wrote: > Author: echristo > Date: Tue Jul 6 00:18:56 2010 > New Revision: 107640 > > URL: http://llvm.org/viewvc/llvm-project?rev=107640&view=rev > Log: > Fix up -fstack-protector on linux to use the segment > registers. Split out testcases per architecture and os > now. > > Patch from Nelson Elhage. > > Added: > llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll > llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll > llvm/trunk/test/CodeGen/X86/stack-protector.ll > Removed: > llvm/trunk/test/CodeGen/Generic/stack-protector.ll > Modified: > llvm/trunk/include/llvm/Target/TargetLowering.h > llvm/trunk/lib/CodeGen/StackProtector.cpp > llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > llvm/trunk/lib/Target/X86/X86ISelLowering.h > > Modified: llvm/trunk/include/llvm/Target/TargetLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107640&r1=107639&r2=107640&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) > +++ llvm/trunk/include/llvm/Target/TargetLowering.h Tue Jul 6 00:18:56 2010 > @@ -749,6 +749,14 @@ > /// getFunctionAlignment - Return the Log2 alignment of this function. > virtual unsigned getFunctionAlignment(const Function *) const = 0; > > + /// getStackCookieLocation - Return true if the target stores stack > + /// protector cookies at a fixed offset in some non-standard address > + /// space, and populates the address space and offset as > + /// appropriate. > + virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const { > + return false; > + } > + > //===--------------------------------------------------------------------===// > // TargetLowering Optimization Methods > // > > Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=107640&r1=107639&r2=107640&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) > +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Jul 6 00:18:56 2010 > @@ -136,7 +136,7 @@ > bool StackProtector::InsertStackProtectors() { > BasicBlock *FailBB = 0; // The basic block to jump to if check fails. > AllocaInst *AI = 0; // Place on stack that stores the stack guard. > - Constant *StackGuardVar = 0; // The stack guard variable. > + Value *StackGuardVar = 0; // The stack guard variable. > > for (Function::iterator I = F->begin(), E = F->end(); I != E; ) { > BasicBlock *BB = I++; > @@ -155,7 +155,20 @@ > // > PointerType *PtrTy = PointerType::getUnqual( > Type::getInt8Ty(RI->getContext())); > - StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); > + > + unsigned AddressSpace, Offset; > + if (TLI->getStackCookieLocation(AddressSpace, Offset)) { > + Constant *ASPtr = Constant::getNullValue( > + PointerType::get(Type::getInt8Ty(RI->getContext()), AddressSpace)); > + APInt OffsetInt(32, Offset); > + Constant *OffsetVal = Constant::getIntegerValue( > + Type::getInt32Ty(RI->getContext()), OffsetInt); > + StackGuardVar = ConstantExpr::getPointerCast( > + ConstantExpr::getGetElementPtr(ASPtr, &OffsetVal, 1), > + PointerType::get(PtrTy, AddressSpace)); > + } else { > + StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); > + } > > BasicBlock &Entry = F->getEntryBlock(); > Instruction *InsPt = &Entry.front(); > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107640&r1=107639&r2=107640&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jul 6 00:18:56 2010 > @@ -1189,6 +1189,27 @@ > return F->hasFnAttr(Attribute::OptimizeForSize) ? 0 : 4; > } > > +bool X86TargetLowering::getStackCookieLocation(unsigned &AddressSpace, > + unsigned &Offset) const { > + if (!Subtarget->isTargetLinux()) > + return false; > + > + if (Subtarget->is64Bit()) { > + // %fs:0x28, unless we're using a Kernel code model, in which case it's %gs: > + Offset = 0x28; > + if (getTargetMachine().getCodeModel() == CodeModel::Kernel) > + AddressSpace = 256; > + else > + AddressSpace = 257; > + } else { > + // %gs:0x14 on i386 > + Offset = 0x14; > + AddressSpace = 256; > + } > + return true; > +} > + > + > //===----------------------------------------------------------------------===// > // Return Value Calling Convention Implementation > //===----------------------------------------------------------------------===// > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107640&r1=107639&r2=107640&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Jul 6 00:18:56 2010 > @@ -593,6 +593,12 @@ > /// getFunctionAlignment - Return the Log2 alignment of this function. > virtual unsigned getFunctionAlignment(const Function *F) const; > > + /// getStackCookieLocation - Return true if the target stores stack > + /// protector cookies at a fixed offset in some non-standard address > + /// space, and populates the address space and offset as > + /// appropriate. > + virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const; > + > private: > /// Subtarget - Keep a pointer to the X86Subtarget around so that we can > /// make the right decision when generating code for different targets. > > Removed: llvm/trunk/test/CodeGen/Generic/stack-protector.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/stack-protector.ll?rev=107639&view=auto > ============================================================================== > --- llvm/trunk/test/CodeGen/Generic/stack-protector.ll (original) > +++ llvm/trunk/test/CodeGen/Generic/stack-protector.ll (removed) > @@ -1,25 +0,0 @@ > -; RUN: llc < %s -o - | grep {__stack_chk_guard} > -; RUN: llc < %s -o - | grep {__stack_chk_fail} > - > -@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] > - > -define void @test(i8* %a) nounwind ssp { > -entry: > - %a_addr = alloca i8* ; [#uses=2] > - %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] > - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > - store i8* %a, i8** %a_addr > - %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > - %0 = load i8** %a_addr, align 4 ; [#uses=1] > - %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] > - %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > - %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] > - br label %return > - > -return: ; preds = %entry > - ret void > -} > - > -declare i8* @strcpy(i8*, i8*) nounwind > - > -declare i32 @printf(i8*, ...) nounwind > > Added: llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll?rev=107640&view=auto > ============================================================================== > --- llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll (added) > +++ llvm/trunk/test/CodeGen/PowerPC/stack-protector.ll Tue Jul 6 00:18:56 2010 > @@ -0,0 +1,25 @@ > +; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_guard} > +; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_fail} > + > +@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] > + > +define void @test(i8* %a) nounwind ssp { > +entry: > + %a_addr = alloca i8* ; [#uses=2] > + %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] > + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > + store i8* %a, i8** %a_addr > + %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > + %0 = load i8** %a_addr, align 4 ; [#uses=1] > + %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] > + %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] > + br label %return > + > +return: ; preds = %entry > + ret void > +} > + > +declare i8* @strcpy(i8*, i8*) nounwind > + > +declare i32 @printf(i8*, ...) nounwind > > Added: llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll?rev=107640&view=auto > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll (added) > +++ llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll Tue Jul 6 00:18:56 2010 > @@ -0,0 +1,28 @@ > +; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | grep %gs: > +; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %fs: > +; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %gs: > +; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_guard} > +; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_fail} > + > +@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] > + > +define void @test(i8* %a) nounwind ssp { > +entry: > + %a_addr = alloca i8* ; [#uses=2] > + %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] > + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > + store i8* %a, i8** %a_addr > + %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > + %0 = load i8** %a_addr, align 4 ; [#uses=1] > + %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] > + %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] > + br label %return > + > +return: ; preds = %entry > + ret void > +} > + > +declare i8* @strcpy(i8*, i8*) nounwind > + > +declare i32 @printf(i8*, ...) nounwind > > Added: llvm/trunk/test/CodeGen/X86/stack-protector.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-protector.ll?rev=107640&view=auto > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/stack-protector.ll (added) > +++ llvm/trunk/test/CodeGen/X86/stack-protector.ll Tue Jul 6 00:18:56 2010 > @@ -0,0 +1,25 @@ > +; RUN: llc -march=x86 < %s -o - | grep {__stack_chk_guard} > +; RUN: llc -march=x86 < %s -o - | grep {__stack_chk_fail} > + > +@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] > + > +define void @test(i8* %a) nounwind ssp { > +entry: > + %a_addr = alloca i8* ; [#uses=2] > + %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] > + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > + store i8* %a, i8** %a_addr > + %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > + %0 = load i8** %a_addr, align 4 ; [#uses=1] > + %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] > + %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] > + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] > + br label %return > + > +return: ; preds = %entry > + ret void > +} > + > +declare i8* @strcpy(i8*, i8*) nounwind > + > +declare i32 @printf(i8*, ...) nounwind > > > _______________________________________________ > 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 Jul 7 02:48:00 2010 From: baldrick at free.fr (Duncan Sands) Date: Wed, 07 Jul 2010 07:48:00 -0000 Subject: [llvm-commits] [llvm] r107758 - in /llvm/trunk: Makefile Makefile.rules docs/HowToReleaseLLVM.html docs/MakefileGuide.html lib/Transforms/IPO/MergeFunctions.cpp utils/NewNightlyTest.pl Message-ID: <20100707074800.8DF3D2A6C12D@llvm.org> Author: baldrick Date: Wed Jul 7 02:48:00 2010 New Revision: 107758 URL: http://llvm.org/viewvc/llvm-project?rev=107758&view=rev Log: Rename "Release" builds as "Release+Asserts"; rename "Release-Asserts" builds to "Release". The default build is unchanged (optimization on, assertions on), however it is now called Release+Asserts. The intent is that future LLVM releases released via llvm.org will be Release builds in the new sense, i.e. will have assertions disabled (currently they have assertions enabled, for a more than 20% slowdown). This will bring them in line with MacOS releases, which ship with assertions disabled. It also means that "Release" now means the same things in make and cmake builds: cmake already disables assertions for "Release" builds AFAICS. Modified: llvm/trunk/Makefile llvm/trunk/Makefile.rules llvm/trunk/docs/HowToReleaseLLVM.html llvm/trunk/docs/MakefileGuide.html llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/utils/NewNightlyTest.pl Modified: llvm/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=107758&r1=107757&r2=107758&view=diff ============================================================================== --- llvm/trunk/Makefile (original) +++ llvm/trunk/Makefile Wed Jul 7 02:48:00 2010 @@ -180,7 +180,7 @@ # that it gets executed last. ifneq ($(BUILD_DIRS_ONLY),1) all:: - $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build + $(Echo) '*****' Completed $(BuildMode) Build ifeq ($(BuildMode),Debug) $(Echo) '*****' Note: Debug build can be 10 times slower than an $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=107758&r1=107757&r2=107758&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Wed Jul 7 02:48:00 2010 @@ -398,12 +398,11 @@ # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. -ifdef DISABLE_ASSERTIONS - # Indicate that assertions are turned off using a minus sign - BuildMode := $(BuildMode)-Asserts - CPP.Defines += -DNDEBUG -else +ifndef DISABLE_ASSERTIONS + BuildMode := $(BuildMode)+Asserts CPP.Defines += -D_DEBUG +else + CPP.Defines += -DNDEBUG endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or Modified: llvm/trunk/docs/HowToReleaseLLVM.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/HowToReleaseLLVM.html?rev=107758&r1=107757&r2=107758&view=diff ============================================================================== --- llvm/trunk/docs/HowToReleaseLLVM.html (original) +++ llvm/trunk/docs/HowToReleaseLLVM.html Wed Jul 7 02:48:00 2010 @@ -213,13 +213,13 @@
    The build of llvm, llvm-gcc, and clang must be free -of errors and warnings in both debug, release, and release-asserts builds. +of errors and warnings in both debug, release+asserts, and release builds. If all builds are clean, then the release passes build qualification.
    1. debug: ENABLE_OPTIMIZED=0
    2. -
    3. release: ENABLE_OPTIMIZED=1
    4. -
    5. release-asserts: ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1
    6. +
    7. release+asserts: ENABLE_OPTIMIZED=1
    8. +
    9. release: ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1
    @@ -227,7 +227,7 @@

    - Build both debug, release (optimized), and release-asserts versions of + Build both debug, release+asserts (optimized), and release versions of LLVM on all supported platforms. Direction to build llvm are here.

    @@ -264,7 +264,7 @@ Binary Distribution

    - Creating the Clang binary distribution (debug/release/release-asserts) requires + Creating the Clang binary distribution (debug/release/release) requires performing the following steps for each supported platform:

    @@ -429,7 +429,7 @@

    - The final stages of the release process involving taging the release branch, + The final stages of the release process involving tagging the release branch, updating documentation that refers to the release, and updating the demo page.

    FIXME: Add a note if anything needs to be done to the clang website. Modified: llvm/trunk/docs/MakefileGuide.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/MakefileGuide.html?rev=107758&r1=107757&r2=107758&view=diff ============================================================================== --- llvm/trunk/docs/MakefileGuide.html (original) +++ llvm/trunk/docs/MakefileGuide.html Wed Jul 7 02:48:00 2010 @@ -652,7 +652,7 @@ the profiled tools (gmon.out).

    DISABLE_ASSERTIONS
    If set to any value, causes the build to disable assertions, even if - building a release or profile build. This will exclude all assertion check + building a debug or profile build. This will exclude all assertion check code from the build. LLVM will execute faster, but with little help when things go wrong.
    EXPERIMENTAL_DIRS
    Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=107758&r1=107757&r2=107758&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Wed Jul 7 02:48:00 2010 @@ -146,7 +146,7 @@ switch(Ty1->getTypeID()) { default: llvm_unreachable("Unknown type!"); - // Fall through in Release-Asserts mode. + // Fall through in Release mode. case Type::IntegerTyID: case Type::OpaqueTyID: // Ty1 == Ty2 would have returned true earlier. Modified: llvm/trunk/utils/NewNightlyTest.pl URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/NewNightlyTest.pl?rev=107758&r1=107757&r2=107758&view=diff ============================================================================== --- llvm/trunk/utils/NewNightlyTest.pl (original) +++ llvm/trunk/utils/NewNightlyTest.pl Wed Jul 7 02:48:00 2010 @@ -47,8 +47,8 @@ # -noclean Do not run 'make clean' before building. # -nobuild Do not build llvm. If tests are enabled perform them # on the llvm build specified in the build directory -# -release Build an LLVM Release version -# -release-asserts Build an LLVM ReleaseAsserts version +# -release Build an LLVM Release+Asserts version +# -release-asserts Build an LLVM Release version # -disable-bindings Disable building LLVM bindings. # -with-clang Checkout Clang source into tools/clang. # -compileflags Next argument specifies extra options passed to make when From baldrick at free.fr Wed Jul 7 03:30:06 2010 From: baldrick at free.fr (Duncan Sands) Date: Wed, 07 Jul 2010 08:30:06 -0000 Subject: [llvm-commits] [zorg] r107762 - in /zorg/trunk: buildbot/osuosl/master/config/builders.py lnt/docs/tests.rst lnt/lnt/tests/nt.py zorg/buildbot/builders/ClangBuilder.py zorg/buildbot/builders/LLVMBuilder.py zorg/buildbot/builders/LLVMGCCBuilder.py zorg/buildbot/builders/Util.py Message-ID: <20100707083006.84F712A6C12C@llvm.org> Author: baldrick Date: Wed Jul 7 03:30:06 2010 New Revision: 107762 URL: http://llvm.org/viewvc/llvm-project?rev=107762&view=rev Log: Update the buildbot scripts for name changes Release->Release+Asserts, Release-Asserts->Release; Debug->Debug+Asserts, Debug-Asserts->Debug. Someone will need to restart them though. Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py zorg/trunk/lnt/docs/tests.rst zorg/trunk/lnt/lnt/tests/nt.py zorg/trunk/zorg/buildbot/builders/ClangBuilder.py zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py zorg/trunk/zorg/buildbot/builders/Util.py Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/buildbot/osuosl/master/config/builders.py (original) +++ zorg/trunk/buildbot/osuosl/master/config/builders.py Wed Jul 7 03:30:06 2010 @@ -153,7 +153,7 @@ 'slavenames' :["dunbar-darwin10"], 'builddir' :"clang-i686-darwin10", 'factory': ClangBuilder.getClangBuildFactory(triple='i686-apple-darwin10', - stage1_config='Release-Asserts')}, + stage1_config='Release')}, {'name': "clang-i686-freebsd", 'slavenames':["freebsd1"], 'builddir':"clang-i686-freebsd", @@ -173,22 +173,22 @@ 'builddir' : "clang-x86_64-darwin10-selfhost", 'factory' : ClangBuilder.getClangBuildFactory(triple='x86_64-apple-darwin10', useTwoStage=True, - stage1_config='Release', - stage2_config='Debug')}, + stage1_config='Release+Asserts', + stage2_config='Debug+Asserts')}, {'name' : "clang-x86_64-linux-selfhost-rel", 'slavenames' : ["osu7"], 'builddir' : "clang-x86_64-linux-selfhost-rel", 'factory' : ClangBuilder.getClangBuildFactory(triple='x86_64-pc-linux-gnu', useTwoStage=True, - stage1_config='Release', - stage2_config='Release')}, + stage1_config='Release+Asserts', + stage2_config='Release+Asserts')}, {'name' : "clang-i686-linux-fnt", 'slavenames' : ['balint1'], 'builddir' : "clang-i686-linux-fnt", 'factory' : NightlytestBuilder.getFastNightlyTestBuildFactory(triple='i686-pc-linux-gnu', - stage1_config='Release', + stage1_config='Release+Asserts', test=False, xfails=clang_i386_linux_xfails) }, @@ -196,7 +196,7 @@ 'slavenames' : ['osu7'], 'builddir' : "clang-x86_64-linux-fnt", 'factory' : NightlytestBuilder.getFastNightlyTestBuildFactory(triple='x86_64-pc-linux-gnu', - stage1_config='Release', + stage1_config='Release+Asserts', test=False, xfails=clang_x86_64_linux_xfails) }, ] @@ -250,16 +250,16 @@ 'builddir' : "clang-i386-darwin10-selfhost-rel", 'factory' : ClangBuilder.getClangBuildFactory(triple='i386-apple-darwin10', useTwoStage=True, - stage1_config='Release', - stage2_config='Release'), + stage1_config='Release+Asserts', + stage2_config='Release+Asserts'), 'category' : 'clang.exp' }, {'name' : "clang-x86_64-darwin10-selfhost-rel", 'slavenames' : ["dunbar-darwin10"], 'builddir' : "clang-x86_64-darwin10-selfhost-rel", 'factory' : ClangBuilder.getClangBuildFactory(triple='x86_64-apple-darwin10', useTwoStage=True, - stage1_config='Release', - stage2_config='Release'), + stage1_config='Release+Asserts', + stage2_config='Release+Asserts'), 'category' : 'clang.exp' }, {'name' : "llvm-gcc-x86_64-linux-selfhost", @@ -456,8 +456,8 @@ 'builddir' : "clang-i686-linux-selfhost-rel", 'factory' : ClangBuilder.getClangBuildFactory(triple='i686-pc-linux-gnu', useTwoStage=True, - stage1_config='Release', - stage2_config='Release'), + stage1_config='Release+Asserts', + stage2_config='Release+Asserts'), 'category' : 'clang.exp' }, {'name' : "clang-i686-xp-msvc9_alt", @@ -471,8 +471,8 @@ 'builddir':"clang-i686-freebsd-selfhost-rel", 'factory': ClangBuilder.getClangBuildFactory(triple='i686-pc-freebsd', useTwoStage=True, - stage1_config='Release', - stage2_config='Release'), + stage1_config='Release+Asserts', + stage2_config='Release+Asserts'), 'category' : 'clang.exp' }, ] @@ -507,5 +507,5 @@ {'name': "clang-x86_64-linux-checks", 'slavenames':["osu2"], 'builddir':"clang-x86_64-linux-checks", - 'factory': ClangBuilder.getClangBuildFactory(stage1_config='Debug+Checks'), + 'factory': ClangBuilder.getClangBuildFactory(stage1_config='Debug+Asserts+Checks'), 'category':'clang.exp'} Modified: zorg/trunk/lnt/docs/tests.rst URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/docs/tests.rst?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/lnt/docs/tests.rst (original) +++ zorg/trunk/lnt/docs/tests.rst Wed Jul 7 03:30:06 2010 @@ -72,9 +72,9 @@ The ``nt`` test requires that the LLVM test-suite repository, a working LLVM compiler, and a LLVM source and build tree are available. Currently, the LLVM -build tree is expected to have been built-in the Release configuration. Unlike -the prior ``NewNightlyTest.pl``, the ``nt`` tool does not checkout or build any -thing, it is expected that users manage their own LLVM source and build +build tree is expected to have been built-in the Release+Asserts configuration. +Unlike the prior ``NewNightlyTest.pl``, the ``nt`` tool does not checkout or build +any thing, it is expected that users manage their own LLVM source and build trees. Ideally, each of the components should be based on the same LLVM revision (except perhaps the LLVM test-suite), but this is not required. @@ -97,8 +97,8 @@ $ rm -rf /tmp/BAR $ lnt runtest nt \ --sandbox /tmp/BAR \ - --cc ~/llvm.obj.64/Release/bin/clang \ - --cxx ~/llvm.obj.64/Release/bin/clang++ \ + --cc ~/llvm.obj.64/Release+Asserts/bin/clang \ + --cxx ~/llvm.obj.64/Release+Asserts/bin/clang++ \ --llvm-src ~/llvm \ --llvm-obj ~/llvm.obj.64 \ --test-suite ~/llvm-test-suite \ Modified: zorg/trunk/lnt/lnt/tests/nt.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/nt.py?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/lnt/lnt/tests/nt.py (original) +++ zorg/trunk/lnt/lnt/tests/nt.py Wed Jul 7 03:30:06 2010 @@ -66,8 +66,9 @@ else: fatal('invalid build mode: %r' % opts.build_mode) + make_variables['DISABLE_ASSERTIONS'] = '1' while build_mode: - for (name,key) in (('-Asserts', 'DISABLE_ASSERTIONS'), + for (name,key) in (('+Asserts', 'ENABLE_ASSERTIONS'), ('+Checks', 'ENABLE_EXPENSIVE_CHECKS'), ('+Coverage', 'ENABLE_COVERAGE'), ('+Debug', 'DEBUG_SYMBOLS'), Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Wed Jul 7 03:30:06 2010 @@ -18,7 +18,7 @@ valgrindLeakCheck=False, outOfDir=False, useTwoStage=False, completely_clean=False, always_install=False, make='make', jobs="%(jobs)s", - stage1_config='Debug', stage2_config='Release', + stage1_config='Debug+Asserts', stage2_config='Release+Asserts', extra_configure_args=[], use_pty_in_tests=False): # Don't use in-dir builds with a two stage build process. inDir = not outOfDir and not useTwoStage Modified: zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Wed Jul 7 03:30:06 2010 @@ -31,7 +31,7 @@ # Force without llvm-gcc so we don't run afoul of Frontend test failures. configure_args = ["./configure", "--without-llvmgcc", "--without-llvmgxx"] - config_name = 'Debug' + config_name = 'Debug+Asserts' if expensive_checks: configure_args.append('--enable-expensive-checks') config_name += '+Checks' Modified: zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/LLVMGCCBuilder.py Wed Jul 7 03:30:06 2010 @@ -11,8 +11,8 @@ def getLLVMGCCBuildFactory(jobs='%(jobs)s', update=True, clean=True, gxxincludedir=None, triple=None, build=None, host=None, target=None, - useTwoStage=True, stage1_config='Release', - stage2_config='Release', make='make', + useTwoStage=True, stage1_config='Release+Asserts', + stage2_config='Release+Asserts', make='make', extra_configure_args=[], verbose=False, env = {}, defaultBranch='trunk'): if build or host or target: Modified: zorg/trunk/zorg/buildbot/builders/Util.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/Util.py?rev=107762&r1=107761&r2=107762&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/Util.py (original) +++ zorg/trunk/zorg/buildbot/builders/Util.py Wed Jul 7 03:30:06 2010 @@ -9,9 +9,10 @@ else: raise ValueError,'Unknown config name: %r' % origname - if name.startswith('-Asserts'): - name = name[len('-Asserts'):] - args.append('--disable-assertions') + args.append('--disable-assertions') + if name.startswith('+Asserts'): + name = name[len('+Asserts'):] + args.append('--enable-assertions') if name.startswith('+Checks'): name = name[len('+Checks'):] From ggreif at gmail.com Wed Jul 7 04:29:08 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 07 Jul 2010 09:29:08 -0000 Subject: [llvm-commits] [llvm] r107764 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <20100707092908.19D692A6C12C@llvm.org> Author: ggreif Date: Wed Jul 7 04:29:07 2010 New Revision: 107764 URL: http://llvm.org/viewvc/llvm-project?rev=107764&view=rev Log: minor cosmetic changes that happened to sit in my tree 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=107764&r1=107763&r2=107764&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Wed Jul 7 04:29:07 2010 @@ -886,14 +886,14 @@ InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr = "", Instruction *InsertBefore = 0) { - return new((unsigned)(ArgEnd - ArgBegin + 1)) + return new(unsigned(ArgEnd - ArgBegin + 1)) CallInst(Func, ArgBegin, ArgEnd, NameStr, InsertBefore); } template static CallInst *Create(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr, BasicBlock *InsertAtEnd) { - return new((unsigned)(ArgEnd - ArgBegin + 1)) + return new(unsigned(ArgEnd - ArgBegin + 1)) CallInst(Func, ArgBegin, ArgEnd, NameStr, InsertAtEnd); } static CallInst *Create(Value *F, Value *Actual, @@ -1116,7 +1116,7 @@ ->getElementType())->getReturnType(), Instruction::Call, OperandTraits::op_end(this) - (ArgEnd - ArgBegin + 1), - (unsigned)(ArgEnd - ArgBegin + 1), InsertBefore) { + unsigned(ArgEnd - ArgBegin + 1), InsertBefore) { init(Func, ArgBegin, ArgEnd, NameStr, typename std::iterator_traits::iterator_category()); } From ggreif at gmail.com Wed Jul 7 04:43:45 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 07 Jul 2010 09:43:45 -0000 Subject: [llvm-commits] [llvm] r107766 - /llvm/trunk/include/llvm/Support/CallSite.h Message-ID: <20100707094345.CACB22A6C12C@llvm.org> Author: ggreif Date: Wed Jul 7 04:43:45 2010 New Revision: 107766 URL: http://llvm.org/viewvc/llvm-project?rev=107766&view=rev Log: conditionalize on CallInst::ArgOffset Modified: llvm/trunk/include/llvm/Support/CallSite.h Modified: llvm/trunk/include/llvm/Support/CallSite.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=107766&r1=107765&r2=107766&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CallSite.h (original) +++ llvm/trunk/include/llvm/Support/CallSite.h Wed Jul 7 04:43:45 2010 @@ -256,14 +256,14 @@ /// Returns the operand number of the first argument unsigned getArgumentOffset() const { if (isCall()) - return 1; // Skip Function (ATM) + return CallInst::ArgOffset; // Skip Function (ATM) else return 0; // Args are at the front } unsigned getArgumentEndOffset() const { if (isCall()) - return 0; // Unchanged (ATM) + return CallInst::ArgOffset ? 0 : 1; // Unchanged (ATM) else return 3; // Skip BB, BB, Function } From ggreif at gmail.com Wed Jul 7 05:34:04 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 07 Jul 2010 10:34:04 -0000 Subject: [llvm-commits] [llvm] r107767 - /llvm/trunk/lib/Analysis/ConstantFolding.cpp Message-ID: <20100707103404.1E6B92A6C12C@llvm.org> Author: ggreif Date: Wed Jul 7 05:34:03 2010 New Revision: 107767 URL: http://llvm.org/viewvc/llvm-project?rev=107767&view=rev Log: conditionalize by CallInst::ArgOffset Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=107767&r1=107766&r2=107767&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original) +++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Wed Jul 7 05:34:03 2010 @@ -772,9 +772,9 @@ case Instruction::ICmp: case Instruction::FCmp: assert(0 && "Invalid for compares"); case Instruction::Call: - if (Function *F = dyn_cast(Ops[0])) + if (Function *F = dyn_cast(Ops[CallInst::ArgOffset ? 0:NumOps-1])) if (canConstantFoldCallTo(F)) - return ConstantFoldCall(F, Ops+1, NumOps-1); + return ConstantFoldCall(F, Ops+CallInst::ArgOffset, NumOps-1); return 0; case Instruction::PtrToInt: // If the input is a inttoptr, eliminate the pair. This requires knowing From ggreif at gmail.com Wed Jul 7 08:58:46 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 07 Jul 2010 13:58:46 -0000 Subject: [llvm-commits] [llvm] r107774 - /llvm/trunk/Makefile.config.in Message-ID: <20100707135846.A95FE2A6C12C@llvm.org> Author: ggreif Date: Wed Jul 7 08:58:46 2010 New Revision: 107774 URL: http://llvm.org/viewvc/llvm-project?rev=107774&view=rev Log: typo in comment, regeneration not necessary Modified: llvm/trunk/Makefile.config.in Modified: llvm/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=107774&r1=107773&r2=107774&view=diff ============================================================================== --- llvm/trunk/Makefile.config.in (original) +++ llvm/trunk/Makefile.config.in Wed Jul 7 08:58:46 2010 @@ -222,8 +222,8 @@ # When ENABLE_PROFILING is enabled, profile instrumentation is done # and output is put into the "+Profile" directories, where -# is either Debug or Release depending on how other builkd -# flags are set.. Otherwise, output is put in the +# is either Debug or Release depending on how other build +# flags are set. Otherwise, output is put in the # directories. #ENABLE_PROFILING = 1 @ENABLE_PROFILING@ From gohman at apple.com Wed Jul 7 09:12:29 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 14:12:29 -0000 Subject: [llvm-commits] [llvm] r107775 - in /llvm/trunk: ./ lib/Analysis/ lib/Analysis/IPA/ lib/Archive/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/CompilerDriver/ lib/ExecutionEngine/ lib/ExecutionEngine/Interpreter/ lib/ExecutionEngine/JIT/ lib/Linker/ lib/MC/ lib/MC/MCParser/ lib/Support/ lib/System/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmParser/ lib/Target/ARM/AsmPrinter/ lib/Target/ARM/Disassembler/ lib/Target/ARM/TargetInfo/ lib/Target/A... Message-ID: <20100707141229.CB5392A6C12C@llvm.org> Author: djg Date: Wed Jul 7 09:12:28 2010 New Revision: 107775 URL: http://llvm.org/viewvc/llvm-project?rev=107775&view=rev Log: Add Debug+Asserts and Release+Asserts to svn:ignore properties. Modified: llvm/trunk/ (props changed) llvm/trunk/lib/Analysis/ (props changed) llvm/trunk/lib/Analysis/IPA/ (props changed) llvm/trunk/lib/Archive/ (props changed) llvm/trunk/lib/AsmParser/ (props changed) llvm/trunk/lib/Bitcode/Reader/ (props changed) llvm/trunk/lib/Bitcode/Writer/ (props changed) llvm/trunk/lib/CodeGen/ (props changed) llvm/trunk/lib/CodeGen/AsmPrinter/ (props changed) llvm/trunk/lib/CodeGen/SelectionDAG/ (props changed) llvm/trunk/lib/CompilerDriver/ (props changed) llvm/trunk/lib/ExecutionEngine/ (props changed) llvm/trunk/lib/ExecutionEngine/Interpreter/ (props changed) llvm/trunk/lib/ExecutionEngine/JIT/ (props changed) llvm/trunk/lib/Linker/ (props changed) llvm/trunk/lib/MC/ (props changed) llvm/trunk/lib/MC/MCParser/ (props changed) llvm/trunk/lib/Support/ (props changed) llvm/trunk/lib/System/ (props changed) llvm/trunk/lib/Target/ (props changed) llvm/trunk/lib/Target/ARM/ (props changed) llvm/trunk/lib/Target/ARM/AsmParser/ (props changed) llvm/trunk/lib/Target/ARM/AsmPrinter/ (props changed) llvm/trunk/lib/Target/ARM/Disassembler/ (props changed) llvm/trunk/lib/Target/ARM/TargetInfo/ (props changed) llvm/trunk/lib/Target/Alpha/ (props changed) llvm/trunk/lib/Target/Alpha/AsmPrinter/ (props changed) llvm/trunk/lib/Target/Alpha/TargetInfo/ (props changed) llvm/trunk/lib/Target/Blackfin/ (props changed) llvm/trunk/lib/Target/Blackfin/AsmPrinter/ (props changed) llvm/trunk/lib/Target/Blackfin/TargetInfo/ (props changed) llvm/trunk/lib/Target/CBackend/ (props changed) llvm/trunk/lib/Target/CBackend/TargetInfo/ (props changed) llvm/trunk/lib/Target/CellSPU/ (props changed) llvm/trunk/lib/Target/CellSPU/AsmPrinter/ (props changed) llvm/trunk/lib/Target/CellSPU/TargetInfo/ (props changed) llvm/trunk/lib/Target/CppBackend/ (props changed) llvm/trunk/lib/Target/CppBackend/TargetInfo/ (props changed) llvm/trunk/lib/Target/MBlaze/ (props changed) llvm/trunk/lib/Target/MBlaze/AsmPrinter/ (props changed) llvm/trunk/lib/Target/MBlaze/TargetInfo/ (props changed) llvm/trunk/lib/Target/MSIL/ (props changed) llvm/trunk/lib/Target/MSIL/TargetInfo/ (props changed) llvm/trunk/lib/Target/MSP430/ (props changed) llvm/trunk/lib/Target/MSP430/AsmPrinter/ (props changed) llvm/trunk/lib/Target/MSP430/TargetInfo/ (props changed) llvm/trunk/lib/Target/Mips/ (props changed) llvm/trunk/lib/Target/Mips/AsmPrinter/ (props changed) llvm/trunk/lib/Target/Mips/TargetInfo/ (props changed) llvm/trunk/lib/Target/PIC16/ (props changed) llvm/trunk/lib/Target/PIC16/AsmPrinter/ (props changed) llvm/trunk/lib/Target/PIC16/PIC16Passes/ (props changed) llvm/trunk/lib/Target/PIC16/TargetInfo/ (props changed) llvm/trunk/lib/Target/PowerPC/ (props changed) llvm/trunk/lib/Target/PowerPC/AsmPrinter/ (props changed) llvm/trunk/lib/Target/PowerPC/TargetInfo/ (props changed) llvm/trunk/lib/Target/Sparc/ (props changed) llvm/trunk/lib/Target/Sparc/AsmPrinter/ (props changed) llvm/trunk/lib/Target/Sparc/TargetInfo/ (props changed) llvm/trunk/lib/Target/SystemZ/ (props changed) llvm/trunk/lib/Target/SystemZ/AsmPrinter/ (props changed) llvm/trunk/lib/Target/SystemZ/TargetInfo/ (props changed) llvm/trunk/lib/Target/X86/ (props changed) llvm/trunk/lib/Target/X86/AsmParser/ (props changed) llvm/trunk/lib/Target/X86/AsmPrinter/ (props changed) llvm/trunk/lib/Target/X86/Disassembler/ (props changed) llvm/trunk/lib/Target/X86/TargetInfo/ (props changed) llvm/trunk/lib/Target/XCore/ (props changed) llvm/trunk/lib/Target/XCore/AsmPrinter/ (props changed) llvm/trunk/lib/Target/XCore/TargetInfo/ (props changed) llvm/trunk/lib/Transforms/Hello/ (props changed) llvm/trunk/lib/Transforms/IPO/ (props changed) llvm/trunk/lib/Transforms/InstCombine/ (props changed) llvm/trunk/lib/Transforms/Instrumentation/ (props changed) llvm/trunk/lib/Transforms/Scalar/ (props changed) llvm/trunk/lib/Transforms/Utils/ (props changed) llvm/trunk/lib/VMCore/ (props changed) llvm/trunk/projects/sample/ (props changed) llvm/trunk/projects/sample/lib/sample/ (props changed) llvm/trunk/projects/sample/tools/sample/ (props changed) llvm/trunk/runtime/libprofile/ (props changed) llvm/trunk/tools/bugpoint/ (props changed) llvm/trunk/tools/edis/ (props changed) llvm/trunk/tools/llc/ (props changed) llvm/trunk/tools/lli/ (props changed) llvm/trunk/tools/llvm-ar/ (props changed) llvm/trunk/tools/llvm-as/ (props changed) llvm/trunk/tools/llvm-bcanalyzer/ (props changed) llvm/trunk/tools/llvm-dis/ (props changed) llvm/trunk/tools/llvm-extract/ (props changed) llvm/trunk/tools/llvm-ld/ (props changed) llvm/trunk/tools/llvm-link/ (props changed) llvm/trunk/tools/llvm-mc/ (props changed) llvm/trunk/tools/llvm-nm/ (props changed) llvm/trunk/tools/llvm-prof/ (props changed) llvm/trunk/tools/llvm-ranlib/ (props changed) llvm/trunk/tools/llvm-stub/ (props changed) llvm/trunk/tools/llvmc/driver/ (props changed) llvm/trunk/tools/llvmc/plugins/Base/ (props changed) llvm/trunk/tools/llvmc/plugins/Clang/ (props changed) llvm/trunk/tools/lto/ (props changed) llvm/trunk/tools/opt/ (props changed) llvm/trunk/unittests/ADT/ (props changed) llvm/trunk/unittests/ExecutionEngine/ (props changed) llvm/trunk/unittests/ExecutionEngine/JIT/ (props changed) llvm/trunk/unittests/Support/ (props changed) llvm/trunk/unittests/Transforms/Utils/ (props changed) llvm/trunk/unittests/VMCore/ (props changed) llvm/trunk/utils/FileCheck/ (props changed) llvm/trunk/utils/FileUpdate/ (props changed) llvm/trunk/utils/PerfectShuffle/ (props changed) llvm/trunk/utils/TableGen/ (props changed) llvm/trunk/utils/count/ (props changed) llvm/trunk/utils/fpcmp/ (props changed) llvm/trunk/utils/not/ (props changed) llvm/trunk/utils/unittest/UnitTestMain/ (props changed) llvm/trunk/utils/unittest/googletest/ (props changed) Propchange: llvm/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -20,3 +20,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Analysis/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Analysis/IPA/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Archive/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/AsmParser/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Bitcode/Reader/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Bitcode/Writer/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/CodeGen/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/CodeGen/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/CodeGen/SelectionDAG/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/CompilerDriver/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -1,8 +1,9 @@ Debug Release Release-Asserts - Debug+Coverage-Asserts Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/ExecutionEngine/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/ExecutionEngine/Interpreter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/ExecutionEngine/JIT/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Linker/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/MC/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/MC/MCParser/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Support/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/System/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/ARM/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/ARM/AsmParser/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/ARM/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/ARM/Disassembler/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/ARM/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Alpha/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Alpha/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Alpha/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Blackfin/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -15,3 +15,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Blackfin/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Blackfin/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CBackend/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CBackend/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CellSPU/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CellSPU/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CellSPU/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CppBackend/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/CppBackend/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MBlaze/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MBlaze/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MBlaze/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MSIL/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MSIL/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MSP430/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MSP430/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/MSP430/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Mips/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Mips/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Mips/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PIC16/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PIC16/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PIC16/PIC16Passes/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PIC16/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PowerPC/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PowerPC/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PowerPC/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Sparc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Sparc/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/Sparc/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/SystemZ/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -14,3 +14,5 @@ SystemZGenRegisterInfo.inc SystemZGenRegisterNames.inc SystemZGenSubtarget.inc +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/SystemZ/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/SystemZ/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/X86/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/X86/AsmParser/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/X86/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/X86/Disassembler/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/X86/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/XCore/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/XCore/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/XCore/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Transforms/Hello/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Transforms/IPO/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Transforms/InstCombine/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Transforms/Instrumentation/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Transforms/Scalar/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Transforms/Utils/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/VMCore/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/projects/sample/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -9,3 +9,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/projects/sample/lib/sample/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/projects/sample/tools/sample/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/runtime/libprofile/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/bugpoint/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/edis/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release+Coverage Debug+Checks EDInfo.inc +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/lli/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-ar/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-as/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-bcanalyzer/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-dis/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-extract/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-ld/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-link/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-mc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-nm/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-prof/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-ranlib/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvm-stub/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvmc/driver/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvmc/plugins/Base/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -7,3 +7,5 @@ Release+Coverage Debug+Checks AutoGenerated.inc +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvmc/plugins/Clang/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release+Coverage Debug+Checks AutoGenerated.inc +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/lto/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/opt/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/unittests/ADT/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/unittests/ExecutionEngine/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/unittests/ExecutionEngine/JIT/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/unittests/Support/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/unittests/Transforms/Utils/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Release-Asserts Release+Coverage *Tests +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/unittests/VMCore/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/FileCheck/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/FileUpdate/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/PerfectShuffle/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/TableGen/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/count/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/fpcmp/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/not/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/unittest/UnitTestMain/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -5,3 +5,5 @@ Release Release-Asserts Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/utils/unittest/googletest/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jul 7 09:12:28 2010 @@ -6,3 +6,5 @@ Debug+Coverage Release+Coverage Debug+Checks +Debug+Asserts +Release+Asserts From gohman at apple.com Wed Jul 7 09:27:09 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 14:27:09 -0000 Subject: [llvm-commits] [llvm] r107776 - in /llvm/trunk: docs/AliasAnalysis.html include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/Passes.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/AliasAnalysisEvaluator.cpp lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/args-rets-allocas-loads.ll test/Analysis/BasicAA/interprocedural.ll Message-ID: <20100707142710.04C1E2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 09:27:09 2010 New Revision: 107776 URL: http://llvm.org/viewvc/llvm-project?rev=107776&view=rev Log: Remove interprocedural-basic-aa and associated code. The AliasAnalysis interface needs implementations to be consistent, so any code which wants to support different semantics must use a different interface. It's not currently worthwhile to add a new interface for this new concept. Document that AliasAnalysis doesn't support cross-function queries. Removed: llvm/trunk/test/Analysis/BasicAA/interprocedural.ll Modified: llvm/trunk/docs/AliasAnalysis.html llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/include/llvm/Analysis/Passes.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll Modified: llvm/trunk/docs/AliasAnalysis.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AliasAnalysis.html?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/docs/AliasAnalysis.html (original) +++ llvm/trunk/docs/AliasAnalysis.html Wed Jul 7 09:27:09 2010 @@ -117,6 +117,11 @@ call. The AliasAnalysis interface also exposes some helper methods which allow you to get mod/ref information for arbitrary instructions.

    +

    All AliasAnalysis interfaces require that in queries involving +multiple values, values which are not +constants are all defined within the +same function.

    +
    @@ -181,9 +186,13 @@
    -The alias method is the primary interface used to determine whether or -not two memory objects alias each other. It takes two memory objects as input -and returns MustAlias, MayAlias, or NoAlias as appropriate. +

    The alias method is the primary interface used to determine whether +or not two memory objects alias each other. It takes two memory objects as +input and returns MustAlias, MayAlias, or NoAlias as appropriate.

    + +

    Like all AliasAnalysis interfaces, the alias method requires +that either the two pointer values be defined within the same function, or at +least one of the values is a constant.

    @@ -202,10 +211,8 @@ and reallocation.

    As an exception to this is with the -noalias keyword. AliasAnalysis -implementations may choose to respect the noalias keyword and ignore -the "irrelevant" dependencies, provided their clients do not need to be aware -of these dependencies for correctness.

    +noalias keyword; the "irrelevant" +dependencies are ignored.

    The MayAlias response is used whenever the two pointers might refer to the same object. If the two memory objects overlap, but do not start at the same Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Wed Jul 7 09:27:09 2010 @@ -323,10 +323,10 @@ /// identifiable object. This returns true for: /// Global Variables and Functions (but not Global Aliases) /// Allocas and Mallocs -/// ByVal and NoAlias Arguments, if Interprocedural is false -/// NoAlias returns, if Interprocedural is false +/// ByVal and NoAlias Arguments +/// NoAlias returns /// -bool isIdentifiedObject(const Value *V, bool Interprocedural = false); +bool isIdentifiedObject(const Value *V); } // End llvm namespace Modified: llvm/trunk/include/llvm/Analysis/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Passes.h (original) +++ llvm/trunk/include/llvm/Analysis/Passes.h Wed Jul 7 09:27:09 2010 @@ -53,13 +53,6 @@ //===--------------------------------------------------------------------===// // - // createInterproceduralAAEvalPass - This pass implements a simple - // N^2 interprocedural alias analysis accuracy evaluator. - // - Pass *createInterproceduralAAEvalPass(); - - //===--------------------------------------------------------------------===// - // // createNoAAPass - This pass implements a "I don't know" alias analysis. // ImmutablePass *createNoAAPass(); @@ -67,23 +60,12 @@ //===--------------------------------------------------------------------===// // // createBasicAliasAnalysisPass - This pass implements the default alias - // analysis. This analysis respects the noalias attribute, so it is not - // suitable for some interprocedural uses (see the discussion of noalias - // in AliasAnalysis.html for details). + // analysis. // ImmutablePass *createBasicAliasAnalysisPass(); //===--------------------------------------------------------------------===// // - // createInterproceduralBasicAliasAnalysisPass - This pass is similar to - // baiscaa, except that it properly supports queries to values which live - // in different functions. Unlike the regular BasicAliasAnalysis, this - // implementation does not respect the noalias attribute. - // - ImmutablePass *createInterproceduralBasicAliasAnalysisPass(); - - //===--------------------------------------------------------------------===// - // /// createLibCallAliasAnalysisPass - Create an alias analysis pass that knows /// about the semantics of a set of libcalls specified by LCI. The newly /// constructed pass takes ownership of the pointer that is provided. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Wed Jul 7 09:27:09 2010 @@ -229,20 +229,18 @@ /// identifiable object. This returns true for: /// Global Variables and Functions (but not Global Aliases) /// Allocas and Mallocs -/// ByVal and NoAlias Arguments, if Interprocedural is false -/// NoAlias returns, if Interprocedural is false +/// ByVal and NoAlias Arguments +/// NoAlias returns /// -bool llvm::isIdentifiedObject(const Value *V, bool Interprocedural) { +bool llvm::isIdentifiedObject(const Value *V) { if (isa(V)) return true; if (isa(V) && !isa(V)) return true; - if (!Interprocedural) { - if (isNoAliasCall(V)) - return true; - if (const Argument *A = dyn_cast(V)) - return A->hasNoAliasAttr() || A->hasByValAttr(); - } + if (isNoAliasCall(V)) + return true; + if (const Argument *A = dyn_cast(V)) + return A->hasNoAliasAttr() || A->hasByValAttr(); return false; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Wed Jul 7 09:27:09 2010 @@ -21,7 +21,6 @@ #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" -#include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -45,21 +44,20 @@ static cl::opt PrintModRef("print-modref", cl::ReallyHidden); namespace { - /// AAEval - Base class for exhaustive alias analysis evaluators. - class AAEval { - protected: + class AAEval : public FunctionPass { unsigned NoAlias, MayAlias, MustAlias; unsigned NoModRef, Mod, Ref, ModRef; - SetVector Pointers; - SetVector CallSites; + public: + static char ID; // Pass identification, replacement for typeid + AAEval() : FunctionPass(&ID) {} - void getAnalysisUsage(AnalysisUsage &AU) const { + virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.setPreservesAll(); } - void doInitialization(Module &M) { + bool doInitialization(Module &M) { NoAlias = MayAlias = MustAlias = 0; NoModRef = Mod = Ref = ModRef = 0; @@ -67,85 +65,19 @@ PrintNoAlias = PrintMayAlias = PrintMustAlias = true; PrintNoModRef = PrintMod = PrintRef = PrintModRef = true; } - } - - void runOnFunction(Function &F); - void evaluate(AliasAnalysis *AA, Module *M); - void doFinalization(Module &M); - }; - - class FunctionAAEval : public FunctionPass, AAEval { - public: - static char ID; // Pass identification, replacement for typeid - FunctionAAEval() : FunctionPass(&ID) {} - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - return AAEval::getAnalysisUsage(AU); - } - - virtual bool doInitialization(Module &M) { - AAEval::doInitialization(M); - return false; - } - - virtual bool runOnFunction(Function &F) { - AAEval::runOnFunction(F); - - if (PrintNoAlias || PrintMayAlias || PrintMustAlias || - PrintNoModRef || PrintMod || PrintRef || PrintModRef) - errs() << "Function: " << F.getName() << ": " << Pointers.size() - << " pointers, " << CallSites.size() << " call sites\n"; - - AAEval::evaluate(&getAnalysis(), F.getParent()); - return false; - } - - virtual bool doFinalization(Module &M) { - AAEval::doFinalization(M); return false; } - }; - - class InterproceduralAAEval : public ModulePass, AAEval { - public: - static char ID; // Pass identification, replacement for typeid - InterproceduralAAEval() : ModulePass(&ID) {} - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - return AAEval::getAnalysisUsage(AU); - } - - virtual bool runOnModule(Module &M) { - AAEval::doInitialization(M); - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - AAEval::runOnFunction(*I); - - if (PrintNoAlias || PrintMayAlias || PrintMustAlias || - PrintNoModRef || PrintMod || PrintRef || PrintModRef) - errs() << "Module: " << Pointers.size() - << " pointers, " << CallSites.size() << " call sites\n"; - AAEval::evaluate(&getAnalysis(), &M); - AAEval::doFinalization(M); - return false; - } + bool runOnFunction(Function &F); + bool doFinalization(Module &M); }; } -char FunctionAAEval::ID = 0; -static RegisterPass +char AAEval::ID = 0; +static RegisterPass X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true); -FunctionPass *llvm::createAAEvalPass() { return new FunctionAAEval(); } - -char InterproceduralAAEval::ID = 0; -static RegisterPass -Y("interprocedural-aa-eval", - "Exhaustive Interprocedural Alias Analysis Precision Evaluator", false, true); - -Pass *llvm::createInterproceduralAAEvalPass() { - return new InterproceduralAAEval(); -} +FunctionPass *llvm::createAAEvalPass() { return new AAEval(); } static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2, const Module *M) { @@ -180,7 +112,12 @@ && !isa(V); } -void AAEval::runOnFunction(Function &F) { +bool AAEval::runOnFunction(Function &F) { + AliasAnalysis &AA = getAnalysis(); + + SetVector Pointers; + SetVector CallSites; + for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) if (I->getType()->isPointerTy()) // Add all pointer arguments. Pointers.insert(I); @@ -210,31 +147,33 @@ if (CS.getInstruction()) CallSites.insert(CS); } -} -void AAEval::evaluate(AliasAnalysis *AA, Module *M) { + if (PrintNoAlias || PrintMayAlias || PrintMustAlias || + PrintNoModRef || PrintMod || PrintRef || PrintModRef) + errs() << "Function: " << F.getName() << ": " << Pointers.size() + << " pointers, " << CallSites.size() << " call sites\n"; // iterate over the worklist, and run the full (n^2)/2 disambiguations for (SetVector::iterator I1 = Pointers.begin(), E = Pointers.end(); I1 != E; ++I1) { unsigned I1Size = ~0u; const Type *I1ElTy = cast((*I1)->getType())->getElementType(); - if (I1ElTy->isSized()) I1Size = AA->getTypeStoreSize(I1ElTy); + if (I1ElTy->isSized()) I1Size = AA.getTypeStoreSize(I1ElTy); for (SetVector::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { unsigned I2Size = ~0u; const Type *I2ElTy =cast((*I2)->getType())->getElementType(); - if (I2ElTy->isSized()) I2Size = AA->getTypeStoreSize(I2ElTy); + if (I2ElTy->isSized()) I2Size = AA.getTypeStoreSize(I2ElTy); - switch (AA->alias(*I1, I1Size, *I2, I2Size)) { + switch (AA.alias(*I1, I1Size, *I2, I2Size)) { case AliasAnalysis::NoAlias: - PrintResults("NoAlias", PrintNoAlias, *I1, *I2, M); + PrintResults("NoAlias", PrintNoAlias, *I1, *I2, F.getParent()); ++NoAlias; break; case AliasAnalysis::MayAlias: - PrintResults("MayAlias", PrintMayAlias, *I1, *I2, M); + PrintResults("MayAlias", PrintMayAlias, *I1, *I2, F.getParent()); ++MayAlias; break; case AliasAnalysis::MustAlias: - PrintResults("MustAlias", PrintMustAlias, *I1, *I2, M); + PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent()); ++MustAlias; break; default: errs() << "Unknown alias query result!\n"; @@ -251,20 +190,20 @@ V != Ve; ++V) { unsigned Size = ~0u; const Type *ElTy = cast((*V)->getType())->getElementType(); - if (ElTy->isSized()) Size = AA->getTypeStoreSize(ElTy); + if (ElTy->isSized()) Size = AA.getTypeStoreSize(ElTy); - switch (AA->getModRefInfo(*C, *V, Size)) { + switch (AA.getModRefInfo(*C, *V, Size)) { case AliasAnalysis::NoModRef: - PrintModRefResults("NoModRef", PrintNoModRef, I, *V, M); + PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent()); ++NoModRef; break; case AliasAnalysis::Mod: - PrintModRefResults(" Mod", PrintMod, I, *V, M); + PrintModRefResults(" Mod", PrintMod, I, *V, F.getParent()); ++Mod; break; case AliasAnalysis::Ref: - PrintModRefResults(" Ref", PrintRef, I, *V, M); + PrintModRefResults(" Ref", PrintRef, I, *V, F.getParent()); ++Ref; break; case AliasAnalysis::ModRef: - PrintModRefResults(" ModRef", PrintModRef, I, *V, M); + PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent()); ++ModRef; break; default: errs() << "Unknown alias query result!\n"; @@ -272,8 +211,7 @@ } } - Pointers.clear(); - CallSites.clear(); + return false; } static void PrintPercent(unsigned Num, unsigned Sum) { @@ -281,7 +219,7 @@ << ((Num*1000ULL/Sum) % 10) << "%)\n"; } -void AAEval::doFinalization(Module &M) { +bool AAEval::doFinalization(Module &M) { unsigned AliasSum = NoAlias + MayAlias + MustAlias; errs() << "===== Alias Analysis Evaluator Report =====\n"; if (AliasSum == 0) { @@ -317,4 +255,6 @@ << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/" << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n"; } + + return false; } Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Jul 7 09:27:09 2010 @@ -194,6 +194,7 @@ // BasicAliasAnalysis Pass //===----------------------------------------------------------------------===// +#ifndef NDEBUG static const Function *getParent(const Value *V) { if (const Instruction *inst = dyn_cast(V)) return inst->getParent()->getParent(); @@ -204,15 +205,6 @@ return NULL; } -static bool sameParent(const Value *O1, const Value *O2) { - - const Function *F1 = getParent(O1); - const Function *F2 = getParent(O2); - - return F1 && F1 == F2; -} - -#ifdef XDEBUG static bool notDifferentParent(const Value *O1, const Value *O2) { const Function *F1 = getParent(O1); @@ -227,25 +219,14 @@ /// Because it doesn't chain to a previous alias analysis (like -no-aa), it /// derives from the NoAA class. struct BasicAliasAnalysis : public NoAA { - /// Interprocedural - Flag for "interprocedural" mode, where we must - /// support queries of values which live in different functions. - bool Interprocedural; - static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() - : NoAA(&ID), Interprocedural(false) {} - BasicAliasAnalysis(void *PID, bool interprocedural) - : NoAA(PID), Interprocedural(interprocedural) {} + BasicAliasAnalysis() : NoAA(&ID) {} AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { assert(Visited.empty() && "Visited must be cleared after use!"); -#ifdef XDEBUG - assert((Interprocedural || notDifferentParent(V1, V2)) && - "BasicAliasAnalysis (-basicaa) doesn't support interprocedural " - "queries; use InterproceduralAliasAnalysis " - "(-interprocedural-basic-aa) instead."); -#endif + assert(notDifferentParent(V1, V2) && + "BasicAliasAnalysis doesn't support interprocedural queries."); AliasResult Alias = aliasCheck(V1, V1Size, V2, V2Size); Visited.clear(); return Alias; @@ -324,6 +305,9 @@ /// simple "address taken" analysis on local objects. AliasAnalysis::ModRefResult BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { + assert(notDifferentParent(CS.getInstruction(), P) && + "AliasAnalysis query involving multiple functions!"); + const Value *Object = P->getUnderlyingObject(); // If this is a tail call and P points to a stack location, we know that @@ -336,16 +320,10 @@ if (CI->isTailCall()) return NoModRef; - // If we can identify an object and it's known to be within the - // same function as the call, we can ignore interprocedural concerns. - bool EffectivelyInterprocedural = - Interprocedural && !sameParent(Object, CS.getInstruction()); - // If the pointer is to a locally allocated object that does not escape, // then the call can not mod/ref the pointer unless the call takes the pointer // as an argument, and itself doesn't capture it. if (!isa(Object) && CS.getInstruction() != Object && - !EffectivelyInterprocedural && isNonEscapingLocalObject(Object)) { bool PassedAsArg = false; unsigned ArgNo = 0; @@ -765,36 +743,25 @@ if (CPN->getType()->getAddressSpace() == 0) return NoAlias; - // If we can identify two objects and they're known to be within the - // same function, we can ignore interprocedural concerns. - bool EffectivelyInterprocedural = - Interprocedural && !sameParent(O1, O2); - if (O1 != O2) { // If V1/V2 point to two different objects we know that we have no alias. - if (isIdentifiedObject(O1, EffectivelyInterprocedural) && - isIdentifiedObject(O2, EffectivelyInterprocedural)) + if (isIdentifiedObject(O1) && isIdentifiedObject(O2)) return NoAlias; // Constant pointers can't alias with non-const isIdentifiedObject objects. - if ((isa(O1) && - isIdentifiedObject(O2, EffectivelyInterprocedural) && - !isa(O2)) || - (isa(O2) && - isIdentifiedObject(O1, EffectivelyInterprocedural) && - !isa(O1))) + if ((isa(O1) && isIdentifiedObject(O2) && !isa(O2)) || + (isa(O2) && isIdentifiedObject(O1) && !isa(O1))) return NoAlias; // Arguments can't alias with local allocations or noalias calls // in the same function. - if (!EffectivelyInterprocedural && - ((isa(O1) && (isa(O2) || isNoAliasCall(O2))) || + if (((isa(O1) && (isa(O2) || isNoAliasCall(O2))) || (isa(O2) && (isa(O1) || isNoAliasCall(O1))))) return NoAlias; // Most objects can't alias null. - if ((isa(V2) && isKnownNonNull(O1)) || - (isa(V1) && isKnownNonNull(O2))) + if ((isa(O2) && isKnownNonNull(O1)) || + (isa(O1) && isKnownNonNull(O2))) return NoAlias; } @@ -814,7 +781,7 @@ // temporary store the nocapture argument's value in a temporary memory // location if that memory location doesn't escape. Or it may pass a // nocapture value to other functions as long as they don't capture it. - if (O1 != O2 && !EffectivelyInterprocedural) { + if (O1 != O2) { if (isEscapeSource(O1) && isNonEscapingLocalObject(O2)) return NoAlias; if (isEscapeSource(O2) && isNonEscapingLocalObject(O1)) @@ -850,33 +817,3 @@ // Make sure that anything that uses AliasAnalysis pulls in this file. DEFINING_FILE_FOR(BasicAliasAnalysis) - -//===----------------------------------------------------------------------===// -// InterproceduralBasicAliasAnalysis Pass -//===----------------------------------------------------------------------===// - -namespace { - /// InterproceduralBasicAliasAnalysis - This is similar to basicaa, except - /// that it properly supports queries to values which live in different - /// functions. - /// - /// Note that we don't currently take this to the extreme, analyzing all - /// call sites of a function to answer a query about an Argument. - /// - struct InterproceduralBasicAliasAnalysis : public BasicAliasAnalysis { - static char ID; // Class identification, replacement for typeinfo - InterproceduralBasicAliasAnalysis() : BasicAliasAnalysis(&ID, true) {} - }; -} - -// Register this pass... -char InterproceduralBasicAliasAnalysis::ID = 0; -static RegisterPass -W("interprocedural-basic-aa", "Interprocedural Basic Alias Analysis", false, true); - -// Declare that we implement the AliasAnalysis interface -static RegisterAnalysisGroup Z(W); - -ImmutablePass *llvm::createInterproceduralBasicAliasAnalysisPass() { - return new InterproceduralBasicAliasAnalysis(); -} Modified: llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll?rev=107776&r1=107775&r2=107776&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll Wed Jul 7 09:27:09 2010 @@ -1,5 +1,4 @@ -; RUN: opt -interprocedural-basic-aa -interprocedural-aa-eval -print-all-alias-modref-info -disable-output < %s |& FileCheck --check-prefix=IPAA %s -; RUN: opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output < %s |& FileCheck --check-prefix=FUNCAA %s +; RUN: opt -aa-eval -print-all-alias-modref-info -disable-output < %s |& FileCheck %s declare void @callee(double* %callee_arg) declare void @nocap_callee(double* nocapture %nocap_callee_arg) @@ -48,1675 +47,264 @@ ret void } -; caller_b is the same as caller_a but with different names, to test -; interprocedural queries. -define void @caller_b(double* %arg_b0, - double* %arg_b1, - double* noalias %noalias_arg_b0, - double* noalias %noalias_arg_b1, - double** %indirect_b0, - double** %indirect_b1) { - %loaded_b0 = load double** %indirect_b0 - %loaded_b1 = load double** %indirect_b1 - - %escape_alloca_b0 = alloca double - %escape_alloca_b1 = alloca double - %noescape_alloca_b0 = alloca double - %noescape_alloca_b1 = alloca double - - %normal_ret_b0 = call double* @normal_returner() - %normal_ret_b1 = call double* @normal_returner() - %noalias_ret_b0 = call double* @noalias_returner() - %noalias_ret_b1 = call double* @noalias_returner() - - call void @callee(double* %escape_alloca_b0) - call void @callee(double* %escape_alloca_b1) - call void @nocap_callee(double* %noescape_alloca_b0) - call void @nocap_callee(double* %noescape_alloca_b1) - - store double 0.0, double* %loaded_b0 - store double 0.0, double* %loaded_b1 - store double 0.0, double* %arg_b0 - store double 0.0, double* %arg_b1 - store double 0.0, double* %noalias_arg_b0 - store double 0.0, double* %noalias_arg_b1 - store double 0.0, double* %escape_alloca_b0 - store double 0.0, double* %escape_alloca_b1 - store double 0.0, double* %noescape_alloca_b0 - store double 0.0, double* %noescape_alloca_b1 - store double 0.0, double* %normal_ret_b0 - store double 0.0, double* %normal_ret_b1 - store double 0.0, double* %noalias_ret_b0 - store double 0.0, double* %noalias_ret_b1 - ret void -} - -; FUNCAA: Function: caller_a: 16 pointers, 8 call sites -; FUNCAA: MayAlias: double* %arg_a0, double* %arg_a1 -; FUNCAA: NoAlias: double* %arg_a0, double* %noalias_arg_a0 -; FUNCAA: NoAlias: double* %arg_a1, double* %noalias_arg_a0 -; FUNCAA: NoAlias: double* %arg_a0, double* %noalias_arg_a1 -; FUNCAA: NoAlias: double* %arg_a1, double* %noalias_arg_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %noalias_arg_a1 -; FUNCAA: MayAlias: double* %arg_a0, double** %indirect_a0 -; FUNCAA: MayAlias: double* %arg_a1, double** %indirect_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double** %indirect_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double** %indirect_a0 -; FUNCAA: MayAlias: double* %arg_a0, double** %indirect_a1 -; FUNCAA: MayAlias: double* %arg_a1, double** %indirect_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double** %indirect_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double** %indirect_a1 -; FUNCAA: MayAlias: double** %indirect_a0, double** %indirect_a1 -; FUNCAA: MayAlias: double* %arg_a0, double* %loaded_a0 -; FUNCAA: MayAlias: double* %arg_a1, double* %loaded_a0 -; FUNCAA: NoAlias: double* %loaded_a0, double* %noalias_arg_a0 -; FUNCAA: NoAlias: double* %loaded_a0, double* %noalias_arg_a1 -; FUNCAA: MayAlias: double* %loaded_a0, double** %indirect_a0 -; FUNCAA: MayAlias: double* %loaded_a0, double** %indirect_a1 -; FUNCAA: MayAlias: double* %arg_a0, double* %loaded_a1 -; FUNCAA: MayAlias: double* %arg_a1, double* %loaded_a1 -; FUNCAA: NoAlias: double* %loaded_a1, double* %noalias_arg_a0 -; FUNCAA: NoAlias: double* %loaded_a1, double* %noalias_arg_a1 -; FUNCAA: MayAlias: double* %loaded_a1, double** %indirect_a0 -; FUNCAA: MayAlias: double* %loaded_a1, double** %indirect_a1 -; FUNCAA: MayAlias: double* %loaded_a0, double* %loaded_a1 -; FUNCAA: NoAlias: double* %arg_a0, double* %escape_alloca_a0 -; FUNCAA: NoAlias: double* %arg_a1, double* %escape_alloca_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %noalias_arg_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %noalias_arg_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double** %indirect_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double** %indirect_a1 -; FUNCAA: MayAlias: double* %escape_alloca_a0, double* %loaded_a0 -; FUNCAA: MayAlias: double* %escape_alloca_a0, double* %loaded_a1 -; FUNCAA: NoAlias: double* %arg_a0, double* %escape_alloca_a1 -; FUNCAA: NoAlias: double* %arg_a1, double* %escape_alloca_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double* %noalias_arg_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double* %noalias_arg_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double** %indirect_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double** %indirect_a1 -; FUNCAA: MayAlias: double* %escape_alloca_a1, double* %loaded_a0 -; FUNCAA: MayAlias: double* %escape_alloca_a1, double* %loaded_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %escape_alloca_a1 -; FUNCAA: NoAlias: double* %arg_a0, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %arg_a1, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %noescape_alloca_a0, double** %indirect_a0 -; FUNCAA: NoAlias: double* %noescape_alloca_a0, double** %indirect_a1 -; FUNCAA: NoAlias: double* %loaded_a0, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %loaded_a1, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %arg_a0, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %arg_a1, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %noescape_alloca_a1, double** %indirect_a0 -; FUNCAA: NoAlias: double* %noescape_alloca_a1, double** %indirect_a1 -; FUNCAA: NoAlias: double* %loaded_a0, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %loaded_a1, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %noescape_alloca_a0, double* %noescape_alloca_a1 -; FUNCAA: MayAlias: double* %arg_a0, double* %normal_ret_a0 -; FUNCAA: MayAlias: double* %arg_a1, double* %normal_ret_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %normal_ret_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double* %normal_ret_a0 -; FUNCAA: MayAlias: double* %normal_ret_a0, double** %indirect_a0 -; FUNCAA: MayAlias: double* %normal_ret_a0, double** %indirect_a1 -; FUNCAA: MayAlias: double* %loaded_a0, double* %normal_ret_a0 -; FUNCAA: MayAlias: double* %loaded_a1, double* %normal_ret_a0 -; FUNCAA: MayAlias: double* %escape_alloca_a0, double* %normal_ret_a0 -; FUNCAA: MayAlias: double* %escape_alloca_a1, double* %normal_ret_a0 -; FUNCAA: NoAlias: double* %noescape_alloca_a0, double* %normal_ret_a0 -; FUNCAA: NoAlias: double* %noescape_alloca_a1, double* %normal_ret_a0 -; FUNCAA: MayAlias: double* %arg_a0, double* %normal_ret_a1 -; FUNCAA: MayAlias: double* %arg_a1, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double* %normal_ret_a1 -; FUNCAA: MayAlias: double* %normal_ret_a1, double** %indirect_a0 -; FUNCAA: MayAlias: double* %normal_ret_a1, double** %indirect_a1 -; FUNCAA: MayAlias: double* %loaded_a0, double* %normal_ret_a1 -; FUNCAA: MayAlias: double* %loaded_a1, double* %normal_ret_a1 -; FUNCAA: MayAlias: double* %escape_alloca_a0, double* %normal_ret_a1 -; FUNCAA: MayAlias: double* %escape_alloca_a1, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %noescape_alloca_a0, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %noescape_alloca_a1, double* %normal_ret_a1 -; FUNCAA: MayAlias: double* %normal_ret_a0, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %arg_a0, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %arg_a1, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double** %indirect_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double** %indirect_a1 -; FUNCAA: NoAlias: double* %loaded_a0, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %loaded_a1, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double* %noalias_ret_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double* %normal_ret_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %arg_a0, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %arg_a1, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a0, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %noalias_arg_a1, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %noalias_ret_a1, double** %indirect_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a1, double** %indirect_a1 -; FUNCAA: NoAlias: double* %loaded_a0, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %loaded_a1, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a0, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %escape_alloca_a1, double* %noalias_ret_a1 -; FUNCAA: NoAlias: double* %noalias_ret_a1, double* %noescape_alloca_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a1, double* %noescape_alloca_a1 -; FUNCAA: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a0 -; FUNCAA: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a1 -; FUNCAA: NoAlias: double* %noalias_ret_a0, double* %noalias_ret_a1 -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; FUNCAA: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; FUNCAA: Function: caller_b: 16 pointers, 8 call sites -; FUNCAA: MayAlias: double* %arg_b0, double* %arg_b1 -; FUNCAA: NoAlias: double* %arg_b0, double* %noalias_arg_b0 -; FUNCAA: NoAlias: double* %arg_b1, double* %noalias_arg_b0 -; FUNCAA: NoAlias: double* %arg_b0, double* %noalias_arg_b1 -; FUNCAA: NoAlias: double* %arg_b1, double* %noalias_arg_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %noalias_arg_b1 -; FUNCAA: MayAlias: double* %arg_b0, double** %indirect_b0 -; FUNCAA: MayAlias: double* %arg_b1, double** %indirect_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double** %indirect_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double** %indirect_b0 -; FUNCAA: MayAlias: double* %arg_b0, double** %indirect_b1 -; FUNCAA: MayAlias: double* %arg_b1, double** %indirect_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double** %indirect_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double** %indirect_b1 -; FUNCAA: MayAlias: double** %indirect_b0, double** %indirect_b1 -; FUNCAA: MayAlias: double* %arg_b0, double* %loaded_b0 -; FUNCAA: MayAlias: double* %arg_b1, double* %loaded_b0 -; FUNCAA: NoAlias: double* %loaded_b0, double* %noalias_arg_b0 -; FUNCAA: NoAlias: double* %loaded_b0, double* %noalias_arg_b1 -; FUNCAA: MayAlias: double* %loaded_b0, double** %indirect_b0 -; FUNCAA: MayAlias: double* %loaded_b0, double** %indirect_b1 -; FUNCAA: MayAlias: double* %arg_b0, double* %loaded_b1 -; FUNCAA: MayAlias: double* %arg_b1, double* %loaded_b1 -; FUNCAA: NoAlias: double* %loaded_b1, double* %noalias_arg_b0 -; FUNCAA: NoAlias: double* %loaded_b1, double* %noalias_arg_b1 -; FUNCAA: MayAlias: double* %loaded_b1, double** %indirect_b0 -; FUNCAA: MayAlias: double* %loaded_b1, double** %indirect_b1 -; FUNCAA: MayAlias: double* %loaded_b0, double* %loaded_b1 -; FUNCAA: NoAlias: double* %arg_b0, double* %escape_alloca_b0 -; FUNCAA: NoAlias: double* %arg_b1, double* %escape_alloca_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %noalias_arg_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %noalias_arg_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double** %indirect_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double** %indirect_b1 -; FUNCAA: MayAlias: double* %escape_alloca_b0, double* %loaded_b0 -; FUNCAA: MayAlias: double* %escape_alloca_b0, double* %loaded_b1 -; FUNCAA: NoAlias: double* %arg_b0, double* %escape_alloca_b1 -; FUNCAA: NoAlias: double* %arg_b1, double* %escape_alloca_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double* %noalias_arg_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double* %noalias_arg_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double** %indirect_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double** %indirect_b1 -; FUNCAA: MayAlias: double* %escape_alloca_b1, double* %loaded_b0 -; FUNCAA: MayAlias: double* %escape_alloca_b1, double* %loaded_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %escape_alloca_b1 -; FUNCAA: NoAlias: double* %arg_b0, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %arg_b1, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %noescape_alloca_b0, double** %indirect_b0 -; FUNCAA: NoAlias: double* %noescape_alloca_b0, double** %indirect_b1 -; FUNCAA: NoAlias: double* %loaded_b0, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %loaded_b1, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %arg_b0, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %arg_b1, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %noescape_alloca_b1, double** %indirect_b0 -; FUNCAA: NoAlias: double* %noescape_alloca_b1, double** %indirect_b1 -; FUNCAA: NoAlias: double* %loaded_b0, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %loaded_b1, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %noescape_alloca_b0, double* %noescape_alloca_b1 -; FUNCAA: MayAlias: double* %arg_b0, double* %normal_ret_b0 -; FUNCAA: MayAlias: double* %arg_b1, double* %normal_ret_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %normal_ret_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double* %normal_ret_b0 -; FUNCAA: MayAlias: double* %normal_ret_b0, double** %indirect_b0 -; FUNCAA: MayAlias: double* %normal_ret_b0, double** %indirect_b1 -; FUNCAA: MayAlias: double* %loaded_b0, double* %normal_ret_b0 -; FUNCAA: MayAlias: double* %loaded_b1, double* %normal_ret_b0 -; FUNCAA: MayAlias: double* %escape_alloca_b0, double* %normal_ret_b0 -; FUNCAA: MayAlias: double* %escape_alloca_b1, double* %normal_ret_b0 -; FUNCAA: NoAlias: double* %noescape_alloca_b0, double* %normal_ret_b0 -; FUNCAA: NoAlias: double* %noescape_alloca_b1, double* %normal_ret_b0 -; FUNCAA: MayAlias: double* %arg_b0, double* %normal_ret_b1 -; FUNCAA: MayAlias: double* %arg_b1, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double* %normal_ret_b1 -; FUNCAA: MayAlias: double* %normal_ret_b1, double** %indirect_b0 -; FUNCAA: MayAlias: double* %normal_ret_b1, double** %indirect_b1 -; FUNCAA: MayAlias: double* %loaded_b0, double* %normal_ret_b1 -; FUNCAA: MayAlias: double* %loaded_b1, double* %normal_ret_b1 -; FUNCAA: MayAlias: double* %escape_alloca_b0, double* %normal_ret_b1 -; FUNCAA: MayAlias: double* %escape_alloca_b1, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %noescape_alloca_b0, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %noescape_alloca_b1, double* %normal_ret_b1 -; FUNCAA: MayAlias: double* %normal_ret_b0, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %arg_b0, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %arg_b1, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double** %indirect_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double** %indirect_b1 -; FUNCAA: NoAlias: double* %loaded_b0, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %loaded_b1, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double* %noalias_ret_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double* %normal_ret_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %arg_b0, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %arg_b1, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b0, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %noalias_arg_b1, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %noalias_ret_b1, double** %indirect_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b1, double** %indirect_b1 -; FUNCAA: NoAlias: double* %loaded_b0, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %loaded_b1, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b0, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %escape_alloca_b1, double* %noalias_ret_b1 -; FUNCAA: NoAlias: double* %noalias_ret_b1, double* %noescape_alloca_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b1, double* %noescape_alloca_b1 -; FUNCAA: NoAlias: double* %noalias_ret_b1, double* %normal_ret_b0 -; FUNCAA: NoAlias: double* %noalias_ret_b1, double* %normal_ret_b1 -; FUNCAA: NoAlias: double* %noalias_ret_b0, double* %noalias_ret_b1 -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %noalias_ret_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %noalias_ret_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @callee(double* %escape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @callee(double* %escape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; FUNCAA: ModRef: Ptr: double* %arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double** %indirect_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double** %indirect_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %loaded_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %loaded_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; FUNCAA: ===== Alias Analysis Evaluator Report ===== -; FUNCAA: 240 Total Alias Queries Performed -; FUNCAA: 168 no alias responses (70.0%) -; FUNCAA: 72 may alias responses (30.0%) -; FUNCAA: 0 must alias responses (0.0%) -; FUNCAA: Alias Analysis Evaluator Pointer Alias Summary: 70%/30%/0% -; FUNCAA: 256 Total ModRef Queries Performed -; FUNCAA: 88 no mod/ref responses (34.3%) -; FUNCAA: 0 mod responses (0.0%) -; FUNCAA: 0 ref responses (0.0%) -; FUNCAA: 168 mod & ref responses (65.6%) -; FUNCAA: Alias Analysis Evaluator Mod/Ref Summary: 34%/0%/0%/65% - -; IPAA: Module: 34 pointers, 16 call sites -; IPAA: MayAlias: double* %callee_arg, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a1, double* %callee_arg -; IPAA: MayAlias: double* %arg_a1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %arg_a1 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %nocap_callee_arg -; IPAA: NoAlias: double* %arg_a0, double* %noalias_arg_a0 -; IPAA: NoAlias: double* %arg_a1, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %nocap_callee_arg -; IPAA: NoAlias: double* %arg_a0, double* %noalias_arg_a1 -; IPAA: NoAlias: double* %arg_a1, double* %noalias_arg_a1 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %callee_arg, double** %indirect_a0 -; IPAA: MayAlias: double* %nocap_callee_arg, double** %indirect_a0 -; IPAA: MayAlias: double* %arg_a0, double** %indirect_a0 -; IPAA: MayAlias: double* %arg_a1, double** %indirect_a0 -; IPAA: NoAlias: double* %noalias_arg_a0, double** %indirect_a0 -; IPAA: NoAlias: double* %noalias_arg_a1, double** %indirect_a0 -; IPAA: MayAlias: double* %callee_arg, double** %indirect_a1 -; IPAA: MayAlias: double* %nocap_callee_arg, double** %indirect_a1 -; IPAA: MayAlias: double* %arg_a0, double** %indirect_a1 -; IPAA: MayAlias: double* %arg_a1, double** %indirect_a1 -; IPAA: NoAlias: double* %noalias_arg_a0, double** %indirect_a1 -; IPAA: NoAlias: double* %noalias_arg_a1, double** %indirect_a1 -; IPAA: MayAlias: double** %indirect_a0, double** %indirect_a1 -; IPAA: MayAlias: double* %callee_arg, double* %loaded_a0 -; IPAA: MayAlias: double* %loaded_a0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %loaded_a0 -; IPAA: MayAlias: double* %arg_a1, double* %loaded_a0 -; IPAA: NoAlias: double* %loaded_a0, double* %noalias_arg_a0 -; IPAA: NoAlias: double* %loaded_a0, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %loaded_a0, double** %indirect_a0 -; IPAA: MayAlias: double* %loaded_a0, double** %indirect_a1 -; IPAA: MayAlias: double* %callee_arg, double* %loaded_a1 -; IPAA: MayAlias: double* %loaded_a1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %loaded_a1 -; IPAA: MayAlias: double* %arg_a1, double* %loaded_a1 -; IPAA: NoAlias: double* %loaded_a1, double* %noalias_arg_a0 -; IPAA: NoAlias: double* %loaded_a1, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %loaded_a1, double** %indirect_a0 -; IPAA: MayAlias: double* %loaded_a1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %loaded_a1 -; IPAA: MayAlias: double* %callee_arg, double* %escape_alloca_a0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %nocap_callee_arg -; IPAA: NoAlias: double* %arg_a0, double* %escape_alloca_a0 -; IPAA: NoAlias: double* %arg_a1, double* %escape_alloca_a0 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noalias_arg_a0 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noalias_arg_a1 -; IPAA: NoAlias: double* %escape_alloca_a0, double** %indirect_a0 -; IPAA: NoAlias: double* %escape_alloca_a0, double** %indirect_a1 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %loaded_a0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %loaded_a1 -; IPAA: MayAlias: double* %callee_arg, double* %escape_alloca_a1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %nocap_callee_arg -; IPAA: NoAlias: double* %arg_a0, double* %escape_alloca_a1 -; IPAA: NoAlias: double* %arg_a1, double* %escape_alloca_a1 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noalias_arg_a0 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noalias_arg_a1 -; IPAA: NoAlias: double* %escape_alloca_a1, double** %indirect_a0 -; IPAA: NoAlias: double* %escape_alloca_a1, double** %indirect_a1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %loaded_a0 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %loaded_a1 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %escape_alloca_a1 -; IPAA: MayAlias: double* %callee_arg, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %arg_a0, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %arg_a1, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %noalias_arg_a1, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %noescape_alloca_a0, double** %indirect_a0 -; IPAA: NoAlias: double* %noescape_alloca_a0, double** %indirect_a1 -; IPAA: NoAlias: double* %loaded_a0, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %loaded_a1, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %callee_arg, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %arg_a0, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %arg_a1, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %noalias_arg_a1, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %noescape_alloca_a1, double** %indirect_a0 -; IPAA: NoAlias: double* %noescape_alloca_a1, double** %indirect_a1 -; IPAA: NoAlias: double* %loaded_a0, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %loaded_a1, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %noescape_alloca_a0, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %callee_arg, double* %normal_ret_a0 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %normal_ret_a0 -; IPAA: MayAlias: double* %arg_a0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %arg_a1, double* %normal_ret_a0 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %normal_ret_a0 -; IPAA: NoAlias: double* %noalias_arg_a1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %normal_ret_a0, double** %indirect_a0 -; IPAA: MayAlias: double* %normal_ret_a0, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %loaded_a1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %normal_ret_a0 -; IPAA: NoAlias: double* %noescape_alloca_a0, double* %normal_ret_a0 -; IPAA: NoAlias: double* %noescape_alloca_a1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %callee_arg, double* %normal_ret_a1 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %normal_ret_a1 -; IPAA: MayAlias: double* %arg_a0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %arg_a1, double* %normal_ret_a1 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %normal_ret_a1 -; IPAA: NoAlias: double* %noalias_arg_a1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %normal_ret_a1, double** %indirect_a0 -; IPAA: MayAlias: double* %normal_ret_a1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %loaded_a1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %normal_ret_a1 -; IPAA: NoAlias: double* %noescape_alloca_a0, double* %normal_ret_a1 -; IPAA: NoAlias: double* %noescape_alloca_a1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %normal_ret_a0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %nocap_callee_arg -; IPAA: NoAlias: double* %arg_a0, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %arg_a1, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %noalias_arg_a1, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %noalias_ret_a0, double** %indirect_a0 -; IPAA: NoAlias: double* %noalias_ret_a0, double** %indirect_a1 -; IPAA: NoAlias: double* %loaded_a0, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %loaded_a1, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noalias_ret_a0 -; IPAA: NoAlias: double* %noalias_ret_a0, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %noalias_ret_a0, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %noalias_ret_a0, double* %normal_ret_a0 -; IPAA: NoAlias: double* %noalias_ret_a0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_ret_a1 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %nocap_callee_arg -; IPAA: NoAlias: double* %arg_a0, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %arg_a1, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %noalias_arg_a0, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %noalias_arg_a1, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %noalias_ret_a1, double** %indirect_a0 -; IPAA: NoAlias: double* %noalias_ret_a1, double** %indirect_a1 -; IPAA: NoAlias: double* %loaded_a0, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %loaded_a1, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %noalias_ret_a1, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %noalias_ret_a1, double* %noescape_alloca_a1 -; IPAA: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a0 -; IPAA: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a1 -; IPAA: NoAlias: double* %noalias_ret_a0, double* %noalias_ret_a1 -; IPAA: MayAlias: double* %arg_b0, double* %callee_arg -; IPAA: MayAlias: double* %arg_b0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %arg_b0 -; IPAA: MayAlias: double* %arg_a1, double* %arg_b0 -; IPAA: MayAlias: double* %arg_b0, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %arg_b0, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %arg_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %arg_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %arg_b0, double* %loaded_a0 -; IPAA: MayAlias: double* %arg_b0, double* %loaded_a1 -; IPAA: MayAlias: double* %arg_b0, double* %escape_alloca_a0 -; IPAA: MayAlias: double* %arg_b0, double* %escape_alloca_a1 -; IPAA: MayAlias: double* %arg_b0, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %arg_b0, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %arg_b0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %arg_b0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %arg_b0, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %arg_b0, double* %noalias_ret_a1 -; IPAA: MayAlias: double* %arg_b1, double* %callee_arg -; IPAA: MayAlias: double* %arg_b1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %arg_b1 -; IPAA: MayAlias: double* %arg_a1, double* %arg_b1 -; IPAA: MayAlias: double* %arg_b1, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %arg_b1, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %arg_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %arg_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %arg_b1, double* %loaded_a0 -; IPAA: MayAlias: double* %arg_b1, double* %loaded_a1 -; IPAA: MayAlias: double* %arg_b1, double* %escape_alloca_a0 -; IPAA: MayAlias: double* %arg_b1, double* %escape_alloca_a1 -; IPAA: MayAlias: double* %arg_b1, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %arg_b1, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %arg_b1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %arg_b1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %arg_b1, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %arg_b1, double* %noalias_ret_a1 -; IPAA: MayAlias: double* %arg_b0, double* %arg_b1 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %arg_a1, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %noalias_arg_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %noalias_arg_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %loaded_a1, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %noalias_arg_b0, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %arg_b0, double* %noalias_arg_b0 -; IPAA: NoAlias: double* %arg_b1, double* %noalias_arg_b0 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %arg_a1, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %noalias_arg_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %noalias_arg_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %loaded_a1, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %noalias_arg_b1, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %arg_b0, double* %noalias_arg_b1 -; IPAA: NoAlias: double* %arg_b1, double* %noalias_arg_b1 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %callee_arg, double** %indirect_b0 -; IPAA: MayAlias: double* %nocap_callee_arg, double** %indirect_b0 -; IPAA: MayAlias: double* %arg_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %arg_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %noalias_arg_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %noalias_arg_a1, double** %indirect_b0 -; IPAA: MayAlias: double** %indirect_a0, double** %indirect_b0 -; IPAA: MayAlias: double** %indirect_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %loaded_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %loaded_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %escape_alloca_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %escape_alloca_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %noescape_alloca_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %noescape_alloca_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %normal_ret_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %normal_ret_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %noalias_ret_a0, double** %indirect_b0 -; IPAA: MayAlias: double* %noalias_ret_a1, double** %indirect_b0 -; IPAA: MayAlias: double* %arg_b0, double** %indirect_b0 -; IPAA: MayAlias: double* %arg_b1, double** %indirect_b0 -; IPAA: NoAlias: double* %noalias_arg_b0, double** %indirect_b0 -; IPAA: NoAlias: double* %noalias_arg_b1, double** %indirect_b0 -; IPAA: MayAlias: double* %callee_arg, double** %indirect_b1 -; IPAA: MayAlias: double* %nocap_callee_arg, double** %indirect_b1 -; IPAA: MayAlias: double* %arg_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %arg_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %noalias_arg_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %noalias_arg_a1, double** %indirect_b1 -; IPAA: MayAlias: double** %indirect_a0, double** %indirect_b1 -; IPAA: MayAlias: double** %indirect_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %loaded_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %loaded_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %escape_alloca_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %escape_alloca_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %noescape_alloca_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %noescape_alloca_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %normal_ret_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %normal_ret_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %noalias_ret_a0, double** %indirect_b1 -; IPAA: MayAlias: double* %noalias_ret_a1, double** %indirect_b1 -; IPAA: MayAlias: double* %arg_b0, double** %indirect_b1 -; IPAA: MayAlias: double* %arg_b1, double** %indirect_b1 -; IPAA: NoAlias: double* %noalias_arg_b0, double** %indirect_b1 -; IPAA: NoAlias: double* %noalias_arg_b1, double** %indirect_b1 -; IPAA: MayAlias: double** %indirect_b0, double** %indirect_b1 -; IPAA: MayAlias: double* %callee_arg, double* %loaded_b0 -; IPAA: MayAlias: double* %loaded_b0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %loaded_b0 -; IPAA: MayAlias: double* %arg_a1, double* %loaded_b0 -; IPAA: MayAlias: double* %loaded_b0, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %loaded_b0, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %loaded_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %loaded_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %loaded_b0 -; IPAA: MayAlias: double* %loaded_a1, double* %loaded_b0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %loaded_b0 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %loaded_b0 -; IPAA: MayAlias: double* %loaded_b0, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %loaded_b0, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %loaded_b0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %loaded_b0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %loaded_b0, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %loaded_b0, double* %noalias_ret_a1 -; IPAA: MayAlias: double* %arg_b0, double* %loaded_b0 -; IPAA: MayAlias: double* %arg_b1, double* %loaded_b0 -; IPAA: NoAlias: double* %loaded_b0, double* %noalias_arg_b0 -; IPAA: NoAlias: double* %loaded_b0, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %loaded_b0, double** %indirect_b0 -; IPAA: MayAlias: double* %loaded_b0, double** %indirect_b1 -; IPAA: MayAlias: double* %callee_arg, double* %loaded_b1 -; IPAA: MayAlias: double* %loaded_b1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %loaded_b1 -; IPAA: MayAlias: double* %arg_a1, double* %loaded_b1 -; IPAA: MayAlias: double* %loaded_b1, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %loaded_b1, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %loaded_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %loaded_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %loaded_b1 -; IPAA: MayAlias: double* %loaded_a1, double* %loaded_b1 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %loaded_b1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %loaded_b1 -; IPAA: MayAlias: double* %loaded_b1, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %loaded_b1, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %loaded_b1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %loaded_b1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %loaded_b1, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %loaded_b1, double* %noalias_ret_a1 -; IPAA: MayAlias: double* %arg_b0, double* %loaded_b1 -; IPAA: MayAlias: double* %arg_b1, double* %loaded_b1 -; IPAA: NoAlias: double* %loaded_b1, double* %noalias_arg_b0 -; IPAA: NoAlias: double* %loaded_b1, double* %noalias_arg_b1 -; IPAA: MayAlias: double* %loaded_b1, double** %indirect_b0 -; IPAA: MayAlias: double* %loaded_b1, double** %indirect_b1 -; IPAA: MayAlias: double* %loaded_b0, double* %loaded_b1 -; IPAA: MayAlias: double* %callee_arg, double* %escape_alloca_b0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %escape_alloca_b0 -; IPAA: MayAlias: double* %arg_a1, double* %escape_alloca_b0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %escape_alloca_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %escape_alloca_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %loaded_a0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %loaded_a1 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %escape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %escape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %arg_b0, double* %escape_alloca_b0 -; IPAA: NoAlias: double* %arg_b1, double* %escape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noalias_arg_b0 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noalias_arg_b1 -; IPAA: NoAlias: double* %escape_alloca_b0, double** %indirect_b0 -; IPAA: NoAlias: double* %escape_alloca_b0, double** %indirect_b1 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %loaded_b0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %loaded_b1 -; IPAA: MayAlias: double* %callee_arg, double* %escape_alloca_b1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %escape_alloca_b1 -; IPAA: MayAlias: double* %arg_a1, double* %escape_alloca_b1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %noalias_arg_a0 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %noalias_arg_a1 -; IPAA: MayAlias: double* %escape_alloca_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %escape_alloca_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %loaded_a0 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %loaded_a1 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %escape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %escape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noescape_alloca_a0 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %noalias_ret_a0 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %noalias_ret_a1 -; IPAA: NoAlias: double* %arg_b0, double* %escape_alloca_b1 -; IPAA: NoAlias: double* %arg_b1, double* %escape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noalias_arg_b0 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noalias_arg_b1 -; IPAA: NoAlias: double* %escape_alloca_b1, double** %indirect_b0 -; IPAA: NoAlias: double* %escape_alloca_b1, double** %indirect_b1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %loaded_b0 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %loaded_b1 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %escape_alloca_b1 -; IPAA: MayAlias: double* %callee_arg, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %arg_a0, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %arg_a1, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %noescape_alloca_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %noescape_alloca_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %loaded_a1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noescape_alloca_a0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noescape_alloca_a1, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %noescape_alloca_b0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %noescape_alloca_b0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %arg_b0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %arg_b1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noalias_arg_b1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noescape_alloca_b0, double** %indirect_b0 -; IPAA: NoAlias: double* %noescape_alloca_b0, double** %indirect_b1 -; IPAA: NoAlias: double* %loaded_b0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %loaded_b1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noescape_alloca_b0 -; IPAA: MayAlias: double* %callee_arg, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %arg_a0, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %arg_a1, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %noescape_alloca_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %noescape_alloca_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %loaded_a1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noescape_alloca_a0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noescape_alloca_a1, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %noescape_alloca_b1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %noescape_alloca_b1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %arg_b0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %arg_b1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noalias_arg_b1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noescape_alloca_b1, double** %indirect_b0 -; IPAA: NoAlias: double* %noescape_alloca_b1, double** %indirect_b1 -; IPAA: NoAlias: double* %loaded_b0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %loaded_b1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noescape_alloca_b0, double* %noescape_alloca_b1 -; IPAA: MayAlias: double* %callee_arg, double* %normal_ret_b0 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %normal_ret_b0 -; IPAA: MayAlias: double* %arg_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %arg_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %normal_ret_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %normal_ret_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %loaded_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %noescape_alloca_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %noescape_alloca_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %normal_ret_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %normal_ret_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %arg_b0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %arg_b1, double* %normal_ret_b0 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %normal_ret_b0 -; IPAA: NoAlias: double* %noalias_arg_b1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %normal_ret_b0, double** %indirect_b0 -; IPAA: MayAlias: double* %normal_ret_b0, double** %indirect_b1 -; IPAA: MayAlias: double* %loaded_b0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %loaded_b1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %normal_ret_b0 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %normal_ret_b0 -; IPAA: NoAlias: double* %noescape_alloca_b0, double* %normal_ret_b0 -; IPAA: NoAlias: double* %noescape_alloca_b1, double* %normal_ret_b0 -; IPAA: MayAlias: double* %callee_arg, double* %normal_ret_b1 -; IPAA: MayAlias: double* %nocap_callee_arg, double* %normal_ret_b1 -; IPAA: MayAlias: double* %arg_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %arg_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %normal_ret_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %normal_ret_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %loaded_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %noescape_alloca_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %noescape_alloca_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %normal_ret_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %normal_ret_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %arg_b0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %arg_b1, double* %normal_ret_b1 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %normal_ret_b1 -; IPAA: NoAlias: double* %noalias_arg_b1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %normal_ret_b1, double** %indirect_b0 -; IPAA: MayAlias: double* %normal_ret_b1, double** %indirect_b1 -; IPAA: MayAlias: double* %loaded_b0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %loaded_b1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %escape_alloca_b0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %escape_alloca_b1, double* %normal_ret_b1 -; IPAA: NoAlias: double* %noescape_alloca_b0, double* %normal_ret_b1 -; IPAA: NoAlias: double* %noescape_alloca_b1, double* %normal_ret_b1 -; IPAA: MayAlias: double* %normal_ret_b0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %noalias_ret_b0, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %arg_a1, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %noalias_ret_b0, double** %indirect_a0 -; IPAA: MayAlias: double* %noalias_ret_b0, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %loaded_a1, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %noalias_ret_b0, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %noalias_ret_b0, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %noalias_ret_b0, double* %normal_ret_a0 -; IPAA: MayAlias: double* %noalias_ret_b0, double* %normal_ret_a1 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %noalias_ret_b0 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %arg_b0, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %arg_b1, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %noalias_arg_b1, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %noalias_ret_b0, double** %indirect_b0 -; IPAA: NoAlias: double* %noalias_ret_b0, double** %indirect_b1 -; IPAA: NoAlias: double* %loaded_b0, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %loaded_b1, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noalias_ret_b0 -; IPAA: NoAlias: double* %noalias_ret_b0, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noalias_ret_b0, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noalias_ret_b0, double* %normal_ret_b0 -; IPAA: NoAlias: double* %noalias_ret_b0, double* %normal_ret_b1 -; IPAA: MayAlias: double* %callee_arg, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %noalias_ret_b1, double* %nocap_callee_arg -; IPAA: MayAlias: double* %arg_a0, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %arg_a1, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %noalias_arg_a0, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %noalias_arg_a1, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %noalias_ret_b1, double** %indirect_a0 -; IPAA: MayAlias: double* %noalias_ret_b1, double** %indirect_a1 -; IPAA: MayAlias: double* %loaded_a0, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %loaded_a1, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %escape_alloca_a0, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %escape_alloca_a1, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %noalias_ret_b1, double* %noescape_alloca_a0 -; IPAA: MayAlias: double* %noalias_ret_b1, double* %noescape_alloca_a1 -; IPAA: MayAlias: double* %noalias_ret_b1, double* %normal_ret_a0 -; IPAA: MayAlias: double* %noalias_ret_b1, double* %normal_ret_a1 -; IPAA: MayAlias: double* %noalias_ret_a0, double* %noalias_ret_b1 -; IPAA: MayAlias: double* %noalias_ret_a1, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %arg_b0, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %arg_b1, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %noalias_arg_b0, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %noalias_arg_b1, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %noalias_ret_b1, double** %indirect_b0 -; IPAA: NoAlias: double* %noalias_ret_b1, double** %indirect_b1 -; IPAA: NoAlias: double* %loaded_b0, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %loaded_b1, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %escape_alloca_b0, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %escape_alloca_b1, double* %noalias_ret_b1 -; IPAA: NoAlias: double* %noalias_ret_b1, double* %noescape_alloca_b0 -; IPAA: NoAlias: double* %noalias_ret_b1, double* %noescape_alloca_b1 -; IPAA: NoAlias: double* %noalias_ret_b1, double* %normal_ret_b0 -; IPAA: NoAlias: double* %noalias_ret_b1, double* %normal_ret_b1 -; IPAA: NoAlias: double* %noalias_ret_b0, double* %noalias_ret_b1 -; IPAA: ModRef: Ptr: double* %callee_arg <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> call void @callee(double* %escape_alloca_a0) -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> call void @callee(double* %escape_alloca_a1) -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; IPAA: ModRef: Ptr: double* %callee_arg <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> %normal_ret_b0 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> %normal_ret_b1 = call double* @normal_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b0 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> %noalias_ret_b0 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %arg_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %noalias_ret_b1 <-> %noalias_ret_b1 = call double* @noalias_returner() ; [#uses=1] -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @callee(double* %escape_alloca_b0) -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @callee(double* %escape_alloca_b1) -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b0) -; IPAA: ModRef: Ptr: double* %callee_arg <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %nocap_callee_arg <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_arg_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double** %indirect_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %loaded_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %escape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noescape_alloca_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %noescape_alloca_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ModRef: Ptr: double* %normal_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b0 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: NoModRef: Ptr: double* %noalias_ret_b1 <-> call void @nocap_callee(double* %noescape_alloca_b1) -; IPAA: ===== Alias Analysis Evaluator Report ===== -; IPAA: 561 Total Alias Queries Performed -; IPAA: 184 no alias responses (32.7%) -; IPAA: 377 may alias responses (67.2%) -; IPAA: 0 must alias responses (0.0%) -; IPAA: Alias Analysis Evaluator Pointer Alias Summary: 32%/67%/0% -; IPAA: 544 Total ModRef Queries Performed -; IPAA: 88 no mod/ref responses (16.1%) -; IPAA: 0 mod responses (0.0%) -; IPAA: 0 ref responses (0.0%) -; IPAA: 456 mod & ref responses (83.8%) -; IPAA: Alias Analysis Evaluator Mod/Ref Summary: 16%/0%/0%/83% +; CHECK: Function: caller_a: 16 pointers, 8 call sites +; CHECK: MayAlias: double* %arg_a0, double* %arg_a1 +; CHECK: NoAlias: double* %arg_a0, double* %noalias_arg_a0 +; CHECK: NoAlias: double* %arg_a1, double* %noalias_arg_a0 +; CHECK: NoAlias: double* %arg_a0, double* %noalias_arg_a1 +; CHECK: NoAlias: double* %arg_a1, double* %noalias_arg_a1 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %noalias_arg_a1 +; CHECK: MayAlias: double* %arg_a0, double** %indirect_a0 +; CHECK: MayAlias: double* %arg_a1, double** %indirect_a0 +; CHECK: NoAlias: double* %noalias_arg_a0, double** %indirect_a0 +; CHECK: NoAlias: double* %noalias_arg_a1, double** %indirect_a0 +; CHECK: MayAlias: double* %arg_a0, double** %indirect_a1 +; CHECK: MayAlias: double* %arg_a1, double** %indirect_a1 +; CHECK: NoAlias: double* %noalias_arg_a0, double** %indirect_a1 +; CHECK: NoAlias: double* %noalias_arg_a1, double** %indirect_a1 +; CHECK: MayAlias: double** %indirect_a0, double** %indirect_a1 +; CHECK: MayAlias: double* %arg_a0, double* %loaded_a0 +; CHECK: MayAlias: double* %arg_a1, double* %loaded_a0 +; CHECK: NoAlias: double* %loaded_a0, double* %noalias_arg_a0 +; CHECK: NoAlias: double* %loaded_a0, double* %noalias_arg_a1 +; CHECK: MayAlias: double* %loaded_a0, double** %indirect_a0 +; CHECK: MayAlias: double* %loaded_a0, double** %indirect_a1 +; CHECK: MayAlias: double* %arg_a0, double* %loaded_a1 +; CHECK: MayAlias: double* %arg_a1, double* %loaded_a1 +; CHECK: NoAlias: double* %loaded_a1, double* %noalias_arg_a0 +; CHECK: NoAlias: double* %loaded_a1, double* %noalias_arg_a1 +; CHECK: MayAlias: double* %loaded_a1, double** %indirect_a0 +; CHECK: MayAlias: double* %loaded_a1, double** %indirect_a1 +; CHECK: MayAlias: double* %loaded_a0, double* %loaded_a1 +; CHECK: NoAlias: double* %arg_a0, double* %escape_alloca_a0 +; CHECK: NoAlias: double* %arg_a1, double* %escape_alloca_a0 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %noalias_arg_a0 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %noalias_arg_a1 +; CHECK: NoAlias: double* %escape_alloca_a0, double** %indirect_a0 +; CHECK: NoAlias: double* %escape_alloca_a0, double** %indirect_a1 +; CHECK: MayAlias: double* %escape_alloca_a0, double* %loaded_a0 +; CHECK: MayAlias: double* %escape_alloca_a0, double* %loaded_a1 +; CHECK: NoAlias: double* %arg_a0, double* %escape_alloca_a1 +; CHECK: NoAlias: double* %arg_a1, double* %escape_alloca_a1 +; CHECK: NoAlias: double* %escape_alloca_a1, double* %noalias_arg_a0 +; CHECK: NoAlias: double* %escape_alloca_a1, double* %noalias_arg_a1 +; CHECK: NoAlias: double* %escape_alloca_a1, double** %indirect_a0 +; CHECK: NoAlias: double* %escape_alloca_a1, double** %indirect_a1 +; CHECK: MayAlias: double* %escape_alloca_a1, double* %loaded_a0 +; CHECK: MayAlias: double* %escape_alloca_a1, double* %loaded_a1 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %escape_alloca_a1 +; CHECK: NoAlias: double* %arg_a0, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %arg_a1, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %noalias_arg_a1, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %noescape_alloca_a0, double** %indirect_a0 +; CHECK: NoAlias: double* %noescape_alloca_a0, double** %indirect_a1 +; CHECK: NoAlias: double* %loaded_a0, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %loaded_a1, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %arg_a0, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %arg_a1, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %noalias_arg_a1, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %noescape_alloca_a1, double** %indirect_a0 +; CHECK: NoAlias: double* %noescape_alloca_a1, double** %indirect_a1 +; CHECK: NoAlias: double* %loaded_a0, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %loaded_a1, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %escape_alloca_a1, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %noescape_alloca_a0, double* %noescape_alloca_a1 +; CHECK: MayAlias: double* %arg_a0, double* %normal_ret_a0 +; CHECK: MayAlias: double* %arg_a1, double* %normal_ret_a0 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %normal_ret_a0 +; CHECK: NoAlias: double* %noalias_arg_a1, double* %normal_ret_a0 +; CHECK: MayAlias: double* %normal_ret_a0, double** %indirect_a0 +; CHECK: MayAlias: double* %normal_ret_a0, double** %indirect_a1 +; CHECK: MayAlias: double* %loaded_a0, double* %normal_ret_a0 +; CHECK: MayAlias: double* %loaded_a1, double* %normal_ret_a0 +; CHECK: MayAlias: double* %escape_alloca_a0, double* %normal_ret_a0 +; CHECK: MayAlias: double* %escape_alloca_a1, double* %normal_ret_a0 +; CHECK: NoAlias: double* %noescape_alloca_a0, double* %normal_ret_a0 +; CHECK: NoAlias: double* %noescape_alloca_a1, double* %normal_ret_a0 +; CHECK: MayAlias: double* %arg_a0, double* %normal_ret_a1 +; CHECK: MayAlias: double* %arg_a1, double* %normal_ret_a1 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %normal_ret_a1 +; CHECK: NoAlias: double* %noalias_arg_a1, double* %normal_ret_a1 +; CHECK: MayAlias: double* %normal_ret_a1, double** %indirect_a0 +; CHECK: MayAlias: double* %normal_ret_a1, double** %indirect_a1 +; CHECK: MayAlias: double* %loaded_a0, double* %normal_ret_a1 +; CHECK: MayAlias: double* %loaded_a1, double* %normal_ret_a1 +; CHECK: MayAlias: double* %escape_alloca_a0, double* %normal_ret_a1 +; CHECK: MayAlias: double* %escape_alloca_a1, double* %normal_ret_a1 +; CHECK: NoAlias: double* %noescape_alloca_a0, double* %normal_ret_a1 +; CHECK: NoAlias: double* %noescape_alloca_a1, double* %normal_ret_a1 +; CHECK: MayAlias: double* %normal_ret_a0, double* %normal_ret_a1 +; CHECK: NoAlias: double* %arg_a0, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %arg_a1, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %noalias_arg_a1, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %noalias_ret_a0, double** %indirect_a0 +; CHECK: NoAlias: double* %noalias_ret_a0, double** %indirect_a1 +; CHECK: NoAlias: double* %loaded_a0, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %loaded_a1, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %escape_alloca_a1, double* %noalias_ret_a0 +; CHECK: NoAlias: double* %noalias_ret_a0, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %noalias_ret_a0, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %noalias_ret_a0, double* %normal_ret_a0 +; CHECK: NoAlias: double* %noalias_ret_a0, double* %normal_ret_a1 +; CHECK: NoAlias: double* %arg_a0, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %arg_a1, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %noalias_arg_a0, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %noalias_arg_a1, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %noalias_ret_a1, double** %indirect_a0 +; CHECK: NoAlias: double* %noalias_ret_a1, double** %indirect_a1 +; CHECK: NoAlias: double* %loaded_a0, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %loaded_a1, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %escape_alloca_a0, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %escape_alloca_a1, double* %noalias_ret_a1 +; CHECK: NoAlias: double* %noalias_ret_a1, double* %noescape_alloca_a0 +; CHECK: NoAlias: double* %noalias_ret_a1, double* %noescape_alloca_a1 +; CHECK: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a0 +; CHECK: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a1 +; CHECK: NoAlias: double* %noalias_ret_a0, double* %noalias_ret_a1 +; CHECK: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: ===== Alias Analysis Evaluator Report ===== +; CHECK: 120 Total Alias Queries Performed +; CHECK: 84 no alias responses (70.0%) +; CHECK: 36 may alias responses (30.0%) +; CHECK: 0 must alias responses (0.0%) +; CHECK: Alias Analysis Evaluator Pointer Alias Summary: 70%/30%/0% +; CHECK: 128 Total ModRef Queries Performed +; CHECK: 44 no mod/ref responses (34.3%) +; CHECK: 0 mod responses (0.0%) +; CHECK: 0 ref responses (0.0%) +; CHECK: 84 mod & ref responses (65.6%) +; CHECK: Alias Analysis Evaluator Mod/Ref Summary: 34%/0%/0%/65% Removed: llvm/trunk/test/Analysis/BasicAA/interprocedural.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/interprocedural.ll?rev=107775&view=auto ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/interprocedural.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/interprocedural.ll (removed) @@ -1,73 +0,0 @@ -; RUN: opt -interprocedural-basic-aa -interprocedural-aa-eval -print-all-alias-modref-info -disable-output < %s |& FileCheck %s - -; The noalias attribute is not safe in an interprocedural context. -; CHECK: MayAlias: i8* %p, i8* %q - -define void @t0(i8* noalias %p) { - store i8 0, i8* %p - ret void -} -define void @t1(i8* noalias %q) { - store i8 0, i8* %q - ret void -} - -; An alloca can alias an argument in a different function. -; CHECK: MayAlias: i32* %r, i32* %s - -define void @s0(i32* %r) { - store i32 0, i32* %r - ret void -} - -define void @s1() { - %s = alloca i32, i32 10 - store i32 0, i32* %s - call void @s0(i32* %s) - ret void -} - -; An alloca does not alias an argument in the same function. -; CHECK: NoAlias: i64* %t, i64* %u -; CHECK: NoAlias: i64* %a, i64* %u -; CHECK: NoAlias: i64* %a, i64* %t -; CHECK: MayAlias: i64* %u, i64* %v -; CHECK: MayAlias: i64* %t, i64* %v -; CHECK: NoAlias: i64* %a, i64* %v -; CHECK: MayAlias: i64* %b, i64* %u -; CHECK: MayAlias: i64* %b, i64* %t -; CHECK: MayAlias: i64* %b, i64* %v -declare i64* @r0_callee(i64*) -define i64* @r0(i64* %u) { - %t = alloca i64, i32 10 - %a = alloca i64, i32 10 - %v = call i64* @r0_callee(i64* %t) - %b = call i64* @r0_callee(i64* %t) - store i64 0, i64* %t - store i64 0, i64* %u - store i64 0, i64* %v - store i64 0, i64* %a - store i64 0, i64* %b - ret i64* %t -} - -; The noalias attribute is safe when both arguments belong to the same function -; even in an interprocedural context. -; CHECK: NoAlias: i8* %w, i8* %x - -define void @q0(i8* noalias %w, i8* noalias %x) { - store i8 0, i8* %w - store i8 0, i8* %x - call void @q0(i8* noalias %x, i8* noalias %w) - unreachable -} - -; The noalias attribute is not necessarily safe in an interprocedural context. -; CHECK: MayAlias: double* %y, double* @G - - at G = external global double -define void @p0(double* noalias %y) { - store double 0.0, double* %y - store double 0.0, double* @G - unreachable -} From gohman at apple.com Wed Jul 7 09:30:04 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 14:30:04 -0000 Subject: [llvm-commits] [llvm] r107777 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100707143004.62D522A6C12C@llvm.org> Author: djg Date: Wed Jul 7 09:30:04 2010 New Revision: 107777 URL: http://llvm.org/viewvc/llvm-project?rev=107777&view=rev Log: Minore code simplification. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=107777&r1=107776&r2=107777&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Jul 7 09:30:04 2010 @@ -763,8 +763,22 @@ if ((isa(O2) && isKnownNonNull(O1)) || (isa(O1) && isKnownNonNull(O2))) return NoAlias; - } + // If one pointer is the result of a call/invoke or load and the other is a + // non-escaping local object within the same function, then we know the + // object couldn't escape to a point where the call could return it. + // + // Note that if the pointers are in different functions, there are a + // variety of complications. A call with a nocapture argument may still + // temporary store the nocapture argument's value in a temporary memory + // location if that memory location doesn't escape. Or it may pass a + // nocapture value to other functions as long as they don't capture it. + if (isEscapeSource(O1) && isNonEscapingLocalObject(O2)) + return NoAlias; + if (isEscapeSource(O2) && isNonEscapingLocalObject(O1)) + return NoAlias; + } + // If the size of one access is larger than the entire object on the other // side, then we know such behavior is undefined and can assume no alias. if (TD) @@ -772,22 +786,6 @@ (V2Size != ~0U && isObjectSmallerThan(O1, V2Size, *TD))) return NoAlias; - // If one pointer is the result of a call/invoke or load and the other is a - // non-escaping local object within the same function, then we know the - // object couldn't escape to a point where the call could return it. - // - // Note that if the pointers are in different functions, there are a - // variety of complications. A call with a nocapture argument may still - // temporary store the nocapture argument's value in a temporary memory - // location if that memory location doesn't escape. Or it may pass a - // nocapture value to other functions as long as they don't capture it. - if (O1 != O2) { - if (isEscapeSource(O1) && isNonEscapingLocalObject(O2)) - return NoAlias; - if (isEscapeSource(O2) && isNonEscapingLocalObject(O1)) - return NoAlias; - } - // FIXME: This isn't aggressively handling alias(GEP, PHI) for example: if the // GEP can't simplify, we don't even look at the PHI cases. if (!isa(V1) && isa(V2)) { From gohman at apple.com Wed Jul 7 09:33:51 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 14:33:51 -0000 Subject: [llvm-commits] [llvm] r107778 - in /llvm/trunk: include/llvm/CodeGen/MachineBasicBlock.h lib/CodeGen/MachineBasicBlock.cpp Message-ID: <20100707143351.50FEF2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 09:33:51 2010 New Revision: 107778 URL: http://llvm.org/viewvc/llvm-project?rev=107778&view=rev Log: Add a getFirstNonPHI utility function. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=107778&r1=107777&r2=107778&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Wed Jul 7 09:33:51 2010 @@ -282,6 +282,13 @@ /// branch to do so (e.g., a table jump). True is a conservative answer. bool canFallThrough(); + /// Returns a pointer to the first instructon in this block that is not a + /// PHINode instruction. When adding instruction to the beginning of the + /// basic block, they should be added before the returned value, not before + /// the first instruction, which might be PHI. + /// Returns end() is there's no non-PHI instruction. + iterator getFirstNonPHI(); + /// getFirstTerminator - returns an iterator to the first terminator /// instruction of this basic block. If a terminator does not exist, /// it returns end() Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=107778&r1=107777&r2=107778&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Wed Jul 7 09:33:51 2010 @@ -139,6 +139,13 @@ Parent->getParent()->DeleteMachineInstr(MI); } +MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI() { + iterator I = begin(); + while (I != end() && I->isPHI()) + ++I; + return I; +} + MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() { iterator I = end(); while (I != begin() && (--I)->getDesc().isTerminator()) From ggreif at gmail.com Wed Jul 7 09:37:05 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 07 Jul 2010 14:37:05 -0000 Subject: [llvm-commits] [llvm] r107779 - /llvm/trunk/Makefile Message-ID: <20100707143705.190382A6C12C@llvm.org> Author: ggreif Date: Wed Jul 7 09:37:04 2010 New Revision: 107779 URL: http://llvm.org/viewvc/llvm-project?rev=107779&view=rev Log: adapt condition for changed default build mode who knows how to cover Asserts or Debug separately please do not hesitate to extend this Modified: llvm/trunk/Makefile Modified: llvm/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=107779&r1=107778&r2=107779&view=diff ============================================================================== --- llvm/trunk/Makefile (original) +++ llvm/trunk/Makefile Wed Jul 7 09:37:04 2010 @@ -181,7 +181,7 @@ ifneq ($(BUILD_DIRS_ONLY),1) all:: $(Echo) '*****' Completed $(BuildMode) Build -ifeq ($(BuildMode),Debug) +ifeq ($(BuildMode),Debug+Asserts) $(Echo) '*****' Note: Debug build can be 10 times slower than an $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to $(Echo) '*****' make an optimized build. Alternatively you can From stoklund at 2pi.dk Wed Jul 7 09:41:22 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 07 Jul 2010 14:41:22 -0000 Subject: [llvm-commits] [llvm] r107780 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <20100707144122.626DE2A6C12C@llvm.org> Author: stoklund Date: Wed Jul 7 09:41:22 2010 New Revision: 107780 URL: http://llvm.org/viewvc/llvm-project?rev=107780&view=rev Log: Fix more places assuming subregisters have live intervals Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107780&r1=107779&r2=107780&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Jul 7 09:41:22 2010 @@ -211,6 +211,8 @@ // physreg has sub-registers, update their live intervals as well. if (TargetRegisterInfo::isPhysicalRegister(IntB.reg)) { for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { + if (!li_->hasInterval(*SR)) + continue; LiveInterval &SRLI = li_->getInterval(*SR); SRLI.addRange(LiveRange(FillerStart, FillerEnd, SRLI.getNextValue(FillerStart, 0, true, @@ -392,7 +394,8 @@ // clobbers from the superreg. if (BHasSubRegs) for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) - if (HasOtherReachingDefs(IntA, li_->getInterval(*SR), AValNo, 0)) + if (li_->hasInterval(*SR) && + HasOtherReachingDefs(IntA, li_->getInterval(*SR), AValNo, 0)) return false; // If some of the uses of IntA.reg is already coalesced away, return false. @@ -498,6 +501,8 @@ VNInfo *DeadVNI = BDeadValNos[i]; if (BHasSubRegs) { for (const unsigned *SR = tri_->getSubRegisters(IntB.reg); *SR; ++SR) { + if (!li_->hasInterval(*SR)) + continue; LiveInterval &SRLI = li_->getInterval(*SR); if (const LiveRange *SRLR = SRLI.getLiveRangeContaining(DeadVNI->def)) SRLI.removeValNo(SRLR->valno); From gohman at apple.com Wed Jul 7 10:15:27 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 15:15:27 -0000 Subject: [llvm-commits] [llvm] r107781 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h lib/CodeGen/CMakeLists.txt lib/CodeGen/CallingConvLower.cpp lib/CodeGen/SelectionDAG/CMakeLists.txt lib/CodeGen/SelectionDAG/CallingConvLower.cpp Message-ID: <20100707151527.A05782A6C12C@llvm.org> Author: djg Date: Wed Jul 7 10:15:27 2010 New Revision: 107781 URL: http://llvm.org/viewvc/llvm-project?rev=107781&view=rev Log: Move CallingConvLower.cpp out of the SelectionDAG directory. Added: llvm/trunk/lib/CodeGen/CallingConvLower.cpp - copied unchanged from r107774, llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp Removed: llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/lib/CodeGen/CMakeLists.txt llvm/trunk/lib/CodeGen/SelectionDAG/CMakeLists.txt Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107781&r1=107780&r2=107781&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Jul 7 10:15:27 2010 @@ -24,7 +24,6 @@ class TargetRegisterInfo; class TargetMachine; class CCState; - class SDNode; /// CCValAssign - Represent assignment of one arg/retval to a location. class CCValAssign { Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=107781&r1=107780&r2=107781&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CMakeLists.txt (original) +++ llvm/trunk/lib/CodeGen/CMakeLists.txt Wed Jul 7 10:15:27 2010 @@ -3,6 +3,7 @@ Analysis.cpp BranchFolding.cpp CalcSpillWeights.cpp + CallingConvLower.cpp CodePlacementOpt.cpp CriticalAntiDepBreaker.cpp DeadMachineInstructionElim.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/CMakeLists.txt?rev=107781&r1=107780&r2=107781&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/CMakeLists.txt (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/CMakeLists.txt Wed Jul 7 10:15:27 2010 @@ -1,5 +1,4 @@ add_llvm_library(LLVMSelectionDAG - CallingConvLower.cpp DAGCombiner.cpp FastISel.cpp FunctionLoweringInfo.cpp Removed: llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp?rev=107780&view=auto ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/CallingConvLower.cpp (removed) @@ -1,214 +0,0 @@ -//===-- CallingConvLower.cpp - Calling Conventions ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the CCState class, used for lowering and implementing -// calling conventions. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CodeGen/CallingConvLower.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Target/TargetRegisterInfo.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" -using namespace llvm; - -CCState::CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &tm, - SmallVector &locs, LLVMContext &C) - : CallingConv(CC), IsVarArg(isVarArg), TM(tm), - TRI(*TM.getRegisterInfo()), Locs(locs), Context(C) { - // No stack is used. - StackOffset = 0; - - UsedRegs.resize((TRI.getNumRegs()+31)/32); -} - -// HandleByVal - Allocate a stack slot large enough to pass an argument by -// value. The size and alignment information of the argument is encoded in its -// parameter attribute. -void CCState::HandleByVal(unsigned ValNo, EVT ValVT, - EVT LocVT, CCValAssign::LocInfo LocInfo, - int MinSize, int MinAlign, - ISD::ArgFlagsTy ArgFlags) { - unsigned Align = ArgFlags.getByValAlign(); - unsigned Size = ArgFlags.getByValSize(); - if (MinSize > (int)Size) - Size = MinSize; - if (MinAlign > (int)Align) - Align = MinAlign; - unsigned Offset = AllocateStack(Size, Align); - - addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); -} - -/// MarkAllocated - Mark a register and all of its aliases as allocated. -void CCState::MarkAllocated(unsigned Reg) { - UsedRegs[Reg/32] |= 1 << (Reg&31); - - if (const unsigned *RegAliases = TRI.getAliasSet(Reg)) - for (; (Reg = *RegAliases); ++RegAliases) - UsedRegs[Reg/32] |= 1 << (Reg&31); -} - -/// AnalyzeFormalArguments - Analyze an array of argument values, -/// incorporating info about the formals into this state. -void -CCState::AnalyzeFormalArguments(const SmallVectorImpl &Ins, - CCAssignFn Fn) { - unsigned NumArgs = Ins.size(); - - for (unsigned i = 0; i != NumArgs; ++i) { - EVT ArgVT = Ins[i].VT; - ISD::ArgFlagsTy ArgFlags = Ins[i].Flags; - if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Formal argument #" << i << " has unhandled type " - << ArgVT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -/// CheckReturn - Analyze the return values of a function, returning true if -/// the return can be performed without sret-demotion, and false otherwise. -bool CCState::CheckReturn(const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, - CCAssignFn Fn) { - // Determine which register each value should be copied into. - for (unsigned i = 0, e = OutTys.size(); i != e; ++i) { - EVT VT = OutTys[i]; - ISD::ArgFlagsTy ArgFlags = ArgsFlags[i]; - if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) - return false; - } - return true; -} - -/// AnalyzeReturn - Analyze the returned values of a return, -/// incorporating info about the result values into this state. -void CCState::AnalyzeReturn(const SmallVectorImpl &Outs, - CCAssignFn Fn) { - // Determine which register each value should be copied into. - for (unsigned i = 0, e = Outs.size(); i != e; ++i) { - EVT VT = Outs[i].Val.getValueType(); - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; - if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Return operand #" << i << " has unhandled type " - << VT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -void CCState::AnalyzeReturn(const SmallVectorImpl &Outs, - CCAssignFn Fn) { - // Determine which register each value should be copied into. - for (unsigned i = 0, e = Outs.size(); i != e; ++i) { - EVT VT = Outs[i].VT; - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; - if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Return operand #" << i << " has unhandled type " - << VT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - - -/// AnalyzeCallOperands - Analyze the outgoing arguments to a call, -/// incorporating info about the passed values into this state. -void CCState::AnalyzeCallOperands(const SmallVectorImpl &Outs, - CCAssignFn Fn) { - unsigned NumOps = Outs.size(); - for (unsigned i = 0; i != NumOps; ++i) { - EVT ArgVT = Outs[i].Val.getValueType(); - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; - if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Call operand #" << i << " has unhandled type " - << ArgVT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -/// AnalyzeCallOperands - Analyze the outgoing arguments to a call, -/// incorporating info about the passed values into this state. -void -CCState::AnalyzeCallOperands(const SmallVectorImpl &Outs, - CCAssignFn Fn) { - unsigned NumOps = Outs.size(); - for (unsigned i = 0; i != NumOps; ++i) { - EVT ArgVT = Outs[i].VT; - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; - if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Call operand #" << i << " has unhandled type " - << ArgVT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -/// AnalyzeCallOperands - Same as above except it takes vectors of types -/// and argument flags. -void CCState::AnalyzeCallOperands(SmallVectorImpl &ArgVTs, - SmallVectorImpl &Flags, - CCAssignFn Fn) { - unsigned NumOps = ArgVTs.size(); - for (unsigned i = 0; i != NumOps; ++i) { - EVT ArgVT = ArgVTs[i]; - ISD::ArgFlagsTy ArgFlags = Flags[i]; - if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Call operand #" << i << " has unhandled type " - << ArgVT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -/// AnalyzeCallResult - Analyze the return values of a call, -/// incorporating info about the passed values into this state. -void CCState::AnalyzeCallResult(const SmallVectorImpl &Ins, - CCAssignFn Fn) { - for (unsigned i = 0, e = Ins.size(); i != e; ++i) { - EVT VT = Ins[i].VT; - ISD::ArgFlagsTy Flags = Ins[i].Flags; - if (Fn(i, VT, VT, CCValAssign::Full, Flags, *this)) { -#ifndef NDEBUG - dbgs() << "Call result #" << i << " has unhandled type " - << VT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -/// AnalyzeCallResult - Same as above except it's specialized for calls which -/// produce a single value. -void CCState::AnalyzeCallResult(EVT VT, CCAssignFn Fn) { - if (Fn(0, VT, VT, CCValAssign::Full, ISD::ArgFlagsTy(), *this)) { -#ifndef NDEBUG - dbgs() << "Call result has unhandled type " - << VT.getEVTString(); -#endif - llvm_unreachable(0); - } -} From gohman at apple.com Wed Jul 7 10:28:42 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 15:28:42 -0000 Subject: [llvm-commits] [llvm] r107782 - in /llvm/trunk/include/llvm: CodeGen/CallingConvLower.h CodeGen/SelectionDAGNodes.h Target/TargetCallingConv.h Target/TargetLowering.h Message-ID: <20100707152843.0883C2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 10:28:42 2010 New Revision: 107782 URL: http://llvm.org/viewvc/llvm-project?rev=107782&view=rev Log: Move ArgFlagsTy, OutputArg, and InputArg out of SelectionDAGNodes.h and into a new header, TargetCallingConv.h. Added: llvm/trunk/include/llvm/Target/TargetCallingConv.h Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/include/llvm/Target/TargetLowering.h Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107782&r1=107781&r2=107782&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Jul 7 10:28:42 2010 @@ -17,7 +17,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/ValueTypes.h" -#include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/Target/TargetCallingConv.h" #include "llvm/CallingConv.h" namespace llvm { Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=107782&r1=107781&r2=107782&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Wed Jul 7 10:28:42 2010 @@ -1464,144 +1464,6 @@ } }; -namespace ISD { - struct ArgFlagsTy { - private: - static const uint64_t NoFlagSet = 0ULL; - static const uint64_t ZExt = 1ULL<<0; ///< Zero extended - static const uint64_t ZExtOffs = 0; - static const uint64_t SExt = 1ULL<<1; ///< Sign extended - static const uint64_t SExtOffs = 1; - static const uint64_t InReg = 1ULL<<2; ///< Passed in register - static const uint64_t InRegOffs = 2; - static const uint64_t SRet = 1ULL<<3; ///< Hidden struct-ret ptr - static const uint64_t SRetOffs = 3; - static const uint64_t ByVal = 1ULL<<4; ///< Struct passed by value - static const uint64_t ByValOffs = 4; - static const uint64_t Nest = 1ULL<<5; ///< Nested fn static chain - static const uint64_t NestOffs = 5; - static const uint64_t ByValAlign = 0xFULL << 6; //< Struct alignment - static const uint64_t ByValAlignOffs = 6; - static const uint64_t Split = 1ULL << 10; - static const uint64_t SplitOffs = 10; - static const uint64_t OrigAlign = 0x1FULL<<27; - static const uint64_t OrigAlignOffs = 27; - static const uint64_t ByValSize = 0xffffffffULL << 32; //< Struct size - static const uint64_t ByValSizeOffs = 32; - - static const uint64_t One = 1ULL; //< 1 of this type, for shifts - - uint64_t Flags; - public: - ArgFlagsTy() : Flags(0) { } - - bool isZExt() const { return Flags & ZExt; } - void setZExt() { Flags |= One << ZExtOffs; } - - bool isSExt() const { return Flags & SExt; } - void setSExt() { Flags |= One << SExtOffs; } - - bool isInReg() const { return Flags & InReg; } - void setInReg() { Flags |= One << InRegOffs; } - - bool isSRet() const { return Flags & SRet; } - void setSRet() { Flags |= One << SRetOffs; } - - bool isByVal() const { return Flags & ByVal; } - void setByVal() { Flags |= One << ByValOffs; } - - bool isNest() const { return Flags & Nest; } - void setNest() { Flags |= One << NestOffs; } - - unsigned getByValAlign() const { - return (unsigned) - ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2); - } - void setByValAlign(unsigned A) { - Flags = (Flags & ~ByValAlign) | - (uint64_t(Log2_32(A) + 1) << ByValAlignOffs); - } - - bool isSplit() const { return Flags & Split; } - void setSplit() { Flags |= One << SplitOffs; } - - unsigned getOrigAlign() const { - return (unsigned) - ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2); - } - void setOrigAlign(unsigned A) { - Flags = (Flags & ~OrigAlign) | - (uint64_t(Log2_32(A) + 1) << OrigAlignOffs); - } - - unsigned getByValSize() const { - return (unsigned)((Flags & ByValSize) >> ByValSizeOffs); - } - void setByValSize(unsigned S) { - Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs); - } - - /// getArgFlagsString - Returns the flags as a string, eg: "zext align:4". - std::string getArgFlagsString(); - - /// getRawBits - Represent the flags as a bunch of bits. - uint64_t getRawBits() const { return Flags; } - }; - - /// InputArg - This struct carries flags and type information about a - /// single incoming (formal) argument or incoming (from the perspective - /// of the caller) return value virtual register. - /// - struct InputArg { - ArgFlagsTy Flags; - EVT VT; - bool Used; - - InputArg() : VT(MVT::Other), Used(false) {} - InputArg(ISD::ArgFlagsTy flags, EVT vt, bool used) - : Flags(flags), VT(vt), Used(used) { - assert(VT.isSimple() && - "InputArg value type must be Simple!"); - } - }; - - /// OutputArg - This struct carries flags and a value for a - /// single outgoing (actual) argument or outgoing (from the perspective - /// of the caller) return value virtual register. - /// - struct OutputArg { - ArgFlagsTy Flags; - SDValue Val; - - /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". - bool IsFixed; - - OutputArg() : IsFixed(false) {} - OutputArg(ISD::ArgFlagsTy flags, SDValue val, bool isfixed) - : Flags(flags), Val(val), IsFixed(isfixed) { - assert(Val.getValueType().isSimple() && - "OutputArg value type must be Simple!"); - } - }; - - /// OutputArgReg - This struct carries flags and a register value for a - /// single outgoing (actual) argument or outgoing (from the perspective - /// of the caller) return value virtual register. - /// - struct OutputArgReg { - ArgFlagsTy Flags; - EVT VT; - unsigned Reg; - - /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". - bool IsFixed; - - OutputArgReg() : IsFixed(false) {} - OutputArgReg(ISD::ArgFlagsTy flags, EVT vt, unsigned reg, bool isfixed) - : Flags(flags), VT(vt), Reg(reg), IsFixed(isfixed) {} - }; -} - /// VTSDNode - This class is used to represent EVT's, which are used /// to parameterize some operations. class VTSDNode : public SDNode { Added: llvm/trunk/include/llvm/Target/TargetCallingConv.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetCallingConv.h?rev=107782&view=auto ============================================================================== --- llvm/trunk/include/llvm/Target/TargetCallingConv.h (added) +++ llvm/trunk/include/llvm/Target/TargetCallingConv.h Wed Jul 7 10:28:42 2010 @@ -0,0 +1,161 @@ +//===-- llvm/Target/TargetCallingConv.h - Calling Convention ----*- 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 types for working with calling-convention information. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TARGET_TARGETCALLINGCONV_H +#define LLVM_TARGET_TARGETCALLINGCONV_H + +#include "llvm/CodeGen/SelectionDAGNodes.h" + +namespace llvm { + +namespace ISD { + struct ArgFlagsTy { + private: + static const uint64_t NoFlagSet = 0ULL; + static const uint64_t ZExt = 1ULL<<0; ///< Zero extended + static const uint64_t ZExtOffs = 0; + static const uint64_t SExt = 1ULL<<1; ///< Sign extended + static const uint64_t SExtOffs = 1; + static const uint64_t InReg = 1ULL<<2; ///< Passed in register + static const uint64_t InRegOffs = 2; + static const uint64_t SRet = 1ULL<<3; ///< Hidden struct-ret ptr + static const uint64_t SRetOffs = 3; + static const uint64_t ByVal = 1ULL<<4; ///< Struct passed by value + static const uint64_t ByValOffs = 4; + static const uint64_t Nest = 1ULL<<5; ///< Nested fn static chain + static const uint64_t NestOffs = 5; + static const uint64_t ByValAlign = 0xFULL << 6; //< Struct alignment + static const uint64_t ByValAlignOffs = 6; + static const uint64_t Split = 1ULL << 10; + static const uint64_t SplitOffs = 10; + static const uint64_t OrigAlign = 0x1FULL<<27; + static const uint64_t OrigAlignOffs = 27; + static const uint64_t ByValSize = 0xffffffffULL << 32; //< Struct size + static const uint64_t ByValSizeOffs = 32; + + static const uint64_t One = 1ULL; //< 1 of this type, for shifts + + uint64_t Flags; + public: + ArgFlagsTy() : Flags(0) { } + + bool isZExt() const { return Flags & ZExt; } + void setZExt() { Flags |= One << ZExtOffs; } + + bool isSExt() const { return Flags & SExt; } + void setSExt() { Flags |= One << SExtOffs; } + + bool isInReg() const { return Flags & InReg; } + void setInReg() { Flags |= One << InRegOffs; } + + bool isSRet() const { return Flags & SRet; } + void setSRet() { Flags |= One << SRetOffs; } + + bool isByVal() const { return Flags & ByVal; } + void setByVal() { Flags |= One << ByValOffs; } + + bool isNest() const { return Flags & Nest; } + void setNest() { Flags |= One << NestOffs; } + + unsigned getByValAlign() const { + return (unsigned) + ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2); + } + void setByValAlign(unsigned A) { + Flags = (Flags & ~ByValAlign) | + (uint64_t(Log2_32(A) + 1) << ByValAlignOffs); + } + + bool isSplit() const { return Flags & Split; } + void setSplit() { Flags |= One << SplitOffs; } + + unsigned getOrigAlign() const { + return (unsigned) + ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2); + } + void setOrigAlign(unsigned A) { + Flags = (Flags & ~OrigAlign) | + (uint64_t(Log2_32(A) + 1) << OrigAlignOffs); + } + + unsigned getByValSize() const { + return (unsigned)((Flags & ByValSize) >> ByValSizeOffs); + } + void setByValSize(unsigned S) { + Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs); + } + + /// getArgFlagsString - Returns the flags as a string, eg: "zext align:4". + std::string getArgFlagsString(); + + /// getRawBits - Represent the flags as a bunch of bits. + uint64_t getRawBits() const { return Flags; } + }; + + /// InputArg - This struct carries flags and type information about a + /// single incoming (formal) argument or incoming (from the perspective + /// of the caller) return value virtual register. + /// + struct InputArg { + ArgFlagsTy Flags; + EVT VT; + bool Used; + + InputArg() : VT(MVT::Other), Used(false) {} + InputArg(ISD::ArgFlagsTy flags, EVT vt, bool used) + : Flags(flags), VT(vt), Used(used) { + assert(VT.isSimple() && + "InputArg value type must be Simple!"); + } + }; + + /// OutputArg - This struct carries flags and a value for a + /// single outgoing (actual) argument or outgoing (from the perspective + /// of the caller) return value virtual register. + /// + struct OutputArg { + ArgFlagsTy Flags; + SDValue Val; + + /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". + bool IsFixed; + + OutputArg() : IsFixed(false) {} + OutputArg(ISD::ArgFlagsTy flags, SDValue val, bool isfixed) + : Flags(flags), Val(val), IsFixed(isfixed) { + assert(Val.getValueType().isSimple() && + "OutputArg value type must be Simple!"); + } + }; + + /// OutputArgReg - This struct carries flags and a register value for a + /// single outgoing (actual) argument or outgoing (from the perspective + /// of the caller) return value virtual register. + /// + struct OutputArgReg { + ArgFlagsTy Flags; + EVT VT; + unsigned Reg; + + /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". + bool IsFixed; + + OutputArgReg() : IsFixed(false) {} + OutputArgReg(ISD::ArgFlagsTy flags, EVT vt, unsigned reg, bool isfixed) + : Flags(flags), VT(vt), Reg(reg), IsFixed(isfixed) {} + }; +} + +} // end llvm namespace + +#endif Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107782&r1=107781&r2=107782&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jul 7 10:28:42 2010 @@ -32,6 +32,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/DebugLoc.h" +#include "llvm/Target/TargetCallingConv.h" #include "llvm/Target/TargetMachine.h" #include #include From sabre at nondot.org Wed Jul 7 10:52:27 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 07 Jul 2010 15:52:27 -0000 Subject: [llvm-commits] [llvm] r107785 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp lib/Support/raw_ostream.cpp lib/System/Unix/Program.inc Message-ID: <20100707155227.E68D52A6C12C@llvm.org> Author: lattner Date: Wed Jul 7 10:52:27 2010 New Revision: 107785 URL: http://llvm.org/viewvc/llvm-project?rev=107785&view=rev Log: add some triple for minix, patch by Kees van Reeuwijk from PR7582 Modified: llvm/trunk/include/llvm/ADT/Triple.h llvm/trunk/lib/Support/Triple.cpp llvm/trunk/lib/Support/raw_ostream.cpp llvm/trunk/lib/System/Unix/Program.inc Modified: llvm/trunk/include/llvm/ADT/Triple.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=107785&r1=107784&r2=107785&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/Triple.h (original) +++ llvm/trunk/include/llvm/ADT/Triple.h Wed Jul 7 10:52:27 2010 @@ -100,7 +100,8 @@ Psp, Solaris, Win32, - Haiku + Haiku, + Minix }; private: Modified: llvm/trunk/lib/Support/Triple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=107785&r1=107784&r2=107785&view=diff ============================================================================== --- llvm/trunk/lib/Support/Triple.cpp (original) +++ llvm/trunk/lib/Support/Triple.cpp Wed Jul 7 10:52:27 2010 @@ -104,6 +104,7 @@ case Solaris: return "solaris"; case Win32: return "win32"; case Haiku: return "haiku"; + case Minix: return "minix"; } return ""; @@ -326,7 +327,9 @@ else if (OSName.startswith("win32")) OS = Win32; else if (OSName.startswith("haiku")) - OS = Haiku; + OS = Haiku; + else if (OSName.startswith("minix")) + OS = Minix; else OS = UnknownOS; Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=107785&r1=107784&r2=107785&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Wed Jul 7 10:52:27 2010 @@ -481,7 +481,7 @@ } size_t raw_fd_ostream::preferred_buffer_size() const { -#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_MINIX) +#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__minix) // Windows and Minix have no st_blksize. assert(FD >= 0 && "File not yet open!"); struct stat statbuf; Modified: llvm/trunk/lib/System/Unix/Program.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=107785&r1=107784&r2=107785&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Program.inc (original) +++ llvm/trunk/lib/System/Unix/Program.inc Wed Jul 7 10:52:27 2010 @@ -310,7 +310,7 @@ // fact of having a handler at all causes the wait below to return with EINTR, // unlike if we used SIG_IGN. if (secondsToWait) { -#ifndef __HAIKU__ +#if !defined(__HAIKU__) && !defined(__minix) Act.sa_sigaction = 0; #endif Act.sa_handler = TimeOutHandler; From gohman at apple.com Wed Jul 7 10:54:55 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 15:54:55 -0000 Subject: [llvm-commits] [llvm] r107786 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/Blackfin/ lib/Target/CellSPU/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/SystemZ/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <20100707155455.F08C72A6C12C@llvm.org> Author: djg Date: Wed Jul 7 10:54:55 2010 New Revision: 107786 URL: http://llvm.org/viewvc/llvm-project?rev=107786&view=rev Log: Split the SDValue out of OutputArg so that SelectionDAG-independent code can do calling-convention queries. This obviates OutputArgReg. Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/Target/TargetCallingConv.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/CallingConvLower.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.h llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.h llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.h llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.h llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.h llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.h llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.h llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.h Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Jul 7 10:54:55 2010 @@ -184,8 +184,6 @@ /// incorporating info about the result values into this state. void AnalyzeReturn(const SmallVectorImpl &Outs, CCAssignFn Fn); - void AnalyzeReturn(const SmallVectorImpl &Outs, - CCAssignFn Fn); /// CheckReturn - Analyze the return values of a function, returning /// true if the return can be performed without sret-demotion, and @@ -198,8 +196,6 @@ /// incorporating info about the passed values into this state. void AnalyzeCallOperands(const SmallVectorImpl &Outs, CCAssignFn Fn); - void AnalyzeCallOperands(const SmallVectorImpl &Outs, - CCAssignFn Fn); /// AnalyzeCallOperands - Same as above except it takes vectors of types /// and argument flags. Modified: llvm/trunk/include/llvm/Target/TargetCallingConv.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetCallingConv.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetCallingConv.h (original) +++ llvm/trunk/include/llvm/Target/TargetCallingConv.h Wed Jul 7 10:54:55 2010 @@ -14,8 +14,6 @@ #ifndef LLVM_TARGET_TARGETCALLINGCONV_H #define LLVM_TARGET_TARGETCALLINGCONV_H -#include "llvm/CodeGen/SelectionDAGNodes.h" - namespace llvm { namespace ISD { @@ -112,7 +110,7 @@ bool Used; InputArg() : VT(MVT::Other), Used(false) {} - InputArg(ISD::ArgFlagsTy flags, EVT vt, bool used) + InputArg(ArgFlagsTy flags, EVT vt, bool used) : Flags(flags), VT(vt), Used(used) { assert(VT.isSimple() && "InputArg value type must be Simple!"); @@ -125,35 +123,18 @@ /// struct OutputArg { ArgFlagsTy Flags; - SDValue Val; + EVT VT; /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". bool IsFixed; OutputArg() : IsFixed(false) {} - OutputArg(ISD::ArgFlagsTy flags, SDValue val, bool isfixed) - : Flags(flags), Val(val), IsFixed(isfixed) { - assert(Val.getValueType().isSimple() && + OutputArg(ArgFlagsTy flags, EVT vt, bool isfixed) + : Flags(flags), VT(vt), IsFixed(isfixed) { + assert(VT.isSimple() && "OutputArg value type must be Simple!"); } }; - - /// OutputArgReg - This struct carries flags and a register value for a - /// single outgoing (actual) argument or outgoing (from the perspective - /// of the caller) return value virtual register. - /// - struct OutputArgReg { - ArgFlagsTy Flags; - EVT VT; - unsigned Reg; - - /// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...". - bool IsFixed; - - OutputArgReg() : IsFixed(false) {} - OutputArgReg(ISD::ArgFlagsTy flags, EVT vt, unsigned reg, bool isfixed) - : Flags(flags), VT(vt), Reg(reg), IsFixed(isfixed) {} - }; } } // end llvm namespace Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jul 7 10:54:55 2010 @@ -1145,6 +1145,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -1173,6 +1174,7 @@ virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { assert(0 && "Not Implemented"); return SDValue(); // this is here to silence compiler errors Modified: llvm/trunk/lib/CodeGen/CallingConvLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CallingConvLower.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CallingConvLower.cpp (original) +++ llvm/trunk/lib/CodeGen/CallingConvLower.cpp Wed Jul 7 10:54:55 2010 @@ -99,22 +99,6 @@ CCAssignFn Fn) { // Determine which register each value should be copied into. for (unsigned i = 0, e = Outs.size(); i != e; ++i) { - EVT VT = Outs[i].Val.getValueType(); - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; - if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Return operand #" << i << " has unhandled type " - << VT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -void CCState::AnalyzeReturn(const SmallVectorImpl &Outs, - CCAssignFn Fn) { - // Determine which register each value should be copied into. - for (unsigned i = 0, e = Outs.size(); i != e; ++i) { EVT VT = Outs[i].VT; ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) { @@ -127,32 +111,12 @@ } } - /// AnalyzeCallOperands - Analyze the outgoing arguments to a call, /// incorporating info about the passed values into this state. void CCState::AnalyzeCallOperands(const SmallVectorImpl &Outs, CCAssignFn Fn) { unsigned NumOps = Outs.size(); for (unsigned i = 0; i != NumOps; ++i) { - EVT ArgVT = Outs[i].Val.getValueType(); - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; - if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { -#ifndef NDEBUG - dbgs() << "Call operand #" << i << " has unhandled type " - << ArgVT.getEVTString(); -#endif - llvm_unreachable(0); - } - } -} - -/// AnalyzeCallOperands - Analyze the outgoing arguments to a call, -/// incorporating info about the passed values into this state. -void -CCState::AnalyzeCallOperands(const SmallVectorImpl &Outs, - CCAssignFn Fn) { - unsigned NumOps = Outs.size(); - for (unsigned i = 0; i != NumOps; ++i) { EVT ArgVT = Outs[i].VT; ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Jul 7 10:54:55 2010 @@ -1027,6 +1027,7 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) { SDValue Chain = getControlRoot(); SmallVector Outs; + SmallVector OutVals; if (!FuncInfo.CanLowerReturn) { unsigned DemoteReg = FuncInfo.DemoteRegister; @@ -1105,8 +1106,11 @@ else if (F->paramHasAttr(0, Attribute::ZExt)) Flags.setZExt(); - for (unsigned i = 0; i < NumParts; ++i) - Outs.push_back(ISD::OutputArg(Flags, Parts[i], /*isfixed=*/true)); + for (unsigned i = 0; i < NumParts; ++i) { + Outs.push_back(ISD::OutputArg(Flags, Parts[i].getValueType(), + /*isfixed=*/true)); + OutVals.push_back(Parts[i]); + } } } } @@ -1115,7 +1119,7 @@ CallingConv::ID CallConv = DAG.getMachineFunction().getFunction()->getCallingConv(); Chain = TLI.LowerReturn(Chain, CallConv, isVarArg, - Outs, getCurDebugLoc(), DAG); + Outs, OutVals, getCurDebugLoc(), DAG); // Verify that the target's LowerReturn behaved as expected. assert(Chain.getNode() && Chain.getValueType() == MVT::Other && @@ -5768,6 +5772,7 @@ DebugLoc dl) const { // Handle all of the outgoing arguments. SmallVector Outs; + SmallVector OutVals; for (unsigned i = 0, e = Args.size(); i != e; ++i) { SmallVector ValueVTs; ComputeValueVTs(*this, Args[i].Ty, ValueVTs); @@ -5821,13 +5826,15 @@ for (unsigned j = 0; j != NumParts; ++j) { // if it isn't first piece, alignment must be 1 - ISD::OutputArg MyFlags(Flags, Parts[j], i < NumFixedArgs); + ISD::OutputArg MyFlags(Flags, Parts[j].getValueType(), + i < NumFixedArgs); if (NumParts > 1 && j == 0) MyFlags.Flags.setSplit(); else if (j != 0) MyFlags.Flags.setOrigAlign(1); Outs.push_back(MyFlags); + OutVals.push_back(Parts[j]); } } } @@ -5856,7 +5863,7 @@ SmallVector InVals; Chain = LowerCall(Chain, Callee, CallConv, isVarArg, isTailCall, - Outs, Ins, dl, DAG, InVals); + Outs, OutVals, Ins, dl, DAG, InVals); // Verify that the target's LowerCall behaved as expected. assert(Chain.getNode() && Chain.getValueType() == MVT::Other && Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -1030,6 +1030,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -1043,7 +1044,7 @@ // Check if it's really possible to do a tail call. isTailCall = IsEligibleForTailCallOptimization(Callee, CallConv, isVarArg, IsStructRet, MF.getFunction()->hasStructRetAttr(), - Outs, Ins, DAG); + Outs, OutVals, Ins, DAG); // We don't support GuaranteedTailCallOpt for ARM, only automatically // detected sibcalls. if (isTailCall) { @@ -1083,7 +1084,7 @@ i != e; ++i, ++realArgIdx) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[realArgIdx].Val; + SDValue Arg = OutVals[realArgIdx]; ISD::ArgFlagsTy Flags = Outs[realArgIdx].Flags; // Promote the value if needed. @@ -1377,6 +1378,7 @@ bool isCalleeStructRet, bool isCallerStructRet, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, SelectionDAG& DAG) const { const Function *CallerF = DAG.getMachineFunction().getFunction(); @@ -1470,7 +1472,7 @@ ++i, ++realArgIdx) { CCValAssign &VA = ArgLocs[i]; EVT RegVT = VA.getLocVT(); - SDValue Arg = Outs[realArgIdx].Val; + SDValue Arg = OutVals[realArgIdx]; ISD::ArgFlagsTy Flags = Outs[realArgIdx].Flags; if (VA.getLocInfo() == CCValAssign::Indirect) return false; @@ -1505,6 +1507,7 @@ ARMTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of the return value to a location. @@ -1535,7 +1538,7 @@ CCValAssign &VA = RVLocs[i]; assert(VA.isRegLoc() && "Can only return in registers!"); - SDValue Arg = Outs[realRVLocIdx].Val; + SDValue Arg = OutVals[realRVLocIdx]; switch (VA.getLocInfo()) { default: llvm_unreachable("Unknown loc info!"); Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jul 7 10:54:55 2010 @@ -337,6 +337,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -350,12 +351,14 @@ bool isCalleeStructRet, bool isCallerStructRet, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, SelectionDAG& DAG) const; virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -224,6 +224,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -251,7 +252,7 @@ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { @@ -470,6 +471,7 @@ AlphaTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { SDValue Copy = DAG.getCopyToReg(Chain, dl, Alpha::R26, @@ -483,7 +485,7 @@ break; //return SDValue(); // ret void is legal case 1: { - EVT ArgVT = Outs[0].Val.getValueType(); + EVT ArgVT = Outs[0].VT; unsigned ArgReg; if (ArgVT.isInteger()) ArgReg = Alpha::R0; @@ -492,13 +494,13 @@ ArgReg = Alpha::F0; } Copy = DAG.getCopyToReg(Copy, dl, ArgReg, - Outs[0].Val, Copy.getValue(1)); + OutVals[0], Copy.getValue(1)); if (DAG.getMachineFunction().getRegInfo().liveout_empty()) DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg); break; } case 2: { - EVT ArgVT = Outs[0].Val.getValueType(); + EVT ArgVT = Outs[0].VT; unsigned ArgReg1, ArgReg2; if (ArgVT.isInteger()) { ArgReg1 = Alpha::R0; @@ -509,13 +511,13 @@ ArgReg2 = Alpha::F1; } Copy = DAG.getCopyToReg(Copy, dl, ArgReg1, - Outs[0].Val, Copy.getValue(1)); + OutVals[0], Copy.getValue(1)); if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(), DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg1) == DAG.getMachineFunction().getRegInfo().liveout_end()) DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg1); Copy = DAG.getCopyToReg(Copy, dl, ArgReg2, - Outs[1].Val, Copy.getValue(1)); + OutVals[1], Copy.getValue(1)); if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(), DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg2) == DAG.getMachineFunction().getRegInfo().liveout_end()) Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.h Wed Jul 7 10:54:55 2010 @@ -121,6 +121,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -129,6 +130,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; }; } Modified: llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -219,6 +219,7 @@ BlackfinTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of the return value to locations. @@ -244,7 +245,7 @@ for (unsigned i = 0; i != RVLocs.size(); ++i) { CCValAssign &VA = RVLocs[i]; assert(VA.isRegLoc() && "Can only return in registers!"); - SDValue Opi = Outs[i].Val; + SDValue Opi = OutVals[i]; // Expand to i32 if necessary switch (VA.getLocInfo()) { @@ -277,6 +278,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -300,7 +302,7 @@ // Walk the register/memloc assignments, inserting copies/loads. for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { Modified: llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.h (original) +++ llvm/trunk/lib/Target/Blackfin/BlackfinISelLowering.h Wed Jul 7 10:54:55 2010 @@ -63,6 +63,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -71,6 +72,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; }; } // end namespace llvm Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -1135,6 +1135,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -1166,7 +1167,7 @@ SmallVector MemOpChains; for (unsigned i = 0; i != NumOps; ++i) { - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // PtrOff will be used to store the current argument to the stack if a // register cannot be found for it. @@ -1339,6 +1340,7 @@ SPUTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { SmallVector RVLocs; @@ -1360,7 +1362,7 @@ CCValAssign &VA = RVLocs[i]; assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); Flag = Chain.getValue(1); } Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Wed Jul 7 10:54:55 2010 @@ -159,6 +159,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -167,6 +168,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; }; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -525,6 +525,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -556,7 +557,7 @@ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; EVT RegVT = VA.getLocVT(); - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { @@ -835,6 +836,7 @@ SDValue MBlazeTargetLowering:: LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of // the return value to a location @@ -863,7 +865,7 @@ assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); // guarantee that all emitted copies are // stuck together, avoiding something bad Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.h (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.h Wed Jul 7 10:54:55 2010 @@ -109,6 +109,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -117,6 +118,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; virtual MachineBasicBlock * Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -278,6 +278,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -290,7 +291,7 @@ case CallingConv::Fast: case CallingConv::C: return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall, - Outs, Ins, dl, DAG, InVals); + Outs, OutVals, Ins, dl, DAG, InVals); case CallingConv::MSP430_INTR: report_fatal_error("ISRs cannot be called directly"); return SDValue(); @@ -387,6 +388,7 @@ MSP430TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of the return value to a location @@ -421,7 +423,7 @@ assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); // Guarantee that all emitted copies are stuck together, // avoiding something bad. @@ -447,6 +449,7 @@ bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -471,7 +474,7 @@ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.h (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.h Wed Jul 7 10:54:55 2010 @@ -127,6 +127,7 @@ CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -155,6 +156,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -163,6 +165,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -767,6 +767,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -807,7 +808,7 @@ // Walk the register/memloc assignments, inserting copies/loads. for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; CCValAssign &VA = ArgLocs[i]; // Promote the value if needed. @@ -1168,6 +1169,7 @@ MipsTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of @@ -1197,7 +1199,7 @@ assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); // guarantee that all emitted copies are // stuck together, avoiding something bad Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Wed Jul 7 10:54:55 2010 @@ -120,6 +120,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -128,6 +129,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; virtual MachineBasicBlock * Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -1121,6 +1121,7 @@ LowerIndirectCallArguments(SDValue Chain, SDValue InFlag, SDValue DataAddr_Lo, SDValue DataAddr_Hi, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG) const { unsigned NumOps = Outs.size(); @@ -1137,7 +1138,7 @@ unsigned RetVals = Ins.size(); for (unsigned i = 0, ArgOffset = RetVals; i < NumOps; i++) { // Get the arguments - Arg = Outs[i].Val; + Arg = OutVals[i]; Ops.clear(); Ops.push_back(Chain); @@ -1159,6 +1160,7 @@ SDValue PIC16TargetLowering:: LowerDirectCallArguments(SDValue ArgLabel, SDValue Chain, SDValue InFlag, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { unsigned NumOps = Outs.size(); std::string Name; @@ -1184,7 +1186,7 @@ SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); for (unsigned i=0, Offset = 0; i &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // Number of values to return @@ -1299,7 +1302,7 @@ SDValue BS = DAG.getConstant(1, MVT::i8); SDValue RetVal; for(unsigned i=0;i &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -1462,12 +1466,13 @@ SDValue CallArgs; if (IsDirectCall) { CallArgs = LowerDirectCallArguments(ArgLabel, Chain, OperFlag, - Outs, dl, DAG); + Outs, OutVals, dl, DAG); Chain = getChain(CallArgs); OperFlag = getOutFlag(CallArgs); } else { CallArgs = LowerIndirectCallArguments(Chain, OperFlag, DataAddr_Lo, - DataAddr_Hi, Outs, Ins, dl, DAG); + DataAddr_Hi, Outs, OutVals, Ins, + dl, DAG); Chain = getChain(CallArgs); OperFlag = getOutFlag(CallArgs); } Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h Wed Jul 7 10:54:55 2010 @@ -106,12 +106,14 @@ SDValue LowerDirectCallArguments(SDValue ArgLabel, SDValue Chain, SDValue InFlag, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; SDValue LowerIndirectCallArguments(SDValue Chain, SDValue InFlag, SDValue DataAddr_Lo, SDValue DataAddr_Hi, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG) const; @@ -143,6 +145,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -151,6 +154,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; SDValue ExpandStore(SDNode *N, SelectionDAG &DAG) const; Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -2136,6 +2136,7 @@ unsigned CC, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, unsigned &nAltivecParamsAtEnd) { // Count how many bytes are to be pushed on the stack, including the linkage // area, and parameter passing area. We start with 24/48 bytes, which is @@ -2152,9 +2153,9 @@ // 16-byte aligned. nAltivecParamsAtEnd = 0; for (unsigned i = 0; i != NumOps; ++i) { - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; ISD::ArgFlagsTy Flags = Outs[i].Flags; - EVT ArgVT = Arg.getValueType(); + EVT ArgVT = Outs[i].VT; // Varargs Altivec parameters are padded to a 16 byte boundary. if (ArgVT==MVT::v4f32 || ArgVT==MVT::v4i32 || ArgVT==MVT::v8i16 || ArgVT==MVT::v16i8) { @@ -2704,6 +2705,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -2713,11 +2715,11 @@ if (PPCSubTarget.isSVR4ABI() && !PPCSubTarget.isPPC64()) { return LowerCall_SVR4(Chain, Callee, CallConv, isVarArg, - isTailCall, Outs, Ins, + isTailCall, Outs, OutVals, Ins, dl, DAG, InVals); } else { return LowerCall_Darwin(Chain, Callee, CallConv, isVarArg, - isTailCall, Outs, Ins, + isTailCall, Outs, OutVals, Ins, dl, DAG, InVals); } } @@ -2727,6 +2729,7 @@ CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -2767,7 +2770,7 @@ unsigned NumArgs = Outs.size(); for (unsigned i = 0; i != NumArgs; ++i) { - EVT ArgVT = Outs[i].Val.getValueType(); + EVT ArgVT = Outs[i].VT; ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; bool Result; @@ -2836,7 +2839,7 @@ i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; ISD::ArgFlagsTy Flags = Outs[i].Flags; if (Flags.isByVal()) { @@ -2932,6 +2935,7 @@ CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -2959,7 +2963,7 @@ // prereserved space for [SP][CR][LR][3 x unused]. unsigned NumBytes = CalculateParameterAndLinkageAreaSize(DAG, isPPC64, isVarArg, CallConv, - Outs, + Outs, OutVals, nAltivecParamsAtEnd); // Calculate by how many bytes the stack has to be adjusted in case of tail @@ -3023,7 +3027,7 @@ SmallVector MemOpChains; for (unsigned i = 0; i != NumOps; ++i) { - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; ISD::ArgFlagsTy Flags = Outs[i].Flags; // PtrOff will be used to store the current argument to the stack if a @@ -3226,8 +3230,8 @@ ArgOffset = ((ArgOffset+15)/16)*16; ArgOffset += 12*16; for (unsigned i = 0; i != NumOps; ++i) { - SDValue Arg = Outs[i].Val; - EVT ArgType = Arg.getValueType(); + SDValue Arg = OutVals[i]; + EVT ArgType = Outs[i].VT; if (ArgType==MVT::v4f32 || ArgType==MVT::v4i32 || ArgType==MVT::v8i16 || ArgType==MVT::v16i8) { if (++j > NumVRs) { @@ -3295,6 +3299,7 @@ PPCTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { SmallVector RVLocs; @@ -3316,7 +3321,7 @@ CCValAssign &VA = RVLocs[i]; assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); Flag = Chain.getValue(1); } Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h Wed Jul 7 10:54:55 2010 @@ -435,6 +435,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -443,6 +444,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; SDValue @@ -462,6 +464,7 @@ LowerCall_Darwin(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -469,6 +472,7 @@ LowerCall_SVR4(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -38,6 +38,7 @@ SparcTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of the return value to locations. @@ -66,7 +67,7 @@ assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); // Guarantee that all emitted copies are stuck together with flags. Flag = Chain.getValue(1); @@ -262,6 +263,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -283,7 +285,7 @@ // Count the size of the outgoing arguments. unsigned ArgsSize = 0; for (unsigned i = 0, e = Outs.size(); i != e; ++i) { - switch (Outs[i].Val.getValueType().getSimpleVT().SimpleTy) { + switch (Outs[i].VT.getSimpleVT().SimpleTy) { default: llvm_unreachable("Unknown value type!"); case MVT::i1: case MVT::i8: @@ -316,7 +318,7 @@ // Walk the register/memloc assignments, inserting copies/loads. for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { @@ -358,8 +360,8 @@ unsigned ArgOffset = 68; for (unsigned i = 0, e = Outs.size(); i != e; ++i) { - SDValue Val = Outs[i].Val; - EVT ObjectVT = Val.getValueType(); + SDValue Val = OutVals[i]; + EVT ObjectVT = Outs[i].VT; SDValue ValToStore(0, 0); unsigned ObjSize; switch (ObjectVT.getSimpleVT().SimpleTy) { Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.h Wed Jul 7 10:54:55 2010 @@ -86,6 +86,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -94,6 +95,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const; Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -254,6 +254,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -266,7 +267,7 @@ case CallingConv::Fast: case CallingConv::C: return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall, - Outs, Ins, dl, DAG, InVals); + Outs, OutVals, Ins, dl, DAG, InVals); } } @@ -372,6 +373,7 @@ bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -402,7 +404,7 @@ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { @@ -550,6 +552,7 @@ SystemZTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of the return value to a location @@ -575,7 +578,7 @@ // Copy the result values into the output registers. for (unsigned i = 0; i != RVLocs.size(); ++i) { CCValAssign &VA = RVLocs[i]; - SDValue ResValue = Outs[i].Val; + SDValue ResValue = OutVals[i]; assert(VA.isRegLoc() && "Can only return in registers!"); // If this is an 8/16/32-bit value, it is really should be passed promoted Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.h (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.h Wed Jul 7 10:54:55 2010 @@ -98,6 +98,7 @@ CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -126,6 +127,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -134,6 +136,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; const SystemZSubtarget &Subtarget; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -1231,6 +1231,7 @@ X86TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { MachineFunction &MF = DAG.getMachineFunction(); X86MachineFunctionInfo *FuncInfo = MF.getInfo(); @@ -1258,7 +1259,7 @@ for (unsigned i = 0; i != RVLocs.size(); ++i) { CCValAssign &VA = RVLocs[i]; assert(VA.isRegLoc() && "Can only return in registers!"); - SDValue ValToCopy = Outs[i].Val; + SDValue ValToCopy = OutVals[i]; // Returns in ST0/ST1 are handled specially: these are pushed as operands to // the RET instruction and handled by the FP Stackifier. @@ -1816,6 +1817,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -1828,7 +1830,7 @@ // Check if it's really possible to do a tail call. isTailCall = IsEligibleForTailCallOptimization(Callee, CallConv, isVarArg, IsStructRet, MF.getFunction()->hasStructRetAttr(), - Outs, Ins, DAG); + Outs, OutVals, Ins, DAG); // Sibcalls are automatically detected tailcalls which do not require // ABI changes. @@ -1888,7 +1890,7 @@ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; EVT RegVT = VA.getLocVT(); - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; ISD::ArgFlagsTy Flags = Outs[i].Flags; bool isByVal = Flags.isByVal(); @@ -2027,7 +2029,7 @@ if (VA.isRegLoc()) continue; assert(VA.isMemLoc()); - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; ISD::ArgFlagsTy Flags = Outs[i].Flags; // Create frame index. int32_t Offset = VA.getLocMemOffset()+FPDiff; @@ -2320,6 +2322,7 @@ bool isCalleeStructRet, bool isCallerStructRet, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, SelectionDAG& DAG) const { if (!IsTailCallConvention(CalleeCC) && @@ -2433,7 +2436,7 @@ ((X86TargetMachine&)getTargetMachine()).getInstrInfo(); for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; ISD::ArgFlagsTy Flags = Outs[i].Flags; if (VA.getLocInfo() == CCValAssign::Indirect) return false; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jul 7 10:54:55 2010 @@ -652,6 +652,7 @@ bool isCalleeStructRet, bool isCallerStructRet, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, SelectionDAG& DAG) const; bool IsCalleePop(bool isVarArg, CallingConv::ID CallConv) const; @@ -734,6 +735,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -742,6 +744,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; virtual bool Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Wed Jul 7 10:54:55 2010 @@ -812,6 +812,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -826,7 +827,7 @@ case CallingConv::Fast: case CallingConv::C: return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall, - Outs, Ins, dl, DAG, InVals); + Outs, OutVals, Ins, dl, DAG, InVals); } } @@ -839,6 +840,7 @@ CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { @@ -866,7 +868,7 @@ // Walk the register/memloc assignments, inserting copies/loads. for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - SDValue Arg = Outs[i].Val; + SDValue Arg = OutVals[i]; // Promote the value if needed. switch (VA.getLocInfo()) { @@ -1146,6 +1148,7 @@ XCoreTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { // CCValAssign - represent the assignment of @@ -1175,7 +1178,7 @@ assert(VA.isRegLoc() && "Can only return in registers!"); Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(), - Outs[i].Val, Flag); + OutVals[i], Flag); // guarantee that all emitted copies are // stuck together, avoiding something bad Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.h?rev=107786&r1=107785&r2=107786&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.h (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.h Wed Jul 7 10:54:55 2010 @@ -120,6 +120,7 @@ CallingConv::ID CallConv, bool isVarArg, bool isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -178,6 +179,7 @@ CallingConv::ID CallConv, bool isVarArg, bool &isTailCall, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; @@ -186,6 +188,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, + const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const; virtual bool From gohman at apple.com Wed Jul 7 11:01:37 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 16:01:37 -0000 Subject: [llvm-commits] [llvm] r107787 - in /llvm/trunk: include/llvm/CodeGen/FunctionLoweringInfo.h lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <20100707160137.450D42A6C12C@llvm.org> Author: djg Date: Wed Jul 7 11:01:37 2010 New Revision: 107787 URL: http://llvm.org/viewvc/llvm-project?rev=107787&view=rev Log: Move FunctionLoweringInfo.h out into include/llvm/CodeGen. This will allow target-specific fast-isel code to make use of it directly. Added: llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h - copied, changed from r107781, llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h Removed: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Copied: llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h (from r107781, llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h?p2=llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h&p1=llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h&r1=107781&r2=107787&rev=107787&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h Wed Jul 7 11:01:37 2010 @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef FUNCTIONLOWERINGINFO_H -#define FUNCTIONLOWERINGINFO_H +#ifndef LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H +#define LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107787&r1=107786&r2=107787&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 7 11:01:37 2010 @@ -44,6 +44,7 @@ #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" #include "llvm/CodeGen/FastISel.h" +#include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -54,7 +55,6 @@ #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/ErrorHandling.h" -#include "FunctionLoweringInfo.h" using namespace llvm; bool FastISel::hasTrivialKill(const Value *V) const { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp?rev=107787&r1=107786&r2=107787&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Wed Jul 7 11:01:37 2010 @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #define DEBUG_TYPE "function-lowering-info" -#include "FunctionLoweringInfo.h" +#include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" Removed: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h?rev=107786&view=auto ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h (removed) @@ -1,144 +0,0 @@ -//===-- FunctionLoweringInfo.h - Lower functions from LLVM IR to CodeGen --===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This implements routines for translating functions from LLVM IR into -// Machine IR. -// -//===----------------------------------------------------------------------===// - -#ifndef FUNCTIONLOWERINGINFO_H -#define FUNCTIONLOWERINGINFO_H - -#include "llvm/InlineAsm.h" -#include "llvm/Instructions.h" -#include "llvm/ADT/APInt.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/SmallVector.h" -#ifndef NDEBUG -#include "llvm/ADT/SmallSet.h" -#endif -#include "llvm/CodeGen/ValueTypes.h" -#include "llvm/CodeGen/ISDOpcodes.h" -#include "llvm/Support/CallSite.h" -#include - -namespace llvm { - -class AllocaInst; -class BasicBlock; -class CallInst; -class Function; -class GlobalVariable; -class Instruction; -class MachineInstr; -class MachineBasicBlock; -class MachineFunction; -class MachineModuleInfo; -class MachineRegisterInfo; -class TargetLowering; -class Value; - -//===--------------------------------------------------------------------===// -/// FunctionLoweringInfo - This contains information that is global to a -/// function that is used when lowering a region of the function. -/// -class FunctionLoweringInfo { -public: - const TargetLowering &TLI; - const Function *Fn; - MachineFunction *MF; - MachineRegisterInfo *RegInfo; - - /// CanLowerReturn - true iff the function's return value can be lowered to - /// registers. - bool CanLowerReturn; - - /// DemoteRegister - if CanLowerReturn is false, DemoteRegister is a vreg - /// allocated to hold a pointer to the hidden sret parameter. - unsigned DemoteRegister; - - /// MBBMap - A mapping from LLVM basic blocks to their machine code entry. - DenseMap MBBMap; - - /// ValueMap - Since we emit code for the function a basic block at a time, - /// we must remember which virtual registers hold the values for - /// cross-basic-block values. - DenseMap ValueMap; - - /// StaticAllocaMap - Keep track of frame indices for fixed sized allocas in - /// the entry block. This allows the allocas to be efficiently referenced - /// anywhere in the function. - DenseMap StaticAllocaMap; - - /// ArgDbgValues - A list of DBG_VALUE instructions created during isel for - /// function arguments that are inserted after scheduling is completed. - SmallVector ArgDbgValues; - -#ifndef NDEBUG - SmallSet CatchInfoLost; - SmallSet CatchInfoFound; -#endif - - struct LiveOutInfo { - unsigned NumSignBits; - APInt KnownOne, KnownZero; - LiveOutInfo() : NumSignBits(0), KnownOne(1, 0), KnownZero(1, 0) {} - }; - - /// LiveOutRegInfo - Information about live out vregs, indexed by their - /// register number offset by 'FirstVirtualRegister'. - std::vector LiveOutRegInfo; - - /// PHINodesToUpdate - A list of phi instructions whose operand list will - /// be updated after processing the current basic block. - /// TODO: This isn't per-function state, it's per-basic-block state. But - /// there's no other convenient place for it to live right now. - std::vector > PHINodesToUpdate; - - explicit FunctionLoweringInfo(const TargetLowering &TLI); - - /// set - Initialize this FunctionLoweringInfo with the given Function - /// and its associated MachineFunction. - /// - void set(const Function &Fn, MachineFunction &MF); - - /// clear - Clear out all the function-specific state. This returns this - /// FunctionLoweringInfo to an empty state, ready to be used for a - /// different function. - void clear(); - - /// isExportedInst - Return true if the specified value is an instruction - /// exported from its block. - bool isExportedInst(const Value *V) { - return ValueMap.count(V); - } - - unsigned CreateReg(EVT VT); - - unsigned CreateRegs(const Type *Ty); - - unsigned InitializeRegForValue(const Value *V) { - unsigned &R = ValueMap[V]; - assert(R == 0 && "Already initialized this value register!"); - return R = CreateRegs(V->getType()); - } -}; - -/// AddCatchInfo - Extract the personality and type infos from an eh.selector -/// call, and add them to the specified machine basic block. -void AddCatchInfo(const CallInst &I, - MachineModuleInfo *MMI, MachineBasicBlock *MBB); - -/// CopyCatchInfo - Copy catch information from DestBB to SrcBB. -void CopyCatchInfo(const BasicBlock *SrcBB, const BasicBlock *DestBB, - MachineModuleInfo *MMI, FunctionLoweringInfo &FLI); - -} // end namespace llvm - -#endif Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107787&r1=107786&r2=107787&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Jul 7 11:01:37 2010 @@ -14,7 +14,6 @@ #define DEBUG_TYPE "isel" #include "SDNodeDbgValue.h" #include "SelectionDAGBuilder.h" -#include "FunctionLoweringInfo.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/SmallSet.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -32,6 +31,7 @@ #include "llvm/Module.h" #include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/FastISel.h" +#include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/GCMetadata.h" #include "llvm/CodeGen/MachineFunction.h" Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107787&r1=107786&r2=107787&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 11:01:37 2010 @@ -14,7 +14,7 @@ #define DEBUG_TYPE "isel" #include "ScheduleDAGSDNodes.h" #include "SelectionDAGBuilder.h" -#include "FunctionLoweringInfo.h" +#include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/DebugInfo.h" From gohman at apple.com Wed Jul 7 11:29:44 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 16:29:44 -0000 Subject: [llvm-commits] [llvm] r107789 - in /llvm/trunk: include/llvm/CodeGen/FastISel.h include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h Message-ID: <20100707162945.05D9F2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 11:29:44 2010 New Revision: 107789 URL: http://llvm.org/viewvc/llvm-project?rev=107789&view=rev Log: Simplify FastISel's constructor by giving it a FunctionLoweringInfo instance, rather than pointers to all of FunctionLoweringInfo's members. This eliminates an NDEBUG ABI sensitivity. Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Wed Jul 7 11:29:44 2010 @@ -24,6 +24,7 @@ class AllocaInst; class ConstantFP; +class FunctionLoweringInfo; class Instruction; class MachineBasicBlock; class MachineConstantPool; @@ -45,14 +46,7 @@ protected: MachineBasicBlock *MBB; DenseMap LocalValueMap; - DenseMap &ValueMap; - DenseMap &MBBMap; - DenseMap &StaticAllocaMap; - std::vector > &PHINodesToUpdate; -#ifndef NDEBUG - SmallSet &CatchInfoLost; -#endif - MachineFunction &MF; + FunctionLoweringInfo &FuncInfo; MachineRegisterInfo &MRI; MachineFrameInfo &MFI; MachineConstantPool &MCP; @@ -113,15 +107,7 @@ virtual ~FastISel(); protected: - FastISel(MachineFunction &mf, - DenseMap &vm, - DenseMap &bm, - DenseMap &am, - std::vector > &PHINodesToUpdate -#ifndef NDEBUG - , SmallSet &cil -#endif - ); + explicit FastISel(FunctionLoweringInfo &funcInfo); /// TargetSelectInstruction - This method is called by target-independent /// code when the normal FastISel process fails to select an instruction. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jul 7 11:29:44 2010 @@ -43,6 +43,7 @@ class CallInst; class Function; class FastISel; + class FunctionLoweringInfo; class MachineBasicBlock; class MachineFunction; class MachineFrameInfo; @@ -1223,16 +1224,7 @@ /// createFastISel - This method returns a target specific FastISel object, /// or null if the target does not support "fast" ISel. - virtual FastISel * - createFastISel(MachineFunction &, - DenseMap &, - DenseMap &, - DenseMap &, - std::vector > & -#ifndef NDEBUG - , SmallSet &CatchInfoLost -#endif - ) const { + virtual FastISel *createFastISel(FunctionLoweringInfo &funcInfo) const { return 0; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 7 11:29:44 2010 @@ -100,8 +100,8 @@ // cache values defined by Instructions across blocks, and other values // only locally. This is because Instructions already have the SSA // def-dominates-use requirement enforced. - DenseMap::iterator I = ValueMap.find(V); - if (I != ValueMap.end()) + DenseMap::iterator I = FuncInfo.ValueMap.find(V); + if (I != FuncInfo.ValueMap.end()) return I->second; unsigned Reg = LocalValueMap[V]; if (Reg != 0) @@ -112,7 +112,7 @@ if (IsBottomUp) { Reg = createResultReg(TLI.getRegClassFor(VT)); if (isa(V)) - ValueMap[V] = Reg; + FuncInfo.ValueMap[V] = Reg; else LocalValueMap[V] = Reg; return Reg; @@ -189,8 +189,8 @@ // cache values defined by Instructions across blocks, and other values // only locally. This is because Instructions already have the SSA // def-dominates-use requirement enforced. - DenseMap::iterator I = ValueMap.find(V); - if (I != ValueMap.end()) + DenseMap::iterator I = FuncInfo.ValueMap.find(V); + if (I != FuncInfo.ValueMap.end()) return I->second; return LocalValueMap[V]; } @@ -207,7 +207,7 @@ return Reg; } - unsigned &AssignedReg = ValueMap[I]; + unsigned &AssignedReg = FuncInfo.ValueMap[I]; if (AssignedReg == 0) AssignedReg = Reg; else if (Reg != AssignedReg) { @@ -400,7 +400,7 @@ case Intrinsic::dbg_declare: { const DbgDeclareInst *DI = cast(I); if (!DIVariable(DI->getVariable()).Verify() || - !MF.getMMI().hasDebugInfo()) + !FuncInfo.MF->getMMI().hasDebugInfo()) return true; const Value *Address = DI->getAddress(); @@ -414,11 +414,12 @@ // those are handled in SelectionDAGBuilder. if (AI) { DenseMap::iterator SI = - StaticAllocaMap.find(AI); - if (SI == StaticAllocaMap.end()) break; // VLAs. + FuncInfo.StaticAllocaMap.find(AI); + if (SI == FuncInfo.StaticAllocaMap.end()) break; // VLAs. int FI = SI->second; if (!DI->getDebugLoc().isUnknown()) - MF.getMMI().setVariableDbgInfo(DI->getVariable(), FI, DI->getDebugLoc()); + FuncInfo.MF->getMMI().setVariableDbgInfo(DI->getVariable(), + FI, DI->getDebugLoc()); } else // Building the map above is target independent. Generating DBG_VALUE // inline is target dependent; do this now. @@ -478,10 +479,10 @@ default: break; case TargetLowering::Expand: { if (MBB->isLandingPad()) - AddCatchInfo(*cast(I), &MF.getMMI(), MBB); + AddCatchInfo(*cast(I), &FuncInfo.MF->getMMI(), MBB); else { #ifndef NDEBUG - CatchInfoLost.insert(cast(I)); + FuncInfo.CatchInfoLost.insert(cast(I)); #endif // FIXME: Mark exception selector register as live in. Hack for PR1508. unsigned Reg = TLI.getExceptionSelectorRegister(); @@ -790,7 +791,7 @@ if (BI->isUnconditional()) { const BasicBlock *LLVMSucc = BI->getSuccessor(0); - MachineBasicBlock *MSucc = MBBMap[LLVMSucc]; + MachineBasicBlock *MSucc = FuncInfo.MBBMap[LLVMSucc]; FastEmitBranch(MSucc, BI->getDebugLoc()); return true; } @@ -806,7 +807,7 @@ case Instruction::Alloca: // FunctionLowering has the static-sized case covered. - if (StaticAllocaMap.count(cast(I))) + if (FuncInfo.StaticAllocaMap.count(cast(I))) return true; // Dynamic-sized alloca is not handled yet. @@ -852,28 +853,13 @@ } } -FastISel::FastISel(MachineFunction &mf, - DenseMap &vm, - DenseMap &bm, - DenseMap &am, - std::vector > &pn -#ifndef NDEBUG - , SmallSet &cil -#endif - ) +FastISel::FastISel(FunctionLoweringInfo &funcInfo) : MBB(0), - ValueMap(vm), - MBBMap(bm), - StaticAllocaMap(am), - PHINodesToUpdate(pn), -#ifndef NDEBUG - CatchInfoLost(cil), -#endif - MF(mf), - MRI(MF.getRegInfo()), - MFI(*MF.getFrameInfo()), - MCP(*MF.getConstantPool()), - TM(MF.getTarget()), + FuncInfo(funcInfo), + MRI(FuncInfo.MF->getRegInfo()), + MFI(*FuncInfo.MF->getFrameInfo()), + MCP(*FuncInfo.MF->getConstantPool()), + TM(FuncInfo.MF->getTarget()), TD(*TM.getTargetData()), TII(*TM.getInstrInfo()), TLI(*TM.getTargetLowering()), @@ -1183,14 +1169,14 @@ const TerminatorInst *TI = LLVMBB->getTerminator(); SmallPtrSet SuccsHandled; - unsigned OrigNumPHINodesToUpdate = PHINodesToUpdate.size(); + unsigned OrigNumPHINodesToUpdate = FuncInfo.PHINodesToUpdate.size(); // Check successor nodes' PHI nodes that expect a constant to be available // from this block. for (unsigned succ = 0, e = TI->getNumSuccessors(); succ != e; ++succ) { const BasicBlock *SuccBB = TI->getSuccessor(succ); if (!isa(SuccBB->begin())) continue; - MachineBasicBlock *SuccMBB = MBBMap[SuccBB]; + MachineBasicBlock *SuccMBB = FuncInfo.MBBMap[SuccBB]; // If this terminator has multiple identical successors (common for // switches), only handle each succ once. @@ -1219,7 +1205,7 @@ if (VT == MVT::i1) VT = TLI.getTypeToTransformTo(LLVMBB->getContext(), VT); else { - PHINodesToUpdate.resize(OrigNumPHINodesToUpdate); + FuncInfo.PHINodesToUpdate.resize(OrigNumPHINodesToUpdate); return false; } } @@ -1234,10 +1220,10 @@ unsigned Reg = getRegForValue(PHIOp); if (Reg == 0) { - PHINodesToUpdate.resize(OrigNumPHINodesToUpdate); + FuncInfo.PHINodesToUpdate.resize(OrigNumPHINodesToUpdate); return false; } - PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg)); + FuncInfo.PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg)); DL = DebugLoc(); } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 11:29:44 2010 @@ -671,13 +671,7 @@ // Initialize the Fast-ISel state, if needed. FastISel *FastIS = 0; if (EnableFastISel) - FastIS = TLI.createFastISel(*MF, FuncInfo->ValueMap, FuncInfo->MBBMap, - FuncInfo->StaticAllocaMap, - FuncInfo->PHINodesToUpdate -#ifndef NDEBUG - , FuncInfo->CatchInfoLost -#endif - ); + FastIS = TLI.createFastISel(*FuncInfo); // Iterate over all basic blocks in the function. for (Function::const_iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) { Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 7 11:29:44 2010 @@ -24,6 +24,7 @@ #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" #include "llvm/CodeGen/FastISel.h" +#include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -52,20 +53,7 @@ bool X86ScalarSSEf32; public: - explicit X86FastISel(MachineFunction &mf, - DenseMap &vm, - DenseMap &bm, - DenseMap &am, - std::vector > &pn -#ifndef NDEBUG - , SmallSet &cil -#endif - ) - : FastISel(mf, vm, bm, am, pn -#ifndef NDEBUG - , cil -#endif - ) { + explicit X86FastISel(FunctionLoweringInfo &funcInfo) : FastISel(funcInfo) { Subtarget = &TM.getSubtarget(); StackPtr = Subtarget->is64Bit() ? X86::RSP : X86::ESP; X86ScalarSSEf64 = Subtarget->hasSSE2(); @@ -345,7 +333,7 @@ // Don't walk into other basic blocks; it's possible we haven't // visited them yet, so the instructions may not yet be assigned // virtual registers. - if (MBBMap[I->getParent()] != MBB) + if (FuncInfo.MBBMap[I->getParent()] != MBB) return false; Opcode = I->getOpcode(); @@ -382,8 +370,9 @@ case Instruction::Alloca: { // Do static allocas. const AllocaInst *A = cast(V); - DenseMap::iterator SI = StaticAllocaMap.find(A); - if (SI != StaticAllocaMap.end()) { + DenseMap::iterator SI = + FuncInfo.StaticAllocaMap.find(A); + if (SI != FuncInfo.StaticAllocaMap.end()) { AM.BaseType = X86AddressMode::FrameIndexBase; AM.Base.FrameIndex = SI->second; return true; @@ -498,7 +487,7 @@ // If this reference is relative to the pic base, set it now. if (isGlobalRelativeToPICBase(GVFlags)) { // FIXME: How do we know Base.Reg is free?? - AM.Base.Reg = getInstrInfo()->getGlobalBaseReg(&MF); + AM.Base.Reg = getInstrInfo()->getGlobalBaseReg(FuncInfo.MF); } // Unless the ABI requires an extra load, return a direct reference to @@ -844,8 +833,8 @@ // Unconditional branches are selected by tablegen-generated code. // Handle a conditional branch. const BranchInst *BI = cast(I); - MachineBasicBlock *TrueMBB = MBBMap[BI->getSuccessor(0)]; - MachineBasicBlock *FalseMBB = MBBMap[BI->getSuccessor(1)]; + MachineBasicBlock *TrueMBB = FuncInfo.MBBMap[BI->getSuccessor(0)]; + MachineBasicBlock *FalseMBB = FuncInfo.MBBMap[BI->getSuccessor(1)]; // Fold the common case of a conditional branch with a comparison. if (const CmpInst *CI = dyn_cast(BI->getCondition())) { @@ -1511,7 +1500,7 @@ // GOT pointer. if (Subtarget->isPICStyleGOT()) { TargetRegisterClass *RC = X86::GR32RegisterClass; - unsigned Base = getInstrInfo()->getGlobalBaseReg(&MF); + unsigned Base = getInstrInfo()->getGlobalBaseReg(FuncInfo.MF); bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), X86::EBX, Base, RC, RC, DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; @@ -1758,10 +1747,10 @@ unsigned char OpFlag = 0; if (Subtarget->isPICStyleStubPIC()) { // Not dynamic-no-pic OpFlag = X86II::MO_PIC_BASE_OFFSET; - PICBase = getInstrInfo()->getGlobalBaseReg(&MF); + PICBase = getInstrInfo()->getGlobalBaseReg(FuncInfo.MF); } else if (Subtarget->isPICStyleGOT()) { OpFlag = X86II::MO_GOTOFF; - PICBase = getInstrInfo()->getGlobalBaseReg(&MF); + PICBase = getInstrInfo()->getGlobalBaseReg(FuncInfo.MF); } else if (Subtarget->isPICStyleRIPRel() && TM.getCodeModel() == CodeModel::Small) { PICBase = X86::RIP; @@ -1784,7 +1773,7 @@ // various places, but TargetMaterializeAlloca also needs a check // in order to avoid recursion between getRegForValue, // X86SelectAddrss, and TargetMaterializeAlloca. - if (!StaticAllocaMap.count(C)) + if (!FuncInfo.StaticAllocaMap.count(C)) return 0; X86AddressMode AM; @@ -1798,19 +1787,7 @@ } namespace llvm { - llvm::FastISel *X86::createFastISel(MachineFunction &mf, - DenseMap &vm, - DenseMap &bm, - DenseMap &am, - std::vector > &pn -#ifndef NDEBUG - , SmallSet &cil -#endif - ) { - return new X86FastISel(mf, vm, bm, am, pn -#ifndef NDEBUG - , cil -#endif - ); + llvm::FastISel *X86::createFastISel(FunctionLoweringInfo &funcInfo) { + return new X86FastISel(funcInfo); } } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 7 11:29:44 2010 @@ -2471,20 +2471,8 @@ } FastISel * -X86TargetLowering::createFastISel(MachineFunction &mf, - DenseMap &vm, - DenseMap &bm, - DenseMap &am, - std::vector > &pn -#ifndef NDEBUG - , SmallSet &cil -#endif - ) const { - return X86::createFastISel(mf, vm, bm, am, pn -#ifndef NDEBUG - , cil -#endif - ); +X86TargetLowering::createFastISel(FunctionLoweringInfo &funcInfo) const { + return X86::createFastISel(funcInfo); } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107789&r1=107788&r2=107789&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jul 7 11:29:44 2010 @@ -579,16 +579,7 @@ /// createFastISel - This method returns a target specific FastISel object, /// or null if the target does not support "fast" ISel. - virtual FastISel * - createFastISel(MachineFunction &mf, - DenseMap &, - DenseMap &, - DenseMap &, - std::vector > & -#ifndef NDEBUG - , SmallSet & -#endif - ) const; + virtual FastISel *createFastISel(FunctionLoweringInfo &funcInfo) const; /// getFunctionAlignment - Return the Log2 alignment of this function. virtual unsigned getFunctionAlignment(const Function *F) const; @@ -821,15 +812,7 @@ }; namespace X86 { - FastISel *createFastISel(MachineFunction &mf, - DenseMap &, - DenseMap &, - DenseMap &, - std::vector > & -#ifndef NDEBUG - , SmallSet & -#endif - ); + FastISel *createFastISel(FunctionLoweringInfo &funcInfo); } } From gohman at apple.com Wed Jul 7 11:47:08 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 16:47:08 -0000 Subject: [llvm-commits] [llvm] r107791 - in /llvm/trunk: include/llvm/CodeGen/FastISel.h include/llvm/CodeGen/FunctionLoweringInfo.h include/llvm/CodeGen/SelectionDAGISel.h lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/X86/X86FastISel.cpp utils/TableGen/FastISelEmitter.cpp Message-ID: <20100707164709.0E5E12A6C12C@llvm.org> Author: djg Date: Wed Jul 7 11:47:08 2010 New Revision: 107791 URL: http://llvm.org/viewvc/llvm-project?rev=107791&view=rev Log: Give FunctionLoweringInfo an MBB member, avoiding the need to pass it around everywhere, and also give it an InsertPt member, to enable isel to operate at an arbitrary position within a block, rather than just appending to a block. Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/utils/TableGen/FastISelEmitter.cpp Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Wed Jul 7 11:47:08 2010 @@ -44,7 +44,6 @@ /// lowering, but runs quickly. class FastISel { protected: - MachineBasicBlock *MBB; DenseMap LocalValueMap; FunctionLoweringInfo &FuncInfo; MachineRegisterInfo &MRI; @@ -62,18 +61,10 @@ /// startNewBlock - Set the current block to which generated machine /// instructions will be appended, and clear the local CSE map. /// - void startNewBlock(MachineBasicBlock *mbb) { - setCurrentBlock(mbb); + void startNewBlock() { LocalValueMap.clear(); } - /// setCurrentBlock - Set the current block to which generated machine - /// instructions will be appended. - /// - void setCurrentBlock(MachineBasicBlock *mbb) { - MBB = mbb; - } - /// getCurDebugLoc() - Return current debug location information. DebugLoc getCurDebugLoc() const { return DL; } Modified: llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h Wed Jul 7 11:47:08 2010 @@ -25,6 +25,7 @@ #endif #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/Support/CallSite.h" #include @@ -80,6 +81,12 @@ /// function arguments that are inserted after scheduling is completed. SmallVector ArgDbgValues; + /// MBB - The current block. + MachineBasicBlock *MBB; + + /// MBB - The current insert position inside the current block. + MachineBasicBlock::iterator InsertPt; + #ifndef NDEBUG SmallSet CatchInfoLost; SmallSet CatchInfoFound; Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Wed Jul 7 11:47:08 2010 @@ -280,15 +280,14 @@ SDNode *MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTs, const SDValue *Ops, unsigned NumOps, unsigned EmitNodeInfo); - void PrepareEHLandingPad(MachineBasicBlock *BB); + void PrepareEHLandingPad(); void SelectAllBasicBlocks(const Function &Fn); - void FinishBasicBlock(MachineBasicBlock *BB); + void FinishBasicBlock(); - MachineBasicBlock *SelectBasicBlock(MachineBasicBlock *BB, - BasicBlock::const_iterator Begin, - BasicBlock::const_iterator End, - bool &HadTailCall); - MachineBasicBlock *CodeGenAndEmitDAG(MachineBasicBlock *BB); + void SelectBasicBlock(BasicBlock::const_iterator Begin, + BasicBlock::const_iterator End, + bool &HadTailCall); + void CodeGenAndEmitDAG(); void LowerArguments(const BasicBlock *BB); void ComputeLiveOutVRegInfo(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 7 11:47:08 2010 @@ -169,7 +169,8 @@ Reg = lookUpRegForValue(Op); } else if (isa(V)) { Reg = createResultReg(TLI.getRegClassFor(VT)); - BuildMI(MBB, DL, TII.get(TargetOpcode::IMPLICIT_DEF), Reg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::IMPLICIT_DEF), Reg); } // If target-independent code couldn't handle the value, give target-specific @@ -212,7 +213,7 @@ AssignedReg = Reg; else if (Reg != AssignedReg) { const TargetRegisterClass *RegClass = MRI.getRegClass(Reg); - TII.copyRegToReg(*MBB, MBB->end(), AssignedReg, + TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, AssignedReg, Reg, RegClass, RegClass, DL); } return AssignedReg; @@ -434,23 +435,28 @@ if (!V) { // Currently the optimizer can produce this; insert an undef to // help debugging. Probably the optimizer should not do this. - BuildMI(MBB, DL, II).addReg(0U).addImm(DI->getOffset()). - addMetadata(DI->getVariable()); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(0U).addImm(DI->getOffset()) + .addMetadata(DI->getVariable()); } else if (const ConstantInt *CI = dyn_cast(V)) { - BuildMI(MBB, DL, II).addImm(CI->getZExtValue()).addImm(DI->getOffset()). - addMetadata(DI->getVariable()); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addImm(CI->getZExtValue()).addImm(DI->getOffset()) + .addMetadata(DI->getVariable()); } else if (const ConstantFP *CF = dyn_cast(V)) { - BuildMI(MBB, DL, II).addFPImm(CF).addImm(DI->getOffset()). - addMetadata(DI->getVariable()); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addFPImm(CF).addImm(DI->getOffset()) + .addMetadata(DI->getVariable()); } else if (unsigned Reg = lookUpRegForValue(V)) { - BuildMI(MBB, DL, II).addReg(Reg, RegState::Debug).addImm(DI->getOffset()). - addMetadata(DI->getVariable()); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Reg, RegState::Debug).addImm(DI->getOffset()) + .addMetadata(DI->getVariable()); } else { // We can't yet handle anything else here because it would require // generating code, thus altering codegen because of debug info. // Insert an undef so we can see what we dropped. - BuildMI(MBB, DL, II).addReg(0U).addImm(DI->getOffset()). - addMetadata(DI->getVariable()); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(0U).addImm(DI->getOffset()) + .addMetadata(DI->getVariable()); } return true; } @@ -459,12 +465,13 @@ switch (TLI.getOperationAction(ISD::EXCEPTIONADDR, VT)) { default: break; case TargetLowering::Expand: { - assert(MBB->isLandingPad() && "Call to eh.exception not in landing pad!"); + assert(FuncInfo.MBB->isLandingPad() && + "Call to eh.exception not in landing pad!"); unsigned Reg = TLI.getExceptionAddressRegister(); const TargetRegisterClass *RC = TLI.getRegClassFor(VT); unsigned ResultReg = createResultReg(RC); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - Reg, RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, Reg, RC, RC, DL); assert(InsertedCopy && "Can't copy address registers!"); InsertedCopy = InsertedCopy; UpdateValueMap(I, ResultReg); @@ -478,23 +485,23 @@ switch (TLI.getOperationAction(ISD::EHSELECTION, VT)) { default: break; case TargetLowering::Expand: { - if (MBB->isLandingPad()) - AddCatchInfo(*cast(I), &FuncInfo.MF->getMMI(), MBB); + if (FuncInfo.MBB->isLandingPad()) + AddCatchInfo(*cast(I), &FuncInfo.MF->getMMI(), FuncInfo.MBB); else { #ifndef NDEBUG FuncInfo.CatchInfoLost.insert(cast(I)); #endif // FIXME: Mark exception selector register as live in. Hack for PR1508. unsigned Reg = TLI.getExceptionSelectorRegister(); - if (Reg) MBB->addLiveIn(Reg); + if (Reg) FuncInfo.MBB->addLiveIn(Reg); } unsigned Reg = TLI.getExceptionSelectorRegister(); EVT SrcVT = TLI.getPointerTy(); const TargetRegisterClass *RC = TLI.getRegClassFor(SrcVT); unsigned ResultReg = createResultReg(RC); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, Reg, - RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, Reg, RC, RC, DL); assert(InsertedCopy && "Can't copy address registers!"); InsertedCopy = InsertedCopy; @@ -613,8 +620,9 @@ TargetRegisterClass* DstClass = TLI.getRegClassFor(DstVT); ResultReg = createResultReg(DstClass); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - Op0, DstClass, SrcClass, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, Op0, + DstClass, SrcClass, DL); if (!InsertedCopy) ResultReg = 0; } @@ -662,13 +670,14 @@ /// the CFG. void FastISel::FastEmitBranch(MachineBasicBlock *MSucc, DebugLoc DL) { - if (MBB->isLayoutSuccessor(MSucc)) { + if (FuncInfo.MBB->isLayoutSuccessor(MSucc)) { // The unconditional fall-through case, which needs no instructions. } else { // The unconditional branch case. - TII.InsertBranch(*MBB, MSucc, NULL, SmallVector(), DL); + TII.InsertBranch(*FuncInfo.MBB, MSucc, NULL, + SmallVector(), DL); } - MBB->addSuccessor(MSucc); + FuncInfo.MBB->addSuccessor(MSucc); } /// SelectFNeg - Emit an FNeg operation. @@ -854,8 +863,7 @@ } FastISel::FastISel(FunctionLoweringInfo &funcInfo) - : MBB(0), - FuncInfo(funcInfo), + : FuncInfo(funcInfo), MRI(FuncInfo.MF->getRegInfo()), MFI(*FuncInfo.MF->getFrameInfo()), MCP(*FuncInfo.MF->getConstantPool()), @@ -993,7 +1001,7 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, DL, II, ResultReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg); return ResultReg; } @@ -1004,11 +1012,14 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg).addReg(Op0, Op0IsKill * RegState::Kill); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + .addReg(Op0, Op0IsKill * RegState::Kill); else { - BuildMI(MBB, DL, II).addReg(Op0, Op0IsKill * RegState::Kill); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + .addReg(Op0, Op0IsKill * RegState::Kill); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1024,15 +1035,16 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill); else { - BuildMI(MBB, DL, II) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1047,15 +1059,16 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Imm); else { - BuildMI(MBB, DL, II) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Imm); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1070,15 +1083,16 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addFPImm(FPImm); else { - BuildMI(MBB, DL, II) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addFPImm(FPImm); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1094,17 +1108,18 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill) .addImm(Imm); else { - BuildMI(MBB, DL, II) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill) .addImm(Imm); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1118,11 +1133,12 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg).addImm(Imm); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg).addImm(Imm); else { - BuildMI(MBB, DL, II).addImm(Imm); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II).addImm(Imm); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1138,15 +1154,16 @@ const TargetInstrDesc &II = TII.get(TargetOpcode::EXTRACT_SUBREG); if (II.getNumDefs() >= 1) - BuildMI(MBB, DL, II, ResultReg) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Idx); else { - BuildMI(MBB, DL, II) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Idx); - bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, - II.ImplicitDefs[0], RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + ResultReg, II.ImplicitDefs[0], + RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 11:47:08 2010 @@ -319,9 +319,8 @@ return true; } -MachineBasicBlock * -SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB, - BasicBlock::const_iterator Begin, +void +SelectionDAGISel::SelectBasicBlock(BasicBlock::const_iterator Begin, BasicBlock::const_iterator End, bool &HadTailCall) { // Lower all of the non-terminator instructions. If a call is emitted @@ -336,7 +335,7 @@ SDB->clear(); // Final step, emit the lowered DAG as machine code. - return CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); } namespace { @@ -425,7 +424,7 @@ } while (!Worklist.empty()); } -MachineBasicBlock *SelectionDAGISel::CodeGenAndEmitDAG(MachineBasicBlock *BB) { +void SelectionDAGISel::CodeGenAndEmitDAG() { std::string GroupName; if (TimePassesIsEnabled) GroupName = "Instruction Selection and Scheduling"; @@ -434,7 +433,7 @@ ViewDAGCombine2 || ViewDAGCombineLT || ViewISelDAGs || ViewSchedDAGs || ViewSUnitDAGs) BlockName = MF->getFunction()->getNameStr() + ":" + - BB->getBasicBlock()->getNameStr(); + FuncInfo->MBB->getBasicBlock()->getNameStr(); DEBUG(dbgs() << "Initial selection DAG:\n"; CurDAG->dump()); @@ -541,7 +540,7 @@ { NamedRegionTimer T("Instruction Scheduling", GroupName, TimePassesIsEnabled); - Scheduler->Run(CurDAG, BB, BB->end()); + Scheduler->Run(CurDAG, FuncInfo->MBB, FuncInfo->InsertPt); } if (ViewSUnitDAGs) Scheduler->viewGraph(); @@ -550,7 +549,7 @@ // inserted into. { NamedRegionTimer T("Instruction Creation", GroupName, TimePassesIsEnabled); - BB = Scheduler->EmitSchedule(); + FuncInfo->MBB = Scheduler->EmitSchedule(); } // Free the scheduler state. @@ -562,8 +561,6 @@ // Free the SelectionDAG state, now that we're finished with it. CurDAG->clear(); - - return BB; } void SelectionDAGISel::DoInstructionSelection() { @@ -625,21 +622,22 @@ /// PrepareEHLandingPad - Emit an EH_LABEL, set up live-in registers, and /// do other setup for EH landing-pad blocks. -void SelectionDAGISel::PrepareEHLandingPad(MachineBasicBlock *BB) { +void SelectionDAGISel::PrepareEHLandingPad() { // Add a label to mark the beginning of the landing pad. Deletion of the // landing pad can thus be detected via the MachineModuleInfo. - MCSymbol *Label = MF->getMMI().addLandingPad(BB); + MCSymbol *Label = MF->getMMI().addLandingPad(FuncInfo->MBB); const TargetInstrDesc &II = TM.getInstrInfo()->get(TargetOpcode::EH_LABEL); - BuildMI(BB, SDB->getCurDebugLoc(), II).addSym(Label); + BuildMI(*FuncInfo->MBB, FuncInfo->InsertPt, SDB->getCurDebugLoc(), II) + .addSym(Label); // Mark exception register as live in. unsigned Reg = TLI.getExceptionAddressRegister(); - if (Reg) BB->addLiveIn(Reg); + if (Reg) FuncInfo->MBB->addLiveIn(Reg); // Mark exception selector register as live in. Reg = TLI.getExceptionSelectorRegister(); - if (Reg) BB->addLiveIn(Reg); + if (Reg) FuncInfo->MBB->addLiveIn(Reg); // FIXME: Hack around an exception handling flaw (PR1508): the personality // function and list of typeids logically belong to the invoke (or, if you @@ -652,7 +650,7 @@ // in exceptions not being caught because no typeids are associated with // the invoke. This may not be the only way things can go wrong, but it // is the only way we try to work around for the moment. - const BasicBlock *LLVMBB = BB->getBasicBlock(); + const BasicBlock *LLVMBB = FuncInfo->MBB->getBasicBlock(); const BranchInst *Br = dyn_cast(LLVMBB->getTerminator()); if (Br && Br->isUnconditional()) { // Critical edge? @@ -676,7 +674,8 @@ // Iterate over all basic blocks in the function. for (Function::const_iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) { const BasicBlock *LLVMBB = &*I; - MachineBasicBlock *BB = FuncInfo->MBBMap[LLVMBB]; + FuncInfo->MBB = FuncInfo->MBBMap[LLVMBB]; + FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); BasicBlock::const_iterator const Begin = LLVMBB->getFirstNonPHI(); BasicBlock::const_iterator const End = LLVMBB->end(); @@ -687,8 +686,8 @@ LowerArguments(LLVMBB); // Setup an EH landing-pad block. - if (BB->isLandingPad()) - PrepareEHLandingPad(BB); + if (FuncInfo->MBB->isLandingPad()) + PrepareEHLandingPad(); // Before doing SelectionDAG ISel, see if FastISel has been requested. if (FastIS) { @@ -697,9 +696,9 @@ if (LLVMBB == &Fn.getEntryBlock()) { CurDAG->setRoot(SDB->getControlRoot()); SDB->clear(); - BB = CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); } - FastIS->startNewBlock(BB); + FastIS->startNewBlock(); // Do FastISel on as many instructions as possible. for (; BI != End; ++BI) { #if 0 @@ -729,7 +728,7 @@ } bool HadTailCall = false; - BB = SelectBasicBlock(BB, BI, llvm::next(BI), HadTailCall); + SelectBasicBlock(BI, llvm::next(BI), HadTailCall); // If the call was emitted as a tail call, we're done with the block. if (HadTailCall) { @@ -737,9 +736,6 @@ break; } - // If the instruction was codegen'd with multiple blocks, - // inform the FastISel object where to resume inserting. - FastIS->setCurrentBlock(BB); continue; } @@ -765,10 +761,10 @@ // block. if (BI != End) { bool HadTailCall; - BB = SelectBasicBlock(BB, BI, End, HadTailCall); + SelectBasicBlock(BI, End, HadTailCall); } - FinishBasicBlock(BB); + FinishBasicBlock(); FuncInfo->PHINodesToUpdate.clear(); } @@ -776,7 +772,7 @@ } void -SelectionDAGISel::FinishBasicBlock(MachineBasicBlock *BB) { +SelectionDAGISel::FinishBasicBlock() { DEBUG(dbgs() << "Total amount of phi nodes to update: " << FuncInfo->PHINodesToUpdate.size() << "\n"; @@ -794,11 +790,11 @@ MachineInstr *PHI = FuncInfo->PHINodesToUpdate[i].first; assert(PHI->isPHI() && "This is not a machine PHI node that we are updating!"); - if (!BB->isSuccessor(PHI->getParent())) + if (!FuncInfo->MBB->isSuccessor(PHI->getParent())) continue; PHI->addOperand( MachineOperand::CreateReg(FuncInfo->PHINodesToUpdate[i].second, false)); - PHI->addOperand(MachineOperand::CreateMBB(BB)); + PHI->addOperand(MachineOperand::CreateMBB(FuncInfo->MBB)); } return; } @@ -807,33 +803,35 @@ // Lower header first, if it wasn't already lowered if (!SDB->BitTestCases[i].Emitted) { // Set the current basic block to the mbb we wish to insert the code into - BB = SDB->BitTestCases[i].Parent; + FuncInfo->MBB = SDB->BitTestCases[i].Parent; + FuncInfo->InsertPt = FuncInfo->MBB->end(); // Emit the code - SDB->visitBitTestHeader(SDB->BitTestCases[i], BB); + SDB->visitBitTestHeader(SDB->BitTestCases[i], FuncInfo->MBB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - BB = CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); } for (unsigned j = 0, ej = SDB->BitTestCases[i].Cases.size(); j != ej; ++j) { // Set the current basic block to the mbb we wish to insert the code into - BB = SDB->BitTestCases[i].Cases[j].ThisBB; + FuncInfo->MBB = SDB->BitTestCases[i].Cases[j].ThisBB; + FuncInfo->InsertPt = FuncInfo->MBB->end(); // Emit the code if (j+1 != ej) SDB->visitBitTestCase(SDB->BitTestCases[i].Cases[j+1].ThisBB, SDB->BitTestCases[i].Reg, SDB->BitTestCases[i].Cases[j], - BB); + FuncInfo->MBB); else SDB->visitBitTestCase(SDB->BitTestCases[i].Default, SDB->BitTestCases[i].Reg, SDB->BitTestCases[i].Cases[j], - BB); + FuncInfo->MBB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - BB = CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); } // Update PHI Nodes @@ -878,22 +876,24 @@ // Lower header first, if it wasn't already lowered if (!SDB->JTCases[i].first.Emitted) { // Set the current basic block to the mbb we wish to insert the code into - BB = SDB->JTCases[i].first.HeaderBB; + FuncInfo->MBB = SDB->JTCases[i].first.HeaderBB; + FuncInfo->InsertPt = FuncInfo->MBB->end(); // Emit the code SDB->visitJumpTableHeader(SDB->JTCases[i].second, SDB->JTCases[i].first, - BB); + FuncInfo->MBB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - BB = CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); } // Set the current basic block to the mbb we wish to insert the code into - BB = SDB->JTCases[i].second.MBB; + FuncInfo->MBB = SDB->JTCases[i].second.MBB; + FuncInfo->InsertPt = FuncInfo->MBB->end(); // Emit the code SDB->visitJumpTable(SDB->JTCases[i].second); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - BB = CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); // Update PHI Nodes for (unsigned pi = 0, pe = FuncInfo->PHINodesToUpdate.size(); @@ -911,11 +911,11 @@ (MachineOperand::CreateMBB(SDB->JTCases[i].first.HeaderBB)); } // JT BB. Just iterate over successors here - if (BB->isSuccessor(PHIBB)) { + if (FuncInfo->MBB->isSuccessor(PHIBB)) { PHI->addOperand (MachineOperand::CreateReg(FuncInfo->PHINodesToUpdate[pi].second, false)); - PHI->addOperand(MachineOperand::CreateMBB(BB)); + PHI->addOperand(MachineOperand::CreateMBB(FuncInfo->MBB)); } } } @@ -927,10 +927,10 @@ MachineInstr *PHI = FuncInfo->PHINodesToUpdate[i].first; assert(PHI->isPHI() && "This is not a machine PHI node that we are updating!"); - if (BB->isSuccessor(PHI->getParent())) { + if (FuncInfo->MBB->isSuccessor(PHI->getParent())) { PHI->addOperand( MachineOperand::CreateReg(FuncInfo->PHINodesToUpdate[i].second, false)); - PHI->addOperand(MachineOperand::CreateMBB(BB)); + PHI->addOperand(MachineOperand::CreateMBB(FuncInfo->MBB)); } } @@ -938,7 +938,8 @@ // additional DAGs necessary. for (unsigned i = 0, e = SDB->SwitchCases.size(); i != e; ++i) { // Set the current basic block to the mbb we wish to insert the code into - MachineBasicBlock *ThisBB = BB = SDB->SwitchCases[i].ThisBB; + MachineBasicBlock *ThisBB = FuncInfo->MBB = SDB->SwitchCases[i].ThisBB; + FuncInfo->InsertPt = FuncInfo->MBB->end(); // Determine the unique successors. SmallVector Succs; @@ -948,21 +949,23 @@ // Emit the code. Note that this could result in ThisBB being split, so // we need to check for updates. - SDB->visitSwitchCase(SDB->SwitchCases[i], BB); + SDB->visitSwitchCase(SDB->SwitchCases[i], FuncInfo->MBB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - ThisBB = CodeGenAndEmitDAG(BB); + CodeGenAndEmitDAG(); + ThisBB = FuncInfo->MBB; // Handle any PHI nodes in successors of this chunk, as if we were coming // from the original BB before switch expansion. Note that PHI nodes can // occur multiple times in PHINodesToUpdate. We have to be very careful to // handle them the right number of times. for (unsigned i = 0, e = Succs.size(); i != e; ++i) { - BB = Succs[i]; + FuncInfo->MBB = Succs[i]; + FuncInfo->InsertPt = FuncInfo->MBB->end(); // BB may have been removed from the CFG if a branch was constant folded. - if (ThisBB->isSuccessor(BB)) { - for (MachineBasicBlock::iterator Phi = BB->begin(); - Phi != BB->end() && Phi->isPHI(); + if (ThisBB->isSuccessor(FuncInfo->MBB)) { + for (MachineBasicBlock::iterator Phi = FuncInfo->MBB->begin(); + Phi != FuncInfo->MBB->end() && Phi->isPHI(); ++Phi) { // This value for this PHI node is recorded in PHINodesToUpdate. for (unsigned pn = 0; ; ++pn) { Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 7 11:47:08 2010 @@ -230,7 +230,8 @@ } ResultReg = createResultReg(RC); - addFullAddress(BuildMI(MBB, DL, TII.get(Opc), ResultReg), AM); + addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, + DL, TII.get(Opc), ResultReg), AM); return true; } @@ -249,7 +250,7 @@ case MVT::i1: { // Mask out all but lowest bit. unsigned AndResult = createResultReg(X86::GR8RegisterClass); - BuildMI(MBB, DL, + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::AND8ri), AndResult).addReg(Val).addImm(1); Val = AndResult; } @@ -266,7 +267,8 @@ break; } - addFullAddress(BuildMI(MBB, DL, TII.get(Opc)), AM).addReg(Val); + addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, + DL, TII.get(Opc)), AM).addReg(Val); return true; } @@ -294,7 +296,8 @@ } if (Opc) { - addFullAddress(BuildMI(MBB, DL, TII.get(Opc)), AM) + addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, + DL, TII.get(Opc)), AM) .addImm(Signed ? (uint64_t) CI->getSExtValue() : CI->getZExtValue()); return true; @@ -333,7 +336,7 @@ // Don't walk into other basic blocks; it's possible we haven't // visited them yet, so the instructions may not yet be assigned // virtual registers. - if (FuncInfo.MBBMap[I->getParent()] != MBB) + if (FuncInfo.MBBMap[I->getParent()] != FuncInfo.MBB) return false; Opcode = I->getOpcode(); @@ -530,7 +533,8 @@ } LoadReg = createResultReg(RC); - addFullAddress(BuildMI(MBB, DL, TII.get(Opc), LoadReg), StubAM); + addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, + DL, TII.get(Opc), LoadReg), StubAM); // Prevent loading GV stub multiple times in same MBB. LocalValueMap[V] = LoadReg; @@ -720,8 +724,9 @@ // CMPri, otherwise use CMPrr. if (const ConstantInt *Op1C = dyn_cast(Op1)) { if (unsigned CompareImmOpc = X86ChooseCmpImmediateOpcode(VT, Op1C)) { - BuildMI(MBB, DL, TII.get(CompareImmOpc)).addReg(Op0Reg) - .addImm(Op1C->getSExtValue()); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CompareImmOpc)) + .addReg(Op0Reg) + .addImm(Op1C->getSExtValue()); return true; } } @@ -731,7 +736,9 @@ unsigned Op1Reg = getRegForValue(Op1); if (Op1Reg == 0) return false; - BuildMI(MBB, DL, TII.get(CompareOpc)).addReg(Op0Reg).addReg(Op1Reg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CompareOpc)) + .addReg(Op0Reg) + .addReg(Op1Reg); return true; } @@ -753,9 +760,10 @@ unsigned EReg = createResultReg(&X86::GR8RegClass); unsigned NPReg = createResultReg(&X86::GR8RegClass); - BuildMI(MBB, DL, TII.get(X86::SETEr), EReg); - BuildMI(MBB, DL, TII.get(X86::SETNPr), NPReg); - BuildMI(MBB, DL, + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::SETEr), EReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(X86::SETNPr), NPReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::AND8rr), ResultReg).addReg(NPReg).addReg(EReg); UpdateValueMap(I, ResultReg); return true; @@ -766,9 +774,13 @@ unsigned NEReg = createResultReg(&X86::GR8RegClass); unsigned PReg = createResultReg(&X86::GR8RegClass); - BuildMI(MBB, DL, TII.get(X86::SETNEr), NEReg); - BuildMI(MBB, DL, TII.get(X86::SETPr), PReg); - BuildMI(MBB, DL, TII.get(X86::OR8rr), ResultReg).addReg(PReg).addReg(NEReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(X86::SETNEr), NEReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(X86::SETPr), PReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(X86::OR8rr), ResultReg) + .addReg(PReg).addReg(NEReg); UpdateValueMap(I, ResultReg); return true; } @@ -807,7 +819,7 @@ if (!X86FastEmitCompare(Op0, Op1, VT)) return false; - BuildMI(MBB, DL, TII.get(SetCCOpc), ResultReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(SetCCOpc), ResultReg); UpdateValueMap(I, ResultReg); return true; } @@ -843,7 +855,7 @@ // Try to take advantage of fallthrough opportunities. CmpInst::Predicate Predicate = CI->getPredicate(); - if (MBB->isLayoutSuccessor(TrueMBB)) { + if (FuncInfo.MBB->isLayoutSuccessor(TrueMBB)) { std::swap(TrueMBB, FalseMBB); Predicate = CmpInst::getInversePredicate(Predicate); } @@ -892,16 +904,18 @@ if (!X86FastEmitCompare(Op0, Op1, VT)) return false; - BuildMI(MBB, DL, TII.get(BranchOpc)).addMBB(TrueMBB); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(BranchOpc)) + .addMBB(TrueMBB); if (Predicate == CmpInst::FCMP_UNE) { // X86 requires a second branch to handle UNE (and OEQ, // which is mapped to UNE above). - BuildMI(MBB, DL, TII.get(X86::JP_4)).addMBB(TrueMBB); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::JP_4)) + .addMBB(TrueMBB); } FastEmitBranch(FalseMBB, DL); - MBB->addSuccessor(TrueMBB); + FuncInfo.MBB->addSuccessor(TrueMBB); return true; } } else if (ExtractValueInst *EI = @@ -927,7 +941,8 @@ unsigned Reg = getRegForValue(EI); for (MachineBasicBlock::const_reverse_iterator - RI = MBB->rbegin(), RE = MBB->rend(); RI != RE; ++RI) { + RI = FuncInfo.MBB->rbegin(), RE = FuncInfo.MBB->rend(); + RI != RE; ++RI) { const MachineInstr &MI = *RI; if (MI.definesRegister(Reg)) { @@ -952,11 +967,11 @@ unsigned OpCode = SetMI->getOpcode(); if (OpCode == X86::SETOr || OpCode == X86::SETBr) { - BuildMI(MBB, DL, TII.get(OpCode == X86::SETOr ? - X86::JO_4 : X86::JB_4)) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(OpCode == X86::SETOr ? X86::JO_4 : X86::JB_4)) .addMBB(TrueMBB); FastEmitBranch(FalseMBB, DL); - MBB->addSuccessor(TrueMBB); + FuncInfo.MBB->addSuccessor(TrueMBB); return true; } } @@ -968,10 +983,12 @@ unsigned OpReg = getRegForValue(BI->getCondition()); if (OpReg == 0) return false; - BuildMI(MBB, DL, TII.get(X86::TEST8rr)).addReg(OpReg).addReg(OpReg); - BuildMI(MBB, DL, TII.get(X86::JNE_4)).addMBB(TrueMBB); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TEST8rr)) + .addReg(OpReg).addReg(OpReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::JNE_4)) + .addMBB(TrueMBB); FastEmitBranch(FalseMBB, DL); - MBB->addSuccessor(TrueMBB); + FuncInfo.MBB->addSuccessor(TrueMBB); return true; } @@ -1028,7 +1045,7 @@ // Fold immediate in shl(x,3). if (const ConstantInt *CI = dyn_cast(I->getOperand(1))) { unsigned ResultReg = createResultReg(RC); - BuildMI(MBB, DL, TII.get(OpImm), + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpImm), ResultReg).addReg(Op0Reg).addImm(CI->getZExtValue() & 0xff); UpdateValueMap(I, ResultReg); return true; @@ -1036,17 +1053,20 @@ unsigned Op1Reg = getRegForValue(I->getOperand(1)); if (Op1Reg == 0) return false; - TII.copyRegToReg(*MBB, MBB->end(), CReg, Op1Reg, RC, RC, DL); + TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + CReg, Op1Reg, RC, RC, DL); // The shift instruction uses X86::CL. If we defined a super-register // of X86::CL, emit an EXTRACT_SUBREG to precisely describe what // we're doing here. if (CReg != X86::CL) - BuildMI(MBB, DL, TII.get(TargetOpcode::EXTRACT_SUBREG), X86::CL) + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(TargetOpcode::EXTRACT_SUBREG), X86::CL) .addReg(CReg).addImm(X86::sub_8bit); unsigned ResultReg = createResultReg(RC); - BuildMI(MBB, DL, TII.get(OpReg), ResultReg).addReg(Op0Reg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpReg), ResultReg) + .addReg(Op0Reg); UpdateValueMap(I, ResultReg); return true; } @@ -1078,9 +1098,11 @@ unsigned Op2Reg = getRegForValue(I->getOperand(2)); if (Op2Reg == 0) return false; - BuildMI(MBB, DL, TII.get(X86::TEST8rr)).addReg(Op0Reg).addReg(Op0Reg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TEST8rr)) + .addReg(Op0Reg).addReg(Op0Reg); unsigned ResultReg = createResultReg(RC); - BuildMI(MBB, DL, TII.get(Opc), ResultReg).addReg(Op1Reg).addReg(Op2Reg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), ResultReg) + .addReg(Op1Reg).addReg(Op2Reg); UpdateValueMap(I, ResultReg); return true; } @@ -1094,7 +1116,9 @@ unsigned OpReg = getRegForValue(V); if (OpReg == 0) return false; unsigned ResultReg = createResultReg(X86::FR64RegisterClass); - BuildMI(MBB, DL, TII.get(X86::CVTSS2SDrr), ResultReg).addReg(OpReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(X86::CVTSS2SDrr), ResultReg) + .addReg(OpReg); UpdateValueMap(I, ResultReg); return true; } @@ -1111,7 +1135,9 @@ unsigned OpReg = getRegForValue(V); if (OpReg == 0) return false; unsigned ResultReg = createResultReg(X86::FR32RegisterClass); - BuildMI(MBB, DL, TII.get(X86::CVTSD2SSrr), ResultReg).addReg(OpReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(X86::CVTSD2SSrr), ResultReg) + .addReg(OpReg); UpdateValueMap(I, ResultReg); return true; } @@ -1146,7 +1172,8 @@ const TargetRegisterClass *CopyRC = (SrcVT == MVT::i16) ? X86::GR16_ABCDRegisterClass : X86::GR32_ABCDRegisterClass; unsigned CopyReg = createResultReg(CopyRC); - BuildMI(MBB, DL, TII.get(CopyOpc), CopyReg).addReg(InputReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CopyOpc), CopyReg) + .addReg(InputReg); // Then issue an extract_subreg. unsigned ResultReg = FastEmitInst_extractsubreg(MVT::i8, @@ -1218,7 +1245,7 @@ return false; unsigned ResultReg = createResultReg(TLI.getRegClassFor(VT)); - BuildMI(MBB, DL, TII.get(OpC), ResultReg). + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpC), ResultReg). addImm(CI->isZero() ? -1ULL : 0); UpdateValueMap(&I, ResultReg); return true; @@ -1232,12 +1259,12 @@ const TargetInstrDesc &II = TII.get(TargetOpcode::DBG_VALUE); // FIXME may need to add RegState::Debug to any registers produced, // although ESP/EBP should be the only ones at the moment. - addFullAddress(BuildMI(MBB, DL, II), AM).addImm(0). - addMetadata(DI->getVariable()); + addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II), AM). + addImm(0).addMetadata(DI->getVariable()); return true; } case Intrinsic::trap: { - BuildMI(MBB, DL, TII.get(X86::TRAP)); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TRAP)); return true; } case Intrinsic::sadd_with_overflow: @@ -1273,7 +1300,8 @@ return false; unsigned ResultReg = createResultReg(TLI.getRegClassFor(VT)); - BuildMI(MBB, DL, TII.get(OpC), ResultReg).addReg(Reg1).addReg(Reg2); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpC), ResultReg) + .addReg(Reg1).addReg(Reg2); unsigned DestReg1 = UpdateValueMap(&I, ResultReg); // If the add with overflow is an intra-block value then we just want to @@ -1291,7 +1319,7 @@ unsigned Opc = X86::SETBr; if (I.getIntrinsicID() == Intrinsic::sadd_with_overflow) Opc = X86::SETOr; - BuildMI(MBB, DL, TII.get(Opc), ResultReg); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), ResultReg); return true; } } @@ -1418,7 +1446,8 @@ // Issue CALLSEQ_START unsigned AdjStackDown = TM.getRegisterInfo()->getCallFrameSetupOpcode(); - BuildMI(MBB, DL, TII.get(AdjStackDown)).addImm(NumBytes); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(AdjStackDown)) + .addImm(NumBytes); // Process argument: walk the register/memloc assignments, inserting // copies / loads. @@ -1474,8 +1503,8 @@ if (VA.isRegLoc()) { TargetRegisterClass* RC = TLI.getRegClassFor(ArgVT); - bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), VA.getLocReg(), - Arg, RC, RC, DL); + bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + VA.getLocReg(), Arg, RC, RC, DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; Emitted = true; RegArgs.push_back(VA.getLocReg()); @@ -1501,8 +1530,8 @@ if (Subtarget->isPICStyleGOT()) { TargetRegisterClass *RC = X86::GR32RegisterClass; unsigned Base = getInstrInfo()->getGlobalBaseReg(FuncInfo.MF); - bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), X86::EBX, Base, RC, RC, - DL); + bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + X86::EBX, Base, RC, RC, DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; Emitted = true; } @@ -1512,7 +1541,8 @@ if (CalleeOp) { // Register-indirect call. unsigned CallOpc = Subtarget->is64Bit() ? X86::CALL64r : X86::CALL32r; - MIB = BuildMI(MBB, DL, TII.get(CallOpc)).addReg(CalleeOp); + MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc)) + .addReg(CalleeOp); } else { // Direct call. @@ -1541,7 +1571,8 @@ } - MIB = BuildMI(MBB, DL, TII.get(CallOpc)).addGlobalAddress(GV, 0, OpFlags); + MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc)) + .addGlobalAddress(GV, 0, OpFlags); } // Add an implicit use GOT pointer in EBX. @@ -1554,7 +1585,8 @@ // Issue CALLSEQ_END unsigned AdjStackUp = TM.getRegisterInfo()->getCallFrameDestroyOpcode(); - BuildMI(MBB, DL, TII.get(AdjStackUp)).addImm(NumBytes).addImm(0); + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(AdjStackUp)) + .addImm(NumBytes).addImm(0); // Now handle call return value (if any). SmallVector UsedRegs; @@ -1581,7 +1613,7 @@ } unsigned ResultReg = createResultReg(DstRC); - bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, ResultReg, RVLocs[0].getLocReg(), DstRC, SrcRC, DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; Emitted = true; @@ -1595,18 +1627,21 @@ unsigned Opc = ResVT == MVT::f32 ? X86::ST_Fp80m32 : X86::ST_Fp80m64; unsigned MemSize = ResVT.getSizeInBits()/8; int FI = MFI.CreateStackObject(MemSize, MemSize, false); - addFrameReference(BuildMI(MBB, DL, TII.get(Opc)), FI).addReg(ResultReg); + addFrameReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(Opc)), FI) + .addReg(ResultReg); DstRC = ResVT == MVT::f32 ? X86::FR32RegisterClass : X86::FR64RegisterClass; Opc = ResVT == MVT::f32 ? X86::MOVSSrm : X86::MOVSDrm; ResultReg = createResultReg(DstRC); - addFrameReference(BuildMI(MBB, DL, TII.get(Opc), ResultReg), FI); + addFrameReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(Opc), ResultReg), FI); } if (AndToI1) { // Mask out all but lowest bit for some call which produces an i1. unsigned AndResult = createResultReg(X86::GR8RegisterClass); - BuildMI(MBB, DL, + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::AND8ri), AndResult).addReg(ResultReg).addImm(1); ResultReg = AndResult; } @@ -1729,7 +1764,8 @@ else Opc = X86::LEA64r; unsigned ResultReg = createResultReg(RC); - addLeaAddress(BuildMI(MBB, DL, TII.get(Opc), ResultReg), AM); + addLeaAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(Opc), ResultReg), AM); return ResultReg; } return 0; @@ -1759,7 +1795,8 @@ // Create the load from the constant pool. unsigned MCPOffset = MCP.getConstantPoolIndex(C, Align); unsigned ResultReg = createResultReg(RC); - addConstantPoolReference(BuildMI(MBB, DL, TII.get(Opc), ResultReg), + addConstantPoolReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(Opc), ResultReg), MCPOffset, PICBase, OpFlag); return ResultReg; @@ -1782,7 +1819,8 @@ unsigned Opc = Subtarget->is64Bit() ? X86::LEA64r : X86::LEA32r; TargetRegisterClass* RC = TLI.getRegClassFor(TLI.getPointerTy()); unsigned ResultReg = createResultReg(RC); - addLeaAddress(BuildMI(MBB, DL, TII.get(Opc), ResultReg), AM); + addLeaAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + TII.get(Opc), ResultReg), AM); return ResultReg; } Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=107791&r1=107790&r2=107791&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Wed Jul 7 11:47:08 2010 @@ -432,7 +432,7 @@ for (unsigned i = 0; i < Memo.PhysRegs->size(); ++i) { if ((*Memo.PhysRegs)[i] != "") - OS << " TII.copyRegToReg(*MBB, MBB->end(), " + OS << " TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, " << (*Memo.PhysRegs)[i] << ", Op" << i << ", " << "TM.getRegisterInfo()->getPhysicalRegisterRegClass(" << (*Memo.PhysRegs)[i] << "), " @@ -526,7 +526,7 @@ for (unsigned i = 0; i < Memo.PhysRegs->size(); ++i) { if ((*Memo.PhysRegs)[i] != "") - OS << " TII.copyRegToReg(*MBB, MBB->end(), " + OS << " TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, " << (*Memo.PhysRegs)[i] << ", Op" << i << ", " << "TM.getRegisterInfo()->getPhysicalRegisterRegClass(" << (*Memo.PhysRegs)[i] << "), " From baldrick at free.fr Wed Jul 7 11:48:16 2010 From: baldrick at free.fr (Duncan Sands) Date: Wed, 07 Jul 2010 16:48:16 -0000 Subject: [llvm-commits] [llvm] r107792 - /llvm/trunk/Makefile Message-ID: <20100707164816.9547E2A6C12C@llvm.org> Author: baldrick Date: Wed Jul 7 11:48:16 2010 New Revision: 107792 URL: http://llvm.org/viewvc/llvm-project?rev=107792&view=rev Log: Issue the warning about being slow whenever optimization is disabled, and not just for Debug+Asserts builds. Modified: llvm/trunk/Makefile Modified: llvm/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=107792&r1=107791&r2=107792&view=diff ============================================================================== --- llvm/trunk/Makefile (original) +++ llvm/trunk/Makefile Wed Jul 7 11:48:16 2010 @@ -181,7 +181,7 @@ ifneq ($(BUILD_DIRS_ONLY),1) all:: $(Echo) '*****' Completed $(BuildMode) Build -ifeq ($(BuildMode),Debug+Asserts) +ifneq ($(ENABLE_OPTIMIZED),1) $(Echo) '*****' Note: Debug build can be 10 times slower than an $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to $(Echo) '*****' make an optimized build. Alternatively you can From baldrick at free.fr Wed Jul 7 11:58:47 2010 From: baldrick at free.fr (Duncan Sands) Date: Wed, 07 Jul 2010 18:58:47 +0200 Subject: [llvm-commits] [llvm] r107779 - /llvm/trunk/Makefile In-Reply-To: <20100707143705.190382A6C12C@llvm.org> References: <20100707143705.190382A6C12C@llvm.org> Message-ID: <4C34B247.3070503@free.fr> > who knows how to cover Asserts or Debug separately > please do not hesitate to extend this Thanks Gabor. I've changed it to test ENABLE_OPTIMIZED instead. Ciao, Duncan. From gohman at apple.com Wed Jul 7 12:28:45 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 17:28:45 -0000 Subject: [llvm-commits] [llvm] r107795 - /llvm/trunk/lib/CodeGen/MachineFunction.cpp Message-ID: <20100707172845.CBF2D2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 12:28:45 2010 New Revision: 107795 URL: http://llvm.org/viewvc/llvm-project?rev=107795&view=rev Log: Fix debugging strings. Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=107795&r1=107794&r2=107795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Wed Jul 7 12:28:45 2010 @@ -378,7 +378,7 @@ #ifndef NDEBUG ViewGraph(this, "mf" + getFunction()->getNameStr()); #else - errs() << "SelectionDAG::viewGraph is only available in debug builds on " + errs() << "MachineFunction::viewCFG is only available in debug builds on " << "systems with Graphviz or gv!\n"; #endif // NDEBUG } @@ -388,7 +388,7 @@ #ifndef NDEBUG ViewGraph(this, "mf" + getFunction()->getNameStr(), true); #else - errs() << "SelectionDAG::viewGraph is only available in debug builds on " + errs() << "MachineFunction::viewCFGOnly is only available in debug builds on " << "systems with Graphviz or gv!\n"; #endif // NDEBUG } From dpatel at apple.com Wed Jul 7 13:18:18 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 07 Jul 2010 18:18:18 -0000 Subject: [llvm-commits] [llvm] r107796 - /llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Message-ID: <20100707181818.4C7E12A6C12C@llvm.org> Author: dpatel Date: Wed Jul 7 13:18:18 2010 New Revision: 107796 URL: http://llvm.org/viewvc/llvm-project?rev=107796&view=rev Log: Update comment. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107796&r1=107795&r2=107796&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Jul 7 13:18:18 2010 @@ -604,9 +604,10 @@ } else if (SD->getKind() == SDDbgValue::CONST) { const Value *V = SD->getConst(); if (const ConstantInt *CI = dyn_cast(V)) { - // FIXME: SDDbgValues aren't updated with legalization, so it's possible - // to have i128 values in them at this point. As a crude workaround, just - // drop the debug info if this happens. + // FIXME: SDDbgValue constants aren't updated with legalization, so it's + // possible to have i128 constants in them at this point. Dwarf writer + // does not handle i128 constants at the moment so, as a crude workaround, + // just drop the debug info if this happens. if (!CI->getValue().isSignedIntN(64)) MIB.addReg(0U); else From gohman at apple.com Wed Jul 7 13:22:13 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 18:22:13 -0000 Subject: [llvm-commits] [llvm] r107797 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <20100707182213.D5D5D2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 13:22:13 2010 New Revision: 107797 URL: http://llvm.org/viewvc/llvm-project?rev=107797&view=rev Log: Update the insert position after scheduling, which may change the position when emitting multiple blocks when executing a custom inserter. 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=107797&r1=107796&r2=107797&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 13:22:13 2010 @@ -550,6 +550,7 @@ { NamedRegionTimer T("Instruction Creation", GroupName, TimePassesIsEnabled); FuncInfo->MBB = Scheduler->EmitSchedule(); + FuncInfo->InsertPt = Scheduler->InsertPos; } // Free the scheduler state. From bruno.cardoso at gmail.com Wed Jul 7 13:24:20 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 18:24:20 -0000 Subject: [llvm-commits] [llvm] r107798 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100707182421.039372A6C12C@llvm.org> Author: bruno Date: Wed Jul 7 13:24:20 2010 New Revision: 107798 URL: http://llvm.org/viewvc/llvm-project?rev=107798&view=rev Log: Add AVX AES instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=107798&r1=107797&r2=107798&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Wed Jul 7 13:24:20 2010 @@ -4966,33 +4966,47 @@ // AES-NI Instructions //===----------------------------------------------------------------------===// -let Constraints = "$src1 = $dst" in { - multiclass AESI_binop_rm_int opc, string OpcodeStr, - Intrinsic IntId128, bit Commutable = 0> { - def rr : AES8I, - OpSize { - let isCommutable = Commutable; - } - def rm : AES8I, OpSize; - } +multiclass AESI_binop_rm_int opc, string OpcodeStr, + Intrinsic IntId128, bit Is2Addr = 1> { + def rr : AES8I, + OpSize; + def rm : AES8I, OpSize; +} + +// Perform One Round of an AES Encryption/Decryption Flow +let isAsmParserOnly = 1, Predicates = [HasAVX, HasAES] in { + defm VAESENC : AESI_binop_rm_int<0xDC, "vaesenc", + int_x86_aesni_aesenc, 0>, VEX_4V; + defm VAESENCLAST : AESI_binop_rm_int<0xDD, "vaesenclast", + int_x86_aesni_aesenclast, 0>, VEX_4V; + defm VAESDEC : AESI_binop_rm_int<0xDE, "vaesdec", + int_x86_aesni_aesdec, 0>, VEX_4V; + defm VAESDECLAST : AESI_binop_rm_int<0xDF, "vaesdeclast", + int_x86_aesni_aesdeclast, 0>, VEX_4V; } -defm AESENC : AESI_binop_rm_int<0xDC, "aesenc", - int_x86_aesni_aesenc>; -defm AESENCLAST : AESI_binop_rm_int<0xDD, "aesenclast", - int_x86_aesni_aesenclast>; -defm AESDEC : AESI_binop_rm_int<0xDE, "aesdec", - int_x86_aesni_aesdec>; -defm AESDECLAST : AESI_binop_rm_int<0xDF, "aesdeclast", - int_x86_aesni_aesdeclast>; +let Constraints = "$src1 = $dst" in { + defm AESENC : AESI_binop_rm_int<0xDC, "aesenc", + int_x86_aesni_aesenc>; + defm AESENCLAST : AESI_binop_rm_int<0xDD, "aesenclast", + int_x86_aesni_aesenclast>; + defm AESDEC : AESI_binop_rm_int<0xDE, "aesdec", + int_x86_aesni_aesdec>; + defm AESDECLAST : AESI_binop_rm_int<0xDF, "aesdeclast", + int_x86_aesni_aesdeclast>; +} def : Pat<(v2i64 (int_x86_aesni_aesenc VR128:$src1, VR128:$src2)), (AESENCrr VR128:$src1, VR128:$src2)>; @@ -5011,13 +5025,27 @@ def : Pat<(v2i64 (int_x86_aesni_aesdeclast VR128:$src1, (memop addr:$src2))), (AESDECLASTrm VR128:$src1, addr:$src2)>; +// Perform the AES InvMixColumn Transformation +let isAsmParserOnly = 1, Predicates = [HasAVX, HasAES] in { + def VAESIMCrr : AES8I<0xDB, MRMSrcReg, (outs VR128:$dst), + (ins VR128:$src1), + "vaesimc\t{$src1, $dst|$dst, $src1}", + [(set VR128:$dst, + (int_x86_aesni_aesimc VR128:$src1))]>, + OpSize, VEX; + def VAESIMCrm : AES8I<0xDB, MRMSrcMem, (outs VR128:$dst), + (ins i128mem:$src1), + "vaesimc\t{$src1, $dst|$dst, $src1}", + [(set VR128:$dst, + (int_x86_aesni_aesimc (bitconvert (memopv2i64 addr:$src1))))]>, + OpSize, VEX; +} def AESIMCrr : AES8I<0xDB, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1), "aesimc\t{$src1, $dst|$dst, $src1}", [(set VR128:$dst, (int_x86_aesni_aesimc VR128:$src1))]>, OpSize; - def AESIMCrm : AES8I<0xDB, MRMSrcMem, (outs VR128:$dst), (ins i128mem:$src1), "aesimc\t{$src1, $dst|$dst, $src1}", @@ -5025,6 +5053,22 @@ (int_x86_aesni_aesimc (bitconvert (memopv2i64 addr:$src1))))]>, OpSize; +// AES Round Key Generation Assist +let isAsmParserOnly = 1, Predicates = [HasAVX, HasAES] in { + def VAESKEYGENASSIST128rr : AESAI<0xDF, MRMSrcReg, (outs VR128:$dst), + (ins VR128:$src1, i8imm:$src2), + "vaeskeygenassist\t{$src2, $src1, $dst|$dst, $src1, $src2}", + [(set VR128:$dst, + (int_x86_aesni_aeskeygenassist VR128:$src1, imm:$src2))]>, + OpSize, VEX; + def VAESKEYGENASSIST128rm : AESAI<0xDF, MRMSrcMem, (outs VR128:$dst), + (ins i128mem:$src1, i8imm:$src2), + "vaeskeygenassist\t{$src2, $src1, $dst|$dst, $src1, $src2}", + [(set VR128:$dst, + (int_x86_aesni_aeskeygenassist (bitconvert (memopv2i64 addr:$src1)), + imm:$src2))]>, + OpSize, VEX; +} def AESKEYGENASSIST128rr : AESAI<0xDF, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, i8imm:$src2), "aeskeygenassist\t{$src2, $src1, $dst|$dst, $src1, $src2}", Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107798&r1=107797&r2=107798&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Wed Jul 7 13:24:20 2010 @@ -12162,3 +12162,51 @@ // CHECK: encoding: [0xc4,0xe3,0x79,0x61,0x28,0x07] vpcmpestri $7, (%eax), %xmm5 +// CHECK: vaesimc %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe2,0x79,0xdb,0xea] + vaesimc %xmm2, %xmm5 + +// CHECK: vaesimc (%eax), %xmm2 +// CHECK: encoding: [0xc4,0xe2,0x79,0xdb,0x10] + vaesimc (%eax), %xmm2 + +// CHECK: vaesenc %xmm2, %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe2,0x51,0xdc,0xca] + vaesenc %xmm2, %xmm5, %xmm1 + +// CHECK: vaesenc (%eax), %xmm5, %xmm3 +// CHECK: encoding: [0xc4,0xe2,0x51,0xdc,0x18] + vaesenc (%eax), %xmm5, %xmm3 + +// CHECK: vaesenclast %xmm2, %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe2,0x51,0xdd,0xca] + vaesenclast %xmm2, %xmm5, %xmm1 + +// CHECK: vaesenclast (%eax), %xmm5, %xmm3 +// CHECK: encoding: [0xc4,0xe2,0x51,0xdd,0x18] + vaesenclast (%eax), %xmm5, %xmm3 + +// CHECK: vaesdec %xmm2, %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe2,0x51,0xde,0xca] + vaesdec %xmm2, %xmm5, %xmm1 + +// CHECK: vaesdec (%eax), %xmm5, %xmm3 +// CHECK: encoding: [0xc4,0xe2,0x51,0xde,0x18] + vaesdec (%eax), %xmm5, %xmm3 + +// CHECK: vaesdeclast %xmm2, %xmm5, %xmm1 +// CHECK: encoding: [0xc4,0xe2,0x51,0xdf,0xca] + vaesdeclast %xmm2, %xmm5, %xmm1 + +// CHECK: vaesdeclast (%eax), %xmm5, %xmm3 +// CHECK: encoding: [0xc4,0xe2,0x51,0xdf,0x18] + vaesdeclast (%eax), %xmm5, %xmm3 + +// CHECK: vaeskeygenassist $7, %xmm2, %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0xdf,0xea,0x07] + vaeskeygenassist $7, %xmm2, %xmm5 + +// CHECK: vaeskeygenassist $7, (%eax), %xmm5 +// CHECK: encoding: [0xc4,0xe3,0x79,0xdf,0x28,0x07] + vaeskeygenassist $7, (%eax), %xmm5 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107798&r1=107797&r2=107798&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Wed Jul 7 13:24:20 2010 @@ -2225,3 +2225,52 @@ // CHECK: vpcmpestri $7, (%rax), %xmm10 // CHECK: encoding: [0xc4,0x63,0x79,0x61,0x10,0x07] vpcmpestri $7, (%rax), %xmm10 + +// CHECK: vaesimc %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x42,0x79,0xdb,0xd4] + vaesimc %xmm12, %xmm10 + +// CHECK: vaesimc (%rax), %xmm12 +// CHECK: encoding: [0xc4,0x62,0x79,0xdb,0x20] + vaesimc (%rax), %xmm12 + +// CHECK: vaesenc %xmm12, %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x42,0x29,0xdc,0xdc] + vaesenc %xmm12, %xmm10, %xmm11 + +// CHECK: vaesenc (%rax), %xmm10, %xmm13 +// CHECK: encoding: [0xc4,0x62,0x29,0xdc,0x28] + vaesenc (%rax), %xmm10, %xmm13 + +// CHECK: vaesenclast %xmm12, %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x42,0x29,0xdd,0xdc] + vaesenclast %xmm12, %xmm10, %xmm11 + +// CHECK: vaesenclast (%rax), %xmm10, %xmm13 +// CHECK: encoding: [0xc4,0x62,0x29,0xdd,0x28] + vaesenclast (%rax), %xmm10, %xmm13 + +// CHECK: vaesdec %xmm12, %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x42,0x29,0xde,0xdc] + vaesdec %xmm12, %xmm10, %xmm11 + +// CHECK: vaesdec (%rax), %xmm10, %xmm13 +// CHECK: encoding: [0xc4,0x62,0x29,0xde,0x28] + vaesdec (%rax), %xmm10, %xmm13 + +// CHECK: vaesdeclast %xmm12, %xmm10, %xmm11 +// CHECK: encoding: [0xc4,0x42,0x29,0xdf,0xdc] + vaesdeclast %xmm12, %xmm10, %xmm11 + +// CHECK: vaesdeclast (%rax), %xmm10, %xmm13 +// CHECK: encoding: [0xc4,0x62,0x29,0xdf,0x28] + vaesdeclast (%rax), %xmm10, %xmm13 + +// CHECK: vaeskeygenassist $7, %xmm12, %xmm10 +// CHECK: encoding: [0xc4,0x43,0x79,0xdf,0xd4,0x07] + vaeskeygenassist $7, %xmm12, %xmm10 + +// CHECK: vaeskeygenassist $7, (%rax), %xmm10 +// CHECK: encoding: [0xc4,0x63,0x79,0xdf,0x10,0x07] + vaeskeygenassist $7, (%rax), %xmm10 + From isanbard at gmail.com Wed Jul 7 13:32:35 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 07 Jul 2010 18:32:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r107799 - in /llvm-gcc-4.2/trunk/libcpp: configure configure.ac Message-ID: <20100707183235.7548C2A6C12C@llvm.org> Author: void Date: Wed Jul 7 13:32:35 2010 New Revision: 107799 URL: http://llvm.org/viewvc/llvm-project?rev=107799&view=rev Log: Support ALL of the different build modes. Did anyone test this change at all?! Modified: llvm-gcc-4.2/trunk/libcpp/configure llvm-gcc-4.2/trunk/libcpp/configure.ac Modified: llvm-gcc-4.2/trunk/libcpp/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/configure?rev=107799&r1=107798&r2=107799&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/configure (original) +++ llvm-gcc-4.2/trunk/libcpp/configure Wed Jul 7 13:32:35 2010 @@ -1,27 +1,56 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for cpplib . +# Generated by GNU Autoconf 2.61 for cpplib . # # 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 +} - 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 +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_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_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; } +") 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='cpplib' PACKAGE_TARNAME='cpplib' @@ -277,42 +582,144 @@ # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB ACLOCAL AUTOCONF AUTOHEADER WARN_CFLAGS WARN_PEDANTIC WERROR am__leading_dot DEPDIR CCDEPMODE CPP EGREP LIBOBJS ALLOCA USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT LIBICONV LTLIBICONV PACKAGE USED_CATALOGS MAINT LLVMBASEPATH 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 +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +SET_MAKE +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +RANLIB +ACLOCAL +AUTOCONF +AUTOHEADER +WARN_CFLAGS +WARN_PEDANTIC +WERROR +am__leading_dot +DEPDIR +CCDEPMODE +CPP +GREP +EGREP +LIBOBJS +ALLOCA +USE_NLS +LIBINTL +LIBINTL_DEP +INCINTL +XGETTEXT +GMSGFMT +POSUB +CATALOGS +DATADIRNAME +INSTOBJEXT +GENCAT +CATOBJEXT +LIBICONV +LTLIBICONV +PACKAGE +USED_CATALOGS +MAINT +LLVMBASEPATH +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -339,34 +746,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 ;; @@ -388,33 +809,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- \ @@ -441,6 +874,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 ;; @@ -465,13 +904,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) @@ -536,6 +978,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 ;; @@ -588,24 +1040,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. @@ -636,8 +1084,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 ;; *) @@ -657,27 +1104,19 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# 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 - [\\/$]* | ?:[\\/]* | 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; }; };; + [\\/$]* | ?:[\\/]* ) 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' @@ -704,75 +1143,77 @@ 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 +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; }; } - else - { 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 -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - + 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. # @@ -800,9 +1241,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] @@ -820,15 +1258,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/cpplib] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -867,8 +1312,9 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -876,120 +1322,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 ;; -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 - 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 cpplib configure -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 cpplib $as_me , 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 ## --------- ## @@ -1008,7 +1420,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` @@ -1022,6 +1434,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1043,7 +1456,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1054,7 +1466,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 @@ -1076,9 +1488,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 @@ -1089,8 +1499,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. { @@ -1103,20 +1513,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 @@ -1127,22 +1551,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 @@ -1154,26 +1584,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. @@ -1204,14 +1632,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;} @@ -1227,8 +1658,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 @@ -1240,12 +1671,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 @@ -1270,8 +1700,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 @@ -1288,12 +1717,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 - @@ -1318,119 +1741,164 @@ +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 -case ../config in - [\\/]* | ?:[\\/]* ) ac_macro_dir=../config ;; - *) ac_macro_dir=$srcdir/../config ;; -esac -if test -d "$ac_macro_dir"; then : -else - { { echo "$as_me:$LINENO: error: cannot find macro directory \`../config'" >&5 -echo "$as_me: error: cannot find macro directory \`../config'" >&2;} - { (exit 1); exit 1; }; } -fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&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. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1441,32 +1909,33 @@ program_prefix=${target_alias}- # Checks for programs. -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1483,8 +1952,8 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1506,7 +1975,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1525,21 +1994,22 @@ ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1557,8 +2027,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1571,32 +2041,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1609,36 +2081,51 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1651,74 +2138,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1732,7 +2179,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1743,6 +2190,7 @@ fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1760,22 +2208,23 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1788,36 +2237,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1830,29 +2281,45 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1865,21 +2332,35 @@ { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -1904,47 +2385,77 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1956,19 +2467,21 @@ fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1987,22 +2500,27 @@ fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2013,9 +2531,8 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2029,14 +2546,14 @@ fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2056,14 +2573,20 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2081,12 +2604,12 @@ rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2109,50 +2632,49 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2168,38 +2690,118 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2215,12 +2817,12 @@ CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2254,12 +2856,17 @@ /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2274,254 +2881,108 @@ return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -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 - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + +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 + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2534,27 +2995,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -2565,8 +3040,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ACLOCAL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2579,25 +3054,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ACLOCAL="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ACLOCAL=$ac_cv_prog_ACLOCAL if test -n "$ACLOCAL"; then - echo "$as_me:$LINENO: result: $ACLOCAL" >&5 -echo "${ECHO_T}$ACLOCAL" >&6 + { echo "$as_me:$LINENO: result: $ACLOCAL" >&5 +echo "${ECHO_T}$ACLOCAL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ACLOCAL" && break done test -n "$ACLOCAL" || ACLOCAL="$MISSING aclocal" @@ -2606,8 +3083,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AUTOCONF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2620,25 +3097,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AUTOCONF="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AUTOCONF=$ac_cv_prog_AUTOCONF if test -n "$AUTOCONF"; then - echo "$as_me:$LINENO: result: $AUTOCONF" >&5 -echo "${ECHO_T}$AUTOCONF" >&6 + { echo "$as_me:$LINENO: result: $AUTOCONF" >&5 +echo "${ECHO_T}$AUTOCONF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AUTOCONF" && break done test -n "$AUTOCONF" || AUTOCONF="$MISSING autoconf" @@ -2647,8 +3126,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AUTOHEADER+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2661,25 +3140,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AUTOHEADER="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AUTOHEADER=$ac_cv_prog_AUTOHEADER if test -n "$AUTOHEADER"; then - echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 -echo "${ECHO_T}$AUTOHEADER" >&6 + { echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 +echo "${ECHO_T}$AUTOHEADER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AUTOHEADER" && break done test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader" @@ -2696,9 +3177,9 @@ -Wmissing-format-attribute; do as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` - echo "$as_me:$LINENO: checking whether $CC supports $option" >&5 -echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6 -if eval "test \"\${$as_acx_Woption+set}\" = set"; then + { echo "$as_me:$LINENO: checking whether $CC supports $option" >&5 +echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6; } +if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="$option" @@ -2718,39 +3199,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_acx_Woption=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_acx_Woption=no" + eval "$as_acx_Woption=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_acx_Woption'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_acx_Woption'}'`" >&6 +ac_res=`eval echo '${'$as_acx_Woption'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_acx_Woption'}'` = yes; then WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option" fi @@ -2760,8 +3238,8 @@ WARN_PEDANTIC= if test "$GCC" = yes; then - echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5 -echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5 +echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long... $ECHO_C" >&6; } if test "${acx_cv_prog_cc_pedantic__Wno_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2783,39 +3261,35 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then acx_cv_prog_cc_pedantic__Wno_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -acx_cv_prog_cc_pedantic__Wno_long_long=no + acx_cv_prog_cc_pedantic__Wno_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic__Wno_long_long" >&5 -echo "${ECHO_T}$acx_cv_prog_cc_pedantic__Wno_long_long" >&6 +{ echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic__Wno_long_long" >&5 +echo "${ECHO_T}$acx_cv_prog_cc_pedantic__Wno_long_long" >&6; } if test $acx_cv_prog_cc_pedantic__Wno_long_long = yes; then WARN_PEDANTIC="-pedantic -Wno-long-long" fi @@ -2828,13 +3302,13 @@ # Only enable with --enable-werror-always until existing warnings are # corrected. WERROR= -# Check whether --enable-werror-always or --disable-werror-always was given. +# Check whether --enable-werror-always was given. if test "${enable_werror_always+set}" = set; then - enableval="$enable_werror_always" - + enableval=$enable_werror_always; else enable_werror_always=no -fi; +fi + if test $enable_werror_always = yes; then WERROR=-Werror fi @@ -2853,14 +3327,14 @@ DEPDIR="${am__leading_dot}deps" - ac_config_commands="$ac_config_commands depdir" +ac_config_commands="$ac_config_commands depdir" depcc="$CC" am_compiler_list= am_depcomp=$ac_aux_dir/depcomp -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2944,8 +3418,8 @@ fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } if test x${am_cv_CC_dependencies_compiler_type-none} = xnone then { { echo "$as_me:$LINENO: error: no usable dependency style found" >&5 echo "$as_me: error: no usable dependency style found" >&2;} @@ -2956,8 +3430,8 @@ # Checks for header files. -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2981,38 +3455,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no + ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -3021,8 +3491,8 @@ fi -echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 -echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 +echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6; } if test "${gcc_cv_header_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3043,38 +3513,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_header_string=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_header_string=no + gcc_cv_header_string=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 -echo "${ECHO_T}$gcc_cv_header_string" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 +echo "${ECHO_T}$gcc_cv_header_string" >&6; } if test $gcc_cv_header_string = yes; then cat >>confdefs.h <<\_ACEOF @@ -3088,8 +3554,8 @@ 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 -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3123,24 +3589,22 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3149,9 +3613,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3161,24 +3626,22 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3189,6 +3652,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3206,8 +3670,8 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3230,24 +3694,22 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3256,9 +3718,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3268,24 +3731,22 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3296,6 +3757,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3318,23 +3780,170 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3358,35 +3967,31 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3405,7 +4010,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -3426,7 +4031,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -3442,6 +4047,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3461,18 +4067,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3485,12 +4100,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3513,9 +4130,9 @@ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3529,38 +4146,35 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3585,18 +4199,19 @@ stdlib.h strings.h string.h sys/file.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3607,41 +4222,37 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3650,24 +4261,22 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3675,9 +4284,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -3701,25 +4311,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to gcc-bugs at gcc.gnu.org ## ## ----------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3733,8 +4342,8 @@ # Checks for typedefs, structures, and compiler characteristics. -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3752,10 +4361,10 @@ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; - const charset x; + const charset cs; /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; + char const *const *pcpcc; + char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; @@ -3764,16 +4373,17 @@ an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; - ccp = &g + (g ? g-g : 0); + pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; + if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; @@ -3792,7 +4402,9 @@ } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; + if (!foo) return 0; } + return !cs[0] && !zero.x; #endif ; @@ -3800,38 +4412,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no + ac_cv_c_const=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @@ -3840,8 +4448,8 @@ fi -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3861,39 +4469,37 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in @@ -3911,8 +4517,8 @@ ;; esac -echo "$as_me:$LINENO: checking for obstacks" >&5 -echo $ECHO_N "checking for obstacks... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for obstacks" >&5 +echo $ECHO_N "checking for obstacks... $ECHO_C" >&6; } if test "${ac_cv_func_obstack+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3922,49 +4528,51 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "obstack.h" +$ac_includes_default + #include "obstack.h" int main () { -struct obstack *mem; obstack_free(mem,(char *) 0) +struct obstack mem; + #define obstack_chunk_alloc malloc + #define obstack_chunk_free free + obstack_init (&mem); + obstack_free (&mem, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_obstack=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_obstack=no + ac_cv_func_obstack=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 -echo "${ECHO_T}$ac_cv_func_obstack" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 +echo "${ECHO_T}$ac_cv_func_obstack" >&6; } if test $ac_cv_func_obstack = yes; then cat >>confdefs.h <<\_ACEOF @@ -3972,18 +4580,16 @@ _ACEOF else - case $LIBOBJS in - "obstack.$ac_objext" | \ - *" obstack.$ac_objext" | \ - "obstack.$ac_objext "* | \ + case " $LIBOBJS " in *" obstack.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS obstack.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS obstack.$ac_objext" + ;; esac fi -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3994,62 +4600,59 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef off_t ac__type_new_; int main () { -if ((off_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (off_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no + ac_cv_type_off_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define off_t long +#define off_t long int _ACEOF fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4060,62 +4663,59 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef size_t ac__type_new_; int main () { -if ((size_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (size_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define size_t unsigned int _ACEOF fi -echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4131,44 +4731,42 @@ int main () { -struct tm *tp; tp->tm_sec; +struct tm tm; + int *p = &tm.tm_sec; + return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_struct_tm=sys/time.h + ac_cv_struct_tm=sys/time.h fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -4177,8 +4775,8 @@ fi -echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4189,61 +4787,57 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int ac__type_new_; int main () { -if ((int *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no + ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4253,10 +4847,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4264,27 +4859,22 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4294,10 +4884,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4305,56 +4896,53 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4362,27 +4950,22 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4392,10 +4975,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4403,50 +4987,48 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4457,10 +5039,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4468,52 +5051,45 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4521,8 +5097,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4531,35 +5108,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4570,29 +5156,32 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4603,61 +5192,57 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4667,10 +5252,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4678,27 +5264,22 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4708,10 +5289,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4719,56 +5301,53 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4776,27 +5355,22 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4806,10 +5380,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4817,50 +5392,48 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4871,10 +5444,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4882,52 +5456,45 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4935,8 +5502,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4945,35 +5513,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4984,22 +5561,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -5025,9 +5605,9 @@ for ac_func in clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5053,68 +5633,60 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5123,8 +5695,8 @@ fi done -echo "$as_me:$LINENO: checking whether abort is declared" >&5 -echo $ECHO_N "checking whether abort is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether abort is declared" >&5 +echo $ECHO_N "checking whether abort is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_abort+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5139,7 +5711,7 @@ main () { #ifndef abort - char *p = (char *) abort; + (void) abort; #endif ; @@ -5147,38 +5719,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_abort=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_abort=no + ac_cv_have_decl_abort=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_abort" >&5 -echo "${ECHO_T}$ac_cv_have_decl_abort" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_abort" >&5 +echo "${ECHO_T}$ac_cv_have_decl_abort" >&6; } if test $ac_cv_have_decl_abort = yes; then cat >>confdefs.h <<_ACEOF @@ -5193,8 +5761,8 @@ fi -echo "$as_me:$LINENO: checking whether asprintf is declared" >&5 -echo $ECHO_N "checking whether asprintf is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether asprintf is declared" >&5 +echo $ECHO_N "checking whether asprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_asprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5209,7 +5777,7 @@ main () { #ifndef asprintf - char *p = (char *) asprintf; + (void) asprintf; #endif ; @@ -5217,38 +5785,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_asprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_asprintf=no + ac_cv_have_decl_asprintf=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_asprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_asprintf" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_asprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_asprintf" >&6; } if test $ac_cv_have_decl_asprintf = yes; then cat >>confdefs.h <<_ACEOF @@ -5263,8 +5827,8 @@ fi -echo "$as_me:$LINENO: checking whether basename is declared" >&5 -echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether basename is declared" >&5 +echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_basename+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5279,7 +5843,7 @@ main () { #ifndef basename - char *p = (char *) basename; + (void) basename; #endif ; @@ -5287,38 +5851,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_basename=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_basename=no + ac_cv_have_decl_basename=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5 -echo "${ECHO_T}$ac_cv_have_decl_basename" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5 +echo "${ECHO_T}$ac_cv_have_decl_basename" >&6; } if test $ac_cv_have_decl_basename = yes; then cat >>confdefs.h <<_ACEOF @@ -5333,8 +5893,8 @@ fi -echo "$as_me:$LINENO: checking whether errno is declared" >&5 -echo $ECHO_N "checking whether errno is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether errno is declared" >&5 +echo $ECHO_N "checking whether errno is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5349,7 +5909,7 @@ main () { #ifndef errno - char *p = (char *) errno; + (void) errno; #endif ; @@ -5357,38 +5917,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_errno=no + ac_cv_have_decl_errno=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_errno" >&5 -echo "${ECHO_T}$ac_cv_have_decl_errno" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_errno" >&5 +echo "${ECHO_T}$ac_cv_have_decl_errno" >&6; } if test $ac_cv_have_decl_errno = yes; then cat >>confdefs.h <<_ACEOF @@ -5403,8 +5959,8 @@ fi -echo "$as_me:$LINENO: checking whether getopt is declared" >&5 -echo $ECHO_N "checking whether getopt is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether getopt is declared" >&5 +echo $ECHO_N "checking whether getopt is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5419,7 +5975,7 @@ main () { #ifndef getopt - char *p = (char *) getopt; + (void) getopt; #endif ; @@ -5427,38 +5983,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_getopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_getopt=no + ac_cv_have_decl_getopt=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getopt" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getopt" >&6; } if test $ac_cv_have_decl_getopt = yes; then cat >>confdefs.h <<_ACEOF @@ -5473,8 +6025,8 @@ fi -echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 -echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 +echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5489,7 +6041,7 @@ main () { #ifndef clearerr_unlocked - char *p = (char *) clearerr_unlocked; + (void) clearerr_unlocked; #endif ; @@ -5497,38 +6049,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_clearerr_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_clearerr_unlocked=no + ac_cv_have_decl_clearerr_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6; } if test $ac_cv_have_decl_clearerr_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5543,8 +6091,8 @@ fi -echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 -echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 +echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5559,7 +6107,7 @@ main () { #ifndef feof_unlocked - char *p = (char *) feof_unlocked; + (void) feof_unlocked; #endif ; @@ -5567,38 +6115,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_feof_unlocked=no + ac_cv_have_decl_feof_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6; } if test $ac_cv_have_decl_feof_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5613,8 +6157,8 @@ fi -echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 -echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 +echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5629,7 +6173,7 @@ main () { #ifndef ferror_unlocked - char *p = (char *) ferror_unlocked; + (void) ferror_unlocked; #endif ; @@ -5637,38 +6181,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_ferror_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_ferror_unlocked=no + ac_cv_have_decl_ferror_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6; } if test $ac_cv_have_decl_ferror_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5683,8 +6223,8 @@ fi -echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 -echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 +echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5699,7 +6239,7 @@ main () { #ifndef fflush_unlocked - char *p = (char *) fflush_unlocked; + (void) fflush_unlocked; #endif ; @@ -5707,38 +6247,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fflush_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fflush_unlocked=no + ac_cv_have_decl_fflush_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6; } if test $ac_cv_have_decl_fflush_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5753,8 +6289,8 @@ fi -echo "$as_me:$LINENO: checking whether fgetc_unlocked is declared" >&5 -echo $ECHO_N "checking whether fgetc_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fgetc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgetc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fgetc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5769,7 +6305,7 @@ main () { #ifndef fgetc_unlocked - char *p = (char *) fgetc_unlocked; + (void) fgetc_unlocked; #endif ; @@ -5777,38 +6313,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fgetc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fgetc_unlocked=no + ac_cv_have_decl_fgetc_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgetc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fgetc_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgetc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgetc_unlocked" >&6; } if test $ac_cv_have_decl_fgetc_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5823,8 +6355,8 @@ fi -echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 -echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5839,7 +6371,7 @@ main () { #ifndef fgets_unlocked - char *p = (char *) fgets_unlocked; + (void) fgets_unlocked; #endif ; @@ -5847,38 +6379,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fgets_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fgets_unlocked=no + ac_cv_have_decl_fgets_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6; } if test $ac_cv_have_decl_fgets_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5893,8 +6421,8 @@ fi -echo "$as_me:$LINENO: checking whether fileno_unlocked is declared" >&5 -echo $ECHO_N "checking whether fileno_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fileno_unlocked is declared" >&5 +echo $ECHO_N "checking whether fileno_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fileno_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5909,7 +6437,7 @@ main () { #ifndef fileno_unlocked - char *p = (char *) fileno_unlocked; + (void) fileno_unlocked; #endif ; @@ -5917,38 +6445,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fileno_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fileno_unlocked=no + ac_cv_have_decl_fileno_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fileno_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fileno_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fileno_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fileno_unlocked" >&6; } if test $ac_cv_have_decl_fileno_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -5963,8 +6487,8 @@ fi -echo "$as_me:$LINENO: checking whether fprintf_unlocked is declared" >&5 -echo $ECHO_N "checking whether fprintf_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fprintf_unlocked is declared" >&5 +echo $ECHO_N "checking whether fprintf_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fprintf_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5979,7 +6503,7 @@ main () { #ifndef fprintf_unlocked - char *p = (char *) fprintf_unlocked; + (void) fprintf_unlocked; #endif ; @@ -5987,38 +6511,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fprintf_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fprintf_unlocked=no + ac_cv_have_decl_fprintf_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fprintf_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fprintf_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fprintf_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fprintf_unlocked" >&6; } if test $ac_cv_have_decl_fprintf_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6033,8 +6553,8 @@ fi -echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6049,7 +6569,7 @@ main () { #ifndef fputc_unlocked - char *p = (char *) fputc_unlocked; + (void) fputc_unlocked; #endif ; @@ -6057,38 +6577,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fputc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fputc_unlocked=no + ac_cv_have_decl_fputc_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6; } if test $ac_cv_have_decl_fputc_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6103,8 +6619,8 @@ fi -echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6119,7 +6635,7 @@ main () { #ifndef fputs_unlocked - char *p = (char *) fputs_unlocked; + (void) fputs_unlocked; #endif ; @@ -6127,38 +6643,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fputs_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fputs_unlocked=no + ac_cv_have_decl_fputs_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6; } if test $ac_cv_have_decl_fputs_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6173,8 +6685,8 @@ fi -echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 -echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 +echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6189,7 +6701,7 @@ main () { #ifndef fread_unlocked - char *p = (char *) fread_unlocked; + (void) fread_unlocked; #endif ; @@ -6197,38 +6709,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fread_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fread_unlocked=no + ac_cv_have_decl_fread_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6; } if test $ac_cv_have_decl_fread_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6243,8 +6751,8 @@ fi -echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 +echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6259,7 +6767,7 @@ main () { #ifndef fwrite_unlocked - char *p = (char *) fwrite_unlocked; + (void) fwrite_unlocked; #endif ; @@ -6267,38 +6775,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fwrite_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fwrite_unlocked=no + ac_cv_have_decl_fwrite_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6; } if test $ac_cv_have_decl_fwrite_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6313,8 +6817,8 @@ fi -echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6329,7 +6833,7 @@ main () { #ifndef getchar_unlocked - char *p = (char *) getchar_unlocked; + (void) getchar_unlocked; #endif ; @@ -6337,38 +6841,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_getchar_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_getchar_unlocked=no + ac_cv_have_decl_getchar_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6; } if test $ac_cv_have_decl_getchar_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6383,8 +6883,8 @@ fi -echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 -echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6399,7 +6899,7 @@ main () { #ifndef getc_unlocked - char *p = (char *) getc_unlocked; + (void) getc_unlocked; #endif ; @@ -6407,38 +6907,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_getc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_getc_unlocked=no + ac_cv_have_decl_getc_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6; } if test $ac_cv_have_decl_getc_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6453,8 +6949,8 @@ fi -echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 -echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6469,7 +6965,7 @@ main () { #ifndef putchar_unlocked - char *p = (char *) putchar_unlocked; + (void) putchar_unlocked; #endif ; @@ -6477,38 +6973,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_putchar_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_putchar_unlocked=no + ac_cv_have_decl_putchar_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6; } if test $ac_cv_have_decl_putchar_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6523,8 +7015,8 @@ fi -echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 +echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6539,7 +7031,7 @@ main () { #ifndef putc_unlocked - char *p = (char *) putc_unlocked; + (void) putc_unlocked; #endif ; @@ -6547,38 +7039,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_putc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_putc_unlocked=no + ac_cv_have_decl_putc_unlocked=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6; } if test $ac_cv_have_decl_putc_unlocked = yes; then cat >>confdefs.h <<_ACEOF @@ -6593,8 +7081,8 @@ fi -echo "$as_me:$LINENO: checking whether vasprintf is declared" >&5 -echo $ECHO_N "checking whether vasprintf is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether vasprintf is declared" >&5 +echo $ECHO_N "checking whether vasprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_vasprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6609,7 +7097,7 @@ main () { #ifndef vasprintf - char *p = (char *) vasprintf; + (void) vasprintf; #endif ; @@ -6617,38 +7105,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_vasprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_vasprintf=no + ac_cv_have_decl_vasprintf=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_vasprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_vasprintf" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_vasprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vasprintf" >&6; } if test $ac_cv_have_decl_vasprintf = yes; then cat >>confdefs.h <<_ACEOF @@ -6669,8 +7153,8 @@ # Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6685,44 +7169,42 @@ main () { char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -6731,8 +7213,8 @@ fi -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6749,7 +7231,7 @@ # include # define alloca _alloca # else -# if HAVE_ALLOCA_H +# ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX @@ -6767,44 +7249,42 @@ main () { char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then @@ -6818,15 +7298,15 @@ # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. -ALLOCA=alloca.$ac_objext +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6836,7 +7316,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) +#if defined CRAY && ! defined CRAY2 webecray #else wenotbecray @@ -6849,17 +7329,17 @@ else ac_cv_os_cray=no fi -rm -f conftest* +rm -f -r conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6885,68 +7365,60 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @@ -6959,8 +7431,8 @@ done fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6973,6 +7445,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int find_stack_direction () { @@ -6990,17 +7463,26 @@ int main () { - exit (find_stack_direction () < 0); + return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7013,11 +7495,13 @@ ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -7026,8 +7510,8 @@ fi -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7051,35 +7535,31 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -7098,7 +7578,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -7119,7 +7599,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -7135,6 +7615,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -7154,18 +7635,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7178,12 +7668,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -7193,8 +7685,8 @@ fi - echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7214,40 +7706,37 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_langinfo_codeset=no + am_cv_langinfo_codeset=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF @@ -7269,22 +7758,22 @@ if test -f ../intl/config.intl; then . ../intl/config.intl fi -echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } if test x"$USE_NLS" != xyes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; } # Look for .po and .gmo files in the source directory. CATALOGS= XLINGUAS= @@ -7315,8 +7804,8 @@ fi done LINGUAS="$XLINGUAS" - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 + { echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6; } DATADIRNAME=share @@ -7329,8 +7818,8 @@ fi -echo "$as_me:$LINENO: checking for uchar" >&5 -echo $ECHO_N "checking for uchar... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for uchar" >&5 +echo $ECHO_N "checking for uchar... $ECHO_C" >&6; } if test "${gcc_cv_type_uchar+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7353,38 +7842,34 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uchar=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uchar=no + ac_cv_type_uchar=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_type_uchar" >&5 -echo "${ECHO_T}$gcc_cv_type_uchar" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_type_uchar" >&5 +echo "${ECHO_T}$gcc_cv_type_uchar" >&6; } if test $ac_cv_type_uchar = yes; then cat >>confdefs.h <<\_ACEOF @@ -7410,13 +7895,13 @@ prefix="$acl_save_prefix" -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -7433,8 +7918,8 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -7463,11 +7948,11 @@ ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7496,17 +7981,17 @@ LD="$acl_cv_path_LD" if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7517,14 +8002,14 @@ acl_cv_prog_gnu_ld=no fi fi -echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7536,8 +8021,8 @@ acl_cv_rpath=done fi -echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" @@ -7545,13 +8030,13 @@ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath or --disable-rpath was given. + # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" - : + enableval=$enable_rpath; : else enable_rpath=yes -fi; +fi + @@ -7573,10 +8058,9 @@ prefix="$acl_save_prefix" -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +# Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" - + withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -7599,7 +8083,8 @@ fi fi -fi; +fi + LIBICONV= LTLIBICONV= INCICONV= @@ -7966,8 +8451,8 @@ done - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7993,34 +8478,32 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" @@ -8044,42 +8527,40 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF @@ -8088,10 +8569,10 @@ fi if test "$am_cv_lib_iconv" = yes; then - echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6 + { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= @@ -8101,8 +8582,8 @@ if test "$am_cv_func_iconv" = yes; then - echo "$as_me:$LINENO: checking for iconv declaration" >&5 -echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8135,43 +8616,39 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_proto_iconv_arg1="const" + am_cv_proto_iconv_arg1="const" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - echo "$as_me:$LINENO: result: ${ac_t:- + { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- - }$am_cv_proto_iconv" >&6 + }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 @@ -8196,13 +8673,13 @@ fi -# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +# Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - + enableval=$enable_maintainer_mode; else enable_maintainer_mode=no -fi; +fi + if test "x$enable_maintainer_mode" = xno; then MAINT='#' @@ -8211,13 +8688,13 @@ fi -# Check whether --enable-checking or --disable-checking was given. +# Check whether --enable-checking was given. if test "${enable_checking+set}" = set; then - enableval="$enable_checking" - + enableval=$enable_checking; else enable_checking=no -fi; +fi + if test $enable_checking != no ; then @@ -8265,10 +8742,9 @@ # LLVM LOCAL begin -# Check whether --enable-llvm or --disable-llvm was given. +# Check whether --enable-llvm was given. if test "${enable_llvm+set}" = set; then - enableval="$enable_llvm" - case "${enableval}" in + enableval=$enable_llvm; case "${enableval}" in yes) { { echo "$as_me:$LINENO: error: You must specify a path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify a path to your LLVM tree with --enable-llvm=DIR" >&2;} { (exit 1); exit 1; }; } @@ -8287,10 +8763,8 @@ esac if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then - echo Found Release LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then - echo Found Debug LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH @@ -8298,6 +8772,12 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Asserts/bin/llc$EXEEXT"; then + echo Found Release+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts" + elif test -x "$LLVMBASEPATH/Debug+Asserts/bin/llc$EXEEXT"; then + echo Found Debug+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts" elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then echo Found Release+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Release+Checks" @@ -8310,8 +8790,16 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Release+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts+Checks" elif test -x "$LLVMBASEPATH/bin/llc$EXEEXT"; then echo Found Installed LLVM Tree in $LLVMBASEPATH + elif test x$LLVMBUILDMODE = x; then + echo Found Installed LLVM Tree in $LLVMBASEPATH else { { echo "$as_me:$LINENO: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&2;} @@ -8320,16 +8808,17 @@ else LLVMBASEPATH="" -fi; +fi + # LLVM LOCAL end # Output. - ac_config_headers="$ac_config_headers config.h:config.in" +ac_config_headers="$ac_config_headers config.h:config.in" - ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8349,39 +8838,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 @@ -8390,32 +8898,18 @@ # 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 - DEFS=-DHAVE_CONFIG_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 @@ -8446,17 +8940,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 @@ -8466,8 +8988,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='+ ' @@ -8481,18 +9038,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 @@ -8500,159 +9058,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'` +# 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$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=: @@ -8661,7 +9180,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'" @@ -8670,31 +9210,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 cpplib $as_me , 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 @@ -8702,30 +9225,20 @@ 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 +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -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 +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -8733,7 +9246,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 @@ -8752,19 +9265,21 @@ $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ cpplib config.status -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 -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8775,39 +9290,24 @@ 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 @@ -8817,18 +9317,24 @@ $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { 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 ;; -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 @@ -8844,37 +9350,49 @@ _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 # - DEPDIR=$DEPDIR _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" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "depdir" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + case $ac_config_target in + "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES 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 @@ -8886,716 +9404,554 @@ 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 build@,$build,;t t -s, at build_cpu@,$build_cpu,;t t -s, at build_vendor@,$build_vendor,;t t -s, at build_os@,$build_os,;t t -s, at host@,$host,;t t -s, at host_cpu@,$host_cpu,;t t -s, at host_vendor@,$host_vendor,;t t -s, at host_os@,$host_os,;t t -s, at target@,$target,;t t -s, at target_cpu@,$target_cpu,;t t -s, at target_vendor@,$target_vendor,;t t -s, at target_os@,$target_os,;t t -s, at SET_MAKE@,$SET_MAKE,;t t -s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s, at INSTALL_DATA@,$INSTALL_DATA,;t t -s, at CC@,$CC,;t t -s, at CFLAGS@,$CFLAGS,;t t -s, at LDFLAGS@,$LDFLAGS,;t t -s, at CPPFLAGS@,$CPPFLAGS,;t t -s, at ac_ct_CC@,$ac_ct_CC,;t t -s, at EXEEXT@,$EXEEXT,;t t -s, at OBJEXT@,$OBJEXT,;t t -s, at RANLIB@,$RANLIB,;t t -s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s, at ACLOCAL@,$ACLOCAL,;t t -s, at AUTOCONF@,$AUTOCONF,;t t -s, at AUTOHEADER@,$AUTOHEADER,;t t -s, at WARN_CFLAGS@,$WARN_CFLAGS,;t t -s, at WARN_PEDANTIC@,$WARN_PEDANTIC,;t t -s, at WERROR@,$WERROR,;t t -s, at am__leading_dot@,$am__leading_dot,;t t -s, at DEPDIR@,$DEPDIR,;t t -s, at CCDEPMODE@,$CCDEPMODE,;t t -s, at CPP@,$CPP,;t t -s, at EGREP@,$EGREP,;t t -s, at LIBOBJS@,$LIBOBJS,;t t -s, at ALLOCA@,$ALLOCA,;t t -s, at USE_NLS@,$USE_NLS,;t t -s, at LIBINTL@,$LIBINTL,;t t -s, at LIBINTL_DEP@,$LIBINTL_DEP,;t t -s, at INCINTL@,$INCINTL,;t t -s, at XGETTEXT@,$XGETTEXT,;t t -s, at GMSGFMT@,$GMSGFMT,;t t -s, at POSUB@,$POSUB,;t t -s, at CATALOGS@,$CATALOGS,;t t -s, at DATADIRNAME@,$DATADIRNAME,;t t -s, at INSTOBJEXT@,$INSTOBJEXT,;t t -s, at GENCAT@,$GENCAT,;t t -s, at CATOBJEXT@,$CATOBJEXT,;t t -s, at LIBICONV@,$LIBICONV,;t t -s, at LTLIBICONV@,$LTLIBICONV,;t t -s, at PACKAGE@,$PACKAGE,;t t -s, at USED_CATALOGS@,$USED_CATALOGS,;t t -s, at MAINT@,$MAINT,;t t -s, at LLVMBASEPATH@,$LLVMBASEPATH,;t t -s, at LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_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 +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +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 +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +RANLIB!$RANLIB$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +WARN_CFLAGS!$WARN_CFLAGS$ac_delim +WARN_PEDANTIC!$WARN_PEDANTIC$ac_delim +WERROR!$WERROR$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +DEPDIR!$DEPDIR$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +ALLOCA!$ALLOCA$ac_delim +USE_NLS!$USE_NLS$ac_delim +LIBINTL!$LIBINTL$ac_delim +LIBINTL_DEP!$LIBINTL_DEP$ac_delim +INCINTL!$INCINTL$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +POSUB!$POSUB$ac_delim +CATALOGS!$CATALOGS$ac_delim +DATADIRNAME!$DATADIRNAME$ac_delim +INSTOBJEXT!$INSTOBJEXT$ac_delim +GENCAT!$GENCAT$ac_delim +CATOBJEXT!$CATOBJEXT$ac_delim +LIBICONV!$LIBICONV$ac_delim +LTLIBICONV!$LTLIBICONV$ac_delim +PACKAGE!$PACKAGE$ac_delim +USED_CATALOGS!$USED_CATALOGS$ac_delim +MAINT!$MAINT$ac_delim +LLVMBASEPATH!$LLVMBASEPATH$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; 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 :H $CONFIG_HEADERS :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 ;; + 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 + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_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." - - # 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 -s, at INSTALL@,$ac_INSTALL,;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 +s&@INSTALL@&$ac_INSTALL&;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_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + rm -f "$tmp/stdin" 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 ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # 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; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - 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; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines -# This sed command replaces #undef with comments. This is necessary, for +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # 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 - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - 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 || -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" - 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; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi - # Run the commands associated with the file. - case $ac_file in - config.h ) echo timestamp > stamp-h1 ;; - esac -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + rm -f "$tmp/out12" + ;; -# -# 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 - -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 + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + 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 + case $ac_file$ac_mode in + "depdir":C) mkdir $DEPDIR ;; + "config.h":H) echo timestamp > stamp-h1 ;; - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depdir ) mkdir $DEPDIR ;; esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF Modified: llvm-gcc-4.2/trunk/libcpp/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/configure.ac?rev=107799&r1=107798&r2=107799&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/configure.ac (original) +++ llvm-gcc-4.2/trunk/libcpp/configure.ac Wed Jul 7 13:32:35 2010 @@ -163,10 +163,8 @@ esac if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then - echo Found Release LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Release" elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then - echo Found Debug LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug" elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH @@ -174,6 +172,12 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts" + elif test -x "$LLVMBASEPATH/Release+Asserts/bin/llc$EXEEXT"; then + echo Found Release+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts" + elif test -x "$LLVMBASEPATH/Debug+Asserts/bin/llc$EXEEXT"; then + echo Found Debug+Asserts LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts" elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then echo Found Release+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Release+Checks" @@ -186,8 +190,16 @@ elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH LLVMBUILDMODE="Debug-Asserts+Checks" + elif test -x "$LLVMBASEPATH/Release+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Release+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Release+Asserts+Checks" + elif test -x "$LLVMBASEPATH/Debug+Asserts+Checks/bin/llc$EXEEXT"; then + echo Found Debug+Asserts+Checks LLVM Tree in $LLVMBASEPATH + LLVMBUILDMODE="Debug+Asserts+Checks" elif test -x "$LLVMBASEPATH/bin/llc$EXEEXT"; then echo Found Installed LLVM Tree in $LLVMBASEPATH + elif test x$LLVMBUILDMODE = x; then + echo Found Installed LLVM Tree in $LLVMBASEPATH else AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR]) fi From gohman at apple.com Wed Jul 7 13:32:53 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 18:32:53 -0000 Subject: [llvm-commits] [llvm] r107800 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetLowering.h lib/CodeGen/CallingConvLower.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/XCore/XCoreISelLowering.cpp lib/Target/XCore/XCoreISelLowering.h test/CodeGen/X86/fast-isel-gep.ll Message-ID: <20100707183253.8BC2E2A6C131@llvm.org> Author: djg Date: Wed Jul 7 13:32:53 2010 New Revision: 107800 URL: http://llvm.org/viewvc/llvm-project?rev=107800&view=rev Log: Add X86FastISel support for return statements. This entails refactoring a bunch of stuff, to allow the target-independent calling convention logic to be employed. Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/CallingConvLower.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.h llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Jul 7 13:32:53 2010 @@ -188,8 +188,7 @@ /// CheckReturn - Analyze the return values of a function, returning /// true if the return can be performed without sret-demotion, and /// false otherwise. - bool CheckReturn(const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, + bool CheckReturn(const SmallVectorImpl &ArgsFlags, CCAssignFn Fn); /// AnalyzeCallOperands - Analyze the outgoing arguments to a call, Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jul 7 13:32:53 2010 @@ -24,6 +24,7 @@ #include "llvm/CallingConv.h" #include "llvm/InlineAsm.h" +#include "llvm/Attributes.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/ADT/APFloat.h" @@ -1159,8 +1160,7 @@ /// registers. If false is returned, an sret-demotion is performed. /// virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, + const SmallVectorImpl &Outs, LLVMContext &Context) const { // Return true by default to get preexisting behavior. @@ -1656,6 +1656,15 @@ /// optimization. bool benefitFromCodePlacementOpt; }; + +/// GetReturnInfo - Given an LLVM IR type and return type attributes, +/// compute the return value EVTs and flags, and optionally also +/// the offsets, if the return value is being lowered to memory. +void GetReturnInfo(const Type* ReturnType, Attributes attr, + SmallVectorImpl &Outs, + const TargetLowering &TLI, + SmallVectorImpl *Offsets = 0); + } // end llvm namespace #endif Modified: llvm/trunk/lib/CodeGen/CallingConvLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CallingConvLower.cpp?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CallingConvLower.cpp (original) +++ llvm/trunk/lib/CodeGen/CallingConvLower.cpp Wed Jul 7 13:32:53 2010 @@ -80,13 +80,12 @@ /// CheckReturn - Analyze the return values of a function, returning true if /// the return can be performed without sret-demotion, and false otherwise. -bool CCState::CheckReturn(const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, +bool CCState::CheckReturn(const SmallVectorImpl &Outs, CCAssignFn Fn) { // Determine which register each value should be copied into. - for (unsigned i = 0, e = OutTys.size(); i != e; ++i) { - EVT VT = OutTys[i]; - ISD::ArgFlagsTy ArgFlags = ArgsFlags[i]; + for (unsigned i = 0, e = Outs.size(); i != e; ++i) { + EVT VT = Outs[i].VT; + ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) return false; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Jul 7 13:32:53 2010 @@ -963,67 +963,6 @@ return SDValue(); } -/// Get the EVTs and ArgFlags collections that represent the legalized return -/// type of the given function. This does not require a DAG or a return value, -/// and is suitable for use before any DAGs for the function are constructed. -static void getReturnInfo(const Type* ReturnType, - Attributes attr, SmallVectorImpl &OutVTs, - SmallVectorImpl &OutFlags, - const TargetLowering &TLI, - SmallVectorImpl *Offsets = 0) { - SmallVector ValueVTs; - ComputeValueVTs(TLI, ReturnType, ValueVTs); - unsigned NumValues = ValueVTs.size(); - if (NumValues == 0) return; - unsigned Offset = 0; - - for (unsigned j = 0, f = NumValues; j != f; ++j) { - EVT VT = ValueVTs[j]; - ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - - if (attr & Attribute::SExt) - ExtendKind = ISD::SIGN_EXTEND; - else if (attr & 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()) { - EVT MinVT = TLI.getRegisterType(ReturnType->getContext(), MVT::i32); - if (VT.bitsLT(MinVT)) - VT = MinVT; - } - - unsigned NumParts = TLI.getNumRegisters(ReturnType->getContext(), VT); - EVT PartVT = TLI.getRegisterType(ReturnType->getContext(), VT); - unsigned PartSize = TLI.getTargetData()->getTypeAllocSize( - PartVT.getTypeForEVT(ReturnType->getContext())); - - // 'inreg' on function refers to return value - ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy(); - if (attr & Attribute::InReg) - Flags.setInReg(); - - // Propagate extension type if any - if (attr & Attribute::SExt) - Flags.setSExt(); - else if (attr & Attribute::ZExt) - Flags.setZExt(); - - for (unsigned i = 0; i < NumParts; ++i) { - OutVTs.push_back(PartVT); - OutFlags.push_back(Flags); - if (Offsets) - { - Offsets->push_back(Offset); - Offset += PartSize; - } - } - } -} - void SelectionDAGBuilder::visitRet(const ReturnInst &I) { SDValue Chain = getControlRoot(); SmallVector Outs; @@ -4559,14 +4498,13 @@ Args.reserve(CS.arg_size()); // Check whether the function can return without sret-demotion. - SmallVector OutVTs; - SmallVector OutsFlags; + SmallVector Outs; SmallVector Offsets; - getReturnInfo(RetTy, CS.getAttributes().getRetAttributes(), - OutVTs, OutsFlags, TLI, &Offsets); + GetReturnInfo(RetTy, CS.getAttributes().getRetAttributes(), + Outs, TLI, &Offsets); bool CanLowerReturn = TLI.CanLowerReturn(CS.getCallingConv(), - FTy->isVarArg(), OutVTs, OutsFlags, FTy->getContext()); + FTy->isVarArg(), Outs, FTy->getContext()); SDValue DemoteStackSlot; @@ -4659,7 +4597,7 @@ ComputeValueVTs(TLI, PtrRetTy, PVTs); assert(PVTs.size() == 1 && "Pointers should fit in one register"); EVT PtrVT = PVTs[0]; - unsigned NumValues = OutVTs.size(); + unsigned NumValues = Outs.size(); SmallVector Values(NumValues); SmallVector Chains(NumValues); @@ -4667,7 +4605,7 @@ SDValue Add = DAG.getNode(ISD::ADD, getCurDebugLoc(), PtrVT, DemoteStackSlot, DAG.getConstant(Offsets[i], PtrVT)); - SDValue L = DAG.getLoad(OutVTs[i], getCurDebugLoc(), Result.second, + SDValue L = DAG.getLoad(Outs[i].VT, getCurDebugLoc(), Result.second, Add, NULL, Offsets[i], false, false, 1); Values[i] = L; Chains[i] = L.getValue(1); @@ -5959,15 +5897,13 @@ SmallVector Ins; // Check whether the function can return without sret-demotion. - SmallVector OutVTs; - SmallVector OutsFlags; - getReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), - OutVTs, OutsFlags, TLI); + SmallVector Outs; + GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), + Outs, TLI); FuncInfo->CanLowerReturn = TLI.CanLowerReturn(F.getCallingConv(), F.isVarArg(), - OutVTs, OutsFlags, - F.getContext()); + Outs, F.getContext()); if (!FuncInfo->CanLowerReturn) { // Put in an sret pointer parameter before all the other parameters. SmallVector ValueVTs; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jul 7 13:32:53 2010 @@ -20,6 +20,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/GlobalVariable.h" #include "llvm/DerivedTypes.h" +#include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineFunction.h" @@ -838,6 +839,65 @@ return 1; } +/// Get the EVTs and ArgFlags collections that represent the legalized return +/// type of the given function. This does not require a DAG or a return value, +/// and is suitable for use before any DAGs for the function are constructed. +/// TODO: Move this out of TargetLowering.cpp. +void llvm::GetReturnInfo(const Type* ReturnType, Attributes attr, + SmallVectorImpl &Outs, + const TargetLowering &TLI, + SmallVectorImpl *Offsets) { + SmallVector ValueVTs; + ComputeValueVTs(TLI, ReturnType, ValueVTs); + unsigned NumValues = ValueVTs.size(); + if (NumValues == 0) return; + unsigned Offset = 0; + + for (unsigned j = 0, f = NumValues; j != f; ++j) { + EVT VT = ValueVTs[j]; + ISD::NodeType ExtendKind = ISD::ANY_EXTEND; + + if (attr & Attribute::SExt) + ExtendKind = ISD::SIGN_EXTEND; + else if (attr & 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()) { + EVT MinVT = TLI.getRegisterType(ReturnType->getContext(), MVT::i32); + if (VT.bitsLT(MinVT)) + VT = MinVT; + } + + unsigned NumParts = TLI.getNumRegisters(ReturnType->getContext(), VT); + EVT PartVT = TLI.getRegisterType(ReturnType->getContext(), VT); + unsigned PartSize = TLI.getTargetData()->getTypeAllocSize( + PartVT.getTypeForEVT(ReturnType->getContext())); + + // 'inreg' on function refers to return value + ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy(); + if (attr & Attribute::InReg) + Flags.setInReg(); + + // Propagate extension type if any + if (attr & Attribute::SExt) + Flags.setSExt(); + else if (attr & Attribute::ZExt) + Flags.setZExt(); + + for (unsigned i = 0; i < NumParts; ++i) { + Outs.push_back(ISD::OutputArg(Flags, PartVT, /*isFixed=*/true)); + if (Offsets) { + Offsets->push_back(Offset); + Offset += PartSize; + } + } + } +} + /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate /// function arguments in the caller parameter area. This is the actual /// alignment, not its logarithm. Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 7 13:32:53 2010 @@ -23,6 +23,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" +#include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/MachineConstantPool.h" @@ -84,6 +85,8 @@ bool X86SelectStore(const Instruction *I); + bool X86SelectRet(const Instruction *I); + bool X86SelectCmp(const Instruction *I); bool X86SelectZExt(const Instruction *I); @@ -660,6 +663,67 @@ return X86FastEmitStore(VT, I->getOperand(0), AM); } +/// X86SelectRet - Select and emit code to implement ret instructions. +bool X86FastISel::X86SelectRet(const Instruction *I) { + const ReturnInst *Ret = cast(I); + const Function &F = *I->getParent()->getParent(); + + if (!FuncInfo.CanLowerReturn) + return false; + + CallingConv::ID CC = F.getCallingConv(); + if (CC != CallingConv::C && + CC != CallingConv::Fast && + CC != CallingConv::X86_FastCall) + return false; + + if (Subtarget->isTargetWin64()) + return false; + + // fastcc with -tailcallopt is intended to provide a guaranteed + // tail call optimization. Fastisel doesn't know how to do that. + if (CC == CallingConv::Fast && GuaranteedTailCallOpt) + return false; + + // Let SDISel handle vararg functions. + if (F.isVarArg()) + return false; + + SmallVector Outs; + GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), + Outs, TLI); + + // Analyze operands of the call, assigning locations to each operand. + SmallVector ValLocs; + CCState CCInfo(CC, F.isVarArg(), TM, ValLocs, I->getContext()); + CCInfo.AnalyzeReturn(Outs, CCAssignFnForCall(CC)); + + // Copy the return value into registers. + for (unsigned i = 0, e = ValLocs.size(); i != e; ++i) { + CCValAssign &VA = ValLocs[i]; + + // Don't bother handling odd stuff for now. + if (VA.getLocInfo() != CCValAssign::Full) + return false; + if (!VA.isRegLoc()) + return false; + + const Value *RV = Ret->getOperand(VA.getValNo()); + unsigned Reg = getRegForValue(RV); + + TargetRegisterClass* RC = TLI.getRegClassFor(VA.getValVT()); + bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + VA.getLocReg(), Reg, RC, RC, DL); + assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; + + MRI.addLiveOut(X86::XMM0); + } + + // Now emit the RET. + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::RET)); + return true; +} + /// X86SelectLoad - Select and emit code to implement load instructions. /// bool X86FastISel::X86SelectLoad(const Instruction *I) { @@ -1194,14 +1258,18 @@ switch (CI->getIntrinsicID()) { default: break; case Intrinsic::sadd_with_overflow: - case Intrinsic::uadd_with_overflow: + case Intrinsic::uadd_with_overflow: { // Cheat a little. We know that the registers for "add" and "seto" are // allocated sequentially. However, we only keep track of the register // for "add" in the value map. Use extractvalue's index to get the // correct register for "seto". - UpdateValueMap(I, lookUpRegForValue(Agg) + *EI->idx_begin()); + unsigned OpReg = getRegForValue(Agg); + if (OpReg == 0) + return false; + UpdateValueMap(I, OpReg + *EI->idx_begin()); return true; } + } } return false; @@ -1664,6 +1732,8 @@ return X86SelectLoad(I); case Instruction::Store: return X86SelectStore(I); + case Instruction::Ret: + return X86SelectRet(I); case Instruction::ICmp: case Instruction::FCmp: return X86SelectCmp(I); Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 7 13:32:53 2010 @@ -1218,13 +1218,12 @@ bool X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, + const SmallVectorImpl &Outs, LLVMContext &Context) const { SmallVector RVLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs, Context); - return CCInfo.CheckReturn(OutTys, ArgsFlags, RetCC_X86); + return CCInfo.CheckReturn(Outs, RetCC_X86); } SDValue Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jul 7 13:32:53 2010 @@ -740,8 +740,7 @@ virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, + const SmallVectorImpl &Outs, LLVMContext &Context) const; void ReplaceATOMIC_BINARY_64(SDNode *N, SmallVectorImpl &Results, Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Wed Jul 7 13:32:53 2010 @@ -1135,13 +1135,12 @@ bool XCoreTargetLowering:: CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, + const SmallVectorImpl &Outs, LLVMContext &Context) const { SmallVector RVLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs, Context); - return CCInfo.CheckReturn(OutTys, ArgsFlags, RetCC_XCore); + return CCInfo.CheckReturn(Outs, RetCC_XCore); } SDValue Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.h?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.h (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.h Wed Jul 7 13:32:53 2010 @@ -193,8 +193,7 @@ virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &OutTys, - const SmallVectorImpl &ArgsFlags, + const SmallVectorImpl &ArgsFlags, LLVMContext &Context) const; }; } Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll?rev=107800&r1=107799&r2=107800&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll Wed Jul 7 13:32:53 2010 @@ -14,8 +14,7 @@ ; X64: test1: ; X64: movslq %edi, %rax -; X64: movl (%rsi,%rax,4), %eax -; X64: ret +; X64: movl (%rsi,%rax,4), %e } define i32 @test2(i64 %t3, i32* %t1) nounwind { From bob.wilson at apple.com Wed Jul 7 14:00:51 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 07 Jul 2010 19:00:51 -0000 Subject: [llvm-commits] [test-suite] r107802 - /test-suite/trunk/Makefile.rules Message-ID: <20100707190051.444332A6C12C@llvm.org> Author: bwilson Date: Wed Jul 7 14:00:51 2010 New Revision: 107802 URL: http://llvm.org/viewvc/llvm-project?rev=107802&view=rev Log: Update test-suite Makefile.rules to match llvm's Makefile.rules as changed in svn 107758. 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=107802&r1=107801&r2=107802&view=diff ============================================================================== --- test-suite/trunk/Makefile.rules (original) +++ test-suite/trunk/Makefile.rules Wed Jul 7 14:00:51 2010 @@ -154,9 +154,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) - # Indicate that assertions are turned off using a minus sign - CONFIGURATION := $(CONFIGURATION)-Asserts +ifneq ($(DISABLE_ASSERTIONS),1) + CONFIGURATION := $(CONFIGURATION)+Asserts endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or From gohman at apple.com Wed Jul 7 14:20:32 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 19:20:32 -0000 Subject: [llvm-commits] [llvm] r107804 - in /llvm/trunk: include/llvm/CodeGen/FastISel.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-loads.ll test/CodeGen/X86/fast-isel.ll Message-ID: <20100707192032.C1F992A6C12C@llvm.org> Author: djg Date: Wed Jul 7 14:20:32 2010 New Revision: 107804 URL: http://llvm.org/viewvc/llvm-project?rev=107804&view=rev Log: Implement bottom-up fast-isel. This has the advantage of not requiring a separate DCE pass over MachineInstrs. Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll llvm/trunk/test/CodeGen/X86/fast-isel.ll Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Wed Jul 7 14:20:32 2010 @@ -19,6 +19,7 @@ #include "llvm/ADT/SmallSet.h" #endif #include "llvm/CodeGen/ValueTypes.h" +#include "llvm/CodeGen/MachineBasicBlock.h" namespace llvm { @@ -55,15 +56,17 @@ const TargetInstrInfo &TII; const TargetLowering &TLI; const TargetRegisterInfo &TRI; - bool IsBottomUp; + MachineBasicBlock::iterator LastLocalValue; public: + /// getLastLocalValue - Return the position of the last instruction + /// emitted for materializing constants for use in the current block. + MachineBasicBlock::iterator getLastLocalValue() { return LastLocalValue; } + /// startNewBlock - Set the current block to which generated machine /// instructions will be appended, and clear the local CSE map. /// - void startNewBlock() { - LocalValueMap.clear(); - } + void startNewBlock(); /// getCurDebugLoc() - Return current debug location information. DebugLoc getCurDebugLoc() const { return DL; } Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Jul 7 14:20:32 2010 @@ -329,19 +329,15 @@ if (OptLevel != CodeGenOpt::None) PM.add(createOptimizePHIsPass()); - // Delete dead machine instructions regardless of optimization level. - // - // At -O0, fast-isel frequently creates dead instructions. - // - // With optimization, dead code should already be eliminated. However - // there is one known exception: lowered code for arguments that are only - // used by tail calls, where the tail calls reuse the incoming stack - // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll). - PM.add(createDeadMachineInstructionElimPass()); - printAndVerify(PM, "After codegen DCE pass", - /* allowDoubleDefs= */ true); - if (OptLevel != CodeGenOpt::None) { + // With optimization, dead code should already be eliminated. However + // there is one known exception: lowered code for arguments that are only + // used by tail calls, where the tail calls reuse the incoming stack + // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll). + PM.add(createDeadMachineInstructionElimPass()); + printAndVerify(PM, "After codegen DCE pass", + /* allowDoubleDefs= */ true); + PM.add(createOptimizeExtsPass()); if (!DisableMachineLICM) PM.add(createMachineLICMPass()); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 7 14:20:32 2010 @@ -57,6 +57,17 @@ #include "llvm/Support/ErrorHandling.h" using namespace llvm; +/// startNewBlock - Set the current block to which generated machine +/// instructions will be appended, and clear the local CSE map. +/// +void FastISel::startNewBlock() { + LocalValueMap.clear(); + + // Start out as end(), meaining no local-value instructions have + // been emitted. + LastLocalValue = FuncInfo.MBB->end(); +} + bool FastISel::hasTrivialKill(const Value *V) const { // Don't consider constants or arguments to have trivial kills. const Instruction *I = dyn_cast(V); @@ -109,12 +120,9 @@ // In bottom-up mode, just create the virtual register which will be used // to hold the value. It will be materialized later. - if (IsBottomUp) { + if (isa(V)) { Reg = createResultReg(TLI.getRegClassFor(VT)); - if (isa(V)) - FuncInfo.ValueMap[V] = Reg; - else - LocalValueMap[V] = Reg; + FuncInfo.ValueMap[V] = Reg; return Reg; } @@ -180,8 +188,10 @@ // Don't cache constant materializations in the general ValueMap. // To do so would require tracking what uses they dominate. - if (Reg != 0) + if (Reg != 0) { LocalValueMap[V] = Reg; + LastLocalValue = MRI.getVRegDef(Reg); + } return Reg; } @@ -210,12 +220,20 @@ unsigned &AssignedReg = FuncInfo.ValueMap[I]; if (AssignedReg == 0) + // Use the new register. AssignedReg = Reg; else if (Reg != AssignedReg) { - const TargetRegisterClass *RegClass = MRI.getRegClass(Reg); - TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, AssignedReg, - Reg, RegClass, RegClass, DL); + // We already have a register for this value. Replace uses of + // the existing register with uses of the new one. + MRI.replaceRegWith(AssignedReg, Reg); + // Replace uses of the existing register in PHINodesToUpdate too. + for (unsigned i = 0, e = FuncInfo.PHINodesToUpdate.size(); i != e; ++i) + if (FuncInfo.PHINodesToUpdate[i].second == AssignedReg) + FuncInfo.PHINodesToUpdate[i].second = Reg; + // And update the ValueMap. + AssignedReg = Reg; } + return AssignedReg; } @@ -736,11 +754,15 @@ BasicBlock::iterator ScanFrom = LI; if (const Value *V = FindAvailableLoadedValue(LI->getPointerOperand(), LI->getParent(), ScanFrom)) { + if (!isa(V) || + cast(V)->getParent() == LI->getParent() || + (isa(V) && FuncInfo.StaticAllocaMap.count(cast(V)))) { unsigned ResultReg = getRegForValue(V); if (ResultReg != 0) { UpdateValueMap(I, ResultReg); return true; } + } } } @@ -871,8 +893,7 @@ TD(*TM.getTargetData()), TII(*TM.getInstrInfo()), TLI(*TM.getTargetLowering()), - TRI(*TM.getRegisterInfo()), - IsBottomUp(false) { + TRI(*TM.getRegisterInfo()) { } FastISel::~FastISel() {} Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Wed Jul 7 14:20:32 2010 @@ -78,6 +78,13 @@ MF = &mf; RegInfo = &MF->getRegInfo(); + // Check whether the function can return without sret-demotion. + SmallVector Outs; + GetReturnInfo(Fn->getReturnType(), + Fn->getAttributes().getRetAttributes(), Outs, TLI); + CanLowerReturn = TLI.CanLowerReturn(Fn->getCallingConv(), Fn->isVarArg(), + Outs, Fn->getContext()); + // Create a vreg for each argument register that is not dead and is used // outside of the entry block for the function. for (Function::const_arg_iterator AI = Fn->arg_begin(), E = Fn->arg_end(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Jul 7 14:20:32 2010 @@ -951,12 +951,10 @@ // If this is an instruction which fast-isel has deferred, select it now. if (const Instruction *Inst = dyn_cast(V)) { - assert(Inst->isSafeToSpeculativelyExecute() && - "Instruction with side effects deferred!"); - visit(*Inst); - DenseMap::iterator NIt = NodeMap.find(Inst); - if (NIt != NodeMap.end() && NIt->second.getNode()) - return NIt->second; + unsigned InReg = FuncInfo.InitializeRegForValue(Inst); + RegsForValue RFV(*DAG.getContext(), TLI, InReg, Inst->getType()); + SDValue Chain = DAG.getEntryNode(); + return RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL); } llvm_unreachable("Can't get register for value!"); @@ -1259,7 +1257,7 @@ } void SelectionDAGBuilder::visitBr(const BranchInst &I) { - MachineBasicBlock *BrMBB = FuncInfo.MBBMap[I.getParent()]; + MachineBasicBlock *BrMBB = FuncInfo.MBB; // Update machine-CFG edges. MachineBasicBlock *Succ0MBB = FuncInfo.MBBMap[I.getSuccessor(0)]; @@ -1585,7 +1583,7 @@ } void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) { - MachineBasicBlock *InvokeMBB = FuncInfo.MBBMap[I.getParent()]; + MachineBasicBlock *InvokeMBB = FuncInfo.MBB; // Retrieve successors. MachineBasicBlock *Return = FuncInfo.MBBMap[I.getSuccessor(0)]; @@ -2113,7 +2111,7 @@ } void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) { - MachineBasicBlock *SwitchMBB = FuncInfo.MBBMap[SI.getParent()]; + MachineBasicBlock *SwitchMBB = FuncInfo.MBB; // Figure out which block is immediately after the current one. MachineBasicBlock *NextBlock = 0; @@ -2179,7 +2177,7 @@ } void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) { - MachineBasicBlock *IndirectBrMBB = FuncInfo.MBBMap[I.getParent()]; + MachineBasicBlock *IndirectBrMBB = FuncInfo.MBB; // Update machine-CFG edges with unique successors. SmallVector succs; @@ -3839,7 +3837,7 @@ if (DV.isInlinedFnArgument(MF.getFunction())) return false; - MachineBasicBlock *MBB = FuncInfo.MBBMap[DI.getParent()]; + MachineBasicBlock *MBB = FuncInfo.MBB; if (MBB != &MF.front()) return false; @@ -4102,7 +4100,7 @@ } case Intrinsic::eh_exception: { // Insert the EXCEPTIONADDR instruction. - assert(FuncInfo.MBBMap[I.getParent()]->isLandingPad() && + assert(FuncInfo.MBB->isLandingPad() && "Call to eh.exception not in landing pad!"); SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); SDValue Ops[1]; @@ -4114,7 +4112,7 @@ } case Intrinsic::eh_selector: { - MachineBasicBlock *CallMBB = FuncInfo.MBBMap[I.getParent()]; + MachineBasicBlock *CallMBB = FuncInfo.MBB; MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI(); if (CallMBB->isLandingPad()) AddCatchInfo(I, &MMI, CallMBB); @@ -4124,7 +4122,7 @@ #endif // FIXME: Mark exception selector register as live in. Hack for PR1508. unsigned Reg = TLI.getExceptionSelectorRegister(); - if (Reg) FuncInfo.MBBMap[I.getParent()]->addLiveIn(Reg); + if (Reg) FuncInfo.MBB->addLiveIn(Reg); } // Insert the EHSELECTION instruction. @@ -5901,9 +5899,6 @@ GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), Outs, TLI); - FuncInfo->CanLowerReturn = TLI.CanLowerReturn(F.getCallingConv(), - F.isVarArg(), - Outs, F.getContext()); if (!FuncInfo->CanLowerReturn) { // Put in an sret pointer parameter before all the other parameters. SmallVector ValueVTs; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 14:20:32 2010 @@ -680,60 +680,55 @@ BasicBlock::const_iterator const Begin = LLVMBB->getFirstNonPHI(); BasicBlock::const_iterator const End = LLVMBB->end(); - BasicBlock::const_iterator BI = Begin; + BasicBlock::const_iterator BI = End; - // Lower any arguments needed in this block if this is the entry block. - if (LLVMBB == &Fn.getEntryBlock()) - LowerArguments(LLVMBB); - - // Setup an EH landing-pad block. - if (FuncInfo->MBB->isLandingPad()) - PrepareEHLandingPad(); - // Before doing SelectionDAG ISel, see if FastISel has been requested. if (FastIS) { - // Emit code for any incoming arguments. This must happen before - // beginning FastISel on the entry block. - if (LLVMBB == &Fn.getEntryBlock()) { - CurDAG->setRoot(SDB->getControlRoot()); - SDB->clear(); - CodeGenAndEmitDAG(); - } FastIS->startNewBlock(); + // Do FastISel on as many instructions as possible. - for (; BI != End; ++BI) { -#if 0 - // Defer instructions with no side effects; they'll be emitted - // on-demand later. - if (BI->isSafeToSpeculativelyExecute() && - !FuncInfo->isExportedInst(BI)) + for (; BI != Begin; --BI) { + const Instruction *Inst = llvm::prior(BI); + + // If we no longer require this instruction, skip it. + if (!Inst->mayWriteToMemory() && + !isa(Inst) && + !isa(Inst) && + !FuncInfo->isExportedInst(Inst)) continue; -#endif + + // Bottom-up: reset the insert pos at the top, after any local-value + // instructions. + MachineBasicBlock::iterator LVIP = FastIS->getLastLocalValue(); + if (LVIP != FuncInfo->MBB->end()) + FuncInfo->InsertPt = next(LVIP); + else + FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); // Try to select the instruction with FastISel. - if (FastIS->SelectInstruction(BI)) + if (FastIS->SelectInstruction(Inst)) continue; // Then handle certain instructions as single-LLVM-Instruction blocks. - if (isa(BI)) { + if (isa(Inst)) { ++NumFastIselFailures; if (EnableFastISelVerbose || EnableFastISelAbort) { dbgs() << "FastISel missed call: "; - BI->dump(); + Inst->dump(); } - if (!BI->getType()->isVoidTy() && !BI->use_empty()) { - unsigned &R = FuncInfo->ValueMap[BI]; + if (!Inst->getType()->isVoidTy() && !Inst->use_empty()) { + unsigned &R = FuncInfo->ValueMap[Inst]; if (!R) - R = FuncInfo->CreateRegs(BI->getType()); + R = FuncInfo->CreateRegs(Inst->getType()); } bool HadTailCall = false; - SelectBasicBlock(BI, llvm::next(BI), HadTailCall); + SelectBasicBlock(Inst, BI, HadTailCall); // If the call was emitted as a tail call, we're done with the block. if (HadTailCall) { - BI = End; + --BI; break; } @@ -746,7 +741,7 @@ ++NumFastIselFailures; if (EnableFastISelVerbose || EnableFastISelAbort) { dbgs() << "FastISel miss: "; - BI->dump(); + Inst->dump(); } if (EnableFastISelAbort) // The "fast" selector couldn't handle something and bailed. @@ -757,13 +752,21 @@ } } + FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); + + // Setup an EH landing-pad block. + if (FuncInfo->MBB->isLandingPad()) + PrepareEHLandingPad(); + + // Lower any arguments needed in this block if this is the entry block. + if (LLVMBB == &Fn.getEntryBlock()) + LowerArguments(LLVMBB); + // Run SelectionDAG instruction selection on the remainder of the block // not handled by FastISel. If FastISel is not run, this is the entire // block. - if (BI != End) { - bool HadTailCall; - SelectBasicBlock(BI, End, HadTailCall); - } + bool HadTailCall; + SelectBasicBlock(Begin, BI, HadTailCall); FinishBasicBlock(); FuncInfo->PHINodesToUpdate.clear(); @@ -963,7 +966,8 @@ for (unsigned i = 0, e = Succs.size(); i != e; ++i) { FuncInfo->MBB = Succs[i]; FuncInfo->InsertPt = FuncInfo->MBB->end(); - // BB may have been removed from the CFG if a branch was constant folded. + // FuncInfo->MBB may have been removed from the CFG if a branch was + // constant folded. if (ThisBB->isSuccessor(FuncInfo->MBB)) { for (MachineBasicBlock::iterator Phi = FuncInfo->MBB->begin(); Phi != FuncInfo->MBB->end() && Phi->isPHI(); Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 7 14:20:32 2010 @@ -108,6 +108,7 @@ bool X86SelectCall(const Instruction *I); CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool isTailCall = false); + CCAssignFn *CCAssignFnForRet(CallingConv::ID CC, bool isTailCall = false); const X86InstrInfo *getInstrInfo() const { return getTargetMachine()->getInstrInfo(); @@ -181,6 +182,20 @@ return CC_X86_32_C; } +/// CCAssignFnForRet - Selects the correct CCAssignFn for a given calling +/// convention. +CCAssignFn *X86FastISel::CCAssignFnForRet(CallingConv::ID CC, + bool isTaillCall) { + if (Subtarget->is64Bit()) { + if (Subtarget->isTargetWin64()) + return RetCC_X86_Win64_C; + else + return RetCC_X86_64_C; + } + + return RetCC_X86_32_C; +} + /// X86FastEmitLoad - Emit a machine instruction to load a value of type VT. /// The address is either pre-computed, i.e. Ptr, or a GlobalAddress, i.e. GV. /// Return true and the result register by reference if it is possible. @@ -689,34 +704,39 @@ if (F.isVarArg()) return false; - SmallVector Outs; - GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), - Outs, TLI); + if (Ret->getNumOperands() > 0) { + SmallVector Outs; + GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), + Outs, TLI); + + // Analyze operands of the call, assigning locations to each operand. + SmallVector ValLocs; + CCState CCInfo(CC, F.isVarArg(), TM, ValLocs, I->getContext()); + CCInfo.AnalyzeReturn(Outs, CCAssignFnForRet(CC)); - // Analyze operands of the call, assigning locations to each operand. - SmallVector ValLocs; - CCState CCInfo(CC, F.isVarArg(), TM, ValLocs, I->getContext()); - CCInfo.AnalyzeReturn(Outs, CCAssignFnForCall(CC)); - - // Copy the return value into registers. - for (unsigned i = 0, e = ValLocs.size(); i != e; ++i) { - CCValAssign &VA = ValLocs[i]; - - // Don't bother handling odd stuff for now. - if (VA.getLocInfo() != CCValAssign::Full) - return false; - if (!VA.isRegLoc()) + const Value *RV = Ret->getOperand(0); + unsigned Reg = getRegForValue(RV); + if (Reg == 0) return false; - const Value *RV = Ret->getOperand(VA.getValNo()); - unsigned Reg = getRegForValue(RV); + // Copy the return value into registers. + for (unsigned i = 0, e = ValLocs.size(); i != e; ++i) { + CCValAssign &VA = ValLocs[i]; + + // Don't bother handling odd stuff for now. + if (VA.getLocInfo() != CCValAssign::Full) + return false; + if (!VA.isRegLoc()) + return false; - TargetRegisterClass* RC = TLI.getRegClassFor(VA.getValVT()); - bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - VA.getLocReg(), Reg, RC, RC, DL); - assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; + TargetRegisterClass* RC = TLI.getRegClassFor(VA.getValVT()); + bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, + VA.getLocReg(), Reg + VA.getValNo(), + RC, RC, DL); + assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; - MRI.addLiveOut(X86::XMM0); + MRI.addLiveOut(VA.getLocReg()); + } } // Now emit the RET. Modified: llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll Wed Jul 7 14:20:32 2010 @@ -5,7 +5,7 @@ ; CHECK: foo: ; CHECK-NEXT: movq %rdi, -8(%rsp) ; CHECK-NEXT: movq %rsi, -16(%rsp) -; CHECK: movsd 128(%rsi,%rdi,8), %xmm0 +; CHECK-NEXT: movsd 128(%rsi,%rdi,8), %xmm0 ; CHECK-NEXT: ret define double @foo(i64 %x, double* %p) nounwind { Modified: llvm/trunk/test/CodeGen/X86/fast-isel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel.ll?rev=107804&r1=107803&r2=107804&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel.ll Wed Jul 7 14:20:32 2010 @@ -49,9 +49,10 @@ ret i32 %tmp2 } -define i1 @ptrtoint_i1(i8* %p) nounwind { +define void @ptrtoint_i1(i8* %p, i1* %q) nounwind { %t = ptrtoint i8* %p to i1 - ret i1 %t + store i1 %t, i1* %q + ret void } define i8* @inttoptr_i1(i1 %p) nounwind { %t = inttoptr i1 %p to i8* @@ -86,11 +87,8 @@ ret i8 %tmp } -define void @store_i1(i1* %p, i1 %t) nounwind { - store i1 %t, i1* %p - ret void -} -define i1 @load_i1(i1* %p) nounwind { +define void @load_store_i1(i1* %p, i1* %q) nounwind { %t = load i1* %p - ret i1 %t + store i1 %t, i1* %q + ret void } From criswell at uiuc.edu Wed Jul 7 15:05:25 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 07 Jul 2010 20:05:25 -0000 Subject: [llvm-commits] [poolalloc] r107805 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <20100707200525.4CD072A6C12C@llvm.org> Author: criswell Date: Wed Jul 7 15:05:25 2010 New Revision: 107805 URL: http://llvm.org/viewvc/llvm-project?rev=107805&view=rev Log: Modified code so that it is permissible to not find any targets of an indirect function call. This can happen when a function pointer is loaded from an undef or NULL pointer value. This fixes PR#7580. Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=107805&r1=107804&r2=107805&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Jul 7 15:05:25 2010 @@ -654,13 +654,24 @@ const Type* Int32Type = Type::getInt32Ty(CS.getInstruction()->getContext()); - // If the called function is casted from one function type to another, peer - // into the cast instruction and pull out the actual function being called. - if (ConstantExpr *CE = dyn_cast(CS.getCalledValue())) - if (CE->getOpcode() == Instruction::BitCast && - isa(CE->getOperand(0))) - CF = cast(CE->getOperand(0)); + // + // Get the value that is called at this call site. Strip away any pointer + // casts that do not change the representation of the data (i.e., are + // lossless casts). + // + Value * CalledValue = CS.getCalledValue()->stripPointerCasts(); + + // + // The CallSite::getCalledFunction() method is not guaranteed to strip off + // pointer casts. If no called function was found, manually strip pointer + // casts off of the called value and see if we get a function. If so, this + // is a direct call, and we want to update CF accordingly. + // + if (!CF) CF = dyn_cast(CalledValue); + // + // Do not change any inline assembly code. + // if (isa(TheCall->getOperand(0))) { errs() << "INLINE ASM: ignoring. Hoping that's safe.\n"; return; @@ -669,9 +680,9 @@ // // Ignore calls to NULL pointers or undefined values. // - if ((isa(CS.getCalledValue())) || - (isa(CS.getCalledValue()))) { - errs() << "WARNING: Ignoring call using NULL function pointer.\n"; + if ((isa(CalledValue)) || + (isa(CalledValue))) { + errs() << "WARNING: Ignoring call using NULL/Undef function pointer.\n"; return; } @@ -783,10 +794,15 @@ } // - // Do an assert unless we're bugpointing something. + // If we still haven't been able to find a target function of the call site + // to transform, do nothing. + // + // One may be tempted to think that we should always have at least one + // target, but this is not true. There are perfectly acceptable (but + // strange) programs for which no function targets exist. Function + // pointers loaded from undef values, for example, will have no targets. // - if ((UsingBugpoint) && (!CF)) return; - assert (CF && "No call graph info"); + if (!CF) return; // Get the common graph for the set of functions this call may invoke. if (UsingBugpoint && (!(Graphs.hasDSGraph(*CF)))) return; From criswell at uiuc.edu Wed Jul 7 15:08:46 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 07 Jul 2010 20:08:46 -0000 Subject: [llvm-commits] [poolalloc] r107806 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <20100707200846.EE39B2A6C12C@llvm.org> Author: criswell Date: Wed Jul 7 15:08:46 2010 New Revision: 107806 URL: http://llvm.org/viewvc/llvm-project?rev=107806&view=rev Log: Improved comment text and wrapped text to 80 columns. No functionality changes. Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=107806&r1=107805&r2=107806&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Jul 7 15:08:46 2010 @@ -184,7 +184,11 @@ // and the that the old one has no name. std::string Name = I->getName(); I->setName(""); - // FIXME: Don't assume allocation sizes are 32bit--this differs per architecture! + // + // FIXME: Don't assume allocation sizes are 32-bit; different architectures + // have different limits on the size of memory objects that they can + // allocate. + // if (!Size->getType()->isIntegerTy(32)) Size = CastInst::CreateIntegerCast(Size, Type::getInt32Ty(Size->getType()->getContext()), false, Size->getName(), I); From dpatel at apple.com Wed Jul 7 15:12:52 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 07 Jul 2010 20:12:52 -0000 Subject: [llvm-commits] [llvm] r107807 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100707201252.6B0AD2A6C12C@llvm.org> Author: dpatel Date: Wed Jul 7 15:12:52 2010 New Revision: 107807 URL: http://llvm.org/viewvc/llvm-project?rev=107807&view=rev Log: 80 cols. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=107807&r1=107806&r2=107807&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Jul 7 15:12:52 2010 @@ -44,7 +44,8 @@ static cl::opt PrintDbgScope("print-dbgscope", cl::Hidden, cl::desc("Print DbgScope information for each machine instruction")); -static cl::opt DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden, +static cl::opt DisableDebugInfoPrinting("disable-debug-info-print", + cl::Hidden, cl::desc("Disable debug info printing")); static cl::opt UnknownLocations("use-unknown-locations", cl::Hidden, @@ -1072,8 +1073,9 @@ if (!Name.empty()) addString(&Buffer, dwarf::DW_AT_name, dwarf::DW_FORM_string, Name); - if (Tag == dwarf::DW_TAG_enumeration_type || Tag == dwarf::DW_TAG_class_type || - Tag == dwarf::DW_TAG_structure_type || Tag == dwarf::DW_TAG_union_type) { + if (Tag == dwarf::DW_TAG_enumeration_type || Tag == dwarf::DW_TAG_class_type + || Tag == dwarf::DW_TAG_structure_type || Tag == dwarf::DW_TAG_union_type) + { // Add size if non-zero (derived types might be zero-sized.) if (Size) addUInt(&Buffer, dwarf::DW_AT_byte_size, 0, Size); @@ -1615,11 +1617,13 @@ // FIXME : Handle getNumOperands != 3 if (DVInsn->getNumOperands() == 3) { if (DVInsn->getOperand(0).isReg()) - updated = addRegisterAddress(VariableDie, DVLabel, DVInsn->getOperand(0)); + updated = + addRegisterAddress(VariableDie, DVLabel, DVInsn->getOperand(0)); else if (DVInsn->getOperand(0).isImm()) updated = addConstantValue(VariableDie, DVLabel, DVInsn->getOperand(0)); else if (DVInsn->getOperand(0).isFPImm()) - updated = addConstantFPValue(VariableDie, DVLabel, DVInsn->getOperand(0)); + updated = + addConstantFPValue(VariableDie, DVLabel, DVInsn->getOperand(0)); } else { MachineLocation Location = Asm->getDebugValueLocation(DVInsn); if (Location.getReg()) { @@ -2270,7 +2274,8 @@ const MachineInstr *Begin = NULL; const MachineInstr *End = NULL; for (SmallVector::iterator - MVI = MultipleValues.begin(), MVE = MultipleValues.end(); MVI != MVE; ++MVI) { + MVI = MultipleValues.begin(), MVE = MultipleValues.end(); + MVI != MVE; ++MVI) { if (!Begin) { Begin = *MVI; continue; @@ -2375,7 +2380,8 @@ } /// getOrCreateDbgScope - Create DbgScope for the scope. -DbgScope *DwarfDebug::getOrCreateDbgScope(const MDNode *Scope, const MDNode *InlinedAt) { +DbgScope *DwarfDebug::getOrCreateDbgScope(const MDNode *Scope, + const MDNode *InlinedAt) { if (!InlinedAt) { DbgScope *WScope = DbgScopeMap.lookup(Scope); if (WScope) @@ -2548,7 +2554,8 @@ // current instruction scope does not match scope of first instruction // in this range then create a new instruction range. DbgRange R(RangeBeginMI, PrevMI); - MI2ScopeMap[RangeBeginMI] = getOrCreateDbgScope(PrevScope, PrevInlinedAt); + MI2ScopeMap[RangeBeginMI] = getOrCreateDbgScope(PrevScope, + PrevInlinedAt); MIRanges.push_back(R); } @@ -2771,7 +2778,7 @@ if (ProcessedSPNodes.count((*AI)->getScopeNode()) == 0) constructScopeDIE(*AI); } - + DIE *CurFnDIE = constructScopeDIE(CurrentFnDbgScope); if (!DisableFramePointerElim(*MF)) @@ -2852,7 +2859,8 @@ /// recordSourceLine - Register a source line with debug info. Returns the /// unique label that was emitted and which provides correspondence to /// the source line list. -MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, const MDNode *S) { +MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, + const MDNode *S) { StringRef Dir; StringRef Fn; @@ -3597,8 +3605,9 @@ unsigned char Size = Asm->getTargetData().getPointerSize(); Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", 0)); unsigned index = 1; - for (SmallVector::iterator I = DotDebugLocEntries.begin(), - E = DotDebugLocEntries.end(); I != E; ++I, ++index) { + for (SmallVector::iterator + I = DotDebugLocEntries.begin(), E = DotDebugLocEntries.end(); + I != E; ++I, ++index) { DotDebugLocEntry Entry = *I; if (Entry.isEmpty()) { Asm->OutStreamer.EmitIntValue(0, Size, /*addrspace*/0); From reid at kleckner.net Wed Jul 7 15:16:45 2010 From: reid at kleckner.net (Reid Kleckner) Date: Wed, 07 Jul 2010 20:16:45 -0000 Subject: [llvm-commits] [llvm] r107808 - /llvm/trunk/docs/DebuggingJITedCode.html Message-ID: <20100707201645.5B1872A6C12C@llvm.org> Author: rnk Date: Wed Jul 7 15:16:45 2010 New Revision: 107808 URL: http://llvm.org/viewvc/llvm-project?rev=107808&view=rev Log: Update the docs for debugging JITed code with GDB. Modified: llvm/trunk/docs/DebuggingJITedCode.html (contents, props changed) Modified: llvm/trunk/docs/DebuggingJITedCode.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DebuggingJITedCode.html?rev=107808&r1=107807&r2=107808&view=diff ============================================================================== --- llvm/trunk/docs/DebuggingJITedCode.html (original) +++ llvm/trunk/docs/DebuggingJITedCode.html Wed Jul 7 15:16:45 2010 @@ -9,87 +9,24 @@

    Debugging JITed Code With GDB
      -
    1. Introduction
    2. -
    3. Quickstart
    4. -
    5. Example with clang and lli
    6. +
    7. Example usage
    8. +
    9. Background
    Written by Reid Kleckner
    - +
    -

    Without special runtime support, debugging dynamically generated code with -GDB (as well as most debuggers) can be quite painful. Debuggers generally read -debug information from the object file of the code, but for JITed code, there is -no such file to look for. -

    - -

    Depending on the architecture, this can impact the debugging experience in -different ways. For example, on most 32-bit x86 architectures, you can simply -compile with -fno-omit-frame-pointer for GCC and -disable-fp-elim for LLVM. -When GDB creates a backtrace, it can properly unwind the stack, but the stack -frames owned by JITed code have ??'s instead of the appropriate symbol name. -However, on Linux x86_64 in particular, GDB relies on the DWARF CFA debug -information to unwind the stack, so even if you compile your program to leave -the frame pointer untouched, GDB will usually be unable to unwind the stack past -any JITed code stack frames. +

    In order to debug code JITed by LLVM, you need GDB 7.0 or newer, which is +available on most modern distributions of Linux. The version of GDB that Apple +ships with XCode has been frozen at 6.3 for a while. LLDB may be a better +option for debugging JITed code on Mac OS X.

    -

    In order to communicate the necessary debug info to GDB, an interface for -registering JITed code with debuggers has been designed and implemented for -GDB and LLVM. At a high level, whenever LLVM generates new machine code, it -also generates an object file in memory containing the debug information. LLVM -then adds the object file to the global list of object files and calls a special -function (__jit_debug_register_code) marked noinline that GDB knows about. When -GDB attaches to a process, it puts a breakpoint in this function and loads all -of the object files in the global list. When LLVM calls the registration -function, GDB catches the breakpoint signal, loads the new object file from -LLVM's memory, and resumes the execution. In this way, GDB can get the -necessary debug information. -

    - -

    At the time of this writing, LLVM only supports architectures that use ELF -object files and it only generates symbols and DWARF CFA information. However, -it would be easy to add more information to the object file, so we don't need to -coordinate with GDB to get better debug information. -

    -
    - - - - -
    - -

    In order to debug code JITed by LLVM, you need to install a recent version -of GDB. The interface was added on 2009-08-19, so you need a snapshot of GDB -more recent than that. Either download a snapshot of GDB or checkout CVS as -instructed here. Here -are the commands for doing a checkout and building the code: -

    - -
    -$ cvs -z 3 -d :pserver:anoncvs at sourceware.org:/cvs/src co gdb
    -$ mv src gdb   # You probably don't want this checkout called "src".
    -$ cd gdb
    -$ ./configure --prefix="$GDB_INSTALL"
    -$ make
    -$ make install
    -
    - -

    You can then use -jit-emit-debug in the LLVM command line arguments to enable -the interface. -

    -
    - - - - -
    - -

    For example, consider debugging running lli on the following C code in -foo.c: +

    Consider debugging the following code compiled with clang and run through +lli:

    @@ -119,7 +56,9 @@
     
     # Compile foo.c to bitcode.  You can use either clang or llvm-gcc with this
     # command line.  Both require -fexceptions, or the calls are all marked
    -# 'nounwind' which disables DWARF CFA info.
    +# 'nounwind' which disables DWARF exception handling info.  Custom frontends
    +# should avoid adding this attribute to JITed code, since it interferes with
    +# DWARF CFA generation at the moment.
     $ clang foo.c -fexceptions -emit-llvm -c -o foo.bc
     
     # Run foo.bc under lli with -jit-emit-debug.  If you built lli in debug mode,
    @@ -143,18 +82,60 @@
     #3  0x00007ffff7f5502a in main ()
     #4  0x00000000007c0225 in llvm::JIT::runFunction(llvm::Function*,
         std::vector<llvm::GenericValue,
    -    std::allocator<llvm::GenericValue> > const&) ()
    +    std::allocator<llvm::GenericValue> > const&) ()
     #5  0x00000000007d6d98 in
         llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*,
         std::vector<std::string,
    -    std::allocator<std::string> > const&, char const* const*) ()
    +    std::allocator<std::string> > const&, char const* const*) ()
     #6  0x00000000004dab76 in main ()
     
    -

    As you can see, GDB can correctly unwind the stack and has the appropriate function names.

    + + + + + +
    + +

    Without special runtime support, debugging dynamically generated code with +GDB (as well as most debuggers) can be quite painful. Debuggers generally read +debug information from the object file of the code, but for JITed code, there is +no such file to look for. +

    + +

    Depending on the architecture, this can impact the debugging experience in +different ways. For example, on most 32-bit x86 architectures, you can simply +compile with -fno-omit-frame-pointer for GCC and -disable-fp-elim for LLVM. +When GDB creates a backtrace, it can properly unwind the stack, but the stack +frames owned by JITed code have ??'s instead of the appropriate symbol name. +However, on Linux x86_64 in particular, GDB relies on the DWARF call frame +address (CFA) debug information to unwind the stack, so even if you compile +your program to leave the frame pointer untouched, GDB will usually be unable +to unwind the stack past any JITed code stack frames. +

    + +

    In order to communicate the necessary debug info to GDB, an interface for +registering JITed code with debuggers has been designed and implemented for +GDB and LLVM. At a high level, whenever LLVM generates new machine code, it +also generates an object file in memory containing the debug information. LLVM +then adds the object file to the global list of object files and calls a special +function (__jit_debug_register_code) marked noinline that GDB knows about. When +GDB attaches to a process, it puts a breakpoint in this function and loads all +of the object files in the global list. When LLVM calls the registration +function, GDB catches the breakpoint signal, loads the new object file from +LLVM's memory, and resumes the execution. In this way, GDB can get the +necessary debug information. +

    + +

    At the time of this writing, LLVM only supports architectures that use ELF +object files and it only generates symbols and DWARF CFA information. However, +it would be easy to add more information to the object file, so we don't need to +coordinate with GDB to get better debug information. +

    +

    @@ -165,7 +146,7 @@ src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> Reid Kleckner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-01-01 23:10:51 -0800 (Thu, 01 Jan 2009) $ + Last modified: $Date$ Propchange: llvm/trunk/docs/DebuggingJITedCode.html ------------------------------------------------------------------------------ svn:keywords = Date From stoklund at 2pi.dk Wed Jul 7 15:33:28 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 07 Jul 2010 20:33:28 -0000 Subject: [llvm-commits] [llvm] r107809 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/crash.ll Message-ID: <20100707203328.11FE82A6C12C@llvm.org> Author: stoklund Date: Wed Jul 7 15:33:27 2010 New Revision: 107809 URL: http://llvm.org/viewvc/llvm-project?rev=107809&view=rev Log: Allow copies between GR8_ABCD_L and GR8_ABCD_H. This fixes PR7540. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/test/CodeGen/X86/crash.ll Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=107809&r1=107808&r2=107809&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Jul 7 15:33:27 2010 @@ -1913,6 +1913,9 @@ else if (SrcRC->hasSuperClass(&X86::GR32RegClass) && DestRC->hasSuperClass(&X86::GR32RegClass)) CommonRC = &X86::GR32RegClass; + else if (SrcRC->hasSuperClass(&X86::GR8RegClass) && + DestRC->hasSuperClass(&X86::GR8RegClass)) + CommonRC = &X86::GR8RegClass; else CommonRC = 0; } Modified: llvm/trunk/test/CodeGen/X86/crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/crash.ll?rev=107809&r1=107808&r2=107809&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/crash.ll (original) +++ llvm/trunk/test/CodeGen/X86/crash.ll Wed Jul 7 15:33:27 2010 @@ -130,3 +130,14 @@ bb67: ret void } + +; Crash when trying to copy AH to AL. +; PR7540 +define void @copy8bitregs() nounwind { +entry: + %div.i = sdiv i32 115200, 0 + %shr8.i = lshr i32 %div.i, 8 + %conv4.i = trunc i32 %shr8.i to i8 + call void asm sideeffect "outb $0, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %conv4.i, i32 1017) nounwind + unreachable +} From dpatel at apple.com Wed Jul 7 15:49:57 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 07 Jul 2010 20:49:57 -0000 Subject: [llvm-commits] [llvm] r107810 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100707204957.D888E2A6C12C@llvm.org> Author: dpatel Date: Wed Jul 7 15:49:57 2010 New Revision: 107810 URL: http://llvm.org/viewvc/llvm-project?rev=107810&view=rev Log: Rename couple of maps. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=107810&r1=107809&r2=107810&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Jul 7 15:49:57 2010 @@ -80,15 +80,13 @@ /// IndexTyDie - An anonymous type for index type. Owned by CUDie. DIE *IndexTyDie; - /// GVToDieMap - Tracks the mapping of unit level debug informaton + /// MDNodeToDieMap - Tracks the mapping of unit level debug informaton /// variables to debug information entries. - /// FIXME : Rename GVToDieMap -> NodeToDieMap - DenseMap GVToDieMap; + DenseMap MDNodeToDieMap; - /// GVToDIEEntryMap - Tracks the mapping of unit level debug informaton + /// MDNodeToDIEEntryMap - Tracks the mapping of unit level debug informaton /// descriptors to debug information entries using a DIEEntry proxy. - /// FIXME : Rename - DenseMap GVToDIEEntryMap; + DenseMap MDNodeToDIEEntryMap; /// Globals - A map of globally visible named entities for this unit. /// @@ -124,25 +122,25 @@ /// getDIE - Returns the debug information entry map slot for the /// specified debug variable. - DIE *getDIE(const MDNode *N) { return GVToDieMap.lookup(N); } + DIE *getDIE(const MDNode *N) { return MDNodeToDieMap.lookup(N); } /// insertDIE - Insert DIE into the map. void insertDIE(const MDNode *N, DIE *D) { - GVToDieMap.insert(std::make_pair(N, D)); + MDNodeToDieMap.insert(std::make_pair(N, D)); } /// getDIEEntry - Returns the debug information entry for the speciefied /// debug variable. DIEEntry *getDIEEntry(const MDNode *N) { - DenseMap::iterator I = GVToDIEEntryMap.find(N); - if (I == GVToDIEEntryMap.end()) + DenseMap::iterator I = MDNodeToDIEEntryMap.find(N); + if (I == MDNodeToDIEEntryMap.end()) return NULL; return I->second; } /// insertDIEEntry - Insert debug information entry into the map. void insertDIEEntry(const MDNode *N, DIEEntry *E) { - GVToDIEEntryMap.insert(std::make_pair(N, E)); + MDNodeToDIEEntryMap.insert(std::make_pair(N, E)); } /// addDie - Adds or interns the DIE to the compile unit. From grosbach at apple.com Wed Jul 7 16:06:51 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 07 Jul 2010 21:06:51 -0000 Subject: [llvm-commits] [llvm] r107811 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <20100707210651.43C442A6C12C@llvm.org> Author: grosbach Date: Wed Jul 7 16:06:51 2010 New Revision: 107811 URL: http://llvm.org/viewvc/llvm-project?rev=107811&view=rev Log: grammar and trailing whitespace Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=107811&r1=107810&r2=107811&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jul 7 16:06:51 2010 @@ -337,7 +337,7 @@ if (CPChange && ++NoCPIters > 30) llvm_unreachable("Constant Island pass failed to converge!"); DEBUG(dumpBBs()); - + // Clear NewWaterList now. If we split a block for branches, it should // appear as "new water" for the next iteration of constant pool placement. NewWaterList.clear(); @@ -361,8 +361,8 @@ // After a while, this might be made debug-only, but it is not expensive. verify(MF); - // If LR has been forced spilled and no far jumps (i.e. BL) has been issued. - // Undo the spill / restore of LR if possible. + // If LR has been forced spilled and no far jump (i.e. BL) has been issued, + // undo the spill / restore of LR if possible. if (isThumb && !HasFarJump && AFI->isLRSpilledForFarJump()) MadeChange |= UndoLRSpillRestore(); @@ -1624,7 +1624,7 @@ // constantpool tables? MachineJumpTableInfo *MJTI = MF.getJumpTableInfo(); if (MJTI == 0) return false; - + const std::vector &JT = MJTI->getJumpTables(); for (unsigned i = 0, e = T2JumpTables.size(); i != e; ++i) { MachineInstr *MI = T2JumpTables[i]; @@ -1667,7 +1667,7 @@ MachineInstr *AddrMI = --PrevI; bool OptOk = true; - // Examine the instruction that calculate the jumptable entry address. + // Examine the instruction that calculates the jumptable entry address. // If it's not the one just before the t2BR_JT, we won't delete it, then // it's not worth doing the optimization. for (unsigned k = 0, eee = AddrMI->getNumOperands(); k != eee; ++k) { @@ -1732,7 +1732,7 @@ MachineJumpTableInfo *MJTI = MF.getJumpTableInfo(); if (MJTI == 0) return false; - + const std::vector &JT = MJTI->getJumpTables(); for (unsigned i = 0, e = T2JumpTables.size(); i != e; ++i) { MachineInstr *MI = T2JumpTables[i]; From gohman at apple.com Wed Jul 7 16:18:22 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 21:18:22 -0000 Subject: [llvm-commits] [llvm] r107813 - /llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Message-ID: <20100707211822.A72652A6C12C@llvm.org> Author: djg Date: Wed Jul 7 16:18:22 2010 New Revision: 107813 URL: http://llvm.org/viewvc/llvm-project?rev=107813&view=rev Log: Not all custom inserters create new basic blocks. If the inserter didn't create a new block, don't reset the insert position. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107813&r1=107812&r2=107813&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Jul 7 16:18:22 2010 @@ -732,8 +732,11 @@ if (II.usesCustomInsertionHook()) { // Insert this instruction into the basic block using a target // specific inserter which may returns a new basic block. - MBB = TLI->EmitInstrWithCustomInserter(MI, MBB); - InsertPos = MBB->end(); + MachineBasicBlock *NewMBB = TLI->EmitInstrWithCustomInserter(MI, MBB); + if (NewMBB != MBB) { + MBB = NewMBB; + InsertPos = NewMBB->end(); + } return; } From dpatel at apple.com Wed Jul 7 16:52:21 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 07 Jul 2010 21:52:21 -0000 Subject: [llvm-commits] [llvm] r107818 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Message-ID: <20100707215221.998962A6C12C@llvm.org> Author: dpatel Date: Wed Jul 7 16:52:21 2010 New Revision: 107818 URL: http://llvm.org/viewvc/llvm-project?rev=107818&view=rev Log: Print undefined/unknown debug value as "undef". Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=107818&r1=107817&r2=107818&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Wed Jul 7 16:52:21 2010 @@ -505,7 +505,12 @@ O << V.getName(); O << " <- "; // Frame address. Currently handles register +- offset only. - O << '['; printOperand(MI, 0, O); O << '+'; printOperand(MI, 3, O); + O << '['; + if (MI->getOperand(0).isReg() && MI->getOperand(0).getReg()) + printOperand(MI, 0, O); + else + O << "undef"; + O << '+'; printOperand(MI, 3, O); O << ']'; O << "+"; printOperand(MI, NOps-2, O); From wdietz2 at illinois.edu Wed Jul 7 17:14:06 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Wed, 07 Jul 2010 22:14:06 -0000 Subject: [llvm-commits] [poolalloc] r107819 - in /poolalloc/trunk/test/dsa/regression: ./ 2010-07-07.UndefArg.ll dg.exp Message-ID: <20100707221406.9BBC22A6C12C@llvm.org> Author: wdietz2 Date: Wed Jul 7 17:14:06 2010 New Revision: 107819 URL: http://llvm.org/viewvc/llvm-project?rev=107819&view=rev Log: Added testcase for handling an undef argument. Added new regression test folder. Added: poolalloc/trunk/test/dsa/regression/ poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll poolalloc/trunk/test/dsa/regression/dg.exp Added: poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll?rev=107819&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll (added) +++ poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll Wed Jul 7 17:14:06 2010 @@ -0,0 +1,76 @@ +;RUN: dsaopt %s -ds-aa -gvn +; FIXME: Make this test more directly test the underlying issue. +; (the -ds-aa and -gvn are just ways of forcing the right query to be made) + +;(Reduced from Stanford/Treesort) +; ModuleID = 'bugpoint-reduced-simplified.bc' +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-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%struct.node = type { %struct.node*, %struct.node*, i32 } + + at sortlist = external global [5001 x i32], align 32 ; <[5001 x i32]*> [#uses=1] + +define fastcc i32 @Checktree(%struct.node* nocapture %p) nounwind readonly { +entry: + ret i32 1 +} + +define i32 @main() nounwind { +bb.nph: + br label %bb + +bb: ; preds = %Trees.exit, %bb.nph + br label %bb.i.i + +bb.i.i: ; preds = %bb.i.i, %bb + br i1 undef, label %bb.nph.i, label %bb.i.i + +bb.nph.i: ; preds = %bb.i.i + br label %bb.i + +bb.i: ; preds = %bb1.i.i, %bb.nph.i + %scevgep.i = getelementptr [5001 x i32]* @sortlist, i64 0, i64 0 ; [#uses=1] + %0 = load i32* %scevgep.i, align 4 ; [#uses=0] + br label %bb.i1.i + +bb.i1.i: ; preds = %bb.i1.i, %bb.i + br i1 undef, label %bb1.i.i, label %bb.i1.i + +bb1.i.i: ; preds = %bb.i1.i + br i1 undef, label %bb2.i, label %bb.i + +bb2.i: ; preds = %bb1.i.i + br i1 undef, label %bb7.i.i, label %bb.i4.i + +bb.i4.i: ; preds = %bb2.i + br i1 undef, label %bb2.i5.i, label %bb7.i.i + +bb2.i5.i: ; preds = %bb.i4.i + br i1 undef, label %Checktree.exit, label %bb8.i + +bb8.i: ; preds = %bb2.i5.i + br i1 undef, label %bb10.i, label %bb5.i6.i + +bb10.i: ; preds = %bb8.i + %1 = tail call fastcc i32 @Checktree(%struct.node* undef) nounwind ; [#uses=0] + br label %Checktree.exit + +Checktree.exit: ; preds = %bb10.i, %bb2.i5.i + br i1 undef, label %bb5.i6.i, label %bb7.i.i + +bb5.i6.i: ; preds = %Checktree.exit, %bb8.i + br label %bb7.i.i + +bb7.i.i: ; preds = %bb5.i6.i, %Checktree.exit, %bb.i4.i, %bb2.i + br i1 undef, label %bb3.i, label %Trees.exit + +bb3.i: ; preds = %bb7.i.i + unreachable + +Trees.exit: ; preds = %bb7.i.i + br i1 undef, label %bb2, label %bb + +bb2: ; preds = %Trees.exit + ret i32 0 +} Added: poolalloc/trunk/test/dsa/regression/dg.exp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/dg.exp?rev=107819&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/regression/dg.exp (added) +++ poolalloc/trunk/test/dsa/regression/dg.exp Wed Jul 7 17:14:06 2010 @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] From evan.cheng at apple.com Wed Jul 7 17:15:37 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 07 Jul 2010 22:15:37 -0000 Subject: [llvm-commits] [llvm] r107820 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/Alpha/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <20100707221538.41C0E2A6C12C@llvm.org> Author: evancheng Date: Wed Jul 7 17:15:37 2010 New Revision: 107820 URL: http://llvm.org/viewvc/llvm-project?rev=107820&view=rev Log: Move getExtLoad() and (some) getLoad() DebugLoc argument after EVT argument for consistency sake. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Jul 7 17:15:37 2010 @@ -632,18 +632,20 @@ SDValue getLoad(EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, bool isVolatile, bool isNonTemporal, unsigned Alignment); - SDValue getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, + SDValue getExtLoad(ISD::LoadExtType ExtType, EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, EVT MemVT, bool isVolatile, bool isNonTemporal, unsigned Alignment); SDValue getIndexedLoad(SDValue OrigLoad, DebugLoc dl, SDValue Base, - SDValue Offset, ISD::MemIndexedMode AM); - SDValue getLoad(ISD::MemIndexedMode AM, DebugLoc dl, ISD::LoadExtType ExtType, - EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, + SDValue Offset, ISD::MemIndexedMode AM); + SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, + EVT VT, DebugLoc dl, + SDValue Chain, SDValue Ptr, SDValue Offset, const Value *SV, int SVOffset, EVT MemVT, bool isVolatile, bool isNonTemporal, unsigned Alignment); - SDValue getLoad(ISD::MemIndexedMode AM, DebugLoc dl, ISD::LoadExtType ExtType, - EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, + SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, + EVT VT, DebugLoc dl, + SDValue Chain, SDValue Ptr, SDValue Offset, EVT MemVT, MachineMemOperand *MMO); /// getStore - Helper function to build ISD::STORE nodes. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jul 7 17:15:37 2010 @@ -669,7 +669,7 @@ ? (TLI.isLoadExtLegal(ISD::ZEXTLOAD, MemVT) ? ISD::ZEXTLOAD : ISD::EXTLOAD) : LD->getExtensionType(); Replace = true; - return DAG.getExtLoad(ExtType, dl, PVT, + return DAG.getExtLoad(ExtType, PVT, dl, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), LD->getSrcValueOffset(), MemVT, LD->isVolatile(), @@ -891,7 +891,7 @@ ISD::LoadExtType ExtType = ISD::isNON_EXTLoad(LD) ? (TLI.isLoadExtLegal(ISD::ZEXTLOAD, MemVT) ? ISD::ZEXTLOAD : ISD::EXTLOAD) : LD->getExtensionType(); - SDValue NewLD = DAG.getExtLoad(ExtType, dl, PVT, + SDValue NewLD = DAG.getExtLoad(ExtType, PVT, dl, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), LD->getSrcValueOffset(), MemVT, LD->isVolatile(), @@ -2198,7 +2198,7 @@ BitWidth - MemVT.getScalarType().getSizeInBits())) && ((!LegalOperations && !LN0->isVolatile()) || TLI.isLoadExtLegal(ISD::ZEXTLOAD, MemVT))) { - SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, N0.getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), MemVT, @@ -2221,7 +2221,7 @@ BitWidth - MemVT.getScalarType().getSizeInBits())) && ((!LegalOperations && !LN0->isVolatile()) || TLI.isLoadExtLegal(ISD::ZEXTLOAD, MemVT))) { - SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, N0.getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), MemVT, @@ -2255,7 +2255,7 @@ EVT LoadResultTy = HasAnyExt ? LN0->getValueType(0) : VT; SDValue NewLoad = - DAG.getExtLoad(ISD::ZEXTLOAD, LN0->getDebugLoc(), LoadResultTy, + DAG.getExtLoad(ISD::ZEXTLOAD, LoadResultTy, LN0->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), ExtVT, LN0->isVolatile(), LN0->isNonTemporal(), @@ -2291,7 +2291,7 @@ EVT LoadResultTy = HasAnyExt ? LN0->getValueType(0) : VT; SDValue Load = - DAG.getExtLoad(ISD::ZEXTLOAD, LN0->getDebugLoc(), LoadResultTy, + DAG.getExtLoad(ISD::ZEXTLOAD, LoadResultTy, LN0->getDebugLoc(), LN0->getChain(), NewPtr, LN0->getSrcValue(), LN0->getSrcValueOffset(), ExtVT, LN0->isVolatile(), LN0->isNonTemporal(), @@ -3503,7 +3503,7 @@ DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::SIGN_EXTEND, SetCCs, TLI); if (DoXform) { LoadSDNode *LN0 = cast(N0); - SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), @@ -3547,7 +3547,7 @@ EVT MemVT = LN0->getMemoryVT(); if ((!LegalOperations && !LN0->isVolatile()) || TLI.isLoadExtLegal(ISD::SEXTLOAD, MemVT)) { - SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), MemVT, @@ -3692,7 +3692,7 @@ DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::ZERO_EXTEND, SetCCs, TLI); if (DoXform) { LoadSDNode *LN0 = cast(N0); - SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), @@ -3736,7 +3736,7 @@ EVT MemVT = LN0->getMemoryVT(); if ((!LegalOperations && !LN0->isVolatile()) || TLI.isLoadExtLegal(ISD::ZEXTLOAD, MemVT)) { - SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), MemVT, @@ -3894,7 +3894,7 @@ DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::ANY_EXTEND, SetCCs, TLI); if (DoXform) { LoadSDNode *LN0 = cast(N0); - SDValue ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), @@ -3938,8 +3938,9 @@ N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); EVT MemVT = LN0->getMemoryVT(); - SDValue ExtLoad = DAG.getExtLoad(LN0->getExtensionType(), N->getDebugLoc(), - VT, LN0->getChain(), LN0->getBasePtr(), + SDValue ExtLoad = DAG.getExtLoad(LN0->getExtensionType(), VT, + N->getDebugLoc(), + LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), MemVT, LN0->isVolatile(), LN0->isNonTemporal(), @@ -4108,7 +4109,7 @@ ? DAG.getLoad(VT, N0.getDebugLoc(), LN0->getChain(), NewPtr, LN0->getSrcValue(), LN0->getSrcValueOffset() + PtrOff, LN0->isVolatile(), LN0->isNonTemporal(), NewAlign) - : DAG.getExtLoad(ExtType, N0.getDebugLoc(), VT, LN0->getChain(), NewPtr, + : DAG.getExtLoad(ExtType, VT, N0.getDebugLoc(), LN0->getChain(), NewPtr, LN0->getSrcValue(), LN0->getSrcValueOffset() + PtrOff, ExtVT, LN0->isVolatile(), LN0->isNonTemporal(), NewAlign); @@ -4195,7 +4196,7 @@ ((!LegalOperations && !cast(N0)->isVolatile()) || TLI.isLoadExtLegal(ISD::SEXTLOAD, EVT))) { LoadSDNode *LN0 = cast(N0); - SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, @@ -4212,7 +4213,7 @@ ((!LegalOperations && !cast(N0)->isVolatile()) || TLI.isLoadExtLegal(ISD::SEXTLOAD, EVT))) { LoadSDNode *LN0 = cast(N0); - SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, @@ -4975,7 +4976,7 @@ ((!LegalOperations && !cast(N0)->isVolatile()) || TLI.isLoadExtLegal(ISD::EXTLOAD, N0.getValueType()))) { LoadSDNode *LN0 = cast(N0); - SDValue ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, N->getDebugLoc(), VT, + SDValue ExtLoad = DAG.getExtLoad(ISD::EXTLOAD, VT, N->getDebugLoc(), LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), @@ -5559,8 +5560,8 @@ if (OptLevel != CodeGenOpt::None && LD->isUnindexed()) { if (unsigned Align = DAG.InferPtrAlignment(Ptr)) { if (Align > LD->getAlignment()) - return DAG.getExtLoad(LD->getExtensionType(), N->getDebugLoc(), - LD->getValueType(0), + return DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0), + N->getDebugLoc(), Chain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), LD->getMemoryVT(), LD->isVolatile(), LD->isNonTemporal(), Align); @@ -5583,8 +5584,8 @@ LD->isVolatile(), LD->isNonTemporal(), LD->getAlignment()); } else { - ReplLoad = DAG.getExtLoad(LD->getExtensionType(), LD->getDebugLoc(), - LD->getValueType(0), + ReplLoad = DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0), + LD->getDebugLoc(), BetterChain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), LD->getMemoryVT(), @@ -6649,8 +6650,8 @@ LLD->getAlignment()); } else { Load = DAG.getExtLoad(LLD->getExtensionType(), - TheSelect->getDebugLoc(), TheSelect->getValueType(0), + TheSelect->getDebugLoc(), LLD->getChain(), Addr, 0, 0, LLD->getMemoryVT(), LLD->isVolatile(), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Jul 7 17:15:37 2010 @@ -378,8 +378,8 @@ SDValue CPIdx = DAG.getConstantPool(LLVMC, TLI.getPointerTy()); unsigned Alignment = cast(CPIdx)->getAlignment(); if (Extend) - return DAG.getExtLoad(ISD::EXTLOAD, dl, - OrigVT, DAG.getEntryNode(), + return DAG.getExtLoad(ISD::EXTLOAD, OrigVT, dl, + DAG.getEntryNode(), CPIdx, PseudoSourceValue::getConstantPool(), 0, VT, false, false, Alignment); return DAG.getLoad(OrigVT, dl, DAG.getEntryNode(), CPIdx, @@ -456,7 +456,7 @@ 8 * (StoredBytes - Offset)); // Load from the stack slot. - SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, RegVT, Store, StackPtr, + SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, RegVT, dl, Store, StackPtr, NULL, 0, MemVT, false, false, 0); Stores.push_back(DAG.getTruncStore(Load.getValue(1), dl, Load, Ptr, @@ -558,7 +558,7 @@ // The last copy may be partial. Do an extending load. EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), 8 * (LoadedBytes - Offset)); - SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, RegVT, Chain, Ptr, + SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, RegVT, dl, Chain, Ptr, LD->getSrcValue(), SVOffset + Offset, MemVT, LD->isVolatile(), LD->isNonTemporal(), @@ -574,7 +574,7 @@ Stores.size()); // Finally, perform the original load only redirected to the stack slot. - Load = DAG.getExtLoad(LD->getExtensionType(), dl, VT, TF, StackBase, + Load = DAG.getExtLoad(LD->getExtensionType(), VT, dl, TF, StackBase, NULL, 0, LoadedVT, false, false, 0); // Callers expect a MERGE_VALUES node. @@ -603,21 +603,21 @@ // Load the value in two parts SDValue Lo, Hi; if (TLI.isLittleEndian()) { - Lo = DAG.getExtLoad(ISD::ZEXTLOAD, dl, VT, Chain, Ptr, LD->getSrcValue(), + Lo = DAG.getExtLoad(ISD::ZEXTLOAD, VT, dl, Chain, Ptr, LD->getSrcValue(), SVOffset, NewLoadedVT, LD->isVolatile(), LD->isNonTemporal(), Alignment); Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getConstant(IncrementSize, TLI.getPointerTy())); - Hi = DAG.getExtLoad(HiExtType, dl, VT, Chain, Ptr, LD->getSrcValue(), + Hi = DAG.getExtLoad(HiExtType, VT, dl, Chain, Ptr, LD->getSrcValue(), SVOffset + IncrementSize, NewLoadedVT, LD->isVolatile(), LD->isNonTemporal(), MinAlign(Alignment,IncrementSize)); } else { - Hi = DAG.getExtLoad(HiExtType, dl, VT, Chain, Ptr, LD->getSrcValue(), + Hi = DAG.getExtLoad(HiExtType, VT, dl, Chain, Ptr, LD->getSrcValue(), SVOffset, NewLoadedVT, LD->isVolatile(), LD->isNonTemporal(), Alignment); Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getConstant(IncrementSize, TLI.getPointerTy())); - Lo = DAG.getExtLoad(ISD::ZEXTLOAD, dl, VT, Chain, Ptr, LD->getSrcValue(), + Lo = DAG.getExtLoad(ISD::ZEXTLOAD, VT, dl, Chain, Ptr, LD->getSrcValue(), SVOffset + IncrementSize, NewLoadedVT, LD->isVolatile(), LD->isNonTemporal(), MinAlign(Alignment,IncrementSize)); } @@ -1181,7 +1181,7 @@ ISD::LoadExtType NewExtType = ExtType == ISD::ZEXTLOAD ? ISD::ZEXTLOAD : ISD::EXTLOAD; - Result = DAG.getExtLoad(NewExtType, dl, Node->getValueType(0), + Result = DAG.getExtLoad(NewExtType, Node->getValueType(0), dl, Tmp1, Tmp2, LD->getSrcValue(), SVOffset, NVT, isVolatile, isNonTemporal, Alignment); @@ -1217,8 +1217,8 @@ if (TLI.isLittleEndian()) { // EXTLOAD:i24 -> ZEXTLOAD:i16 | (shl EXTLOAD at +2:i8, 16) // Load the bottom RoundWidth bits. - Lo = DAG.getExtLoad(ISD::ZEXTLOAD, dl, - Node->getValueType(0), Tmp1, Tmp2, + Lo = DAG.getExtLoad(ISD::ZEXTLOAD, Node->getValueType(0), dl, + Tmp1, Tmp2, LD->getSrcValue(), SVOffset, RoundVT, isVolatile, isNonTemporal, Alignment); @@ -1226,7 +1226,7 @@ IncrementSize = RoundWidth / 8; Tmp2 = DAG.getNode(ISD::ADD, dl, Tmp2.getValueType(), Tmp2, DAG.getIntPtrConstant(IncrementSize)); - Hi = DAG.getExtLoad(ExtType, dl, Node->getValueType(0), Tmp1, Tmp2, + Hi = DAG.getExtLoad(ExtType, Node->getValueType(0), dl, Tmp1, Tmp2, LD->getSrcValue(), SVOffset + IncrementSize, ExtraVT, isVolatile, isNonTemporal, MinAlign(Alignment, IncrementSize)); @@ -1246,7 +1246,7 @@ // Big endian - avoid unaligned loads. // EXTLOAD:i24 -> (shl EXTLOAD:i16, 8) | ZEXTLOAD at +2:i8 // Load the top RoundWidth bits. - Hi = DAG.getExtLoad(ExtType, dl, Node->getValueType(0), Tmp1, Tmp2, + Hi = DAG.getExtLoad(ExtType, Node->getValueType(0), dl, Tmp1, Tmp2, LD->getSrcValue(), SVOffset, RoundVT, isVolatile, isNonTemporal, Alignment); @@ -1254,8 +1254,8 @@ IncrementSize = RoundWidth / 8; Tmp2 = DAG.getNode(ISD::ADD, dl, Tmp2.getValueType(), Tmp2, DAG.getIntPtrConstant(IncrementSize)); - Lo = DAG.getExtLoad(ISD::ZEXTLOAD, dl, - Node->getValueType(0), Tmp1, Tmp2, + Lo = DAG.getExtLoad(ISD::ZEXTLOAD, + Node->getValueType(0), dl, Tmp1, Tmp2, LD->getSrcValue(), SVOffset + IncrementSize, ExtraVT, isVolatile, isNonTemporal, MinAlign(Alignment, IncrementSize)); @@ -1333,7 +1333,7 @@ "EXTLOAD should always be supported!"); // Turn the unsupported load into an EXTLOAD followed by an explicit // zero/sign extend inreg. - Result = DAG.getExtLoad(ISD::EXTLOAD, dl, Node->getValueType(0), + Result = DAG.getExtLoad(ISD::EXTLOAD, Node->getValueType(0), dl, Tmp1, Tmp2, LD->getSrcValue(), LD->getSrcValueOffset(), SrcVT, LD->isVolatile(), LD->isNonTemporal(), @@ -1555,7 +1555,7 @@ return DAG.getLoad(Op.getValueType(), dl, Ch, StackPtr, NULL, 0, false, false, 0); else - return DAG.getExtLoad(ISD::EXTLOAD, dl, Op.getValueType(), Ch, StackPtr, + return DAG.getExtLoad(ISD::EXTLOAD, Op.getValueType(), dl, Ch, StackPtr, NULL, 0, Vec.getValueType().getVectorElementType(), false, false, 0); } @@ -1787,7 +1787,7 @@ DestAlign); assert(SlotSize < DestSize && "Unknown extension!"); - return DAG.getExtLoad(ISD::EXTLOAD, dl, DestVT, Store, FIPtr, SV, 0, SlotVT, + return DAG.getExtLoad(ISD::EXTLOAD, DestVT, dl, Store, FIPtr, SV, 0, SlotVT, false, false, DestAlign); } @@ -2185,7 +2185,7 @@ false, false, Alignment); else { FudgeInReg = - LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, dl, DestVT, + LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT, dl, DAG.getEntryNode(), CPIdx, PseudoSourceValue::getConstantPool(), 0, MVT::f32, false, false, Alignment)); @@ -3155,7 +3155,7 @@ SDValue Addr = DAG.getNode(ISD::ADD, dl, PTy, Index, Table); EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), EntrySize * 8); - SDValue LD = DAG.getExtLoad(ISD::SEXTLOAD, dl, PTy, Chain, Addr, + SDValue LD = DAG.getExtLoad(ISD::SEXTLOAD, PTy, dl, Chain, Addr, PseudoSourceValue::getJumpTable(), 0, MemVT, false, false, 0); Addr = LD; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Wed Jul 7 17:15:37 2010 @@ -453,8 +453,8 @@ SDValue NewL; if (L->getExtensionType() == ISD::NON_EXTLOAD) { - NewL = DAG.getLoad(L->getAddressingMode(), dl, L->getExtensionType(), - NVT, L->getChain(), L->getBasePtr(), L->getOffset(), + NewL = DAG.getLoad(L->getAddressingMode(), L->getExtensionType(), + NVT, dl, L->getChain(), L->getBasePtr(), L->getOffset(), L->getSrcValue(), L->getSrcValueOffset(), NVT, L->isVolatile(), L->isNonTemporal(), L->getAlignment()); // Legalized the chain result - switch anything that used the old chain to @@ -464,8 +464,8 @@ } // Do a non-extending load followed by FP_EXTEND. - NewL = DAG.getLoad(L->getAddressingMode(), dl, ISD::NON_EXTLOAD, - L->getMemoryVT(), L->getChain(), + NewL = DAG.getLoad(L->getAddressingMode(), ISD::NON_EXTLOAD, + L->getMemoryVT(), dl, L->getChain(), L->getBasePtr(), L->getOffset(), L->getSrcValue(), L->getSrcValueOffset(), L->getMemoryVT(), L->isVolatile(), @@ -1109,7 +1109,7 @@ assert(NVT.isByteSized() && "Expanded type not byte sized!"); assert(LD->getMemoryVT().bitsLE(NVT) && "Float type not round?"); - Hi = DAG.getExtLoad(LD->getExtensionType(), dl, NVT, Chain, Ptr, + Hi = DAG.getExtLoad(LD->getExtensionType(), NVT, dl, Chain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), LD->getMemoryVT(), LD->isVolatile(), LD->isNonTemporal(), LD->getAlignment()); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Jul 7 17:15:37 2010 @@ -369,7 +369,7 @@ ISD::LoadExtType ExtType = ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType(); DebugLoc dl = N->getDebugLoc(); - SDValue Res = DAG.getExtLoad(ExtType, dl, NVT, N->getChain(), N->getBasePtr(), + SDValue Res = DAG.getExtLoad(ExtType, NVT, dl, N->getChain(), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), N->getMemoryVT(), N->isVolatile(), N->isNonTemporal(), N->getAlignment()); @@ -1532,7 +1532,7 @@ if (N->getMemoryVT().bitsLE(NVT)) { EVT MemVT = N->getMemoryVT(); - Lo = DAG.getExtLoad(ExtType, dl, NVT, Ch, Ptr, N->getSrcValue(), SVOffset, + Lo = DAG.getExtLoad(ExtType, NVT, dl, Ch, Ptr, N->getSrcValue(), SVOffset, MemVT, isVolatile, isNonTemporal, Alignment); // Remember the chain. @@ -1565,7 +1565,7 @@ unsigned IncrementSize = NVT.getSizeInBits()/8; Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getIntPtrConstant(IncrementSize)); - Hi = DAG.getExtLoad(ExtType, dl, NVT, Ch, Ptr, N->getSrcValue(), + Hi = DAG.getExtLoad(ExtType, NVT, dl, Ch, Ptr, N->getSrcValue(), SVOffset+IncrementSize, NEVT, isVolatile, isNonTemporal, MinAlign(Alignment, IncrementSize)); @@ -1583,7 +1583,7 @@ unsigned ExcessBits = (EBytes - IncrementSize)*8; // Load both the high bits and maybe some of the low bits. - Hi = DAG.getExtLoad(ExtType, dl, NVT, Ch, Ptr, N->getSrcValue(), SVOffset, + Hi = DAG.getExtLoad(ExtType, NVT, dl, Ch, Ptr, N->getSrcValue(), SVOffset, EVT::getIntegerVT(*DAG.getContext(), MemVT.getSizeInBits() - ExcessBits), isVolatile, isNonTemporal, Alignment); @@ -1592,7 +1592,7 @@ Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getIntPtrConstant(IncrementSize)); // Load the rest of the low bits. - Lo = DAG.getExtLoad(ISD::ZEXTLOAD, dl, NVT, Ch, Ptr, N->getSrcValue(), + Lo = DAG.getExtLoad(ISD::ZEXTLOAD, NVT, dl, Ch, Ptr, N->getSrcValue(), SVOffset+IncrementSize, EVT::getIntegerVT(*DAG.getContext(), ExcessBits), isVolatile, isNonTemporal, @@ -2455,7 +2455,7 @@ // Load the value out, extending it from f32 to the destination float type. // FIXME: Avoid the extend by constructing the right constant pool? - SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, dl, DstVT, DAG.getEntryNode(), + SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, DstVT, dl, DAG.getEntryNode(), FudgePtr, NULL, 0, MVT::f32, false, false, Alignment); return DAG.getNode(ISD::FADD, dl, DstVT, SignedConv, Fudge); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Wed Jul 7 17:15:37 2010 @@ -165,9 +165,10 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) { assert(N->isUnindexed() && "Indexed vector load?"); - SDValue Result = DAG.getLoad(ISD::UNINDEXED, N->getDebugLoc(), + SDValue Result = DAG.getLoad(ISD::UNINDEXED, N->getExtensionType(), N->getValueType(0).getVectorElementType(), + N->getDebugLoc(), N->getChain(), N->getBasePtr(), DAG.getUNDEF(N->getBasePtr().getValueType()), N->getSrcValue(), N->getSrcValueOffset(), @@ -760,14 +761,14 @@ EVT LoMemVT, HiMemVT; GetSplitDestVTs(MemoryVT, LoMemVT, HiMemVT); - Lo = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, LoVT, Ch, Ptr, Offset, + Lo = DAG.getLoad(ISD::UNINDEXED, ExtType, LoVT, dl, Ch, Ptr, Offset, SV, SVOffset, LoMemVT, isVolatile, isNonTemporal, Alignment); unsigned IncrementSize = LoMemVT.getSizeInBits()/8; Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getIntPtrConstant(IncrementSize)); SVOffset += IncrementSize; - Hi = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, HiVT, Ch, Ptr, Offset, + Hi = DAG.getLoad(ISD::UNINDEXED, ExtType, HiVT, dl, Ch, Ptr, Offset, SV, SVOffset, HiMemVT, isVolatile, isNonTemporal, Alignment); // Build a factor node to remember that this load is independent of the @@ -1105,7 +1106,7 @@ // Load back the required element. StackPtr = GetVectorElementPointer(StackPtr, EltVT, Idx); - return DAG.getExtLoad(ISD::EXTLOAD, dl, N->getValueType(0), Store, StackPtr, + return DAG.getExtLoad(ISD::EXTLOAD, N->getValueType(0), dl, Store, StackPtr, SV, 0, EltVT, false, false, 0); } @@ -2351,14 +2352,14 @@ unsigned WidenNumElts = WidenVT.getVectorNumElements(); SmallVector Ops(WidenNumElts); unsigned Increment = LdEltVT.getSizeInBits() / 8; - Ops[0] = DAG.getExtLoad(ExtType, dl, EltVT, Chain, BasePtr, SV, SVOffset, + Ops[0] = DAG.getExtLoad(ExtType, EltVT, dl, Chain, BasePtr, SV, SVOffset, LdEltVT, isVolatile, isNonTemporal, Align); LdChain.push_back(Ops[0].getValue(1)); unsigned i = 0, Offset = Increment; for (i=1; i < NumElts; ++i, Offset += Increment) { SDValue NewBasePtr = DAG.getNode(ISD::ADD, dl, BasePtr.getValueType(), BasePtr, DAG.getIntPtrConstant(Offset)); - Ops[i] = DAG.getExtLoad(ExtType, dl, EltVT, Chain, NewBasePtr, SV, + Ops[i] = DAG.getExtLoad(ExtType, EltVT, dl, Chain, NewBasePtr, SV, SVOffset + Offset, LdEltVT, isVolatile, isNonTemporal, Align); LdChain.push_back(Ops[i].getValue(1)); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Jul 7 17:15:37 2010 @@ -3370,7 +3370,7 @@ // FIXME does the case above also need this? EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT); assert(NVT.bitsGE(VT)); - Value = DAG.getExtLoad(ISD::EXTLOAD, dl, NVT, Chain, + Value = DAG.getExtLoad(ISD::EXTLOAD, NVT, dl, Chain, getMemBasePlusOffset(Src, SrcOff, DAG), SrcSV, SrcSVOff + SrcOff, VT, isVol, false, MinAlign(SrcAlign, SrcOff)); @@ -3895,8 +3895,8 @@ } SDValue -SelectionDAG::getLoad(ISD::MemIndexedMode AM, DebugLoc dl, - ISD::LoadExtType ExtType, EVT VT, SDValue Chain, +SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, + EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, SDValue Offset, const Value *SV, int SVOffset, EVT MemVT, bool isVolatile, bool isNonTemporal, @@ -3919,12 +3919,12 @@ MachineMemOperand *MMO = MF.getMachineMemOperand(SV, Flags, SVOffset, MemVT.getStoreSize(), Alignment); - return getLoad(AM, dl, ExtType, VT, Chain, Ptr, Offset, MemVT, MMO); + return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO); } SDValue -SelectionDAG::getLoad(ISD::MemIndexedMode AM, DebugLoc dl, - ISD::LoadExtType ExtType, EVT VT, SDValue Chain, +SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, + EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, SDValue Offset, EVT MemVT, MachineMemOperand *MMO) { if (VT == MemVT) { @@ -3974,18 +3974,18 @@ bool isVolatile, bool isNonTemporal, unsigned Alignment) { SDValue Undef = getUNDEF(Ptr.getValueType()); - return getLoad(ISD::UNINDEXED, dl, ISD::NON_EXTLOAD, VT, Chain, Ptr, Undef, + return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, SV, SVOffset, VT, isVolatile, isNonTemporal, Alignment); } -SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, +SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, EVT MemVT, bool isVolatile, bool isNonTemporal, unsigned Alignment) { SDValue Undef = getUNDEF(Ptr.getValueType()); - return getLoad(ISD::UNINDEXED, dl, ExtType, VT, Chain, Ptr, Undef, + return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, SV, SVOffset, MemVT, isVolatile, isNonTemporal, Alignment); } @@ -3995,7 +3995,7 @@ LoadSDNode *LD = cast(OrigLoad); assert(LD->getOffset().getOpcode() == ISD::UNDEF && "Load is already a indexed load!"); - return getLoad(AM, dl, LD->getExtensionType(), OrigLoad.getValueType(), + return getLoad(AM, LD->getExtensionType(), OrigLoad.getValueType(), dl, LD->getChain(), Base, Offset, LD->getSrcValue(), LD->getSrcValueOffset(), LD->getMemoryVT(), LD->isVolatile(), LD->isNonTemporal(), LD->getAlignment()); Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Wed Jul 7 17:15:37 2010 @@ -541,7 +541,7 @@ false, false, 0); SDValue Tmp = DAG.getNode(ISD::ADD, dl, MVT::i64, VAListP, DAG.getConstant(8, MVT::i64)); - SDValue Offset = DAG.getExtLoad(ISD::SEXTLOAD, dl, MVT::i64, Base.getValue(1), + SDValue Offset = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, dl, Base.getValue(1), Tmp, NULL, 0, MVT::i32, false, false, 0); DataPtr = DAG.getNode(ISD::ADD, dl, MVT::i64, Base, Offset); if (N->getValueType(0).isFloatingPoint()) @@ -706,7 +706,7 @@ SDValue Result; if (Op.getValueType() == MVT::i32) - Result = DAG.getExtLoad(ISD::SEXTLOAD, dl, MVT::i64, Chain, DataPtr, + Result = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, dl, Chain, DataPtr, NULL, 0, MVT::i32, false, false, 0); else Result = DAG.getLoad(Op.getValueType(), dl, Chain, DataPtr, NULL, 0, @@ -726,7 +726,7 @@ false, false, 0); SDValue NP = DAG.getNode(ISD::ADD, dl, MVT::i64, SrcP, DAG.getConstant(8, MVT::i64)); - Val = DAG.getExtLoad(ISD::SEXTLOAD, dl, MVT::i64, Result, + Val = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, dl, Result, NP, NULL,0, MVT::i32, false, false, 0); SDValue NPD = DAG.getNode(ISD::ADD, dl, MVT::i64, DestP, DAG.getConstant(8, MVT::i64)); Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Jul 7 17:15:37 2010 @@ -3053,7 +3053,7 @@ // Everything else is passed left-justified. EVT VT = (Size==1) ? MVT::i8 : MVT::i16; if (GPR_idx != NumGPRs) { - SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, PtrVT, Chain, Arg, + SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, PtrVT, dl, Chain, Arg, NULL, 0, VT, false, false, 0); MemOpChains.push_back(Load.getValue(1)); RegsToPass.push_back(std::make_pair(GPR[GPR_idx++], Load)); Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Wed Jul 7 17:15:37 2010 @@ -147,7 +147,7 @@ unsigned Offset = 4-std::max(1U, ObjectVT.getSizeInBits()/8); FIPtr = DAG.getNode(ISD::ADD, dl, MVT::i32, FIPtr, DAG.getConstant(Offset, MVT::i32)); - Load = DAG.getExtLoad(LoadOp, dl, MVT::i32, Chain, FIPtr, + Load = DAG.getExtLoad(LoadOp, MVT::i32, dl, Chain, FIPtr, NULL, 0, ObjectVT, false, false, 0); Load = DAG.getNode(ISD::TRUNCATE, dl, ObjectVT, Load); } Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Jul 7 17:15:37 2010 @@ -500,7 +500,7 @@ N->getOperand(0), MemTmp, NULL, 0, MemVT, false, false, 0); - SDValue Result = CurDAG->getExtLoad(ISD::EXTLOAD, dl, DstVT, Store, MemTmp, + SDValue Result = CurDAG->getExtLoad(ISD::EXTLOAD, DstVT, dl, Store, MemTmp, NULL, 0, MemVT, false, false, 0); // We're about to replace all uses of the FP_ROUND/FP_EXTEND with the Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 7 17:15:37 2010 @@ -5769,7 +5769,7 @@ // Load the value out, extending it from f32 to f80. // FIXME: Avoid the extend by constructing the right constant pool? - SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, dl, MVT::f80, DAG.getEntryNode(), + SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, MVT::f80, dl, DAG.getEntryNode(), FudgePtr, PseudoSourceValue::getConstantPool(), 0, MVT::f32, false, false, 4); // Extend everything to 80 bits to force it to be done on x87. Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107820&r1=107819&r2=107820&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Wed Jul 7 17:15:37 2010 @@ -454,12 +454,12 @@ if (LD->getAlignment() == 2) { int SVOffset = LD->getSrcValueOffset(); - SDValue Low = DAG.getExtLoad(ISD::ZEXTLOAD, dl, MVT::i32, Chain, + SDValue Low = DAG.getExtLoad(ISD::ZEXTLOAD, MVT::i32, dl, Chain, BasePtr, LD->getSrcValue(), SVOffset, MVT::i16, LD->isVolatile(), LD->isNonTemporal(), 2); SDValue HighAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, BasePtr, DAG.getConstant(2, MVT::i32)); - SDValue High = DAG.getExtLoad(ISD::EXTLOAD, dl, MVT::i32, Chain, + SDValue High = DAG.getExtLoad(ISD::EXTLOAD, MVT::i32, dl, Chain, HighAddr, LD->getSrcValue(), SVOffset + 2, MVT::i16, LD->isVolatile(), LD->isNonTemporal(), 2); From dpatel at apple.com Wed Jul 7 17:20:57 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 07 Jul 2010 22:20:57 -0000 Subject: [llvm-commits] [llvm] r107822 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h Message-ID: <20100707222057.328502A6C12C@llvm.org> Author: dpatel Date: Wed Jul 7 17:20:57 2010 New Revision: 107822 URL: http://llvm.org/viewvc/llvm-project?rev=107822&view=rev Log: One MDNode may be used to create regular DIE as well as abstract DIE. Keep track of abstract subprogram DIEs. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=107822&r1=107821&r2=107822&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Jul 7 17:20:57 2010 @@ -1389,6 +1389,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(const MDNode *SPNode) { CompileUnit *SPCU = getCompileUnit(SPNode); DIE *SPDie = SPCU->getDIE(SPNode); + assert(SPDie && "Unable to find subprogram DIE!"); DISubprogram SP(SPNode); @@ -1422,6 +1423,14 @@ SPCU->addDie(SPDie); } + // Pick up abstract subprogram DIE. + if (DIE *AbsSPDIE = AbstractSPDies.lookup(SPNode)) { + SPDie = new DIE(dwarf::DW_TAG_subprogram); + addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, + dwarf::DW_FORM_ref4, AbsSPDIE); + SPCU->addDie(SPDie); + } + addLabel(SPDie, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, Asm->GetTempSymbol("func_begin", Asm->getFunctionNumber())); addLabel(SPDie, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr, @@ -1695,8 +1704,12 @@ ScopeDIE = constructInlinedScopeDIE(Scope); else if (DS.isSubprogram()) { ProcessedSPNodes.insert(DS); - if (Scope->isAbstractScope()) + if (Scope->isAbstractScope()) { ScopeDIE = getCompileUnit(DS)->getDIE(DS); + // Note down abstract DIE. + if (ScopeDIE) + AbstractSPDies.insert(std::make_pair(DS, ScopeDIE)); + } else ScopeDIE = updateSubprogramScopeDIE(DS); } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=107822&r1=107821&r2=107822&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Jul 7 17:20:57 2010 @@ -156,6 +156,9 @@ /// not included DbgScopeMap. AbstractScopes owns its DbgScope*s. DenseMap AbstractScopes; + /// AbstractSPDies - Collection of abstract subprogram DIEs. + DenseMap AbstractSPDies; + /// AbstractScopesList - Tracks abstract scopes constructed while processing /// a function. This list is cleared during endFunction(). SmallVectorAbstractScopesList; From bruno.cardoso at gmail.com Wed Jul 7 17:24:03 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 07 Jul 2010 22:24:03 -0000 Subject: [llvm-commits] [llvm] r107823 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100707222403.768F02A6C12C@llvm.org> Author: bruno Date: Wed Jul 7 17:24:03 2010 New Revision: 107823 URL: http://llvm.org/viewvc/llvm-project?rev=107823&view=rev Log: Add more assembly opcodes for SSE compare instructions Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=107823&r1=107822&r2=107823&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Jul 7 17:24:03 2010 @@ -693,14 +693,38 @@ unsigned SSECCIdx = IsVCMP ? 4 : 3; unsigned SSEComparisonCode = StringSwitch( PatchedName.slice(SSECCIdx, PatchedName.size() - 2)) - .Case("eq", 0) - .Case("lt", 1) - .Case("le", 2) - .Case("unord", 3) - .Case("neq", 4) - .Case("nlt", 5) - .Case("nle", 6) - .Case("ord", 7) + .Case("eq", 0) + .Case("lt", 1) + .Case("le", 2) + .Case("unord", 3) + .Case("neq", 4) + .Case("nlt", 5) + .Case("nle", 6) + .Case("ord", 7) + .Case("eq_uq", 8) + .Case("nge", 9) + .Case("ngt", 0x0A) + .Case("false", 0x0B) + .Case("neq_oq", 0x0C) + .Case("ge", 0x0D) + .Case("gt", 0x0E) + .Case("true", 0x0F) + .Case("eq_os", 0x10) + .Case("lt_oq", 0x11) + .Case("le_oq", 0x12) + .Case("unord_s", 0x13) + .Case("neq_us", 0x14) + .Case("nlt_uq", 0x15) + .Case("nle_uq", 0x16) + .Case("ord_s", 0x17) + .Case("eq_us", 0x18) + .Case("nge_uq", 0x19) + .Case("ngt_uq", 0x1A) + .Case("false_os", 0x1B) + .Case("neq_os", 0x1C) + .Case("ge_oq", 0x1D) + .Case("gt_oq", 0x1E) + .Case("true_us", 0x1F) .Default(~0U); if (SSEComparisonCode != ~0U) { ExtraImmOp = MCConstantExpr::Create(SSEComparisonCode, Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=107823&r1=107822&r2=107823&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Wed Jul 7 17:24:03 2010 @@ -12210,3 +12210,98 @@ // CHECK: encoding: [0xc4,0xe3,0x79,0xdf,0x28,0x07] vaeskeygenassist $7, (%eax), %xmm5 +// CHECK: vcmpps $8, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x08] + vcmpeq_uqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $9, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x09] + vcmpngeps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $10, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x0a] + vcmpngtps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $11, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x0b] + vcmpfalseps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $12, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x0c] + vcmpneq_oqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $13, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x0d] + vcmpgeps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $14, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x0e] + vcmpgtps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $15, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x0f] + vcmptrueps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $16, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x10] + vcmpeq_osps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $17, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x11] + vcmplt_oqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $18, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x12] + vcmple_oqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $19, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x13] + vcmpunord_sps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $20, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x14] + vcmpneq_usps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $21, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x15] + vcmpnlt_uqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $22, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x16] + vcmpnle_uqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $23, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x17] + vcmpord_sps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $24, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x18] + vcmpeq_usps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $25, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x19] + vcmpnge_uqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $26, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x1a] + vcmpngt_uqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $27, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x1b] + vcmpfalse_osps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $28, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x1c] + vcmpneq_osps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $29, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x1d] + vcmpge_oqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $30, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x1e] + vcmpgt_oqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $31, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x1f] + vcmptrue_usps %xmm1, %xmm2, %xmm3 Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107823&r1=107822&r2=107823&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Wed Jul 7 17:24:03 2010 @@ -2274,3 +2274,98 @@ // CHECK: encoding: [0xc4,0x63,0x79,0xdf,0x10,0x07] vaeskeygenassist $7, (%rax), %xmm10 +// CHECK: vcmpps $8, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x08] + vcmpeq_uqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $9, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x09] + vcmpngeps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $10, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x0a] + vcmpngtps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $11, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x0b] + vcmpfalseps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $12, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x0c] + vcmpneq_oqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $13, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x0d] + vcmpgeps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $14, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x0e] + vcmpgtps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $15, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x0f] + vcmptrueps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $16, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x10] + vcmpeq_osps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $17, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x11] + vcmplt_oqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $18, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x12] + vcmple_oqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $19, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x13] + vcmpunord_sps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $20, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x14] + vcmpneq_usps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $21, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x15] + vcmpnlt_uqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $22, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x16] + vcmpnle_uqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $23, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x17] + vcmpord_sps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $24, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x18] + vcmpeq_usps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $25, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x19] + vcmpnge_uqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $26, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x1a] + vcmpngt_uqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $27, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x1b] + vcmpfalse_osps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $28, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x1c] + vcmpneq_osps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $29, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x1d] + vcmpge_oqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $30, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x1e] + vcmpgt_oqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $31, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x1f] + vcmptrue_usps %xmm11, %xmm12, %xmm13 From sabre at nondot.org Wed Jul 7 17:27:32 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 07 Jul 2010 22:27:32 -0000 Subject: [llvm-commits] [llvm] r107825 - in /llvm/trunk: lib/Target/X86/X86AsmBackend.cpp lib/Target/X86/X86FixupKinds.h lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrInfo.h lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86MCCodeEmitter.cpp test/MC/AsmParser/X86/x86_64-encoding.s utils/TableGen/EDEmitter.cpp utils/TableGen/X86RecognizableInstr.cpp Message-ID: <20100707222732.41E692A6C12C@llvm.org> Author: lattner Date: Wed Jul 7 17:27:31 2010 New Revision: 107825 URL: http://llvm.org/viewvc/llvm-project?rev=107825&view=rev Log: Implement the major chunk of PR7195: support for 'callw' in the integrated assembler. Still some discussion to be done. Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp llvm/trunk/lib/Target/X86/X86FixupKinds.h llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s llvm/trunk/utils/TableGen/EDEmitter.cpp llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Wed Jul 7 17:27:31 2010 @@ -23,13 +23,13 @@ #include "llvm/Target/TargetAsmBackend.h" using namespace llvm; -namespace { static unsigned getFixupKindLog2Size(unsigned Kind) { switch (Kind) { default: assert(0 && "invalid fixup kind!"); case X86::reloc_pcrel_1byte: case FK_Data_1: return 0; + case X86::reloc_pcrel_2byte: case FK_Data_2: return 1; case X86::reloc_pcrel_4byte: case X86::reloc_riprel_4byte: @@ -39,6 +39,7 @@ } } +namespace { class X86AsmBackend : public TargetAsmBackend { public: X86AsmBackend(const Target &T) @@ -60,6 +61,7 @@ bool WriteNopData(uint64_t Count, MCObjectWriter *OW) const; }; +} // end anonymous namespace static unsigned getRelaxedOpcode(unsigned Op) { switch (Op) { @@ -180,6 +182,7 @@ /* *** */ +namespace { class ELFX86AsmBackend : public X86AsmBackend { public: ELFX86AsmBackend(const Target &T) @@ -281,7 +284,7 @@ } }; -} +} // end anonymous namespace TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T, const std::string &TT) { Modified: llvm/trunk/lib/Target/X86/X86FixupKinds.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FixupKinds.h?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FixupKinds.h (original) +++ llvm/trunk/lib/Target/X86/X86FixupKinds.h Wed Jul 7 17:27:31 2010 @@ -17,6 +17,7 @@ enum Fixups { reloc_pcrel_4byte = FirstTargetFixupKind, // 32-bit pcrel, e.g. a branch. reloc_pcrel_1byte, // 8-bit pcrel, e.g. branch_1 + reloc_pcrel_2byte, // 16-bit pcrel, e.g. callw reloc_riprel_4byte, // 32-bit rip-relative reloc_riprel_4byte_movq_load // 32-bit rip-relative in movq }; Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Wed Jul 7 17:27:31 2010 @@ -50,9 +50,10 @@ def Imm8 : ImmType<1>; def Imm8PCRel : ImmType<2>; def Imm16 : ImmType<3>; -def Imm32 : ImmType<4>; -def Imm32PCRel : ImmType<5>; -def Imm64 : ImmType<6>; +def Imm16PCRel : ImmType<4>; +def Imm32 : ImmType<5>; +def Imm32PCRel : ImmType<6>; +def Imm64 : ImmType<7>; // FPFormat - This specifies what form this FP instruction has. This is used by // the Floating-Point stackifier pass. @@ -187,6 +188,13 @@ let CodeSize = 3; } +class Ii16PCRel o, Format f, dag outs, dag ins, string asm, + list pattern> + : X86Inst { + let Pattern = pattern; + let CodeSize = 3; +} + class Ii32PCRel o, Format f, dag outs, dag ins, string asm, list pattern> : X86Inst { Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Wed Jul 7 17:27:31 2010 @@ -360,9 +360,10 @@ Imm8 = 1 << ImmShift, Imm8PCRel = 2 << ImmShift, Imm16 = 3 << ImmShift, - Imm32 = 4 << ImmShift, - Imm32PCRel = 5 << ImmShift, - Imm64 = 6 << ImmShift, + Imm16PCRel = 4 << ImmShift, + Imm32 = 5 << ImmShift, + Imm32PCRel = 6 << ImmShift, + Imm64 = 7 << ImmShift, //===------------------------------------------------------------------===// // FP Instruction Classification... Zero is non-fp instruction. @@ -460,7 +461,8 @@ default: assert(0 && "Unknown immediate size"); case X86II::Imm8: case X86II::Imm8PCRel: return 1; - case X86II::Imm16: return 2; + case X86II::Imm16: + case X86II::Imm16PCRel: return 2; case X86II::Imm32: case X86II::Imm32PCRel: return 4; case X86II::Imm64: return 8; @@ -473,6 +475,7 @@ switch (TSFlags & X86II::ImmMask) { default: assert(0 && "Unknown immediate size"); case X86II::Imm8PCRel: + case X86II::Imm16PCRel: case X86II::Imm32PCRel: return true; case X86II::Imm8: Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Jul 7 17:27:31 2010 @@ -259,6 +259,7 @@ let ParserMatchClass = X86AbsMemAsmOperand, PrintMethod = "print_pcrel_imm" in { def i32imm_pcrel : Operand; +def i16imm_pcrel : Operand; def offset8 : Operand; def offset16 : Operand; @@ -709,6 +710,12 @@ "lcall{w}\t{*}$dst", []>, OpSize; def FARCALL32m : I<0xFF, MRM3m, (outs), (ins opaque48mem:$dst), "lcall{l}\t{*}$dst", []>; + + // callw for 16 bit code for the assembler. + let isAsmParserOnly = 1 in + def CALLpcrel16 : Ii16PCRel<0xE8, RawFrm, + (outs), (ins i16imm_pcrel:$dst, variable_ops), + "callw\t$dst", []>, OpSize; } // Constructing a stack frame. Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Wed Jul 7 17:27:31 2010 @@ -38,13 +38,14 @@ ~X86MCCodeEmitter() {} unsigned getNumFixupKinds() const { - return 4; + return 5; } const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const { const static MCFixupKindInfo Infos[] = { { "reloc_pcrel_4byte", 0, 4 * 8, MCFixupKindInfo::FKF_IsPCRel }, { "reloc_pcrel_1byte", 0, 1 * 8, MCFixupKindInfo::FKF_IsPCRel }, + { "reloc_pcrel_2byte", 0, 2 * 8, MCFixupKindInfo::FKF_IsPCRel }, { "reloc_riprel_4byte", 0, 4 * 8, MCFixupKindInfo::FKF_IsPCRel }, { "reloc_riprel_4byte_movq_load", 0, 4 * 8, MCFixupKindInfo::FKF_IsPCRel } }; @@ -170,8 +171,8 @@ switch (Size) { default: assert(0 && "Unknown immediate size"); case 1: return isPCRel ? MCFixupKind(X86::reloc_pcrel_1byte) : FK_Data_1; + case 2: return isPCRel ? MCFixupKind(X86::reloc_pcrel_2byte) : FK_Data_2; case 4: return isPCRel ? MCFixupKind(X86::reloc_pcrel_4byte) : FK_Data_4; - case 2: assert(!isPCRel); return FK_Data_2; case 8: assert(!isPCRel); return FK_Data_8; } } @@ -199,6 +200,8 @@ FixupKind == MCFixupKind(X86::reloc_riprel_4byte) || FixupKind == MCFixupKind(X86::reloc_riprel_4byte_movq_load)) ImmOffset -= 4; + if (FixupKind == MCFixupKind(X86::reloc_pcrel_2byte)) + ImmOffset -= 4;// FIXME: This should be 2, but 'as' produces an offset of 4. if (FixupKind == MCFixupKind(X86::reloc_pcrel_1byte)) ImmOffset -= 1; Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Wed Jul 7 17:27:31 2010 @@ -1,5 +1,10 @@ // RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s +// PR7195 +// CHECK: callw 42 +// CHECK: encoding: [0x66,0xe8,A,A] + callw 42 + // CHECK: crc32b %bl, %eax // CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0xc3] crc32b %bl, %eax Modified: llvm/trunk/utils/TableGen/EDEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/EDEmitter.cpp?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/EDEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/EDEmitter.cpp Wed Jul 7 17:27:31 2010 @@ -347,6 +347,7 @@ LEA("lea64mem"); // all I + PCR("i16imm_pcrel"); PCR("i32imm_pcrel"); PCR("i64i32imm_pcrel"); PCR("brtarget8"); Modified: llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp?rev=107825&r1=107824&r2=107825&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp (original) +++ llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp Wed Jul 7 17:27:31 2010 @@ -836,6 +836,7 @@ TYPE("RST", TYPE_ST) TYPE("i128mem", TYPE_M128) TYPE("i64i32imm_pcrel", TYPE_REL64) + TYPE("i16imm_pcrel", TYPE_REL16) TYPE("i32imm_pcrel", TYPE_REL32) TYPE("SSECC", TYPE_IMM3) TYPE("brtarget", TYPE_RELv) @@ -955,6 +956,7 @@ ENCODING("i64i8imm", ENCODING_IB) ENCODING("i8imm", ENCODING_IB) ENCODING("i64i32imm_pcrel", ENCODING_ID) + ENCODING("i16imm_pcrel", ENCODING_IW) ENCODING("i32imm_pcrel", ENCODING_ID) ENCODING("brtarget", ENCODING_Iv) ENCODING("brtarget8", ENCODING_IB) From sabre at nondot.org Wed Jul 7 17:35:14 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 07 Jul 2010 22:35:14 -0000 Subject: [llvm-commits] [llvm] r107826 - in /llvm/trunk/lib: MC/MachObjectWriter.cpp Target/X86/X86MCCodeEmitter.cpp Message-ID: <20100707223514.198E92A6C12C@llvm.org> Author: lattner Date: Wed Jul 7 17:35:13 2010 New Revision: 107826 URL: http://llvm.org/viewvc/llvm-project?rev=107826&view=rev Log: finish up support for callw: PR7195 Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=107826&r1=107825&r2=107826&view=diff ============================================================================== --- llvm/trunk/lib/MC/MachObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/MachObjectWriter.cpp Wed Jul 7 17:35:13 2010 @@ -33,6 +33,7 @@ default: llvm_unreachable("invalid fixup kind!"); case X86::reloc_pcrel_1byte: case FK_Data_1: return 0; + case X86::reloc_pcrel_2byte: case FK_Data_2: return 1; case X86::reloc_pcrel_4byte: case X86::reloc_riprel_4byte: @@ -47,6 +48,7 @@ default: return false; case X86::reloc_pcrel_1byte: + case X86::reloc_pcrel_2byte: case X86::reloc_pcrel_4byte: case X86::reloc_riprel_4byte: case X86::reloc_riprel_4byte_movq_load: Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=107826&r1=107825&r2=107826&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Wed Jul 7 17:35:13 2010 @@ -201,7 +201,7 @@ FixupKind == MCFixupKind(X86::reloc_riprel_4byte_movq_load)) ImmOffset -= 4; if (FixupKind == MCFixupKind(X86::reloc_pcrel_2byte)) - ImmOffset -= 4;// FIXME: This should be 2, but 'as' produces an offset of 4. + ImmOffset -= 2; if (FixupKind == MCFixupKind(X86::reloc_pcrel_1byte)) ImmOffset -= 1; From gohman at apple.com Wed Jul 7 17:38:14 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 7 Jul 2010 15:38:14 -0700 Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups In-Reply-To: References: Message-ID: <8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com> On Jul 6, 2010, at 2:41 PM, Rafael Espindola wrote: > One issues is that we would produce silly code like > > add r0, r0, #3 > bfc r0, #0, #2 > > for the vaarg of i32. What is the correct way to find the minimum > alignment of an argument? This is not the same as the stack alignment > at function entry. For example, for ARM the correct value is 4, since > values smaller than 32 bits are promoted (see 5.2.1.1 and 5.2.1.2 in > AAPCS). Is TargetData::getCallFrameTypeAlignment what you want here? Dan From grosbach at apple.com Wed Jul 7 17:51:22 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 07 Jul 2010 22:51:22 -0000 Subject: [llvm-commits] [llvm] r107830 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <20100707225122.7174D2A6C12D@llvm.org> Author: grosbach Date: Wed Jul 7 17:51:22 2010 New Revision: 107830 URL: http://llvm.org/viewvc/llvm-project?rev=107830&view=rev Log: Handle cases where the post-RA scheduler may move instructions between the address calculation instructions leading up to a jump table when we're trying to convert them into a TB[H] instruction in Thumb2. This realistically shouldn't happen much, if at all, for well formed inputs, but it's more correct to handle it. rdar://7387682 Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=107830&r1=107829&r2=107830&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jul 7 17:51:22 2010 @@ -1661,15 +1661,25 @@ continue; unsigned IdxReg = MI->getOperand(1).getReg(); bool IdxRegKill = MI->getOperand(1).isKill(); + + // Scan backwards to find the instruction that defines the base + // register. Due to post-RA scheduling, we can't count on it + // immediately preceding the branch instruction. MachineBasicBlock::iterator PrevI = MI; - if (PrevI == MBB->begin()) + MachineBasicBlock::iterator B = MBB->begin(); + while (PrevI != B && !PrevI->definesRegister(BaseReg)) + --PrevI; + + // If for some reason we didn't find it, we can't do anything, so + // just skip this one. + if (!PrevI->definesRegister(BaseReg)) continue; - MachineInstr *AddrMI = --PrevI; + MachineInstr *AddrMI = PrevI; bool OptOk = true; // Examine the instruction that calculates the jumptable entry address. - // If it's not the one just before the t2BR_JT, we won't delete it, then - // it's not worth doing the optimization. + // Make sure it only defines the base register and kills any uses + // other than the index register. for (unsigned k = 0, eee = AddrMI->getNumOperands(); k != eee; ++k) { const MachineOperand &MO = AddrMI->getOperand(k); if (!MO.isReg() || !MO.getReg()) @@ -1686,9 +1696,14 @@ if (!OptOk) continue; - // The previous instruction should be a tLEApcrel or t2LEApcrelJT, we want + // Now scan back again to find the tLEApcrel or t2LEApcrelJT instruction + // that gave us the initial base register definition. + for (--PrevI; PrevI != B && !PrevI->definesRegister(BaseReg); --PrevI) + ; + + // The instruction should be a tLEApcrel or t2LEApcrelJT; we want // to delete it as well. - MachineInstr *LeaMI = --PrevI; + MachineInstr *LeaMI = PrevI; if ((LeaMI->getOpcode() != ARM::tLEApcrelJT && LeaMI->getOpcode() != ARM::t2LEApcrelJT) || LeaMI->getOperand(0).getReg() != BaseReg) From grosbach at apple.com Wed Jul 7 17:53:35 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 07 Jul 2010 22:53:35 -0000 Subject: [llvm-commits] [llvm] r107831 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <20100707225335.414692A6C12C@llvm.org> Author: grosbach Date: Wed Jul 7 17:53:35 2010 New Revision: 107831 URL: http://llvm.org/viewvc/llvm-project?rev=107831&view=rev Log: grammar Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=107831&r1=107830&r2=107831&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jul 7 17:53:35 2010 @@ -1787,7 +1787,7 @@ { MachineFunction &MF = *BB->getParent(); - // If it's the destination block is terminated by an unconditional branch, + // If the destination block is terminated by an unconditional branch, // try to move it; otherwise, create a new block following the jump // table that branches back to the actual target. This is a very simple // heuristic. FIXME: We can definitely improve it. From stoklund at 2pi.dk Wed Jul 7 18:04:56 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 07 Jul 2010 23:04:56 -0000 Subject: [llvm-commits] [llvm] r107832 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <20100707230456.3DE272A6C12C@llvm.org> Author: stoklund Date: Wed Jul 7 18:04:56 2010 New Revision: 107832 URL: http://llvm.org/viewvc/llvm-project?rev=107832&view=rev Log: fix copies to/from GR8_ABCD_H even more 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=107832&r1=107831&r2=107832&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Jul 7 18:04:56 2010 @@ -1932,7 +1932,9 @@ } else if (CommonRC == &X86::GR8RegClass) { // Copying to or from a physical H register on x86-64 requires a NOREX // move. Otherwise use a normal move. - if ((isHReg(DestReg) || isHReg(SrcReg)) && + if ((isHReg(DestReg) || isHReg(SrcReg) || + SrcRC == &X86::GR8_ABCD_HRegClass || + DestRC == &X86::GR8_ABCD_HRegClass) && TM.getSubtarget().is64Bit()) Opc = X86::MOV8rr_NOREX; else From espindola at google.com Wed Jul 7 18:13:56 2010 From: espindola at google.com (Rafael Espindola) Date: Wed, 7 Jul 2010 19:13:56 -0400 Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups In-Reply-To: <8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com> References: <8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com> Message-ID: I thought so, but it is returning just the Abi alignment for me. Should there be an 's:4' or something in the target data? On Jul 7, 2010 6:39 PM, "Dan Gohman" wrote: > > On Jul 6, 2010, at 2:41 PM, Rafael Espindola wrote: > >> One issues is that we would produce silly code like >> >> add r0, r0, #3 >> bfc r0, #0, #2 >> >> for the vaarg of i32. What is the correct way to find the minimum >> alignment of an argument? This is not the same as the stack alignment >> at function entry. For example, for ARM the correct value is 4, since >> values smaller than 32 bits are promoted (see 5.2.1.1 and 5.2.1.2 in >> AAPCS). > > Is TargetData::getCallFrameTypeAlignment what you want here? > > Dan > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100707/2e0bf0ab/attachment.html From sabre at nondot.org Wed Jul 7 18:16:38 2010 From: sabre at nondot.org (Chris Lattner) Date: Wed, 07 Jul 2010 23:16:38 -0000 Subject: [llvm-commits] [llvm] r107834 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <20100707231638.150CA2A6C12C@llvm.org> Author: lattner Date: Wed Jul 7 18:16:37 2010 New Revision: 107834 URL: http://llvm.org/viewvc/llvm-project?rev=107834&view=rev Log: use PrintEscapedString to handle attribute section with escapes in it, PR7399. The asm parser already handles this. This is of dubious utility (see the PR) but the asmprinter was clearly broken here. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=107834&r1=107833&r2=107834&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Jul 7 18:16:37 2010 @@ -70,8 +70,7 @@ // PrintEscapedString - Print each character of the specified string, escaping // it if it is not printable or if it is an escape char. -static void PrintEscapedString(const StringRef &Name, - raw_ostream &Out) { +static void PrintEscapedString(StringRef Name, raw_ostream &Out) { for (unsigned i = 0, e = Name.size(); i != e; ++i) { unsigned char C = Name[i]; if (isprint(C) && C != '\\' && C != '"') @@ -1472,8 +1471,11 @@ writeOperand(GV->getInitializer(), false); } - if (GV->hasSection()) - Out << ", section \"" << GV->getSection() << '"'; + if (GV->hasSection()) { + Out << ", section \""; + PrintEscapedString(GV->getSection(), Out); + Out << '"'; + } if (GV->getAlignment()) Out << ", align " << GV->getAlignment(); @@ -1631,8 +1633,11 @@ Attributes FnAttrs = Attrs.getFnAttributes(); if (FnAttrs != Attribute::None) Out << ' ' << Attribute::getAsString(Attrs.getFnAttributes()); - if (F->hasSection()) - Out << " section \"" << F->getSection() << '"'; + if (F->hasSection()) { + Out << " section \""; + PrintEscapedString(F->getSection(), Out); + Out << '"'; + } if (F->getAlignment()) Out << " align " << F->getAlignment(); if (F->hasGC()) From gohman at apple.com Wed Jul 7 18:47:25 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 23:47:25 -0000 Subject: [llvm-commits] [llvm] r107839 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <20100707234725.4BD362A6C12C@llvm.org> Author: djg Date: Wed Jul 7 18:47:25 2010 New Revision: 107839 URL: http://llvm.org/viewvc/llvm-project?rev=107839&view=rev Log: Fix -fast-isel-abort to check the right instruction. 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=107839&r1=107838&r2=107839&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 18:47:25 2010 @@ -737,7 +737,7 @@ // Otherwise, give up on FastISel for the rest of the block. // For now, be a little lenient about non-branch terminators. - if (!isa(BI) || isa(BI)) { + if (!isa(Inst) || isa(Inst)) { ++NumFastIselFailures; if (EnableFastISelVerbose || EnableFastISelAbort) { dbgs() << "FastISel miss: "; From gohman at apple.com Wed Jul 7 18:52:58 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 07 Jul 2010 23:52:58 -0000 Subject: [llvm-commits] [llvm] r107840 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <20100707235258.DF6BF2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 18:52:58 2010 New Revision: 107840 URL: http://llvm.org/viewvc/llvm-project?rev=107840&view=rev Log: Don't forward-declare registers for static allocas, which we'll prefer to materialize as local constants. This fixes the clang bootstrap abort. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107840&r1=107839&r2=107840&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 7 18:52:58 2010 @@ -120,7 +120,9 @@ // In bottom-up mode, just create the virtual register which will be used // to hold the value. It will be materialized later. - if (isa(V)) { + if (isa(V) && + (!isa(V) || + !FuncInfo.StaticAllocaMap.count(cast(V)))) { Reg = createResultReg(TLI.getRegClassFor(VT)); FuncInfo.ValueMap[V] = Reg; return Reg; From stuart at apple.com Wed Jul 7 19:12:36 2010 From: stuart at apple.com (Stuart Hastings) Date: Thu, 08 Jul 2010 00:12:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r107843 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Message-ID: <20100708001236.5DD6A2A6C12C@llvm.org> Author: stuart Date: Wed Jul 7 19:12:36 2010 New Revision: 107843 URL: http://llvm.org/viewvc/llvm-project?rev=107843&view=rev Log: Record correct line # for decl. Radar 8152866. 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=107843&r1=107842&r2=107843&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Wed Jul 7 19:12:36 2010 @@ -604,7 +604,7 @@ Instruction *Call = DebugFactory.InsertDeclare(AI, D, Builder.GetInsertBlock()); - Call->setDebugLoc(DebugLoc::get(CurLineNo, 0, VarScope)); + Call->setDebugLoc(DebugLoc::get(Loc.line, 0, VarScope)); } From benny.kra at googlemail.com Wed Jul 7 19:18:35 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Thu, 8 Jul 2010 02:18:35 +0200 Subject: [llvm-commits] [PATCH] Add a instcombine optimization. Message-ID: <5728FE48-1EF0-4A7B-A11D-AE2E95B40227@gmail.com> The attached patch adds a new transformation to instcombine: (X >s -1) ? C1 : C2 --> ((X >>s 31) & (C2 - C1)) + C1 and (X ((X >>s 31) & (C2 - C1)) + C1 this way the conditional can be avoided. for this function (on x86) int pn(int n) { return n >= 0 ? 1 : -1; } we used to generate: testl %edi, %edi movl $1, %ecx movl $-1, %eax cmovnsl %ecx, %eax now: sarl $31, %edi movl %edi, %eax orl $1, %eax and a more general example int sel(int n) { return n >= 0 ? 60 : 100; } we used to generate: testl %edi, %edi movl $60, %ecx movl $100, %eax cmovnsl %ecx, %eax now: sarl $31, %edi andl $40, %edi leal 60(%rdi), %eax -------------- next part -------------- A non-text attachment was scrubbed... Name: branchless.patch Type: application/octet-stream Size: 3456 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100708/d16fea21/attachment.obj From sabre at nondot.org Wed Jul 7 19:27:05 2010 From: sabre at nondot.org (Chris Lattner) Date: Thu, 08 Jul 2010 00:27:05 -0000 Subject: [llvm-commits] [llvm] r107846 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/address-space.ll Message-ID: <20100708002705.E7F3F2A6C12C@llvm.org> Author: lattner Date: Wed Jul 7 19:27:05 2010 New Revision: 107846 URL: http://llvm.org/viewvc/llvm-project?rev=107846&view=rev Log: Fix the second half of PR7437: scalarrepl wasn't preserving address spaces when SRoA'ing memcpy's. Added: llvm/trunk/test/Transforms/ScalarRepl/address-space.ll Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=107846&r1=107845&r2=107846&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Jul 7 19:27:05 2010 @@ -1272,6 +1272,8 @@ // If there is an other pointer, we want to convert it to the same pointer // type as AI has, so we can GEP through it safely. if (OtherPtr) { + unsigned AddrSpace = + cast(OtherPtr->getType())->getAddressSpace(); // Remove bitcasts and all-zero GEPs from OtherPtr. This is an // optimization, but it's also required to detect the corner case where @@ -1279,20 +1281,8 @@ // OtherPtr may be a bitcast or GEP that currently being rewritten. (This // function is only called for mem intrinsics that access the whole // aggregate, so non-zero GEPs are not an issue here.) - while (1) { - if (BitCastInst *BC = dyn_cast(OtherPtr)) { - OtherPtr = BC->getOperand(0); - continue; - } - if (GetElementPtrInst *GEP = dyn_cast(OtherPtr)) { - // All zero GEPs are effectively bitcasts. - if (GEP->hasAllZeroIndices()) { - OtherPtr = GEP->getOperand(0); - continue; - } - } - break; - } + OtherPtr = OtherPtr->stripPointerCasts(); + // Copying the alloca to itself is a no-op: just delete it. if (OtherPtr == AI || OtherPtr == NewElts[0]) { // This code will run twice for a no-op memcpy -- once for each operand. @@ -1304,15 +1294,13 @@ return; } - if (ConstantExpr *BCE = dyn_cast(OtherPtr)) - if (BCE->getOpcode() == Instruction::BitCast) - OtherPtr = BCE->getOperand(0); - // If the pointer is not the right type, insert a bitcast to the right // type. - if (OtherPtr->getType() != AI->getType()) - OtherPtr = new BitCastInst(OtherPtr, AI->getType(), OtherPtr->getName(), - MI); + const Type *NewTy = + PointerType::get(AI->getType()->getElementType(), AddrSpace); + + if (OtherPtr->getType() != NewTy) + OtherPtr = new BitCastInst(OtherPtr, NewTy, OtherPtr->getName(), MI); } // Process each element of the aggregate. Added: llvm/trunk/test/Transforms/ScalarRepl/address-space.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ScalarRepl/address-space.ll?rev=107846&view=auto ============================================================================== --- llvm/trunk/test/Transforms/ScalarRepl/address-space.ll (added) +++ llvm/trunk/test/Transforms/ScalarRepl/address-space.ll Wed Jul 7 19:27:05 2010 @@ -0,0 +1,35 @@ +; RUN: opt -S -scalarrepl < %s | FileCheck %s +; PR7437 - Make sure SROA preserves address space of memcpy when +; hacking on it. +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-n8:16:32:64" +target triple = "x86_64-apple-darwin10" + +%struct.anon = type { [1 x float] } + +; CHECK: define void @Test( +; CHECK: load float addrspace(2)* +; CHECK-NEXT: fsub float +; CHECK: store float {{.*}}, float addrspace(2)* +define void @Test(%struct.anon addrspace(2)* %pPtr) nounwind { +entry: + %s = alloca %struct.anon, align 4 ; <%struct.anon*> [#uses=3] + %arrayidx = getelementptr inbounds %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1] + %tmp1 = bitcast %struct.anon* %s to i8* ; [#uses=1] + %tmp2 = bitcast %struct.anon addrspace(2)* %arrayidx to i8 addrspace(2)* ; [#uses=1] + call void @llvm.memcpy.p0i8.p2i8.i64(i8* %tmp1, i8 addrspace(2)* %tmp2, i64 4, i32 4, i1 false) + %tmp3 = getelementptr inbounds %struct.anon* %s, i32 0, i32 0 ; <[1 x float]*> [#uses=1] + %arrayidx4 = getelementptr inbounds [1 x float]* %tmp3, i32 0, i64 0 ; [#uses=2] + %tmp5 = load float* %arrayidx4 ; [#uses=1] + %sub = fsub float %tmp5, 5.000000e+00 ; [#uses=1] + store float %sub, float* %arrayidx4 + %arrayidx7 = getelementptr inbounds %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1] + %tmp8 = bitcast %struct.anon addrspace(2)* %arrayidx7 to i8 addrspace(2)* ; [#uses=1] + %tmp9 = bitcast %struct.anon* %s to i8* ; [#uses=1] + call void @llvm.memcpy.p2i8.p0i8.i64(i8 addrspace(2)* %tmp8, i8* %tmp9, i64 4, i32 4, i1 false) + ret void +} + +declare void @llvm.memcpy.p0i8.p2i8.i64(i8* nocapture, i8 addrspace(2)* nocapture, i64, i32, i1) nounwind + +declare void @llvm.memcpy.p2i8.p0i8.i64(i8 addrspace(2)* nocapture, i8* nocapture, i64, i32, i1) nounwind + From grosbach at apple.com Wed Jul 7 19:38:54 2010 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 08 Jul 2010 00:38:54 -0000 Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk: include/llvm/CodeGen/RegisterScavenging.h lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/RegisterScavenging.cpp Message-ID: <20100708003854.AB2F12A6C12C@llvm.org> Author: grosbach Date: Wed Jul 7 19:38:54 2010 New Revision: 107847 URL: http://llvm.org/viewvc/llvm-project?rev=107847&view=rev Log: When processing frame index virtual registers, consider all available registers (if there are any) and use the one which remains available for the longest rather than just using the first one. This should help enable better re-use of the loaded frame index values. rdar://7318760 Modified: llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Modified: llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h?rev=107847&r1=107846&r2=107847&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h (original) +++ llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h Wed Jul 7 19:38:54 2010 @@ -98,10 +98,24 @@ /// getRegsUsed - return all registers currently in use in used. void getRegsUsed(BitVector &used, bool includeReserved); + /// getRegsAvailable - Return all available registers in the register class + /// in Mask. + void getRegsAvailable(const TargetRegisterClass *RC, BitVector &Mask); + /// FindUnusedReg - Find a unused register of the specified register class. /// Return 0 if none is found. unsigned FindUnusedReg(const TargetRegisterClass *RegClass) const; + /// findSurvivorReg - Return the candidate register that is unused for the + /// longest after StartMI. UseMI is set to the instruction where the search + /// stopped. + /// + /// No more than InstrLimit instructions are inspected. + unsigned findSurvivorReg(MachineBasicBlock::iterator StartMI, + BitVector &Candidates, + unsigned InstrLimit, + MachineBasicBlock::iterator &UseMI); + /// setScavengingFrameIndex / getScavengingFrameIndex - accessor and setter of /// ScavengingFrameIndex. void setScavengingFrameIndex(int FI) { ScavengingFrameIndex = FI; } @@ -147,11 +161,6 @@ /// Add Reg and its aliases to BV. void addRegWithAliases(BitVector &BV, unsigned Reg); - unsigned findSurvivorReg(MachineBasicBlock::iterator MI, - BitVector &Candidates, - unsigned InstrLimit, - MachineBasicBlock::iterator &UseMI); - }; } // End llvm namespace Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=107847&r1=107846&r2=107847&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jul 7 19:38:54 2010 @@ -885,10 +885,20 @@ // Scavenge a new scratch register CurrentVirtReg = Reg; const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg); - CurrentScratchReg = RS->FindUnusedReg(RC); - if (CurrentScratchReg == 0) + const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); + BitVector Candidates(TRI->getNumRegs()); + RS->getRegsAvailable(RC, Candidates); + + // If there are any registers available, use the one that's + // unused for the longest after this instruction. That increases + // the ability to reuse the value. + if (Candidates.any()) { + MachineBasicBlock::iterator UMI; + CurrentScratchReg = RS->findSurvivorReg(I, Candidates, 25, UMI); + } else { // No register is "free". Scavenge a register. CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); + } PrevValue = Value; } Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=107847&r1=107846&r2=107847&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Wed Jul 7 19:38:54 2010 @@ -242,8 +242,18 @@ return 0; } +/// getRegsAvailable - Return all available registers in the register class +/// in Mask. +void RegScavenger::getRegsAvailable(const TargetRegisterClass *RC, + BitVector &Mask) { + for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end(); + I != E; ++I) + if (!isAliasUsed(*I)) + Mask.set(*I); +} + /// findSurvivorReg - Return the candidate register that is unused for the -/// longest after MBBI. UseMI is set to the instruction where the search +/// longest after StargMII. UseMI is set to the instruction where the search /// stopped. /// /// No more than InstrLimit instructions are inspected. From wdietz2 at illinois.edu Wed Jul 7 19:49:22 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Thu, 08 Jul 2010 00:49:22 -0000 Subject: [llvm-commits] [poolalloc] r107848 - /poolalloc/trunk/test/Makefile Message-ID: <20100708004922.326B42A6C12C@llvm.org> Author: wdietz2 Date: Wed Jul 7 19:49:22 2010 New Revision: 107848 URL: http://llvm.org/viewvc/llvm-project?rev=107848&view=rev Log: Define the TESTSUITE variable on a different line to allow it to be easily overriden during make invocation. Modified: poolalloc/trunk/test/Makefile Modified: poolalloc/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=107848&r1=107847&r2=107848&view=diff ============================================================================== --- poolalloc/trunk/test/Makefile (original) +++ poolalloc/trunk/test/Makefile Wed Jul 7 19:49:22 2010 @@ -416,9 +416,11 @@ SETPATH = \ PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(LLVMGCCDIR)/bin:$(PATH):$(PROJ_OBJ_ROOT)/test/tools +TESTSUITE=$(PROJ_OBJ_ROOT)/test + #Run the lit tests for this project lit: lit.site.cfg $(TOOLS) - $(SETPATH) $(MAKE) -C $(LLVM_OBJ_ROOT)/test check-local-lit TESTSUITE=$(PROJ_OBJ_ROOT)/test + $(SETPATH) $(MAKE) -C $(LLVM_OBJ_ROOT)/test check-local-lit TESTSUITE=$(TESTSUITE) clean:: -$(RM) -rf `find $(PROJ_OBJ_DIR) -name Output -type d -print` From wdietz2 at illinois.edu Wed Jul 7 19:52:12 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Thu, 08 Jul 2010 00:52:12 -0000 Subject: [llvm-commits] [poolalloc] r107849 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100708005212.9DC602A6C12C@llvm.org> Author: wdietz2 Date: Wed Jul 7 19:52:12 2010 New Revision: 107849 URL: http://llvm.org/viewvc/llvm-project?rev=107849&view=rev Log: When creating a DSCallsite, properly handle cases where DSA didn't create a DSNode for a value for a good reason. Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=107849&r1=107848&r2=107849&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Wed Jul 7 19:52:12 2010 @@ -31,6 +31,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/GlobalAlias.h" #include #include @@ -54,6 +55,26 @@ cl::Hidden); } +// Determines if the DSGraph 'should' have a node for a given value. +static bool shouldHaveNodeForValue(const Value *V) { + // Peer through casts + V = V->stripPointerCasts(); + + // Only pointers get nodes + if (!isa(V->getType())) return false; + + // Undef values, even ones of pointer type, don't get nodes. + if (isa(V)) return false; + + // Use the Aliasee of GlobalAliases + // FIXME: This check might not be required, it's here because + // something similar is done in the Local pass. + if (const GlobalAlias *GA = dyn_cast(V)) + return shouldHaveNodeForValue(GA->getAliasee()); + + return true; +} + /// getFunctionNames - Return a space separated list of the name of the /// functions in this graph (if any) std::string DSGraph::getFunctionNames() const { @@ -517,7 +538,7 @@ DSCallSite DSGraph::getDSCallSiteForCallSite(CallSite CS) const { DSNodeHandle RetVal, VarArg; Instruction *I = CS.getInstruction(); - if (isa(I->getType())) + if (shouldHaveNodeForValue(I)) RetVal = getNodeForValue(I); //FIXME: Here we trust the signature of the callsite to determine which arguments @@ -532,7 +553,8 @@ // Calculate the arguments vector... for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) if (isa((*I)->getType())) { - const DSNodeHandle ArgNode = getNodeForValue(*I); + DSNodeHandle ArgNode; // Initially empty + if (shouldHaveNodeForValue(*I)) ArgNode = getNodeForValue(*I); if (I - CS.arg_begin() < NumFixedArgs) { Args.push_back(ArgNode); } else { From gohman at apple.com Wed Jul 7 20:00:56 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 08 Jul 2010 01:00:56 -0000 Subject: [llvm-commits] [llvm] r107850 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/X86/ lib/Target/XCore/ test/CodeGen/X86/ utils/TableGen/ Message-ID: <20100708010056.C260E2A6C12C@llvm.org> Author: djg Date: Wed Jul 7 20:00:56 2010 New Revision: 107850 URL: http://llvm.org/viewvc/llvm-project?rev=107850&view=rev Log: Revert 107840 107839 107813 107804 107800 107797 107791. Debug info intrinsics win for now. Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/CallingConvLower.cpp llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.h llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll llvm/trunk/test/CodeGen/X86/fast-isel.ll llvm/trunk/utils/TableGen/FastISelEmitter.cpp Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Jul 7 20:00:56 2010 @@ -188,7 +188,8 @@ /// CheckReturn - Analyze the return values of a function, returning /// true if the return can be performed without sret-demotion, and /// false otherwise. - bool CheckReturn(const SmallVectorImpl &ArgsFlags, + bool CheckReturn(const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, CCAssignFn Fn); /// AnalyzeCallOperands - Analyze the outgoing arguments to a call, Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Wed Jul 7 20:00:56 2010 @@ -19,7 +19,6 @@ #include "llvm/ADT/SmallSet.h" #endif #include "llvm/CodeGen/ValueTypes.h" -#include "llvm/CodeGen/MachineBasicBlock.h" namespace llvm { @@ -45,6 +44,7 @@ /// lowering, but runs quickly. class FastISel { protected: + MachineBasicBlock *MBB; DenseMap LocalValueMap; FunctionLoweringInfo &FuncInfo; MachineRegisterInfo &MRI; @@ -56,17 +56,23 @@ const TargetInstrInfo &TII; const TargetLowering &TLI; const TargetRegisterInfo &TRI; - MachineBasicBlock::iterator LastLocalValue; + bool IsBottomUp; public: - /// getLastLocalValue - Return the position of the last instruction - /// emitted for materializing constants for use in the current block. - MachineBasicBlock::iterator getLastLocalValue() { return LastLocalValue; } - /// startNewBlock - Set the current block to which generated machine /// instructions will be appended, and clear the local CSE map. /// - void startNewBlock(); + void startNewBlock(MachineBasicBlock *mbb) { + setCurrentBlock(mbb); + LocalValueMap.clear(); + } + + /// setCurrentBlock - Set the current block to which generated machine + /// instructions will be appended. + /// + void setCurrentBlock(MachineBasicBlock *mbb) { + MBB = mbb; + } /// getCurDebugLoc() - Return current debug location information. DebugLoc getCurDebugLoc() const { return DL; } Modified: llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/FunctionLoweringInfo.h Wed Jul 7 20:00:56 2010 @@ -25,7 +25,6 @@ #endif #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/ISDOpcodes.h" -#include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/Support/CallSite.h" #include @@ -81,12 +80,6 @@ /// function arguments that are inserted after scheduling is completed. SmallVector ArgDbgValues; - /// MBB - The current block. - MachineBasicBlock *MBB; - - /// MBB - The current insert position inside the current block. - MachineBasicBlock::iterator InsertPt; - #ifndef NDEBUG SmallSet CatchInfoLost; SmallSet CatchInfoFound; Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Wed Jul 7 20:00:56 2010 @@ -280,14 +280,15 @@ SDNode *MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTs, const SDValue *Ops, unsigned NumOps, unsigned EmitNodeInfo); - void PrepareEHLandingPad(); + void PrepareEHLandingPad(MachineBasicBlock *BB); void SelectAllBasicBlocks(const Function &Fn); - void FinishBasicBlock(); + void FinishBasicBlock(MachineBasicBlock *BB); - void SelectBasicBlock(BasicBlock::const_iterator Begin, - BasicBlock::const_iterator End, - bool &HadTailCall); - void CodeGenAndEmitDAG(); + MachineBasicBlock *SelectBasicBlock(MachineBasicBlock *BB, + BasicBlock::const_iterator Begin, + BasicBlock::const_iterator End, + bool &HadTailCall); + MachineBasicBlock *CodeGenAndEmitDAG(MachineBasicBlock *BB); void LowerArguments(const BasicBlock *BB); void ComputeLiveOutVRegInfo(); Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jul 7 20:00:56 2010 @@ -24,7 +24,6 @@ #include "llvm/CallingConv.h" #include "llvm/InlineAsm.h" -#include "llvm/Attributes.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/ADT/APFloat.h" @@ -1160,7 +1159,8 @@ /// registers. If false is returned, an sret-demotion is performed. /// virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &Outs, + const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, LLVMContext &Context) const { // Return true by default to get preexisting behavior. @@ -1656,15 +1656,6 @@ /// optimization. bool benefitFromCodePlacementOpt; }; - -/// GetReturnInfo - Given an LLVM IR type and return type attributes, -/// compute the return value EVTs and flags, and optionally also -/// the offsets, if the return value is being lowered to memory. -void GetReturnInfo(const Type* ReturnType, Attributes attr, - SmallVectorImpl &Outs, - const TargetLowering &TLI, - SmallVectorImpl *Offsets = 0); - } // end llvm namespace #endif Modified: llvm/trunk/lib/CodeGen/CallingConvLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CallingConvLower.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CallingConvLower.cpp (original) +++ llvm/trunk/lib/CodeGen/CallingConvLower.cpp Wed Jul 7 20:00:56 2010 @@ -80,12 +80,13 @@ /// CheckReturn - Analyze the return values of a function, returning true if /// the return can be performed without sret-demotion, and false otherwise. -bool CCState::CheckReturn(const SmallVectorImpl &Outs, +bool CCState::CheckReturn(const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, CCAssignFn Fn) { // Determine which register each value should be copied into. - for (unsigned i = 0, e = Outs.size(); i != e; ++i) { - EVT VT = Outs[i].VT; - ISD::ArgFlagsTy ArgFlags = Outs[i].Flags; + for (unsigned i = 0, e = OutTys.size(); i != e; ++i) { + EVT VT = OutTys[i]; + ISD::ArgFlagsTy ArgFlags = ArgsFlags[i]; if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) return false; } Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Jul 7 20:00:56 2010 @@ -329,15 +329,19 @@ if (OptLevel != CodeGenOpt::None) PM.add(createOptimizePHIsPass()); - if (OptLevel != CodeGenOpt::None) { - // With optimization, dead code should already be eliminated. However - // there is one known exception: lowered code for arguments that are only - // used by tail calls, where the tail calls reuse the incoming stack - // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll). - PM.add(createDeadMachineInstructionElimPass()); - printAndVerify(PM, "After codegen DCE pass", - /* allowDoubleDefs= */ true); + // Delete dead machine instructions regardless of optimization level. + // + // At -O0, fast-isel frequently creates dead instructions. + // + // With optimization, dead code should already be eliminated. However + // there is one known exception: lowered code for arguments that are only + // used by tail calls, where the tail calls reuse the incoming stack + // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll). + PM.add(createDeadMachineInstructionElimPass()); + printAndVerify(PM, "After codegen DCE pass", + /* allowDoubleDefs= */ true); + if (OptLevel != CodeGenOpt::None) { PM.add(createOptimizeExtsPass()); if (!DisableMachineLICM) PM.add(createMachineLICMPass()); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 7 20:00:56 2010 @@ -57,17 +57,6 @@ #include "llvm/Support/ErrorHandling.h" using namespace llvm; -/// startNewBlock - Set the current block to which generated machine -/// instructions will be appended, and clear the local CSE map. -/// -void FastISel::startNewBlock() { - LocalValueMap.clear(); - - // Start out as end(), meaining no local-value instructions have - // been emitted. - LastLocalValue = FuncInfo.MBB->end(); -} - bool FastISel::hasTrivialKill(const Value *V) const { // Don't consider constants or arguments to have trivial kills. const Instruction *I = dyn_cast(V); @@ -120,11 +109,12 @@ // In bottom-up mode, just create the virtual register which will be used // to hold the value. It will be materialized later. - if (isa(V) && - (!isa(V) || - !FuncInfo.StaticAllocaMap.count(cast(V)))) { + if (IsBottomUp) { Reg = createResultReg(TLI.getRegClassFor(VT)); - FuncInfo.ValueMap[V] = Reg; + if (isa(V)) + FuncInfo.ValueMap[V] = Reg; + else + LocalValueMap[V] = Reg; return Reg; } @@ -179,8 +169,7 @@ Reg = lookUpRegForValue(Op); } else if (isa(V)) { Reg = createResultReg(TLI.getRegClassFor(VT)); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(TargetOpcode::IMPLICIT_DEF), Reg); + BuildMI(MBB, DL, TII.get(TargetOpcode::IMPLICIT_DEF), Reg); } // If target-independent code couldn't handle the value, give target-specific @@ -190,10 +179,8 @@ // Don't cache constant materializations in the general ValueMap. // To do so would require tracking what uses they dominate. - if (Reg != 0) { + if (Reg != 0) LocalValueMap[V] = Reg; - LastLocalValue = MRI.getVRegDef(Reg); - } return Reg; } @@ -222,20 +209,12 @@ unsigned &AssignedReg = FuncInfo.ValueMap[I]; if (AssignedReg == 0) - // Use the new register. AssignedReg = Reg; else if (Reg != AssignedReg) { - // We already have a register for this value. Replace uses of - // the existing register with uses of the new one. - MRI.replaceRegWith(AssignedReg, Reg); - // Replace uses of the existing register in PHINodesToUpdate too. - for (unsigned i = 0, e = FuncInfo.PHINodesToUpdate.size(); i != e; ++i) - if (FuncInfo.PHINodesToUpdate[i].second == AssignedReg) - FuncInfo.PHINodesToUpdate[i].second = Reg; - // And update the ValueMap. - AssignedReg = Reg; + const TargetRegisterClass *RegClass = MRI.getRegClass(Reg); + TII.copyRegToReg(*MBB, MBB->end(), AssignedReg, + Reg, RegClass, RegClass, DL); } - return AssignedReg; } @@ -455,28 +434,23 @@ if (!V) { // Currently the optimizer can produce this; insert an undef to // help debugging. Probably the optimizer should not do this. - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) - .addReg(0U).addImm(DI->getOffset()) - .addMetadata(DI->getVariable()); + BuildMI(MBB, DL, II).addReg(0U).addImm(DI->getOffset()). + addMetadata(DI->getVariable()); } else if (const ConstantInt *CI = dyn_cast(V)) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) - .addImm(CI->getZExtValue()).addImm(DI->getOffset()) - .addMetadata(DI->getVariable()); + BuildMI(MBB, DL, II).addImm(CI->getZExtValue()).addImm(DI->getOffset()). + addMetadata(DI->getVariable()); } else if (const ConstantFP *CF = dyn_cast(V)) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) - .addFPImm(CF).addImm(DI->getOffset()) - .addMetadata(DI->getVariable()); + BuildMI(MBB, DL, II).addFPImm(CF).addImm(DI->getOffset()). + addMetadata(DI->getVariable()); } else if (unsigned Reg = lookUpRegForValue(V)) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) - .addReg(Reg, RegState::Debug).addImm(DI->getOffset()) - .addMetadata(DI->getVariable()); + BuildMI(MBB, DL, II).addReg(Reg, RegState::Debug).addImm(DI->getOffset()). + addMetadata(DI->getVariable()); } else { // We can't yet handle anything else here because it would require // generating code, thus altering codegen because of debug info. // Insert an undef so we can see what we dropped. - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) - .addReg(0U).addImm(DI->getOffset()) - .addMetadata(DI->getVariable()); + BuildMI(MBB, DL, II).addReg(0U).addImm(DI->getOffset()). + addMetadata(DI->getVariable()); } return true; } @@ -485,13 +459,12 @@ switch (TLI.getOperationAction(ISD::EXCEPTIONADDR, VT)) { default: break; case TargetLowering::Expand: { - assert(FuncInfo.MBB->isLandingPad() && - "Call to eh.exception not in landing pad!"); + assert(MBB->isLandingPad() && "Call to eh.exception not in landing pad!"); unsigned Reg = TLI.getExceptionAddressRegister(); const TargetRegisterClass *RC = TLI.getRegClassFor(VT); unsigned ResultReg = createResultReg(RC); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, Reg, RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + Reg, RC, RC, DL); assert(InsertedCopy && "Can't copy address registers!"); InsertedCopy = InsertedCopy; UpdateValueMap(I, ResultReg); @@ -505,23 +478,23 @@ switch (TLI.getOperationAction(ISD::EHSELECTION, VT)) { default: break; case TargetLowering::Expand: { - if (FuncInfo.MBB->isLandingPad()) - AddCatchInfo(*cast(I), &FuncInfo.MF->getMMI(), FuncInfo.MBB); + if (MBB->isLandingPad()) + AddCatchInfo(*cast(I), &FuncInfo.MF->getMMI(), MBB); else { #ifndef NDEBUG FuncInfo.CatchInfoLost.insert(cast(I)); #endif // FIXME: Mark exception selector register as live in. Hack for PR1508. unsigned Reg = TLI.getExceptionSelectorRegister(); - if (Reg) FuncInfo.MBB->addLiveIn(Reg); + if (Reg) MBB->addLiveIn(Reg); } unsigned Reg = TLI.getExceptionSelectorRegister(); EVT SrcVT = TLI.getPointerTy(); const TargetRegisterClass *RC = TLI.getRegClassFor(SrcVT); unsigned ResultReg = createResultReg(RC); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, Reg, RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, Reg, + RC, RC, DL); assert(InsertedCopy && "Can't copy address registers!"); InsertedCopy = InsertedCopy; @@ -640,9 +613,8 @@ TargetRegisterClass* DstClass = TLI.getRegClassFor(DstVT); ResultReg = createResultReg(DstClass); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, Op0, - DstClass, SrcClass, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + Op0, DstClass, SrcClass, DL); if (!InsertedCopy) ResultReg = 0; } @@ -690,14 +662,13 @@ /// the CFG. void FastISel::FastEmitBranch(MachineBasicBlock *MSucc, DebugLoc DL) { - if (FuncInfo.MBB->isLayoutSuccessor(MSucc)) { + if (MBB->isLayoutSuccessor(MSucc)) { // The unconditional fall-through case, which needs no instructions. } else { // The unconditional branch case. - TII.InsertBranch(*FuncInfo.MBB, MSucc, NULL, - SmallVector(), DL); + TII.InsertBranch(*MBB, MSucc, NULL, SmallVector(), DL); } - FuncInfo.MBB->addSuccessor(MSucc); + MBB->addSuccessor(MSucc); } /// SelectFNeg - Emit an FNeg operation. @@ -756,15 +727,11 @@ BasicBlock::iterator ScanFrom = LI; if (const Value *V = FindAvailableLoadedValue(LI->getPointerOperand(), LI->getParent(), ScanFrom)) { - if (!isa(V) || - cast(V)->getParent() == LI->getParent() || - (isa(V) && FuncInfo.StaticAllocaMap.count(cast(V)))) { unsigned ResultReg = getRegForValue(V); if (ResultReg != 0) { UpdateValueMap(I, ResultReg); return true; } - } } } @@ -887,7 +854,8 @@ } FastISel::FastISel(FunctionLoweringInfo &funcInfo) - : FuncInfo(funcInfo), + : MBB(0), + FuncInfo(funcInfo), MRI(FuncInfo.MF->getRegInfo()), MFI(*FuncInfo.MF->getFrameInfo()), MCP(*FuncInfo.MF->getConstantPool()), @@ -895,7 +863,8 @@ TD(*TM.getTargetData()), TII(*TM.getInstrInfo()), TLI(*TM.getTargetLowering()), - TRI(*TM.getRegisterInfo()) { + TRI(*TM.getRegisterInfo()), + IsBottomUp(false) { } FastISel::~FastISel() {} @@ -1024,7 +993,7 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg); + BuildMI(MBB, DL, II, ResultReg); return ResultReg; } @@ -1035,14 +1004,11 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) - .addReg(Op0, Op0IsKill * RegState::Kill); + BuildMI(MBB, DL, II, ResultReg).addReg(Op0, Op0IsKill * RegState::Kill); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) - .addReg(Op0, Op0IsKill * RegState::Kill); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + BuildMI(MBB, DL, II).addReg(Op0, Op0IsKill * RegState::Kill); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1058,16 +1024,15 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + BuildMI(MBB, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + BuildMI(MBB, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1082,16 +1047,15 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + BuildMI(MBB, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Imm); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + BuildMI(MBB, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Imm); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1106,16 +1070,15 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + BuildMI(MBB, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addFPImm(FPImm); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + BuildMI(MBB, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addFPImm(FPImm); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1131,18 +1094,17 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + BuildMI(MBB, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill) .addImm(Imm); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + BuildMI(MBB, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addReg(Op1, Op1IsKill * RegState::Kill) .addImm(Imm); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1156,12 +1118,11 @@ const TargetInstrDesc &II = TII.get(MachineInstOpcode); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg).addImm(Imm); + BuildMI(MBB, DL, II, ResultReg).addImm(Imm); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II).addImm(Imm); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + BuildMI(MBB, DL, II).addImm(Imm); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } @@ -1177,16 +1138,15 @@ const TargetInstrDesc &II = TII.get(TargetOpcode::EXTRACT_SUBREG); if (II.getNumDefs() >= 1) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg) + BuildMI(MBB, DL, II, ResultReg) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Idx); else { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II) + BuildMI(MBB, DL, II) .addReg(Op0, Op0IsKill * RegState::Kill) .addImm(Idx); - bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - ResultReg, II.ImplicitDefs[0], - RC, RC, DL); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC, DL); if (!InsertedCopy) ResultReg = 0; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Wed Jul 7 20:00:56 2010 @@ -78,13 +78,6 @@ MF = &mf; RegInfo = &MF->getRegInfo(); - // Check whether the function can return without sret-demotion. - SmallVector Outs; - GetReturnInfo(Fn->getReturnType(), - Fn->getAttributes().getRetAttributes(), Outs, TLI); - CanLowerReturn = TLI.CanLowerReturn(Fn->getCallingConv(), Fn->isVarArg(), - Outs, Fn->getContext()); - // Create a vreg for each argument register that is not dead and is used // outside of the entry block for the function. for (Function::const_arg_iterator AI = Fn->arg_begin(), E = Fn->arg_end(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Jul 7 20:00:56 2010 @@ -732,11 +732,8 @@ if (II.usesCustomInsertionHook()) { // Insert this instruction into the basic block using a target // specific inserter which may returns a new basic block. - MachineBasicBlock *NewMBB = TLI->EmitInstrWithCustomInserter(MI, MBB); - if (NewMBB != MBB) { - MBB = NewMBB; - InsertPos = NewMBB->end(); - } + MBB = TLI->EmitInstrWithCustomInserter(MI, MBB); + InsertPos = MBB->end(); return; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Jul 7 20:00:56 2010 @@ -951,16 +951,79 @@ // If this is an instruction which fast-isel has deferred, select it now. if (const Instruction *Inst = dyn_cast(V)) { - unsigned InReg = FuncInfo.InitializeRegForValue(Inst); - RegsForValue RFV(*DAG.getContext(), TLI, InReg, Inst->getType()); - SDValue Chain = DAG.getEntryNode(); - return RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL); + assert(Inst->isSafeToSpeculativelyExecute() && + "Instruction with side effects deferred!"); + visit(*Inst); + DenseMap::iterator NIt = NodeMap.find(Inst); + if (NIt != NodeMap.end() && NIt->second.getNode()) + return NIt->second; } llvm_unreachable("Can't get register for value!"); return SDValue(); } +/// Get the EVTs and ArgFlags collections that represent the legalized return +/// type of the given function. This does not require a DAG or a return value, +/// and is suitable for use before any DAGs for the function are constructed. +static void getReturnInfo(const Type* ReturnType, + Attributes attr, SmallVectorImpl &OutVTs, + SmallVectorImpl &OutFlags, + const TargetLowering &TLI, + SmallVectorImpl *Offsets = 0) { + SmallVector ValueVTs; + ComputeValueVTs(TLI, ReturnType, ValueVTs); + unsigned NumValues = ValueVTs.size(); + if (NumValues == 0) return; + unsigned Offset = 0; + + for (unsigned j = 0, f = NumValues; j != f; ++j) { + EVT VT = ValueVTs[j]; + ISD::NodeType ExtendKind = ISD::ANY_EXTEND; + + if (attr & Attribute::SExt) + ExtendKind = ISD::SIGN_EXTEND; + else if (attr & 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()) { + EVT MinVT = TLI.getRegisterType(ReturnType->getContext(), MVT::i32); + if (VT.bitsLT(MinVT)) + VT = MinVT; + } + + unsigned NumParts = TLI.getNumRegisters(ReturnType->getContext(), VT); + EVT PartVT = TLI.getRegisterType(ReturnType->getContext(), VT); + unsigned PartSize = TLI.getTargetData()->getTypeAllocSize( + PartVT.getTypeForEVT(ReturnType->getContext())); + + // 'inreg' on function refers to return value + ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy(); + if (attr & Attribute::InReg) + Flags.setInReg(); + + // Propagate extension type if any + if (attr & Attribute::SExt) + Flags.setSExt(); + else if (attr & Attribute::ZExt) + Flags.setZExt(); + + for (unsigned i = 0; i < NumParts; ++i) { + OutVTs.push_back(PartVT); + OutFlags.push_back(Flags); + if (Offsets) + { + Offsets->push_back(Offset); + Offset += PartSize; + } + } + } +} + void SelectionDAGBuilder::visitRet(const ReturnInst &I) { SDValue Chain = getControlRoot(); SmallVector Outs; @@ -1257,7 +1320,7 @@ } void SelectionDAGBuilder::visitBr(const BranchInst &I) { - MachineBasicBlock *BrMBB = FuncInfo.MBB; + MachineBasicBlock *BrMBB = FuncInfo.MBBMap[I.getParent()]; // Update machine-CFG edges. MachineBasicBlock *Succ0MBB = FuncInfo.MBBMap[I.getSuccessor(0)]; @@ -1583,7 +1646,7 @@ } void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) { - MachineBasicBlock *InvokeMBB = FuncInfo.MBB; + MachineBasicBlock *InvokeMBB = FuncInfo.MBBMap[I.getParent()]; // Retrieve successors. MachineBasicBlock *Return = FuncInfo.MBBMap[I.getSuccessor(0)]; @@ -2111,7 +2174,7 @@ } void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) { - MachineBasicBlock *SwitchMBB = FuncInfo.MBB; + MachineBasicBlock *SwitchMBB = FuncInfo.MBBMap[SI.getParent()]; // Figure out which block is immediately after the current one. MachineBasicBlock *NextBlock = 0; @@ -2177,7 +2240,7 @@ } void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) { - MachineBasicBlock *IndirectBrMBB = FuncInfo.MBB; + MachineBasicBlock *IndirectBrMBB = FuncInfo.MBBMap[I.getParent()]; // Update machine-CFG edges with unique successors. SmallVector succs; @@ -3837,7 +3900,7 @@ if (DV.isInlinedFnArgument(MF.getFunction())) return false; - MachineBasicBlock *MBB = FuncInfo.MBB; + MachineBasicBlock *MBB = FuncInfo.MBBMap[DI.getParent()]; if (MBB != &MF.front()) return false; @@ -4100,7 +4163,7 @@ } case Intrinsic::eh_exception: { // Insert the EXCEPTIONADDR instruction. - assert(FuncInfo.MBB->isLandingPad() && + assert(FuncInfo.MBBMap[I.getParent()]->isLandingPad() && "Call to eh.exception not in landing pad!"); SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); SDValue Ops[1]; @@ -4112,7 +4175,7 @@ } case Intrinsic::eh_selector: { - MachineBasicBlock *CallMBB = FuncInfo.MBB; + MachineBasicBlock *CallMBB = FuncInfo.MBBMap[I.getParent()]; MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI(); if (CallMBB->isLandingPad()) AddCatchInfo(I, &MMI, CallMBB); @@ -4122,7 +4185,7 @@ #endif // FIXME: Mark exception selector register as live in. Hack for PR1508. unsigned Reg = TLI.getExceptionSelectorRegister(); - if (Reg) FuncInfo.MBB->addLiveIn(Reg); + if (Reg) FuncInfo.MBBMap[I.getParent()]->addLiveIn(Reg); } // Insert the EHSELECTION instruction. @@ -4496,13 +4559,14 @@ Args.reserve(CS.arg_size()); // Check whether the function can return without sret-demotion. - SmallVector Outs; + SmallVector OutVTs; + SmallVector OutsFlags; SmallVector Offsets; - GetReturnInfo(RetTy, CS.getAttributes().getRetAttributes(), - Outs, TLI, &Offsets); + getReturnInfo(RetTy, CS.getAttributes().getRetAttributes(), + OutVTs, OutsFlags, TLI, &Offsets); bool CanLowerReturn = TLI.CanLowerReturn(CS.getCallingConv(), - FTy->isVarArg(), Outs, FTy->getContext()); + FTy->isVarArg(), OutVTs, OutsFlags, FTy->getContext()); SDValue DemoteStackSlot; @@ -4595,7 +4659,7 @@ ComputeValueVTs(TLI, PtrRetTy, PVTs); assert(PVTs.size() == 1 && "Pointers should fit in one register"); EVT PtrVT = PVTs[0]; - unsigned NumValues = Outs.size(); + unsigned NumValues = OutVTs.size(); SmallVector Values(NumValues); SmallVector Chains(NumValues); @@ -4603,7 +4667,7 @@ SDValue Add = DAG.getNode(ISD::ADD, getCurDebugLoc(), PtrVT, DemoteStackSlot, DAG.getConstant(Offsets[i], PtrVT)); - SDValue L = DAG.getLoad(Outs[i].VT, getCurDebugLoc(), Result.second, + SDValue L = DAG.getLoad(OutVTs[i], getCurDebugLoc(), Result.second, Add, NULL, Offsets[i], false, false, 1); Values[i] = L; Chains[i] = L.getValue(1); @@ -5895,10 +5959,15 @@ SmallVector Ins; // Check whether the function can return without sret-demotion. - SmallVector Outs; - GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), - Outs, TLI); - + SmallVector OutVTs; + SmallVector OutsFlags; + getReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), + OutVTs, OutsFlags, TLI); + + FuncInfo->CanLowerReturn = TLI.CanLowerReturn(F.getCallingConv(), + F.isVarArg(), + OutVTs, OutsFlags, + F.getContext()); if (!FuncInfo->CanLowerReturn) { // Put in an sret pointer parameter before all the other parameters. SmallVector ValueVTs; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jul 7 20:00:56 2010 @@ -319,8 +319,9 @@ return true; } -void -SelectionDAGISel::SelectBasicBlock(BasicBlock::const_iterator Begin, +MachineBasicBlock * +SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB, + BasicBlock::const_iterator Begin, BasicBlock::const_iterator End, bool &HadTailCall) { // Lower all of the non-terminator instructions. If a call is emitted @@ -335,7 +336,7 @@ SDB->clear(); // Final step, emit the lowered DAG as machine code. - CodeGenAndEmitDAG(); + return CodeGenAndEmitDAG(BB); } namespace { @@ -424,7 +425,7 @@ } while (!Worklist.empty()); } -void SelectionDAGISel::CodeGenAndEmitDAG() { +MachineBasicBlock *SelectionDAGISel::CodeGenAndEmitDAG(MachineBasicBlock *BB) { std::string GroupName; if (TimePassesIsEnabled) GroupName = "Instruction Selection and Scheduling"; @@ -433,7 +434,7 @@ ViewDAGCombine2 || ViewDAGCombineLT || ViewISelDAGs || ViewSchedDAGs || ViewSUnitDAGs) BlockName = MF->getFunction()->getNameStr() + ":" + - FuncInfo->MBB->getBasicBlock()->getNameStr(); + BB->getBasicBlock()->getNameStr(); DEBUG(dbgs() << "Initial selection DAG:\n"; CurDAG->dump()); @@ -540,7 +541,7 @@ { NamedRegionTimer T("Instruction Scheduling", GroupName, TimePassesIsEnabled); - Scheduler->Run(CurDAG, FuncInfo->MBB, FuncInfo->InsertPt); + Scheduler->Run(CurDAG, BB, BB->end()); } if (ViewSUnitDAGs) Scheduler->viewGraph(); @@ -549,8 +550,7 @@ // inserted into. { NamedRegionTimer T("Instruction Creation", GroupName, TimePassesIsEnabled); - FuncInfo->MBB = Scheduler->EmitSchedule(); - FuncInfo->InsertPt = Scheduler->InsertPos; + BB = Scheduler->EmitSchedule(); } // Free the scheduler state. @@ -562,6 +562,8 @@ // Free the SelectionDAG state, now that we're finished with it. CurDAG->clear(); + + return BB; } void SelectionDAGISel::DoInstructionSelection() { @@ -623,22 +625,21 @@ /// PrepareEHLandingPad - Emit an EH_LABEL, set up live-in registers, and /// do other setup for EH landing-pad blocks. -void SelectionDAGISel::PrepareEHLandingPad() { +void SelectionDAGISel::PrepareEHLandingPad(MachineBasicBlock *BB) { // Add a label to mark the beginning of the landing pad. Deletion of the // landing pad can thus be detected via the MachineModuleInfo. - MCSymbol *Label = MF->getMMI().addLandingPad(FuncInfo->MBB); + MCSymbol *Label = MF->getMMI().addLandingPad(BB); const TargetInstrDesc &II = TM.getInstrInfo()->get(TargetOpcode::EH_LABEL); - BuildMI(*FuncInfo->MBB, FuncInfo->InsertPt, SDB->getCurDebugLoc(), II) - .addSym(Label); + BuildMI(BB, SDB->getCurDebugLoc(), II).addSym(Label); // Mark exception register as live in. unsigned Reg = TLI.getExceptionAddressRegister(); - if (Reg) FuncInfo->MBB->addLiveIn(Reg); + if (Reg) BB->addLiveIn(Reg); // Mark exception selector register as live in. Reg = TLI.getExceptionSelectorRegister(); - if (Reg) FuncInfo->MBB->addLiveIn(Reg); + if (Reg) BB->addLiveIn(Reg); // FIXME: Hack around an exception handling flaw (PR1508): the personality // function and list of typeids logically belong to the invoke (or, if you @@ -651,7 +652,7 @@ // in exceptions not being caught because no typeids are associated with // the invoke. This may not be the only way things can go wrong, but it // is the only way we try to work around for the moment. - const BasicBlock *LLVMBB = FuncInfo->MBB->getBasicBlock(); + const BasicBlock *LLVMBB = BB->getBasicBlock(); const BranchInst *Br = dyn_cast(LLVMBB->getTerminator()); if (Br && Br->isUnconditional()) { // Critical edge? @@ -675,73 +676,80 @@ // Iterate over all basic blocks in the function. for (Function::const_iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) { const BasicBlock *LLVMBB = &*I; - FuncInfo->MBB = FuncInfo->MBBMap[LLVMBB]; - FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); + MachineBasicBlock *BB = FuncInfo->MBBMap[LLVMBB]; BasicBlock::const_iterator const Begin = LLVMBB->getFirstNonPHI(); BasicBlock::const_iterator const End = LLVMBB->end(); - BasicBlock::const_iterator BI = End; + BasicBlock::const_iterator BI = Begin; + + // Lower any arguments needed in this block if this is the entry block. + if (LLVMBB == &Fn.getEntryBlock()) + LowerArguments(LLVMBB); + // Setup an EH landing-pad block. + if (BB->isLandingPad()) + PrepareEHLandingPad(BB); + // Before doing SelectionDAG ISel, see if FastISel has been requested. if (FastIS) { - FastIS->startNewBlock(); - + // Emit code for any incoming arguments. This must happen before + // beginning FastISel on the entry block. + if (LLVMBB == &Fn.getEntryBlock()) { + CurDAG->setRoot(SDB->getControlRoot()); + SDB->clear(); + BB = CodeGenAndEmitDAG(BB); + } + FastIS->startNewBlock(BB); // Do FastISel on as many instructions as possible. - for (; BI != Begin; --BI) { - const Instruction *Inst = llvm::prior(BI); - - // If we no longer require this instruction, skip it. - if (!Inst->mayWriteToMemory() && - !isa(Inst) && - !isa(Inst) && - !FuncInfo->isExportedInst(Inst)) + for (; BI != End; ++BI) { +#if 0 + // Defer instructions with no side effects; they'll be emitted + // on-demand later. + if (BI->isSafeToSpeculativelyExecute() && + !FuncInfo->isExportedInst(BI)) continue; - - // Bottom-up: reset the insert pos at the top, after any local-value - // instructions. - MachineBasicBlock::iterator LVIP = FastIS->getLastLocalValue(); - if (LVIP != FuncInfo->MBB->end()) - FuncInfo->InsertPt = next(LVIP); - else - FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); +#endif // Try to select the instruction with FastISel. - if (FastIS->SelectInstruction(Inst)) + if (FastIS->SelectInstruction(BI)) continue; // Then handle certain instructions as single-LLVM-Instruction blocks. - if (isa(Inst)) { + if (isa(BI)) { ++NumFastIselFailures; if (EnableFastISelVerbose || EnableFastISelAbort) { dbgs() << "FastISel missed call: "; - Inst->dump(); + BI->dump(); } - if (!Inst->getType()->isVoidTy() && !Inst->use_empty()) { - unsigned &R = FuncInfo->ValueMap[Inst]; + if (!BI->getType()->isVoidTy() && !BI->use_empty()) { + unsigned &R = FuncInfo->ValueMap[BI]; if (!R) - R = FuncInfo->CreateRegs(Inst->getType()); + R = FuncInfo->CreateRegs(BI->getType()); } bool HadTailCall = false; - SelectBasicBlock(Inst, BI, HadTailCall); + BB = SelectBasicBlock(BB, BI, llvm::next(BI), HadTailCall); // If the call was emitted as a tail call, we're done with the block. if (HadTailCall) { - --BI; + BI = End; break; } + // If the instruction was codegen'd with multiple blocks, + // inform the FastISel object where to resume inserting. + FastIS->setCurrentBlock(BB); continue; } // Otherwise, give up on FastISel for the rest of the block. // For now, be a little lenient about non-branch terminators. - if (!isa(Inst) || isa(Inst)) { + if (!isa(BI) || isa(BI)) { ++NumFastIselFailures; if (EnableFastISelVerbose || EnableFastISelAbort) { dbgs() << "FastISel miss: "; - Inst->dump(); + BI->dump(); } if (EnableFastISelAbort) // The "fast" selector couldn't handle something and bailed. @@ -752,23 +760,15 @@ } } - FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); - - // Setup an EH landing-pad block. - if (FuncInfo->MBB->isLandingPad()) - PrepareEHLandingPad(); - - // Lower any arguments needed in this block if this is the entry block. - if (LLVMBB == &Fn.getEntryBlock()) - LowerArguments(LLVMBB); - // Run SelectionDAG instruction selection on the remainder of the block // not handled by FastISel. If FastISel is not run, this is the entire // block. - bool HadTailCall; - SelectBasicBlock(Begin, BI, HadTailCall); + if (BI != End) { + bool HadTailCall; + BB = SelectBasicBlock(BB, BI, End, HadTailCall); + } - FinishBasicBlock(); + FinishBasicBlock(BB); FuncInfo->PHINodesToUpdate.clear(); } @@ -776,7 +776,7 @@ } void -SelectionDAGISel::FinishBasicBlock() { +SelectionDAGISel::FinishBasicBlock(MachineBasicBlock *BB) { DEBUG(dbgs() << "Total amount of phi nodes to update: " << FuncInfo->PHINodesToUpdate.size() << "\n"; @@ -794,11 +794,11 @@ MachineInstr *PHI = FuncInfo->PHINodesToUpdate[i].first; assert(PHI->isPHI() && "This is not a machine PHI node that we are updating!"); - if (!FuncInfo->MBB->isSuccessor(PHI->getParent())) + if (!BB->isSuccessor(PHI->getParent())) continue; PHI->addOperand( MachineOperand::CreateReg(FuncInfo->PHINodesToUpdate[i].second, false)); - PHI->addOperand(MachineOperand::CreateMBB(FuncInfo->MBB)); + PHI->addOperand(MachineOperand::CreateMBB(BB)); } return; } @@ -807,35 +807,33 @@ // Lower header first, if it wasn't already lowered if (!SDB->BitTestCases[i].Emitted) { // Set the current basic block to the mbb we wish to insert the code into - FuncInfo->MBB = SDB->BitTestCases[i].Parent; - FuncInfo->InsertPt = FuncInfo->MBB->end(); + BB = SDB->BitTestCases[i].Parent; // Emit the code - SDB->visitBitTestHeader(SDB->BitTestCases[i], FuncInfo->MBB); + SDB->visitBitTestHeader(SDB->BitTestCases[i], BB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - CodeGenAndEmitDAG(); + BB = CodeGenAndEmitDAG(BB); } for (unsigned j = 0, ej = SDB->BitTestCases[i].Cases.size(); j != ej; ++j) { // Set the current basic block to the mbb we wish to insert the code into - FuncInfo->MBB = SDB->BitTestCases[i].Cases[j].ThisBB; - FuncInfo->InsertPt = FuncInfo->MBB->end(); + BB = SDB->BitTestCases[i].Cases[j].ThisBB; // Emit the code if (j+1 != ej) SDB->visitBitTestCase(SDB->BitTestCases[i].Cases[j+1].ThisBB, SDB->BitTestCases[i].Reg, SDB->BitTestCases[i].Cases[j], - FuncInfo->MBB); + BB); else SDB->visitBitTestCase(SDB->BitTestCases[i].Default, SDB->BitTestCases[i].Reg, SDB->BitTestCases[i].Cases[j], - FuncInfo->MBB); + BB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - CodeGenAndEmitDAG(); + BB = CodeGenAndEmitDAG(BB); } // Update PHI Nodes @@ -880,24 +878,22 @@ // Lower header first, if it wasn't already lowered if (!SDB->JTCases[i].first.Emitted) { // Set the current basic block to the mbb we wish to insert the code into - FuncInfo->MBB = SDB->JTCases[i].first.HeaderBB; - FuncInfo->InsertPt = FuncInfo->MBB->end(); + BB = SDB->JTCases[i].first.HeaderBB; // Emit the code SDB->visitJumpTableHeader(SDB->JTCases[i].second, SDB->JTCases[i].first, - FuncInfo->MBB); + BB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - CodeGenAndEmitDAG(); + BB = CodeGenAndEmitDAG(BB); } // Set the current basic block to the mbb we wish to insert the code into - FuncInfo->MBB = SDB->JTCases[i].second.MBB; - FuncInfo->InsertPt = FuncInfo->MBB->end(); + BB = SDB->JTCases[i].second.MBB; // Emit the code SDB->visitJumpTable(SDB->JTCases[i].second); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - CodeGenAndEmitDAG(); + BB = CodeGenAndEmitDAG(BB); // Update PHI Nodes for (unsigned pi = 0, pe = FuncInfo->PHINodesToUpdate.size(); @@ -915,11 +911,11 @@ (MachineOperand::CreateMBB(SDB->JTCases[i].first.HeaderBB)); } // JT BB. Just iterate over successors here - if (FuncInfo->MBB->isSuccessor(PHIBB)) { + if (BB->isSuccessor(PHIBB)) { PHI->addOperand (MachineOperand::CreateReg(FuncInfo->PHINodesToUpdate[pi].second, false)); - PHI->addOperand(MachineOperand::CreateMBB(FuncInfo->MBB)); + PHI->addOperand(MachineOperand::CreateMBB(BB)); } } } @@ -931,10 +927,10 @@ MachineInstr *PHI = FuncInfo->PHINodesToUpdate[i].first; assert(PHI->isPHI() && "This is not a machine PHI node that we are updating!"); - if (FuncInfo->MBB->isSuccessor(PHI->getParent())) { + if (BB->isSuccessor(PHI->getParent())) { PHI->addOperand( MachineOperand::CreateReg(FuncInfo->PHINodesToUpdate[i].second, false)); - PHI->addOperand(MachineOperand::CreateMBB(FuncInfo->MBB)); + PHI->addOperand(MachineOperand::CreateMBB(BB)); } } @@ -942,8 +938,7 @@ // additional DAGs necessary. for (unsigned i = 0, e = SDB->SwitchCases.size(); i != e; ++i) { // Set the current basic block to the mbb we wish to insert the code into - MachineBasicBlock *ThisBB = FuncInfo->MBB = SDB->SwitchCases[i].ThisBB; - FuncInfo->InsertPt = FuncInfo->MBB->end(); + MachineBasicBlock *ThisBB = BB = SDB->SwitchCases[i].ThisBB; // Determine the unique successors. SmallVector Succs; @@ -953,24 +948,21 @@ // Emit the code. Note that this could result in ThisBB being split, so // we need to check for updates. - SDB->visitSwitchCase(SDB->SwitchCases[i], FuncInfo->MBB); + SDB->visitSwitchCase(SDB->SwitchCases[i], BB); CurDAG->setRoot(SDB->getRoot()); SDB->clear(); - CodeGenAndEmitDAG(); - ThisBB = FuncInfo->MBB; + ThisBB = CodeGenAndEmitDAG(BB); // Handle any PHI nodes in successors of this chunk, as if we were coming // from the original BB before switch expansion. Note that PHI nodes can // occur multiple times in PHINodesToUpdate. We have to be very careful to // handle them the right number of times. for (unsigned i = 0, e = Succs.size(); i != e; ++i) { - FuncInfo->MBB = Succs[i]; - FuncInfo->InsertPt = FuncInfo->MBB->end(); - // FuncInfo->MBB may have been removed from the CFG if a branch was - // constant folded. - if (ThisBB->isSuccessor(FuncInfo->MBB)) { - for (MachineBasicBlock::iterator Phi = FuncInfo->MBB->begin(); - Phi != FuncInfo->MBB->end() && Phi->isPHI(); + BB = Succs[i]; + // BB may have been removed from the CFG if a branch was constant folded. + if (ThisBB->isSuccessor(BB)) { + for (MachineBasicBlock::iterator Phi = BB->begin(); + Phi != BB->end() && Phi->isPHI(); ++Phi) { // This value for this PHI node is recorded in PHINodesToUpdate. for (unsigned pn = 0; ; ++pn) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jul 7 20:00:56 2010 @@ -20,7 +20,6 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/GlobalVariable.h" #include "llvm/DerivedTypes.h" -#include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineFunction.h" @@ -839,65 +838,6 @@ return 1; } -/// Get the EVTs and ArgFlags collections that represent the legalized return -/// type of the given function. This does not require a DAG or a return value, -/// and is suitable for use before any DAGs for the function are constructed. -/// TODO: Move this out of TargetLowering.cpp. -void llvm::GetReturnInfo(const Type* ReturnType, Attributes attr, - SmallVectorImpl &Outs, - const TargetLowering &TLI, - SmallVectorImpl *Offsets) { - SmallVector ValueVTs; - ComputeValueVTs(TLI, ReturnType, ValueVTs); - unsigned NumValues = ValueVTs.size(); - if (NumValues == 0) return; - unsigned Offset = 0; - - for (unsigned j = 0, f = NumValues; j != f; ++j) { - EVT VT = ValueVTs[j]; - ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - - if (attr & Attribute::SExt) - ExtendKind = ISD::SIGN_EXTEND; - else if (attr & 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()) { - EVT MinVT = TLI.getRegisterType(ReturnType->getContext(), MVT::i32); - if (VT.bitsLT(MinVT)) - VT = MinVT; - } - - unsigned NumParts = TLI.getNumRegisters(ReturnType->getContext(), VT); - EVT PartVT = TLI.getRegisterType(ReturnType->getContext(), VT); - unsigned PartSize = TLI.getTargetData()->getTypeAllocSize( - PartVT.getTypeForEVT(ReturnType->getContext())); - - // 'inreg' on function refers to return value - ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy(); - if (attr & Attribute::InReg) - Flags.setInReg(); - - // Propagate extension type if any - if (attr & Attribute::SExt) - Flags.setSExt(); - else if (attr & Attribute::ZExt) - Flags.setZExt(); - - for (unsigned i = 0; i < NumParts; ++i) { - Outs.push_back(ISD::OutputArg(Flags, PartVT, /*isFixed=*/true)); - if (Offsets) { - Offsets->push_back(Offset); - Offset += PartSize; - } - } - } -} - /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate /// function arguments in the caller parameter area. This is the actual /// alignment, not its logarithm. Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 7 20:00:56 2010 @@ -23,7 +23,6 @@ #include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" -#include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/MachineConstantPool.h" @@ -85,8 +84,6 @@ bool X86SelectStore(const Instruction *I); - bool X86SelectRet(const Instruction *I); - bool X86SelectCmp(const Instruction *I); bool X86SelectZExt(const Instruction *I); @@ -108,7 +105,6 @@ bool X86SelectCall(const Instruction *I); CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool isTailCall = false); - CCAssignFn *CCAssignFnForRet(CallingConv::ID CC, bool isTailCall = false); const X86InstrInfo *getInstrInfo() const { return getTargetMachine()->getInstrInfo(); @@ -182,20 +178,6 @@ return CC_X86_32_C; } -/// CCAssignFnForRet - Selects the correct CCAssignFn for a given calling -/// convention. -CCAssignFn *X86FastISel::CCAssignFnForRet(CallingConv::ID CC, - bool isTaillCall) { - if (Subtarget->is64Bit()) { - if (Subtarget->isTargetWin64()) - return RetCC_X86_Win64_C; - else - return RetCC_X86_64_C; - } - - return RetCC_X86_32_C; -} - /// X86FastEmitLoad - Emit a machine instruction to load a value of type VT. /// The address is either pre-computed, i.e. Ptr, or a GlobalAddress, i.e. GV. /// Return true and the result register by reference if it is possible. @@ -248,8 +230,7 @@ } ResultReg = createResultReg(RC); - addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, - DL, TII.get(Opc), ResultReg), AM); + addFullAddress(BuildMI(MBB, DL, TII.get(Opc), ResultReg), AM); return true; } @@ -268,7 +249,7 @@ case MVT::i1: { // Mask out all but lowest bit. unsigned AndResult = createResultReg(X86::GR8RegisterClass); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + BuildMI(MBB, DL, TII.get(X86::AND8ri), AndResult).addReg(Val).addImm(1); Val = AndResult; } @@ -285,8 +266,7 @@ break; } - addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, - DL, TII.get(Opc)), AM).addReg(Val); + addFullAddress(BuildMI(MBB, DL, TII.get(Opc)), AM).addReg(Val); return true; } @@ -314,8 +294,7 @@ } if (Opc) { - addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, - DL, TII.get(Opc)), AM) + addFullAddress(BuildMI(MBB, DL, TII.get(Opc)), AM) .addImm(Signed ? (uint64_t) CI->getSExtValue() : CI->getZExtValue()); return true; @@ -354,7 +333,7 @@ // Don't walk into other basic blocks; it's possible we haven't // visited them yet, so the instructions may not yet be assigned // virtual registers. - if (FuncInfo.MBBMap[I->getParent()] != FuncInfo.MBB) + if (FuncInfo.MBBMap[I->getParent()] != MBB) return false; Opcode = I->getOpcode(); @@ -551,8 +530,7 @@ } LoadReg = createResultReg(RC); - addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, - DL, TII.get(Opc), LoadReg), StubAM); + addFullAddress(BuildMI(MBB, DL, TII.get(Opc), LoadReg), StubAM); // Prevent loading GV stub multiple times in same MBB. LocalValueMap[V] = LoadReg; @@ -678,72 +656,6 @@ return X86FastEmitStore(VT, I->getOperand(0), AM); } -/// X86SelectRet - Select and emit code to implement ret instructions. -bool X86FastISel::X86SelectRet(const Instruction *I) { - const ReturnInst *Ret = cast(I); - const Function &F = *I->getParent()->getParent(); - - if (!FuncInfo.CanLowerReturn) - return false; - - CallingConv::ID CC = F.getCallingConv(); - if (CC != CallingConv::C && - CC != CallingConv::Fast && - CC != CallingConv::X86_FastCall) - return false; - - if (Subtarget->isTargetWin64()) - return false; - - // fastcc with -tailcallopt is intended to provide a guaranteed - // tail call optimization. Fastisel doesn't know how to do that. - if (CC == CallingConv::Fast && GuaranteedTailCallOpt) - return false; - - // Let SDISel handle vararg functions. - if (F.isVarArg()) - return false; - - if (Ret->getNumOperands() > 0) { - SmallVector Outs; - GetReturnInfo(F.getReturnType(), F.getAttributes().getRetAttributes(), - Outs, TLI); - - // Analyze operands of the call, assigning locations to each operand. - SmallVector ValLocs; - CCState CCInfo(CC, F.isVarArg(), TM, ValLocs, I->getContext()); - CCInfo.AnalyzeReturn(Outs, CCAssignFnForRet(CC)); - - const Value *RV = Ret->getOperand(0); - unsigned Reg = getRegForValue(RV); - if (Reg == 0) - return false; - - // Copy the return value into registers. - for (unsigned i = 0, e = ValLocs.size(); i != e; ++i) { - CCValAssign &VA = ValLocs[i]; - - // Don't bother handling odd stuff for now. - if (VA.getLocInfo() != CCValAssign::Full) - return false; - if (!VA.isRegLoc()) - return false; - - TargetRegisterClass* RC = TLI.getRegClassFor(VA.getValVT()); - bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - VA.getLocReg(), Reg + VA.getValNo(), - RC, RC, DL); - assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; - - MRI.addLiveOut(VA.getLocReg()); - } - } - - // Now emit the RET. - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::RET)); - return true; -} - /// X86SelectLoad - Select and emit code to implement load instructions. /// bool X86FastISel::X86SelectLoad(const Instruction *I) { @@ -808,9 +720,8 @@ // CMPri, otherwise use CMPrr. if (const ConstantInt *Op1C = dyn_cast(Op1)) { if (unsigned CompareImmOpc = X86ChooseCmpImmediateOpcode(VT, Op1C)) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CompareImmOpc)) - .addReg(Op0Reg) - .addImm(Op1C->getSExtValue()); + BuildMI(MBB, DL, TII.get(CompareImmOpc)).addReg(Op0Reg) + .addImm(Op1C->getSExtValue()); return true; } } @@ -820,9 +731,7 @@ unsigned Op1Reg = getRegForValue(Op1); if (Op1Reg == 0) return false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CompareOpc)) - .addReg(Op0Reg) - .addReg(Op1Reg); + BuildMI(MBB, DL, TII.get(CompareOpc)).addReg(Op0Reg).addReg(Op1Reg); return true; } @@ -844,10 +753,9 @@ unsigned EReg = createResultReg(&X86::GR8RegClass); unsigned NPReg = createResultReg(&X86::GR8RegClass); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::SETEr), EReg); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(X86::SETNPr), NPReg); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + BuildMI(MBB, DL, TII.get(X86::SETEr), EReg); + BuildMI(MBB, DL, TII.get(X86::SETNPr), NPReg); + BuildMI(MBB, DL, TII.get(X86::AND8rr), ResultReg).addReg(NPReg).addReg(EReg); UpdateValueMap(I, ResultReg); return true; @@ -858,13 +766,9 @@ unsigned NEReg = createResultReg(&X86::GR8RegClass); unsigned PReg = createResultReg(&X86::GR8RegClass); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(X86::SETNEr), NEReg); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(X86::SETPr), PReg); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(X86::OR8rr), ResultReg) - .addReg(PReg).addReg(NEReg); + BuildMI(MBB, DL, TII.get(X86::SETNEr), NEReg); + BuildMI(MBB, DL, TII.get(X86::SETPr), PReg); + BuildMI(MBB, DL, TII.get(X86::OR8rr), ResultReg).addReg(PReg).addReg(NEReg); UpdateValueMap(I, ResultReg); return true; } @@ -903,7 +807,7 @@ if (!X86FastEmitCompare(Op0, Op1, VT)) return false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(SetCCOpc), ResultReg); + BuildMI(MBB, DL, TII.get(SetCCOpc), ResultReg); UpdateValueMap(I, ResultReg); return true; } @@ -939,7 +843,7 @@ // Try to take advantage of fallthrough opportunities. CmpInst::Predicate Predicate = CI->getPredicate(); - if (FuncInfo.MBB->isLayoutSuccessor(TrueMBB)) { + if (MBB->isLayoutSuccessor(TrueMBB)) { std::swap(TrueMBB, FalseMBB); Predicate = CmpInst::getInversePredicate(Predicate); } @@ -988,18 +892,16 @@ if (!X86FastEmitCompare(Op0, Op1, VT)) return false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(BranchOpc)) - .addMBB(TrueMBB); + BuildMI(MBB, DL, TII.get(BranchOpc)).addMBB(TrueMBB); if (Predicate == CmpInst::FCMP_UNE) { // X86 requires a second branch to handle UNE (and OEQ, // which is mapped to UNE above). - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::JP_4)) - .addMBB(TrueMBB); + BuildMI(MBB, DL, TII.get(X86::JP_4)).addMBB(TrueMBB); } FastEmitBranch(FalseMBB, DL); - FuncInfo.MBB->addSuccessor(TrueMBB); + MBB->addSuccessor(TrueMBB); return true; } } else if (ExtractValueInst *EI = @@ -1025,8 +927,7 @@ unsigned Reg = getRegForValue(EI); for (MachineBasicBlock::const_reverse_iterator - RI = FuncInfo.MBB->rbegin(), RE = FuncInfo.MBB->rend(); - RI != RE; ++RI) { + RI = MBB->rbegin(), RE = MBB->rend(); RI != RE; ++RI) { const MachineInstr &MI = *RI; if (MI.definesRegister(Reg)) { @@ -1051,11 +952,11 @@ unsigned OpCode = SetMI->getOpcode(); if (OpCode == X86::SETOr || OpCode == X86::SETBr) { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(OpCode == X86::SETOr ? X86::JO_4 : X86::JB_4)) + BuildMI(MBB, DL, TII.get(OpCode == X86::SETOr ? + X86::JO_4 : X86::JB_4)) .addMBB(TrueMBB); FastEmitBranch(FalseMBB, DL); - FuncInfo.MBB->addSuccessor(TrueMBB); + MBB->addSuccessor(TrueMBB); return true; } } @@ -1067,12 +968,10 @@ unsigned OpReg = getRegForValue(BI->getCondition()); if (OpReg == 0) return false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TEST8rr)) - .addReg(OpReg).addReg(OpReg); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::JNE_4)) - .addMBB(TrueMBB); + BuildMI(MBB, DL, TII.get(X86::TEST8rr)).addReg(OpReg).addReg(OpReg); + BuildMI(MBB, DL, TII.get(X86::JNE_4)).addMBB(TrueMBB); FastEmitBranch(FalseMBB, DL); - FuncInfo.MBB->addSuccessor(TrueMBB); + MBB->addSuccessor(TrueMBB); return true; } @@ -1129,7 +1028,7 @@ // Fold immediate in shl(x,3). if (const ConstantInt *CI = dyn_cast(I->getOperand(1))) { unsigned ResultReg = createResultReg(RC); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpImm), + BuildMI(MBB, DL, TII.get(OpImm), ResultReg).addReg(Op0Reg).addImm(CI->getZExtValue() & 0xff); UpdateValueMap(I, ResultReg); return true; @@ -1137,20 +1036,17 @@ unsigned Op1Reg = getRegForValue(I->getOperand(1)); if (Op1Reg == 0) return false; - TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - CReg, Op1Reg, RC, RC, DL); + TII.copyRegToReg(*MBB, MBB->end(), CReg, Op1Reg, RC, RC, DL); // The shift instruction uses X86::CL. If we defined a super-register // of X86::CL, emit an EXTRACT_SUBREG to precisely describe what // we're doing here. if (CReg != X86::CL) - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(TargetOpcode::EXTRACT_SUBREG), X86::CL) + BuildMI(MBB, DL, TII.get(TargetOpcode::EXTRACT_SUBREG), X86::CL) .addReg(CReg).addImm(X86::sub_8bit); unsigned ResultReg = createResultReg(RC); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpReg), ResultReg) - .addReg(Op0Reg); + BuildMI(MBB, DL, TII.get(OpReg), ResultReg).addReg(Op0Reg); UpdateValueMap(I, ResultReg); return true; } @@ -1182,11 +1078,9 @@ unsigned Op2Reg = getRegForValue(I->getOperand(2)); if (Op2Reg == 0) return false; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TEST8rr)) - .addReg(Op0Reg).addReg(Op0Reg); + BuildMI(MBB, DL, TII.get(X86::TEST8rr)).addReg(Op0Reg).addReg(Op0Reg); unsigned ResultReg = createResultReg(RC); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), ResultReg) - .addReg(Op1Reg).addReg(Op2Reg); + BuildMI(MBB, DL, TII.get(Opc), ResultReg).addReg(Op1Reg).addReg(Op2Reg); UpdateValueMap(I, ResultReg); return true; } @@ -1200,9 +1094,7 @@ unsigned OpReg = getRegForValue(V); if (OpReg == 0) return false; unsigned ResultReg = createResultReg(X86::FR64RegisterClass); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(X86::CVTSS2SDrr), ResultReg) - .addReg(OpReg); + BuildMI(MBB, DL, TII.get(X86::CVTSS2SDrr), ResultReg).addReg(OpReg); UpdateValueMap(I, ResultReg); return true; } @@ -1219,9 +1111,7 @@ unsigned OpReg = getRegForValue(V); if (OpReg == 0) return false; unsigned ResultReg = createResultReg(X86::FR32RegisterClass); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(X86::CVTSD2SSrr), ResultReg) - .addReg(OpReg); + BuildMI(MBB, DL, TII.get(X86::CVTSD2SSrr), ResultReg).addReg(OpReg); UpdateValueMap(I, ResultReg); return true; } @@ -1256,8 +1146,7 @@ const TargetRegisterClass *CopyRC = (SrcVT == MVT::i16) ? X86::GR16_ABCDRegisterClass : X86::GR32_ABCDRegisterClass; unsigned CopyReg = createResultReg(CopyRC); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CopyOpc), CopyReg) - .addReg(InputReg); + BuildMI(MBB, DL, TII.get(CopyOpc), CopyReg).addReg(InputReg); // Then issue an extract_subreg. unsigned ResultReg = FastEmitInst_extractsubreg(MVT::i8, @@ -1278,18 +1167,14 @@ switch (CI->getIntrinsicID()) { default: break; case Intrinsic::sadd_with_overflow: - case Intrinsic::uadd_with_overflow: { + case Intrinsic::uadd_with_overflow: // Cheat a little. We know that the registers for "add" and "seto" are // allocated sequentially. However, we only keep track of the register // for "add" in the value map. Use extractvalue's index to get the // correct register for "seto". - unsigned OpReg = getRegForValue(Agg); - if (OpReg == 0) - return false; - UpdateValueMap(I, OpReg + *EI->idx_begin()); + UpdateValueMap(I, lookUpRegForValue(Agg) + *EI->idx_begin()); return true; } - } } return false; @@ -1333,7 +1218,7 @@ return false; unsigned ResultReg = createResultReg(TLI.getRegClassFor(VT)); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpC), ResultReg). + BuildMI(MBB, DL, TII.get(OpC), ResultReg). addImm(CI->isZero() ? -1ULL : 0); UpdateValueMap(&I, ResultReg); return true; @@ -1347,12 +1232,12 @@ const TargetInstrDesc &II = TII.get(TargetOpcode::DBG_VALUE); // FIXME may need to add RegState::Debug to any registers produced, // although ESP/EBP should be the only ones at the moment. - addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II), AM). - addImm(0).addMetadata(DI->getVariable()); + addFullAddress(BuildMI(MBB, DL, II), AM).addImm(0). + addMetadata(DI->getVariable()); return true; } case Intrinsic::trap: { - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TRAP)); + BuildMI(MBB, DL, TII.get(X86::TRAP)); return true; } case Intrinsic::sadd_with_overflow: @@ -1388,8 +1273,7 @@ return false; unsigned ResultReg = createResultReg(TLI.getRegClassFor(VT)); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpC), ResultReg) - .addReg(Reg1).addReg(Reg2); + BuildMI(MBB, DL, TII.get(OpC), ResultReg).addReg(Reg1).addReg(Reg2); unsigned DestReg1 = UpdateValueMap(&I, ResultReg); // If the add with overflow is an intra-block value then we just want to @@ -1407,7 +1291,7 @@ unsigned Opc = X86::SETBr; if (I.getIntrinsicID() == Intrinsic::sadd_with_overflow) Opc = X86::SETOr; - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), ResultReg); + BuildMI(MBB, DL, TII.get(Opc), ResultReg); return true; } } @@ -1534,8 +1418,7 @@ // Issue CALLSEQ_START unsigned AdjStackDown = TM.getRegisterInfo()->getCallFrameSetupOpcode(); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(AdjStackDown)) - .addImm(NumBytes); + BuildMI(MBB, DL, TII.get(AdjStackDown)).addImm(NumBytes); // Process argument: walk the register/memloc assignments, inserting // copies / loads. @@ -1591,8 +1474,8 @@ if (VA.isRegLoc()) { TargetRegisterClass* RC = TLI.getRegClassFor(ArgVT); - bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - VA.getLocReg(), Arg, RC, RC, DL); + bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), VA.getLocReg(), + Arg, RC, RC, DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; Emitted = true; RegArgs.push_back(VA.getLocReg()); @@ -1618,8 +1501,8 @@ if (Subtarget->isPICStyleGOT()) { TargetRegisterClass *RC = X86::GR32RegisterClass; unsigned Base = getInstrInfo()->getGlobalBaseReg(FuncInfo.MF); - bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, - X86::EBX, Base, RC, RC, DL); + bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), X86::EBX, Base, RC, RC, + DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; Emitted = true; } @@ -1629,8 +1512,7 @@ if (CalleeOp) { // Register-indirect call. unsigned CallOpc = Subtarget->is64Bit() ? X86::CALL64r : X86::CALL32r; - MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc)) - .addReg(CalleeOp); + MIB = BuildMI(MBB, DL, TII.get(CallOpc)).addReg(CalleeOp); } else { // Direct call. @@ -1659,8 +1541,7 @@ } - MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc)) - .addGlobalAddress(GV, 0, OpFlags); + MIB = BuildMI(MBB, DL, TII.get(CallOpc)).addGlobalAddress(GV, 0, OpFlags); } // Add an implicit use GOT pointer in EBX. @@ -1673,8 +1554,7 @@ // Issue CALLSEQ_END unsigned AdjStackUp = TM.getRegisterInfo()->getCallFrameDestroyOpcode(); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(AdjStackUp)) - .addImm(NumBytes).addImm(0); + BuildMI(MBB, DL, TII.get(AdjStackUp)).addImm(NumBytes).addImm(0); // Now handle call return value (if any). SmallVector UsedRegs; @@ -1701,7 +1581,7 @@ } unsigned ResultReg = createResultReg(DstRC); - bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, ResultReg, + bool Emitted = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, RVLocs[0].getLocReg(), DstRC, SrcRC, DL); assert(Emitted && "Failed to emit a copy instruction!"); Emitted=Emitted; Emitted = true; @@ -1715,21 +1595,18 @@ unsigned Opc = ResVT == MVT::f32 ? X86::ST_Fp80m32 : X86::ST_Fp80m64; unsigned MemSize = ResVT.getSizeInBits()/8; int FI = MFI.CreateStackObject(MemSize, MemSize, false); - addFrameReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(Opc)), FI) - .addReg(ResultReg); + addFrameReference(BuildMI(MBB, DL, TII.get(Opc)), FI).addReg(ResultReg); DstRC = ResVT == MVT::f32 ? X86::FR32RegisterClass : X86::FR64RegisterClass; Opc = ResVT == MVT::f32 ? X86::MOVSSrm : X86::MOVSDrm; ResultReg = createResultReg(DstRC); - addFrameReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(Opc), ResultReg), FI); + addFrameReference(BuildMI(MBB, DL, TII.get(Opc), ResultReg), FI); } if (AndToI1) { // Mask out all but lowest bit for some call which produces an i1. unsigned AndResult = createResultReg(X86::GR8RegisterClass); - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, + BuildMI(MBB, DL, TII.get(X86::AND8ri), AndResult).addReg(ResultReg).addImm(1); ResultReg = AndResult; } @@ -1752,8 +1629,6 @@ return X86SelectLoad(I); case Instruction::Store: return X86SelectStore(I); - case Instruction::Ret: - return X86SelectRet(I); case Instruction::ICmp: case Instruction::FCmp: return X86SelectCmp(I); @@ -1854,8 +1729,7 @@ else Opc = X86::LEA64r; unsigned ResultReg = createResultReg(RC); - addLeaAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(Opc), ResultReg), AM); + addLeaAddress(BuildMI(MBB, DL, TII.get(Opc), ResultReg), AM); return ResultReg; } return 0; @@ -1885,8 +1759,7 @@ // Create the load from the constant pool. unsigned MCPOffset = MCP.getConstantPoolIndex(C, Align); unsigned ResultReg = createResultReg(RC); - addConstantPoolReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(Opc), ResultReg), + addConstantPoolReference(BuildMI(MBB, DL, TII.get(Opc), ResultReg), MCPOffset, PICBase, OpFlag); return ResultReg; @@ -1909,8 +1782,7 @@ unsigned Opc = Subtarget->is64Bit() ? X86::LEA64r : X86::LEA32r; TargetRegisterClass* RC = TLI.getRegClassFor(TLI.getPointerTy()); unsigned ResultReg = createResultReg(RC); - addLeaAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, - TII.get(Opc), ResultReg), AM); + addLeaAddress(BuildMI(MBB, DL, TII.get(Opc), ResultReg), AM); return ResultReg; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jul 7 20:00:56 2010 @@ -1218,12 +1218,13 @@ bool X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &Outs, + const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, LLVMContext &Context) const { SmallVector RVLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs, Context); - return CCInfo.CheckReturn(Outs, RetCC_X86); + return CCInfo.CheckReturn(OutTys, ArgsFlags, RetCC_X86); } SDValue Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jul 7 20:00:56 2010 @@ -740,7 +740,8 @@ virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &Outs, + const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, LLVMContext &Context) const; void ReplaceATOMIC_BINARY_64(SDNode *N, SmallVectorImpl &Results, Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Wed Jul 7 20:00:56 2010 @@ -1135,12 +1135,13 @@ bool XCoreTargetLowering:: CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &Outs, + const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, LLVMContext &Context) const { SmallVector RVLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs, Context); - return CCInfo.CheckReturn(Outs, RetCC_XCore); + return CCInfo.CheckReturn(OutTys, ArgsFlags, RetCC_XCore); } SDValue Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.h?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.h (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.h Wed Jul 7 20:00:56 2010 @@ -193,7 +193,8 @@ virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg, - const SmallVectorImpl &ArgsFlags, + const SmallVectorImpl &OutTys, + const SmallVectorImpl &ArgsFlags, LLVMContext &Context) const; }; } Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll Wed Jul 7 20:00:56 2010 @@ -14,7 +14,8 @@ ; X64: test1: ; X64: movslq %edi, %rax -; X64: movl (%rsi,%rax,4), %e +; X64: movl (%rsi,%rax,4), %eax +; X64: ret } define i32 @test2(i64 %t3, i32* %t1) nounwind { Modified: llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-loads.ll Wed Jul 7 20:00:56 2010 @@ -5,7 +5,7 @@ ; CHECK: foo: ; CHECK-NEXT: movq %rdi, -8(%rsp) ; CHECK-NEXT: movq %rsi, -16(%rsp) -; CHECK-NEXT: movsd 128(%rsi,%rdi,8), %xmm0 +; CHECK: movsd 128(%rsi,%rdi,8), %xmm0 ; CHECK-NEXT: ret define double @foo(i64 %x, double* %p) nounwind { Modified: llvm/trunk/test/CodeGen/X86/fast-isel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel.ll?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel.ll Wed Jul 7 20:00:56 2010 @@ -49,10 +49,9 @@ ret i32 %tmp2 } -define void @ptrtoint_i1(i8* %p, i1* %q) nounwind { +define i1 @ptrtoint_i1(i8* %p) nounwind { %t = ptrtoint i8* %p to i1 - store i1 %t, i1* %q - ret void + ret i1 %t } define i8* @inttoptr_i1(i1 %p) nounwind { %t = inttoptr i1 %p to i8* @@ -87,8 +86,11 @@ ret i8 %tmp } -define void @load_store_i1(i1* %p, i1* %q) nounwind { - %t = load i1* %p - store i1 %t, i1* %q +define void @store_i1(i1* %p, i1 %t) nounwind { + store i1 %t, i1* %p ret void } +define i1 @load_i1(i1* %p) nounwind { + %t = load i1* %p + ret i1 %t +} Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=107850&r1=107849&r2=107850&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Wed Jul 7 20:00:56 2010 @@ -432,7 +432,7 @@ for (unsigned i = 0; i < Memo.PhysRegs->size(); ++i) { if ((*Memo.PhysRegs)[i] != "") - OS << " TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, " + OS << " TII.copyRegToReg(*MBB, MBB->end(), " << (*Memo.PhysRegs)[i] << ", Op" << i << ", " << "TM.getRegisterInfo()->getPhysicalRegisterRegClass(" << (*Memo.PhysRegs)[i] << "), " @@ -526,7 +526,7 @@ for (unsigned i = 0; i < Memo.PhysRegs->size(); ++i) { if ((*Memo.PhysRegs)[i] != "") - OS << " TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt, " + OS << " TII.copyRegToReg(*MBB, MBB->end(), " << (*Memo.PhysRegs)[i] << ", Op" << i << ", " << "TM.getRegisterInfo()->getPhysicalRegisterRegClass(" << (*Memo.PhysRegs)[i] << "), " From dalej at apple.com Wed Jul 7 20:18:24 2010 From: dalej at apple.com (Dale Johannesen) Date: Thu, 08 Jul 2010 01:18:24 -0000 Subject: [llvm-commits] [llvm] r107851 - in /llvm/trunk: lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMInstrInfo.td test/CodeGen/ARM/call-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll utils/TableGen/ARMDecoderEmitter.cpp Message-ID: <20100708011824.2CC2D2A6C12C@llvm.org> Author: johannes Date: Wed Jul 7 20:18:23 2010 New Revision: 107851 URL: http://llvm.org/viewvc/llvm-project?rev=107851&view=rev Log: Changes to ARM tail calls, mostly cosmetic. Add explicit testcases for tail calls within the same module. Duplicate some code to humor those who think .w doesn't apply on ARM. Leave this disabled on Thumb1, and add some comments explaining why it's hard and won't gain much. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/test/CodeGen/ARM/call-tc.ll llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=107851&r1=107850&r2=107851&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Jul 7 20:18:23 2010 @@ -1663,7 +1663,8 @@ // Jump to label or value in register. if (RetOpcode == ARM::TCRETURNdi) { - BuildMI(MBB, MBBI, dl, TII.get(ARM::TAILJMPd)). + BuildMI(MBB, MBBI, dl, + TII.get(STI.isThumb() ? ARM::TAILJMPdt : ARM::TAILJMPd)). addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset(), JumpTarget.getTargetFlags()); } else if (RetOpcode == ARM::TCRETURNdiND) { Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107851&r1=107850&r2=107851&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 20:18:23 2010 @@ -1338,13 +1338,7 @@ if (!TII->isLoadFromStackSlot(Def, FI)) return false; } else { -// unsigned Opcode = Def->getOpcode(); -// if ((Opcode == X86::LEA32r || Opcode == X86::LEA64r) && -// Def->getOperand(1).isFI()) { -// FI = Def->getOperand(1).getIndex(); -// Bytes = Flags.getByValSize(); -// } else - return false; + return false; } } else if (LoadSDNode *Ld = dyn_cast(Arg)) { if (Flags.isByVal()) @@ -1400,6 +1394,12 @@ // FIXME: Completely disable sibcall for Thumb1 since Thumb1RegisterInfo:: // emitEpilogue is not ready for them. + // Doing this is tricky, since the LDM/POP instruction on Thumb doesn't take + // LR. This means if we need to reload LR, it takes an extra instructions, + // which outweighs the value of the tail call; but here we don't know yet + // whether LR is going to be used. Probably the right approach is to + // generate the tail call here and turn it back into CALL/RET in + // emitEpilogue if LR is used. if (Subtarget->isThumb1Only()) return false; @@ -1409,6 +1409,13 @@ // (We could do this by loading the address of the callee into a register; // that is an extra instruction over the direct call and burns a register // as well, so is not likely to be a win.) + + // It might be safe to remove this restriction on non-Darwin. + + // Thumb1 PIC calls to external symbols use BX, so they can be tail calls, + // but we need to make sure there are enough registers; the only valid + // registers are the 4 used for parameters. We don't currently do this + // case. if (isa(Callee)) return false; Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=107851&r1=107850&r2=107851&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Wed Jul 7 20:18:23 2010 @@ -1049,6 +1049,10 @@ "@TC_RETURN","\t$dst", []>, Requires<[IsDarwin]>; def TAILJMPd : ABXI<0b1010, (outs), (ins brtarget:$dst, variable_ops), + IIC_Br, "b\t$dst @ TAILCALL", + []>, Requires<[IsDarwin]>; + + def TAILJMPdt: ABXI<0b1010, (outs), (ins brtarget:$dst, variable_ops), IIC_Br, "b.w\t$dst @ TAILCALL", []>, Requires<[IsDarwin]>; Modified: llvm/trunk/test/CodeGen/ARM/call-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/call-tc.ll?rev=107851&r1=107850&r2=107851&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/call-tc.ll (original) +++ llvm/trunk/test/CodeGen/ARM/call-tc.ll Wed Jul 7 20:18:23 2010 @@ -1,5 +1,5 @@ -; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=CHECKV4 -; RUN: llc < %s -march=arm -mattr=+v5t | FileCheck %s -check-prefix=CHECKV5 +; RUN: llc < %s -mtriple=arm-apple-darwin -march=arm | FileCheck %s -check-prefix=CHECKV4 +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin -mattr=+v5t | FileCheck %s -check-prefix=CHECKV5 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi\ ; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECKELF @@ -37,3 +37,12 @@ %10 = call i32* %9(i32 %0, i32* null, i32 %1, i32* %2, i32* %3, i32* %4) ; [#uses=1] ret i32* %10 } + +define void @t4() { +; CHECKV4: t4: +; CHECKV4: b _t2 @ TAILCALL +; CHECKV5: t4: +; CHECKV5: b _t2 @ TAILCALL + tail call void @t2( ) ; [#uses=0] + ret void +} Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll?rev=107851&r1=107850&r2=107851&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll Wed Jul 7 20:18:23 2010 @@ -25,3 +25,13 @@ %tmp.upgrd.2 = tail call i32 %tmp( ) ; [#uses=0] ret void } + +define void @j() { +; DARWIN: j: +; DARWIN: b.w _f @ TAILCALL + +; LINUX: j: +; LINUX: b.w f @ TAILCALL + tail call void @f() + ret void +} Modified: llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp?rev=107851&r1=107850&r2=107851&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp Wed Jul 7 20:18:23 2010 @@ -1578,8 +1578,8 @@ // Tail calls are other patterns that generate existing instructions. if (Name == "TCRETURNdi" || Name == "TCRETURNdiND" || Name == "TCRETURNri" || Name == "TCRETURNriND" || - Name == "TAILJMPd" || Name == "TAILJMPdND" || - Name == "TAILJMPdNDt" || + Name == "TAILJMPd" || Name == "TAILJMPdt" || + Name == "TAILJMPdND" || Name == "TAILJMPdNDt" || Name == "TAILJMPr" || Name == "TAILJMPrND" || Name == "MOVr_TC") return false; From stoklund at 2pi.dk Wed Jul 7 20:23:16 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 7 Jul 2010 18:23:16 -0700 Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk: include/llvm/CodeGen/RegisterScavenging.h lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/RegisterScavenging.cpp In-Reply-To: <20100708003854.AB2F12A6C12C@llvm.org> References: <20100708003854.AB2F12A6C12C@llvm.org> Message-ID: <70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk> On Jul 7, 2010, at 5:38 PM, Jim Grosbach wrote: > Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=107847&r1=107846&r2=107847&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) > +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jul 7 19:38:54 2010 > @@ -885,10 +885,20 @@ > // Scavenge a new scratch register > CurrentVirtReg = Reg; > const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg); > - CurrentScratchReg = RS->FindUnusedReg(RC); > - if (CurrentScratchReg == 0) > + const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); > + BitVector Candidates(TRI->getNumRegs()); > + RS->getRegsAvailable(RC, Candidates); > + > + // If there are any registers available, use the one that's > + // unused for the longest after this instruction. That increases > + // the ability to reuse the value. > + if (Candidates.any()) { > + MachineBasicBlock::iterator UMI; > + CurrentScratchReg = RS->findSurvivorReg(I, Candidates, 25, UMI); > + } else { > // No register is "free". Scavenge a register. > CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); > + } > > PrevValue = Value; > } This looks like a method that escaped from RegScavenger. Isn't RegScavenger::scavengeRegister already doing this? I think CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); is all you need. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1929 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100707/28e49e73/attachment.bin From evan.cheng at apple.com Wed Jul 7 21:08:51 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 08 Jul 2010 02:08:51 -0000 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll Message-ID: <20100708020851.2FC172A6C12C@llvm.org> Author: evancheng Date: Wed Jul 7 21:08:50 2010 New Revision: 107852 URL: http://llvm.org/viewvc/llvm-project?rev=107852&view=rev Log: Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met: 1. The arguments are f32. 2. The arguments are loads and they have no uses other than the comparison. 3. The comparison code is EQ or NE. e.g. vldr.32 s0, [r1] vldr.32 s1, [r0] vcmpe.f32 s1, s0 vmrs apsr_nzcv, fpscr beq LBB0_2 => ldr r1, [r1] ldr r0, [r0] cmp r0, r1 beq LBB0_2 More complicated cases will be implemented in subsequent patches. Added: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107852&r1=107851&r2=107852&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 21:08:50 2010 @@ -59,7 +59,7 @@ static cl::opt EnableARMLongCalls("arm-long-calls", cl::Hidden, - cl::desc("Generate calls via indirect call instructions."), + cl::desc("Generate calls via indirect call instructions"), cl::init(false)); static cl::opt @@ -69,7 +69,7 @@ static cl::opt EnableARMCodePlacement("arm-code-placement", cl::Hidden, - cl::desc("Enable code placement pass for ARM."), + cl::desc("Enable code placement pass for ARM"), cl::init(false)); static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, EVT &LocVT, @@ -2273,9 +2273,42 @@ return DAG.getNode(CompareType, dl, MVT::Flag, LHS, RHS); } +static bool canBitcastToInt(SDNode *Op) { + return Op->hasOneUse() && + ISD::isNormalLoad(Op) && + Op->getValueType(0) == MVT::f32; +} + +static SDValue bitcastToInt(SDValue Op, SelectionDAG &DAG) { + if (LoadSDNode *Ld = dyn_cast(Op)) + return DAG.getLoad(MVT::i32, Op.getDebugLoc(), + Ld->getChain(), Ld->getBasePtr(), + Ld->getSrcValue(), Ld->getSrcValueOffset(), + Ld->isVolatile(), Ld->isNonTemporal(), + Ld->getAlignment()); + + llvm_unreachable("Unknown VFP cmp argument!"); +} + /// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given operands. -static SDValue getVFPCmp(SDValue LHS, SDValue RHS, SelectionDAG &DAG, - DebugLoc dl) { +SDValue +ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, + SDValue &ARMCC, SelectionDAG &DAG, + DebugLoc dl) const { + if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || + CC == ISD::SETNE || CC == ISD::SETUNE) && + canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) { + // If there are no othter uses of the CMP operands, and the condition + // code is EQ oe NE, we can optimize it to an integer comparison. + if (CC == ISD::SETOEQ) + CC = ISD::SETEQ; + else if (CC == ISD::SETUNE) + CC = ISD::SETNE; + LHS = bitcastToInt(LHS, DAG); + RHS = bitcastToInt(RHS, DAG); + return getARMCmp(LHS, RHS, CC, ARMCC, DAG, dl); + } + SDValue Cmp; if (!isFloatingPointZero(RHS)) Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Flag, LHS, RHS); @@ -2305,13 +2338,13 @@ SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); SDValue Result = DAG.getNode(ARMISD::CMOV, dl, VT, FalseVal, TrueVal, - ARMCC, CCR, Cmp); + ARMCC, CCR, Cmp); if (CondCode2 != ARMCC::AL) { SDValue ARMCC2 = DAG.getConstant(CondCode2, MVT::i32); // FIXME: Needs another CMP because flag can have but one use. - SDValue Cmp2 = getVFPCmp(LHS, RHS, DAG, dl); + SDValue Cmp2 = getVFPCmp(LHS, RHS, CC, ARMCC2, DAG, dl); Result = DAG.getNode(ARMISD::CMOV, dl, VT, Result, TrueVal, ARMCC2, CCR, Cmp2); } @@ -2338,8 +2371,8 @@ ARMCC::CondCodes CondCode, CondCode2; FPCCToARMCC(CC, CondCode, CondCode2); - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag); SDValue Ops[] = { Chain, Dest, ARMCC, CCR, Cmp }; @@ -2427,7 +2460,7 @@ return DAG.getNode(Opc, dl, VT, Op); } -static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { +SDValue ARMTargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const { // Implement fcopysign with a fabs and a conditional fneg. SDValue Tmp0 = Op.getOperand(0); SDValue Tmp1 = Op.getOperand(1); @@ -2435,8 +2468,10 @@ EVT VT = Op.getValueType(); EVT SrcVT = Tmp1.getValueType(); SDValue AbsVal = DAG.getNode(ISD::FABS, dl, VT, Tmp0); - SDValue Cmp = getVFPCmp(Tmp1, DAG.getConstantFP(0.0, SrcVT), DAG, dl); SDValue ARMCC = DAG.getConstant(ARMCC::LT, MVT::i32); + SDValue FP0 = DAG.getConstantFP(0.0, SrcVT); + SDValue Cmp = getVFPCmp(Tmp1, FP0, + ISD::SETLT, ARMCC, DAG, dl); SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); return DAG.getNode(ARMISD::CNEG, dl, VT, AbsVal, AbsVal, ARMCC, CCR, Cmp); } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=107852&r1=107851&r2=107852&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jul 7 21:08:50 2010 @@ -313,6 +313,7 @@ SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const; SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const; @@ -363,6 +364,8 @@ SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; + SDValue getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, + SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; MachineBasicBlock *EmitAtomicCmpSwap(MachineInstr *MI, MachineBasicBlock *BB, Added: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107852&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (added) +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Wed Jul 7 21:08:50 2010 @@ -0,0 +1,29 @@ +; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s +; rdar://7461510 + +define arm_apcscc i32 @t1(float* %a, float* %b) nounwind { +entry: +; CHECK: t1: +; CHECK-NOT: vldr +; CHECK: ldr +; CHECK: ldr +; CHECK: cmp r0, r1 +; CHECK-NOT: vcmpe.f32 +; CHECK-NOT: vmrs +; CHECK: beq + %0 = load float* %a + %1 = load float* %b + %2 = fcmp une float %0, %1 + br i1 %2, label %bb1, label %bb2 + +bb1: + %3 = call i32 @bar() + ret i32 %3 + +bb2: + %4 = call i32 @foo() + ret i32 %4 +} + +declare i32 @bar() +declare i32 @foo() From grosbach at apple.com Wed Jul 7 21:48:27 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 7 Jul 2010 19:48:27 -0700 Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk: include/llvm/CodeGen/RegisterScavenging.h lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/RegisterScavenging.cpp In-Reply-To: <70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk> References: <20100708003854.AB2F12A6C12C@llvm.org> <70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk> Message-ID: On Jul 7, 2010, at 6:23 PM, Jakob Stoklund Olesen wrote: > > On Jul 7, 2010, at 5:38 PM, Jim Grosbach wrote: >> Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=107847&r1=107846&r2=107847&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) >> +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jul 7 19:38:54 2010 >> @@ -885,10 +885,20 @@ >> // Scavenge a new scratch register >> CurrentVirtReg = Reg; >> const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg); >> - CurrentScratchReg = RS->FindUnusedReg(RC); >> - if (CurrentScratchReg == 0) >> + const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); >> + BitVector Candidates(TRI->getNumRegs()); >> + RS->getRegsAvailable(RC, Candidates); >> + >> + // If there are any registers available, use the one that's >> + // unused for the longest after this instruction. That increases >> + // the ability to reuse the value. >> + if (Candidates.any()) { >> + MachineBasicBlock::iterator UMI; >> + CurrentScratchReg = RS->findSurvivorReg(I, Candidates, 25, UMI); >> + } else { >> // No register is "free". Scavenge a register. >> CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); >> + } >> >> PrevValue = Value; >> } > > This looks like a method that escaped from RegScavenger. Isn't RegScavenger::scavengeRegister already doing this? > > I think > > CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); > > is all you need. > > It's close, but not quite. scavengeRegister() will find the register of the indicated register class that's used furthest away. It considers all registers of the register class as candidates, however, not just the available ones. Essentially, it's almost assuming that a spill will be required, but does have an early exit if for some reason it's called and finds a register that is available. That could just as easily be an assert, really. Previously, we looked for an available register, taking the first one we noticed if one or more exists; otherwise, we called scavengeRegister() to find a reasonable choice to spill and free up a register to use. Now, we apply the same heuristic for "reasonable to use" to selecting amongst the available registers, not just when spilling. -Jim From bob.wilson at apple.com Wed Jul 7 21:58:32 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 7 Jul 2010 19:58:32 -0700 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: <20100708020851.2FC172A6C12C@llvm.org> References: <20100708020851.2FC172A6C12C@llvm.org> Message-ID: This doesn't account for +0 == -0, does it? I think this is only safe when the UnsafeFPMath option is enabled. On Jul 7, 2010, at 7:08 PM, Evan Cheng wrote: > Author: evancheng > Date: Wed Jul 7 21:08:50 2010 > New Revision: 107852 > > URL: http://llvm.org/viewvc/llvm-project?rev=107852&view=rev > Log: > Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met: > 1. The arguments are f32. > 2. The arguments are loads and they have no uses other than the comparison. > 3. The comparison code is EQ or NE. > > e.g. > vldr.32 s0, [r1] > vldr.32 s1, [r0] > vcmpe.f32 s1, s0 > vmrs apsr_nzcv, fpscr > beq LBB0_2 > => > ldr r1, [r1] > ldr r0, [r0] > cmp r0, r1 > beq LBB0_2 > > More complicated cases will be implemented in subsequent patches. > > Added: > llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll > Modified: > llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > llvm/trunk/lib/Target/ARM/ARMISelLowering.h > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107852&r1=107851&r2=107852&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 21:08:50 2010 > @@ -59,7 +59,7 @@ > > static cl::opt > EnableARMLongCalls("arm-long-calls", cl::Hidden, > - cl::desc("Generate calls via indirect call instructions."), > + cl::desc("Generate calls via indirect call instructions"), > cl::init(false)); > > static cl::opt > @@ -69,7 +69,7 @@ > > static cl::opt > EnableARMCodePlacement("arm-code-placement", cl::Hidden, > - cl::desc("Enable code placement pass for ARM."), > + cl::desc("Enable code placement pass for ARM"), > cl::init(false)); > > static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, EVT &LocVT, > @@ -2273,9 +2273,42 @@ > return DAG.getNode(CompareType, dl, MVT::Flag, LHS, RHS); > } > > +static bool canBitcastToInt(SDNode *Op) { > + return Op->hasOneUse() && > + ISD::isNormalLoad(Op) && > + Op->getValueType(0) == MVT::f32; > +} > + > +static SDValue bitcastToInt(SDValue Op, SelectionDAG &DAG) { > + if (LoadSDNode *Ld = dyn_cast(Op)) > + return DAG.getLoad(MVT::i32, Op.getDebugLoc(), > + Ld->getChain(), Ld->getBasePtr(), > + Ld->getSrcValue(), Ld->getSrcValueOffset(), > + Ld->isVolatile(), Ld->isNonTemporal(), > + Ld->getAlignment()); > + > + llvm_unreachable("Unknown VFP cmp argument!"); > +} > + > /// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given operands. > -static SDValue getVFPCmp(SDValue LHS, SDValue RHS, SelectionDAG &DAG, > - DebugLoc dl) { > +SDValue > +ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, > + SDValue &ARMCC, SelectionDAG &DAG, > + DebugLoc dl) const { > + if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || > + CC == ISD::SETNE || CC == ISD::SETUNE) && > + canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) { > + // If there are no othter uses of the CMP operands, and the condition > + // code is EQ oe NE, we can optimize it to an integer comparison. > + if (CC == ISD::SETOEQ) > + CC = ISD::SETEQ; > + else if (CC == ISD::SETUNE) > + CC = ISD::SETNE; > + LHS = bitcastToInt(LHS, DAG); > + RHS = bitcastToInt(RHS, DAG); > + return getARMCmp(LHS, RHS, CC, ARMCC, DAG, dl); > + } > + > SDValue Cmp; > if (!isFloatingPointZero(RHS)) > Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Flag, LHS, RHS); > @@ -2305,13 +2338,13 @@ > > SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); > SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); > - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); > + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); > SDValue Result = DAG.getNode(ARMISD::CMOV, dl, VT, FalseVal, TrueVal, > - ARMCC, CCR, Cmp); > + ARMCC, CCR, Cmp); > if (CondCode2 != ARMCC::AL) { > SDValue ARMCC2 = DAG.getConstant(CondCode2, MVT::i32); > // FIXME: Needs another CMP because flag can have but one use. > - SDValue Cmp2 = getVFPCmp(LHS, RHS, DAG, dl); > + SDValue Cmp2 = getVFPCmp(LHS, RHS, CC, ARMCC2, DAG, dl); > Result = DAG.getNode(ARMISD::CMOV, dl, VT, > Result, TrueVal, ARMCC2, CCR, Cmp2); > } > @@ -2338,8 +2371,8 @@ > ARMCC::CondCodes CondCode, CondCode2; > FPCCToARMCC(CC, CondCode, CondCode2); > > - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); > SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); > + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); > SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); > SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag); > SDValue Ops[] = { Chain, Dest, ARMCC, CCR, Cmp }; > @@ -2427,7 +2460,7 @@ > return DAG.getNode(Opc, dl, VT, Op); > } > > -static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { > +SDValue ARMTargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const { > // Implement fcopysign with a fabs and a conditional fneg. > SDValue Tmp0 = Op.getOperand(0); > SDValue Tmp1 = Op.getOperand(1); > @@ -2435,8 +2468,10 @@ > EVT VT = Op.getValueType(); > EVT SrcVT = Tmp1.getValueType(); > SDValue AbsVal = DAG.getNode(ISD::FABS, dl, VT, Tmp0); > - SDValue Cmp = getVFPCmp(Tmp1, DAG.getConstantFP(0.0, SrcVT), DAG, dl); > SDValue ARMCC = DAG.getConstant(ARMCC::LT, MVT::i32); > + SDValue FP0 = DAG.getConstantFP(0.0, SrcVT); > + SDValue Cmp = getVFPCmp(Tmp1, FP0, > + ISD::SETLT, ARMCC, DAG, dl); > SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); > return DAG.getNode(ARMISD::CNEG, dl, VT, AbsVal, AbsVal, ARMCC, CCR, Cmp); > } > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=107852&r1=107851&r2=107852&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jul 7 21:08:50 2010 > @@ -313,6 +313,7 @@ > SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const; > SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; > SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const; > + SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const; > SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; > SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; > SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const; > @@ -363,6 +364,8 @@ > > SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, > SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; > + SDValue getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, > + SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; > > MachineBasicBlock *EmitAtomicCmpSwap(MachineInstr *MI, > MachineBasicBlock *BB, > > Added: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107852&view=auto > ============================================================================== > --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (added) > +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Wed Jul 7 21:08:50 2010 > @@ -0,0 +1,29 @@ > +; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s > +; rdar://7461510 > + > +define arm_apcscc i32 @t1(float* %a, float* %b) nounwind { > +entry: > +; CHECK: t1: > +; CHECK-NOT: vldr > +; CHECK: ldr > +; CHECK: ldr > +; CHECK: cmp r0, r1 > +; CHECK-NOT: vcmpe.f32 > +; CHECK-NOT: vmrs > +; CHECK: beq > + %0 = load float* %a > + %1 = load float* %b > + %2 = fcmp une float %0, %1 > + br i1 %2, label %bb1, label %bb2 > + > +bb1: > + %3 = call i32 @bar() > + ret i32 %3 > + > +bb2: > + %4 = call i32 @foo() > + ret i32 %4 > +} > + > +declare i32 @bar() > +declare i32 @foo() > > > _______________________________________________ > 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 Wed Jul 7 23:57:19 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 07 Jul 2010 21:57:19 -0700 Subject: [llvm-commits] [llvm] r107851 - in /llvm/trunk: lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMInstrInfo.td test/CodeGen/ARM/call-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll utils/TableGen/ARMDecoderEmitter.cpp In-Reply-To: <20100708011824.2CC2D2A6C12C@llvm.org> References: <20100708011824.2CC2D2A6C12C@llvm.org> Message-ID: <7D97F0CF-2567-4E12-94F2-35BEAAE5A1AD@apple.com> On Jul 7, 2010, at 6:18 PM, Dale Johannesen wrote: > Author: johannes > Date: Wed Jul 7 20:18:23 2010 > New Revision: 107851 > > URL: http://llvm.org/viewvc/llvm-project?rev=107851&view=rev > Log: > Changes to ARM tail calls, mostly cosmetic. > Add explicit testcases for tail calls within the same module. > Duplicate some code to humor those who think .w doesn't apply on ARM. Thanks Dale. Evan > Leave this disabled on Thumb1, and add some comments explaining why it's hard > and won't gain much. > > > Modified: > llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp > llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > llvm/trunk/lib/Target/ARM/ARMInstrInfo.td > llvm/trunk/test/CodeGen/ARM/call-tc.ll > llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll > llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=107851&r1=107850&r2=107851&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Jul 7 20:18:23 2010 > @@ -1663,7 +1663,8 @@ > > // Jump to label or value in register. > if (RetOpcode == ARM::TCRETURNdi) { > - BuildMI(MBB, MBBI, dl, TII.get(ARM::TAILJMPd)). > + BuildMI(MBB, MBBI, dl, > + TII.get(STI.isThumb() ? ARM::TAILJMPdt : ARM::TAILJMPd)). > addGlobalAddress(JumpTarget.getGlobal(), JumpTarget.getOffset(), > JumpTarget.getTargetFlags()); > } else if (RetOpcode == ARM::TCRETURNdiND) { > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107851&r1=107850&r2=107851&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 20:18:23 2010 > @@ -1338,13 +1338,7 @@ > if (!TII->isLoadFromStackSlot(Def, FI)) > return false; > } else { > -// unsigned Opcode = Def->getOpcode(); > -// if ((Opcode == X86::LEA32r || Opcode == X86::LEA64r) && > -// Def->getOperand(1).isFI()) { > -// FI = Def->getOperand(1).getIndex(); > -// Bytes = Flags.getByValSize(); > -// } else > - return false; > + return false; > } > } else if (LoadSDNode *Ld = dyn_cast(Arg)) { > if (Flags.isByVal()) > @@ -1400,6 +1394,12 @@ > > // FIXME: Completely disable sibcall for Thumb1 since Thumb1RegisterInfo:: > // emitEpilogue is not ready for them. > + // Doing this is tricky, since the LDM/POP instruction on Thumb doesn't take > + // LR. This means if we need to reload LR, it takes an extra instructions, > + // which outweighs the value of the tail call; but here we don't know yet > + // whether LR is going to be used. Probably the right approach is to > + // generate the tail call here and turn it back into CALL/RET in > + // emitEpilogue if LR is used. > if (Subtarget->isThumb1Only()) > return false; > > @@ -1409,6 +1409,13 @@ > // (We could do this by loading the address of the callee into a register; > // that is an extra instruction over the direct call and burns a register > // as well, so is not likely to be a win.) > + > + // It might be safe to remove this restriction on non-Darwin. > + > + // Thumb1 PIC calls to external symbols use BX, so they can be tail calls, > + // but we need to make sure there are enough registers; the only valid > + // registers are the 4 used for parameters. We don't currently do this > + // case. > if (isa(Callee)) > return false; > > > Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=107851&r1=107850&r2=107851&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) > +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Wed Jul 7 20:18:23 2010 > @@ -1049,6 +1049,10 @@ > "@TC_RETURN","\t$dst", []>, Requires<[IsDarwin]>; > > def TAILJMPd : ABXI<0b1010, (outs), (ins brtarget:$dst, variable_ops), > + IIC_Br, "b\t$dst @ TAILCALL", > + []>, Requires<[IsDarwin]>; > + > + def TAILJMPdt: ABXI<0b1010, (outs), (ins brtarget:$dst, variable_ops), > IIC_Br, "b.w\t$dst @ TAILCALL", > []>, Requires<[IsDarwin]>; > > > Modified: llvm/trunk/test/CodeGen/ARM/call-tc.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/call-tc.ll?rev=107851&r1=107850&r2=107851&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/ARM/call-tc.ll (original) > +++ llvm/trunk/test/CodeGen/ARM/call-tc.ll Wed Jul 7 20:18:23 2010 > @@ -1,5 +1,5 @@ > -; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=CHECKV4 > -; RUN: llc < %s -march=arm -mattr=+v5t | FileCheck %s -check-prefix=CHECKV5 > +; RUN: llc < %s -mtriple=arm-apple-darwin -march=arm | FileCheck %s -check-prefix=CHECKV4 > +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin -mattr=+v5t | FileCheck %s -check-prefix=CHECKV5 > ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi\ > ; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECKELF > > @@ -37,3 +37,12 @@ > %10 = call i32* %9(i32 %0, i32* null, i32 %1, i32* %2, i32* %3, i32* %4) ; [#uses=1] > ret i32* %10 > } > + > +define void @t4() { > +; CHECKV4: t4: > +; CHECKV4: b _t2 @ TAILCALL > +; CHECKV5: t4: > +; CHECKV5: b _t2 @ TAILCALL > + tail call void @t2( ) ; [#uses=0] > + ret void > +} > > Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll?rev=107851&r1=107850&r2=107851&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll (original) > +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll Wed Jul 7 20:18:23 2010 > @@ -25,3 +25,13 @@ > %tmp.upgrd.2 = tail call i32 %tmp( ) ; [#uses=0] > ret void > } > + > +define void @j() { > +; DARWIN: j: > +; DARWIN: b.w _f @ TAILCALL > + > +; LINUX: j: > +; LINUX: b.w f @ TAILCALL > + tail call void @f() > + ret void > +} > > Modified: llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp?rev=107851&r1=107850&r2=107851&view=diff > ============================================================================== > --- llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp (original) > +++ llvm/trunk/utils/TableGen/ARMDecoderEmitter.cpp Wed Jul 7 20:18:23 2010 > @@ -1578,8 +1578,8 @@ > // Tail calls are other patterns that generate existing instructions. > if (Name == "TCRETURNdi" || Name == "TCRETURNdiND" || > Name == "TCRETURNri" || Name == "TCRETURNriND" || > - Name == "TAILJMPd" || Name == "TAILJMPdND" || > - Name == "TAILJMPdNDt" || > + Name == "TAILJMPd" || Name == "TAILJMPdt" || > + Name == "TAILJMPdND" || Name == "TAILJMPdNDt" || > Name == "TAILJMPr" || Name == "TAILJMPrND" || > Name == "MOVr_TC") > return false; > > > _______________________________________________ > 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 Wed Jul 7 23:59:59 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 07 Jul 2010 21:59:59 -0700 Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk: include/llvm/CodeGen/RegisterScavenging.h lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/RegisterScavenging.cpp In-Reply-To: References: <20100708003854.AB2F12A6C12C@llvm.org> <70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk> Message-ID: <3DB6043D-A396-487E-AFA2-41EADC74803B@apple.com> On Jul 7, 2010, at 7:48 PM, Jim Grosbach wrote: > > On Jul 7, 2010, at 6:23 PM, Jakob Stoklund Olesen wrote: > >> >> On Jul 7, 2010, at 5:38 PM, Jim Grosbach wrote: >>> Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=107847&r1=107846&r2=107847&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) >>> +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jul 7 19:38:54 2010 >>> @@ -885,10 +885,20 @@ >>> // Scavenge a new scratch register >>> CurrentVirtReg = Reg; >>> const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg); >>> - CurrentScratchReg = RS->FindUnusedReg(RC); >>> - if (CurrentScratchReg == 0) >>> + const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); >>> + BitVector Candidates(TRI->getNumRegs()); >>> + RS->getRegsAvailable(RC, Candidates); >>> + >>> + // If there are any registers available, use the one that's >>> + // unused for the longest after this instruction. That increases >>> + // the ability to reuse the value. >>> + if (Candidates.any()) { >>> + MachineBasicBlock::iterator UMI; >>> + CurrentScratchReg = RS->findSurvivorReg(I, Candidates, 25, UMI); >>> + } else { >>> // No register is "free". Scavenge a register. >>> CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); >>> + } >>> >>> PrevValue = Value; >>> } >> >> This looks like a method that escaped from RegScavenger. Isn't RegScavenger::scavengeRegister already doing this? >> >> I think >> >> CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj); >> >> is all you need. >> >> > > It's close, but not quite. scavengeRegister() will find the register of the indicated register class that's used furthest away. It considers all registers of the register class as candidates, however, not just the available ones. Essentially, it's almost assuming that a spill will be required, but does have an early exit if for some reason it's called and finds a register that is available. That could just as easily be an assert, really. > > Previously, we looked for an available register, taking the first one we noticed if one or more exists; otherwise, we called scavengeRegister() to find a reasonable choice to spill and free up a register to use. Now, we apply the same heuristic for "reasonable to use" to selecting amongst the available registers, not just when spilling. Does it make sense to move the code into RS? Also, what's the magic number 25? Evan > > -Jim > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From stoklund at 2pi.dk Thu Jul 8 00:01:41 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 08 Jul 2010 05:01:41 -0000 Subject: [llvm-commits] [llvm] r107854 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LowerSubregs.cpp lib/CodeGen/TargetInstrInfoImpl.cpp Message-ID: <20100708050141.D8E852A6C12C@llvm.org> Author: stoklund Date: Thu Jul 8 00:01:41 2010 New Revision: 107854 URL: http://llvm.org/viewvc/llvm-project?rev=107854&view=rev Log: Add TargetInstrInfo::copyPhysReg hook and use it from LowerSubregs. This target hook is intended to replace copyRegToReg entirely, but for now it calls copyRegToReg. Any remaining calls to copyRegToReg wil be replaced by COPY instructions. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=107854&r1=107853&r2=107854&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Jul 8 00:01:41 2010 @@ -369,7 +369,13 @@ assert(0 && "Target didn't implement TargetInstrInfo::copyRegToReg!"); return false; } - + + /// copyPhysReg - Emit instructions to copy a pair of physical registers. + virtual void copyPhysReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, DebugLoc DL, + unsigned DestReg, unsigned SrcReg, + bool KillSrc) const =0; + /// storeRegToStackSlot - Store the specified register of the given register /// class to the specified stack frame index. The store instruction is to be /// added to the given machine basic block before the specified machine @@ -661,6 +667,10 @@ virtual ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const; + virtual void copyPhysReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, DebugLoc DL, + unsigned DestReg, unsigned SrcReg, + bool KillSrc) const; }; } // End llvm namespace Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=107854&r1=107853&r2=107854&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Jul 8 00:01:41 2010 @@ -85,7 +85,7 @@ if (MII->addRegisterDead(DstReg, TRI)) break; assert(MII != MI->getParent()->begin() && - "copyRegToReg output doesn't reference destination register!"); + "copyPhysReg output doesn't reference destination register!"); } } @@ -102,7 +102,7 @@ if (MII->addRegisterKilled(SrcReg, TRI, AddIfNotFound)) break; assert(MII != MI->getParent()->begin() && - "copyRegToReg output doesn't reference source register!"); + "copyPhysReg output doesn't reference source register!"); } } @@ -155,13 +155,7 @@ DEBUG(dbgs() << "subreg: eliminated!"); } else { - // Insert copy - const TargetRegisterClass *TRCS = TRI->getPhysicalRegisterRegClass(DstReg); - const TargetRegisterClass *TRCD = TRI->getPhysicalRegisterRegClass(SrcReg); - bool Emitted = TII->copyRegToReg(*MBB, MI, DstReg, SrcReg, TRCD, TRCS, - MI->getDebugLoc()); - (void)Emitted; - assert(Emitted && "Subreg and Dst must be of compatible register class"); + TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstReg, SrcReg, false); // Transfer the kill/dead flags, if needed. if (MI->getOperand(0).isDead()) TransferDeadFlag(MI, DstReg, TRI); @@ -215,18 +209,11 @@ } DEBUG(dbgs() << "subreg: eliminated!"); } else { - // Insert sub-register copy - const TargetRegisterClass *TRC0= TRI->getPhysicalRegisterRegClass(DstSubReg); - const TargetRegisterClass *TRC1= TRI->getPhysicalRegisterRegClass(InsReg); - bool Emitted = TII->copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1, - MI->getDebugLoc()); - (void)Emitted; - assert(Emitted && "Subreg and Dst must be of compatible register class"); + TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstSubReg, InsReg, + MI->getOperand(2).isKill()); // Transfer the kill/dead flags, if needed. if (MI->getOperand(0).isDead()) TransferDeadFlag(MI, DstSubReg, TRI); - if (MI->getOperand(2).isKill()) - TransferKillFlag(MI, InsReg, TRI); DEBUG({ MachineBasicBlock::iterator dMI = MI; dbgs() << "subreg: " << *(--dMI); @@ -280,18 +267,13 @@ } } else { // Insert sub-register copy - const TargetRegisterClass *TRC0= TRI->getPhysicalRegisterRegClass(DstSubReg); - const TargetRegisterClass *TRC1= TRI->getPhysicalRegisterRegClass(InsReg); if (MI->getOperand(2).isUndef()) // If the source register being inserted is undef, then this becomes a // KILL. BuildMI(*MBB, MI, MI->getDebugLoc(), TII->get(TargetOpcode::KILL), DstSubReg); else { - bool Emitted = TII->copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1, - MI->getDebugLoc()); - (void)Emitted; - assert(Emitted && "Subreg and Dst must be of compatible register class"); + TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstSubReg, InsReg, false); } MachineBasicBlock::iterator CopyMI = MI; --CopyMI; @@ -343,21 +325,11 @@ } DEBUG(dbgs() << "real copy: " << *MI); - // Ask target for a lowered copy instruction. - const TargetRegisterClass *DstRC = - TRI->getPhysicalRegisterRegClass(DstMO.getReg()); - const TargetRegisterClass *SrcRC = - TRI->getPhysicalRegisterRegClass(SrcMO.getReg()); - bool Emitted = TII->copyRegToReg(*MI->getParent(), MI, - DstMO.getReg(), SrcMO.getReg(), - DstRC, SrcRC, MI->getDebugLoc()); - (void)Emitted; - assert(Emitted && "Cannot emit copy"); + TII->copyPhysReg(*MI->getParent(), MI, MI->getDebugLoc(), + DstMO.getReg(), SrcMO.getReg(), SrcMO.isKill()); if (DstMO.isDead()) TransferDeadFlag(MI, DstMO.getReg(), TRI); - if (SrcMO.isKill()) - TransferKillFlag(MI, SrcMO.getReg(), TRI, true); if (MI->getNumOperands() > 2) TransferImplicitDefs(MI); DEBUG({ Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=107854&r1=107853&r2=107854&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Thu Jul 8 00:01:41 2010 @@ -365,3 +365,20 @@ CreateTargetPostRAHazardRecognizer(const InstrItineraryData &II) const { return (ScheduleHazardRecognizer *)new PostRAHazardRecognizer(II); } + +// Default implementation of copyPhysReg using copyRegToReg. +void TargetInstrInfoImpl::copyPhysReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, + DebugLoc DL, + unsigned DestReg, unsigned SrcReg, + bool KillSrc) const { + assert(TargetRegisterInfo::isPhysicalRegister(DestReg)); + assert(TargetRegisterInfo::isPhysicalRegister(SrcReg)); + const TargetRegisterInfo *TRI = MBB.getParent()->getTarget().getRegisterInfo(); + const TargetRegisterClass *DRC = TRI->getPhysicalRegisterRegClass(DestReg); + const TargetRegisterClass *SRC = TRI->getPhysicalRegisterRegClass(SrcReg); + if (!copyRegToReg(MBB, MI, DestReg, SrcReg, DRC, SRC, DL)) + llvm_unreachable("Cannot emit physreg copy instruction"); + if (KillSrc) + llvm::prior(MI)->addRegisterKilled(SrcReg, TRI, true); +} From evan.cheng at apple.com Thu Jul 8 00:28:58 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 07 Jul 2010 22:28:58 -0700 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: References: <20100708020851.2FC172A6C12C@llvm.org> Message-ID: <15144F72-11C9-4A71-AD10-AC8A8B912EF3@apple.com> Yes. I'll fix. Evan On Jul 7, 2010, at 7:58 PM, Bob Wilson wrote: > This doesn't account for +0 == -0, does it? > > I think this is only safe when the UnsafeFPMath option is enabled. > > On Jul 7, 2010, at 7:08 PM, Evan Cheng wrote: > >> Author: evancheng >> Date: Wed Jul 7 21:08:50 2010 >> New Revision: 107852 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=107852&view=rev >> Log: >> Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met: >> 1. The arguments are f32. >> 2. The arguments are loads and they have no uses other than the comparison. >> 3. The comparison code is EQ or NE. >> >> e.g. >> vldr.32 s0, [r1] >> vldr.32 s1, [r0] >> vcmpe.f32 s1, s0 >> vmrs apsr_nzcv, fpscr >> beq LBB0_2 >> => >> ldr r1, [r1] >> ldr r0, [r0] >> cmp r0, r1 >> beq LBB0_2 >> >> More complicated cases will be implemented in subsequent patches. >> >> Added: >> llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll >> Modified: >> llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >> llvm/trunk/lib/Target/ARM/ARMISelLowering.h >> >> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107852&r1=107851&r2=107852&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 21:08:50 2010 >> @@ -59,7 +59,7 @@ >> >> static cl::opt >> EnableARMLongCalls("arm-long-calls", cl::Hidden, >> - cl::desc("Generate calls via indirect call instructions."), >> + cl::desc("Generate calls via indirect call instructions"), >> cl::init(false)); >> >> static cl::opt >> @@ -69,7 +69,7 @@ >> >> static cl::opt >> EnableARMCodePlacement("arm-code-placement", cl::Hidden, >> - cl::desc("Enable code placement pass for ARM."), >> + cl::desc("Enable code placement pass for ARM"), >> cl::init(false)); >> >> static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, EVT &LocVT, >> @@ -2273,9 +2273,42 @@ >> return DAG.getNode(CompareType, dl, MVT::Flag, LHS, RHS); >> } >> >> +static bool canBitcastToInt(SDNode *Op) { >> + return Op->hasOneUse() && >> + ISD::isNormalLoad(Op) && >> + Op->getValueType(0) == MVT::f32; >> +} >> + >> +static SDValue bitcastToInt(SDValue Op, SelectionDAG &DAG) { >> + if (LoadSDNode *Ld = dyn_cast(Op)) >> + return DAG.getLoad(MVT::i32, Op.getDebugLoc(), >> + Ld->getChain(), Ld->getBasePtr(), >> + Ld->getSrcValue(), Ld->getSrcValueOffset(), >> + Ld->isVolatile(), Ld->isNonTemporal(), >> + Ld->getAlignment()); >> + >> + llvm_unreachable("Unknown VFP cmp argument!"); >> +} >> + >> /// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given operands. >> -static SDValue getVFPCmp(SDValue LHS, SDValue RHS, SelectionDAG &DAG, >> - DebugLoc dl) { >> +SDValue >> +ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, >> + SDValue &ARMCC, SelectionDAG &DAG, >> + DebugLoc dl) const { >> + if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || >> + CC == ISD::SETNE || CC == ISD::SETUNE) && >> + canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) { >> + // If there are no othter uses of the CMP operands, and the condition >> + // code is EQ oe NE, we can optimize it to an integer comparison. >> + if (CC == ISD::SETOEQ) >> + CC = ISD::SETEQ; >> + else if (CC == ISD::SETUNE) >> + CC = ISD::SETNE; >> + LHS = bitcastToInt(LHS, DAG); >> + RHS = bitcastToInt(RHS, DAG); >> + return getARMCmp(LHS, RHS, CC, ARMCC, DAG, dl); >> + } >> + >> SDValue Cmp; >> if (!isFloatingPointZero(RHS)) >> Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Flag, LHS, RHS); >> @@ -2305,13 +2338,13 @@ >> >> SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); >> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >> - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); >> + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); >> SDValue Result = DAG.getNode(ARMISD::CMOV, dl, VT, FalseVal, TrueVal, >> - ARMCC, CCR, Cmp); >> + ARMCC, CCR, Cmp); >> if (CondCode2 != ARMCC::AL) { >> SDValue ARMCC2 = DAG.getConstant(CondCode2, MVT::i32); >> // FIXME: Needs another CMP because flag can have but one use. >> - SDValue Cmp2 = getVFPCmp(LHS, RHS, DAG, dl); >> + SDValue Cmp2 = getVFPCmp(LHS, RHS, CC, ARMCC2, DAG, dl); >> Result = DAG.getNode(ARMISD::CMOV, dl, VT, >> Result, TrueVal, ARMCC2, CCR, Cmp2); >> } >> @@ -2338,8 +2371,8 @@ >> ARMCC::CondCodes CondCode, CondCode2; >> FPCCToARMCC(CC, CondCode, CondCode2); >> >> - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); >> SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); >> + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); >> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >> SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag); >> SDValue Ops[] = { Chain, Dest, ARMCC, CCR, Cmp }; >> @@ -2427,7 +2460,7 @@ >> return DAG.getNode(Opc, dl, VT, Op); >> } >> >> -static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { >> +SDValue ARMTargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const { >> // Implement fcopysign with a fabs and a conditional fneg. >> SDValue Tmp0 = Op.getOperand(0); >> SDValue Tmp1 = Op.getOperand(1); >> @@ -2435,8 +2468,10 @@ >> EVT VT = Op.getValueType(); >> EVT SrcVT = Tmp1.getValueType(); >> SDValue AbsVal = DAG.getNode(ISD::FABS, dl, VT, Tmp0); >> - SDValue Cmp = getVFPCmp(Tmp1, DAG.getConstantFP(0.0, SrcVT), DAG, dl); >> SDValue ARMCC = DAG.getConstant(ARMCC::LT, MVT::i32); >> + SDValue FP0 = DAG.getConstantFP(0.0, SrcVT); >> + SDValue Cmp = getVFPCmp(Tmp1, FP0, >> + ISD::SETLT, ARMCC, DAG, dl); >> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >> return DAG.getNode(ARMISD::CNEG, dl, VT, AbsVal, AbsVal, ARMCC, CCR, Cmp); >> } >> >> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=107852&r1=107851&r2=107852&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jul 7 21:08:50 2010 >> @@ -313,6 +313,7 @@ >> SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const; >> + SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const; >> @@ -363,6 +364,8 @@ >> >> SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, >> SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; >> + SDValue getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, >> + SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; >> >> MachineBasicBlock *EmitAtomicCmpSwap(MachineInstr *MI, >> MachineBasicBlock *BB, >> >> Added: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107852&view=auto >> ============================================================================== >> --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (added) >> +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Wed Jul 7 21:08:50 2010 >> @@ -0,0 +1,29 @@ >> +; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s >> +; rdar://7461510 >> + >> +define arm_apcscc i32 @t1(float* %a, float* %b) nounwind { >> +entry: >> +; CHECK: t1: >> +; CHECK-NOT: vldr >> +; CHECK: ldr >> +; CHECK: ldr >> +; CHECK: cmp r0, r1 >> +; CHECK-NOT: vcmpe.f32 >> +; CHECK-NOT: vmrs >> +; CHECK: beq >> + %0 = load float* %a >> + %1 = load float* %b >> + %2 = fcmp une float %0, %1 >> + br i1 %2, label %bb1, label %bb2 >> + >> +bb1: >> + %3 = call i32 @bar() >> + ret i32 %3 >> + >> +bb2: >> + %4 = call i32 @foo() >> + ret i32 %4 >> +} >> + >> +declare i32 @bar() >> +declare i32 @foo() >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From anton at korobeynikov.info Thu Jul 8 00:43:52 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Thu, 8 Jul 2010 09:43:52 +0400 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: <20100708020851.2FC172A6C12C@llvm.org> References: <20100708020851.2FC172A6C12C@llvm.org> Message-ID: Hello, Evan > Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met: Any reasons of doing this? This looks like a pretty expensive change and ARM manuals explicitly tell not to do so. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From evan.cheng at apple.com Thu Jul 8 01:01:42 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jul 2010 23:01:42 -0700 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: References: <20100708020851.2FC172A6C12C@llvm.org> Message-ID: On Jul 7, 2010, at 10:43 PM, Anton Korobeynikov wrote: > Hello, Evan > >> Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met: > Any reasons of doing this? This looks like a pretty expensive change > and ARM manuals explicitly tell not to do so. Which manual? Why would it be expensive? before: vldr.32 s0, [r1] vldr.32 s1, [r0] vcmpe.f32 s1, s0 vmrs apsr_nzcv, fpscr beq LBB0_2 after: ldr r1, [r1] ldr r0, [r0] cmp r0, r1 beq LBB0_2 On Cortex-a8 vmrs is very expensive. But even on a9 the integer version should be faster. Evan > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University From evan.cheng at apple.com Thu Jul 8 01:01:49 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 08 Jul 2010 06:01:49 -0000 Subject: [llvm-commits] [llvm] r107856 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/fpcmp-opt.ll Message-ID: <20100708060149.5649E2A6C12C@llvm.org> Author: evancheng Date: Thu Jul 8 01:01:49 2010 New Revision: 107856 URL: http://llvm.org/viewvc/llvm-project?rev=107856&view=rev Log: r107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107856&r1=107855&r2=107856&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jul 8 01:01:49 2010 @@ -2295,11 +2295,13 @@ ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const { - if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || + if (UnsafeFPMath && + (CC == ISD::SETEQ || CC == ISD::SETOEQ || CC == ISD::SETNE || CC == ISD::SETUNE) && canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) { - // If there are no othter uses of the CMP operands, and the condition - // code is EQ oe NE, we can optimize it to an integer comparison. + // If unsafe fp math optimization is enabled and there are no othter uses of + // the CMP operands, and the condition code is EQ oe NE, we can optimize it + // to an integer comparison. if (CC == ISD::SETOEQ) CC = ISD::SETEQ; else if (CC == ISD::SETUNE) Modified: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107856&r1=107855&r2=107856&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (original) +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Thu Jul 8 01:01:49 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s +; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math | FileCheck %s ; rdar://7461510 define arm_apcscc i32 @t1(float* %a, float* %b) nounwind { From enderby at apple.com Thu Jul 8 01:03:57 2010 From: enderby at apple.com (Kevin Enderby) Date: Wed, 7 Jul 2010 23:03:57 -0700 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: References: <20100708020851.2FC172A6C12C@llvm.org> Message-ID: <3CDD7DFD-70C7-4260-BA86-70781462FE2B@apple.com> Also what about NaN's compared to anything being required to return unordered (that is the way I recall the IEEE standard)? Kev On Jul 7, 2010, at 7:58 PM, Bob Wilson wrote: > This doesn't account for +0 == -0, does it? > > I think this is only safe when the UnsafeFPMath option is enabled. > > On Jul 7, 2010, at 7:08 PM, Evan Cheng wrote: > >> Author: evancheng >> Date: Wed Jul 7 21:08:50 2010 >> New Revision: 107852 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=107852&view=rev >> Log: >> Optimize some vfp comparisons to integer ones. This patch >> implements the simplest case when the following conditions are met: >> 1. The arguments are f32. >> 2. The arguments are loads and they have no uses other than the >> comparison. >> 3. The comparison code is EQ or NE. >> >> e.g. >> vldr.32 s0, [r1] >> vldr.32 s1, [r0] >> vcmpe.f32 s1, s0 >> vmrs apsr_nzcv, fpscr >> beq LBB0_2 >> => >> ldr r1, [r1] >> ldr r0, [r0] >> cmp r0, r1 >> beq LBB0_2 >> >> More complicated cases will be implemented in subsequent patches. >> >> Added: >> llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll >> Modified: >> llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >> llvm/trunk/lib/Target/ARM/ARMISelLowering.h >> >> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107852&r1=107851&r2=107852&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 >> 21:08:50 2010 >> @@ -59,7 +59,7 @@ >> >> static cl::opt >> EnableARMLongCalls("arm-long-calls", cl::Hidden, >> - cl::desc("Generate calls via indirect call instructions."), >> + cl::desc("Generate calls via indirect call instructions"), >> cl::init(false)); >> >> static cl::opt >> @@ -69,7 +69,7 @@ >> >> static cl::opt >> EnableARMCodePlacement("arm-code-placement", cl::Hidden, >> - cl::desc("Enable code placement pass for ARM."), >> + cl::desc("Enable code placement pass for ARM"), >> cl::init(false)); >> >> static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, EVT >> &LocVT, >> @@ -2273,9 +2273,42 @@ >> return DAG.getNode(CompareType, dl, MVT::Flag, LHS, RHS); >> } >> >> +static bool canBitcastToInt(SDNode *Op) { >> + return Op->hasOneUse() && >> + ISD::isNormalLoad(Op) && >> + Op->getValueType(0) == MVT::f32; >> +} >> + >> +static SDValue bitcastToInt(SDValue Op, SelectionDAG &DAG) { >> + if (LoadSDNode *Ld = dyn_cast(Op)) >> + return DAG.getLoad(MVT::i32, Op.getDebugLoc(), >> + Ld->getChain(), Ld->getBasePtr(), >> + Ld->getSrcValue(), Ld->getSrcValueOffset(), >> + Ld->isVolatile(), Ld->isNonTemporal(), >> + Ld->getAlignment()); >> + >> + llvm_unreachable("Unknown VFP cmp argument!"); >> +} >> + >> /// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given >> operands. >> -static SDValue getVFPCmp(SDValue LHS, SDValue RHS, SelectionDAG >> &DAG, >> - DebugLoc dl) { >> +SDValue >> +ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, >> ISD::CondCode CC, >> + SDValue &ARMCC, SelectionDAG &DAG, >> + DebugLoc dl) const { >> + if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || >> + CC == ISD::SETNE || CC == ISD::SETUNE) && >> + canBitcastToInt(LHS.getNode()) && >> canBitcastToInt(RHS.getNode())) { >> + // If there are no othter uses of the CMP operands, and the >> condition >> + // code is EQ oe NE, we can optimize it to an integer >> comparison. >> + if (CC == ISD::SETOEQ) >> + CC = ISD::SETEQ; >> + else if (CC == ISD::SETUNE) >> + CC = ISD::SETNE; >> + LHS = bitcastToInt(LHS, DAG); >> + RHS = bitcastToInt(RHS, DAG); >> + return getARMCmp(LHS, RHS, CC, ARMCC, DAG, dl); >> + } >> + >> SDValue Cmp; >> if (!isFloatingPointZero(RHS)) >> Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Flag, LHS, RHS); >> @@ -2305,13 +2338,13 @@ >> >> SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); >> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >> - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); >> + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); >> SDValue Result = DAG.getNode(ARMISD::CMOV, dl, VT, FalseVal, >> TrueVal, >> - ARMCC, CCR, Cmp); >> + ARMCC, CCR, Cmp); >> if (CondCode2 != ARMCC::AL) { >> SDValue ARMCC2 = DAG.getConstant(CondCode2, MVT::i32); >> // FIXME: Needs another CMP because flag can have but one use. >> - SDValue Cmp2 = getVFPCmp(LHS, RHS, DAG, dl); >> + SDValue Cmp2 = getVFPCmp(LHS, RHS, CC, ARMCC2, DAG, dl); >> Result = DAG.getNode(ARMISD::CMOV, dl, VT, >> Result, TrueVal, ARMCC2, CCR, Cmp2); >> } >> @@ -2338,8 +2371,8 @@ >> ARMCC::CondCodes CondCode, CondCode2; >> FPCCToARMCC(CC, CondCode, CondCode2); >> >> - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); >> SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); >> + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); >> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >> SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag); >> SDValue Ops[] = { Chain, Dest, ARMCC, CCR, Cmp }; >> @@ -2427,7 +2460,7 @@ >> return DAG.getNode(Opc, dl, VT, Op); >> } >> >> -static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { >> +SDValue ARMTargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG >> &DAG) const { >> // Implement fcopysign with a fabs and a conditional fneg. >> SDValue Tmp0 = Op.getOperand(0); >> SDValue Tmp1 = Op.getOperand(1); >> @@ -2435,8 +2468,10 @@ >> EVT VT = Op.getValueType(); >> EVT SrcVT = Tmp1.getValueType(); >> SDValue AbsVal = DAG.getNode(ISD::FABS, dl, VT, Tmp0); >> - SDValue Cmp = getVFPCmp(Tmp1, DAG.getConstantFP(0.0, SrcVT), >> DAG, dl); >> SDValue ARMCC = DAG.getConstant(ARMCC::LT, MVT::i32); >> + SDValue FP0 = DAG.getConstantFP(0.0, SrcVT); >> + SDValue Cmp = getVFPCmp(Tmp1, FP0, >> + ISD::SETLT, ARMCC, DAG, dl); >> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >> return DAG.getNode(ARMISD::CNEG, dl, VT, AbsVal, AbsVal, ARMCC, >> CCR, Cmp); >> } >> >> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=107852&r1=107851&r2=107852&view=diff >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jul 7 21:08:50 >> 2010 >> @@ -313,6 +313,7 @@ >> SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const; >> + SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; >> SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) >> const; >> @@ -363,6 +364,8 @@ >> >> SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, >> SDValue &ARMCC, SelectionDAG &DAG, DebugLoc >> dl) const; >> + SDValue getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, >> + SDValue &ARMCC, SelectionDAG &DAG, DebugLoc >> dl) const; >> >> MachineBasicBlock *EmitAtomicCmpSwap(MachineInstr *MI, >> MachineBasicBlock *BB, >> >> Added: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107852&view=auto >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (added) >> +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Wed Jul 7 21:08:50 2010 >> @@ -0,0 +1,29 @@ >> +; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s >> +; rdar://7461510 >> + >> +define arm_apcscc i32 @t1(float* %a, float* %b) nounwind { >> +entry: >> +; CHECK: t1: >> +; CHECK-NOT: vldr >> +; CHECK: ldr >> +; CHECK: ldr >> +; CHECK: cmp r0, r1 >> +; CHECK-NOT: vcmpe.f32 >> +; CHECK-NOT: vmrs >> +; CHECK: beq >> + %0 = load float* %a >> + %1 = load float* %b >> + %2 = fcmp une float %0, %1 >> + br i1 %2, label %bb1, label %bb2 >> + >> +bb1: >> + %3 = call i32 @bar() >> + ret i32 %3 >> + >> +bb2: >> + %4 = call i32 @foo() >> + ret i32 %4 >> +} >> + >> +declare i32 @bar() >> +declare i32 @foo() >> >> >> _______________________________________________ >> 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 evan.cheng at apple.com Thu Jul 8 01:21:25 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 7 Jul 2010 23:21:25 -0700 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: <3CDD7DFD-70C7-4260-BA86-70781462FE2B@apple.com> References: <20100708020851.2FC172A6C12C@llvm.org> <3CDD7DFD-70C7-4260-BA86-70781462FE2B@apple.com> Message-ID: <9B83706C-B49B-499B-90B6-E13E0E0F60DE@apple.com> On Jul 7, 2010, at 11:03 PM, Kevin Enderby wrote: > Also what about NaN's compared to anything being required to return unordered (that is the way I recall the IEEE standard)? I did check for those. :-) Evan > > Kev > > On Jul 7, 2010, at 7:58 PM, Bob Wilson wrote: > >> This doesn't account for +0 == -0, does it? >> >> I think this is only safe when the UnsafeFPMath option is enabled. >> >> On Jul 7, 2010, at 7:08 PM, Evan Cheng wrote: >> >>> Author: evancheng >>> Date: Wed Jul 7 21:08:50 2010 >>> New Revision: 107852 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=107852&view=rev >>> Log: >>> Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met: >>> 1. The arguments are f32. >>> 2. The arguments are loads and they have no uses other than the comparison. >>> 3. The comparison code is EQ or NE. >>> >>> e.g. >>> vldr.32 s0, [r1] >>> vldr.32 s1, [r0] >>> vcmpe.f32 s1, s0 >>> vmrs apsr_nzcv, fpscr >>> beq LBB0_2 >>> => >>> ldr r1, [r1] >>> ldr r0, [r0] >>> cmp r0, r1 >>> beq LBB0_2 >>> >>> More complicated cases will be implemented in subsequent patches. >>> >>> Added: >>> llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll >>> Modified: >>> llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >>> llvm/trunk/lib/Target/ARM/ARMISelLowering.h >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107852&r1=107851&r2=107852&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jul 7 21:08:50 2010 >>> @@ -59,7 +59,7 @@ >>> >>> static cl::opt >>> EnableARMLongCalls("arm-long-calls", cl::Hidden, >>> - cl::desc("Generate calls via indirect call instructions."), >>> + cl::desc("Generate calls via indirect call instructions"), >>> cl::init(false)); >>> >>> static cl::opt >>> @@ -69,7 +69,7 @@ >>> >>> static cl::opt >>> EnableARMCodePlacement("arm-code-placement", cl::Hidden, >>> - cl::desc("Enable code placement pass for ARM."), >>> + cl::desc("Enable code placement pass for ARM"), >>> cl::init(false)); >>> >>> static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, EVT &LocVT, >>> @@ -2273,9 +2273,42 @@ >>> return DAG.getNode(CompareType, dl, MVT::Flag, LHS, RHS); >>> } >>> >>> +static bool canBitcastToInt(SDNode *Op) { >>> + return Op->hasOneUse() && >>> + ISD::isNormalLoad(Op) && >>> + Op->getValueType(0) == MVT::f32; >>> +} >>> + >>> +static SDValue bitcastToInt(SDValue Op, SelectionDAG &DAG) { >>> + if (LoadSDNode *Ld = dyn_cast(Op)) >>> + return DAG.getLoad(MVT::i32, Op.getDebugLoc(), >>> + Ld->getChain(), Ld->getBasePtr(), >>> + Ld->getSrcValue(), Ld->getSrcValueOffset(), >>> + Ld->isVolatile(), Ld->isNonTemporal(), >>> + Ld->getAlignment()); >>> + >>> + llvm_unreachable("Unknown VFP cmp argument!"); >>> +} >>> + >>> /// Returns a appropriate VFP CMP (fcmp{s|d}+fmstat) for the given operands. >>> -static SDValue getVFPCmp(SDValue LHS, SDValue RHS, SelectionDAG &DAG, >>> - DebugLoc dl) { >>> +SDValue >>> +ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, >>> + SDValue &ARMCC, SelectionDAG &DAG, >>> + DebugLoc dl) const { >>> + if ((CC == ISD::SETEQ || CC == ISD::SETOEQ || >>> + CC == ISD::SETNE || CC == ISD::SETUNE) && >>> + canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) { >>> + // If there are no othter uses of the CMP operands, and the condition >>> + // code is EQ oe NE, we can optimize it to an integer comparison. >>> + if (CC == ISD::SETOEQ) >>> + CC = ISD::SETEQ; >>> + else if (CC == ISD::SETUNE) >>> + CC = ISD::SETNE; >>> + LHS = bitcastToInt(LHS, DAG); >>> + RHS = bitcastToInt(RHS, DAG); >>> + return getARMCmp(LHS, RHS, CC, ARMCC, DAG, dl); >>> + } >>> + >>> SDValue Cmp; >>> if (!isFloatingPointZero(RHS)) >>> Cmp = DAG.getNode(ARMISD::CMPFP, dl, MVT::Flag, LHS, RHS); >>> @@ -2305,13 +2338,13 @@ >>> >>> SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); >>> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >>> - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); >>> + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); >>> SDValue Result = DAG.getNode(ARMISD::CMOV, dl, VT, FalseVal, TrueVal, >>> - ARMCC, CCR, Cmp); >>> + ARMCC, CCR, Cmp); >>> if (CondCode2 != ARMCC::AL) { >>> SDValue ARMCC2 = DAG.getConstant(CondCode2, MVT::i32); >>> // FIXME: Needs another CMP because flag can have but one use. >>> - SDValue Cmp2 = getVFPCmp(LHS, RHS, DAG, dl); >>> + SDValue Cmp2 = getVFPCmp(LHS, RHS, CC, ARMCC2, DAG, dl); >>> Result = DAG.getNode(ARMISD::CMOV, dl, VT, >>> Result, TrueVal, ARMCC2, CCR, Cmp2); >>> } >>> @@ -2338,8 +2371,8 @@ >>> ARMCC::CondCodes CondCode, CondCode2; >>> FPCCToARMCC(CC, CondCode, CondCode2); >>> >>> - SDValue Cmp = getVFPCmp(LHS, RHS, DAG, dl); >>> SDValue ARMCC = DAG.getConstant(CondCode, MVT::i32); >>> + SDValue Cmp = getVFPCmp(LHS, RHS, CC, ARMCC, DAG, dl); >>> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >>> SDVTList VTList = DAG.getVTList(MVT::Other, MVT::Flag); >>> SDValue Ops[] = { Chain, Dest, ARMCC, CCR, Cmp }; >>> @@ -2427,7 +2460,7 @@ >>> return DAG.getNode(Opc, dl, VT, Op); >>> } >>> >>> -static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { >>> +SDValue ARMTargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const { >>> // Implement fcopysign with a fabs and a conditional fneg. >>> SDValue Tmp0 = Op.getOperand(0); >>> SDValue Tmp1 = Op.getOperand(1); >>> @@ -2435,8 +2468,10 @@ >>> EVT VT = Op.getValueType(); >>> EVT SrcVT = Tmp1.getValueType(); >>> SDValue AbsVal = DAG.getNode(ISD::FABS, dl, VT, Tmp0); >>> - SDValue Cmp = getVFPCmp(Tmp1, DAG.getConstantFP(0.0, SrcVT), DAG, dl); >>> SDValue ARMCC = DAG.getConstant(ARMCC::LT, MVT::i32); >>> + SDValue FP0 = DAG.getConstantFP(0.0, SrcVT); >>> + SDValue Cmp = getVFPCmp(Tmp1, FP0, >>> + ISD::SETLT, ARMCC, DAG, dl); >>> SDValue CCR = DAG.getRegister(ARM::CPSR, MVT::i32); >>> return DAG.getNode(ARMISD::CNEG, dl, VT, AbsVal, AbsVal, ARMCC, CCR, Cmp); >>> } >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=107852&r1=107851&r2=107852&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jul 7 21:08:50 2010 >>> @@ -313,6 +313,7 @@ >>> SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const; >>> SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; >>> SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const; >>> + SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const; >>> SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; >>> SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; >>> SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const; >>> @@ -363,6 +364,8 @@ >>> >>> SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, >>> SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; >>> + SDValue getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC, >>> + SDValue &ARMCC, SelectionDAG &DAG, DebugLoc dl) const; >>> >>> MachineBasicBlock *EmitAtomicCmpSwap(MachineInstr *MI, >>> MachineBasicBlock *BB, >>> >>> Added: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107852&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (added) >>> +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Wed Jul 7 21:08:50 2010 >>> @@ -0,0 +1,29 @@ >>> +; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s >>> +; rdar://7461510 >>> + >>> +define arm_apcscc i32 @t1(float* %a, float* %b) nounwind { >>> +entry: >>> +; CHECK: t1: >>> +; CHECK-NOT: vldr >>> +; CHECK: ldr >>> +; CHECK: ldr >>> +; CHECK: cmp r0, r1 >>> +; CHECK-NOT: vcmpe.f32 >>> +; CHECK-NOT: vmrs >>> +; CHECK: beq >>> + %0 = load float* %a >>> + %1 = load float* %b >>> + %2 = fcmp une float %0, %1 >>> + br i1 %2, label %bb1, label %bb2 >>> + >>> +bb1: >>> + %3 = call i32 @bar() >>> + ret i32 %3 >>> + >>> +bb2: >>> + %4 = call i32 @foo() >>> + ret i32 %4 >>> +} >>> + >>> +declare i32 @bar() >>> +declare i32 @foo() >>> >>> >>> _______________________________________________ >>> 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 rjmccall at apple.com Thu Jul 8 02:04:58 2010 From: rjmccall at apple.com (John McCall) Date: Thu, 8 Jul 2010 00:04:58 -0700 Subject: [llvm-commits] [llvm] r107852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h test/CodeGen/ARM/fpcmp-opt.ll In-Reply-To: <9B83706C-B49B-499B-90B6-E13E0E0F60DE@apple.com> References: <20100708020851.2FC172A6C12C@llvm.org> <3CDD7DFD-70C7-4260-BA86-70781462FE2B@apple.com> <9B83706C-B49B-499B-90B6-E13E0E0F60DE@apple.com> Message-ID: <7C24C7C7-6E5A-47DA-9F71-6E2BD741EEA5@apple.com> On Jul 7, 2010, at 11:21 PM, Evan Cheng wrote: > On Jul 7, 2010, at 11:03 PM, Kevin Enderby wrote: > >> Also what about NaN's compared to anything being required to return unordered (that is the way I recall the IEEE standard)? > > I did check for those. :-) Kevin is right, this is just never correct with NaNs. Suppose A and B are QNaNs with different bit-patterns. For oeq, A == A should be false, bitwise comparison has it true. For ueq, A == B should be true, bitwise comparison has it false. For one, A != B should be false, bitwise comparison has it true. For une, A != A should be true, bitwise comparison has it false. It's also wrong with SNaNs, but I don't know if we care about that. Anyway, I think -ffinite-math-only is sufficient. John. From baldrick at free.fr Thu Jul 8 02:12:56 2010 From: baldrick at free.fr (Duncan Sands) Date: Thu, 08 Jul 2010 09:12:56 +0200 Subject: [llvm-commits] [PATCH] Add a instcombine optimization. In-Reply-To: <5728FE48-1EF0-4A7B-A11D-AE2E95B40227@gmail.com> References: <5728FE48-1EF0-4A7B-A11D-AE2E95B40227@gmail.com> Message-ID: <4C357A78.2090005@free.fr> Hi Benjamin, > The attached patch adds a new transformation to instcombine: > (X>s -1) ? C1 : C2 --> ((X>>s 31)& (C2 - C1)) + C1 how about (X >s -1) ? C1 : C2 --> ((X >>s 31) & (C2 xor C1)) xor C1 instead? It might interact better with other bit fiddling optimizations. Otherwise the patch looks good. Ciao, Duncan. From echristo at apple.com Thu Jul 8 02:36:46 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 08 Jul 2010 07:36:46 -0000 Subject: [llvm-commits] [llvm] r107860 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td test/CodeGen/X86/x86-64-tls-1.ll Message-ID: <20100708073646.AD9762A6C12D@llvm.org> Author: echristo Date: Thu Jul 8 02:36:46 2010 New Revision: 107860 URL: http://llvm.org/viewvc/llvm-project?rev=107860&view=rev Log: A slight reworking of the custom patterns for x86-64 tpoff codegen and correct the testcase for valid assembly. Needs more tests. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=107860&r1=107859&r2=107860&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Thu Jul 8 02:36:46 2010 @@ -1890,8 +1890,6 @@ (MOV64ri tjumptable :$dst)>, Requires<[FarData]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri tglobaladdr :$dst)>, Requires<[FarData]>; -def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), - (MOV64ri tglobaltlsaddr :$dst)>, Requires<[FarData]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri texternalsym:$dst)>, Requires<[FarData]>; def : Pat<(i64 (X86Wrapper tblockaddress:$dst)), @@ -1906,8 +1904,6 @@ (MOV64ri64i32 tjumptable :$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri64i32 tglobaladdr :$dst)>, Requires<[SmallCode]>; -def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), - (MOV64ri64i32 tglobaltlsaddr :$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri64i32 texternalsym:$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper tblockaddress:$dst)), @@ -1922,8 +1918,6 @@ (MOV64ri32 tjumptable :$dst)>, Requires<[KernelCode]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri32 tglobaladdr :$dst)>, Requires<[KernelCode]>; -def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), - (MOV64ri32 tglobaltlsaddr :$dst)>, Requires<[KernelCode]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri32 texternalsym:$dst)>, Requires<[KernelCode]>; def : Pat<(i64 (X86Wrapper tblockaddress:$dst)), @@ -1941,9 +1935,6 @@ def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst), (MOV64mi32 addr:$dst, tglobaladdr:$src)>, Requires<[NearData, IsStatic]>; -def : Pat<(store (i64 (X86Wrapper tglobaltlsaddr:$src)), addr:$dst), - (MOV64mi32 addr:$dst, tglobaltlsaddr:$src)>, - Requires<[NearData, IsStatic]>; def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst), (MOV64mi32 addr:$dst, texternalsym:$src)>, Requires<[NearData, IsStatic]>; @@ -1981,6 +1972,17 @@ (TCRETURNdi64 texternalsym:$dst, imm:$off)>, Requires<[In64BitMode]>; +// tls has some funny stuff here... +// This corresponds to movabs $foo at tpoff, %rax +def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), + (MOV64ri tglobaltlsaddr :$dst)>; +// This corresponds to add $foo at tpoff, %rax +def : Pat<(add GR64:$src1, (X86Wrapper tglobaltlsaddr :$dst)), + (ADD64ri32 GR64:$src1, tglobaltlsaddr :$dst)>; +// This corresponds to mov foo at tpoff(%rbx), %eax +def : Pat<(load (i64 (X86Wrapper tglobaltlsaddr :$dst))), + (MOV64rm tglobaltlsaddr :$dst)>; + // Comparisons. // TEST R,R is smaller than CMP R,0 Modified: llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll?rev=107860&r1=107859&r2=107860&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll (original) +++ llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll Thu Jul 8 02:36:46 2010 @@ -1,6 +1,6 @@ ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s @tm_nest_level = internal thread_local global i32 0 define i64 @z() nounwind { -; CHECK: movl $tm_nest_level at TPOFF, %ecx +; CHECK: movabsq $tm_nest_level at TPOFF, %rcx ret i64 and (i64 ptrtoint (i32* @tm_nest_level to i64), i64 100) } From baldrick at free.fr Thu Jul 8 03:27:18 2010 From: baldrick at free.fr (Duncan Sands) Date: Thu, 08 Jul 2010 08:27:18 -0000 Subject: [llvm-commits] [llvm] r107862 - in /llvm/trunk/docs: GettingStarted.html WritingAnLLVMPass.html Message-ID: <20100708082718.670DD2A6C12C@llvm.org> Author: baldrick Date: Thu Jul 8 03:27:18 2010 New Revision: 107862 URL: http://llvm.org/viewvc/llvm-project?rev=107862&view=rev Log: Tweak some docs now that the default build is called Debug+Asserts. Modified: llvm/trunk/docs/GettingStarted.html llvm/trunk/docs/WritingAnLLVMPass.html Modified: llvm/trunk/docs/GettingStarted.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStarted.html?rev=107862&r1=107861&r2=107862&view=diff ============================================================================== --- llvm/trunk/docs/GettingStarted.html (original) +++ llvm/trunk/docs/GettingStarted.html Thu Jul 8 03:27:18 2010 @@ -1137,13 +1137,13 @@ named after the build type:

    -
    Debug Builds +
    Debug Builds with assertions enabled (the default)
    Tools -
    OBJ_ROOT/Debug/bin +
    OBJ_ROOT/Debug+Asserts/bin
    Libraries -
    OBJ_ROOT/Debug/lib +
    OBJ_ROOT/Debug+Asserts/lib


    Modified: llvm/trunk/docs/WritingAnLLVMPass.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=107862&r1=107861&r2=107862&view=diff ============================================================================== --- llvm/trunk/docs/WritingAnLLVMPass.html (original) +++ llvm/trunk/docs/WritingAnLLVMPass.html Thu Jul 8 03:27:18 2010 @@ -195,7 +195,7 @@

    This makefile specifies that all of the .cpp files in the current directory are to be compiled and linked together into a -Debug/lib/Hello.so shared object that can be dynamically loaded by +Debug+Asserts/lib/Hello.so shared object that can be dynamically loaded by the opt or bugpoint tools via their -load options. If your operating system uses a suffix other than .so (such as windows or Mac OS/X), the appropriate extension will be used.

    @@ -332,7 +332,7 @@

    Now that it's all together, compile the file with a simple "gmake" command in the local directory and you should get a new -"Debug/lib/Hello.so file. Note that everything in this file is +"Debug+Asserts/lib/Hello.so file. Note that everything in this file is contained in an anonymous namespace: this reflects the fact that passes are self contained units that do not need external interfaces (although they can have them) to be useful.

    @@ -358,7 +358,7 @@ work):

    -$ opt -load ../../../Debug/lib/Hello.so -hello < hello.bc > /dev/null
    +$ opt -load ../../../Debug+Asserts/lib/Hello.so -hello < hello.bc > /dev/null
     Hello: __main
     Hello: puts
     Hello: main
    @@ -375,7 +375,7 @@
     opt with the -help option:

    -$ opt -load ../../../Debug/lib/Hello.so -help
    +$ opt -load ../../../Debug+Asserts/lib/Hello.so -help
     OVERVIEW: llvm .bc -> .bc modular optimizer
     
     USAGE: opt [options] <input bitcode>
    @@ -403,7 +403,7 @@
     example:

    -$ opt -load ../../../Debug/lib/Hello.so -hello -time-passes < hello.bc > /dev/null
    +$ opt -load ../../../Debug+Asserts/lib/Hello.so -hello -time-passes < hello.bc > /dev/null
     Hello: __main
     Hello: puts
     Hello: main
    @@ -1418,7 +1418,7 @@
     Lets try it out with the gcse and licm passes:

    -$ opt -load ../../../Debug/lib/Hello.so -gcse -licm --debug-pass=Structure < hello.bc > /dev/null
    +$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -licm --debug-pass=Structure < hello.bc > /dev/null
     Module Pass Manager
       Function Pass Manager
         Dominator Set Construction
    @@ -1455,7 +1455,7 @@
     World pass in between the two passes:

    -$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null
    +$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null
     Module Pass Manager
       Function Pass Manager
         Dominator Set Construction
    @@ -1496,7 +1496,7 @@
     

    Now when we run our pass, we get this output:

    -$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null
    +$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null
     Pass Arguments:  -gcse -hello -licm
     Module Pass Manager
       Function Pass Manager
    @@ -1737,8 +1737,8 @@
     
     (gdb) break llvm::PassManager::run
     Breakpoint 1 at 0x2413bc: file Pass.cpp, line 70.
    -(gdb) run test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]
    -Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]
    +(gdb) run test.bc -load $(LLVMTOP)/llvm/Debug+Asserts/lib/[libname].so -[passoption]
    +Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug+Asserts/lib/[libname].so -[passoption]
     Breakpoint 1, PassManager::run (this=0xffbef174, M=@0x70b298) at Pass.cpp:70
     70      bool PassManager::run(Module &M) { return PM->run(M); }
     (gdb)
    
    
    
    
    From benny.kra at googlemail.com  Thu Jul  8 06:29:03 2010
    From: benny.kra at googlemail.com (Benjamin Kramer)
    Date: Thu, 8 Jul 2010 13:29:03 +0200
    Subject: [llvm-commits] [PATCH] Add a instcombine optimization.
    In-Reply-To: <4C357A78.2090005@free.fr>
    References: <5728FE48-1EF0-4A7B-A11D-AE2E95B40227@gmail.com>
    	<4C357A78.2090005@free.fr>
    Message-ID: <4A50AB2D-4D4B-4EC0-A6A3-2F9457C6FD9C@gmail.com>
    
    
    On 08.07.2010, at 09:12, Duncan Sands wrote:
    
    > Hi Benjamin,
    > 
    >> The attached patch adds a new transformation to instcombine:
    >> (X>s -1) ? C1 : C2 -->  ((X>>s 31)&  (C2 - C1)) + C1
    > 
    > how about (X >s -1) ? C1 : C2 -->  ((X >>s 31) & (C2 xor C1)) xor C1
    > instead?  It might interact better with other bit fiddling optimizations.
    > Otherwise the patch looks good.
    
    Hmm, but we wont get a lea on x86 with xor. I don't think xor is profitable
    unless we extend the optimization to transform non-const C1 and C2 too.
    
    
    From benny.kra at googlemail.com  Thu Jul  8 06:39:10 2010
    From: benny.kra at googlemail.com (Benjamin Kramer)
    Date: Thu, 08 Jul 2010 11:39:10 -0000
    Subject: [llvm-commits] [llvm] r107866 - in /llvm/trunk:
     lib/Target/README.txt lib/Transforms/InstCombine/InstCombineSelect.cpp
     test/Transforms/InstCombine/select.ll
    Message-ID: <20100708113911.0859E2A6C12C@llvm.org>
    
    Author: d0k
    Date: Thu Jul  8 06:39:10 2010
    New Revision: 107866
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107866&view=rev
    Log:
    Teach instcombine to transform
    (X >s -1) ? C1 : C2 and (X >s 31) & (C2 - C1)) + C1, avoiding the conditional.
    
    This optimization could be extended to take non-const C1 and C2 but we better
    stay conservative to avoid code size bloat for now.
    
    for
    int sel(int n) {
         return n >= 0 ? 60 : 100;
    }
    
    we now generate
      sarl  $31, %edi
      andl  $40, %edi
      leal  60(%rdi), %eax
    
    instead of
      testl %edi, %edi
      movl  $60, %ecx
      movl  $100, %eax
      cmovnsl %ecx, %eax
    
    Modified:
        llvm/trunk/lib/Target/README.txt
        llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
        llvm/trunk/test/Transforms/InstCombine/select.ll
    
    Modified: llvm/trunk/lib/Target/README.txt
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=107866&r1=107865&r2=107866&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/README.txt (original)
    +++ llvm/trunk/lib/Target/README.txt Thu Jul  8 06:39:10 2010
    @@ -906,17 +906,6 @@
     
     //===---------------------------------------------------------------------===//
     
    -From GCC Bug 3756:
    -int
    -pn (int n)
    -{
    - return (n >= 0 ? 1 : -1);
    -}
    -Should combine to (n >> 31) | 1.  Currently not optimized with "clang
    --emit-llvm-bc | opt -std-compile-opts | llc".
    -
    -//===---------------------------------------------------------------------===//
    -
     void a(int variable)
     {
      if (variable == 4 || variable == 6)
    
    Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=107866&r1=107865&r2=107866&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
    +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Thu Jul  8 06:39:10 2010
    @@ -329,6 +329,37 @@
           }
         }
     
    +  // Transform (X >s -1) ? C1 : C2 --> ((X >>s 31) & (C2 - C1)) + C1
    +  // and       (X  ((X >>s 31) & (C2 - C1)) + C1
    +  // FIXME: Type and constness constraints could be lifted, but we have to
    +  //        watch code size carefully. We should consider xor instead of
    +  //        sub/add when we decide to do that.
    +  if (const IntegerType *Ty = dyn_cast(CmpLHS->getType())) {
    +    if (TrueVal->getType() == Ty) {
    +      if (ConstantInt *Cmp = dyn_cast(CmpRHS)) {
    +        ConstantInt *C1 = NULL, *C2 = NULL;
    +        if (Pred == ICmpInst::ICMP_SGT && Cmp->isAllOnesValue()) {
    +          C1 = dyn_cast(TrueVal);
    +          C2 = dyn_cast(FalseVal);
    +        } else if (Pred == ICmpInst::ICMP_SLT && Cmp->isNullValue()) {
    +          C1 = dyn_cast(FalseVal);
    +          C2 = dyn_cast(TrueVal);
    +        }
    +        if (C1 && C2) {
    +          // This shift results in either -1 or 0.
    +          Value *AShr = Builder->CreateAShr(CmpLHS, Ty->getBitWidth()-1);
    +
    +          // Check if we can express the operation with a single or.
    +          if (C2->isAllOnesValue())
    +            return ReplaceInstUsesWith(SI, Builder->CreateOr(AShr, C1));
    +
    +          Value *And = Builder->CreateAnd(AShr, C2->getValue()-C1->getValue());
    +          return ReplaceInstUsesWith(SI, Builder->CreateAdd(And, C1));
    +        }
    +      }
    +    }
    +  }
    +
       if (CmpLHS == TrueVal && CmpRHS == FalseVal) {
         // Transform (X == Y) ? X : Y  -> Y
         if (Pred == ICmpInst::ICMP_EQ)
    
    Modified: llvm/trunk/test/Transforms/InstCombine/select.ll
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/select.ll?rev=107866&r1=107865&r2=107866&view=diff
    ==============================================================================
    --- llvm/trunk/test/Transforms/InstCombine/select.ll (original)
    +++ llvm/trunk/test/Transforms/InstCombine/select.ll Thu Jul  8 06:39:10 2010
    @@ -438,3 +438,35 @@
     ; CHECK: @test34
     ; CHECK: ret i32 %x
     }
    +
    +define i32 @test35(i32 %x) {
    +  %cmp = icmp sge i32 %x, 0
    +  %cond = select i1 %cmp, i32 60, i32 100
    +  ret i32 %cond
    +; CHECK: @test35
    +; CHECK: ashr i32 %x, 31
    +; CHECK: and i32 {{.*}}, 40
    +; CHECK: add i32 {{.*}}, 60
    +; CHECK: ret
    +}
    +
    +define i32 @test36(i32 %x) {
    +  %cmp = icmp slt i32 %x, 0
    +  %cond = select i1 %cmp, i32 60, i32 100
    +  ret i32 %cond
    +; CHECK: @test36
    +; CHECK: ashr i32 %x, 31
    +; CHECK: and i32 {{.*}}, -40
    +; CHECK: add i32 {{.*}}, 100
    +; CHECK: ret
    +}
    +
    +define i32 @test37(i32 %x) {
    +  %cmp = icmp sgt i32 %x, -1
    +  %cond = select i1 %cmp, i32 1, i32 -1
    +  ret i32 %cond
    +; CHECK: @test37
    +; CHECK: ashr i32 %x, 31
    +; CHECK: or i32 {{.*}}, 1
    +; CHECK: ret
    +}
    
    
    
    
    From benny.kra at googlemail.com  Thu Jul  8 06:40:32 2010
    From: benny.kra at googlemail.com (Benjamin Kramer)
    Date: Thu, 8 Jul 2010 13:40:32 +0200
    Subject: [llvm-commits] [PATCH] Add a instcombine optimization.
    In-Reply-To: <4A50AB2D-4D4B-4EC0-A6A3-2F9457C6FD9C@gmail.com>
    References: <5728FE48-1EF0-4A7B-A11D-AE2E95B40227@gmail.com>
    	<4C357A78.2090005@free.fr>
    	<4A50AB2D-4D4B-4EC0-A6A3-2F9457C6FD9C@gmail.com>
    Message-ID: 
    
    
    On 08.07.2010, at 13:29, Benjamin Kramer wrote:
    
    > 
    > On 08.07.2010, at 09:12, Duncan Sands wrote:
    > 
    >> Hi Benjamin,
    >> 
    >>> The attached patch adds a new transformation to instcombine:
    >>> (X>s -1) ? C1 : C2 -->  ((X>>s 31)&  (C2 - C1)) + C1
    >> 
    >> how about (X >s -1) ? C1 : C2 -->  ((X >>s 31) & (C2 xor C1)) xor C1
    >> instead?  It might interact better with other bit fiddling optimizations.
    >> Otherwise the patch looks good.
    > 
    > Hmm, but we wont get a lea on x86 with xor. I don't think xor is profitable
    > unless we extend the optimization to transform non-const C1 and C2 too.
    
    I committed the patch along with a FIXME about xor in r107866.
    
    
    From baldrick at free.fr  Thu Jul  8 06:54:27 2010
    From: baldrick at free.fr (Duncan Sands)
    Date: Thu, 08 Jul 2010 11:54:27 -0000
    Subject: [llvm-commits] [llvm] r107867 - in /llvm/trunk/include/llvm:
     ADT/PostOrderIterator.h Analysis/IntervalIterator.h
    Message-ID: <20100708115427.D67BD2A6C12C@llvm.org>
    
    Author: baldrick
    Date: Thu Jul  8 06:54:27 2010
    New Revision: 107867
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107867&view=rev
    Log:
    Do not use std::stack because it causes obscure failures when
    compiled with MSVC 2010 (PR7367).  Instead use a SmallVector.
    
    Modified:
        llvm/trunk/include/llvm/ADT/PostOrderIterator.h
        llvm/trunk/include/llvm/Analysis/IntervalIterator.h
    
    Modified: llvm/trunk/include/llvm/ADT/PostOrderIterator.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PostOrderIterator.h?rev=107867&r1=107866&r2=107867&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/ADT/PostOrderIterator.h (original)
    +++ llvm/trunk/include/llvm/ADT/PostOrderIterator.h Thu Jul  8 06:54:27 2010
    @@ -18,8 +18,8 @@
     
     #include "llvm/ADT/GraphTraits.h"
     #include "llvm/ADT/SmallPtrSet.h"
    +#include "llvm/ADT/SmallVector.h"
     #include 
    -#include 
     #include 
     
     namespace llvm {
    @@ -52,21 +52,21 @@
     
       // VisitStack - Used to maintain the ordering.  Top = current block
       // First element is basic block pointer, second is the 'next child' to visit
    -  std::stack > VisitStack;
    +  SmallVector, 16> VisitStack;
     
       void traverseChild() {
    -    while (VisitStack.top().second != GT::child_end(VisitStack.top().first)) {
    -      NodeType *BB = *VisitStack.top().second++;
    +    while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) {
    +      NodeType *BB = *VisitStack.back().second++;
           if (!this->Visited.count(BB)) {  // If the block is not visited...
             this->Visited.insert(BB);
    -        VisitStack.push(std::make_pair(BB, GT::child_begin(BB)));
    +        VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
           }
         }
       }
     
       inline po_iterator(NodeType *BB) {
         this->Visited.insert(BB);
    -    VisitStack.push(std::make_pair(BB, GT::child_begin(BB)));
    +    VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
         traverseChild();
       }
       inline po_iterator() {} // End is when stack is empty.
    @@ -75,7 +75,7 @@
         po_iterator_storage(S) {
         if(!S.count(BB)) {
           this->Visited.insert(BB);
    -      VisitStack.push(std::make_pair(BB, GT::child_begin(BB)));
    +      VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
           traverseChild();
         }
       }
    @@ -102,7 +102,7 @@
       inline bool operator!=(const _Self& x) const { return !operator==(x); }
     
       inline pointer operator*() const {
    -    return VisitStack.top().first;
    +    return VisitStack.back().first;
       }
     
       // This is a nonstandard operator-> that dereferences the pointer an extra
    @@ -112,7 +112,7 @@
       inline NodeType *operator->() const { return operator*(); }
     
       inline _Self& operator++() {   // Preincrement
    -    VisitStack.pop();
    +    VisitStack.pop_back();
         if (!VisitStack.empty())
           traverseChild();
         return *this;
    
    Modified: llvm/trunk/include/llvm/Analysis/IntervalIterator.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalIterator.h?rev=107867&r1=107866&r2=107867&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/Analysis/IntervalIterator.h (original)
    +++ llvm/trunk/include/llvm/Analysis/IntervalIterator.h Thu Jul  8 06:54:27 2010
    @@ -33,10 +33,10 @@
     #ifndef LLVM_INTERVAL_ITERATOR_H
     #define LLVM_INTERVAL_ITERATOR_H
     
    +#include "llvm/ADT/SmallVector.h"
     #include "llvm/Analysis/IntervalPartition.h"
     #include "llvm/Function.h"
     #include "llvm/Support/CFG.h"
    -#include 
     #include 
     #include 
     
    @@ -88,7 +88,7 @@
     template,
              class IGT = GraphTraits > >
     class IntervalIterator {
    -  std::stack > IntStack;
    +  SmallVector, 16> IntStack;
       std::set Visited;
       OrigContainer_t *OrigContainer;
       bool IOwnMem;     // If True, delete intervals when done with them
    @@ -116,15 +116,15 @@
         if (IOwnMem)
           while (!IntStack.empty()) {
             delete operator*();
    -        IntStack.pop();
    +        IntStack.pop_back();
           }
       }
     
       inline bool operator==(const _Self& x) const { return IntStack == x.IntStack;}
       inline bool operator!=(const _Self& x) const { return !operator==(x); }
     
    -  inline const Interval *operator*() const { return IntStack.top().first; }
    -  inline       Interval *operator*()       { return IntStack.top().first; }
    +  inline const Interval *operator*() const { return IntStack.back().first; }
    +  inline       Interval *operator*()       { return IntStack.back().first; }
       inline const Interval *operator->() const { return operator*(); }
       inline       Interval *operator->()       { return operator*(); }
     
    @@ -133,8 +133,8 @@
         do {
           // All of the intervals on the stack have been visited.  Try visiting
           // their successors now.
    -      Interval::succ_iterator &SuccIt = IntStack.top().second,
    -                                EndIt = succ_end(IntStack.top().first);
    +      Interval::succ_iterator &SuccIt = IntStack.back().second,
    +                                EndIt = succ_end(IntStack.back().first);
           while (SuccIt != EndIt) {                 // Loop over all interval succs
             bool Done = ProcessInterval(getSourceGraphNode(OrigContainer, *SuccIt));
             ++SuccIt;                               // Increment iterator
    @@ -142,10 +142,10 @@
           }
     
           // Free interval memory... if necessary
    -      if (IOwnMem) delete IntStack.top().first;
    +      if (IOwnMem) delete IntStack.back().first;
     
           // We ran out of successors for this interval... pop off the stack
    -      IntStack.pop();
    +      IntStack.pop_back();
         } while (!IntStack.empty());
     
         return *this;
    @@ -175,7 +175,7 @@
                E = GT::child_end(Node); I != E; ++I)
           ProcessNode(Int, getSourceGraphNode(OrigContainer, *I));
     
    -    IntStack.push(std::make_pair(Int, succ_begin(Int)));
    +    IntStack.push_back(std::make_pair(Int, succ_begin(Int)));
         return true;
       }
     
    
    
    
    
    From benny.kra at googlemail.com  Thu Jul  8 07:09:56 2010
    From: benny.kra at googlemail.com (Benjamin Kramer)
    Date: Thu, 08 Jul 2010 12:09:56 -0000
    Subject: [llvm-commits] [llvm] r107868 -
    	/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    Message-ID: <20100708120956.7F4412A6C12C@llvm.org>
    
    Author: d0k
    Date: Thu Jul  8 07:09:56 2010
    New Revision: 107868
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107868&view=rev
    Log:
    Merge the duplicated iabs optimization in DAGCombiner and let it detected a few more idioms.
    
    Modified:
        llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    
    Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=107868&r1=107867&r2=107868&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
    +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jul  8 07:09:56 2010
    @@ -6892,38 +6892,34 @@
         }
       }
     
    -  // Check to see if this is an integer abs. select_cc setl[te] X, 0, -X, X ->
    +  // Check to see if this is an integer abs.
    +  // select_cc setg[te] X,  0,  X, -X ->
    +  // select_cc setgt    X, -1,  X, -X ->
    +  // select_cc setl[te] X,  0, -X,  X ->
    +  // select_cc setlt    X,  1, -X,  X ->
       // Y = sra (X, size(X)-1); xor (add (X, Y), Y)
    -  if (N1C && N1C->isNullValue() && (CC == ISD::SETLT || CC == ISD::SETLE) &&
    -      N0 == N3 && N2.getOpcode() == ISD::SUB && N0 == N2.getOperand(1) &&
    -      N2.getOperand(0) == N1 && N0.getValueType().isInteger()) {
    +  if (N1C) {
    +    ConstantSDNode *SubC = NULL;
    +    if (((N1C->isNullValue() && (CC == ISD::SETGT || CC == ISD::SETGE)) ||
    +         (N1C->isAllOnesValue() && CC == ISD::SETGT)) &&
    +        N0 == N2 && N3.getOpcode() == ISD::SUB && N0 == N3.getOperand(1))
    +      SubC = dyn_cast(N3.getOperand(0));
    +    else if (((N1C->isNullValue() && (CC == ISD::SETLT || CC == ISD::SETLE)) ||
    +              (N1C->isOne() && CC == ISD::SETLT)) &&
    +             N0 == N3 && N2.getOpcode() == ISD::SUB && N0 == N2.getOperand(1))
    +      SubC = dyn_cast(N2.getOperand(0));
    +
         EVT XType = N0.getValueType();
    -    SDValue Shift = DAG.getNode(ISD::SRA, N0.getDebugLoc(), XType, N0,
    -                                DAG.getConstant(XType.getSizeInBits()-1,
    -                                                getShiftAmountTy()));
    -    SDValue Add = DAG.getNode(ISD::ADD, N0.getDebugLoc(), XType,
    -                              N0, Shift);
    -    AddToWorkList(Shift.getNode());
    -    AddToWorkList(Add.getNode());
    -    return DAG.getNode(ISD::XOR, DL, XType, Add, Shift);
    -  }
    -  // Check to see if this is an integer abs. select_cc setgt X, -1, X, -X ->
    -  // Y = sra (X, size(X)-1); xor (add (X, Y), Y)
    -  if (N1C && N1C->isAllOnesValue() && CC == ISD::SETGT &&
    -      N0 == N2 && N3.getOpcode() == ISD::SUB && N0 == N3.getOperand(1)) {
    -    if (ConstantSDNode *SubC = dyn_cast(N3.getOperand(0))) {
    -      EVT XType = N0.getValueType();
    -      if (SubC->isNullValue() && XType.isInteger()) {
    -        SDValue Shift = DAG.getNode(ISD::SRA, N0.getDebugLoc(), XType,
    -                                    N0,
    -                                    DAG.getConstant(XType.getSizeInBits()-1,
    -                                                    getShiftAmountTy()));
    -        SDValue Add = DAG.getNode(ISD::ADD, N0.getDebugLoc(),
    -                                  XType, N0, Shift);
    -        AddToWorkList(Shift.getNode());
    -        AddToWorkList(Add.getNode());
    -        return DAG.getNode(ISD::XOR, DL, XType, Add, Shift);
    -      }
    +    if (SubC && SubC->isNullValue() && XType.isInteger()) {
    +      SDValue Shift = DAG.getNode(ISD::SRA, N0.getDebugLoc(), XType,
    +                                  N0,
    +                                  DAG.getConstant(XType.getSizeInBits()-1,
    +                                                  getShiftAmountTy()));
    +      SDValue Add = DAG.getNode(ISD::ADD, N0.getDebugLoc(),
    +                                XType, N0, Shift);
    +      AddToWorkList(Shift.getNode());
    +      AddToWorkList(Add.getNode());
    +      return DAG.getNode(ISD::XOR, DL, XType, Add, Shift);
         }
       }
     
    
    
    
    
    From baldrick at free.fr  Thu Jul  8 08:06:08 2010
    From: baldrick at free.fr (Duncan Sands)
    Date: Thu, 08 Jul 2010 13:06:08 -0000
    Subject: [llvm-commits] [llvm] r107869 - in /llvm/trunk/include/llvm:
     ADT/PostOrderIterator.h Analysis/IntervalIterator.h
    Message-ID: <20100708130608.96C702A6C12C@llvm.org>
    
    Author: baldrick
    Date: Thu Jul  8 08:06:08 2010
    New Revision: 107869
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107869&view=rev
    Log:
    Use std::vector rather than SmallVector here because SmallVector
    causes some versions of gcc to crash when building LLVM.
    
    Modified:
        llvm/trunk/include/llvm/ADT/PostOrderIterator.h
        llvm/trunk/include/llvm/Analysis/IntervalIterator.h
    
    Modified: llvm/trunk/include/llvm/ADT/PostOrderIterator.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PostOrderIterator.h?rev=107869&r1=107868&r2=107869&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/ADT/PostOrderIterator.h (original)
    +++ llvm/trunk/include/llvm/ADT/PostOrderIterator.h Thu Jul  8 08:06:08 2010
    @@ -18,7 +18,6 @@
     
     #include "llvm/ADT/GraphTraits.h"
     #include "llvm/ADT/SmallPtrSet.h"
    -#include "llvm/ADT/SmallVector.h"
     #include 
     #include 
     
    @@ -52,7 +51,7 @@
     
       // VisitStack - Used to maintain the ordering.  Top = current block
       // First element is basic block pointer, second is the 'next child' to visit
    -  SmallVector, 16> VisitStack;
    +  std::vector > VisitStack;
     
       void traverseChild() {
         while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) {
    
    Modified: llvm/trunk/include/llvm/Analysis/IntervalIterator.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalIterator.h?rev=107869&r1=107868&r2=107869&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/Analysis/IntervalIterator.h (original)
    +++ llvm/trunk/include/llvm/Analysis/IntervalIterator.h Thu Jul  8 08:06:08 2010
    @@ -33,12 +33,12 @@
     #ifndef LLVM_INTERVAL_ITERATOR_H
     #define LLVM_INTERVAL_ITERATOR_H
     
    -#include "llvm/ADT/SmallVector.h"
     #include "llvm/Analysis/IntervalPartition.h"
     #include "llvm/Function.h"
     #include "llvm/Support/CFG.h"
    -#include 
     #include 
    +#include 
    +#include 
     
     namespace llvm {
     
    @@ -88,7 +88,7 @@
     template,
              class IGT = GraphTraits > >
     class IntervalIterator {
    -  SmallVector, 16> IntStack;
    +  std::vector > IntStack;
       std::set Visited;
       OrigContainer_t *OrigContainer;
       bool IOwnMem;     // If True, delete intervals when done with them
    
    
    
    
    From espindola at google.com  Thu Jul  8 09:19:07 2010
    From: espindola at google.com (Rafael Espindola)
    Date: Thu, 8 Jul 2010 10:19:07 -0400
    Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups
    In-Reply-To: 
    References: 
    	<8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com>
    	
    Message-ID: 
    
    I think I found the correct method: getTransientStackAlignment.
    
    The attached patch uses it. Is it OK?
    
    Cheers,
    -- 
    Rafael ?vila de Esp?ndola
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: vaarg.patch
    Type: text/x-diff
    Size: 6117 bytes
    Desc: not available
    Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100708/cb19509b/attachment.bin 
    
    From espindola at google.com  Thu Jul  8 09:34:29 2010
    From: espindola at google.com (Rafael Espindola)
    Date: Thu, 8 Jul 2010 10:34:29 -0400
    Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups
    In-Reply-To: 
    References: 
    	<8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com>
    	
    	
    Message-ID: 
    
    Now with the comment fixed too.
    
    Cheers,
    -- 
    Rafael ?vila de Esp?ndola
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: vaarg.patch
    Type: text/x-diff
    Size: 6043 bytes
    Desc: not available
    Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100708/41496140/attachment.bin 
    
    From baldrick at free.fr  Thu Jul  8 10:10:11 2010
    From: baldrick at free.fr (Duncan Sands)
    Date: Thu, 08 Jul 2010 17:10:11 +0200
    Subject: [llvm-commits] [PATCH] Add a instcombine optimization.
    In-Reply-To: <4A50AB2D-4D4B-4EC0-A6A3-2F9457C6FD9C@gmail.com>
    References: <5728FE48-1EF0-4A7B-A11D-AE2E95B40227@gmail.com>
    	<4C357A78.2090005@free.fr>
    	<4A50AB2D-4D4B-4EC0-A6A3-2F9457C6FD9C@gmail.com>
    Message-ID: <4C35EA53.7000607@free.fr>
    
    Hi Benjamin,
    
    >>> The attached patch adds a new transformation to instcombine:
    >>> (X>s -1) ? C1 : C2 -->   ((X>>s 31)&   (C2 - C1)) + C1
    >>
    >> how about (X>s -1) ? C1 : C2 -->   ((X>>s 31)&  (C2 xor C1)) xor C1
    >> instead?  It might interact better with other bit fiddling optimizations.
    >> Otherwise the patch looks good.
    >
    > Hmm, but we wont get a lea on x86 with xor.
    
    maybe this is a sign that it should be a DAGCombiner optimization rather
    than an instcombine one?
    
    Ciao,
    
    Duncan.
    
    I don't think xor is profitable
    > unless we extend the optimization to transform non-const C1 and C2 too.
    
    
    
    
    From grosbach at apple.com  Thu Jul  8 10:47:49 2010
    From: grosbach at apple.com (Jim Grosbach)
    Date: Thu, 8 Jul 2010 08:47:49 -0700
    Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk:
    	include/llvm/CodeGen/RegisterScavenging.h	lib/CodeGen/PrologEpilogInserter.cpp
    	lib/CodeGen/RegisterScavenging.cpp
    In-Reply-To: <3DB6043D-A396-487E-AFA2-41EADC74803B@apple.com>
    References: <20100708003854.AB2F12A6C12C@llvm.org>
    	<70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk>
    	
    	<3DB6043D-A396-487E-AFA2-41EADC74803B@apple.com>
    Message-ID: <3D73D5BA-7463-471C-A76C-328421CCB6C4@apple.com>
    
    
    On Jul 7, 2010, at 9:59 PM, Evan Cheng wrote:
    
    > 
    > 
    > On Jul 7, 2010, at 7:48 PM, Jim Grosbach  wrote:
    > 
    >> 
    >> On Jul 7, 2010, at 6:23 PM, Jakob Stoklund Olesen wrote:
    >> 
    >>> 
    >>> On Jul 7, 2010, at 5:38 PM, Jim Grosbach wrote:
    >>>> Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
    >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=107847&r1=107846&r2=107847&view=diff
    >>>> ==============================================================================
    >>>> --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
    >>>> +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jul  7 19:38:54 2010
    >>>> @@ -885,10 +885,20 @@
    >>>>          // Scavenge a new scratch register
    >>>>          CurrentVirtReg = Reg;
    >>>>          const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg);
    >>>> -            CurrentScratchReg = RS->FindUnusedReg(RC);
    >>>> -            if (CurrentScratchReg == 0)
    >>>> +            const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
    >>>> +            BitVector Candidates(TRI->getNumRegs());
    >>>> +            RS->getRegsAvailable(RC, Candidates);
    >>>> +
    >>>> +            // If there are any registers available, use the one that's
    >>>> +            // unused for the longest after this instruction. That increases
    >>>> +            // the ability to reuse the value.
    >>>> +            if (Candidates.any()) {
    >>>> +              MachineBasicBlock::iterator UMI;
    >>>> +              CurrentScratchReg = RS->findSurvivorReg(I, Candidates, 25, UMI);
    >>>> +            } else {
    >>>>            // No register is "free". Scavenge a register.
    >>>>            CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj);
    >>>> +            }
    >>>> 
    >>>>          PrevValue = Value;
    >>>>        }
    >>> 
    >>> This looks like a method that escaped from RegScavenger. Isn't RegScavenger::scavengeRegister already doing this?
    >>> 
    >>> I think
    >>> 
    >>>             CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj);
    >>> 
    >>> is all you need.
    >>> 
    >>> 
    >> 
    >> It's close, but not quite. scavengeRegister() will find the register of the indicated register class that's used furthest away. It considers all registers of the register class as candidates, however, not just the available ones. Essentially, it's almost assuming that a spill will be required, but does have an early exit if for some reason it's called and finds a register that is available. That could just as easily be an assert, really.
    >> 
    >> Previously, we looked for an available register, taking the first one we noticed if one or more exists; otherwise, we called scavengeRegister() to find a reasonable choice to spill and free up a register to use. Now, we apply the same heuristic for "reasonable to use" to selecting amongst the available registers, not just when spilling.
    > 
    > Does it make sense to move the code into RS?
    
    I think so, yes. I've been pondering whether it makes more sense to add a new method or to modify scavengeRegister() such that it'll incorporate this use-case directly. I'm leaning towards the latter, since as Jakob correctly points out, they're so similar already.
    
    
    > Also, what's the magic number 25?
    > 
    
    Upper limit on how far ahead to scan for uses of the registers. That's the magic number the RS uses, so I mirrored that here. It would be better, I think, to change the operand order and give it a default value. I figured one change at a time, though, so didn't do that as part of the initial checkin.
    
    
    > Evan
    > 
    >> 
    >> -Jim
    >> 
    >> 
    >> 
    >> 
    >> _______________________________________________
    >> llvm-commits mailing list
    >> llvm-commits at cs.uiuc.edu
    >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
    
    
    
    
    From stoklund at 2pi.dk  Thu Jul  8 11:03:19 2010
    From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
    Date: Thu, 8 Jul 2010 09:03:19 -0700
    Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk:
    	include/llvm/CodeGen/RegisterScavenging.h	lib/CodeGen/PrologEpilogInserter.cpp
    	lib/CodeGen/RegisterScavenging.cpp
    In-Reply-To: <3D73D5BA-7463-471C-A76C-328421CCB6C4@apple.com>
    References: <20100708003854.AB2F12A6C12C@llvm.org>
    	<70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk>
    	
    	<3DB6043D-A396-487E-AFA2-41EADC74803B@apple.com>
    	<3D73D5BA-7463-471C-A76C-328421CCB6C4@apple.com>
    Message-ID: 
    
    
    On Jul 8, 2010, at 8:47 AM, Jim Grosbach wrote:
    >>> It's close, but not quite. scavengeRegister() will find the register of the indicated register class that's used furthest away. It considers all registers of the register class as candidates, however, not just the available ones. Essentially, it's almost assuming that a spill will be required, but does have an early exit if for some reason it's called and finds a register that is available. That could just as easily be an assert, really.
    >>> 
    >>> Previously, we looked for an available register, taking the first one we noticed if one or more exists; otherwise, we called scavengeRegister() to find a reasonable choice to spill and free up a register to use. Now, we apply the same heuristic for "reasonable to use" to selecting amongst the available registers, not just when spilling.
    >> 
    >> Does it make sense to move the code into RS?
    > 
    > I think so, yes. I've been pondering whether it makes more sense to add a new method or to modify scavengeRegister() such that it'll incorporate this use-case directly. I'm leaning towards the latter, since as Jakob correctly points out, they're so similar already.
    
    It should be as simple as:
    
    if ((Candidates & RegsAvailable).any())
      Candidates &= RegsAvailable:
    
    in the right place.
    
    
    
    
    
    From bob.wilson at apple.com  Thu Jul  8 11:03:09 2010
    From: bob.wilson at apple.com (Bob Wilson)
    Date: Thu, 08 Jul 2010 16:03:09 -0000
    Subject: [llvm-commits] [zorg] r107876 - /zorg/trunk/lnt/lnt/tests/nt.py
    Message-ID: <20100708160309.282E82A6C12C@llvm.org>
    
    Author: bwilson
    Date: Thu Jul  8 11:03:08 2010
    New Revision: 107876
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107876&view=rev
    Log:
    Fix setting of DISABLE_ASSERTIONS.  For some reason, our makefiles are
    inconsistent and use DISABLE_ASSERTIONS instead of ENABLE_ASSERTIONS.
    
    Modified:
        zorg/trunk/lnt/lnt/tests/nt.py
    
    Modified: zorg/trunk/lnt/lnt/tests/nt.py
    URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/nt.py?rev=107876&r1=107875&r2=107876&view=diff
    ==============================================================================
    --- zorg/trunk/lnt/lnt/tests/nt.py (original)
    +++ zorg/trunk/lnt/lnt/tests/nt.py Thu Jul  8 11:03:08 2010
    @@ -66,7 +66,6 @@
         else:
             fatal('invalid build mode: %r' % opts.build_mode)
     
    -    make_variables['DISABLE_ASSERTIONS'] = '1'
         while build_mode:
             for (name,key) in (('+Asserts', 'ENABLE_ASSERTIONS'),
                                ('+Checks', 'ENABLE_EXPENSIVE_CHECKS'),
    @@ -80,6 +79,12 @@
             else:
                 fatal('invalid build mode: %r' % opts.build_mode)
     
    +    # Assertions are disabled by default.
    +    if 'ENABLE_ASSERTIONS' in make_variables:
    +        del make_variables['ENABLE_ASSERTIONS']
    +    else:
    +        make_variables['DISABLE_ASSERTIONS'] = '1'
    +
         # Set the optimization level options.
         make_variables['OPTFLAGS'] = opts.optimize_option
         if opts.optimize_option == '-Os':
    
    
    
    
    From bob.wilson at apple.com  Thu Jul  8 11:03:57 2010
    From: bob.wilson at apple.com (Bob Wilson)
    Date: Thu, 08 Jul 2010 16:03:57 -0000
    Subject: [llvm-commits] [test-suite] r107877 -
    	/test-suite/trunk/Makefile.rules
    Message-ID: <20100708160357.3F5A32A6C12C@llvm.org>
    
    Author: bwilson
    Date: Thu Jul  8 11:03:57 2010
    New Revision: 107877
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107877&view=rev
    Log:
    Fix comment to match use of DISABLE_ASSERTIONS.
    
    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=107877&r1=107876&r2=107877&view=diff
    ==============================================================================
    --- test-suite/trunk/Makefile.rules (original)
    +++ test-suite/trunk/Makefile.rules Thu Jul  8 11:03:57 2010
    @@ -152,8 +152,8 @@
       CONFIGURATION := $(CONFIGURATION)+Profile
     endif
     
    -# If ENABLE_ASSERTIONS=1 is specified (make command line or configured),
    -# then adjust the CONFIGURATION name appropriately (to match LLVM makefiles)
    +# Unless DISABLE_ASSERTIONS=1 is specified (make command line or configured),
    +# adjust the CONFIGURATION name appropriately (to match LLVM makefiles)
     ifneq ($(DISABLE_ASSERTIONS),1)
       CONFIGURATION := $(CONFIGURATION)+Asserts
     endif
    
    
    
    
    From grosbach at apple.com  Thu Jul  8 11:10:53 2010
    From: grosbach at apple.com (Jim Grosbach)
    Date: Thu, 8 Jul 2010 09:10:53 -0700
    Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk:
    	include/llvm/CodeGen/RegisterScavenging.h	lib/CodeGen/PrologEpilogInserter.cpp
    	lib/CodeGen/RegisterScavenging.cpp
    In-Reply-To: 
    References: <20100708003854.AB2F12A6C12C@llvm.org>
    	<70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk>
    	
    	<3DB6043D-A396-487E-AFA2-41EADC74803B@apple.com>
    	<3D73D5BA-7463-471C-A76C-328421CCB6C4@apple.com>
    	
    Message-ID: <2221F725-21B6-4085-82F8-4897D5AE4E77@apple.com>
    
    
    On Jul 8, 2010, at 9:03 AM, Jakob Stoklund Olesen wrote:
    
    > 
    > On Jul 8, 2010, at 8:47 AM, Jim Grosbach wrote:
    >>>> It's close, but not quite. scavengeRegister() will find the register of the indicated register class that's used furthest away. It considers all registers of the register class as candidates, however, not just the available ones. Essentially, it's almost assuming that a spill will be required, but does have an early exit if for some reason it's called and finds a register that is available. That could just as easily be an assert, really.
    >>>> 
    >>>> Previously, we looked for an available register, taking the first one we noticed if one or more exists; otherwise, we called scavengeRegister() to find a reasonable choice to spill and free up a register to use. Now, we apply the same heuristic for "reasonable to use" to selecting amongst the available registers, not just when spilling.
    >>> 
    >>> Does it make sense to move the code into RS?
    >> 
    >> I think so, yes. I've been pondering whether it makes more sense to add a new method or to modify scavengeRegister() such that it'll incorporate this use-case directly. I'm leaning towards the latter, since as Jakob correctly points out, they're so similar already.
    > 
    > It should be as simple as:
    > 
    > if ((Candidates & RegsAvailable).any())
    >  Candidates &= RegsAvailable:
    > 
    > in the right place.
    > 
    > 
    
    Well, almost. scavengeRegister() still needs to handle the fall-back of considering all registers, not just the available ones. In any case, I do think that's the way to go, so I'll take care of it in a few.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100708/a5cb6811/attachment.html 
    
    From grosbach at apple.com  Thu Jul  8 11:35:40 2010
    From: grosbach at apple.com (Jim Grosbach)
    Date: Thu, 8 Jul 2010 09:35:40 -0700
    Subject: [llvm-commits] [llvm] r107847 - in /llvm/trunk:
    	include/llvm/CodeGen/RegisterScavenging.h	lib/CodeGen/PrologEpilogInserter.cpp
    	lib/CodeGen/RegisterScavenging.cpp
    In-Reply-To: <2221F725-21B6-4085-82F8-4897D5AE4E77@apple.com>
    References: <20100708003854.AB2F12A6C12C@llvm.org>
    	<70A40112-C2B9-4FA8-9765-4C158C40463F@2pi.dk>
    	
    	<3DB6043D-A396-487E-AFA2-41EADC74803B@apple.com>
    	<3D73D5BA-7463-471C-A76C-328421CCB6C4@apple.com>
    	
    	<2221F725-21B6-4085-82F8-4897D5AE4E77@apple.com>
    Message-ID: 
    
    
    On Jul 8, 2010, at 9:10 AM, Jim Grosbach wrote:
    
    > 
    > On Jul 8, 2010, at 9:03 AM, Jakob Stoklund Olesen wrote:
    > 
    >> 
    >> On Jul 8, 2010, at 8:47 AM, Jim Grosbach wrote:
    >>>>> It's close, but not quite. scavengeRegister() will find the register of the indicated register class that's used furthest away. It considers all registers of the register class as candidates, however, not just the available ones. Essentially, it's almost assuming that a spill will be required, but does have an early exit if for some reason it's called and finds a register that is available. That could just as easily be an assert, really.
    >>>>> 
    >>>>> Previously, we looked for an available register, taking the first one we noticed if one or more exists; otherwise, we called scavengeRegister() to find a reasonable choice to spill and free up a register to use. Now, we apply the same heuristic for "reasonable to use" to selecting amongst the available registers, not just when spilling.
    >>>> 
    >>>> Does it make sense to move the code into RS?
    >>> 
    >>> I think so, yes. I've been pondering whether it makes more sense to add a new method or to modify scavengeRegister() such that it'll incorporate this use-case directly. I'm leaning towards the latter, since as Jakob correctly points out, they're so similar already.
    >> 
    >> It should be as simple as:
    >> 
    >> if ((Candidates & RegsAvailable).any())
    >>  Candidates &= RegsAvailable:
    >> 
    >> in the right place.
    >> 
    >> 
    > 
    > Well, almost. scavengeRegister() still needs to handle the fall-back of considering all registers, not just the available ones.
    
    Woops. I read too quickly. Saw what I expected, not what you actually wrote. Yes, that's what's needed.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100708/c701d6fc/attachment.html 
    
    From stoklund at 2pi.dk  Thu Jul  8 11:40:15 2010
    From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
    Date: Thu, 08 Jul 2010 16:40:15 -0000
    Subject: [llvm-commits] [llvm] r107878 - in /llvm/trunk/lib:
     CodeGen/LiveIntervalAnalysis.cpp CodeGen/LowerSubregs.cpp
     CodeGen/ProcessImplicitDefs.cpp CodeGen/RegisterCoalescer.cpp
     CodeGen/SimpleRegisterCoalescing.cpp CodeGen/StackSlotColoring.cpp
     CodeGen/TwoAddressInstructionPass.cpp Target/X86/X86InstrInfo.cpp
    Message-ID: <20100708164015.9F82F2A6C12C@llvm.org>
    
    Author: stoklund
    Date: Thu Jul  8 11:40:15 2010
    New Revision: 107878
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107878&view=rev
    Log:
    Remove references to INSERT_SUBREG after de-SSA.
    
    Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of
    INSERT_SUBREG.
    
    Modified:
        llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
        llvm/trunk/lib/CodeGen/LowerSubregs.cpp
        llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp
        llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
        llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
        llvm/trunk/lib/CodeGen/StackSlotColoring.cpp
        llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
        llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
    
    Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
    +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Jul  8 11:40:15 2010
    @@ -324,12 +324,6 @@
         if (mi->isCopyLike() ||
             tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) {
           CopyMI = mi;
    -
    -      // Some of the REG_SEQUENCE lowering in TwoAddressInstrPass creates
    -      // implicit defs without really knowing. It shows up as INSERT_SUBREG
    -      // using an undefined register.
    -      if (mi->isInsertSubreg())
    -        mi->getOperand(1).setIsUndef();
         }
     
         VNInfo *ValNo = interval.getNextValue(defIndex, CopyMI, true,
    
    Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original)
    +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Jul  8 11:40:15 2010
    @@ -54,7 +54,6 @@
     
       private:
         bool LowerExtract(MachineInstr *MI);
    -    bool LowerInsert(MachineInstr *MI);
         bool LowerSubregToReg(MachineInstr *MI);
         bool LowerCopy(MachineInstr *MI);
     
    @@ -225,85 +224,6 @@
       return true;
     }
     
    -bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
    -  MachineBasicBlock *MBB = MI->getParent();
    -  assert((MI->getOperand(0).isReg() && MI->getOperand(0).isDef()) &&
    -         (MI->getOperand(1).isReg() && MI->getOperand(1).isUse()) &&
    -         (MI->getOperand(2).isReg() && MI->getOperand(2).isUse()) &&
    -          MI->getOperand(3).isImm() && "Invalid insert_subreg");
    -          
    -  unsigned DstReg = MI->getOperand(0).getReg();
    -#ifndef NDEBUG
    -  unsigned SrcReg = MI->getOperand(1).getReg();
    -#endif
    -  unsigned InsReg = MI->getOperand(2).getReg();
    -  unsigned SubIdx = MI->getOperand(3).getImm();     
    -
    -  assert(DstReg == SrcReg && "insert_subreg not a two-address instruction?");
    -  assert(SubIdx != 0 && "Invalid index for insert_subreg");
    -  unsigned DstSubReg = TRI->getSubReg(DstReg, SubIdx);
    -  assert(DstSubReg && "invalid subregister index for register");
    -  assert(TargetRegisterInfo::isPhysicalRegister(SrcReg) &&
    -         "Insert superreg source must be in a physical register");
    -  assert(TargetRegisterInfo::isPhysicalRegister(InsReg) &&
    -         "Inserted value must be in a physical register");
    -
    -  DEBUG(dbgs() << "subreg: CONVERTING: " << *MI);
    -
    -  if (DstSubReg == InsReg) {
    -    // No need to insert an identity copy instruction. If the SrcReg was
    -    // , we need to make sure it is alive by inserting a KILL
    -    if (MI->getOperand(1).isUndef() && !MI->getOperand(0).isDead()) {
    -      MachineInstrBuilder MIB = BuildMI(*MBB, MI, MI->getDebugLoc(),
    -                                TII->get(TargetOpcode::KILL), DstReg);
    -      if (MI->getOperand(2).isUndef())
    -        MIB.addReg(InsReg, RegState::Undef);
    -      else
    -        MIB.addReg(InsReg, RegState::Kill);
    -    } else {
    -      DEBUG(dbgs() << "subreg: eliminated!\n");
    -      MBB->erase(MI);
    -      return true;
    -    }
    -  } else {
    -    // Insert sub-register copy
    -    if (MI->getOperand(2).isUndef())
    -      // If the source register being inserted is undef, then this becomes a
    -      // KILL.
    -      BuildMI(*MBB, MI, MI->getDebugLoc(),
    -              TII->get(TargetOpcode::KILL), DstSubReg);
    -    else {
    -      TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstSubReg, InsReg, false);
    -    }
    -    MachineBasicBlock::iterator CopyMI = MI;
    -    --CopyMI;
    -
    -    // INSERT_SUBREG is a two-address instruction so it implicitly kills SrcReg.
    -    if (!MI->getOperand(1).isUndef())
    -      CopyMI->addOperand(MachineOperand::CreateReg(DstReg, false, true, true));
    -
    -    // Transfer the kill/dead flags, if needed.
    -    if (MI->getOperand(0).isDead()) {
    -      TransferDeadFlag(MI, DstSubReg, TRI);
    -    } else {
    -      // Make sure the full DstReg is live after this replacement.
    -      CopyMI->addOperand(MachineOperand::CreateReg(DstReg, true, true));
    -    }
    -
    -    // Make sure the inserted register gets killed
    -    if (MI->getOperand(2).isKill() && !MI->getOperand(2).isUndef())
    -      TransferKillFlag(MI, InsReg, TRI);
    -  }
    -
    -  DEBUG({
    -      MachineBasicBlock::iterator dMI = MI;
    -      dbgs() << "subreg: " << *(--dMI) << "\n";
    -    });
    -
    -  MBB->erase(MI);
    -  return true;
    -}
    -
     bool LowerSubregsInstructionPass::LowerCopy(MachineInstr *MI) {
       MachineOperand &DstMO = MI->getOperand(0);
       MachineOperand &SrcMO = MI->getOperand(1);
    @@ -359,10 +279,9 @@
              mi != me;) {
           MachineBasicBlock::iterator nmi = llvm::next(mi);
           MachineInstr *MI = mi;
    +      assert(!MI->isInsertSubreg() && "INSERT_SUBREG should no longer appear");
           if (MI->isExtractSubreg()) {
             MadeChange |= LowerExtract(MI);
    -      } else if (MI->isInsertSubreg()) {
    -        MadeChange |= LowerInsert(MI);
           } else if (MI->isSubregToReg()) {
             MadeChange |= LowerSubregToReg(MI);
           } else if (MI->isCopy()) {
    
    Modified: llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp (original)
    +++ llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp Thu Jul  8 11:40:15 2010
    @@ -102,21 +102,6 @@
             continue;
           }
     
    -      if (MI->isInsertSubreg()) {
    -        MachineOperand &MO = MI->getOperand(2);
    -        if (ImpDefRegs.count(MO.getReg())) {
    -          // %reg1032 = INSERT_SUBREG %reg1032, undef, 2
    -          // This is an identity copy, eliminate it now.
    -          if (MO.isKill()) {
    -            LiveVariables::VarInfo& vi = lv_->getVarInfo(MO.getReg());
    -            vi.removeKill(MI);
    -          }
    -          MI->eraseFromParent();
    -          Changed = true;
    -          continue;
    -        }
    -      }
    -
           // Eliminate %reg1032:sub = COPY undef.
           if (MI->isCopy() && MI->getOperand(0).getSubReg()) {
             MachineOperand &MO = MI->getOperand(1);
    
    Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
    +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Thu Jul  8 11:40:15 2010
    @@ -54,7 +54,7 @@
         DstSub = MI->getOperand(0).getSubReg();
         Src = MI->getOperand(1).getReg();
         SrcSub = compose(MI->getOperand(1).getSubReg(), MI->getOperand(2).getImm());
    -  } else if (MI->isInsertSubreg() || MI->isSubregToReg()) {
    +  } else if (MI->isSubregToReg()) {
         Dst = MI->getOperand(0).getReg();
         DstSub = compose(MI->getOperand(0).getSubReg(), MI->getOperand(3).getImm());
         Src = MI->getOperand(2).getReg();
    
    Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
    +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Jul  8 11:40:15 2010
    @@ -1528,12 +1528,7 @@
         if (Inst->isCopy() || Inst->isExtractSubreg()) {
           DstReg = Inst->getOperand(0).getReg();
           SrcReg = Inst->getOperand(1).getReg();
    -    } else if (Inst->isInsertSubreg()) {
    -      DstReg = Inst->getOperand(0).getReg();
    -      SrcReg = Inst->getOperand(2).getReg();
    -      if (Inst->getOperand(1).isUndef())
    -        isInsUndef = true;
    -    } else if (Inst->isInsertSubreg() || Inst->isSubregToReg()) {
    +    } else if (Inst->isSubregToReg()) {
           DstReg = Inst->getOperand(0).getReg();
           SrcReg = Inst->getOperand(2).getReg();
         } else if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg, SrcSubIdx, DstSubIdx))
    
    Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original)
    +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Thu Jul  8 11:40:15 2010
    @@ -508,8 +508,7 @@
     
             // Abort the use is actually a sub-register def. We don't have enough
             // information to figure out if it is really legal.
    -        if (MO.getSubReg() || MII->isExtractSubreg() ||
    -            MII->isInsertSubreg() || MII->isSubregToReg())
    +        if (MO.getSubReg() || MII->isExtractSubreg() || MII->isSubregToReg())
               return false;
     
             const TargetRegisterClass *RC = TID.OpInfo[i].getRegClass(TRI);
    
    Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
    +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Thu Jul  8 11:40:15 2010
    @@ -1359,25 +1359,11 @@
     
         // Insert a copy or an extract to replace the original extracts.
         MachineBasicBlock::iterator InsertLoc = SomeMI;
    -    if (NewSrcSubIdx) {
    -      // Insert an extract subreg.
    -      BuildMI(*SomeMI->getParent(), InsertLoc, SomeMI->getDebugLoc(),
    -              TII->get(TargetOpcode::EXTRACT_SUBREG), DstReg)
    -        .addReg(SrcReg).addImm(NewSrcSubIdx);
    -    } else if (NewDstSubIdx) {
    -      // Do a subreg insertion.
    -      BuildMI(*SomeMI->getParent(), InsertLoc, SomeMI->getDebugLoc(),
    -              TII->get(TargetOpcode::INSERT_SUBREG), DstReg)
    -        .addReg(DstReg).addReg(SrcReg).addImm(NewDstSubIdx);
    -    } else {
    -      // Insert a copy.
    -      bool Emitted =
    -        TII->copyRegToReg(*SomeMI->getParent(), InsertLoc, DstReg, SrcReg,
    -                          MRI->getRegClass(DstReg), MRI->getRegClass(SrcReg),
    -                          SomeMI->getDebugLoc());
    -      (void)Emitted;
    -    }
    -    MachineBasicBlock::iterator CopyMI = prior(InsertLoc);
    +    MachineInstr *CopyMI = BuildMI(*SomeMI->getParent(), SomeMI,
    +                                   SomeMI->getDebugLoc(),
    +                                   TII->get(TargetOpcode::COPY))
    +      .addReg(DstReg, RegState::Define, NewDstSubIdx)
    +      .addReg(SrcReg, 0, NewSrcSubIdx);
     
         // Remove all the old extract instructions.
         for (MachineRegisterInfo::use_nodbg_iterator
    
    Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=107878&r1=107877&r2=107878&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
    +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Jul  8 11:40:15 2010
    @@ -1145,10 +1145,9 @@
       // least on modern x86 machines).
       BuildMI(*MFI, MBBI, MI->getDebugLoc(), get(X86::IMPLICIT_DEF), leaInReg);
       MachineInstr *InsMI =
    -    BuildMI(*MFI, MBBI, MI->getDebugLoc(), get(X86::INSERT_SUBREG),leaInReg)
    -    .addReg(leaInReg)
    -    .addReg(Src, getKillRegState(isKill))
    -    .addImm(X86::sub_16bit);
    +    BuildMI(*MFI, MBBI, MI->getDebugLoc(), get(TargetOpcode::COPY))
    +    .addReg(leaInReg, RegState::Define, X86::sub_16bit)
    +    .addReg(Src, getKillRegState(isKill));
     
       MachineInstrBuilder MIB = BuildMI(*MFI, MBBI, MI->getDebugLoc(),
                                         get(Opc), leaOutReg);
    @@ -1189,10 +1188,9 @@
           // well be shifting and then extracting the lower 16-bits. 
           BuildMI(*MFI, MIB, MI->getDebugLoc(), get(X86::IMPLICIT_DEF), leaInReg2);
           InsMI2 =
    -        BuildMI(*MFI, MIB, MI->getDebugLoc(), get(X86::INSERT_SUBREG),leaInReg2)
    -        .addReg(leaInReg2)
    -        .addReg(Src2, getKillRegState(isKill2))
    -        .addImm(X86::sub_16bit);
    +        BuildMI(*MFI, MIB, MI->getDebugLoc(), get(TargetOpcode::COPY))
    +        .addReg(leaInReg2, RegState::Define, X86::sub_16bit)
    +        .addReg(Src2, getKillRegState(isKill2));
           addRegReg(MIB, leaInReg, true, leaInReg2, true);
         }
         if (LV && isKill2 && InsMI2)
    
    
    
    
    From stoklund at 2pi.dk  Thu Jul  8 11:40:23 2010
    From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
    Date: Thu, 08 Jul 2010 16:40:23 -0000
    Subject: [llvm-commits] [llvm] r107879 - in /llvm/trunk:
     include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/
     lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/X86/
    Message-ID: <20100708164023.4CA252A6C12D@llvm.org>
    
    Author: stoklund
    Date: Thu Jul  8 11:40:22 2010
    New Revision: 107879
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107879&view=rev
    Log:
    Convert EXTRACT_SUBREG to COPY when emitting machine instrs.
    
    EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.
    
    Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
    The isMoveInstr hook will be removed later.
    
    Modified:
        llvm/trunk/include/llvm/CodeGen/MachineInstr.h
        llvm/trunk/include/llvm/Target/TargetInstrInfo.h
        llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
        llvm/trunk/lib/CodeGen/LowerSubregs.cpp
        llvm/trunk/lib/CodeGen/MachineCSE.cpp
        llvm/trunk/lib/CodeGen/OptimizeExts.cpp
        llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp
        llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
        llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
        llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
        llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
        llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
        llvm/trunk/lib/CodeGen/StackSlotColoring.cpp
        llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
        llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
        llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp
        llvm/trunk/lib/Target/X86/X86FastISel.cpp
        llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
    
    Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
    +++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Thu Jul  8 11:40:22 2010
    @@ -215,9 +215,6 @@
       bool isKill() const { return getOpcode() == TargetOpcode::KILL; }
       bool isImplicitDef() const { return getOpcode()==TargetOpcode::IMPLICIT_DEF; }
       bool isInlineAsm() const { return getOpcode() == TargetOpcode::INLINEASM; }
    -  bool isExtractSubreg() const {
    -    return getOpcode() == TargetOpcode::EXTRACT_SUBREG;
    -  }
       bool isInsertSubreg() const {
         return getOpcode() == TargetOpcode::INSERT_SUBREG;
       }
    @@ -234,7 +231,13 @@
       /// isCopyLike - Return true if the instruction behaves like a copy.
       /// This does not include native copy instructions.
       bool isCopyLike() const {
    -    return isCopy() || isSubregToReg() || isExtractSubreg() || isInsertSubreg();
    +    return isCopy() || isSubregToReg();
    +  }
    +
    +  /// isIdentityCopy - Return true is the instruction is an identity copy.
    +  bool isIdentityCopy() const {
    +    return isCopy() && getOperand(0).getReg() == getOperand(1).getReg() &&
    +      getOperand(0).getSubReg() == getOperand(1).getSubReg();
       }
     
       /// readsRegister - Return true if the MachineInstr reads the specified
    
    Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)
    +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Jul  8 11:40:22 2010
    @@ -122,10 +122,6 @@
             SrcReg == DstReg)
           return true;
     
    -    if (MI.getOpcode() == TargetOpcode::EXTRACT_SUBREG &&
    -        MI.getOperand(0).getReg() == MI.getOperand(1).getReg())
    -    return true;
    -
         if ((MI.getOpcode() == TargetOpcode::INSERT_SUBREG ||
              MI.getOpcode() == TargetOpcode::SUBREG_TO_REG) &&
             MI.getOperand(0).getReg() == MI.getOperand(2).getReg())
    
    Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
    +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Jul  8 11:40:22 2010
    @@ -192,6 +192,9 @@
         if (tii_->isMoveInstr(MI, SrcReg, DstReg, SrcSubReg, DstSubReg))
           if (SrcReg == li.reg || DstReg == li.reg)
             continue;
    +    if (MI.isCopy() && MI.getOperand(0).getReg() == li.reg &&
    +        MI.getOperand(1).getReg() == li.reg)
    +      continue;
     
         // Check for operands using reg
         for (unsigned i = 0, e = MI.getNumOperands(); i != e;  ++i) {
    
    Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original)
    +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Jul  8 11:40:22 2010
    @@ -53,7 +53,6 @@
         bool runOnMachineFunction(MachineFunction&);
     
       private:
    -    bool LowerExtract(MachineInstr *MI);
         bool LowerSubregToReg(MachineInstr *MI);
         bool LowerCopy(MachineInstr *MI);
     
    @@ -121,57 +120,6 @@
       }
     }
     
    -bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
    -  MachineBasicBlock *MBB = MI->getParent();
    -
    -  assert(MI->getOperand(0).isReg() && MI->getOperand(0).isDef() &&
    -         MI->getOperand(1).isReg() && MI->getOperand(1).isUse() &&
    -         MI->getOperand(2).isImm() && "Malformed extract_subreg");
    -
    -  unsigned DstReg   = MI->getOperand(0).getReg();
    -  unsigned SuperReg = MI->getOperand(1).getReg();
    -  unsigned SubIdx   = MI->getOperand(2).getImm();
    -  unsigned SrcReg   = TRI->getSubReg(SuperReg, SubIdx);
    -
    -  assert(TargetRegisterInfo::isPhysicalRegister(SuperReg) &&
    -         "Extract supperg source must be a physical register");
    -  assert(TargetRegisterInfo::isPhysicalRegister(DstReg) &&
    -         "Extract destination must be in a physical register");
    -  assert(SrcReg && "invalid subregister index for register");
    -
    -  DEBUG(dbgs() << "subreg: CONVERTING: " << *MI);
    -
    -  if (SrcReg == DstReg) {
    -    // No need to insert an identity copy instruction.
    -    if (MI->getOperand(1).isKill()) {
    -      // We must make sure the super-register gets killed. Replace the
    -      // instruction with KILL.
    -      MI->setDesc(TII->get(TargetOpcode::KILL));
    -      MI->RemoveOperand(2);     // SubIdx
    -      DEBUG(dbgs() << "subreg: replace by: " << *MI);
    -      return true;
    -    }
    -
    -    DEBUG(dbgs() << "subreg: eliminated!");
    -  } else {
    -    TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstReg, SrcReg, false);
    -    // Transfer the kill/dead flags, if needed.
    -    if (MI->getOperand(0).isDead())
    -      TransferDeadFlag(MI, DstReg, TRI);
    -    if (MI->getOperand(1).isKill())
    -      TransferKillFlag(MI, SuperReg, TRI, true);
    -    TransferImplicitDefs(MI);
    -    DEBUG({
    -        MachineBasicBlock::iterator dMI = MI;
    -        dbgs() << "subreg: " << *(--dMI);
    -      });
    -  }
    -
    -  DEBUG(dbgs() << '\n');
    -  MBB->erase(MI);
    -  return true;
    -}
    -
     bool LowerSubregsInstructionPass::LowerSubregToReg(MachineInstr *MI) {
       MachineBasicBlock *MBB = MI->getParent();
       assert((MI->getOperand(0).isReg() && MI->getOperand(0).isDef()) &&
    @@ -280,9 +228,9 @@
           MachineBasicBlock::iterator nmi = llvm::next(mi);
           MachineInstr *MI = mi;
           assert(!MI->isInsertSubreg() && "INSERT_SUBREG should no longer appear");
    -      if (MI->isExtractSubreg()) {
    -        MadeChange |= LowerExtract(MI);
    -      } else if (MI->isSubregToReg()) {
    +      assert(MI->getOpcode() != TargetOpcode::EXTRACT_SUBREG &&
    +             "EXTRACT_SUBREG should no longer appear");
    +      if (MI->isSubregToReg()) {
             MadeChange |= LowerSubregToReg(MI);
           } else if (MI->isCopy()) {
             MadeChange |= LowerCopy(MI);
    
    Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original)
    +++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Thu Jul  8 11:40:22 2010
    @@ -126,6 +126,28 @@
           ++NumCoalesces;
           Changed = true;
         }
    +
    +    if (!DefMI->isCopy())
    +      continue;
    +    SrcReg = DefMI->getOperand(1).getReg();
    +    if (!TargetRegisterInfo::isVirtualRegister(SrcReg))
    +      continue;
    +    if (DefMI->getOperand(0).getSubReg() || DefMI->getOperand(1).getSubReg())
    +      continue;
    +    const TargetRegisterClass *SRC   = MRI->getRegClass(SrcReg);
    +    const TargetRegisterClass *RC    = MRI->getRegClass(Reg);
    +    const TargetRegisterClass *NewRC = getCommonSubClass(RC, SRC);
    +    if (!NewRC)
    +      continue;
    +    DEBUG(dbgs() << "Coalescing: " << *DefMI);
    +    DEBUG(dbgs() << "*** to: " << *MI);
    +    MO.setReg(SrcReg);
    +    MRI->clearKillFlags(SrcReg);
    +    if (NewRC != SRC)
    +      MRI->setRegClass(SrcReg, NewRC);
    +    DefMI->eraseFromParent();
    +    ++NumCoalesces;
    +    Changed = true;
       }
     
       return Changed;
    
    Modified: llvm/trunk/lib/CodeGen/OptimizeExts.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeExts.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/OptimizeExts.cpp (original)
    +++ llvm/trunk/lib/CodeGen/OptimizeExts.cpp Thu Jul  8 11:40:22 2010
    @@ -128,12 +128,12 @@
           //
           //    %reg1025 =  %reg1024
           //     ...
    -      //    %reg1027 = EXTRACT_SUBREG %reg1025, 4
    +      //    %reg1027 = COPY %reg1025:4
           //    %reg1026 = SUBREG_TO_REG 0, %reg1027, 4
           //
           // The problem here is that SUBREG_TO_REG is there to assert that an
           // implicit zext occurs. It doesn't insert a zext instruction. If we allow
    -      // the EXTRACT_SUBREG here, it will give us the value after the ,
    +      // the COPY here, it will give us the value after the ,
           // not the original value of %reg1024 before .
           if (UseMI->getOpcode() == TargetOpcode::SUBREG_TO_REG)
             continue;
    @@ -185,8 +185,8 @@
               continue;
             unsigned NewVR = MRI->createVirtualRegister(RC);
             BuildMI(*UseMBB, UseMI, UseMI->getDebugLoc(),
    -                TII->get(TargetOpcode::EXTRACT_SUBREG), NewVR)
    -          .addReg(DstReg).addImm(SubIdx);
    +                TII->get(TargetOpcode::COPY), NewVR)
    +          .addReg(DstReg, 0, SubIdx);
             UseMO->setReg(NewVR);
             ++NumReuse;
             Changed = true;
    
    Modified: llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp (original)
    +++ llvm/trunk/lib/CodeGen/ProcessImplicitDefs.cpp Thu Jul  8 11:40:22 2010
    @@ -50,8 +50,7 @@
         return true;
     
       switch(OpIdx) {
    -    case 1: return (MI->isExtractSubreg() || MI->isCopy()) &&
    -                   MI->getOperand(0).getSubReg() == 0;
    +    case 1: return MI->isCopy() && MI->getOperand(0).getSubReg() == 0;
         case 2: return MI->isSubregToReg() && MI->getOperand(0).getSubReg() == 0;
         default: return false;
       }
    
    Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
    +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Thu Jul  8 11:40:22 2010
    @@ -422,9 +422,10 @@
         unsigned SrcReg, DstReg, SrcSubReg, DstSubReg;
         if (vni->def != SlotIndex() && vni->isDefAccurate() &&
             (CopyMI = li_->getInstructionFromIndex(vni->def)) &&
    -        tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubReg, DstSubReg))
    +        (CopyMI->isCopy() ||
    +         tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubReg, DstSubReg)))
           // Defined by a copy, try to extend SrcReg forward
    -      CandReg = SrcReg;
    +      CandReg = CopyMI->isCopy() ? CopyMI->getOperand(1).getReg() : SrcReg;
         else if (TrivCoalesceEnds &&
                  (CopyMI =
                   li_->getInstructionFromIndex(range.end.getBaseIndex())) &&
    @@ -993,6 +994,24 @@
               if (Reg && allocatableRegs_[Reg] && RC->contains(Reg))
                 mri_->setRegAllocationHint(cur->reg, 0, Reg);
             }
    +      } else if (CopyMI && CopyMI->isCopy()) {
    +        DstReg = CopyMI->getOperand(0).getReg();
    +        DstSubReg = CopyMI->getOperand(0).getSubReg();
    +        SrcReg = CopyMI->getOperand(1).getReg();
    +        SrcSubReg = CopyMI->getOperand(1).getSubReg();
    +        unsigned Reg = 0;
    +        if (TargetRegisterInfo::isPhysicalRegister(SrcReg))
    +          Reg = SrcReg;
    +        else if (vrm_->isAssignedReg(SrcReg))
    +          Reg = vrm_->getPhys(SrcReg);
    +        if (Reg) {
    +          if (SrcSubReg)
    +            Reg = tri_->getSubReg(Reg, SrcSubReg);
    +          if (DstSubReg)
    +            Reg = tri_->getMatchingSuperReg(Reg, DstSubReg, RC);
    +          if (Reg && allocatableRegs_[Reg] && RC->contains(Reg))
    +            mri_->setRegAllocationHint(cur->reg, 0, Reg);
    +        }
           }
         }
       }
    
    Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
    +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Thu Jul  8 11:40:22 2010
    @@ -49,11 +49,6 @@
         DstSub = MI->getOperand(0).getSubReg();
         Src = MI->getOperand(1).getReg();
         SrcSub = MI->getOperand(1).getSubReg();
    -  } else if (MI->isExtractSubreg()) {
    -    Dst = MI->getOperand(0).getReg();
    -    DstSub = MI->getOperand(0).getSubReg();
    -    Src = MI->getOperand(1).getReg();
    -    SrcSub = compose(MI->getOperand(1).getSubReg(), MI->getOperand(2).getImm());
       } else if (MI->isSubregToReg()) {
         Dst = MI->getOperand(0).getReg();
         DstSub = compose(MI->getOperand(0).getSubReg(), MI->getOperand(3).getImm());
    
    Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
    +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Jul  8 11:40:22 2010
    @@ -1132,24 +1132,11 @@
     unsigned FastISel::FastEmitInst_extractsubreg(MVT RetVT,
                                                   unsigned Op0, bool Op0IsKill,
                                                   uint32_t Idx) {
    -  const TargetRegisterClass* RC = MRI.getRegClass(Op0);
    -  
       unsigned ResultReg = createResultReg(TLI.getRegClassFor(RetVT));
    -  const TargetInstrDesc &II = TII.get(TargetOpcode::EXTRACT_SUBREG);
    -  
    -  if (II.getNumDefs() >= 1)
    -    BuildMI(MBB, DL, II, ResultReg)
    -      .addReg(Op0, Op0IsKill * RegState::Kill)
    -      .addImm(Idx);
    -  else {
    -    BuildMI(MBB, DL, II)
    -      .addReg(Op0, Op0IsKill * RegState::Kill)
    -      .addImm(Idx);
    -    bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg,
    -                                         II.ImplicitDefs[0], RC, RC, DL);
    -    if (!InsertedCopy)
    -      ResultReg = 0;
    -  }
    +  assert(TargetRegisterInfo::isVirtualRegister(Op0) &&
    +         "Cannot yet extract from physregs");
    +  BuildMI(MBB, DL, TII.get(TargetOpcode::COPY), ResultReg)
    +    .addReg(Op0, getKillRegState(Op0IsKill), Idx);
       return ResultReg;
     }
     
    
    Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
    +++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Thu Jul  8 11:40:22 2010
    @@ -428,12 +428,9 @@
       }
       
       if (Opc == TargetOpcode::EXTRACT_SUBREG) {
    +    // EXTRACT_SUBREG is lowered as %dst = COPY %src:sub
         unsigned SubIdx = cast(Node->getOperand(1))->getZExtValue();
     
    -    // Create the extract_subreg machine instruction.
    -    MachineInstr *MI = BuildMI(*MF, Node->getDebugLoc(),
    -                               TII->get(TargetOpcode::EXTRACT_SUBREG));
    -
         // Figure out the register class to create for the destreg.
         unsigned VReg = getVR(Node->getOperand(0), VRBaseMap);
         const TargetRegisterClass *TRC = MRI->getRegClass(VReg);
    @@ -450,11 +447,16 @@
           VRBase = MRI->createVirtualRegister(SRC);
         }
     
    -    // Add def, source, and subreg index
    -    MI->addOperand(MachineOperand::CreateReg(VRBase, true));
    +    // Create the extract_subreg machine instruction.
    +    MachineInstr *MI = BuildMI(*MF, Node->getDebugLoc(),
    +                               TII->get(TargetOpcode::COPY), VRBase);
    +
    +    // Add source, and subreg index
         AddOperand(MI, Node->getOperand(0), 0, 0, VRBaseMap, /*IsDebug=*/false,
                    IsClone, IsCloned);
    -    MI->addOperand(MachineOperand::CreateImm(SubIdx));
    +    assert(TargetRegisterInfo::isVirtualRegister(MI->getOperand(1).getReg()) &&
    +           "Cannot yet extract from physregs");
    +    MI->getOperand(1).setSubReg(SubIdx);
         MBB->insert(InsertPos, MI);
       } else if (Opc == TargetOpcode::INSERT_SUBREG ||
                  Opc == TargetOpcode::SUBREG_TO_REG) {
    
    Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
    +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Jul  8 11:40:22 2010
    @@ -1525,7 +1525,7 @@
         // If this isn't a copy nor a extract_subreg, we can't join intervals.
         unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
         bool isInsUndef = false;
    -    if (Inst->isCopy() || Inst->isExtractSubreg()) {
    +    if (Inst->isCopy()) {
           DstReg = Inst->getOperand(0).getReg();
           SrcReg = Inst->getOperand(1).getReg();
         } else if (Inst->isSubregToReg()) {
    @@ -1657,6 +1657,8 @@
                E = mri_->use_nodbg_end(); I != E; ++I) {
           MachineOperand &Use = I.getOperand();
           MachineInstr *UseMI = Use.getParent();
    +      if (UseMI->isIdentityCopy())
    +        continue;
           unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
           if (tii_->isMoveInstr(*UseMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
               SrcReg == DstReg && SrcSubIdx == DstSubIdx)
    @@ -1687,7 +1689,8 @@
     
         // Ignore identity copies.
         unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
    -    if (!(tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
    +    if (!MI->isIdentityCopy() &&
    +        !(tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
               SrcReg == DstReg && SrcSubIdx == DstSubIdx))
           for (unsigned i = 0, NumOps = MI->getNumOperands(); i != NumOps; ++i) {
             MachineOperand &Use = MI->getOperand(i);
    @@ -1818,7 +1821,8 @@
     
           // If the move will be an identity move delete it
           bool isMove= tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx);
    -      if (isMove && SrcReg == DstReg && SrcSubIdx == DstSubIdx) {
    +      if (MI->isIdentityCopy() ||
    +          (isMove && SrcReg == DstReg && SrcSubIdx == DstSubIdx)) {
             if (li_->hasInterval(SrcReg)) {
               LiveInterval &RegInt = li_->getInterval(SrcReg);
               // If def of this move instruction is dead, remove its live range
    
    Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original)
    +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Thu Jul  8 11:40:22 2010
    @@ -508,7 +508,7 @@
     
             // Abort the use is actually a sub-register def. We don't have enough
             // information to figure out if it is really legal.
    -        if (MO.getSubReg() || MII->isExtractSubreg() || MII->isSubregToReg())
    +        if (MO.getSubReg() || MII->isSubregToReg())
               return false;
     
             const TargetRegisterClass *RC = TID.OpInfo[i].getRegClass(TRI);
    @@ -570,7 +570,7 @@
     
             // Abort the use is actually a sub-register use. We don't have enough
             // information to figure out if it is really legal.
    -        if (MO.getSubReg() || MII->isExtractSubreg())
    +        if (MO.getSubReg())
               return false;
     
             const TargetRegisterClass *RC = TID.OpInfo[i].getRegClass(TRI);
    
    Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
    +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Thu Jul  8 11:40:22 2010
    @@ -382,7 +382,7 @@
       DstReg = 0;
       unsigned SrcSubIdx, DstSubIdx;
       if (!TII->isMoveInstr(MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) {
    -    if (MI.isCopy() || MI.isExtractSubreg()) {
    +    if (MI.isCopy()) {
           DstReg = MI.getOperand(0).getReg();
           SrcReg = MI.getOperand(1).getReg();
         } else if (MI.isInsertSubreg()) {
    @@ -1291,7 +1291,7 @@
         if (SrcDefMI->getParent() != DstDefMI->getParent())
           continue;
     
    -    // If there are no other uses than extract_subreg which feed into
    +    // If there are no other uses than copies which feed into
         // the reg_sequence, then we might be able to coalesce them.
         bool CanCoalesce = true;
         SmallVector SrcSubIndices, DstSubIndices;
    @@ -1299,13 +1299,11 @@
                UI = MRI->use_nodbg_begin(SrcReg),
                UE = MRI->use_nodbg_end(); UI != UE; ++UI) {
           MachineInstr *UseMI = &*UI;
    -      if (!UseMI->isExtractSubreg() ||
    -          UseMI->getOperand(0).getReg() != DstReg ||
    -          UseMI->getOperand(1).getSubReg() != 0) {
    +      if (!UseMI->isCopy() || UseMI->getOperand(0).getReg() != DstReg) {
             CanCoalesce = false;
             break;
           }
    -      SrcSubIndices.push_back(UseMI->getOperand(2).getImm());
    +      SrcSubIndices.push_back(UseMI->getOperand(1).getSubReg());
           DstSubIndices.push_back(UseMI->getOperand(0).getSubReg());
         }
     
    @@ -1340,9 +1338,9 @@
                UI = MRI->use_nodbg_begin(SrcReg),
                UE = MRI->use_nodbg_end(); UI != UE; ++UI) {
           MachineInstr *UseMI = &*UI;
    -      assert(UseMI->isExtractSubreg());
    +      assert(UseMI->isCopy());
           unsigned DstSubIdx = UseMI->getOperand(0).getSubReg();
    -      unsigned SrcSubIdx = UseMI->getOperand(2).getImm();
    +      unsigned SrcSubIdx = UseMI->getOperand(1).getSubReg();
           assert(DstSubIdx != 0 && "missing subreg from RegSequence elimination");
           if ((NewDstSubIdx == 0 &&
                TRI->composeSubRegIndices(NewSrcSubIdx, DstSubIdx) != SrcSubIdx) ||
    @@ -1357,7 +1355,7 @@
         if (!CanCoalesce)
           continue;
     
    -    // Insert a copy or an extract to replace the original extracts.
    +    // Insert a copy to replace the original.
         MachineBasicBlock::iterator InsertLoc = SomeMI;
         MachineInstr *CopyMI = BuildMI(*SomeMI->getParent(), SomeMI,
                                        SomeMI->getDebugLoc(),
    @@ -1373,11 +1371,10 @@
           ++UI;
           if (UseMI == CopyMI)
             continue;
    -      assert(UseMI->isExtractSubreg());
    +      assert(UseMI->isCopy());
           // Move any kills to the new copy or extract instruction.
           if (UseMI->getOperand(1).isKill()) {
    -        MachineOperand *KillMO = CopyMI->findRegisterUseOperand(SrcReg);
    -        KillMO->setIsKill();
    +        CopyMI->getOperand(1).setIsKill();
             if (LV)
               // Update live variables
               LV->replaceKillInstruction(SrcReg, UseMI, &*CopyMI);
    @@ -1438,9 +1435,8 @@
           }
           IsImpDef = false;
     
    -      // Remember EXTRACT_SUBREG sources. These might be candidate for
    -      // coalescing.
    -      if (DefMI->isExtractSubreg())
    +      // Remember COPY sources. These might be candidate for coalescing.
    +      if (DefMI->isCopy())
             RealSrcs.push_back(DefMI->getOperand(1).getReg());
     
           if (!Seen.insert(SrcReg) ||
    
    Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp (original)
    +++ llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Thu Jul  8 11:40:22 2010
    @@ -2012,7 +2012,7 @@
           //       = EXTRACT_SUBREG fi#1
           // fi#1 is available in EDI, but it cannot be reused because it's not in
           // the right register file.
    -      if (PhysReg && !AvoidReload && (SubIdx || MI.isExtractSubreg())) {
    +      if (PhysReg && !AvoidReload && SubIdx) {
             const TargetRegisterClass* RC = MRI->getRegClass(VirtReg);
             if (!RC->contains(PhysReg))
               PhysReg = 0;
    
    Modified: llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp (original)
    +++ llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp Thu Jul  8 11:40:22 2010
    @@ -407,7 +407,7 @@
                "expected a virtual register");
         // Extracting from a Q or QQ register.
         MachineInstr *DefMI = MRI->getVRegDef(VirtReg);
    -    if (!DefMI || !DefMI->isExtractSubreg())
    +    if (!DefMI || !DefMI->isCopy() || !DefMI->getOperand(1).getSubReg())
           return false;
         VirtReg = DefMI->getOperand(1).getReg();
         if (LastSrcReg && LastSrcReg != VirtReg)
    @@ -418,7 +418,7 @@
             RC != ARM::QQPRRegisterClass &&
             RC != ARM::QQQQPRRegisterClass)
           return false;
    -    unsigned SubIdx = DefMI->getOperand(2).getImm();
    +    unsigned SubIdx = DefMI->getOperand(1).getSubReg();
         if (LastSubIdx) {
           if (LastSubIdx != SubIdx-Stride)
             return false;
    @@ -445,7 +445,7 @@
         MachineOperand &MO = MI->getOperand(FirstOpnd + R);
         unsigned OldReg = MO.getReg();
         MachineInstr *DefMI = MRI->getVRegDef(OldReg);
    -    assert(DefMI->isExtractSubreg());
    +    assert(DefMI->isCopy());
         MO.setReg(LastSrcReg);
         MO.setSubReg(SubIds[R]);
         MO.setIsKill(false);
    
    Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
    +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Thu Jul  8 11:40:22 2010
    @@ -1039,11 +1039,10 @@
       TII.copyRegToReg(*MBB, MBB->end(), CReg, Op1Reg, RC, RC, DL);
     
       // The shift instruction uses X86::CL. If we defined a super-register
    -  // of X86::CL, emit an EXTRACT_SUBREG to precisely describe what
    -  // we're doing here.
    +  // of X86::CL, emit a subreg KILL to precisely describe what we're doing here.
       if (CReg != X86::CL)
    -    BuildMI(MBB, DL, TII.get(TargetOpcode::EXTRACT_SUBREG), X86::CL)
    -      .addReg(CReg).addImm(X86::sub_8bit);
    +    BuildMI(MBB, DL, TII.get(TargetOpcode::KILL), X86::CL)
    +      .addReg(CReg, RegState::Kill);
     
       unsigned ResultReg = createResultReg(RC);
       BuildMI(MBB, DL, TII.get(OpReg), ResultReg).addReg(Op0Reg);
    
    Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=107879&r1=107878&r2=107879&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
    +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Jul  8 11:40:22 2010
    @@ -1201,10 +1201,9 @@
     
       MachineInstr *NewMI = MIB;
       MachineInstr *ExtMI =
    -    BuildMI(*MFI, MBBI, MI->getDebugLoc(), get(X86::EXTRACT_SUBREG))
    +    BuildMI(*MFI, MBBI, MI->getDebugLoc(), get(TargetOpcode::COPY))
         .addReg(Dest, RegState::Define | getDeadRegState(isDead))
    -    .addReg(leaOutReg, RegState::Kill)
    -    .addImm(X86::sub_16bit);
    +    .addReg(leaOutReg, RegState::Kill, X86::sub_16bit);
     
       if (LV) {
         // Update live variables
    
    
    
    
    From grosbach at apple.com  Thu Jul  8 11:49:27 2010
    From: grosbach at apple.com (Jim Grosbach)
    Date: Thu, 08 Jul 2010 16:49:27 -0000
    Subject: [llvm-commits] [llvm] r107880 - in /llvm/trunk/lib/CodeGen:
     PrologEpilogInserter.cpp RegisterScavenging.cpp
    Message-ID: <20100708164927.23F512A6C12C@llvm.org>
    
    Author: grosbach
    Date: Thu Jul  8 11:49:26 2010
    New Revision: 107880
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107880&view=rev
    Log:
    Clean up scavengeRegister() a bit to prefer available regs, which allows
    the simplification of frame index register scavenging to not have to check
    for available registers directly and instead just let scavengeRegister()
    handle it.
    
    Modified:
        llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
        llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
    
    Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=107880&r1=107879&r2=107880&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
    +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Thu Jul  8 11:49:26 2010
    @@ -885,21 +885,7 @@
                 // Scavenge a new scratch register
                 CurrentVirtReg = Reg;
                 const TargetRegisterClass *RC = Fn.getRegInfo().getRegClass(Reg);
    -            const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
    -            BitVector Candidates(TRI->getNumRegs());
    -            RS->getRegsAvailable(RC, Candidates);
    -
    -            // If there are any registers available, use the one that's
    -            // unused for the longest after this instruction. That increases
    -            // the ability to reuse the value.
    -            if (Candidates.any()) {
    -              MachineBasicBlock::iterator UMI;
    -              CurrentScratchReg = RS->findSurvivorReg(I, Candidates, 25, UMI);
    -            } else {
    -              // No register is "free". Scavenge a register.
    -              CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj);
    -            }
    -
    +            CurrentScratchReg = RS->scavengeRegister(RC, I, SPAdj);
                 PrevValue = Value;
               }
               // replace this reference to the virtual register with the
    
    Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=107880&r1=107879&r2=107880&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original)
    +++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Thu Jul  8 11:49:26 2010
    @@ -339,13 +339,16 @@
           Candidates.reset(MO.getReg());
       }
     
    +  // Try to find a register that's unused if there is one, as then we won't
    +  // have to spill.
    +  if ((Candidates & RegsAvailable).any())
    +     Candidates &= RegsAvailable;
    +
       // Find the register whose use is furthest away.
       MachineBasicBlock::iterator UseMI;
       unsigned SReg = findSurvivorReg(I, Candidates, 25, UseMI);
     
    -  // If we found an unused register there is no reason to spill it. We have
    -  // probably found a callee-saved register that has been saved in the
    -  // prologue, but happens to be unused at this point.
    +  // If we found an unused register there is no reason to spill it.
       if (!isAliasUsed(SReg))
         return SReg;
     
    
    
    
    
    From ggreif at gmail.com  Thu Jul  8 11:52:57 2010
    From: ggreif at gmail.com (Gabor Greif)
    Date: Thu, 08 Jul 2010 16:52:57 -0000
    Subject: [llvm-commits] [llvm] r107881 -
    	/llvm/trunk/include/llvm/Support/CFG.h
    Message-ID: <20100708165257.A8A1E2A6C12C@llvm.org>
    
    Author: ggreif
    Date: Thu Jul  8 11:52:57 2010
    New Revision: 107881
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107881&view=rev
    Log:
    remove unneeded parens
    
    Modified:
        llvm/trunk/include/llvm/Support/CFG.h
    
    Modified: llvm/trunk/include/llvm/Support/CFG.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CFG.h?rev=107881&r1=107880&r2=107881&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/Support/CFG.h (original)
    +++ llvm/trunk/include/llvm/Support/CFG.h Thu Jul  8 11:52:57 2010
    @@ -53,7 +53,7 @@
         assert(!It.atEnd() && "pred_iterator out of range!");
         return cast(*It)->getParent();
       }
    -  inline pointer *operator->() const { return &(operator*()); }
    +  inline pointer *operator->() const { return &operator*(); }
     
       inline Self& operator++() {   // Preincrement
         assert(!It.atEnd() && "pred_iterator out of range!");
    
    
    
    
    From bob.wilson at apple.com  Thu Jul  8 11:54:46 2010
    From: bob.wilson at apple.com (Bob Wilson)
    Date: Thu, 08 Jul 2010 16:54:46 -0000
    Subject: [llvm-commits] [llvm] r107882 -
    	/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td
    Message-ID: <20100708165446.2A6392A6C12C@llvm.org>
    
    Author: bwilson
    Date: Thu Jul  8 11:54:45 2010
    New Revision: 107882
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107882&view=rev
    Log:
    Clean up a comment.
    
    Modified:
        llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td
    
    Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td?rev=107882&r1=107881&r2=107882&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td (original)
    +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Thu Jul  8 11:54:45 2010
    @@ -153,11 +153,11 @@
     
     // Pseudo 256-bit registers to represent pairs of Q registers. These should
     // never be present in the emitted code.
    -// These are used for NEON load / store instructions, e.g. vld4, vst3.
    -// NOTE: It's possible to define more QQ registers since technical the
    -// starting D register number doesn't have to be multiple of 4. e.g. 
    -// D1, D2, D3, D4 would be a legal quad. But that would make the sub-register
    -// stuffs very messy.
    +// These are used for NEON load / store instructions, e.g., vld4, vst3.
    +// NOTE: It's possible to define more QQ registers since technically the
    +// starting D register number doesn't have to be multiple of 4, e.g.,
    +// D1, D2, D3, D4 would be a legal quad, but that would make the subregister
    +// stuff very messy.
     let SubRegIndices = [qsub_0, qsub_1] in {
     let CompositeIndices = [(dsub_2 qsub_1, dsub_0), (dsub_3 qsub_1, dsub_1),
                             (ssub_4 qsub_1, ssub_0), (ssub_5 qsub_1, ssub_1),
    
    
    
    
    From ggreif at gmail.com  Thu Jul  8 11:56:18 2010
    From: ggreif at gmail.com (Gabor Greif)
    Date: Thu, 08 Jul 2010 16:56:18 -0000
    Subject: [llvm-commits] [llvm] r107883 -
    	/llvm/trunk/include/llvm/Analysis/DominatorInternals.h
    Message-ID: <20100708165618.F1C292A6C12C@llvm.org>
    
    Author: ggreif
    Date: Thu Jul  8 11:56:18 2010
    New Revision: 107883
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107883&view=rev
    Log:
    only dereference iterator once in the loop
    (by caching the result we save a potentially expensive dereference)
    
    also use typedefs to shorten type declarations
    
    Modified:
        llvm/trunk/include/llvm/Analysis/DominatorInternals.h
    
    Modified: llvm/trunk/include/llvm/Analysis/DominatorInternals.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DominatorInternals.h?rev=107883&r1=107882&r2=107883&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/Analysis/DominatorInternals.h (original)
    +++ llvm/trunk/include/llvm/Analysis/DominatorInternals.h Thu Jul  8 11:56:18 2010
    @@ -265,14 +265,17 @@
     
         // initialize the semi dominator to point to the parent node
         WInfo.Semi = WInfo.Parent;
    -    for (typename GraphTraits >::ChildIteratorType CI =
    -         GraphTraits >::child_begin(W),
    -         E = GraphTraits >::child_end(W); CI != E; ++CI)
    -      if (DT.Info.count(*CI)) {  // Only if this predecessor is reachable!
    -        unsigned SemiU = DT.Info[Eval(DT, *CI)].Semi;
    +    typedef GraphTraits > InvTraits;
    +    for (typename InvTraits::ChildIteratorType CI =
    +         InvTraits::child_begin(W),
    +         E = InvTraits::child_end(W); CI != E; ++CI) {
    +      typename InvTraits::NodeType *N = *CI;
    +      if (DT.Info.count(N)) {  // Only if this predecessor is reachable!
    +        unsigned SemiU = DT.Info[Eval(DT, N)].Semi;
             if (SemiU < WInfo.Semi)
               WInfo.Semi = SemiU;
           }
    +    }
     
         DT.Info[DT.Vertex[WInfo.Semi]].Bucket.push_back(W);
     
    
    
    
    
    From gohman at apple.com  Thu Jul  8 12:20:28 2010
    From: gohman at apple.com (Dan Gohman)
    Date: Thu, 08 Jul 2010 10:20:28 -0700
    Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups
    In-Reply-To: 
    References: 
    	<8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com>
    	
    	
    Message-ID: <9A8F1803-7291-4665-95C5-BB0B5B7822A7@apple.com>
    
    getTransientStackAlignment does not seem the right tool here.  You  
    want to know how arguments in memory for varargs are aligned, not how  
    the stack pointer itself is aligned.
    
    Dan
    
    On Jul 8, 2010, at 7:19 AM, Rafael Espindola   
    wrote:
    
    > I think I found the correct method: getTransientStackAlignment.
    >
    > The attached patch uses it. Is it OK?
    >
    > Cheers,
    > -- 
    > Rafael ?vila de Esp?ndola
    > 
    
    
    
    From enderby at apple.com  Thu Jul  8 12:22:42 2010
    From: enderby at apple.com (Kevin Enderby)
    Date: Thu, 08 Jul 2010 17:22:42 -0000
    Subject: [llvm-commits] [llvm] r107886 - in /llvm/trunk:
     include/llvm/MC/MCAsmInfo.h include/llvm/MC/MCDirectives.h
     lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp lib/MC/MCAsmStreamer.cpp
     lib/MC/MCMachOStreamer.cpp lib/MC/MCParser/AsmParser.cpp
    Message-ID: <20100708172242.7F83B2A6C12C@llvm.org>
    
    Author: enderby
    Date: Thu Jul  8 12:22:42 2010
    New Revision: 107886
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107886&view=rev
    Log:
    Added the darwin .weak_def_can_be_hidden directive.
    
    Modified:
        llvm/trunk/include/llvm/MC/MCAsmInfo.h
        llvm/trunk/include/llvm/MC/MCDirectives.h
        llvm/trunk/lib/MC/MCAsmInfo.cpp
        llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
        llvm/trunk/lib/MC/MCAsmStreamer.cpp
        llvm/trunk/lib/MC/MCMachOStreamer.cpp
        llvm/trunk/lib/MC/MCParser/AsmParser.cpp
    
    Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original)
    +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Thu Jul  8 12:22:42 2010
    @@ -217,6 +217,11 @@
         /// global as being a weak defined symbol.
         const char *WeakDefDirective;            // Defaults to NULL.
     
    +    /// WeakDefAutoPrivateDirective - This directive, if non-null, is used to
    +    /// declare a global as being a weak defined symbol that is automatically
    +    /// made private by the static linker.
    +    const char *WeakDefAutoPrivateDirective; // Defaults to NULL.
    +
         /// LinkOnceDirective - This directive, if non-null is used to declare a
         /// global as being a weak defined symbol.  This is used on cygwin/mingw.
         const char *LinkOnceDirective;           // Defaults to NULL.
    @@ -387,6 +392,9 @@
         bool hasNoDeadStrip() const { return HasNoDeadStrip; }
         const char *getWeakRefDirective() const { return WeakRefDirective; }
         const char *getWeakDefDirective() const { return WeakDefDirective; }
    +    const char *getWeakDefAutoPrivateDirective() const {
    +      return WeakDefAutoPrivateDirective;
    +    }
         const char *getLinkOnceDirective() const { return LinkOnceDirective; }
         
         MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
    
    Modified: llvm/trunk/include/llvm/MC/MCDirectives.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDirectives.h?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/MC/MCDirectives.h (original)
    +++ llvm/trunk/include/llvm/MC/MCDirectives.h Thu Jul  8 12:22:42 2010
    @@ -38,7 +38,8 @@
       MCSA_Reference,           ///< .reference (MachO)
       MCSA_Weak,                ///< .weak
       MCSA_WeakDefinition,      ///< .weak_definition (MachO)
    -  MCSA_WeakReference        ///< .weak_reference (MachO)
    +  MCSA_WeakReference,       ///< .weak_reference (MachO)
    +  MCSA_WeakDefAutoPrivate   ///< .weak_def_can_be_hidden (MachO)
     };
     
     enum MCAssemblerFlag {
    
    Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original)
    +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Thu Jul  8 12:22:42 2010
    @@ -59,6 +59,7 @@
       HasNoDeadStrip = false;
       WeakRefDirective = 0;
       WeakDefDirective = 0;
    +  WeakDefAutoPrivateDirective = 0;
       LinkOnceDirective = 0;
       HiddenVisibilityAttr = MCSA_Hidden;
       ProtectedVisibilityAttr = MCSA_Protected;
    
    Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original)
    +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Thu Jul  8 12:22:42 2010
    @@ -33,6 +33,7 @@
       // Directives:
       WeakDefDirective = "\t.weak_definition ";
       WeakRefDirective = "\t.weak_reference ";
    +  WeakDefAutoPrivateDirective = "\t.weak_def_can_be_hidden ";
       ZeroDirective = "\t.space\t";  // ".space N" emits N zeros.
       HasMachoZeroFillDirective = true;  // Uses .zerofill
       HasMachoTBSSDirective = true; // Uses .tbss
    
    Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
    +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Thu Jul  8 12:22:42 2010
    @@ -288,6 +288,7 @@
       case MCSA_WeakDefinition: OS << "\t.weak_definition\t"; break;
           // .weak_reference
       case MCSA_WeakReference:  OS << MAI.getWeakRefDirective(); break;
    +  case MCSA_WeakDefAutoPrivate: OS << "\t.weak_def_can_be_hidden\t"; break;
       }
     
       OS << *Symbol;
    
    Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
    +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Thu Jul  8 12:22:42 2010
    @@ -273,6 +273,10 @@
         // it has to be in a coalesced section, but this isn't enforced.
         SD.setFlags(SD.getFlags() | SF_WeakDefinition);
         break;
    +
    +  case MCSA_WeakDefAutoPrivate:
    +    SD.setFlags(SD.getFlags() | SF_WeakDefinition | SF_WeakReference);
    +    break;
       }
     }
     
    
    Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=107886&r1=107885&r2=107886&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
    +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Thu Jul  8 12:22:42 2010
    @@ -755,6 +755,8 @@
           return ParseDirectiveSymbolAttribute(MCSA_WeakDefinition);
         if (IDVal == ".weak_reference")
           return ParseDirectiveSymbolAttribute(MCSA_WeakReference);
    +    if (IDVal == ".weak_def_can_be_hidden")
    +      return ParseDirectiveSymbolAttribute(MCSA_WeakDefAutoPrivate);
     
         if (IDVal == ".comm")
           return ParseDirectiveComm(/*IsLocal=*/false);
    
    
    
    
    From grosbach at apple.com  Thu Jul  8 12:27:23 2010
    From: grosbach at apple.com (Jim Grosbach)
    Date: Thu, 08 Jul 2010 17:27:23 -0000
    Subject: [llvm-commits] [llvm] r107887 -
    	/llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h
    Message-ID: <20100708172723.38E3E2A6C12C@llvm.org>
    
    Author: grosbach
    Date: Thu Jul  8 12:27:23 2010
    New Revision: 107887
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107887&view=rev
    Log:
    After r107880, findSurvivorReg() no longer needs to be public.
    
    Modified:
        llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h
    
    Modified: llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h?rev=107887&r1=107886&r2=107887&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h (original)
    +++ llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h Thu Jul  8 12:27:23 2010
    @@ -106,16 +106,6 @@
       /// Return 0 if none is found.
       unsigned FindUnusedReg(const TargetRegisterClass *RegClass) const;
     
    -  /// findSurvivorReg - Return the candidate register that is unused for the
    -  /// longest after StartMI. UseMI is set to the instruction where the search
    -  /// stopped.
    -  ///
    -  /// No more than InstrLimit instructions are inspected.
    -  unsigned findSurvivorReg(MachineBasicBlock::iterator StartMI,
    -                           BitVector &Candidates,
    -                           unsigned InstrLimit,
    -                           MachineBasicBlock::iterator &UseMI);
    -
       /// setScavengingFrameIndex / getScavengingFrameIndex - accessor and setter of
       /// ScavengingFrameIndex.
       void setScavengingFrameIndex(int FI) { ScavengingFrameIndex = FI; }
    @@ -161,6 +151,16 @@
       /// Add Reg and its aliases to BV.
       void addRegWithAliases(BitVector &BV, unsigned Reg);
     
    +  /// findSurvivorReg - Return the candidate register that is unused for the
    +  /// longest after StartMI. UseMI is set to the instruction where the search
    +  /// stopped.
    +  ///
    +  /// No more than InstrLimit instructions are inspected.
    +  unsigned findSurvivorReg(MachineBasicBlock::iterator StartMI,
    +                           BitVector &Candidates,
    +                           unsigned InstrLimit,
    +                           MachineBasicBlock::iterator &UseMI);
    +
     };
     
     } // End llvm namespace
    
    
    
    
    From criswell at uiuc.edu  Thu Jul  8 12:33:59 2010
    From: criswell at uiuc.edu (John Criswell)
    Date: Thu, 08 Jul 2010 17:33:59 -0000
    Subject: [llvm-commits] [poolalloc] r107888 -
     /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
    Message-ID: <20100708173359.631F42A6C12C@llvm.org>
    
    Author: criswell
    Date: Thu Jul  8 12:33:59 2010
    New Revision: 107888
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107888&view=rev
    Log:
    Removed code that inserted poolinit()/pooldestroy() around function calls which
    had parameters that had no pool handle.  I believe adding this code is
    incorrect when the heuristic allows certain values to be allocated using the
    original allocator (i.e., some values are not pool-allocated).
    
    Modified:
        poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
    
    Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
    URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=107888&r1=107887&r2=107888&view=diff
    ==============================================================================
    --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
    +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Thu Jul  8 12:33:59 2010
    @@ -167,8 +167,21 @@
     }
     
     void FuncTransform::visitLoadInst(LoadInst &LI) {
    +  //
    +  // Record the use of the pool handle for the pointer being dereferenced.
    +  //
       if (Value *PH = getPoolHandle(LI.getOperand(0)))
         AddPoolUse(LI, PH, PoolUses);
    +
    +  //
    +  // If this is a volatile load, then record a use of the pool handle for the
    +  // loaded value, even if it is never used.
    +  //
    +  if (LI.isVolatile()) {
    +    if (Value *PH = getPoolHandle(&LI))
    +      AddPoolUse (LI, PH, PoolUses);
    +  }
    +
       visitInstruction(LI);
     }
     
    @@ -650,14 +663,21 @@
       I->eraseFromParent();
     }
     
    -
    +//
    +// Method: visitCallSite()
    +//
    +// Description:
    +//  This method transforms a call site.  A call site may either be a call
    +//  instruction or an invoke instruction.
    +//
    +// Inputs:
    +//  CS - The call site representing the instruction that should be transformed.
    +//
     void FuncTransform::visitCallSite(CallSite& CS) {
       const Function *CF = CS.getCalledFunction();
       Instruction *TheCall = CS.getInstruction();
       bool thread_creation_point = false;
     
    -  const Type* Int32Type = Type::getInt32Ty(CS.getInstruction()->getContext());
    -
       //
       // Get the value that is called at this call site.  Strip away any pointer
       // casts that do not change the representation of the data (i.e., are
    @@ -877,36 +897,30 @@
     //                                    getDSNodeHFor(*GI),
     //                                    NodeMapping, false);
     
    +  //
       // Okay, now that we have established our mapping, we can figure out which
       // pool descriptors to pass in...
    +  //
    +  // Note:
    +  // There used to be code here that would create a new pool before the
    +  // function call and destroy it after the function call.  This could would
    +  // get triggered if bounds checking was disbled or the DSNode for the
    +  // argument was an array value.
    +  //
    +  // I believe that code was incorrect; an argument may have a NULL pool handle
    +  // (i.e., no pool handle) because the pool allocation heuristic used simply
    +  // decided not to assign that value a pool.  The argument may alias data
    +  // that should not be freed after the function call is complete, so calling
    +  // pooldestroy() after the call would free data, causing dangling pointer
    +  // dereference errors.
    +  //
       std::vector Args;
       for (unsigned i = 0, e = ArgNodes.size(); i != e; ++i) {
         Value *ArgVal = Constant::getNullValue(PoolAllocate::PoolDescPtrTy);
    -    if (NodeMapping.count(ArgNodes[i]))
    +    if (NodeMapping.count(ArgNodes[i])) {
           if (DSNode *LocalNode = NodeMapping[ArgNodes[i]].getNode())
             if (FI.PoolDescriptors.count(LocalNode))
               ArgVal = FI.PoolDescriptors.find(LocalNode)->second;
    -    if (isa(ArgVal) && cast(ArgVal)->isNullValue()) {
    -      if ((!(PAInfo.BoundsChecksEnabled)) || (ArgNodes[i]->isArrayNode())) {
    -        if (!isa(TheCall)) {
    -          // Dinakar: We need pooldescriptors for allocas in the callee if it
    -          //          escapes
    -          BasicBlock::iterator InsertPt = TheCall->getParent()->getParent()->front().begin();
    -          ArgVal =  new AllocaInst(PAInfo.getPoolType(&TheCall->getContext()),
    -                                   0,
    -                                   "PD",
    -                                   InsertPt);
    -          Value *ElSize = ConstantInt::get(Int32Type,0);
    -          Value *Align  = ConstantInt::get(Int32Type,0);
    -          Value* Opts[3] = {ArgVal, ElSize, Align};
    -          CallInst::Create(PAInfo.PoolInit, Opts, Opts + 3,"", TheCall);
    -          BasicBlock::iterator BBI = TheCall;
    -          CallInst::Create(PAInfo.PoolDestroy, ArgVal, "", ++BBI);
    -        }
    -
    -        //probably need to update DSG
    -        //      errs() << "WARNING: NULL POOL ARGUMENTS ARE PASSED IN!\n";
    -      }
         }
         Args.push_back(ArgVal);
       }
    
    
    
    
    From espindola at google.com  Thu Jul  8 12:35:24 2010
    From: espindola at google.com (Rafael Espindola)
    Date: Thu, 8 Jul 2010 13:35:24 -0400
    Subject: [llvm-commits] [patch] Fix va_arg for double and some cleanups
    In-Reply-To: <9A8F1803-7291-4665-95C5-BB0B5B7822A7@apple.com>
    References: 
    	<8F256730-8DB3-4855-86E0-38F60D7D148E@apple.com>
    	
    	
    	<9A8F1803-7291-4665-95C5-BB0B5B7822A7@apple.com>
    Message-ID: 
    
    On 8 July 2010 13:20, Dan Gohman  wrote:
    > getTransientStackAlignment does not seem the right tool here. ?You want to
    > know how arguments in memory for varargs are aligned, not how the stack
    > pointer itself is aligned.
    
    No, I what to know the stack alignment. The VAARG node already contain
    by how much the argument is aligned. The question we are trying to
    answer is "Is this argument more alignment that what we know the stack
    already is?". Knowing that we can insert alignment instructions only
    when necessary.
    
    > Dan
    
    Cheers,
    -- 
    Rafael ?vila de Esp?ndola
    
    
    
    From bob.wilson at apple.com  Thu Jul  8 12:44:00 2010
    From: bob.wilson at apple.com (Bob Wilson)
    Date: Thu, 08 Jul 2010 17:44:00 -0000
    Subject: [llvm-commits] [llvm] r107890 -
    	/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
    Message-ID: <20100708174400.4476C2A6C12D@llvm.org>
    
    Author: bwilson
    Date: Thu Jul  8 12:44:00 2010
    New Revision: 107890
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107890&view=rev
    Log:
    For big-endian systems, VLD2/VST2 with 32-bit vector elements will swap the
    words within the 64-bit D registers.  Use VLD1/VST1 with 64-bit elements
    instead.
    
    Modified:
        llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
    
    Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=107890&r1=107889&r2=107890&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
    +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Jul  8 12:44:00 2010
    @@ -848,7 +848,7 @@
         if (Align >= 16 && getRegisterInfo().canRealignStack(MF)) {
           // FIXME: It's possible to only store part of the QQ register if the
           // spilled def has a sub-register index.
    -      MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(ARM::VST2q32))
    +      MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(ARM::VST1d64Q))
             .addFrameIndex(FI).addImm(16);
           MIB = AddDReg(MIB, SrcReg, ARM::dsub_0, getKillRegState(isKill), TRI);
           MIB = AddDReg(MIB, SrcReg, ARM::dsub_1, 0, TRI);
    @@ -941,7 +941,7 @@
       case ARM::QQPRRegClassID:
       case ARM::QQPR_VFP2RegClassID:
         if (Align >= 16 && getRegisterInfo().canRealignStack(MF)) {
    -      MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(ARM::VLD2q32));
    +      MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(ARM::VLD1d64Q));
           MIB = AddDReg(MIB, DestReg, ARM::dsub_0, RegState::Define, TRI);
           MIB = AddDReg(MIB, DestReg, ARM::dsub_1, RegState::Define, TRI);
           MIB = AddDReg(MIB, DestReg, ARM::dsub_2, RegState::Define, TRI);
    
    
    
    
    From scanon at apple.com  Thu Jul  8 12:45:05 2010
    From: scanon at apple.com (Stephen Canon)
    Date: Thu, 08 Jul 2010 17:45:05 -0000
    Subject: [llvm-commits] [compiler-rt] r107891 -
    	/compiler-rt/trunk/lib/arm/comparesf2.S
    Message-ID: <20100708174505.B673D2A6C12C@llvm.org>
    
    Author: scanon
    Date: Thu Jul  8 12:45:05 2010
    New Revision: 107891
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107891&view=rev
    Log:
    Hand-tuning of single-precision soft-float comparison routines for ARM
    
    Added:
        compiler-rt/trunk/lib/arm/comparesf2.S
    
    Added: compiler-rt/trunk/lib/arm/comparesf2.S
    URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/comparesf2.S?rev=107891&view=auto
    ==============================================================================
    --- compiler-rt/trunk/lib/arm/comparesf2.S (added)
    +++ compiler-rt/trunk/lib/arm/comparesf2.S Thu Jul  8 12:45:05 2010
    @@ -0,0 +1,130 @@
    +//===-- comparesf2.S - Implement single-precision soft-float comparisons --===//
    +//
    +//                     The LLVM Compiler Infrastructure
    +//
    +// This file is distributed under the University of Illinois Open Source
    +// License. See LICENSE.TXT for details.
    +//
    +//===----------------------------------------------------------------------===//
    +//
    +// This file implements the following soft-fp_t comparison routines:
    +//
    +//   __eqsf2   __gesf2   __unordsf2
    +//   __lesf2   __gtsf2
    +//   __ltsf2
    +//   __nesf2
    +//
    +// The semantics of the routines grouped in each column are identical, so there
    +// is a single implementation for each, with multiple names.
    +//
    +// The routines behave as follows:
    +//
    +//   __lesf2(a,b) returns -1 if a < b
    +//                         0 if a == b
    +//                         1 if a > b
    +//                         1 if either a or b is NaN
    +//
    +//   __gesf2(a,b) returns -1 if a < b
    +//                         0 if a == b
    +//                         1 if a > b
    +//                        -1 if either a or b is NaN
    +//
    +//   __unordsf2(a,b) returns 0 if both a and b are numbers
    +//                           1 if either a or b is NaN
    +//
    +// Note that __lesf2( ) and __gesf2( ) are identical except in their handling of
    +// NaN values.
    +//
    +//===----------------------------------------------------------------------===//
    +
    +#include "../assembly.h"
    +.syntax unified
    +
    +.align 2
    +DEFINE_COMPILERRT_FUNCTION(__eqsf2)
    +DEFINE_COMPILERRT_FUNCTION(__lesf2)
    +DEFINE_COMPILERRT_FUNCTION(__ltsf2)
    +DEFINE_COMPILERRT_FUNCTION(__nesf2)
    +    // Make copies of a and b with the sign bit shifted off the top.  These will
    +    // be used to detect zeros and NaNs.
    +    mov     r2,         r0, lsl #1
    +    mov     r3,         r1, lsl #1
    +    
    +    // We do the comparison in three stages (ignoring NaN values for the time
    +    // being).  First, we orr the absolute values of a and b; this sets the Z
    +    // flag if both a and b are zero (of either sign).  The shift of r3 doesn't
    +    // effect this at all, but it *does* make sure that the C flag is clear for
    +    // the subsequent operations.
    +    orrs    r12,    r2, r3, lsr #1
    +    
    +    // Next, we check if a and b have the same or different signs.  If they have
    +    // opposite signs, this eor will set the N flag.
    +    eorsne  r12,    r0, r1
    +    
    +    // If a and b are equal (either both zeros or bit identical; again, we're
    +    // ignoring NaNs for now), this subtract will zero out r0.  If they have the
    +    // same sign, the flags are updated as they would be for a comparison of the
    +    // absolute values of a and b.
    +    subspl  r0,     r2, r3
    +    
    +    // If a is smaller in magnitude than b and both have the same sign, place
    +    // the negation of the sign of b in r0.  Thus, if both are negative and
    +    // a > b, this sets r0 to 0; if both are positive and a < b, this sets
    +    // r0 to -1.
    +    //
    +    // This is also done if a and b have opposite signs and are not both zero,
    +    // because in that case the subtract was not performed and the C flag is
    +    // still clear from the shift argument in orrs; if a is positive and b
    +    // negative, this places 0 in r0; if a is negative and b positive, -1 is
    +    // placed in r0.
    +    mvnlo   r0,         r1, asr #31
    +
    +    // If a is greater in magnitude than b and both have the same sign, place
    +    // the sign of b in r0.  Thus, if both are negative and a < b, -1 is placed
    +    // in r0, which is the desired result.  Conversely, if both are positive
    +    // and a > b, zero is placed in r0.
    +    movhi   r0,         r1, asr #31
    +    
    +    // If you've been keeping track, at this point r0 contains -1 if a < b and
    +    // 0 if a >= b.  All that remains to be done is to set it to 1 if a > b.
    +    // If a == b, then the Z flag is set, so we can get the correct final value
    +    // into r0 by simply or'ing with 1 if Z is clear.
    +	orrne	r0,     r0, #1
    +    
    +    // Finally, we need to deal with NaNs.  If either argument is NaN, replace
    +    // the value in r0 with 1.
    +    cmp     r2,         #0xff000000
    +    cmpls   r3,         #0xff000000
    +    movhi   r0,         #1
    +    bx      lr
    +    
    +.align 2
    +DEFINE_COMPILERRT_FUNCTION(__gesf2)
    +DEFINE_COMPILERRT_FUNCTION(__gtsf2)
    +    // Identical to the preceeding except in that we return -1 for NaN values.
    +    // Given that the two paths share so much code, one might be tempted to 
    +    // unify them; however, the extra code needed to do so makes the code size
    +    // to performance tradeoff very hard to justify for such small functions.
    +    mov     r2,         r0, lsl #1
    +    mov     r3,         r1, lsl #1
    +    orrs    r12,    r2, r3, lsr #1
    +    eorsne  r12,    r0, r1
    +    subspl  r0,     r2, r3
    +    mvnlo   r0,         r1, asr #31
    +    movhi   r0,         r1, asr #31
    +	orrne	r0,     r0, #1
    +    cmp     r2,         #0xff000000
    +    cmpls   r3,         #0xff000000
    +    movhi   r0,         #-1
    +    bx      lr
    +    
    +.align 2
    +DEFINE_COMPILERRT_FUNCTION(__unordsf2)
    +    // Return 1 for NaN values, 0 otherwise.
    +    mov     r2,         r0, lsl #1
    +    mov     r3,         r1, lsl #1
    +    mov     r0,         #0
    +    cmp     r2,         #0xff000000
    +    cmpls   r3,         #0xff000000
    +    movhi   r0,         #1
    +    bx      lr
    
    
    
    
    From bob.wilson at apple.com  Thu Jul  8 12:45:26 2010
    From: bob.wilson at apple.com (Bob Wilson)
    Date: Thu, 08 Jul 2010 17:45:26 -0000
    Subject: [llvm-commits] [llvm] r107892 -
    	/llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp
    Message-ID: <20100708174526.35BDC2A6C12C@llvm.org>
    
    Author: bwilson
    Date: Thu Jul  8 12:45:26 2010
    New Revision: 107892
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107892&view=rev
    Log:
    The NEONPreAllocPass should never have to assign fixed registers anymore.
    This pass can go away entirely soon.
    
    Modified:
        llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp
    
    Modified: llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp?rev=107892&r1=107891&r2=107892&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp (original)
    +++ llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp Thu Jul  8 12:45:26 2010
    @@ -468,40 +468,7 @@
           continue;
         if (FormsRegSequence(MI, FirstOpnd, NumRegs, Offset, Stride))
           continue;
    -
    -    MachineBasicBlock::iterator NextI = llvm::next(MBBI);
    -    for (unsigned R = 0; R < NumRegs; ++R) {
    -      MachineOperand &MO = MI->getOperand(FirstOpnd + R);
    -      assert(MO.isReg() && MO.getSubReg() == 0 && "unexpected operand");
    -      unsigned VirtReg = MO.getReg();
    -      assert(TargetRegisterInfo::isVirtualRegister(VirtReg) &&
    -             "expected a virtual register");
    -
    -      // For now, just assign a fixed set of adjacent registers.
    -      // This leaves plenty of room for future improvements.
    -      static const unsigned NEONDRegs[] = {
    -        ARM::D0, ARM::D1, ARM::D2, ARM::D3,
    -        ARM::D4, ARM::D5, ARM::D6, ARM::D7
    -      };
    -      MO.setReg(NEONDRegs[Offset + R * Stride]);
    -
    -      if (MO.isUse()) {
    -        // Insert a copy from VirtReg.
    -        TII->copyRegToReg(MBB, MBBI, MO.getReg(), VirtReg,
    -                          ARM::DPRRegisterClass, ARM::DPRRegisterClass,
    -                          DebugLoc());
    -        if (MO.isKill()) {
    -          MachineInstr *CopyMI = prior(MBBI);
    -          CopyMI->findRegisterUseOperand(VirtReg)->setIsKill();
    -        }
    -        MO.setIsKill();
    -      } else if (MO.isDef() && !MO.isDead()) {
    -        // Add a copy to VirtReg.
    -        TII->copyRegToReg(MBB, NextI, VirtReg, MO.getReg(),
    -                          ARM::DPRRegisterClass, ARM::DPRRegisterClass,
    -                          DebugLoc());
    -      }
    -    }
    +    llvm_unreachable("expected a REG_SEQUENCE");
       }
     
       return Modified;
    
    
    
    
    From wdietz2 at illinois.edu  Thu Jul  8 13:51:55 2010
    From: wdietz2 at illinois.edu (Will Dietz)
    Date: Thu, 08 Jul 2010 18:51:55 -0000
    Subject: [llvm-commits] [poolalloc] r107896 -
     /poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll
    Message-ID: <20100708185155.0C79D2A6C12C@llvm.org>
    
    Author: wdietz2
    Date: Thu Jul  8 13:51:54 2010
    New Revision: 107896
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107896&view=rev
    Log:
    Don't output the bitcode to stdout, even if the user never sees it.
    
    Modified:
        poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll
    
    Modified: poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll
    URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll?rev=107896&r1=107895&r2=107896&view=diff
    ==============================================================================
    --- poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll (original)
    +++ poolalloc/trunk/test/dsa/regression/2010-07-07.UndefArg.ll Thu Jul  8 13:51:54 2010
    @@ -1,4 +1,4 @@
    -;RUN: dsaopt %s -ds-aa -gvn
    +;RUN: dsaopt %s -ds-aa -gvn -disable-output
     ; FIXME: Make this test more directly test the underlying issue.
     ; (the -ds-aa and -gvn are just ways of forcing the right query to be made)
     
    
    
    
    
    From stoklund at 2pi.dk  Thu Jul  8 14:46:25 2010
    From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
    Date: Thu, 08 Jul 2010 19:46:25 -0000
    Subject: [llvm-commits] [llvm] r107898 - in /llvm/trunk:
     include/llvm/Target/TargetRegisterInfo.h lib/Target/X86/X86InstrInfo.cpp
     lib/Target/X86/X86InstrInfo.h
    Message-ID: <20100708194625.759222A6C12C@llvm.org>
    
    Author: stoklund
    Date: Thu Jul  8 14:46:25 2010
    New Revision: 107898
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107898&view=rev
    Log:
    Implement X86InstrInfo::copyPhysReg
    
    Modified:
        llvm/trunk/include/llvm/Target/TargetRegisterInfo.h
        llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
        llvm/trunk/lib/Target/X86/X86InstrInfo.h
    
    Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=107898&r1=107897&r2=107898&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original)
    +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Thu Jul  8 14:46:25 2010
    @@ -115,6 +115,11 @@
         return RegSet.count(Reg);
       }
     
    +  /// contains - Return true if both registers are in this class.
    +  bool contains(unsigned Reg1, unsigned Reg2) const {
    +    return contains(Reg1) && contains(Reg2);
    +  }
    +
       /// hasType - return true if this TargetRegisterClass has the ValueType vt.
       ///
       bool hasType(EVT vt) const {
    
    Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=107898&r1=107897&r2=107898&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
    +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Jul  8 14:46:25 2010
    @@ -2058,6 +2058,66 @@
       return false;
     }
     
    +void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
    +                               MachineBasicBlock::iterator MI, DebugLoc DL,
    +                               unsigned DestReg, unsigned SrcReg,
    +                               bool KillSrc) const {
    +  // First deal with the normal symmetric copies.
    +  unsigned Opc = 0;
    +  if (X86::GR64RegClass.contains(DestReg, SrcReg))
    +    Opc = X86::MOV64rr;
    +  else if (X86::GR32RegClass.contains(DestReg, SrcReg))
    +    Opc = X86::MOV32rr;
    +  else if (X86::GR16RegClass.contains(DestReg, SrcReg))
    +    Opc = X86::MOV16rr;
    +  else if (X86::GR8RegClass.contains(DestReg, SrcReg)) {
    +    // Copying to or from a physical H register on x86-64 requires a NOREX
    +    // move.  Otherwise use a normal move.
    +    if ((isHReg(DestReg) || isHReg(SrcReg)) &&
    +        TM.getSubtarget().is64Bit())
    +      Opc = X86::MOV8rr_NOREX;
    +    else
    +      Opc = X86::MOV8rr;
    +  } else if (X86::VR128RegClass.contains(DestReg, SrcReg))
    +    Opc = X86::MOVAPSrr;
    +
    +  if (Opc) {
    +    BuildMI(MBB, MI, DL, get(Opc), DestReg)
    +      .addReg(SrcReg, getKillRegState(KillSrc));
    +    return;
    +  }
    +
    +  // Moving EFLAGS to / from another register requires a push and a pop.
    +  if (SrcReg == X86::EFLAGS) {
    +    if (X86::GR64RegClass.contains(DestReg)) {
    +      BuildMI(MBB, MI, DL, get(X86::PUSHF64));
    +      BuildMI(MBB, MI, DL, get(X86::POP64r), DestReg);
    +      return;
    +    } else if (X86::GR32RegClass.contains(DestReg)) {
    +      BuildMI(MBB, MI, DL, get(X86::PUSHF32));
    +      BuildMI(MBB, MI, DL, get(X86::POP32r), DestReg);
    +      return;
    +    }
    +  }
    +  if (DestReg == X86::EFLAGS) {
    +    if (X86::GR64RegClass.contains(SrcReg)) {
    +      BuildMI(MBB, MI, DL, get(X86::PUSH64r))
    +        .addReg(SrcReg, getKillRegState(KillSrc));
    +      BuildMI(MBB, MI, DL, get(X86::POPF64));
    +      return;
    +    } else if (X86::GR32RegClass.contains(SrcReg)) {
    +      BuildMI(MBB, MI, DL, get(X86::PUSH32r))
    +        .addReg(SrcReg, getKillRegState(KillSrc));
    +      BuildMI(MBB, MI, DL, get(X86::POPF32));
    +      return;
    +    }
    +  }
    +
    +  DEBUG(dbgs() << "Cannot copy " << RI.getName(SrcReg)
    +               << " to " << RI.getName(DestReg) << '\n');
    +  llvm_unreachable("Cannot emit physreg copy instruction");
    +}
    +
     static unsigned getLoadStoreRegOpcode(unsigned Reg,
                                           const TargetRegisterClass *RC,
                                           bool isStackAligned,
    
    Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=107898&r1=107897&r2=107898&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original)
    +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Thu Jul  8 14:46:25 2010
    @@ -632,6 +632,10 @@
                                 const TargetRegisterClass *DestRC,
                                 const TargetRegisterClass *SrcRC,
                                 DebugLoc DL) const;
    +  virtual void copyPhysReg(MachineBasicBlock &MBB,
    +                           MachineBasicBlock::iterator MI, DebugLoc DL,
    +                           unsigned DestReg, unsigned SrcReg,
    +                           bool KillSrc) const;
       virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
                                        MachineBasicBlock::iterator MI,
                                        unsigned SrcReg, bool isKill, int FrameIndex,
    
    
    
    
    From stoklund at 2pi.dk  Thu Jul  8 14:46:30 2010
    From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
    Date: Thu, 08 Jul 2010 19:46:30 -0000
    Subject: [llvm-commits] [llvm] r107899 -
    	/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
    Message-ID: <20100708194630.8A7602A6C12D@llvm.org>
    
    Author: stoklund
    Date: Thu Jul  8 14:46:30 2010
    New Revision: 107899
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107899&view=rev
    Log:
    Teach the x86 floating point stackifier to handle COPY instructions.
    
    This pass runs before COPY instructions are passed to copyPhysReg, so we simply
    translate COPY to the proper pseudo instruction. Note that copyPhysReg does not
    handle floating point stack copies.
    
    Once COPY is used everywhere, this can be cleaned up a bit, and most of the
    pseudo instructions can be removed.
    
    Modified:
        llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
    
    Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=107899&r1=107898&r2=107899&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original)
    +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Thu Jul  8 14:46:30 2010
    @@ -164,6 +164,8 @@
         void handleCompareFP(MachineBasicBlock::iterator &I);
         void handleCondMovFP(MachineBasicBlock::iterator &I);
         void handleSpecialFP(MachineBasicBlock::iterator &I);
    +
    +    bool translateCopy(MachineInstr*);
       };
       char FPS::ID = 0;
     }
    @@ -237,7 +239,10 @@
         unsigned FPInstClass = Flags & X86II::FPTypeMask;
         if (MI->isInlineAsm())
           FPInstClass = X86II::SpecialFP;
    -    
    +
    +    if (MI->isCopy() && translateCopy(MI))
    +      FPInstClass = X86II::SpecialFP;
    +
         if (FPInstClass == X86II::NotFP)
           continue;  // Efficiently ignore non-fp insts!
     
    @@ -1206,3 +1211,33 @@
       I = MBB->erase(I);  // Remove the pseudo instruction
       --I;
     }
    +
    +// Translate a COPY instruction to a pseudo-op that handleSpecialFP understands.
    +bool FPS::translateCopy(MachineInstr *MI) {
    +  unsigned DstReg = MI->getOperand(0).getReg();
    +  unsigned SrcReg = MI->getOperand(1).getReg();
    +
    +  if (DstReg == X86::ST0) {
    +    MI->setDesc(TII->get(X86::FpSET_ST0_80));
    +    MI->RemoveOperand(0);
    +    return true;
    +  }
    +  if (DstReg == X86::ST1) {
    +    MI->setDesc(TII->get(X86::FpSET_ST1_80));
    +    MI->RemoveOperand(0);
    +    return true;
    +  }
    +  if (SrcReg == X86::ST0) {
    +    MI->setDesc(TII->get(X86::FpGET_ST0_80));
    +    return true;
    +  }
    +  if (SrcReg == X86::ST1) {
    +    MI->setDesc(TII->get(X86::FpGET_ST1_80));
    +    return true;
    +  }
    +  if (X86::RFP80RegClass.contains(DstReg, SrcReg)) {
    +    MI->setDesc(TII->get(X86::MOV_Fp8080));
    +    return true;
    +  }
    +  return false;
    +}
    
    
    
    
    From clattner at apple.com  Thu Jul  8 15:04:44 2010
    From: clattner at apple.com (Chris Lattner)
    Date: Thu, 8 Jul 2010 13:04:44 -0700
    Subject: [llvm-commits] [llvm] r107886 - in /llvm/trunk:
    	include/llvm/MC/MCAsmInfo.h include/llvm/MC/MCDirectives.h
    	lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp
    	lib/MC/MCAsmStreamer.cpp lib/MC/MCMachOStreamer.cpp
    	lib/MC/MCParser/AsmParser.cpp
    In-Reply-To: <20100708172242.7F83B2A6C12C@llvm.org>
    References: <20100708172242.7F83B2A6C12C@llvm.org>
    Message-ID: <4DD03A78-26B8-4A48-B18D-C69D30603F8C@apple.com>
    
    
    On Jul 8, 2010, at 10:22 AM, Kevin Enderby wrote:
    
    > Author: enderby
    > Date: Thu Jul  8 12:22:42 2010
    > New Revision: 107886
    > 
    > URL: http://llvm.org/viewvc/llvm-project?rev=107886&view=rev
    > Log:
    > Added the darwin .weak_def_can_be_hidden directive.
    
    Thanks Kevin,
    
    I think that the MCAsmInfo.h/.cpp chunks aren't needed for this until the compiler starts generating these.  When that happens it will be more convenient for it to be a bool than a const char*.  For now it's probably best to revert those two hunks.  Thanks!
    
    -Chris
    
    > 
    > Modified:
    >    llvm/trunk/include/llvm/MC/MCAsmInfo.h
    >    llvm/trunk/include/llvm/MC/MCDirectives.h
    >    llvm/trunk/lib/MC/MCAsmInfo.cpp
    >    llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
    >    llvm/trunk/lib/MC/MCAsmStreamer.cpp
    >    llvm/trunk/lib/MC/MCMachOStreamer.cpp
    >    llvm/trunk/lib/MC/MCParser/AsmParser.cpp
    > 
    > Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original)
    > +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Thu Jul  8 12:22:42 2010
    > @@ -217,6 +217,11 @@
    >     /// global as being a weak defined symbol.
    >     const char *WeakDefDirective;            // Defaults to NULL.
    > 
    > +    /// WeakDefAutoPrivateDirective - This directive, if non-null, is used to
    > +    /// declare a global as being a weak defined symbol that is automatically
    > +    /// made private by the static linker.
    > +    const char *WeakDefAutoPrivateDirective; // Defaults to NULL.
    > +
    >     /// LinkOnceDirective - This directive, if non-null is used to declare a
    >     /// global as being a weak defined symbol.  This is used on cygwin/mingw.
    >     const char *LinkOnceDirective;           // Defaults to NULL.
    > @@ -387,6 +392,9 @@
    >     bool hasNoDeadStrip() const { return HasNoDeadStrip; }
    >     const char *getWeakRefDirective() const { return WeakRefDirective; }
    >     const char *getWeakDefDirective() const { return WeakDefDirective; }
    > +    const char *getWeakDefAutoPrivateDirective() const {
    > +      return WeakDefAutoPrivateDirective;
    > +    }
    >     const char *getLinkOnceDirective() const { return LinkOnceDirective; }
    > 
    >     MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
    > 
    > Modified: llvm/trunk/include/llvm/MC/MCDirectives.h
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDirectives.h?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/include/llvm/MC/MCDirectives.h (original)
    > +++ llvm/trunk/include/llvm/MC/MCDirectives.h Thu Jul  8 12:22:42 2010
    > @@ -38,7 +38,8 @@
    >   MCSA_Reference,           ///< .reference (MachO)
    >   MCSA_Weak,                ///< .weak
    >   MCSA_WeakDefinition,      ///< .weak_definition (MachO)
    > -  MCSA_WeakReference        ///< .weak_reference (MachO)
    > +  MCSA_WeakReference,       ///< .weak_reference (MachO)
    > +  MCSA_WeakDefAutoPrivate   ///< .weak_def_can_be_hidden (MachO)
    > };
    > 
    > enum MCAssemblerFlag {
    > 
    > Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original)
    > +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Thu Jul  8 12:22:42 2010
    > @@ -59,6 +59,7 @@
    >   HasNoDeadStrip = false;
    >   WeakRefDirective = 0;
    >   WeakDefDirective = 0;
    > +  WeakDefAutoPrivateDirective = 0;
    >   LinkOnceDirective = 0;
    >   HiddenVisibilityAttr = MCSA_Hidden;
    >   ProtectedVisibilityAttr = MCSA_Protected;
    > 
    > Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original)
    > +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Thu Jul  8 12:22:42 2010
    > @@ -33,6 +33,7 @@
    >   // Directives:
    >   WeakDefDirective = "\t.weak_definition ";
    >   WeakRefDirective = "\t.weak_reference ";
    > +  WeakDefAutoPrivateDirective = "\t.weak_def_can_be_hidden ";
    >   ZeroDirective = "\t.space\t";  // ".space N" emits N zeros.
    >   HasMachoZeroFillDirective = true;  // Uses .zerofill
    >   HasMachoTBSSDirective = true; // Uses .tbss
    > 
    > Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
    > +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Thu Jul  8 12:22:42 2010
    > @@ -288,6 +288,7 @@
    >   case MCSA_WeakDefinition: OS << "\t.weak_definition\t"; break;
    >       // .weak_reference
    >   case MCSA_WeakReference:  OS << MAI.getWeakRefDirective(); break;
    > +  case MCSA_WeakDefAutoPrivate: OS << "\t.weak_def_can_be_hidden\t"; break;
    >   }
    > 
    >   OS << *Symbol;
    > 
    > Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
    > +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Thu Jul  8 12:22:42 2010
    > @@ -273,6 +273,10 @@
    >     // it has to be in a coalesced section, but this isn't enforced.
    >     SD.setFlags(SD.getFlags() | SF_WeakDefinition);
    >     break;
    > +
    > +  case MCSA_WeakDefAutoPrivate:
    > +    SD.setFlags(SD.getFlags() | SF_WeakDefinition | SF_WeakReference);
    > +    break;
    >   }
    > }
    > 
    > 
    > Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=107886&r1=107885&r2=107886&view=diff
    > ==============================================================================
    > --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
    > +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Thu Jul  8 12:22:42 2010
    > @@ -755,6 +755,8 @@
    >       return ParseDirectiveSymbolAttribute(MCSA_WeakDefinition);
    >     if (IDVal == ".weak_reference")
    >       return ParseDirectiveSymbolAttribute(MCSA_WeakReference);
    > +    if (IDVal == ".weak_def_can_be_hidden")
    > +      return ParseDirectiveSymbolAttribute(MCSA_WeakDefAutoPrivate);
    > 
    >     if (IDVal == ".comm")
    >       return ParseDirectiveComm(/*IsLocal=*/false);
    > 
    > 
    > _______________________________________________
    > llvm-commits mailing list
    > llvm-commits at cs.uiuc.edu
    > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
    
    
    
    
    From wdietz2 at illinois.edu  Thu Jul  8 15:08:05 2010
    From: wdietz2 at illinois.edu (Will Dietz)
    Date: Thu, 08 Jul 2010 20:08:05 -0000
    Subject: [llvm-commits] [poolalloc] r107901 -
     /poolalloc/trunk/test/dsa/regression/2010-07-08.FPDeclaration.c
    Message-ID: <20100708200805.B81EF2A6C12C@llvm.org>
    
    Author: wdietz2
    Date: Thu Jul  8 15:08:05 2010
    New Revision: 107901
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107901&view=rev
    Log:
    Added test case where DSA crashes when processing an indirect call to an external function.
    
    Added:
        poolalloc/trunk/test/dsa/regression/2010-07-08.FPDeclaration.c
    
    Added: poolalloc/trunk/test/dsa/regression/2010-07-08.FPDeclaration.c
    URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2010-07-08.FPDeclaration.c?rev=107901&view=auto
    ==============================================================================
    --- poolalloc/trunk/test/dsa/regression/2010-07-08.FPDeclaration.c (added)
    +++ poolalloc/trunk/test/dsa/regression/2010-07-08.FPDeclaration.c Thu Jul  8 15:08:05 2010
    @@ -0,0 +1,12 @@
    +//Test that DSA doesn't crash when processing an indirect call to an external function.
    +//RUN: llvm-gcc -S --emit-llvm -c %s -o %t.bc
    +//RUN: dsaopt %t.bc -dsa-td -disable-output
    +
    +extern void func(void);
    +
    +int main() {
    +  void (*fp)(void) = func;
    +  fp();
    +  return 0;
    +}
    +
    
    
    
    
    From dpatel at apple.com  Thu Jul  8 15:10:35 2010
    From: dpatel at apple.com (Devang Patel)
    Date: Thu, 08 Jul 2010 20:10:35 -0000
    Subject: [llvm-commits] [llvm] r107903 - in
     /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfDebug.cpp DwarfDebug.h
    Message-ID: <20100708201035.CD0872A6C12C@llvm.org>
    
    Author: dpatel
    Date: Thu Jul  8 15:10:35 2010
    New Revision: 107903
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107903&view=rev
    Log:
    Reuse DIEInteger for 1. This is frequently used while emitting an attribute using dwarf::DW_FORM_flag form.
    
    Modified:
        llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
        llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
    
    Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=107903&r1=107902&r2=107903&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
    +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Jul  8 15:10:35 2010
    @@ -322,6 +322,7 @@
       DwarfDebugRangeSectionSym = DwarfDebugLocSectionSym = 0; 
       DwarfDebugLineSectionSym = CurrentLineSectionSym = 0;
       FunctionBeginSym = FunctionEndSym = 0;
    +  DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
       {
         NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
         beginModule(M);
    @@ -376,7 +377,8 @@
     void DwarfDebug::addUInt(DIE *Die, unsigned Attribute,
                              unsigned Form, uint64_t Integer) {
       if (!Form) Form = DIEInteger::BestForm(false, Integer);
    -  DIEValue *Value = new (DIEValueAllocator) DIEInteger(Integer);
    +  DIEValue *Value = Integer == 1 ? 
    +    DIEIntegerOne : new (DIEValueAllocator) DIEInteger(Integer);
       Die->addValue(Attribute, Form, Value);
     }
     
    
    Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=107903&r1=107902&r2=107903&view=diff
    ==============================================================================
    --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
    +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Thu Jul  8 15:10:35 2010
    @@ -263,6 +263,8 @@
       MCSymbol *DwarfDebugLocSectionSym;
       MCSymbol *DwarfDebugLineSectionSym, *CurrentLineSectionSym;
       MCSymbol *FunctionBeginSym, *FunctionEndSym;
    +
    +  DIEInteger *DIEIntegerOne;
     private:
       
       /// getSourceDirectoryAndFileIds - Return the directory and file ids that
    
    
    
    
    From evan.cheng at apple.com  Thu Jul  8 15:12:24 2010
    From: evan.cheng at apple.com (Evan Cheng)
    Date: Thu, 08 Jul 2010 20:12:24 -0000
    Subject: [llvm-commits] [llvm] r107904 - in /llvm/trunk:
     lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/fpcmp-opt.ll
    Message-ID: <20100708201224.B8FBB2A6C12C@llvm.org>
    
    Author: evancheng
    Date: Thu Jul  8 15:12:24 2010
    New Revision: 107904
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107904&view=rev
    Log:
    Check for FiniteOnlyFPMath as well.
    
    Modified:
        llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
        llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll
    
    Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107904&r1=107903&r2=107904&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
    +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jul  8 15:12:24 2010
    @@ -2295,7 +2295,7 @@
     ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC,
                                  SDValue &ARMCC, SelectionDAG &DAG,
                                  DebugLoc dl) const {
    -  if (UnsafeFPMath &&
    +  if (UnsafeFPMath && FiniteOnlyFPMath() &&
           (CC == ISD::SETEQ || CC == ISD::SETOEQ ||
            CC == ISD::SETNE || CC == ISD::SETUNE) &&
           canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) {
    
    Modified: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107904&r1=107903&r2=107904&view=diff
    ==============================================================================
    --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (original)
    +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Thu Jul  8 15:12:24 2010
    @@ -1,4 +1,4 @@
    -; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math | FileCheck %s
    +; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math -enable-finite-only-fp-math | FileCheck %s
     ; rdar://7461510
     
     define arm_apcscc i32 @t1(float* %a, float* %b) nounwind {
    
    
    
    
    From clattner at apple.com  Thu Jul  8 15:15:36 2010
    From: clattner at apple.com (Chris Lattner)
    Date: Thu, 8 Jul 2010 13:15:36 -0700
    Subject: [llvm-commits] [llvm] r107904 - in /llvm/trunk:
    	lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/fpcmp-opt.ll
    In-Reply-To: <20100708201224.B8FBB2A6C12C@llvm.org>
    References: <20100708201224.B8FBB2A6C12C@llvm.org>
    Message-ID: 
    
    
    On Jul 8, 2010, at 1:12 PM, Evan Cheng wrote:
    
    > Author: evancheng
    > Date: Thu Jul  8 15:12:24 2010
    > New Revision: 107904
    > 
    > URL: http://llvm.org/viewvc/llvm-project?rev=107904&view=rev
    > Log:
    > Check for FiniteOnlyFPMath as well.
    
    Evan, this xform is not target specific.  Is there any reason not to implement it in dag combine?
    
    It also seems really dangerous to me, even for -ffast-math.
    
    -Chris
    
    > 
    > Modified:
    >    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
    >    llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll
    > 
    > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107904&r1=107903&r2=107904&view=diff
    > ==============================================================================
    > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
    > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jul  8 15:12:24 2010
    > @@ -2295,7 +2295,7 @@
    > ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC,
    >                              SDValue &ARMCC, SelectionDAG &DAG,
    >                              DebugLoc dl) const {
    > -  if (UnsafeFPMath &&
    > +  if (UnsafeFPMath && FiniteOnlyFPMath() &&
    >       (CC == ISD::SETEQ || CC == ISD::SETOEQ ||
    >        CC == ISD::SETNE || CC == ISD::SETUNE) &&
    >       canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) {
    > 
    > Modified: llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll
    > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll?rev=107904&r1=107903&r2=107904&view=diff
    > ==============================================================================
    > --- llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll (original)
    > +++ llvm/trunk/test/CodeGen/ARM/fpcmp-opt.ll Thu Jul  8 15:12:24 2010
    > @@ -1,4 +1,4 @@
    > -; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math | FileCheck %s
    > +; RUN: llc < %s -march=arm -mattr=+vfp2 -enable-unsafe-fp-math -enable-finite-only-fp-math | FileCheck %s
    > ; rdar://7461510
    > 
    > define arm_apcscc i32 @t1(float* %a, float* %b) nounwind {
    > 
    > 
    > _______________________________________________
    > llvm-commits mailing list
    > llvm-commits at cs.uiuc.edu
    > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
    
    
    
    
    From enderby at apple.com  Thu Jul  8 15:30:44 2010
    From: enderby at apple.com (Kevin Enderby)
    Date: Thu, 08 Jul 2010 20:30:44 -0000
    Subject: [llvm-commits] [llvm] r107906 - in /llvm/trunk:
     include/llvm/MC/MCAsmInfo.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp
    Message-ID: <20100708203044.F3CA92A6C12C@llvm.org>
    
    Author: enderby
    Date: Thu Jul  8 15:30:44 2010
    New Revision: 107906
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107906&view=rev
    Log:
    Revert some unneeded parts of the change in r107886 for the
    .weak_def_can_be_hidden directive.  Chris pointed out that the MCAsmInfo.h/.cpp
    chunks aren't needed for this until the compiler starts generating these.  And
    when that happens it will be more convenient for it to be a bool than a const
    char*.
    
    Modified:
        llvm/trunk/include/llvm/MC/MCAsmInfo.h
        llvm/trunk/lib/MC/MCAsmInfo.cpp
        llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
    
    Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=107906&r1=107905&r2=107906&view=diff
    ==============================================================================
    --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original)
    +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Thu Jul  8 15:30:44 2010
    @@ -217,11 +217,6 @@
         /// global as being a weak defined symbol.
         const char *WeakDefDirective;            // Defaults to NULL.
     
    -    /// WeakDefAutoPrivateDirective - This directive, if non-null, is used to
    -    /// declare a global as being a weak defined symbol that is automatically
    -    /// made private by the static linker.
    -    const char *WeakDefAutoPrivateDirective; // Defaults to NULL.
    -
         /// LinkOnceDirective - This directive, if non-null is used to declare a
         /// global as being a weak defined symbol.  This is used on cygwin/mingw.
         const char *LinkOnceDirective;           // Defaults to NULL.
    @@ -392,9 +387,6 @@
         bool hasNoDeadStrip() const { return HasNoDeadStrip; }
         const char *getWeakRefDirective() const { return WeakRefDirective; }
         const char *getWeakDefDirective() const { return WeakDefDirective; }
    -    const char *getWeakDefAutoPrivateDirective() const {
    -      return WeakDefAutoPrivateDirective;
    -    }
         const char *getLinkOnceDirective() const { return LinkOnceDirective; }
         
         MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
    
    Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=107906&r1=107905&r2=107906&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original)
    +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Thu Jul  8 15:30:44 2010
    @@ -59,7 +59,6 @@
       HasNoDeadStrip = false;
       WeakRefDirective = 0;
       WeakDefDirective = 0;
    -  WeakDefAutoPrivateDirective = 0;
       LinkOnceDirective = 0;
       HiddenVisibilityAttr = MCSA_Hidden;
       ProtectedVisibilityAttr = MCSA_Protected;
    
    Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=107906&r1=107905&r2=107906&view=diff
    ==============================================================================
    --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original)
    +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Thu Jul  8 15:30:44 2010
    @@ -33,7 +33,6 @@
       // Directives:
       WeakDefDirective = "\t.weak_definition ";
       WeakRefDirective = "\t.weak_reference ";
    -  WeakDefAutoPrivateDirective = "\t.weak_def_can_be_hidden ";
       ZeroDirective = "\t.space\t";  // ".space N" emits N zeros.
       HasMachoZeroFillDirective = true;  // Uses .zerofill
       HasMachoTBSSDirective = true; // Uses .tbss
    
    
    
    
    From stuart at apple.com  Thu Jul  8 15:31:05 2010
    From: stuart at apple.com (Stuart Hastings)
    Date: Thu, 08 Jul 2010 20:31:05 -0000
    Subject: [llvm-commits] [llvm] r107907 -
    	/llvm/trunk/test/FrontendC/2010-07-08-DeclDebugLineNo.c
    Message-ID: <20100708203105.D51052A6C12C@llvm.org>
    
    Author: stuart
    Date: Thu Jul  8 15:31:05 2010
    New Revision: 107907
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107907&view=rev
    Log:
    Test case for r107843.  Radar 8152866.
    
    Added:
        llvm/trunk/test/FrontendC/2010-07-08-DeclDebugLineNo.c
    
    Added: llvm/trunk/test/FrontendC/2010-07-08-DeclDebugLineNo.c
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2010-07-08-DeclDebugLineNo.c?rev=107907&view=auto
    ==============================================================================
    --- llvm/trunk/test/FrontendC/2010-07-08-DeclDebugLineNo.c (added)
    +++ llvm/trunk/test/FrontendC/2010-07-08-DeclDebugLineNo.c Thu Jul  8 15:31:05 2010
    @@ -0,0 +1,10 @@
    +// RUN: %llvmgcc -S -O0 -g %s -o - | FileCheck %s
    +// Insure that dbg.declare lines for locals refer to correct line number records.
    +// Radar 8152866.
    +void foo() {
    +  int l = 0;    // line #4: CHECK: {{call.*llvm.dbg.declare.*%l.*\!dbg }}[[variable_l:![0-9]+]]
    +  int p = 0;    // line #5: CHECK: {{call.*llvm.dbg.declare.*%p.*\!dbg }}[[variable_p:![0-9]+]]
    +}
    +// Now match the line number records:
    +// CHECK: {{^}}[[variable_l]]{{ = metadata ![{]i32 5,}}
    +// CHECK: {{^}}[[variable_p]]{{ = metadata ![{]i32 6,}}
    
    
    
    
    From kalle.raiskila at nokia.com  Thu Jul  8 16:15:22 2010
    From: kalle.raiskila at nokia.com (Kalle Raiskila)
    Date: Thu, 08 Jul 2010 21:15:22 -0000
    Subject: [llvm-commits] [llvm] r107913 - in /llvm/trunk/lib/Target/CellSPU:
     SPUCallingConv.td SPUISelLowering.cpp SPURegisterInfo.cpp SPURegisterInfo.h
    Message-ID: <20100708211522.D721C2A6C12C@llvm.org>
    
    Author: kraiskil
    Date: Thu Jul  8 16:15:22 2010
    New Revision: 107913
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107913&view=rev
    Log:
    Switch SPU calling convention (function arguments) 
    to a Tablegen implementation.
    
    Modified:
        llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td
        llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
        llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp
        llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h
    
    Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td?rev=107913&r1=107912&r2=107913&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td (original)
    +++ llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Thu Jul  8 16:15:22 2010
    @@ -34,76 +34,19 @@
     
     //===----------------------------------------------------------------------===//
     // CellSPU Argument Calling Conventions
    -// (note: this isn't used, but presumably should be at some point when other
    -//  targets do.)
     //===----------------------------------------------------------------------===//
    -/*
    -def CC_SPU : CallingConv<[
    -  CCIfType<[i8],  CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  CCIfType<[i16], CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  CCIfType<[i32], CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  CCIfType<[f32], CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  CCIfType<[i64], CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  CCIfType<[f64], CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  CCIfType<[v16i8, v8i16, v4i32, v4f32, v2i64, v2f64],
    -                  CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    -                                 R12, R13, R14, R15, R16, R17, R18, R19, R20,
    -                                 R21, R22, R23, R24, R25, R26, R27, R28, R29,
    -                                 R30, R31, R32, R33, R34, R35, R36, R37, R38,
    -                                 R39, R40, R41, R42, R43, R44, R45, R46, R47,
    -                                 R48, R49, R50, R51, R52, R53, R54, R55, R56,
    -                                 R57, R58, R59, R60, R61, R62, R63, R64, R65,
    -                                 R66, R67, R68, R69, R70, R71, R72, R73, R74,
    -                                 R75, R76, R77, R78, R79]>>,
    -  
    +def CCC_SPU : CallingConv<[
    +  CCIfType<[i8, i16, i32, i64, i128, f32, f64, 
    +            v16i8, v8i16, v4i32, v4f32, v2i64, v2f64],
    +            CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
    +                           R12, R13, R14, R15, R16, R17, R18, R19, R20,
    +                           R21, R22, R23, R24, R25, R26, R27, R28, R29,
    +                           R30, R31, R32, R33, R34, R35, R36, R37, R38,
    +                           R39, R40, R41, R42, R43, R44, R45, R46, R47,
    +                           R48, R49, R50, R51, R52, R53, R54, R55, R56,
    +                           R57, R58, R59, R60, R61, R62, R63, R64, R65,
    +                           R66, R67, R68, R69, R70, R71, R72, R73, R74,
    +                           R75, R76, R77, R78, R79]>>,
       // Integer/FP values get stored in stack slots that are 8 bytes in size and
       // 8-byte aligned if there are no more registers to hold them.
       CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>,
    @@ -112,4 +55,3 @@
       CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
                   CCAssignToStack<16, 16>>
     ]>;
    -*/
    
    Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=107913&r1=107912&r2=107913&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
    +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Thu Jul  8 16:15:22 2010
    @@ -1014,22 +1014,26 @@
       MachineRegisterInfo &RegInfo = MF.getRegInfo();
       SPUFunctionInfo *FuncInfo = MF.getInfo();
     
    -  const unsigned *ArgRegs = SPURegisterInfo::getArgRegs();
    -  const unsigned NumArgRegs = SPURegisterInfo::getNumArgRegs();
    -
       unsigned ArgOffset = SPUFrameInfo::minStackSize();
       unsigned ArgRegIdx = 0;
       unsigned StackSlotSize = SPUFrameInfo::stackSlotSize();
     
       EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
     
    +  SmallVector ArgLocs;
    +  CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
    +                 *DAG.getContext());
    +  // FIXME: allow for other calling conventions
    +  CCInfo.AnalyzeFormalArguments(Ins, CCC_SPU);
    +
       // Add DAG nodes to load the arguments or copy them out of registers.
       for (unsigned ArgNo = 0, e = Ins.size(); ArgNo != e; ++ArgNo) {
         EVT ObjectVT = Ins[ArgNo].VT;
         unsigned ObjSize = ObjectVT.getSizeInBits()/8;
         SDValue ArgVal;
    +    CCValAssign &VA = ArgLocs[ArgNo];
     
    -    if (ArgRegIdx < NumArgRegs) {
    +    if (VA.isRegLoc()) {
           const TargetRegisterClass *ArgRegClass;
     
           switch (ObjectVT.getSimpleVT().SimpleTy) {
    @@ -1068,7 +1072,7 @@
           }
     
           unsigned VReg = RegInfo.createVirtualRegister(ArgRegClass);
    -      RegInfo.addLiveIn(ArgRegs[ArgRegIdx], VReg);
    +      RegInfo.addLiveIn(VA.getLocReg(), VReg);
           ArgVal = DAG.getCopyFromReg(Chain, dl, VReg, ObjectVT);
           ++ArgRegIdx;
         } else {
    @@ -1088,12 +1092,28 @@
     
       // vararg handling:
       if (isVarArg) {
    -    // unsigned int ptr_size = PtrVT.getSizeInBits() / 8;
    +    // FIXME: we should be able to query the argument registers from 
    +    //        tablegen generated code. 
    +    static const unsigned ArgRegs[] = {
    +      SPU::R3,  SPU::R4,  SPU::R5,  SPU::R6,  SPU::R7,  SPU::R8,  SPU::R9,
    +      SPU::R10, SPU::R11, SPU::R12, SPU::R13, SPU::R14, SPU::R15, SPU::R16,
    +      SPU::R17, SPU::R18, SPU::R19, SPU::R20, SPU::R21, SPU::R22, SPU::R23,
    +      SPU::R24, SPU::R25, SPU::R26, SPU::R27, SPU::R28, SPU::R29, SPU::R30,
    +      SPU::R31, SPU::R32, SPU::R33, SPU::R34, SPU::R35, SPU::R36, SPU::R37,
    +      SPU::R38, SPU::R39, SPU::R40, SPU::R41, SPU::R42, SPU::R43, SPU::R44,
    +      SPU::R45, SPU::R46, SPU::R47, SPU::R48, SPU::R49, SPU::R50, SPU::R51,
    +      SPU::R52, SPU::R53, SPU::R54, SPU::R55, SPU::R56, SPU::R57, SPU::R58,
    +      SPU::R59, SPU::R60, SPU::R61, SPU::R62, SPU::R63, SPU::R64, SPU::R65,
    +      SPU::R66, SPU::R67, SPU::R68, SPU::R69, SPU::R70, SPU::R71, SPU::R72,
    +      SPU::R73, SPU::R74, SPU::R75, SPU::R76, SPU::R77, SPU::R78, SPU::R79
    +    };
    +    // size of ArgRegs array
    +    unsigned NumArgRegs = 77;
    +
         // We will spill (79-3)+1 registers to the stack
         SmallVector MemOps;
     
         // Create the frame slot
    -
         for (; ArgRegIdx != NumArgRegs; ++ArgRegIdx) {
           FuncInfo->setVarArgsFrameIndex(
             MFI->CreateFixedObject(StackSlotSize, ArgOffset, true));
    @@ -1145,8 +1165,15 @@
       const SPUSubtarget *ST = SPUTM.getSubtargetImpl();
       unsigned NumOps     = Outs.size();
       unsigned StackSlotSize = SPUFrameInfo::stackSlotSize();
    -  const unsigned *ArgRegs = SPURegisterInfo::getArgRegs();
    -  const unsigned NumArgRegs = SPURegisterInfo::getNumArgRegs();
    +
    +  SmallVector ArgLocs;
    +  CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
    +                 *DAG.getContext()); 
    +  // FIXME: allow for other calling conventions
    +  CCInfo.AnalyzeCallOperands(Outs, CCC_SPU);
    +  
    +  const unsigned NumArgRegs = ArgLocs.size();
    +
     
       // Handy pointer type
       EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
    @@ -1166,8 +1193,9 @@
       // And the arguments passed on the stack
       SmallVector MemOpChains;
     
    -  for (unsigned i = 0; i != NumOps; ++i) {
    -    SDValue Arg = OutVals[i];
    +  for (; ArgRegIdx != NumOps; ++ArgRegIdx) {
    +    SDValue Arg = OutVals[ArgRegIdx];
    +    CCValAssign &VA = ArgLocs[ArgRegIdx];
     
         // PtrOff will be used to store the current argument to the stack if a
         // register cannot be found for it.
    @@ -1190,7 +1218,7 @@
         case MVT::v8i16:
         case MVT::v16i8:
           if (ArgRegIdx != NumArgRegs) {
    -        RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg));
    +        RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
           } else {
             MemOpChains.push_back(DAG.getStore(Chain, dl, Arg, PtrOff, NULL, 0,
                                                false, false, 0));
    
    Modified: llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp?rev=107913&r1=107912&r2=107913&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp (original)
    +++ llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp Thu Jul  8 16:15:22 2010
    @@ -191,33 +191,6 @@
     {
     }
     
    -// SPU's 128-bit registers used for argument passing:
    -static const unsigned SPU_ArgRegs[] = {
    -  SPU::R3,  SPU::R4,  SPU::R5,  SPU::R6,  SPU::R7,  SPU::R8,  SPU::R9,
    -  SPU::R10, SPU::R11, SPU::R12, SPU::R13, SPU::R14, SPU::R15, SPU::R16,
    -  SPU::R17, SPU::R18, SPU::R19, SPU::R20, SPU::R21, SPU::R22, SPU::R23,
    -  SPU::R24, SPU::R25, SPU::R26, SPU::R27, SPU::R28, SPU::R29, SPU::R30,
    -  SPU::R31, SPU::R32, SPU::R33, SPU::R34, SPU::R35, SPU::R36, SPU::R37,
    -  SPU::R38, SPU::R39, SPU::R40, SPU::R41, SPU::R42, SPU::R43, SPU::R44,
    -  SPU::R45, SPU::R46, SPU::R47, SPU::R48, SPU::R49, SPU::R50, SPU::R51,
    -  SPU::R52, SPU::R53, SPU::R54, SPU::R55, SPU::R56, SPU::R57, SPU::R58,
    -  SPU::R59, SPU::R60, SPU::R61, SPU::R62, SPU::R63, SPU::R64, SPU::R65,
    -  SPU::R66, SPU::R67, SPU::R68, SPU::R69, SPU::R70, SPU::R71, SPU::R72,
    -  SPU::R73, SPU::R74, SPU::R75, SPU::R76, SPU::R77, SPU::R78, SPU::R79
    -};
    -
    -const unsigned *
    -SPURegisterInfo::getArgRegs()
    -{
    -  return SPU_ArgRegs;
    -}
    -
    -unsigned
    -SPURegisterInfo::getNumArgRegs()
    -{
    -  return sizeof(SPU_ArgRegs) / sizeof(SPU_ArgRegs[0]);
    -}
    -
     /// getPointerRegClass - Return the register class to use to hold pointers.
     /// This is used for addressing modes.
     const TargetRegisterClass *
    
    Modified: llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h?rev=107913&r1=107912&r2=107913&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h (original)
    +++ llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h Thu Jul  8 16:15:22 2010
    @@ -86,15 +86,6 @@
         // New methods added:
         //------------------------------------------------------------------------
     
    -    //! Return the array of argument passing registers
    -    /*!
    -      \note The size of this array is returned by getArgRegsSize().
    -     */
    -    static const unsigned *getArgRegs();
    -
    -    //! Return the size of the argument passing register array
    -    static unsigned getNumArgRegs();
    -
         //! Get DWARF debugging register number
         int getDwarfRegNum(unsigned RegNum, bool isEH) const;
     
    
    
    
    
    From sabre at nondot.org  Thu Jul  8 17:27:06 2010
    From: sabre at nondot.org (Chris Lattner)
    Date: Thu, 08 Jul 2010 22:27:06 -0000
    Subject: [llvm-commits] [llvm] r107916 -
    	/llvm/trunk/lib/Target/X86/X86InstrInfo.h
    Message-ID: <20100708222706.EF9182A6C12C@llvm.org>
    
    Author: lattner
    Date: Thu Jul  8 17:27:06 2010
    New Revision: 107916
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107916&view=rev
    Log:
    introduce a new X86II::getMemoryOperandNo method, which
    returns the start of the memory operand for an instruction.
    
    Introduce a new "X86AddrSegment" enum to reduce # magic numbers
    referring to X86 memory operand layout.
    
    Modified:
        llvm/trunk/lib/Target/X86/X86InstrInfo.h
    
    Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=107916&r1=107915&r2=107916&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original)
    +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Thu Jul  8 17:27:06 2010
    @@ -473,21 +473,80 @@
       /// TSFlags indicates that it is pc relative.
       static inline unsigned isImmPCRel(uint64_t TSFlags) {
         switch (TSFlags & X86II::ImmMask) {
    -      default: assert(0 && "Unknown immediate size");
    -      case X86II::Imm8PCRel:
    -      case X86II::Imm16PCRel:
    -      case X86II::Imm32PCRel:
    -        return true;
    -      case X86II::Imm8:
    -      case X86II::Imm16:
    -      case X86II::Imm32:
    -      case X86II::Imm64:
    -        return false;
    +    default: assert(0 && "Unknown immediate size");
    +    case X86II::Imm8PCRel:
    +    case X86II::Imm16PCRel:
    +    case X86II::Imm32PCRel:
    +      return true;
    +    case X86II::Imm8:
    +    case X86II::Imm16:
    +    case X86II::Imm32:
    +    case X86II::Imm64:
    +      return false;
         }
    -  }    
    +  }
    +  
    +  /// getMemoryOperandNo - The function returns the MCInst operand # for the
    +  /// first field of the memory operand.  If the instruction doesn't have a
    +  /// memory operand, this returns -1.
    +  ///
    +  /// Note that this ignores tied operands.  If there is a tied register which
    +  /// is duplicated in the MCInst (e.g. "EAX = addl EAX, [mem]") it is only
    +  /// counted as one operand.
    +  ///
    +  static inline int getMemoryOperandNo(uint64_t TSFlags) {
    +    switch (TSFlags & X86II::FormMask) {
    +    case X86II::MRMInitReg:  assert(0 && "FIXME: Remove this form");
    +    default: assert(0 && "Unknown FormMask value in getMemoryOperandNo!");
    +    case X86II::Pseudo:
    +    case X86II::RawFrm:
    +    case X86II::AddRegFrm:
    +    case X86II::MRMDestReg:
    +    case X86II::MRMSrcReg:
    +       return -1;
    +    case X86II::MRMDestMem:
    +      return 0;
    +    case X86II::MRMSrcMem: {
    +      bool HasVEX_4V = (TSFlags >> 32) & X86II::VEX_4V;
    +      unsigned FirstMemOp = 1;
    +      if (HasVEX_4V)
    +        ++FirstMemOp;// Skip the register source (which is encoded in VEX_VVVV).
    +      
    +      // FIXME: Maybe lea should have its own form?  This is a horrible hack.
    +      //if (Opcode == X86::LEA64r || Opcode == X86::LEA64_32r ||
    +      //    Opcode == X86::LEA16r || Opcode == X86::LEA32r)
    +      return FirstMemOp;
    +    }
    +    case X86II::MRM0r: case X86II::MRM1r:
    +    case X86II::MRM2r: case X86II::MRM3r:
    +    case X86II::MRM4r: case X86II::MRM5r:
    +    case X86II::MRM6r: case X86II::MRM7r:
    +      return -1;
    +    case X86II::MRM0m: case X86II::MRM1m:
    +    case X86II::MRM2m: case X86II::MRM3m:
    +    case X86II::MRM4m: case X86II::MRM5m:
    +    case X86II::MRM6m: case X86II::MRM7m:
    +      return 0;
    +    case X86II::MRM_C1:
    +    case X86II::MRM_C2:
    +    case X86II::MRM_C3:
    +    case X86II::MRM_C4:
    +    case X86II::MRM_C8:
    +    case X86II::MRM_C9:
    +    case X86II::MRM_E8:
    +    case X86II::MRM_F0:
    +    case X86II::MRM_F8:
    +    case X86II::MRM_F9:
    +      return -1;
    +    }
    +  }
     }
     
    -const int X86AddrNumOperands = 5;
    +// FIXME: Move into X86II namespace.
    +enum {
    +  X86AddrSegment = 4,
    +  X86AddrNumOperands = 5
    +};
     
     inline static bool isScale(const MachineOperand &MO) {
       return MO.isImm() &&
    
    
    
    
    From sabre at nondot.org  Thu Jul  8 17:28:12 2010
    From: sabre at nondot.org (Chris Lattner)
    Date: Thu, 08 Jul 2010 22:28:12 -0000
    Subject: [llvm-commits] [llvm] r107917 - in /llvm/trunk:
     lib/Target/X86/X86MCCodeEmitter.cpp test/MC/AsmParser/X86/x86_64-encoding.s
    Message-ID: <20100708222812.848692A6C12C@llvm.org>
    
    Author: lattner
    Date: Thu Jul  8 17:28:12 2010
    New Revision: 107917
    
    URL: http://llvm.org/viewvc/llvm-project?rev=107917&view=rev
    Log:
    Rework segment prefix emission code to handle segments
    in memory operands at the same type as hard coded segments.
    This fixes problems where we'd emit the segment override after
    the REX prefix on instructions like:
    mov %gs:(%rdi), %rax
    
    This fixes rdar://8127102.  I have several cleanup patches coming
    next.
    
    Modified:
        llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
        llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s
    
    Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
    URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=107917&r1=107916&r2=107917&view=diff
    ==============================================================================
    --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original)
    +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Thu Jul  8 17:28:12 2010
    @@ -121,9 +121,6 @@
       }
       
       
    -  void EmitSegmentOverridePrefix(const MCOperand &Op, unsigned TSFlags,
    -                                 unsigned &CurByte, raw_ostream &OS) const;
    -
       void EmitMemModRMByte(const MCInst &MI, unsigned Op,
                             unsigned RegOpcodeField, 
                             uint64_t TSFlags, unsigned &CurByte, raw_ostream &OS,
    @@ -136,7 +133,7 @@
                                const MCInst &MI, const TargetInstrDesc &Desc,
                                raw_ostream &OS) const;
     
    -  void EmitOpcodePrefix(uint64_t TSFlags, unsigned &CurByte,
    +  void EmitOpcodePrefix(uint64_t TSFlags, unsigned &CurByte, int MemOperand,
                             const MCInst &MI, const TargetInstrDesc &Desc,
                             raw_ostream &OS) const;
     };
    @@ -214,27 +211,6 @@
       EmitConstant(0, Size, CurByte, OS);
     }
     
    -void X86MCCodeEmitter::EmitSegmentOverridePrefix(const MCOperand &Op,
    -                                                 unsigned TSFlags,
    -                                                 unsigned &CurByte,
    -                                                 raw_ostream &OS) const {
    -  // If no segment register is present, we don't need anything.
    -  if (Op.getReg() == 0)
    -    return;
    -
    -  // Check if we need an override.
    -  switch (Op.getReg()) {
    -  case X86::CS: EmitByte(0x2E, CurByte, OS); return;
    -  case X86::SS: EmitByte(0x36, CurByte, OS); return;
    -  case X86::DS: EmitByte(0x3E, CurByte, OS); return;
    -  case X86::ES: EmitByte(0x26, CurByte, OS); return;
    -  case X86::FS: EmitByte(0x64, CurByte, OS); return;
    -  case X86::GS: EmitByte(0x65, CurByte, OS); return;
    -  }
    -
    -  assert(0 && "Invalid segment register!");
    -}
    -
     void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op,
                                             unsigned RegOpcodeField,
                                             uint64_t TSFlags, unsigned &CurByte,
    @@ -662,8 +638,11 @@
     }
     
     /// EmitOpcodePrefix - Emit all instruction prefixes prior to the opcode.
    +///
    +/// MemOperand is the operand # of the start of a memory operand if present.  If
    +/// Not present, it is -1.
     void X86MCCodeEmitter::EmitOpcodePrefix(uint64_t TSFlags, unsigned &CurByte,
    -                                        const MCInst &MI, 
    +                                        int MemOperand, const MCInst &MI, 
                                             const TargetInstrDesc &Desc,
                                             raw_ostream &OS) const {
     
    @@ -674,7 +653,24 @@
       // Emit segment override opcode prefix as needed.
       switch (TSFlags & X86II::SegOvrMask) {
       default: assert(0 && "Invalid segment!");
    -  case 0: break;  // No segment override!
    +  case 0:
    +    // No segment override, check for explicit one on memory operand.
    +    if (MemOperand != -1 &&   // If the instruction has a memory operand.
    +        // FIXME: This is disgusting.
    +        MI.getOpcode() != X86::LEA64r && MI.getOpcode() != X86::LEA64_32r &&
    +        MI.getOpcode() != X86::LEA16r && MI.getOpcode() != X86::LEA32r) {
    +      switch (MI.getOperand(MemOperand+X86AddrSegment).getReg()) {
    +      default: assert(0 && "Unknown segment register!");
    +      case 0: break;
    +      case X86::CS: EmitByte(0x2E, CurByte, OS); break;
    +      case X86::SS: EmitByte(0x36, CurByte, OS); break;
    +      case X86::DS: EmitByte(0x3E, CurByte, OS); break;
    +      case X86::ES: EmitByte(0x26, CurByte, OS); break;
    +      case X86::FS: EmitByte(0x64, CurByte, OS); break;
    +      case X86::GS: EmitByte(0x65, CurByte, OS); break;
    +      }
    +    }
    +    break;
       case X86II::FS:
         EmitByte(0x64, CurByte, OS);
         break;
    @@ -757,6 +753,17 @@
       const TargetInstrDesc &Desc = TII.get(Opcode);
       uint64_t TSFlags = Desc.TSFlags;
     
    +  
    +  // If this is a two-address instruction, skip one of the register operands.
    +  // FIXME: This should be handled during MCInst lowering.
    +  unsigned NumOps = Desc.getNumOperands();
    +  unsigned CurOp = 0;
    +  if (NumOps > 1 && Desc.getOperandConstraint(1, TOI::TIED_TO) != -1)
    +    ++CurOp;
    +  else if (NumOps > 2 && Desc.getOperandConstraint(NumOps-1, TOI::TIED_TO)== 0)
    +    // Skip the last source operand that is tied_to the dest reg. e.g. LXADD32
    +    --NumOps;
    +  
       // Keep track of the current byte being emitted.
       unsigned CurByte = 0;
       
    @@ -770,24 +777,17 @@
         HasVEXPrefix = true;
       if ((TSFlags >> 32) & X86II::VEX_4V)
         HasVEX_4V = true;
    -
    -  // FIXME: We should emit the prefixes in exactly the same order as GAS does,
    -  // in order to provide diffability.
    -
    +  
    +  // Determine where the memory operand starts, if present.
    +  int MemoryOperand = X86II::getMemoryOperandNo(TSFlags);
    +  if (MemoryOperand != -1) MemoryOperand += CurOp;
    +  
       if (!HasVEXPrefix)
    -    EmitOpcodePrefix(TSFlags, CurByte, MI, Desc, OS);
    +    EmitOpcodePrefix(TSFlags, CurByte, MemoryOperand, MI, Desc, OS);
       else
    +    // FIXME: Segment overrides??
         EmitVEXOpcodePrefix(TSFlags, CurByte, MI, Desc, OS);
       
    -  // If this is a two-address instruction, skip one of the register operands.
    -  unsigned NumOps = Desc.getNumOperands();
    -  unsigned CurOp = 0;
    -  if (NumOps > 1 && Desc.getOperandConstraint(1, TOI::TIED_TO) != -1)
    -    ++CurOp;
    -  else if (NumOps > 2 && Desc.getOperandConstraint(NumOps-1, TOI::TIED_TO)== 0)
    -    // Skip the last source operand that is tied_to the dest reg. e.g. LXADD32
    -    --NumOps;
    -  
       unsigned char BaseOpcode = X86II::getBaseOpcodeFor(TSFlags);
       unsigned SrcRegNum = 0;
       switch (TSFlags & X86II::FormMask) {
    @@ -812,7 +812,6 @@
         break;
       
       case