From echristo at apple.com Mon Oct 18 01:49:12 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 18 Oct 2010 06:49:12 -0000 Subject: [llvm-commits] [llvm] r116698 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Message-ID: <20101018064912.6CB4D2A6C12C@llvm.org> Author: echristo Date: Mon Oct 18 01:49:12 2010 New Revision: 116698 URL: http://llvm.org/viewvc/llvm-project?rev=116698&view=rev Log: Remove the check for invalid calling conventions. Testing shows that they're working just fine. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116698&r1=116697&r2=116698&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 18 01:49:12 2010 @@ -1518,11 +1518,8 @@ // Check the calling convention. ImmutableCallSite CS(CI); CallingConv::ID CC = CS.getCallingConv(); + // TODO: Avoid some calling conventions? - if (CC != CallingConv::C) { - // errs() << "Can't handle calling convention: " << CC << "\n"; - return false; - } // Let SDISel handle vararg functions. const PointerType *PT = cast(CS.getCalledValue()->getType()); From baldrick at free.fr Mon Oct 18 03:13:47 2010 From: baldrick at free.fr (Duncan Sands) Date: Mon, 18 Oct 2010 10:13:47 +0200 Subject: [llvm-commits] [llvm] r116665 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/MachineModuleInfo.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/Target/X86/X86AsmPrinter.cpp test/CodeGen/X86/fltused.ll In-Reply-To: References: <20101016082541.4E3DB2A6C12C@llvm.org> <4CB995C6.7060102@free.fr> Message-ID: <4CBC01BB.3070804@free.fr> Hi Michael, >>> X86-Windows: Emit an undefined global __fltused symbol when targeting Windows >>> if any floating point arguments are passed to an external function. >> >> why? > > Because the Microsoft C standard library requires it. If you don't > printf("%f", 1.0); would fail via a call to abort. An unknown set of > functions have this behavior. thanks for the explanation. If I understand right, this is only needed when calling functions in the Microsoft C standard library, notably printf and scanf but maybe others. > You are correct about indirect calls. As for varargs, the test I added > was explicitly for printf. The CallInst is the call-site. I only use > the function type to avoid checking function calls which obviously > cannot lead to library calls. Yes, I misread your patch: I thought you were only checking the arguments of the function type, but in fact you were indeed checking the callsite. Ciao, Duncan. From kalle.raiskila at nokia.com Mon Oct 18 04:34:19 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 18 Oct 2010 09:34:19 -0000 Subject: [llvm-commits] [llvm] r116701 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp test/CodeGen/CellSPU/sext128.ll Message-ID: <20101018093419.E91BD2A6C12C@llvm.org> Author: kraiskil Date: Mon Oct 18 04:34:19 2010 New Revision: 116701 URL: http://llvm.org/viewvc/llvm-project?rev=116701&view=rev Log: Improve lowering of sext to i128 on SPU. The old algorithm inserted a 'rotqmbyi' instruction which was both redundant and wrong - it made shufb select bytes from the wrong end of the input quad. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/test/CodeGen/CellSPU/sext128.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=116701&r1=116700&r2=116701&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Oct 18 04:34:19 2010 @@ -2642,11 +2642,16 @@ DAG.getNode(SPUISD::PREFSLOT2VEC, dl, mvt, Op0, Op0), DAG.getConstant(31, MVT::i32)); + // reinterpret as a i128 (SHUFB requires it). This gets lowered away. + SDValue extended = SDValue(DAG.getMachineNode(TargetOpcode::COPY_TO_REGCLASS, + dl, Op0VT, Op0, + DAG.getTargetConstant( + SPU::GPRCRegClass.getID(), + MVT::i32)), 0); // Shuffle bytes - Copy the sign bits into the upper 64 bits // and the input value into the lower 64 bits. SDValue extShuffle = DAG.getNode(SPUISD::SHUFB, dl, mvt, - DAG.getNode(ISD::ANY_EXTEND, dl, MVT::i128, Op0), sraVal, shufMask); - + extended, sraVal, shufMask); return DAG.getNode(ISD::BIT_CONVERT, dl, MVT::i128, extShuffle); } Modified: llvm/trunk/test/CodeGen/CellSPU/sext128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/sext128.ll?rev=116701&r1=116700&r2=116701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/sext128.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/sext128.ll Mon Oct 18 04:34:19 2010 @@ -12,6 +12,7 @@ ; CHECK: long 269488144 ; CHECK: long 66051 ; CHECK: long 67438087 +; CHECK-NOT: rotqmbyi ; CHECK: rotmai ; CHECK: lqa ; CHECK: shufb @@ -25,6 +26,7 @@ ; CHECK: long 269488144 ; CHECK: long 269488144 ; CHECK: long 66051 +; CHECK-NOT: rotqmbyi ; CHECK: rotmai ; CHECK: lqa ; CHECK: shufb @@ -39,6 +41,7 @@ ; CHECK: long 269488144 ; CHECK: long 269488144 ; CHECK: long 66051 +; CHECK-NOT: rotqmbyi ; CHECK: rotmai ; CHECK: lqa ; CHECK: shufb From criswell at uiuc.edu Mon Oct 18 11:18:05 2010 From: criswell at uiuc.edu (John Criswell) Date: Mon, 18 Oct 2010 16:18:05 -0000 Subject: [llvm-commits] [poolalloc] r116708 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <20101018161805.B0B8A2A6C12C@llvm.org> Author: criswell Date: Mon Oct 18 11:18:05 2010 New Revision: 116708 URL: http://llvm.org/viewvc/llvm-project?rev=116708&view=rev Log: Removed dead code. Added a comment on why our calloc() handling is incorrect (I think). 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=116708&r1=116707&r2=116708&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Mon Oct 18 11:18:05 2010 @@ -317,6 +317,13 @@ } void FuncTransform::visitAllocaInst(AllocaInst &MI) { +#if 0 + if (MI.getType() != PoolAllocate::PoolDescPtrTy) { + Value *PH = getPoolHandle(&MI); + assert (PH && "Alloca has no pool handle!\n"); + } +#endif + // FIXME: We should remove SAFECode-specific functionality (and comments) // SAFECode will register alloca instructions with the run-time, so do not // do that here. @@ -450,6 +457,8 @@ const Type* Int32Type = Type::getInt32Ty(CS.getInstruction()->getContext()); const Type* Int64Type = Type::getInt64Ty(CS.getInstruction()->getContext()); + // FIXME: This transform is not correct; calloc does not zero the memory + // if NULL is returned. // FIXME: Ensure that we use 32/64-bit object length sizes consistently // FIXME: Rename 'useLong' to something more descriptive? // FIXME: Introduce 'ObjectAllocationSize' variable From grosbach at apple.com Mon Oct 18 11:29:26 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 18 Oct 2010 16:29:26 -0000 Subject: [llvm-commits] [llvm] r116710 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <20101018162926.455DB2A6C12D@llvm.org> Author: grosbach Date: Mon Oct 18 11:29:26 2010 New Revision: 116710 URL: http://llvm.org/viewvc/llvm-project?rev=116710&view=rev Log: Trivial grammar tweak. Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=116710&r1=116709&r2=116710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Mon Oct 18 11:29:26 2010 @@ -829,7 +829,7 @@ ScratchReg = RS->scavengeRegister(RC, I, SPAdj); ++NumScavengedRegs; } - // replace this reference to the virtual register with the + // Replace this reference to the virtual register with the // scratch register. assert (ScratchReg && "Missing scratch register!"); MI->getOperand(i).setReg(ScratchReg); From rafael.espindola at gmail.com Mon Oct 18 11:38:05 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 16:38:05 -0000 Subject: [llvm-commits] [llvm] r116711 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp test/MC/ELF/relocation-386.s Message-ID: <20101018163805.102D02A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 11:38:04 2010 New Revision: 116711 URL: http://llvm.org/viewvc/llvm-project?rev=116711&view=rev Log: Handle GOTOFF correctly on i386. Added: llvm/trunk/test/MC/ELF/relocation-386.s Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116711&r1=116710&r2=116711&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 11:38:04 2010 @@ -556,17 +556,19 @@ if (SD.isExternal()) return true; - if (Section.getFlags() & MCSectionELF::SHF_MERGE) - return Target.getConstant() != 0; - MCSymbolRefExpr::VariantKind Kind = Target.getSymA()->getKind(); const MCSectionELF &Sec2 = static_cast(F.getParent()->getSection()); if (&Sec2 != &Section && - (Kind == MCSymbolRefExpr::VK_PLT || Kind == MCSymbolRefExpr::VK_GOTPCREL)) + (Kind == MCSymbolRefExpr::VK_PLT || + Kind == MCSymbolRefExpr::VK_GOTPCREL || + Kind == MCSymbolRefExpr::VK_GOTOFF)) return true; + if (Section.getFlags() & MCSectionELF::SHF_MERGE) + return Target.getConstant() != 0; + return false; } @@ -663,7 +665,7 @@ case MCSymbolRefExpr::VK_GOT: Type = ELF::R_X86_64_GOT32; break; - case llvm::MCSymbolRefExpr::VK_GOTPCREL: + case MCSymbolRefExpr::VK_GOTPCREL: Type = ELF::R_X86_64_GOTPCREL; break; default: @@ -689,6 +691,14 @@ // instead? case X86::reloc_signed_4byte: case X86::reloc_pcrel_4byte: + switch (Modifier) { + case MCSymbolRefExpr::VK_GOTOFF: + Type = ELF::R_386_GOTOFF; + break; + default: + llvm_unreachable("Unimplemented"); + } + break; case FK_Data_4: Type = ELF::R_386_32; break; case FK_Data_2: Type = ELF::R_386_16; break; case X86::reloc_pcrel_1byte: Added: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116711&view=auto ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (added) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 11:38:04 2010 @@ -0,0 +1,20 @@ +// RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o - | elf-dump | FileCheck %s + +// Test that we produce a GOTOFF and that the relocation uses the symbol and not +// the section. + + +// CHECK: # Symbol 1 +// CHECK-NEXT: (('st_name', 5) # '.Lfoo' + +// CHECK: # Relocation 0 +// CHECK-NEXT: (('r_offset', 2) +// CHECK-NEXT: ('r_sym', 1) +// CHECK-NEXT: ('r_type', 9) + + .text +bar: + leal .Lfoo at GOTOFF(%ebx), %eax + .section .rodata.str1.16,"aMS", at progbits,1 +.Lfoo: + .asciz "bool llvm::llvm_start_multithreaded()" From grosbach at apple.com Mon Oct 18 11:38:50 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 18 Oct 2010 16:38:50 -0000 Subject: [llvm-commits] [llvm] r116712 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20101018163850.BEBD52A6C12C@llvm.org> Author: grosbach Date: Mon Oct 18 11:38:50 2010 New Revision: 116712 URL: http://llvm.org/viewvc/llvm-project?rev=116712&view=rev Log: Grammar tweak. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=116712&r1=116711&r2=116712&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Oct 18 11:38:50 2010 @@ -826,7 +826,7 @@ } // If stack and double are 8-byte aligned and we are spilling an odd number - // of GPRs. Spill one extra callee save GPR so we won't have to pad between + // of GPRs, spill one extra callee save GPR so we won't have to pad between // the integer and double callee save areas. unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); if (TargetAlign == 8 && (NumGPRSpills & 1)) { From grosbach at apple.com Mon Oct 18 11:48:59 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 18 Oct 2010 16:48:59 -0000 Subject: [llvm-commits] [llvm] r116714 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20101018164859.D0DF62A6C12C@llvm.org> Author: grosbach Date: Mon Oct 18 11:48:59 2010 New Revision: 116714 URL: http://llvm.org/viewvc/llvm-project?rev=116714&view=rev Log: ARM addrmode4 instructions (ldm, stm and friends) can't encode an immediate offset for stack references. Make sure we take that into account when deciding whether to reserver an emergency spill slot for the register scavenger. rdar://8559625 Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=116714&r1=116713&r2=116714&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Oct 18 11:48:59 2010 @@ -661,8 +661,9 @@ if (hasFP(MF) && AFI->hasStackFrame()) Limit = std::min(Limit, (1U << 8) - 1); break; + case ARMII::AddrMode4: case ARMII::AddrMode6: - // Addressing mode 6 (load/store) instructions can't encode an + // Addressing modes 4 & 6 (load/store) instructions can't encode an // immediate offset for stack references. return 0; default: From rafael.espindola at gmail.com Mon Oct 18 11:58:03 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 16:58:03 -0000 Subject: [llvm-commits] [llvm] r116715 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp test/MC/ELF/relocation-386.s Message-ID: <20101018165803.758962A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 11:58:03 2010 New Revision: 116715 URL: http://llvm.org/viewvc/llvm-project?rev=116715&view=rev Log: Produce a R_386_PLT32 when needed. Moved the default cases of switches to the start for consistency. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/test/MC/ELF/relocation-386.s Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116715&r1=116714&r2=116715&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 11:58:03 2010 @@ -639,6 +639,8 @@ if (Is64Bit) { if (IsPCRel) { switch (Modifier) { + default: + llvm_unreachable("Unimplemented"); case MCSymbolRefExpr::VK_None: Type = ELF::R_X86_64_PC32; break; @@ -648,8 +650,6 @@ case llvm::MCSymbolRefExpr::VK_GOTPCREL: Type = ELF::R_X86_64_GOTPCREL; break; - default: - llvm_unreachable("Unimplemented"); } } else { switch ((unsigned)Fixup.getKind()) { @@ -659,6 +659,8 @@ case X86::reloc_pcrel_4byte: assert(isInt<32>(Target.getConstant())); switch (Modifier) { + default: + llvm_unreachable("Unimplemented"); case MCSymbolRefExpr::VK_None: Type = ELF::R_X86_64_32S; break; @@ -668,8 +670,6 @@ case MCSymbolRefExpr::VK_GOTPCREL: Type = ELF::R_X86_64_GOTPCREL; break; - default: - llvm_unreachable("Unimplemented"); } break; case FK_Data_4: @@ -682,7 +682,13 @@ } } else { if (IsPCRel) { - Type = ELF::R_386_PC32; + switch (Modifier) { + default: + llvm_unreachable("Unimplemented"); + case MCSymbolRefExpr::VK_PLT: + Type = ELF::R_386_PLT32; + break; + } } else { switch ((unsigned)Fixup.getKind()) { default: llvm_unreachable("invalid fixup kind!"); @@ -692,11 +698,11 @@ case X86::reloc_signed_4byte: case X86::reloc_pcrel_4byte: switch (Modifier) { + default: + llvm_unreachable("Unimplemented"); case MCSymbolRefExpr::VK_GOTOFF: Type = ELF::R_386_GOTOFF; break; - default: - llvm_unreachable("Unimplemented"); } break; case FK_Data_4: Type = ELF::R_386_32; break; Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116715&r1=116714&r2=116715&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 11:58:03 2010 @@ -1,7 +1,7 @@ // RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o - | elf-dump | FileCheck %s -// Test that we produce a GOTOFF and that the relocation uses the symbol and not -// the section. +// Test that we produce the correct relocation types and that the relocation +// to .Lfoo uses the symbol and not the section. // CHECK: # Symbol 1 @@ -11,10 +11,20 @@ // CHECK-NEXT: (('r_offset', 2) // CHECK-NEXT: ('r_sym', 1) // CHECK-NEXT: ('r_type', 9) +// CHECK-NEXT: ), +// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: (('r_offset', +// CHECK-NEXT: ('r_sym', +// CHECK-NEXT: ('r_type', 4) .text bar: leal .Lfoo at GOTOFF(%ebx), %eax - .section .rodata.str1.16,"aMS", at progbits,1 + + .global bar2 +bar2: + calll bar2 at PLT + + .section .rodata.str1.16,"aMS", at progbits,1 .Lfoo: .asciz "bool llvm::llvm_start_multithreaded()" From enderby at apple.com Mon Oct 18 12:04:36 2010 From: enderby at apple.com (Kevin Enderby) Date: Mon, 18 Oct 2010 17:04:36 -0000 Subject: [llvm-commits] [llvm] r116716 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp lib/Target/X86/X86InstrControl.td lib/Target/X86/X86InstrInfo.td test/MC/X86/x86-32.s test/MC/X86/x86-64.s Message-ID: <20101018170436.E6CF52A6C12C@llvm.org> Author: enderby Date: Mon Oct 18 12:04:36 2010 New Revision: 116716 URL: http://llvm.org/viewvc/llvm-project?rev=116716&view=rev Log: Added a handful of x86-32 instructions that were missing so that llvm-mc would be more complete. These are only expected to be used by llvm-mc with assembly source so there is no pattern, [], in the .td files. Most are being added to X86InstrInfo.td as Chris suggested and only comments about register uses are added. Suggestions welcome on the .td changes as I'm not sure on every detail of the x86 records. More missing instructions will be coming. Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp llvm/trunk/lib/Target/X86/X86InstrControl.td llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/test/MC/X86/x86-32.s llvm/trunk/test/MC/X86/x86-64.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=116716&r1=116715&r2=116716&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Oct 18 12:04:36 2010 @@ -1082,6 +1082,13 @@ Operands[0] = X86Operand::CreateToken("xor", NameLoc); } + // FIXME: Hack to handle recognize "aa[dm]" -> "aa[dm] $0xA". + if ((Name.startswith("aad") || Name.startswith("aam")) && + Operands.size() == 1) { + const MCExpr *A = MCConstantExpr::Create(0xA, getParser().getContext()); + Operands.push_back(X86Operand::CreateImm(A, NameLoc, NameLoc)); + } + return false; } Modified: llvm/trunk/lib/Target/X86/X86InstrControl.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrControl.td?rev=116716&r1=116715&r2=116716&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrControl.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrControl.td Mon Oct 18 12:04:36 2010 @@ -24,10 +24,15 @@ def RETI : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops), "ret\t$amt", [(X86retflag timm:$amt)]>; + def RETIW : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops), + "retw\t$amt", + [(X86retflag timm:$amt)]>, OpSize; def LRET : I <0xCB, RawFrm, (outs), (ins), "lret", []>; def LRETI : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt), "lret\t$amt", []>; + def LRETIW : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt), + "lretw\t$amt", []>, OpSize; } // Unconditional branches. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=116716&r1=116715&r2=116716&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Oct 18 12:04:36 2010 @@ -1182,7 +1182,45 @@ // Table lookup instructions def XLAT : I<0xD7, RawFrm, (outs), (ins), "xlatb", []>; - +// ASCII Adjust After Addition +// sets AL, AH and CF and AF of EFLAGS and uses AL and AF of EFLAGS +def AAA : I<0x37, RawFrm, (outs), (ins), "aaa", []>, Requires<[In32BitMode]>; + +// ASCII Adjust AX Before Division +// sets AL, AH and EFLAGS and uses AL and AH +def AAD8i8 : Ii8<0xD5, RawFrm, (outs), (ins i8imm:$src), + "aad\t$src", []>, Requires<[In32BitMode]>; + +// ASCII Adjust AX After Multiply +// sets AL, AH and EFLAGS and uses AL +def AAM8i8 : Ii8<0xD4, RawFrm, (outs), (ins i8imm:$src), + "aam\t$src", []>, Requires<[In32BitMode]>; + +// ASCII Adjust AL After Subtraction - sets +// sets AL, AH and CF and AF of EFLAGS and uses AL and AF of EFLAGS +def AAS : I<0x3F, RawFrm, (outs), (ins), "aas", []>, Requires<[In32BitMode]>; + +// Decimal Adjust AL after Addition +// sets AL, CF and AF of EFLAGS and uses AL, CF and AF of EFLAGS +def DAA : I<0x27, RawFrm, (outs), (ins), "daa", []>, Requires<[In32BitMode]>; + +// Decimal Adjust AL after Subtraction +// sets AL, CF and AF of EFLAGS and uses AL, CF and AF of EFLAGS +def DAS : I<0x2F, RawFrm, (outs), (ins), "das", []>, Requires<[In32BitMode]>; + +// Check Array Index Against Bounds +def BOUNDS16rm : I<0x62, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$src), + "bound\t{$src, $dst|$dst, $src}", []>, OpSize, + Requires<[In32BitMode]>; +def BOUNDS32rm : I<0x62, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src), + "bound\t{$src, $dst|$dst, $src}", []>, + Requires<[In32BitMode]>; + +// Adjust RPL Field of Segment Selector +def ARPL16rr : I<0x63, MRMDestReg, (outs GR16:$src), (ins GR16:$dst), + "arpl\t{$src, $dst|$dst, $src}", []>, Requires<[In32BitMode]>; +def ARPL16mr : I<0x63, MRMSrcMem, (outs GR16:$src), (ins i16mem:$dst), + "arpl\t{$src, $dst|$dst, $src}", []>, Requires<[In32BitMode]>; //===----------------------------------------------------------------------===// // Subsystems. Modified: llvm/trunk/test/MC/X86/x86-32.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32.s?rev=116716&r1=116715&r2=116716&view=diff ============================================================================== --- llvm/trunk/test/MC/X86/x86-32.s (original) +++ llvm/trunk/test/MC/X86/x86-32.s Mon Oct 18 12:04:36 2010 @@ -590,3 +590,67 @@ // PR8288 pshufw $90, %mm4, %mm0 +// rdar://8416805 +// CHECK: aaa +// CHECK: encoding: [0x37] + aaa + +// CHECK: aad $1 +// CHECK: encoding: [0xd5,0x01] + aad $1 + +// CHECK: aad $10 +// CHECK: encoding: [0xd5,0x0a] + aad $0xA + +// CHECK: aad $10 +// CHECK: encoding: [0xd5,0x0a] + aad + +// CHECK: aam $2 +// CHECK: encoding: [0xd4,0x02] + aam $2 + +// CHECK: aam $10 +// CHECK: encoding: [0xd4,0x0a] + aam $0xA + +// CHECK: aam $10 +// CHECK: encoding: [0xd4,0x0a] + aam + +// CHECK: aas +// CHECK: encoding: [0x3f] + aas + +// CHECK: daa +// CHECK: encoding: [0x27] + daa + +// CHECK: das +// CHECK: encoding: [0x2f] + das + +// CHECK: retw $31438 +// CHECK: encoding: [0x66,0xc2,0xce,0x7a] + retw $0x7ace + +// CHECK: lretw $31438 +// CHECK: encoding: [0x66,0xca,0xce,0x7a] + lretw $0x7ace + +// CHECK: bound 2(%eax), %bx +// CHECK: encoding: [0x66,0x62,0x58,0x02] + bound 2(%eax),%bx + +// CHECK: bound 4(%ebx), %ecx +// CHECK: encoding: [0x62,0x4b,0x04] + bound 4(%ebx),%ecx + +// CHECK: arpl %bx, %bx +// CHECK: encoding: [0x63,0xdb] + arpl %bx,%bx + +// CHECK: arpl %bx, 6(%ecx) +// CHECK: encoding: [0x63,0x59,0x06] + arpl %bx,6(%ecx) Modified: llvm/trunk/test/MC/X86/x86-64.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=116716&r1=116715&r2=116716&view=diff ============================================================================== --- llvm/trunk/test/MC/X86/x86-64.s (original) +++ llvm/trunk/test/MC/X86/x86-64.s Mon Oct 18 12:04:36 2010 @@ -714,6 +714,15 @@ // CHECK: iretq // CHECK: encoding: [0x48,0xcf] +// rdar://8416805 +// CHECK: retw $31438 +// CHECK: encoding: [0x66,0xc2,0xce,0x7a] + retw $0x7ace + +// CHECK: lretw $31438 +// CHECK: encoding: [0x66,0xca,0xce,0x7a] + lretw $0x7ace + // rdar://8403907 sysret // CHECK: sysretl From rafael.espindola at gmail.com Mon Oct 18 13:03:28 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 18:03:28 -0000 Subject: [llvm-commits] [llvm] r116719 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20101018180328.8275C2A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 13:03:28 2010 New Revision: 116719 URL: http://llvm.org/viewvc/llvm-project?rev=116719&view=rev Log: Make the bots happy. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116719&r1=116718&r2=116719&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 13:03:28 2010 @@ -684,7 +684,9 @@ if (IsPCRel) { switch (Modifier) { default: - llvm_unreachable("Unimplemented"); + Type = ELF::R_386_PC32; + //llvm_unreachable("Unimplemented"); + break; case MCSymbolRefExpr::VK_PLT: Type = ELF::R_386_PLT32; break; From gohman at apple.com Mon Oct 18 13:04:48 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 18:04:48 -0000 Subject: [llvm-commits] [llvm] r116720 - in /llvm/trunk: include/llvm/Support/ lib/Analysis/ lib/CodeGen/ test/Analysis/BasicAA/ test/Analysis/GlobalsModRef/ test/Analysis/LoopDependenceAnalysis/ test/Analysis/TypeBasedAliasAnalysis/ test/Other/ test/Transforms/ArgumentPromotion/ test/Transforms/DeadStoreElimination/ test/Transforms/GVN/ test/Transforms/Inline/ test/Transforms/LICM/ test/Transforms/MemCpyOpt/ test/Transforms/Sink/ Message-ID: <20101018180449.02B6E2A6C12C@llvm.org> Author: djg Date: Mon Oct 18 13:04:47 2010 New Revision: 116720 URL: http://llvm.org/viewvc/llvm-project?rev=116720&view=rev Log: Make BasicAliasAnalysis a normal AliasAnalysis implementation which does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. Modified: llvm/trunk/include/llvm/Support/StandardPasses.h llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll llvm/trunk/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll llvm/trunk/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll llvm/trunk/test/Analysis/BasicAA/byval.ll llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll llvm/trunk/test/Analysis/BasicAA/empty.ll llvm/trunk/test/Analysis/BasicAA/gep-alias.ll llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll llvm/trunk/test/Analysis/BasicAA/unreachable-block.ll llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll llvm/trunk/test/Other/lint.ll llvm/trunk/test/Transforms/ArgumentPromotion/basictest.ll llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll llvm/trunk/test/Transforms/DeadStoreElimination/PartialStore.ll llvm/trunk/test/Transforms/DeadStoreElimination/const-pointers.ll llvm/trunk/test/Transforms/DeadStoreElimination/context-sensitive.ll llvm/trunk/test/Transforms/DeadStoreElimination/free.ll llvm/trunk/test/Transforms/DeadStoreElimination/lifetime.ll llvm/trunk/test/Transforms/DeadStoreElimination/no-targetdata.ll llvm/trunk/test/Transforms/DeadStoreElimination/simple.ll llvm/trunk/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll llvm/trunk/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll llvm/trunk/test/Transforms/GVN/2008-07-02-Unreachable.ll llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll llvm/trunk/test/Transforms/GVN/calls-nonlocal.ll llvm/trunk/test/Transforms/GVN/condprop.ll llvm/trunk/test/Transforms/GVN/invariant-simple.ll llvm/trunk/test/Transforms/GVN/lifetime-simple.ll llvm/trunk/test/Transforms/GVN/load-constant-mem.ll llvm/trunk/test/Transforms/GVN/load-pre-licm.ll llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll llvm/trunk/test/Transforms/GVN/mixed.ll llvm/trunk/test/Transforms/GVN/nonescaping-malloc.ll llvm/trunk/test/Transforms/GVN/null-aliases-nothing.ll llvm/trunk/test/Transforms/GVN/pre-load.ll llvm/trunk/test/Transforms/GVN/rle-must-alias.ll llvm/trunk/test/Transforms/GVN/rle-nonlocal.ll llvm/trunk/test/Transforms/GVN/rle-semidominated.ll llvm/trunk/test/Transforms/GVN/rle.ll llvm/trunk/test/Transforms/Inline/devirtualize-3.ll llvm/trunk/test/Transforms/Inline/devirtualize.ll llvm/trunk/test/Transforms/Inline/gvn-inline-iteration.ll llvm/trunk/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll llvm/trunk/test/Transforms/LICM/scalar_promote.ll llvm/trunk/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll llvm/trunk/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll llvm/trunk/test/Transforms/MemCpyOpt/loadstore-sret.ll llvm/trunk/test/Transforms/MemCpyOpt/memcpy.ll llvm/trunk/test/Transforms/MemCpyOpt/memmove.ll llvm/trunk/test/Transforms/MemCpyOpt/sret.ll llvm/trunk/test/Transforms/Sink/basic.ll Modified: llvm/trunk/include/llvm/Support/StandardPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StandardPasses.h?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/StandardPasses.h (original) +++ llvm/trunk/include/llvm/Support/StandardPasses.h Mon Oct 18 13:04:47 2010 @@ -72,6 +72,7 @@ static inline void createStandardFunctionPasses(PassManagerBase *PM, unsigned OptimizationLevel) { if (OptimizationLevel > 0) { + PM->add(createBasicAliasAnalysisPass()); PM->add(createCFGSimplificationPass()); if (OptimizationLevel == 1) PM->add(createPromoteMemoryToRegisterPass()); @@ -91,6 +92,8 @@ bool SimplifyLibCalls, bool HaveExceptions, Pass *InliningPass) { + PM->add(createBasicAliasAnalysisPass()); + if (OptimizationLevel == 0) { if (InliningPass) PM->add(InliningPass); @@ -177,6 +180,9 @@ bool Internalize, bool RunInliner, bool VerifyEach) { + // Provide AliasAnalysis services for optimizations. + PM->add(createBasicAliasAnalysisPass()); + // Now that composite has been compiled, scan through the module, looking // for a main function. If main is defined, mark all other functions // internal. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon Oct 18 13:04:47 2010 @@ -190,7 +190,7 @@ char NoAA::ID = 0; INITIALIZE_AG_PASS(NoAA, AliasAnalysis, "no-aa", "No Alias Analysis (always returns 'may' alias)", - true, true, false) + true, true, true) ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } @@ -492,6 +492,14 @@ static char ID; // Class identification, replacement for typeinfo BasicAliasAnalysis() : NoAA(ID) {} + virtual void initializePass() { + InitializeAliasAnalysis(this); + } + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + } + virtual AliasResult alias(const Location &LocA, const Location &LocB) { assert(Visited.empty() && "Visited must be cleared after use!"); @@ -561,7 +569,7 @@ char BasicAliasAnalysis::ID = 0; INITIALIZE_AG_PASS(BasicAliasAnalysis, AliasAnalysis, "basicaa", "Basic Alias Analysis (default AA impl)", - false, true, true) + false, true, false) ImmutablePass *llvm::createBasicAliasAnalysisPass() { return new BasicAliasAnalysis(); @@ -578,7 +586,7 @@ // GV may even be a declaration, not a definition. return GV->isConstant(); - return NoAA::pointsToConstantMemory(Loc); + return AliasAnalysis::pointsToConstantMemory(Loc); } /// getModRefBehavior - Return the behavior when calling the given call site. @@ -611,7 +619,7 @@ if (unsigned id = F->getIntrinsicID()) return getIntrinsicModRefBehavior(id); - return NoAA::getModRefBehavior(F); + return AliasAnalysis::getModRefBehavior(F); } /// getModRefInfo - Check to see if the specified callsite can clobber the @@ -1065,24 +1073,30 @@ std::swap(V1Size, V2Size); std::swap(O1, O2); } - if (const GEPOperator *GV1 = dyn_cast(V1)) - return aliasGEP(GV1, V1Size, V2, V2Size, O1, O2); + if (const GEPOperator *GV1 = dyn_cast(V1)) { + AliasResult Result = aliasGEP(GV1, V1Size, V2, V2Size, O1, O2); + if (Result != MayAlias) return Result; + } if (isa(V2) && !isa(V1)) { std::swap(V1, V2); std::swap(V1Size, V2Size); } - if (const PHINode *PN = dyn_cast(V1)) - return aliasPHI(PN, V1Size, V2, V2Size); + if (const PHINode *PN = dyn_cast(V1)) { + AliasResult Result = aliasPHI(PN, V1Size, V2, V2Size); + if (Result != MayAlias) return Result; + } if (isa(V2) && !isa(V1)) { std::swap(V1, V2); std::swap(V1Size, V2Size); } - if (const SelectInst *S1 = dyn_cast(V1)) - return aliasSelect(S1, V1Size, V2, V2Size); + if (const SelectInst *S1 = dyn_cast(V1)) { + AliasResult Result = aliasSelect(S1, V1Size, V2, V2Size); + if (Result != MayAlias) return Result; + } - return NoAA::alias(Location(V1, V1Size), Location(V2, V2Size)); + return AliasAnalysis::alias(Location(V1, V1Size), Location(V2, V2Size)); } // Make sure that anything that uses AliasAnalysis pulls in this file. Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Mon Oct 18 13:04:47 2010 @@ -14,6 +14,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Analysis/Verifier.h" +#include "llvm/Analysis/Passes.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineFunctionAnalysis.h" @@ -254,6 +255,9 @@ MCContext *&OutContext) { // Standard LLVM-Level Passes. + // Basic AliasAnalysis support. + PM.add(createBasicAliasAnalysisPass()); + // Before running any passes, run the verifier to determine if the input // coming from the front-end and/or optimizer is valid. if (!DisableVerify) Modified: llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll Mon Oct 18 13:04:47 2010 @@ -2,7 +2,7 @@ ; is performed. It is not legal to delete the second load instruction because ; the value computed by the first load instruction is changed by the store. -; RUN: opt < %s -gvn -instcombine -S | grep DONOTREMOVE +; RUN: opt < %s -basicaa -gvn -instcombine -S | grep DONOTREMOVE define i32 @test() { %A = alloca i32 Modified: llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -instcombine -S | grep sub +; RUN: opt < %s -basicaa -gvn -instcombine -S | grep sub ; BasicAA was incorrectly concluding that P1 and P2 didn't conflict! Modified: llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -licm -disable-output +; RUN: opt < %s -basicaa -licm -disable-output %struct..apr_array_header_t = type { i32*, i32, i32, i32, i8* } %struct..apr_table_t = type { %struct..apr_array_header_t, i32, [32 x i32], [32 x i32] } Modified: llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-09-19-LocalArgument.ll Mon Oct 18 13:04:47 2010 @@ -1,6 +1,6 @@ ; In this test, a local alloca cannot alias an incoming argument. -; RUN: opt < %s -gvn -instcombine -S | not grep sub +; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep sub define i32 @test(i32* %P) { %X = alloca i32 Modified: llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll Mon Oct 18 13:04:47 2010 @@ -1,7 +1,7 @@ ; This testcase consists of alias relations which should be completely ; resolvable by basicaa. -; RUN: opt < %s -aa-eval -print-may-aliases -disable-output \ +; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output \ ; RUN: |& not grep May: %T = type { i32, [10 x i8] } Modified: llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll Mon Oct 18 13:04:47 2010 @@ -1,7 +1,7 @@ ; This testcase consists of alias relations which should be completely ; resolvable by basicaa, but require analysis of getelementptr constant exprs. -; RUN: opt < %s -aa-eval -print-may-aliases -disable-output \ +; RUN: opt < %s -basicaa -aa-eval -print-may-aliases -disable-output \ ; RUN: |& not grep May: %T = type { i32, [10 x i8] } Modified: llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse -S | grep {store i32 0} +; RUN: opt < %s -basicaa -dse -S | grep {store i32 0} define void @test({i32,i32 }* %P) { %Q = getelementptr {i32,i32}* %P, i32 1 Modified: llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -licm +; RUN: opt < %s -basicaa -licm %"java/lang/Object" = type { %struct.llvm_java_object_base } %"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 } Modified: llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2004-12-08-BasicAACrash2.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse +; RUN: opt < %s -basicaa -dse %"java/lang/Object" = type { %struct.llvm_java_object_base } %"java/lang/StringBuffer" = type { "java/lang/Object", i32, { "java/lang/Object", i32, [0 x i8] }*, i1 } Modified: llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval -disable-output |& grep {2 no alias respon} +; RUN: opt < %s -basicaa -aa-eval -disable-output |& grep {2 no alias respon} ; TEST that A[1][0] may alias A[0][i]. target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" Modified: llvm/trunk/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -licm -disable-output +; RUN: opt < %s -basicaa -licm -disable-output target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin8.7.0" Modified: llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -disable-output +; RUN: opt < %s -basicaa -gvn -disable-output ; PR1774 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" Modified: llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -disable-output +; RUN: opt < %s -basicaa -gvn -disable-output ; PR1782 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" Modified: llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -disable-output +; RUN: opt < %s -basicaa -gvn -disable-output ; PR2395 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" Modified: llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2008-11-23-NoaliasRet.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval |& grep {1 no alias response} +; RUN: opt < %s -basicaa -aa-eval |& grep {1 no alias response} declare noalias i32* @_Znwj(i32 %x) nounwind Modified: llvm/trunk/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -gvn -instcombine -S < %s | FileCheck %s +; RUN: opt -basicaa -gvn -instcombine -S < %s | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" declare i8 @llvm.atomic.load.add.i8.p0i8(i8*, i8) Modified: llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& grep {NoAlias:.*%P,.*@Z} +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {NoAlias:.*%P,.*@Z} ; If GEP base doesn't alias Z, then GEP doesn't alias Z. ; rdar://7282591 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=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -aa-eval -print-all-alias-modref-info -disable-output < %s |& FileCheck %s +; RUN: opt -basicaa -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) Modified: llvm/trunk/test/Analysis/BasicAA/byval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/byval.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/byval.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/byval.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {ret i32 1} +; RUN: opt < %s -basicaa -gvn -S | grep {ret i32 1} target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin8" %struct.x = type { i32, i32, i32, i32 } Modified: llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/constant-over-index.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval -print-all-alias-modref-info |& FileCheck %s +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info |& FileCheck %s ; PR4267 ; CHECK: MayAlias: double* %p.0.i.0, double* %p3 Modified: llvm/trunk/test/Analysis/BasicAA/empty.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/empty.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/empty.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/empty.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output \ +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \ ; RUN: |& grep {NoAlias: \{\}\\* \[%\]p, \{\}\\* \[%\]q} 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" Modified: llvm/trunk/test/Analysis/BasicAA/gep-alias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/gep-alias.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/gep-alias.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/gep-alias.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -instcombine -S |& FileCheck %s +; RUN: opt < %s -basicaa -gvn -instcombine -S |& FileCheck %s target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" Modified: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s ; CHECK: Just Ref: call void @ro() <-> call void @f0() Modified: llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/phi-and-select.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output \ +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output \ ; RUN: |& grep {NoAlias: double\\* \[%\]a, double\\* \[%\]b\$} | count 4 ; BasicAA should detect NoAliases in PHIs and Selects. Modified: llvm/trunk/test/Analysis/BasicAA/unreachable-block.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/unreachable-block.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/unreachable-block.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/unreachable-block.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -aa-eval -disable-output < %s >& /dev/null +; RUN: opt -basicaa -aa-eval -disable-output < %s >& /dev/null ; BasicAA shouldn't infinitely recurse on the use-def cycles in ; unreachable code. Modified: llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/aliastest.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -globalsmodref-aa -gvn -S | not grep load +; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -S | not grep load @X = internal global i32 4 ; [#uses=1] define i32 @test(i32* %P) { Modified: llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/chaining-analysis.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -globalsmodref-aa -gvn -S | not grep load +; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -S | not grep load ; This test requires the use of previous analyses to determine that ; doesnotmodX does not modify X (because 'sin' doesn't). Modified: llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/indirect-global.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -globalsmodref-aa -gvn -instcombine -S | \ +; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -instcombine -S | \ ; RUN: grep {ret i32 0} @G = internal global i32* null ; [#uses=3] Modified: llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll (original) +++ llvm/trunk/test/Analysis/GlobalsModRef/modreftest.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -globalsmodref-aa -gvn -S | not grep load +; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -S | not grep load @X = internal global i32 4 ; [#uses=2] define i32 @test(i32* %P) { Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/alias.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -analyze -lda | FileCheck %s +; RUN: opt < %s -analyze -basicaa -lda | FileCheck %s ;; x[5] = x[6] // with x being a pointer passed as argument Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-strong.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -analyze -lda | FileCheck %s +; RUN: opt < %s -analyze -basicaa -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 @y = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-crossing.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -analyze -lda | FileCheck %s +; RUN: opt < %s -analyze -basicaa -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 @y = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/siv-weak-zero.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -analyze -lda | FileCheck %s +; RUN: opt < %s -analyze -basicaa -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 @y = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll (original) +++ llvm/trunk/test/Analysis/LoopDependenceAnalysis/ziv.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -analyze -lda | FileCheck %s +; RUN: opt < %s -analyze -basicaa -lda | FileCheck %s @x = common global [256 x i32] zeroinitializer, align 4 Modified: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll (original) +++ llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -tbaa -gvn -S | FileCheck %s +; RUN: opt < %s -basicaa -tbaa -gvn -S | FileCheck %s ; CHECK: @test0_yes ; CHECK: add i8 %x, %x Modified: llvm/trunk/test/Other/lint.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/lint.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Other/lint.ll (original) +++ llvm/trunk/test/Other/lint.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -lint -disable-output < %s |& FileCheck %s +; RUN: opt -basicaa -lint -disable-output < %s |& FileCheck %s target datalayout = "e-p:64:64:64" declare fastcc void @bar() Modified: llvm/trunk/test/Transforms/ArgumentPromotion/basictest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ArgumentPromotion/basictest.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/ArgumentPromotion/basictest.ll (original) +++ llvm/trunk/test/Transforms/ArgumentPromotion/basictest.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -argpromotion -mem2reg -S | not grep alloca +; RUN: opt < %s -basicaa -argpromotion -mem2reg -S | not grep alloca target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" define internal i32 @test(i32* %X, i32* %Y) { %A = load i32* %X ; [#uses=1] Modified: llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/2008-07-28-load-store.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse -S | not grep tmp5 +; RUN: opt < %s -basicaa -dse -S | not grep tmp5 ; PR2599 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" Modified: llvm/trunk/test/Transforms/DeadStoreElimination/PartialStore.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/PartialStore.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/PartialStore.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/PartialStore.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse -S | \ +; RUN: opt < %s -basicaa -dse -S | \ ; RUN: not grep {store i8} ; Ensure that the dead store is deleted in this case. It is wholely ; overwritten by the second store. Modified: llvm/trunk/test/Transforms/DeadStoreElimination/const-pointers.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/const-pointers.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/const-pointers.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/const-pointers.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt %s -dse -S | FileCheck %s +; RUN: opt %s -basicaa -dse -S | FileCheck %s %t = type { i32 } Modified: llvm/trunk/test/Transforms/DeadStoreElimination/context-sensitive.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/context-sensitive.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/context-sensitive.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/context-sensitive.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse -S | not grep DEAD +; RUN: opt < %s -basicaa -dse -S | not grep DEAD target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" declare void @ext() Modified: llvm/trunk/test/Transforms/DeadStoreElimination/free.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/free.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/free.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/free.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse -S | not grep DEAD +; RUN: opt < %s -basicaa -dse -S | not grep DEAD define void @test(i32* %Q, i32* %P) { %DEAD = load i32* %Q ; [#uses=1] Modified: llvm/trunk/test/Transforms/DeadStoreElimination/lifetime.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/lifetime.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/lifetime.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/lifetime.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -S -dse < %s | FileCheck %s +; RUN: opt -S -basicaa -dse < %s | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" Modified: llvm/trunk/test/Transforms/DeadStoreElimination/no-targetdata.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/no-targetdata.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/no-targetdata.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/no-targetdata.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt %s -dse -S | FileCheck %s +; RUN: opt %s -basicaa -dse -S | FileCheck %s declare void @test1f() Modified: llvm/trunk/test/Transforms/DeadStoreElimination/simple.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/simple.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/simple.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/simple.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -dse -S | not grep DEAD +; RUN: opt < %s -basicaa -dse -S | not grep DEAD target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" define void @test(i32* %Q, i32* %P) { Modified: llvm/trunk/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll (original) +++ llvm/trunk/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | not grep {tmp10 =} +; RUN: opt < %s -basicaa -gvn -S | not grep {tmp10 =} %struct.INT2 = type { i32, i32 } @blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2] Modified: llvm/trunk/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll (original) +++ llvm/trunk/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll Mon Oct 18 13:04:47 2010 @@ -1,5 +1,5 @@ -; RUN: opt < %s -gvn -S | grep {tmp17625.* = phi i32. } -; RUN: opt < %s -gvn -S | grep {tmp17631.* = phi i32. } +; RUN: opt < %s -basicaa -gvn -S | grep {tmp17625.* = phi i32. } +; RUN: opt < %s -basicaa -gvn -S | grep {tmp17631.* = phi i32. } @last = external global [65 x i32*] ; <[65 x i32*]*> [#uses=1] Modified: llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll (original) +++ llvm/trunk/test/Transforms/GVN/2007-07-31-NoDomInherit.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {tmp47 = phi i32 } +; RUN: opt < %s -basicaa -gvn -S | grep {tmp47 = phi i32 } %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* } @debug = external constant i32 ; [#uses=0] Modified: llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll (original) +++ llvm/trunk/test/Transforms/GVN/2007-07-31-RedundantPhi.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | not grep {tmp701 =} +; RUN: opt < %s -basicaa -gvn -S | not grep {tmp701 =} @img_width = external global i16 ; [#uses=2] Modified: llvm/trunk/test/Transforms/GVN/2008-07-02-Unreachable.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2008-07-02-Unreachable.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/2008-07-02-Unreachable.ll (original) +++ llvm/trunk/test/Transforms/GVN/2008-07-02-Unreachable.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {ret i8 \[%\]tmp3} +; RUN: opt < %s -basicaa -gvn -S | grep {ret i8 \[%\]tmp3} ; PR2503 @g_3 = external global i8 ; [#uses=2] Modified: llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll (original) +++ llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | FileCheck %s +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s define i8* @cat(i8* %s1, ...) nounwind { entry: Modified: llvm/trunk/test/Transforms/GVN/calls-nonlocal.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/calls-nonlocal.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/calls-nonlocal.ll (original) +++ llvm/trunk/test/Transforms/GVN/calls-nonlocal.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep strlen | count 2 +; RUN: opt < %s -basicaa -gvn -S | grep strlen | count 2 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin9" Modified: llvm/trunk/test/Transforms/GVN/condprop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/condprop.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/condprop.ll (original) +++ llvm/trunk/test/Transforms/GVN/condprop.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {br i1 false} +; RUN: opt < %s -basicaa -gvn -S | grep {br i1 false} @a = external global i32 ; [#uses=7] Modified: llvm/trunk/test/Transforms/GVN/invariant-simple.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/invariant-simple.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/invariant-simple.ll (original) +++ llvm/trunk/test/Transforms/GVN/invariant-simple.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | FileCheck %s +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin7" Modified: llvm/trunk/test/Transforms/GVN/lifetime-simple.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/lifetime-simple.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/lifetime-simple.ll (original) +++ llvm/trunk/test/Transforms/GVN/lifetime-simple.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | FileCheck %s +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin7" Modified: llvm/trunk/test/Transforms/GVN/load-constant-mem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/load-constant-mem.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/load-constant-mem.ll (original) +++ llvm/trunk/test/Transforms/GVN/load-constant-mem.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -instcombine -S | grep {ret i32 0} +; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0} ; PR4189 @G = external constant [4 x i32] Modified: llvm/trunk/test/Transforms/GVN/load-pre-licm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/load-pre-licm.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/load-pre-licm.ll (original) +++ llvm/trunk/test/Transforms/GVN/load-pre-licm.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -S -gvn < %s | FileCheck %s +; RUN: opt -S -basicaa -gvn < %s | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" target triple = "i386-apple-darwin11.0.0" Modified: llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll (original) +++ llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -S -gvn -enable-load-pre %s | FileCheck %s +; RUN: opt -S -basicaa -gvn -enable-load-pre %s | FileCheck %s ; ; The partially redundant load in bb1 should be hoisted to "bb". This comes ; from this C code (GCC PR 23455): Modified: llvm/trunk/test/Transforms/GVN/mixed.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/mixed.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/mixed.ll (original) +++ llvm/trunk/test/Transforms/GVN/mixed.ll Mon Oct 18 13:04:47 2010 @@ -1,5 +1,5 @@ -; RUN: opt < %s -gvn -S | not grep DEADLOAD -; RUN: opt < %s -gvn -S | not grep DEADGEP +; RUN: opt < %s -basicaa -gvn -S | not grep DEADLOAD +; RUN: opt < %s -basicaa -gvn -S | not grep DEADGEP define i32 @main(i32** %p) { block1: Modified: llvm/trunk/test/Transforms/GVN/nonescaping-malloc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/nonescaping-malloc.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/nonescaping-malloc.ll (original) +++ llvm/trunk/test/Transforms/GVN/nonescaping-malloc.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -stats -disable-output |& grep {Number of loads deleted} +; RUN: opt < %s -basicaa -gvn -stats -disable-output |& grep {Number of loads deleted} ; rdar://7363102 ; GVN should be able to eliminate load %tmp22.i, because it is redundant with Modified: llvm/trunk/test/Transforms/GVN/null-aliases-nothing.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/null-aliases-nothing.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/null-aliases-nothing.ll (original) +++ llvm/trunk/test/Transforms/GVN/null-aliases-nothing.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt %s -gvn -S | FileCheck %s +; RUN: opt %s -basicaa -gvn -S | FileCheck %s %t = type { i32 } declare void @test1f(i8*) Modified: llvm/trunk/test/Transforms/GVN/pre-load.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/pre-load.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/pre-load.ll (original) +++ llvm/trunk/test/Transforms/GVN/pre-load.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -enable-load-pre -S | FileCheck %s +; RUN: opt < %s -basicaa -gvn -enable-load-pre -S | FileCheck %s 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" define i32 @test1(i32* %p, i1 %C) { Modified: llvm/trunk/test/Transforms/GVN/rle-must-alias.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle-must-alias.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/rle-must-alias.ll (original) +++ llvm/trunk/test/Transforms/GVN/rle-must-alias.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {DEAD = phi i32 } +; RUN: opt < %s -basicaa -gvn -S | grep {DEAD = phi i32 } ; GVN should eliminate the fully redundant %9 GEP which ; allows DEAD to be removed. This is PR3198. Modified: llvm/trunk/test/Transforms/GVN/rle-nonlocal.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle-nonlocal.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/rle-nonlocal.ll (original) +++ llvm/trunk/test/Transforms/GVN/rle-nonlocal.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | FileCheck %s +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s define i32 @main(i32** %p) { block1: Modified: llvm/trunk/test/Transforms/GVN/rle-semidominated.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle-semidominated.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/rle-semidominated.ll (original) +++ llvm/trunk/test/Transforms/GVN/rle-semidominated.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | grep {DEAD = phi i32 } +; RUN: opt < %s -basicaa -gvn -S | grep {DEAD = phi i32 } define i32 @main(i32* %p) { block1: Modified: llvm/trunk/test/Transforms/GVN/rle.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/GVN/rle.ll (original) +++ llvm/trunk/test/Transforms/GVN/rle.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -gvn -S | FileCheck %s +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s ; 32-bit little endian target. target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" Modified: llvm/trunk/test/Transforms/Inline/devirtualize-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/devirtualize-3.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/Inline/devirtualize-3.ll (original) +++ llvm/trunk/test/Transforms/Inline/devirtualize-3.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -inline -S -scalarrepl -gvn -instcombine %s | FileCheck %s +; RUN: opt -basicaa -inline -S -scalarrepl -gvn -instcombine %s | FileCheck %s ; PR5009 ; CHECK: define i32 @main() Modified: llvm/trunk/test/Transforms/Inline/devirtualize.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/devirtualize.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/Inline/devirtualize.ll (original) +++ llvm/trunk/test/Transforms/Inline/devirtualize.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -S -inline -scalarrepl -instcombine -simplifycfg -instcombine -gvn -globaldce %s | FileCheck %s +; RUN: opt -S -basicaa -inline -scalarrepl -instcombine -simplifycfg -instcombine -gvn -globaldce %s | FileCheck %s 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.0.0" Modified: llvm/trunk/test/Transforms/Inline/gvn-inline-iteration.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/gvn-inline-iteration.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/Inline/gvn-inline-iteration.ll (original) +++ llvm/trunk/test/Transforms/Inline/gvn-inline-iteration.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -inline -gvn %s -S -max-cg-scc-iterations=1 | FileCheck %s +; RUN: opt -basicaa -inline -gvn %s -S -max-cg-scc-iterations=1 | FileCheck %s ; rdar://6295824 and PR6724 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" Modified: llvm/trunk/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll (original) +++ llvm/trunk/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -licm -S | FileCheck %s +; RUN: opt < %s -basicaa -licm -S | FileCheck %s @a = external constant float* Modified: llvm/trunk/test/Transforms/LICM/scalar_promote.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/scalar_promote.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LICM/scalar_promote.ll (original) +++ llvm/trunk/test/Transforms/LICM/scalar_promote.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -licm -S | FileCheck %s +; RUN: opt < %s -basicaa -licm -S | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @X = global i32 7 ; [#uses=4] Modified: llvm/trunk/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll (original) +++ llvm/trunk/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -memcpyopt -dse -S | grep {call.*initialize} | not grep memtmp +; RUN: opt < %s -basicaa -memcpyopt -dse -S | grep {call.*initialize} | not grep memtmp ; PR2077 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" Modified: llvm/trunk/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll (original) +++ llvm/trunk/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -memcpyopt -S | not grep {call.*memcpy.} +; RUN: opt < %s -basicaa -memcpyopt -S | not grep {call.*memcpy.} target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" %a = type { i32 } %b = type { float } Modified: llvm/trunk/test/Transforms/MemCpyOpt/loadstore-sret.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/loadstore-sret.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/loadstore-sret.ll (original) +++ llvm/trunk/test/Transforms/MemCpyOpt/loadstore-sret.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt -S < %s -memcpyopt | FileCheck %s +; RUN: opt -S < %s -basicaa -memcpyopt | FileCheck %s ; 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" Modified: llvm/trunk/test/Transforms/MemCpyOpt/memcpy.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/memcpy.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/memcpy.ll (original) +++ llvm/trunk/test/Transforms/MemCpyOpt/memcpy.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -memcpyopt -dse -S | grep {call.*memcpy} | count 1 +; RUN: opt < %s -basicaa -memcpyopt -dse -S | grep {call.*memcpy} | count 1 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin9" Modified: llvm/trunk/test/Transforms/MemCpyOpt/memmove.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/memmove.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/memmove.ll (original) +++ llvm/trunk/test/Transforms/MemCpyOpt/memmove.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -memcpyopt -S | FileCheck %s +; RUN: opt < %s -basicaa -memcpyopt -S | FileCheck %s ; These memmoves should get optimized to memcpys. 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" Modified: llvm/trunk/test/Transforms/MemCpyOpt/sret.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/sret.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/sret.ll (original) +++ llvm/trunk/test/Transforms/MemCpyOpt/sret.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -memcpyopt -S | not grep {call.*memcpy} +; RUN: opt < %s -basicaa -memcpyopt -S | not grep {call.*memcpy} target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin9" Modified: llvm/trunk/test/Transforms/Sink/basic.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Sink/basic.ll?rev=116720&r1=116719&r2=116720&view=diff ============================================================================== --- llvm/trunk/test/Transforms/Sink/basic.ll (original) +++ llvm/trunk/test/Transforms/Sink/basic.ll Mon Oct 18 13:04:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -sink -S | FileCheck %s +; RUN: opt < %s -basicaa -sink -S | FileCheck %s @A = external global i32 @B = external global i32 From gohman at apple.com Mon Oct 18 13:10:32 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 18:10:32 -0000 Subject: [llvm-commits] [llvm] r116721 - /llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Message-ID: <20101018181032.10E8B2A6C12C@llvm.org> Author: djg Date: Mon Oct 18 13:10:31 2010 New Revision: 116721 URL: http://llvm.org/viewvc/llvm-project?rev=116721&view=rev Log: Use chaining in TypeBasedAliasAnalysis::pointsToConstantMemory. Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=116721&r1=116720&r2=116721&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Mon Oct 18 13:10:31 2010 @@ -173,5 +173,8 @@ // If this is an "immutable" type, we can assume the pointer is pointing // to constant memory. - return TBAANode(M).TypeIsImmutable(); + if (TBAANode(M).TypeIsImmutable()) + return true; + + return AliasAnalysis::pointsToConstantMemory(Loc); } From gohman at apple.com Mon Oct 18 13:17:47 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 18:17:47 -0000 Subject: [llvm-commits] [llvm] r116722 - in /llvm/trunk: lib/Analysis/TypeBasedAliasAnalysis.cpp test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Message-ID: <20101018181747.D09BD2A6C12C@llvm.org> Author: djg Date: Mon Oct 18 13:17:47 2010 New Revision: 116722 URL: http://llvm.org/viewvc/llvm-project?rev=116722&view=rev Log: Make TypeBasedAliasAnalysis default to doing nothing, with a command-line option to enable it. Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=116722&r1=116721&r2=116722&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Mon Oct 18 13:17:47 2010 @@ -32,8 +32,12 @@ #include "llvm/Module.h" #include "llvm/Metadata.h" #include "llvm/Pass.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +// For testing purposes, enable TBAA only via a special option. +static cl::opt EnableTBAA("enable-tbaa"); + namespace { /// TBAANode - This is a simple wrapper around an MDNode which provides a /// higher-level interface by hiding the details of how alias analysis @@ -122,6 +126,9 @@ AliasAnalysis::AliasResult TypeBasedAliasAnalysis::alias(const Location &LocA, const Location &LocB) { + if (!EnableTBAA) + return AliasAnalysis::alias(LocA, LocB); + // Get the attached MDNodes. If either value lacks a tbaa MDNode, we must // be conservative. const MDNode *AM = LocA.TBAATag; @@ -168,6 +175,9 @@ } bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Location &Loc) { + if (!EnableTBAA) + return AliasAnalysis::pointsToConstantMemory(Loc); + const MDNode *M = Loc.TBAATag; if (!M) return false; Modified: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll?rev=116722&r1=116721&r2=116722&view=diff ============================================================================== --- llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll (original) +++ llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Mon Oct 18 13:17:47 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -basicaa -tbaa -gvn -S | FileCheck %s +; RUN: opt < %s -enable-tbaa -basicaa -tbaa -gvn -S | FileCheck %s ; CHECK: @test0_yes ; CHECK: add i8 %x, %x From rafael.espindola at gmail.com Mon Oct 18 13:36:12 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 18:36:12 -0000 Subject: [llvm-commits] [llvm] r116728 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp lib/Target/X86/X86AsmBackend.cpp test/MC/ELF/relocation-386.s Message-ID: <20101018183612.460C22A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 13:36:12 2010 New Revision: 116728 URL: http://llvm.org/viewvc/llvm-project?rev=116728&view=rev Log: Produce ELF::R_386_GOTPC relocations. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/lib/Target/X86/X86AsmBackend.cpp llvm/trunk/test/MC/ELF/relocation-386.s Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116728&r1=116727&r2=116728&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 13:36:12 2010 @@ -707,7 +707,12 @@ break; } break; - case FK_Data_4: Type = ELF::R_386_32; break; + case FK_Data_4: + if (Symbol->getName() == "_GLOBAL_OFFSET_TABLE_") + Type = ELF::R_386_GOTPC; + else + Type = ELF::R_386_32; + break; case FK_Data_2: Type = ELF::R_386_16; break; case X86::reloc_pcrel_1byte: case FK_Data_1: Type = ELF::R_386_8; break; Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=116728&r1=116727&r2=116728&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Mon Oct 18 13:36:12 2010 @@ -72,6 +72,11 @@ default: return Op; + // This is used on i386 with things like addl $foo, %ebx + // FIXME: Should the other *i8 instructions be here too? If not, it might + // be better to just select X86::ADD32ri instead of X86::ADD32ri8. + case X86::ADD32ri8: return X86::ADD32ri; + case X86::JAE_1: return X86::JAE_4; case X86::JA_1: return X86::JA_4; case X86::JBE_1: return X86::JBE_4; Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116728&r1=116727&r2=116728&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 13:36:12 2010 @@ -16,6 +16,12 @@ // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', // CHECK-NEXT: ('r_type', 4) +// CHECK-NEXT: ), +// CHECK-NEXT: # Relocation 2 +// CHECK-NEXT: (('r_offset', +// CHECK-NEXT: ('r_sym', +// CHECK-NEXT: ('r_type', 10) +// CHECK-NEXT: ), .text bar: @@ -24,6 +30,7 @@ .global bar2 bar2: calll bar2 at PLT + addl $_GLOBAL_OFFSET_TABLE_, %ebx .section .rodata.str1.16,"aMS", at progbits,1 .Lfoo: From grosbach at apple.com Mon Oct 18 13:39:46 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 18 Oct 2010 18:39:46 -0000 Subject: [llvm-commits] [llvm] r116729 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20101018183946.E42E82A6C12C@llvm.org> Author: grosbach Date: Mon Oct 18 13:39:46 2010 New Revision: 116729 URL: http://llvm.org/viewvc/llvm-project?rev=116729&view=rev Log: For Thumb2, try to use frame pointer references for stack slots even when a base register is available. rdar://8525298 Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=116729&r1=116728&r2=116729&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Oct 18 13:39:46 2010 @@ -953,8 +953,16 @@ return FPOffset; } else if (MFI->hasVarSizedObjects()) { assert(hasBasePointer(MF) && "missing base pointer!"); - // Use the base register since we have it. - FrameReg = BasePtr; + // Try to use the frame pointer if we can, else use the base pointer + // since it's available. This is handy for the emergency spill slot, in + // particular. + if (AFI->isThumb2Function()) { + if (FPOffset >= -255 && FPOffset < 0) { + FrameReg = getFrameRegister(MF); + return FPOffset; + } + } else + FrameReg = BasePtr; } else if (AFI->isThumb2Function()) { // In Thumb2 mode, the negative offset is very limited. Try to avoid // out of range references. From gohman at apple.com Mon Oct 18 13:45:11 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 18:45:11 -0000 Subject: [llvm-commits] [llvm] r116730 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20101018184511.6F5A92A6C12C@llvm.org> Author: djg Date: Mon Oct 18 13:45:11 2010 New Revision: 116730 URL: http://llvm.org/viewvc/llvm-project?rev=116730&view=rev Log: Fix BasicAA to pass TBAAInfo through to the chained analysis. 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=116730&r1=116729&r2=116730&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon Oct 18 13:45:11 2010 @@ -505,7 +505,8 @@ assert(Visited.empty() && "Visited must be cleared after use!"); assert(notDifferentParent(LocA.Ptr, LocB.Ptr) && "BasicAliasAnalysis doesn't support interprocedural queries."); - AliasResult Alias = aliasCheck(LocA.Ptr, LocA.Size, LocB.Ptr, LocB.Size); + AliasResult Alias = aliasCheck(LocA.Ptr, LocA.Size, LocA.TBAATag, + LocB.Ptr, LocB.Size, LocB.TBAATag); Visited.clear(); return Alias; } @@ -549,19 +550,26 @@ // instruction against another. AliasResult aliasGEP(const GEPOperator *V1, unsigned V1Size, const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2); // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI // instruction against another. AliasResult aliasPHI(const PHINode *PN, unsigned PNSize, - const Value *V2, unsigned V2Size); + const MDNode *PNTBAAInfo, + const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo); /// aliasSelect - Disambiguate a Select instruction against another value. AliasResult aliasSelect(const SelectInst *SI, unsigned SISize, - const Value *V2, unsigned V2Size); + const MDNode *SITBAAInfo, + const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo); AliasResult aliasCheck(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size); + const MDNode *V1TBAATag, + const Value *V2, unsigned V2Size, + const MDNode *V2TBAATag); }; } // End of anonymous namespace @@ -757,6 +765,7 @@ AliasAnalysis::AliasResult BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, unsigned V1Size, const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2) { // If this GEP has been visited before, we're on a use-def cycle. @@ -773,8 +782,8 @@ // out if the indexes to the GEP tell us anything about the derived pointer. if (const GEPOperator *GEP2 = dyn_cast(V2)) { // Do the base pointers alias? - AliasResult BaseAlias = aliasCheck(UnderlyingV1, UnknownSize, - UnderlyingV2, UnknownSize); + AliasResult BaseAlias = aliasCheck(UnderlyingV1, UnknownSize, 0, + UnderlyingV2, UnknownSize, 0); // If we get a No or May, then return it immediately, no amount of analysis // will improve this situation. @@ -814,7 +823,8 @@ if (V1Size == UnknownSize && V2Size == UnknownSize) return MayAlias; - AliasResult R = aliasCheck(UnderlyingV1, UnknownSize, V2, V2Size); + AliasResult R = aliasCheck(UnderlyingV1, UnknownSize, 0, + V2, V2Size, V2TBAAInfo); if (R != MustAlias) // If V2 may alias GEP base pointer, conservatively returns MayAlias. // If V2 is known not to alias GEP base pointer, then the two values @@ -876,7 +886,9 @@ /// instruction against another. AliasAnalysis::AliasResult BasicAliasAnalysis::aliasSelect(const SelectInst *SI, unsigned SISize, - const Value *V2, unsigned V2Size) { + const MDNode *SITBAAInfo, + const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo) { // If this select has been visited before, we're on a use-def cycle. // Such cycles are only valid when PHI nodes are involved or in unreachable // code. The visitPHI function catches cycles containing PHIs, but there @@ -889,13 +901,13 @@ if (const SelectInst *SI2 = dyn_cast(V2)) if (SI->getCondition() == SI2->getCondition()) { AliasResult Alias = - aliasCheck(SI->getTrueValue(), SISize, - SI2->getTrueValue(), V2Size); + aliasCheck(SI->getTrueValue(), SISize, SITBAAInfo, + SI2->getTrueValue(), V2Size, V2TBAAInfo); if (Alias == MayAlias) return MayAlias; AliasResult ThisAlias = - aliasCheck(SI->getFalseValue(), SISize, - SI2->getFalseValue(), V2Size); + aliasCheck(SI->getFalseValue(), SISize, SITBAAInfo, + SI2->getFalseValue(), V2Size, V2TBAAInfo); if (ThisAlias != Alias) return MayAlias; return Alias; @@ -904,7 +916,7 @@ // If both arms of the Select node NoAlias or MustAlias V2, then returns // NoAlias / MustAlias. Otherwise, returns MayAlias. AliasResult Alias = - aliasCheck(V2, V2Size, SI->getTrueValue(), SISize); + aliasCheck(V2, V2Size, V2TBAAInfo, SI->getTrueValue(), SISize, SITBAAInfo); if (Alias == MayAlias) return MayAlias; @@ -914,7 +926,7 @@ Visited.erase(V2); AliasResult ThisAlias = - aliasCheck(V2, V2Size, SI->getFalseValue(), SISize); + aliasCheck(V2, V2Size, V2TBAAInfo, SI->getFalseValue(), SISize, SITBAAInfo); if (ThisAlias != Alias) return MayAlias; return Alias; @@ -924,7 +936,9 @@ // against another. AliasAnalysis::AliasResult BasicAliasAnalysis::aliasPHI(const PHINode *PN, unsigned PNSize, - const Value *V2, unsigned V2Size) { + const MDNode *PNTBAAInfo, + const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo) { // The PHI node has already been visited, avoid recursion any further. if (!Visited.insert(PN)) return MayAlias; @@ -935,16 +949,16 @@ if (const PHINode *PN2 = dyn_cast(V2)) if (PN2->getParent() == PN->getParent()) { AliasResult Alias = - aliasCheck(PN->getIncomingValue(0), PNSize, + aliasCheck(PN->getIncomingValue(0), PNSize, PNTBAAInfo, PN2->getIncomingValueForBlock(PN->getIncomingBlock(0)), - V2Size); + V2Size, V2TBAAInfo); if (Alias == MayAlias) return MayAlias; for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i) { AliasResult ThisAlias = - aliasCheck(PN->getIncomingValue(i), PNSize, + aliasCheck(PN->getIncomingValue(i), PNSize, PNTBAAInfo, PN2->getIncomingValueForBlock(PN->getIncomingBlock(i)), - V2Size); + V2Size, V2TBAAInfo); if (ThisAlias != Alias) return MayAlias; } @@ -965,7 +979,8 @@ V1Srcs.push_back(PV1); } - AliasResult Alias = aliasCheck(V2, V2Size, V1Srcs[0], PNSize); + AliasResult Alias = aliasCheck(V2, V2Size, V2TBAAInfo, + V1Srcs[0], PNSize, PNTBAAInfo); // Early exit if the check of the first PHI source against V2 is MayAlias. // Other results are not possible. if (Alias == MayAlias) @@ -981,7 +996,8 @@ // don't need to assume that V2 is being visited recursively. Visited.erase(V2); - AliasResult ThisAlias = aliasCheck(V2, V2Size, V, PNSize); + AliasResult ThisAlias = aliasCheck(V2, V2Size, V2TBAAInfo, + V, PNSize, PNTBAAInfo); if (ThisAlias != Alias || ThisAlias == MayAlias) return MayAlias; } @@ -994,7 +1010,9 @@ // AliasAnalysis::AliasResult BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { + const MDNode *V1TBAAInfo, + const Value *V2, unsigned V2Size, + const MDNode *V2TBAAInfo) { // If either of the memory references is empty, it doesn't matter what the // pointer values are. if (V1Size == 0 || V2Size == 0) @@ -1074,7 +1092,7 @@ std::swap(O1, O2); } if (const GEPOperator *GV1 = dyn_cast(V1)) { - AliasResult Result = aliasGEP(GV1, V1Size, V2, V2Size, O1, O2); + AliasResult Result = aliasGEP(GV1, V1Size, V2, V2Size, V2TBAAInfo, O1, O2); if (Result != MayAlias) return Result; } @@ -1083,7 +1101,8 @@ std::swap(V1Size, V2Size); } if (const PHINode *PN = dyn_cast(V1)) { - AliasResult Result = aliasPHI(PN, V1Size, V2, V2Size); + AliasResult Result = aliasPHI(PN, V1Size, V1TBAAInfo, + V2, V2Size, V2TBAAInfo); if (Result != MayAlias) return Result; } @@ -1092,11 +1111,13 @@ std::swap(V1Size, V2Size); } if (const SelectInst *S1 = dyn_cast(V1)) { - AliasResult Result = aliasSelect(S1, V1Size, V2, V2Size); + AliasResult Result = aliasSelect(S1, V1Size, V1TBAAInfo, + V2, V2Size, V2TBAAInfo); if (Result != MayAlias) return Result; } - return AliasAnalysis::alias(Location(V1, V1Size), Location(V2, V2Size)); + return AliasAnalysis::alias(Location(V1, V1Size, V1TBAAInfo), + Location(V2, V2Size, V2TBAAInfo)); } // Make sure that anything that uses AliasAnalysis pulls in this file. From gohman at apple.com Mon Oct 18 13:45:59 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 18:45:59 -0000 Subject: [llvm-commits] [llvm] r116731 - /llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Message-ID: <20101018184559.2772F2A6C12C@llvm.org> Author: djg Date: Mon Oct 18 13:45:59 2010 New Revision: 116731 URL: http://llvm.org/viewvc/llvm-project?rev=116731&view=rev Log: Run tbaa before basicaa, since that's how it's expected to be used. Modified: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Modified: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll?rev=116731&r1=116730&r2=116731&view=diff ============================================================================== --- llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll (original) +++ llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/aliastest.ll Mon Oct 18 13:45:59 2010 @@ -1,4 +1,4 @@ -; RUN: opt < %s -enable-tbaa -basicaa -tbaa -gvn -S | FileCheck %s +; RUN: opt < %s -enable-tbaa -tbaa -basicaa -gvn -S | FileCheck %s ; CHECK: @test0_yes ; CHECK: add i8 %x, %x From gohman at apple.com Mon Oct 18 13:50:27 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 18:50:27 -0000 Subject: [llvm-commits] [llvm] r116732 - in /llvm/trunk: include/llvm/Support/StandardPasses.h lib/CodeGen/LLVMTargetMachine.cpp Message-ID: <20101018185027.D36992A6C12C@llvm.org> Author: djg Date: Mon Oct 18 13:50:27 2010 New Revision: 116732 URL: http://llvm.org/viewvc/llvm-project?rev=116732&view=rev Log: Add TypeBasedAliasAnalysis to the standard pass lists. Note that it is currently inert by default. Modified: llvm/trunk/include/llvm/Support/StandardPasses.h llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Modified: llvm/trunk/include/llvm/Support/StandardPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StandardPasses.h?rev=116732&r1=116731&r2=116732&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/StandardPasses.h (original) +++ llvm/trunk/include/llvm/Support/StandardPasses.h Mon Oct 18 13:50:27 2010 @@ -69,10 +69,18 @@ // Implementations + static inline void createStandardAliasAnalysisPasses(PassManagerBase *PM) { + // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that + // BasicAliasAnalysis wins if they disagree. This is intended to help + // support "obvious" type-punning idioms. + PM->add(createTypeBasedAliasAnalysisPass()); + PM->add(createBasicAliasAnalysisPass()); + } + static inline void createStandardFunctionPasses(PassManagerBase *PM, unsigned OptimizationLevel) { if (OptimizationLevel > 0) { - PM->add(createBasicAliasAnalysisPass()); + createStandardAliasAnalysisPasses(PM); PM->add(createCFGSimplificationPass()); if (OptimizationLevel == 1) PM->add(createPromoteMemoryToRegisterPass()); @@ -92,7 +100,7 @@ bool SimplifyLibCalls, bool HaveExceptions, Pass *InliningPass) { - PM->add(createBasicAliasAnalysisPass()); + createStandardAliasAnalysisPasses(PM); if (OptimizationLevel == 0) { if (InliningPass) @@ -181,7 +189,7 @@ bool RunInliner, bool VerifyEach) { // Provide AliasAnalysis services for optimizations. - PM->add(createBasicAliasAnalysisPass()); + createStandardAliasAnalysisPasses(PM); // Now that composite has been compiled, scan through the module, looking // for a main function. If main is defined, mark all other functions Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=116732&r1=116731&r2=116732&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Mon Oct 18 13:50:27 2010 @@ -14,7 +14,6 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/Analysis/Passes.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineFunctionAnalysis.h" @@ -31,6 +30,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FormattedStream.h" +#include "llvm/Support/StandardPasses.h" using namespace llvm; namespace llvm { @@ -256,7 +256,7 @@ // Standard LLVM-Level Passes. // Basic AliasAnalysis support. - PM.add(createBasicAliasAnalysisPass()); + createStandardAliasAnalysisPasses(&PM); // Before running any passes, run the verifier to determine if the input // coming from the front-end and/or optimizer is valid. From dpatel at apple.com Mon Oct 18 13:53:44 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 18 Oct 2010 18:53:44 -0000 Subject: [llvm-commits] [llvm] r116733 - /llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Message-ID: <20101018185344.4737B2A6C12C@llvm.org> Author: dpatel Date: Mon Oct 18 13:53:44 2010 New Revision: 116733 URL: http://llvm.org/viewvc/llvm-project?rev=116733&view=rev Log: Transfer debug loc to lowered call. Patch by Alexander Herz! Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=116733&r1=116732&r2=116733&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Mon Oct 18 13:53:44 2010 @@ -187,6 +187,7 @@ NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); NewCall->setAttributes(II->getAttributes()); + NewCall->setDebugLoc(II->getDebugLoc()); II->replaceAllUsesWith(NewCall); // Insert an unconditional branch to the normal destination. @@ -267,6 +268,7 @@ NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); NewCall->setAttributes(II->getAttributes()); + NewCall->setDebugLoc(II->getDebugLoc()); II->replaceAllUsesWith(NewCall); // Replace the invoke with an uncond branch. From isanbard at gmail.com Mon Oct 18 13:55:29 2010 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 18 Oct 2010 18:55:29 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r116734 - in /llvm-gcc-4.2/trunk/gcc/testsuite: gcc.apple/4656532.c gcc.target/i386/sse-99.c Message-ID: <20101018185529.2854C2A6C12C@llvm.org> Author: void Date: Mon Oct 18 13:55:28 2010 New Revision: 116734 URL: http://llvm.org/viewvc/llvm-project?rev=116734&view=rev Log: If this doesn't disable these tests and stop them failing for clang, then I don't know what will. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4656532.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/sse-99.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4656532.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4656532.c?rev=116734&r1=116733&r2=116734&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4656532.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4656532.c Mon Oct 18 13:55:28 2010 @@ -1,8 +1,6 @@ /* APPLE LOCAL file 4656532 */ /* { dg-do compile { target "i?86-*-darwin*" } } */ /* { dg-options "-O2" } */ -/* LLVM LOCAL disable test for optimizing MMX */ -/* { dg-skip-if "" { *-*-* } { "*" } { "" } } */ #include __m64 x, y; void t1(int n) { @@ -19,4 +17,4 @@ } /* { dg-final { scan-assembler-not "cltd" } } */ -/* { dg-final { scan-assembler-not "\\\-16\\\(\\\%ebp\\\)" } } */ +/* LLVM LOCAL remove scan-assembler-not test for optimizing MMX */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/sse-99.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/sse-99.c?rev=116734&r1=116733&r2=116734&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/sse-99.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/sse-99.c Mon Oct 18 13:55:28 2010 @@ -5,9 +5,8 @@ /* APPLE LOCAL begin radar 4875125 */ /* { dg-options "-O3 -msse -mtune=generic" } */ /* APPLE LOCAL end radar 4875125 */ -/* { dg-final { scan-assembler-times "movq" 4 } } */ /* LLVM LOCAL disable test for optimizing MMX */ -/* { dg-skip-if "" { *-*-* } { "*" } { "" } } */ +/* { DISABLE { scan-assembler-times "movq" 4 } } */ /* PR target/23630 */ /* PR middle-end/23517 */ From rafael.espindola at gmail.com Mon Oct 18 14:33:01 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 19:33:01 -0000 Subject: [llvm-commits] [llvm] r116738 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20101018193301.7CA2D2A6C12E@llvm.org> Author: rafael Date: Mon Oct 18 14:33:01 2010 New Revision: 116738 URL: http://llvm.org/viewvc/llvm-project?rev=116738&view=rev Log: Reenable assert. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116738&r1=116737&r2=116738&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 14:33:01 2010 @@ -684,8 +684,9 @@ if (IsPCRel) { switch (Modifier) { default: + llvm_unreachable("Unimplemented"); + case MCSymbolRefExpr::VK_None: Type = ELF::R_386_PC32; - //llvm_unreachable("Unimplemented"); break; case MCSymbolRefExpr::VK_PLT: Type = ELF::R_386_PLT32; From baldrick at free.fr Mon Oct 18 14:38:40 2010 From: baldrick at free.fr (Duncan Sands) Date: Mon, 18 Oct 2010 21:38:40 +0200 Subject: [llvm-commits] [llvm] r116720 - in /llvm/trunk: include/llvm/Support/ lib/Analysis/ lib/CodeGen/ test/Analysis/BasicAA/ test/Analysis/GlobalsModRef/ test/Analysis/LoopDependenceAnalysis/ test/Analysis/TypeBasedAliasAnalysis/ test/Other/ test/Transforms/ArgumentPromotion/ test/Transforms/DeadStoreElimination/ test/Transforms/GVN/ test/Transforms/Inline/ test/Transforms/LICM/ test/Transforms/MemCpyOpt/ test/Transforms/Sink/ In-Reply-To: <20101018180449.02B6E2A6C12C@llvm.org> References: <20101018180449.02B6E2A6C12C@llvm.org> Message-ID: <4CBCA240.3020300@free.fr> Hi Dan, > Make BasicAliasAnalysis a normal AliasAnalysis implementation which > does normal initialization and normal chaining. Change the default > AliasAnalysis implementation to NoAlias. > > Update StandardCompileOpts.h and friends to explicitly request > BasicAliasAnalysis. it used to be that if you requested a more advanced alias analysis (eg: globalsmodref-aa) then it would be used for the following pass, but later passes would go back to basic-aa. Has this been fixed? Ciao, Duncan. From criswell at uiuc.edu Mon Oct 18 15:01:22 2010 From: criswell at uiuc.edu (John Criswell) Date: Mon, 18 Oct 2010 20:01:22 -0000 Subject: [llvm-commits] [poolalloc] r116739 - in /poolalloc/trunk: include/dsa/DataStructure.h lib/DSA/StdLibPass.cpp Message-ID: <20101018200122.7437C2A6C12C@llvm.org> Author: criswell Date: Mon Oct 18 15:01:22 2010 New Revision: 116739 URL: http://llvm.org/viewvc/llvm-project?rev=116739&view=rev Log: Added code to process the SAFECode run-time checks. This fixes a false alarm with SAFECode on 181.mcf. Modified: poolalloc/trunk/include/dsa/DataStructure.h poolalloc/trunk/lib/DSA/StdLibPass.cpp Modified: poolalloc/trunk/include/dsa/DataStructure.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=116739&r1=116738&r2=116739&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DataStructure.h (original) +++ poolalloc/trunk/include/dsa/DataStructure.h Mon Oct 18 15:01:22 2010 @@ -186,6 +186,7 @@ // functions and generates graphs for them. class StdLibDataStructures : public DataStructures { void eraseCallsTo(Function* F); + void processRuntimeCheck (Module & M, std::string name); public: static char ID; StdLibDataStructures() : DataStructures((intptr_t)&ID, "stdlib.") {} Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=116739&r1=116738&r2=116739&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original) +++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Mon Oct 18 15:01:22 2010 @@ -149,6 +149,19 @@ {"perror", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + // SAFECode Intrinsics + {"sc.lscheck", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.lscheckui", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.lscheckalign", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.lscheckalignui", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.pool_register_stack", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.pool_unregister_stack", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.pool_register_global", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.pool_unregister_global", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.pool_register", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.pool_unregister", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"sc.get_actual_val", {NRET_NARGS, NRET_NARGS, NRET_NARGS, false, true, false}}, + #if 0 {"remove", {false, false, false, true, false, false, false, false, false}}, {"unlink", {false, false, false, true, false, false, false, false, false}}, @@ -219,6 +232,44 @@ } } +// +// Function: processRuntimeCheck() +// +// Description: +// Modify a run-time check so that its return value has the same DSNode as the +// checked pointer. +// +void +StdLibDataStructures::processRuntimeCheck (Module & M, std::string name) { + // + // Get a pointer to the function. + // + Function* F = M.getFunction (name); + + // + // If the function doesn't exist, then there is no work to do. + // + if (!F) return; + + // + // Scan through all direct calls to the function (there should only be direct + // calls) and process each one. + // + for (Value::use_iterator ii = F->use_begin(), ee = F->use_end(); + ii != ee; ++ii) { + if (CallInst* CI = dyn_cast(ii)) { + if (CI->getOperand(0) == F) { + DSGraph* Graph = getDSGraph(*CI->getParent()->getParent()); + DSNodeHandle RetNode = Graph->getNodeForValue(CI); + DSNodeHandle ArgNode = Graph->getNodeForValue(CI->getOperand(2)); + RetNode.mergeWith(ArgNode); + } + } + } + + return; +} + bool StdLibDataStructures::runOnModule (Module &M) { // @@ -338,5 +389,13 @@ eraseCallsTo(F); } + // + // Merge return values and checked pointer values for SAFECode run-time + // checks. + // + processRuntimeCheck (M, "sc.boundscheck"); + processRuntimeCheck (M, "sc.boundscheckui"); + processRuntimeCheck (M, "sc.exactcheck2"); + return false; } From criswell at uiuc.edu Mon Oct 18 15:03:16 2010 From: criswell at uiuc.edu (John Criswell) Date: Mon, 18 Oct 2010 20:03:16 -0000 Subject: [llvm-commits] [poolalloc] r116740 - in /poolalloc/trunk: include/poolalloc/PoolAllocate.h lib/PoolAllocate/PoolAllocate.cpp Message-ID: <20101018200316.A32852A6C12C@llvm.org> Author: criswell Date: Mon Oct 18 15:03:16 2010 New Revision: 116740 URL: http://llvm.org/viewvc/llvm-project?rev=116740&view=rev Log: Give different base names to global pools depending on whether they are for global DSNode or local DSNodes that are created in main(). Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=116740&r1=116739&r2=116740&view=diff ============================================================================== --- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original) +++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Mon Oct 18 15:03:16 2010 @@ -318,7 +318,7 @@ /// CreateGlobalPool - Create a global pool descriptor, initialize it in main, /// and return a pointer to the global for it. GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Alignment, - Instruction *IPHint = 0); + std::string name = "GlobalPool", Instruction *IPHint = 0); /// getPoolType - Return the type of a pool descriptor /// FIXME: These constants should be chosen by the client Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=116740&r1=116739&r2=116740&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Oct 18 15:03:16 2010 @@ -971,7 +971,7 @@ Heuristic::OnePool &Pool = ResultPools[i]; Value *PoolDesc = Pool.PoolDesc; if (PoolDesc == 0) { - PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, InsertPt); + PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, "GlobalPool", InsertPt); if (Pool.NodesInPool.size() == 1 && !Pool.NodesInPool[0]->isNodeCompletelyFolded()) @@ -997,11 +997,11 @@ /// poolinit for it into main. IPHint is an instruction that we should insert /// the poolinit before if not null. GlobalVariable *PoolAllocate::CreateGlobalPool(unsigned RecSize, unsigned Align, - Instruction *IPHint) { + std::string name, Instruction *IPHint) { GlobalVariable *GV = new GlobalVariable(*CurModule, PoolDescType, false, GlobalValue::InternalLinkage, - ConstantAggregateZero::get(PoolDescType), "GlobalPool"); + ConstantAggregateZero::get(PoolDescType), name); // Update the global DSGraph to include this. DSNode *GNode = Graphs->getGlobalsGraph()->addObjectToGraph(GV); @@ -1072,7 +1072,7 @@ NewNode->setModifiedMarker()->setReadMarker(); // This is M/R } else { PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, - InsertPoint); + "PoolForMain", InsertPoint); // Add the global node to main's graph. DSNode *NewNode = DSG->addObjectToGraph(PoolDesc); From rafael.espindola at gmail.com Mon Oct 18 15:25:33 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 20:25:33 -0000 Subject: [llvm-commits] [llvm] r116741 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp test/MC/ELF/relocation-386.s Message-ID: <20101018202533.D582A2A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 15:25:33 2010 New Revision: 116741 URL: http://llvm.org/viewvc/llvm-project?rev=116741&view=rev Log: Relocate with .bss instead of using the symbol. Matches gas behavior. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/test/MC/ELF/relocation-386.s Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116741&r1=116740&r2=116741&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 15:25:33 2010 @@ -560,6 +560,9 @@ const MCSectionELF &Sec2 = static_cast(F.getParent()->getSection()); + if (Section.getKind().isBSS()) + return false; + if (&Sec2 != &Section && (Kind == MCSymbolRefExpr::VK_PLT || Kind == MCSymbolRefExpr::VK_GOTPCREL || Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116741&r1=116740&r2=116741&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 15:25:33 2010 @@ -3,10 +3,23 @@ // Test that we produce the correct relocation types and that the relocation // to .Lfoo uses the symbol and not the section. +// Section 3 is bss +// CHECK: # Section 3 +// CHECK-NEXT: (('sh_name', 13) # '.bss' // CHECK: # Symbol 1 // CHECK-NEXT: (('st_name', 5) # '.Lfoo' +// Symbol 6 is section 3 +// CHECK: # Symbol 6 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 3) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 3) + // CHECK: # Relocation 0 // CHECK-NEXT: (('r_offset', 2) // CHECK-NEXT: ('r_sym', 1) @@ -23,6 +36,13 @@ // CHECK-NEXT: ('r_type', 10) // CHECK-NEXT: ), +// Relocation 3 (bar3 at GOTOFF) is done symbol 6 (bss) +// CHECK-NEXT: # Relocation 3 +// CHECK-NEXT: (('r_offset', +// CHECK-NEXT: ('r_sym', 6 +// CHECK-NEXT: ('r_type', +// CHECK-NEXT: ), + .text bar: leal .Lfoo at GOTOFF(%ebx), %eax @@ -31,6 +51,11 @@ bar2: calll bar2 at PLT addl $_GLOBAL_OFFSET_TABLE_, %ebx + movb bar3 at GOTOFF(%ebx), %al + + .type bar3, at object + .local bar3 + .comm bar3,1,1 .section .rodata.str1.16,"aMS", at progbits,1 .Lfoo: From gohman at apple.com Mon Oct 18 15:44:50 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 20:44:50 -0000 Subject: [llvm-commits] [llvm] r116743 - in /llvm/trunk: include/llvm/Analysis/AliasSetTracker.h include/llvm/LinkAllPasses.h lib/Analysis/AliasSetTracker.cpp lib/Transforms/Scalar/LICM.cpp Message-ID: <20101018204450.7E4A92A6C12C@llvm.org> Author: djg Date: Mon Oct 18 15:44:50 2010 New Revision: 116743 URL: http://llvm.org/viewvc/llvm-project?rev=116743&view=rev Log: Make AliasSetTracker TBAA-aware, enabling TBAA-enabled LICM. Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/include/llvm/LinkAllPasses.h llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=116743&r1=116742&r2=116743&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Mon Oct 18 15:44:50 2010 @@ -41,9 +41,10 @@ PointerRec **PrevInList, *NextInList; AliasSet *AS; unsigned Size; + const MDNode *TBAAInfo; public: PointerRec(Value *V) - : Val(V), PrevInList(0), NextInList(0), AS(0), Size(0) {} + : Val(V), PrevInList(0), NextInList(0), AS(0), Size(0), TBAAInfo(0) {} Value *getValue() const { return Val; } @@ -55,12 +56,19 @@ return &NextInList; } - void updateSize(unsigned NewSize) { + void updateSizeAndTBAAInfo(unsigned NewSize, const MDNode *NewTBAAInfo) { if (NewSize > Size) Size = NewSize; + + if (!TBAAInfo) + TBAAInfo = NewTBAAInfo; + else if (TBAAInfo != NewTBAAInfo) + TBAAInfo = reinterpret_cast(-1); } unsigned getSize() const { return Size; } + const MDNode *getTBAAInfo() const { return TBAAInfo; } + AliasSet *getAliasSet(AliasSetTracker &AST) { assert(AS && "No AliasSet yet!"); if (AS->Forward) { @@ -187,6 +195,7 @@ Value *getPointer() const { return CurNode->getValue(); } unsigned getSize() const { return CurNode->getSize(); } + const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement assert(CurNode && "Advancing past AliasSet.end()!"); @@ -231,6 +240,7 @@ void removeFromTracker(AliasSetTracker &AST); void addPointer(AliasSetTracker &AST, PointerRec &Entry, unsigned Size, + const MDNode *TBAAInfo, bool KnownMustAlias = false); void addCallSite(CallSite CS, AliasAnalysis &AA); void removeCallSite(CallSite CS) { @@ -245,7 +255,8 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// - bool aliasesPointer(const Value *Ptr, unsigned Size, AliasAnalysis &AA) const; + bool aliasesPointer(const Value *Ptr, unsigned Size, const MDNode *TBAAInfo, + AliasAnalysis &AA) const; bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const; }; @@ -298,7 +309,7 @@ /// These methods return true if inserting the instruction resulted in the /// addition of a new alias set (i.e., the pointer did not alias anything). /// - bool add(Value *Ptr, unsigned Size); // Add a location + bool add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); // Add a location bool add(LoadInst *LI); bool add(StoreInst *SI); bool add(VAArgInst *VAAI); @@ -312,7 +323,8 @@ /// remove methods - These methods are used to remove all entries that might /// be aliased by the specified instruction. These methods return true if any /// alias sets were eliminated. - bool remove(Value *Ptr, unsigned Size); // Remove a location + // Remove a location + bool remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); bool remove(LoadInst *LI); bool remove(StoreInst *SI); bool remove(VAArgInst *VAAI); @@ -332,18 +344,21 @@ /// lives in. If the New argument is non-null, this method sets the value to /// true if a new alias set is created to contain the pointer (because the /// pointer didn't alias anything). - AliasSet &getAliasSetForPointer(Value *P, unsigned Size, bool *New = 0); + AliasSet &getAliasSetForPointer(Value *P, unsigned Size, + const MDNode *TBAAInfo, + bool *New = 0); /// getAliasSetForPointerIfExists - Return the alias set containing the /// location specified if one exists, otherwise return null. - AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size) { - return findAliasSetForPointer(P, Size); + AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size, + const MDNode *TBAAInfo) { + return findAliasSetForPointer(P, Size, TBAAInfo); } /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. - bool containsPointer(Value *P, unsigned Size) const; + bool containsPointer(Value *P, unsigned Size, const MDNode *TBAAInfo) const; /// getAliasAnalysis - Return the underlying alias analysis object used by /// this tracker. @@ -390,14 +405,16 @@ return *Entry; } - AliasSet &addPointer(Value *P, unsigned Size, AliasSet::AccessType E, + AliasSet &addPointer(Value *P, unsigned Size, const MDNode *TBAAInfo, + AliasSet::AccessType E, bool &NewSet) { NewSet = false; - AliasSet &AS = getAliasSetForPointer(P, Size, &NewSet); + AliasSet &AS = getAliasSetForPointer(P, Size, TBAAInfo, &NewSet); AS.AccessTy |= E; return AS; } - AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size); + AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size, + const MDNode *TBAAInfo); AliasSet *findAliasSetForCallSite(CallSite CS); }; Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=116743&r1=116742&r2=116743&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Mon Oct 18 15:44:50 2010 @@ -152,7 +152,7 @@ (void)new llvm::ScalarEvolution(); ((llvm::Function*)0)->viewCFGOnly(); llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); - X.add((llvm::Value*)0, 0); // for -print-alias-sets + X.add((llvm::Value*)0, 0, 0); // for -print-alias-sets } } ForcePassLinking; // Force link by creating a global definition. } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116743&r1=116742&r2=116743&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Mon Oct 18 15:44:50 2010 @@ -15,6 +15,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" +#include "llvm/LLVMContext.h" #include "llvm/Pass.h" #include "llvm/Type.h" #include "llvm/Target/TargetData.h" @@ -87,7 +88,8 @@ } void AliasSet::addPointer(AliasSetTracker &AST, PointerRec &Entry, - unsigned Size, bool KnownMustAlias) { + unsigned Size, const MDNode *TBAAInfo, + bool KnownMustAlias) { assert(!Entry.hasAliasSet() && "Entry already in set!"); // Check to see if we have to downgrade to _may_ alias. @@ -95,16 +97,18 @@ if (PointerRec *P = getSomePointer()) { AliasAnalysis &AA = AST.getAliasAnalysis(); AliasAnalysis::AliasResult Result = - AA.alias(P->getValue(), P->getSize(), Entry.getValue(), Size); + AA.alias(AliasAnalysis::Location(P->getValue(), P->getSize(), + P->getTBAAInfo()), + AliasAnalysis::Location(Entry.getValue(), Size, TBAAInfo)); if (Result == AliasAnalysis::MayAlias) AliasTy = MayAlias; else // First entry of must alias must have maximum size! - P->updateSize(Size); + P->updateSizeAndTBAAInfo(Size, TBAAInfo); assert(Result != AliasAnalysis::NoAlias && "Cannot be part of must set!"); } Entry.setAliasSet(this); - Entry.updateSize(Size); + Entry.updateSizeAndTBAAInfo(Size, TBAAInfo); // Add it to the end of the list... assert(*PtrListEnd == 0 && "End of list is not null?"); @@ -135,6 +139,7 @@ /// alias one of the members in the set. /// bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size, + const MDNode *TBAAInfo, AliasAnalysis &AA) const { if (AliasTy == MustAlias) { assert(CallSites.empty() && "Illegal must alias set!"); @@ -143,19 +148,25 @@ // SOME value in the set. PointerRec *SomePtr = getSomePointer(); assert(SomePtr && "Empty must-alias set??"); - return AA.alias(SomePtr->getValue(), SomePtr->getSize(), Ptr, Size); + return AA.alias(AliasAnalysis::Location(SomePtr->getValue(), + SomePtr->getSize(), + SomePtr->getTBAAInfo()), + AliasAnalysis::Location(Ptr, Size, TBAAInfo)); } // If this is a may-alias set, we have to check all of the pointers in the set // to be sure it doesn't alias the set... for (iterator I = begin(), E = end(); I != E; ++I) - if (AA.alias(Ptr, Size, I.getPointer(), I.getSize())) + if (AA.alias(AliasAnalysis::Location(Ptr, Size, TBAAInfo), + AliasAnalysis::Location(I.getPointer(), I.getSize(), I.getTBAAInfo()))) return true; // Check the call sites list and invoke list... if (!CallSites.empty()) { for (unsigned i = 0, e = CallSites.size(); i != e; ++i) - if (AA.getModRefInfo(CallSites[i], Ptr, Size) != AliasAnalysis::NoModRef) + if (AA.getModRefInfo(CallSites[i], + AliasAnalysis::Location(Ptr, Size, TBAAInfo)) != + AliasAnalysis::NoModRef) return true; } @@ -198,10 +209,11 @@ /// that may alias the pointer, merge them together and return the unified set. /// AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr, - unsigned Size) { + unsigned Size, + const MDNode *TBAAInfo) { AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) { - if (I->Forward || !I->aliasesPointer(Ptr, Size, AA)) continue; + if (I->Forward || !I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) continue; if (FoundSet == 0) { // If this is the first alias set ptr can go into. FoundSet = I; // Remember it. @@ -216,9 +228,10 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. -bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size) const { +bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size, + const MDNode *TBAAInfo) const { for (const_iterator I = begin(), E = end(); I != E; ++I) - if (!I->Forward && I->aliasesPointer(Ptr, Size, AA)) + if (!I->Forward && I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) return true; return false; } @@ -245,32 +258,33 @@ /// getAliasSetForPointer - Return the alias set that the specified pointer /// lives in. AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size, + const MDNode *TBAAInfo, bool *New) { AliasSet::PointerRec &Entry = getEntryFor(Pointer); // Check to see if the pointer is already known. if (Entry.hasAliasSet()) { - Entry.updateSize(Size); + Entry.updateSizeAndTBAAInfo(Size, TBAAInfo); // Return the set! return *Entry.getAliasSet(*this)->getForwardedTarget(*this); } - if (AliasSet *AS = findAliasSetForPointer(Pointer, Size)) { + if (AliasSet *AS = findAliasSetForPointer(Pointer, Size, TBAAInfo)) { // Add it to the alias set it aliases. - AS->addPointer(*this, Entry, Size); + AS->addPointer(*this, Entry, Size, TBAAInfo); return *AS; } if (New) *New = true; // Otherwise create a new alias set to hold the loaded pointer. AliasSets.push_back(new AliasSet()); - AliasSets.back().addPointer(*this, Entry, Size); + AliasSets.back().addPointer(*this, Entry, Size, TBAAInfo); return AliasSets.back(); } -bool AliasSetTracker::add(Value *Ptr, unsigned Size) { +bool AliasSetTracker::add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { bool NewPtr; - addPointer(Ptr, Size, AliasSet::NoModRef, NewPtr); + addPointer(Ptr, Size, TBAAInfo, AliasSet::NoModRef, NewPtr); return NewPtr; } @@ -279,6 +293,7 @@ bool NewPtr; AliasSet &AS = addPointer(LI->getOperand(0), AA.getTypeStoreSize(LI->getType()), + LI->getMetadata(LLVMContext::MD_tbaa), AliasSet::Refs, NewPtr); if (LI->isVolatile()) AS.setVolatile(); return NewPtr; @@ -289,6 +304,7 @@ Value *Val = SI->getOperand(0); AliasSet &AS = addPointer(SI->getOperand(1), AA.getTypeStoreSize(Val->getType()), + SI->getMetadata(LLVMContext::MD_tbaa), AliasSet::Mods, NewPtr); if (SI->isVolatile()) AS.setVolatile(); return NewPtr; @@ -296,7 +312,9 @@ bool AliasSetTracker::add(VAArgInst *VAAI) { bool NewPtr; - addPointer(VAAI->getOperand(0), ~0, AliasSet::ModRef, NewPtr); + addPointer(VAAI->getOperand(0), AliasAnalysis::UnknownSize, + VAAI->getMetadata(LLVMContext::MD_tbaa), + AliasSet::ModRef, NewPtr); return NewPtr; } @@ -358,6 +376,7 @@ bool X; for (AliasSet::iterator ASI = AS.begin(), E = AS.end(); ASI != E; ++ASI) { AliasSet &NewAS = addPointer(ASI.getPointer(), ASI.getSize(), + ASI.getTBAAInfo(), (AliasSet::AccessType)AS.AccessTy, X); if (AS.isVolatile()) NewAS.setVolatile(); } @@ -393,8 +412,9 @@ AS.removeFromTracker(*this); } -bool AliasSetTracker::remove(Value *Ptr, unsigned Size) { - AliasSet *AS = findAliasSetForPointer(Ptr, Size); +bool +AliasSetTracker::remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { + AliasSet *AS = findAliasSetForPointer(Ptr, Size, TBAAInfo); if (!AS) return false; remove(*AS); return true; @@ -402,7 +422,8 @@ bool AliasSetTracker::remove(LoadInst *LI) { unsigned Size = AA.getTypeStoreSize(LI->getType()); - AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size); + const MDNode *TBAAInfo = LI->getMetadata(LLVMContext::MD_tbaa); + AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size, TBAAInfo); if (!AS) return false; remove(*AS); return true; @@ -410,14 +431,17 @@ bool AliasSetTracker::remove(StoreInst *SI) { unsigned Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); - AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size); + const MDNode *TBAAInfo = SI->getMetadata(LLVMContext::MD_tbaa); + AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size, TBAAInfo); if (!AS) return false; remove(*AS); return true; } bool AliasSetTracker::remove(VAArgInst *VAAI) { - AliasSet *AS = findAliasSetForPointer(VAAI->getOperand(0), ~0); + AliasSet *AS = findAliasSetForPointer(VAAI->getOperand(0), + AliasAnalysis::UnknownSize, + VAAI->getMetadata(LLVMContext::MD_tbaa)); if (!AS) return false; remove(*AS); return true; @@ -507,7 +531,8 @@ // Add it to the alias set it aliases... I = PointerMap.find(From); AliasSet *AS = I->second->getAliasSet(*this); - AS->addPointer(*this, Entry, I->second->getSize(), true); + AS->addPointer(*this, Entry, I->second->getSize(), I->second->getTBAAInfo(), + true); } Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=116743&r1=116742&r2=116743&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Mon Oct 18 15:44:50 2010 @@ -36,6 +36,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/IntrinsicInst.h" #include "llvm/Instructions.h" +#include "llvm/LLVMContext.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/ConstantFolding.h" @@ -187,9 +188,10 @@ /// pointerInvalidatedByLoop - Return true if the body of this loop may /// store into the memory location pointed to by V. /// - bool pointerInvalidatedByLoop(Value *V, unsigned Size) { + bool pointerInvalidatedByLoop(Value *V, unsigned Size, + const MDNode *TBAAInfo) { // Check to see if any of the basic blocks in CurLoop invalidate *V. - return CurAST->getAliasSetForPointer(V, Size).isMod(); + return CurAST->getAliasSetForPointer(V, Size, TBAAInfo).isMod(); } bool canSinkOrHoistInst(Instruction &I); @@ -402,7 +404,8 @@ unsigned Size = 0; if (LI->getType()->isSized()) Size = AA->getTypeStoreSize(LI->getType()); - return !pointerInvalidatedByLoop(LI->getOperand(0), Size); + return !pointerInvalidatedByLoop(LI->getOperand(0), Size, + LI->getMetadata(LLVMContext::MD_tbaa)); } else if (CallInst *CI = dyn_cast(&I)) { // Handle obvious cases efficiently. AliasAnalysis::ModRefBehavior Behavior = AA->getModRefBehavior(CI); From rafael.espindola at gmail.com Mon Oct 18 15:47:21 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 18 Oct 2010 20:47:21 -0000 Subject: [llvm-commits] [llvm] r116744 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp test/MC/ELF/relocation-386.s Message-ID: <20101018204721.A1B522A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 15:47:21 2010 New Revision: 116744 URL: http://llvm.org/viewvc/llvm-project?rev=116744&view=rev Log: Implement R_386_GOT32. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/test/MC/ELF/relocation-386.s Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116744&r1=116743&r2=116744&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Oct 18 15:47:21 2010 @@ -706,6 +706,9 @@ switch (Modifier) { default: llvm_unreachable("Unimplemented"); + case MCSymbolRefExpr::VK_GOT: + Type = ELF::R_386_GOT32; + break; case MCSymbolRefExpr::VK_GOTOFF: Type = ELF::R_386_GOTOFF; break; Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116744&r1=116743&r2=116744&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 15:47:21 2010 @@ -36,13 +36,20 @@ // CHECK-NEXT: ('r_type', 10) // CHECK-NEXT: ), -// Relocation 3 (bar3 at GOTOFF) is done symbol 6 (bss) +// Relocation 3 (bar3 at GOTOFF) is done with symbol 6 (bss) // CHECK-NEXT: # Relocation 3 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', 6 // CHECK-NEXT: ('r_type', // CHECK-NEXT: ), +// Relocation 4 (bar2 at GOT) is of type R_386_GOT32 +// CHECK-NEXT: # Relocation 4 +// CHECK-NEXT: (('r_offset', +// CHECK-NEXT: ('r_sym', +// CHECK-NEXT: ('r_type', 3 +// CHECK-NEXT: ), + .text bar: leal .Lfoo at GOTOFF(%ebx), %eax @@ -57,6 +64,8 @@ .local bar3 .comm bar3,1,1 + movl bar2j at GOT(%eax), %eax + .section .rodata.str1.16,"aMS", at progbits,1 .Lfoo: .asciz "bool llvm::llvm_start_multithreaded()" From gohman at apple.com Mon Oct 18 16:00:09 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 21:00:09 -0000 Subject: [llvm-commits] [llvm] r116745 - /llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll Message-ID: <20101018210010.07DDD2A6C12C@llvm.org> Author: djg Date: Mon Oct 18 16:00:09 2010 New Revision: 116745 URL: http://llvm.org/viewvc/llvm-project?rev=116745&view=rev Log: Add a basic testcase for TBAA-aware LICM. Added: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll Added: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll?rev=116745&view=auto ============================================================================== --- llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll (added) +++ llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll Mon Oct 18 16:00:09 2010 @@ -0,0 +1,33 @@ +; RUN: opt -tbaa -licm -enable-tbaa -S < %s | FileCheck %s + +; LICM should be able to hoist the address load out of the loop +; by using TBAA information. + +; CHECK: entry: +; CHECK-NEXT: %tmp3 = load double** @P, !tbaa !0 +; CHECK-NEXT: br label %for.body + + at P = common global double* null + +define void @foo(i64 %n) nounwind { +entry: + br label %for.body + +for.body: ; preds = %entry, %for.body + %i.07 = phi i64 [ %inc, %for.body ], [ 0, %entry ] + %tmp3 = load double** @P, !tbaa !1 + %scevgep = getelementptr double* %tmp3, i64 %i.07 + %tmp4 = load double* %scevgep, !tbaa !2 + %mul = fmul double %tmp4, 2.300000e+00 + store double %mul, double* %scevgep, !tbaa !2 + %inc = add i64 %i.07, 1 + %exitcond = icmp eq i64 %inc, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +!0 = metadata !{metadata !"root", null} +!1 = metadata !{metadata !"pointer", metadata !0} +!2 = metadata !{metadata !"double", metadata !0} From foldr at codedgers.com Mon Oct 18 16:16:01 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Mon, 18 Oct 2010 21:16:01 -0000 Subject: [llvm-commits] [llvm] r116749 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <20101018211601.17F842A6C12C@llvm.org> Author: foldr Date: Mon Oct 18 16:16:00 2010 New Revision: 116749 URL: http://llvm.org/viewvc/llvm-project?rev=116749&view=rev Log: Trailing whitespace. Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=116749&r1=116748&r2=116749&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Oct 18 16:16:00 2010 @@ -129,7 +129,7 @@ /// HasPHIUser - Set to true if this global has a user that is a PHI node. bool HasPHIUser; - + GlobalStatus() : isLoaded(false), StoredType(NotStored), StoredOnceValue(0), AccessingFunction(0), HasMultipleAccessingFunctions(false), HasNonInstructionUser(false), HasPHIUser(false) {} @@ -308,7 +308,7 @@ if (Init) SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE); Changed |= CleanupConstantGlobalUsers(CE, SubInit); - } else if (CE->getOpcode() == Instruction::BitCast && + } else if (CE->getOpcode() == Instruction::BitCast && CE->getType()->isPointerTy()) { // Pointer cast, delete any stores and memsets to the global. Changed |= CleanupConstantGlobalUsers(CE, 0); @@ -324,7 +324,7 @@ // and will invalidate our notion of what Init is. Constant *SubInit = 0; if (!isa(GEP->getOperand(0))) { - ConstantExpr *CE = + ConstantExpr *CE = dyn_cast_or_null(ConstantFoldInstruction(GEP)); if (Init && CE && CE->getOpcode() == Instruction::GetElementPtr) SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE); @@ -361,7 +361,7 @@ // We might have a dead and dangling constant hanging off of here. if (Constant *C = dyn_cast(V)) return SafeToDestroyConstant(C); - + Instruction *I = dyn_cast(V); if (!I) return false; @@ -371,15 +371,15 @@ // Stores *to* the pointer are ok. if (StoreInst *SI = dyn_cast(I)) return SI->getOperand(0) != V; - + // Otherwise, it must be a GEP. GetElementPtrInst *GEPI = dyn_cast(I); if (GEPI == 0) return false; - + if (GEPI->getNumOperands() < 3 || !isa(GEPI->getOperand(1)) || !cast(GEPI->getOperand(1))->isNullValue()) return false; - + for (Value::use_iterator I = GEPI->use_begin(), E = GEPI->use_end(); I != E; ++I) if (!isSafeSROAElementUse(*I)) @@ -393,11 +393,11 @@ /// static bool IsUserOfGlobalSafeForSRA(User *U, GlobalValue *GV) { // The user of the global must be a GEP Inst or a ConstantExpr GEP. - if (!isa(U) && - (!isa(U) || + if (!isa(U) && + (!isa(U) || cast(U)->getOpcode() != Instruction::GetElementPtr)) return false; - + // Check to see if this ConstantExpr GEP is SRA'able. In particular, we // don't like < 3 operand CE's, and we don't like non-constant integer // indices. This enforces that all uses are 'gep GV, 0, C, ...' for some @@ -409,18 +409,18 @@ gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); ++GEPI; // Skip over the pointer index. - + // If this is a use of an array allocation, do a bit more checking for sanity. if (const ArrayType *AT = dyn_cast(*GEPI)) { uint64_t NumElements = AT->getNumElements(); ConstantInt *Idx = cast(U->getOperand(2)); - + // Check to make sure that index falls within the array. If not, // something funny is going on, so we won't do the optimization. // if (Idx->getZExtValue() >= NumElements) return false; - + // We cannot scalar repl this level of the array unless any array // sub-indices are in-range constants. In particular, consider: // A[0][i]. We cannot know that the user isn't doing invalid things like @@ -441,7 +441,7 @@ "Indexed GEP type is not array, vector, or struct!"); continue; } - + ConstantInt *IdxVal = dyn_cast(GEPI.getOperand()); if (!IdxVal || IdxVal->getZExtValue() >= NumElements) return false; @@ -465,7 +465,7 @@ } return true; } - + /// SRAGlobal - Perform scalar replacement of aggregates on the specified global /// variable. This opens the door for other optimizations by exposing the @@ -476,7 +476,7 @@ // Make sure this global only has simple uses that we can SRA. if (!GlobalUsersSafeToSRA(GV)) return 0; - + assert(GV->hasLocalLinkage() && !GV->isConstant()); Constant *Init = GV->getInitializer(); const Type *Ty = Init->getType(); @@ -488,7 +488,7 @@ unsigned StartAlignment = GV->getAlignment(); if (StartAlignment == 0) StartAlignment = TD.getABITypeAlignment(GV->getType()); - + if (const StructType *STy = dyn_cast(Ty)) { NewGlobals.reserve(STy->getNumElements()); const StructLayout &Layout = *TD.getStructLayout(STy); @@ -503,7 +503,7 @@ GV->getType()->getAddressSpace()); Globals.insert(GV, NGV); NewGlobals.push_back(NGV); - + // Calculate the known alignment of the field. If the original aggregate // had 256 byte alignment for example, something might depend on that: // propagate info to each field. @@ -522,7 +522,7 @@ if (NumElements > 16 && GV->hasNUsesOrMore(16)) return 0; // It's not worth it. NewGlobals.reserve(NumElements); - + uint64_t EltSize = TD.getTypeAllocSize(STy->getElementType()); unsigned EltAlign = TD.getABITypeAlignment(STy->getElementType()); for (unsigned i = 0, e = NumElements; i != e; ++i) { @@ -537,7 +537,7 @@ GV->getType()->getAddressSpace()); Globals.insert(GV, NGV); NewGlobals.push_back(NGV); - + // Calculate the known alignment of the field. If the original aggregate // had 256 byte alignment for example, something might depend on that: // propagate info to each field. @@ -549,7 +549,7 @@ if (NewGlobals.empty()) return 0; - + DEBUG(dbgs() << "PERFORMING GLOBAL SRA ON: " << *GV); Constant *NullInt =Constant::getNullValue(Type::getInt32Ty(GV->getContext())); @@ -615,7 +615,7 @@ } /// AllUsesOfValueWillTrapIfNull - Return true if all users of the specified -/// value will trap if the value is dynamically null. PHIs keeps track of any +/// value will trap if the value is dynamically null. PHIs keeps track of any /// phi nodes we've seen to avoid reprocessing them. static bool AllUsesOfValueWillTrapIfNull(const Value *V, SmallPtrSet &PHIs) { @@ -757,7 +757,7 @@ // Keep track of whether we are able to remove all the uses of the global // other than the store that defines it. bool AllNonStoreUsesGone = true; - + // Replace all uses of loads with uses of uses of the stored value. for (Value::use_iterator GUI = GV->use_begin(), E = GV->use_end(); GUI != E;){ User *GlobalUser = *GUI++; @@ -830,7 +830,7 @@ ConstantInt *NElements, TargetData* TD) { DEBUG(errs() << "PROMOTING GLOBAL: " << *GV << " CALL = " << *CI << '\n'); - + const Type *GlobalType; if (NElements->getZExtValue() == 1) GlobalType = AllocTy; @@ -840,14 +840,14 @@ // Create the new global variable. The contents of the malloc'd memory is // undefined, so initialize with an undef value. - GlobalVariable *NewGV = new GlobalVariable(*GV->getParent(), + GlobalVariable *NewGV = new GlobalVariable(*GV->getParent(), GlobalType, false, GlobalValue::InternalLinkage, UndefValue::get(GlobalType), GV->getName()+".body", GV, GV->isThreadLocal()); - + // If there are bitcast users of the malloc (which is typical, usually we have // a malloc + bitcast) then replace them with uses of the new global. Update // other users to use the global as well. @@ -867,10 +867,10 @@ User->replaceUsesOfWith(CI, TheBC); } } - + Constant *RepValue = NewGV; if (NewGV->getType() != GV->getType()->getElementType()) - RepValue = ConstantExpr::getBitCast(RepValue, + RepValue = ConstantExpr::getBitCast(RepValue, GV->getType()->getElementType()); // If there is a comparison against null, we will insert a global bool to @@ -890,7 +890,7 @@ SI->eraseFromParent(); continue; } - + LoadInst *LI = cast(GV->use_back()); while (!LI->use_empty()) { Use &LoadUse = LI->use_begin().getUse(); @@ -898,7 +898,7 @@ LoadUse = RepValue; continue; } - + ICmpInst *ICI = cast(LoadUse.getUser()); // Replace the cmp X, 0 with a use of the bool value. Value *LV = new LoadInst(InitBool, InitBool->getName()+".val", ICI); @@ -963,20 +963,20 @@ if (isa(Inst) || isa(Inst)) { continue; // Fine, ignore. } - + if (const StoreInst *SI = dyn_cast(Inst)) { if (SI->getOperand(0) == V && SI->getOperand(1) != GV) return false; // Storing the pointer itself... bad. continue; // Otherwise, storing through it, or storing into GV... fine. } - + // Must index into the array and into the struct. if (isa(Inst) && Inst->getNumOperands() >= 3) { if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Inst, GV, PHIs)) return false; continue; } - + if (const PHINode *PN = dyn_cast(Inst)) { // PHIs are ok if all uses are ok. Don't infinitely recurse through PHI // cycles. @@ -985,13 +985,13 @@ return false; continue; } - + if (const BitCastInst *BCI = dyn_cast(Inst)) { if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(BCI, GV, PHIs)) return false; continue; } - + return false; } return true; @@ -1000,9 +1000,9 @@ /// ReplaceUsesOfMallocWithGlobal - The Alloc pointer is stored into GV /// somewhere. Transform all uses of the allocation into loads from the /// global and uses of the resultant pointer. Further, delete the store into -/// GV. This assumes that these value pass the +/// GV. This assumes that these value pass the /// 'ValueIsOnlyUsedLocallyOrStoredToOneGlobal' predicate. -static void ReplaceUsesOfMallocWithGlobal(Instruction *Alloc, +static void ReplaceUsesOfMallocWithGlobal(Instruction *Alloc, GlobalVariable *GV) { while (!Alloc->use_empty()) { Instruction *U = cast(*Alloc->use_begin()); @@ -1035,7 +1035,7 @@ continue; } } - + // Insert a load from the global, and use it instead of the malloc. Value *NL = new LoadInst(GV, GV->getName()+".val", InsertPt); U->replaceUsesOfWith(Alloc, NL); @@ -1053,24 +1053,24 @@ for (Value::const_use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI) { const Instruction *User = cast(*UI); - + // Comparison against null is ok. if (const ICmpInst *ICI = dyn_cast(User)) { if (!isa(ICI->getOperand(1))) return false; continue; } - + // getelementptr is also ok, but only a simple form. if (const GetElementPtrInst *GEPI = dyn_cast(User)) { // Must index into the array and into the struct. if (GEPI->getNumOperands() < 3) return false; - + // Otherwise the GEP is ok. continue; } - + if (const PHINode *PN = dyn_cast(User)) { if (!LoadUsingPHIsPerLoad.insert(PN)) // This means some phi nodes are dependent on each other. @@ -1079,19 +1079,19 @@ if (!LoadUsingPHIs.insert(PN)) // If we have already analyzed this PHI, then it is safe. continue; - + // Make sure all uses of the PHI are simple enough to transform. if (!LoadUsesSimpleEnoughForHeapSRA(PN, LoadUsingPHIs, LoadUsingPHIsPerLoad)) return false; - + continue; } - + // Otherwise we don't know what this is, not ok. return false; } - + return true; } @@ -1110,10 +1110,10 @@ return false; LoadUsingPHIsPerLoad.clear(); } - + // If we reach here, we know that all uses of the loads and transitive uses // (through PHI nodes) are simple enough to transform. However, we don't know - // that all inputs the to the PHI nodes are in the same equivalence sets. + // that all inputs the to the PHI nodes are in the same equivalence sets. // Check to verify that all operands of the PHIs are either PHIS that can be // transformed, loads from GV, or MI itself. for (SmallPtrSet::const_iterator I = LoadUsingPHIs.begin() @@ -1121,29 +1121,29 @@ const PHINode *PN = *I; for (unsigned op = 0, e = PN->getNumIncomingValues(); op != e; ++op) { Value *InVal = PN->getIncomingValue(op); - + // PHI of the stored value itself is ok. if (InVal == StoredVal) continue; - + if (const PHINode *InPN = dyn_cast(InVal)) { // One of the PHIs in our set is (optimistically) ok. if (LoadUsingPHIs.count(InPN)) continue; return false; } - + // Load from GV is ok. if (const LoadInst *LI = dyn_cast(InVal)) if (LI->getOperand(0) == GV) continue; - + // UNDEF? NULL? - + // Anything else is rejected. return false; } } - + return true; } @@ -1151,15 +1151,15 @@ DenseMap > &InsertedScalarizedValues, std::vector > &PHIsToRewrite) { std::vector &FieldVals = InsertedScalarizedValues[V]; - + if (FieldNo >= FieldVals.size()) FieldVals.resize(FieldNo+1); - + // If we already have this value, just reuse the previously scalarized // version. if (Value *FieldVal = FieldVals[FieldNo]) return FieldVal; - + // Depending on what instruction this is, we have several cases. Value *Result; if (LoadInst *LI = dyn_cast(V)) { @@ -1172,9 +1172,9 @@ } else if (PHINode *PN = dyn_cast(V)) { // PN's type is pointer to struct. Make a new PHI of pointer to struct // field. - const StructType *ST = + const StructType *ST = cast(cast(PN->getType())->getElementType()); - + Result = PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)), PN->getName()+".f"+Twine(FieldNo), PN); @@ -1183,13 +1183,13 @@ llvm_unreachable("Unknown usable value"); Result = 0; } - + return FieldVals[FieldNo] = Result; } /// RewriteHeapSROALoadUser - Given a load instruction and a value derived from /// the load, rewrite the derived value to use the HeapSRoA'd load. -static void RewriteHeapSROALoadUser(Instruction *LoadUser, +static void RewriteHeapSROALoadUser(Instruction *LoadUser, DenseMap > &InsertedScalarizedValues, std::vector > &PHIsToRewrite) { // If this is a comparison against null, handle it. @@ -1199,30 +1199,30 @@ // field. Value *NPtr = GetHeapSROAValue(SCI->getOperand(0), 0, InsertedScalarizedValues, PHIsToRewrite); - + Value *New = new ICmpInst(SCI, SCI->getPredicate(), NPtr, - Constant::getNullValue(NPtr->getType()), + Constant::getNullValue(NPtr->getType()), SCI->getName()); SCI->replaceAllUsesWith(New); SCI->eraseFromParent(); return; } - + // Handle 'getelementptr Ptr, Idx, i32 FieldNo ...' if (GetElementPtrInst *GEPI = dyn_cast(LoadUser)) { assert(GEPI->getNumOperands() >= 3 && isa(GEPI->getOperand(2)) && "Unexpected GEPI!"); - + // Load the pointer for this field. unsigned FieldNo = cast(GEPI->getOperand(2))->getZExtValue(); Value *NewPtr = GetHeapSROAValue(GEPI->getOperand(0), FieldNo, InsertedScalarizedValues, PHIsToRewrite); - + // Create the new GEP idx vector. SmallVector GEPIdx; GEPIdx.push_back(GEPI->getOperand(1)); GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end()); - + Value *NGEPI = GetElementPtrInst::Create(NewPtr, GEPIdx.begin(), GEPIdx.end(), GEPI->getName(), GEPI); @@ -1243,7 +1243,7 @@ tie(InsertPos, Inserted) = InsertedScalarizedValues.insert(std::make_pair(PN, std::vector())); if (!Inserted) return; - + // If this is the first time we've seen this PHI, recursively process all // users. for (Value::use_iterator UI = PN->use_begin(), E = PN->use_end(); UI != E; ) { @@ -1256,7 +1256,7 @@ /// is a value loaded from the global. Eliminate all uses of Ptr, making them /// use FieldGlobals instead. All uses of loaded values satisfy /// AllGlobalLoadUsesSimpleEnoughForHeapSRA. -static void RewriteUsesOfLoadForHeapSRoA(LoadInst *Load, +static void RewriteUsesOfLoadForHeapSRoA(LoadInst *Load, DenseMap > &InsertedScalarizedValues, std::vector > &PHIsToRewrite) { for (Value::use_iterator UI = Load->use_begin(), E = Load->use_end(); @@ -1264,7 +1264,7 @@ Instruction *User = cast(*UI++); RewriteHeapSROALoadUser(User, InsertedScalarizedValues, PHIsToRewrite); } - + if (Load->use_empty()) { Load->eraseFromParent(); InsertedScalarizedValues.erase(Load); @@ -1289,11 +1289,11 @@ // new mallocs at the same place as CI, and N globals. std::vector FieldGlobals; std::vector FieldMallocs; - + for (unsigned FieldNo = 0, e = STy->getNumElements(); FieldNo != e;++FieldNo){ const Type *FieldTy = STy->getElementType(FieldNo); const PointerType *PFieldTy = PointerType::getUnqual(FieldTy); - + GlobalVariable *NGV = new GlobalVariable(*GV->getParent(), PFieldTy, false, GlobalValue::InternalLinkage, @@ -1301,7 +1301,7 @@ GV->getName() + ".f" + Twine(FieldNo), GV, GV->isThreadLocal()); FieldGlobals.push_back(NGV); - + unsigned TypeSize = TD->getTypeAllocSize(FieldTy); if (const StructType *ST = dyn_cast(FieldTy)) TypeSize = TD->getStructLayout(ST)->getSizeInBytes(); @@ -1313,7 +1313,7 @@ FieldMallocs.push_back(NMI); new StoreInst(NMI, NGV, CI); } - + // The tricky aspect of this transformation is handling the case when malloc // fails. In the original code, malloc failing would set the result pointer // of malloc to null. In this case, some mallocs could succeed and others @@ -1340,23 +1340,23 @@ // Split the basic block at the old malloc. BasicBlock *OrigBB = CI->getParent(); BasicBlock *ContBB = OrigBB->splitBasicBlock(CI, "malloc_cont"); - + // Create the block to check the first condition. Put all these blocks at the // end of the function as they are unlikely to be executed. BasicBlock *NullPtrBlock = BasicBlock::Create(OrigBB->getContext(), "malloc_ret_null", OrigBB->getParent()); - + // Remove the uncond branch from OrigBB to ContBB, turning it into a cond // branch on RunningOr. OrigBB->getTerminator()->eraseFromParent(); BranchInst::Create(NullPtrBlock, ContBB, RunningOr, OrigBB); - + // Within the NullPtrBlock, we need to emit a comparison and branch for each // pointer, because some may be null while others are not. for (unsigned i = 0, e = FieldGlobals.size(); i != e; ++i) { Value *GVVal = new LoadInst(FieldGlobals[i], "tmp", NullPtrBlock); - Value *Cmp = new ICmpInst(*NullPtrBlock, ICmpInst::ICMP_NE, GVVal, + Value *Cmp = new ICmpInst(*NullPtrBlock, ICmpInst::ICMP_NE, GVVal, Constant::getNullValue(GVVal->getType()), "tmp"); BasicBlock *FreeBlock = BasicBlock::Create(Cmp->getContext(), "free_it", @@ -1371,10 +1371,10 @@ new StoreInst(Constant::getNullValue(GVVal->getType()), FieldGlobals[i], FreeBlock); BranchInst::Create(NextBlock, FreeBlock); - + NullPtrBlock = NextBlock; } - + BranchInst::Create(ContBB, NullPtrBlock); // CI is no longer needed, remove it. @@ -1385,25 +1385,25 @@ /// inserted for a given load. DenseMap > InsertedScalarizedValues; InsertedScalarizedValues[GV] = FieldGlobals; - + std::vector > PHIsToRewrite; - + // Okay, the malloc site is completely handled. All of the uses of GV are now // loads, and all uses of those loads are simple. Rewrite them to use loads // of the per-field globals instead. for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end(); UI != E;) { Instruction *User = cast(*UI++); - + if (LoadInst *LI = dyn_cast(User)) { RewriteUsesOfLoadForHeapSRoA(LI, InsertedScalarizedValues, PHIsToRewrite); continue; } - + // Must be a store of null. StoreInst *SI = cast(User); assert(isa(SI->getOperand(0)) && "Unexpected heap-sra user!"); - + // Insert a store of null into each global. for (unsigned i = 0, e = FieldGlobals.size(); i != e; ++i) { const PointerType *PT = cast(FieldGlobals[i]->getType()); @@ -1430,7 +1430,7 @@ FieldPN->addIncoming(InVal, PN->getIncomingBlock(i)); } } - + // Drop all inter-phi links and any loads that made it this far. for (DenseMap >::iterator I = InsertedScalarizedValues.begin(), E = InsertedScalarizedValues.end(); @@ -1440,7 +1440,7 @@ else if (LoadInst *LI = dyn_cast(I->first)) LI->dropAllReferences(); } - + // Delete all the phis and loads now that inter-references are dead. for (DenseMap >::iterator I = InsertedScalarizedValues.begin(), E = InsertedScalarizedValues.end(); @@ -1450,7 +1450,7 @@ else if (LoadInst *LI = dyn_cast(I->first)) LI->eraseFromParent(); } - + // The old global is now dead, remove it. GV->eraseFromParent(); @@ -1468,7 +1468,7 @@ TargetData *TD) { if (!TD) return false; - + // If this is a malloc of an abstract type, don't touch it. if (!AllocTy->isSized()) return false; @@ -1508,7 +1508,7 @@ GVI = OptimizeGlobalAddressOfMalloc(GV, CI, AllocTy, NElements, TD); return true; } - + // If the allocation is an array of structures, consider transforming this // into multiple malloc'd arrays, one for each field. This is basically // SRoA for malloc'd memory. @@ -1544,13 +1544,13 @@ CI = dyn_cast(Malloc) ? extractMallocCallFromBitCast(Malloc) : cast(Malloc); } - + GVI = PerformHeapAllocSRoA(GV, CI, getMallocArraySize(CI, TD, true),TD); return true; } - + return false; -} +} // OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge // that only one value (besides its initializer) is ever stored to the global. @@ -1568,7 +1568,7 @@ GV->getInitializer()->isNullValue()) { if (Constant *SOVC = dyn_cast(StoredOnceVal)) { if (GV->getInitializer()->getType() != SOVC->getType()) - SOVC = + SOVC = ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType()); // Optimize away any trapping uses of the loaded value. @@ -1576,7 +1576,7 @@ return true; } else if (CallInst *CI = extractMallocCall(StoredOnceVal)) { const Type* MallocType = getMallocAllocatedType(CI); - if (MallocType && TryToOptimizeStoreOfMallocToGlobal(GV, CI, MallocType, + if (MallocType && TryToOptimizeStoreOfMallocToGlobal(GV, CI, MallocType, GVI, TD)) return true; } @@ -1591,7 +1591,7 @@ /// whenever it is used. This exposes the values to other scalar optimizations. static bool TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) { const Type *GVElType = GV->getType()->getElementType(); - + // If GVElType is already i1, it is already shrunk. If the type of the GV is // an FP value, pointer or vector, don't do this optimization because a select // between them is very expensive and unlikely to lead to later @@ -1611,11 +1611,11 @@ } DEBUG(dbgs() << " *** SHRINKING TO BOOL: " << *GV); - + // Create the new global, initializing it to false. GlobalVariable *NewGV = new GlobalVariable(Type::getInt1Ty(GV->getContext()), false, - GlobalValue::InternalLinkage, + GlobalValue::InternalLinkage, ConstantInt::getFalse(GV->getContext()), GV->getName()+".b", GV->isThreadLocal()); @@ -1716,11 +1716,11 @@ << GS.AccessingFunction->getName() << "\n"); DEBUG(dbgs() << " HasMultipleAccessingFunctions = " << GS.HasMultipleAccessingFunctions << "\n"); - DEBUG(dbgs() << " HasNonInstructionUser = " + DEBUG(dbgs() << " HasNonInstructionUser = " << GS.HasNonInstructionUser<<"\n"); DEBUG(dbgs() << "\n"); #endif - + // If this is a first class global and has only one accessing function // and this function is main (which we know is not recursive we can make // this global a local variable) we replace the global with a local alloca @@ -1750,7 +1750,7 @@ ++NumLocalized; return true; } - + // If the global is never loaded (but may be stored to), it is dead. // Delete it now. if (!GS.isLoaded) { @@ -1943,7 +1943,7 @@ if (!FTy || !FTy->getReturnType()->isVoidTy() || FTy->isVarArg() || FTy->getNumParams() != 0) return 0; - + // Verify that the initializer is simple enough for us to handle. if (!I->hasDefinitiveInitializer()) return 0; ConstantArray *CA = dyn_cast(I->getInitializer()); @@ -1956,7 +1956,7 @@ // Must have a function or null ptr. if (!isa(CS->getOperand(1))) return 0; - + // Init priority must be standard. ConstantInt *CI = dyn_cast(CS->getOperand(0)); if (!CI || CI->getZExtValue() != 65535) @@ -1964,7 +1964,7 @@ } else { return 0; } - + return I; } return 0; @@ -1985,13 +1985,13 @@ /// InstallGlobalCtors - Given a specified llvm.global_ctors list, install the /// specified array, returning the new global to use. -static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL, +static GlobalVariable *InstallGlobalCtors(GlobalVariable *GCL, const std::vector &Ctors) { // If we made a change, reassemble the initializer list. std::vector CSVals; CSVals.push_back(ConstantInt::get(Type::getInt32Ty(GCL->getContext()),65535)); CSVals.push_back(0); - + // Create the new init list. std::vector CAList; for (unsigned i = 0, e = Ctors.size(); i != e; ++i) { @@ -2007,26 +2007,26 @@ } CAList.push_back(ConstantStruct::get(GCL->getContext(), CSVals, false)); } - + // Create the array initializer. const Type *StructTy = cast(GCL->getType()->getElementType())->getElementType(); - Constant *CA = ConstantArray::get(ArrayType::get(StructTy, + Constant *CA = ConstantArray::get(ArrayType::get(StructTy, CAList.size()), CAList); - + // If we didn't change the number of elements, don't create a new GV. if (CA->getType() == GCL->getInitializer()->getType()) { GCL->setInitializer(CA); return GCL; } - + // Create the new global and insert it next to the existing list. GlobalVariable *NGV = new GlobalVariable(CA->getType(), GCL->isConstant(), GCL->getLinkage(), CA, "", GCL->isThreadLocal()); GCL->getParent()->getGlobalList().insert(GCL, NGV); NGV->takeName(GCL); - + // Nuke the old list, replacing any uses with the new one. if (!GCL->use_empty()) { Constant *V = NGV; @@ -2035,7 +2035,7 @@ GCL->replaceAllUsesWith(V); } GCL->eraseFromParent(); - + if (Ctors.size()) return NGV; else @@ -2101,7 +2101,7 @@ assert(Val->getType() == Init->getType() && "Type mismatch!"); return Val; } - + std::vector Elts; if (const StructType *STy = dyn_cast(Init->getType())) { @@ -2119,13 +2119,13 @@ llvm_unreachable("This code is out of sync with " " ConstantFoldLoadThroughGEPConstantExpr"); } - + // Replace the element that we are supposed to. ConstantInt *CU = cast(Addr->getOperand(OpNo)); unsigned Idx = CU->getZExtValue(); assert(Idx < STy->getNumElements() && "Struct index out of range!"); Elts[Idx] = EvaluateStoreInto(Elts[Idx], Val, Addr, OpNo+1); - + // Return the modified struct. return ConstantStruct::get(Init->getContext(), &Elts[0], Elts.size(), STy->isPacked()); @@ -2138,8 +2138,8 @@ NumElts = ATy->getNumElements(); else NumElts = cast(InitTy)->getNumElements(); - - + + // Break up the array into elements. if (ConstantArray *CA = dyn_cast(Init)) { for (User::op_iterator i = CA->op_begin(), e = CA->op_end(); i != e; ++i) @@ -2154,16 +2154,16 @@ " ConstantFoldLoadThroughGEPConstantExpr"); Elts.assign(NumElts, UndefValue::get(InitTy->getElementType())); } - + assert(CI->getZExtValue() < NumElts); Elts[CI->getZExtValue()] = EvaluateStoreInto(Elts[CI->getZExtValue()], Val, Addr, OpNo+1); - + if (Init->getType()->isArrayTy()) return ConstantArray::get(cast(InitTy), Elts); else return ConstantVector::get(&Elts[0], Elts.size()); - } + } } /// CommitValueTo - We have decided that Addr (which satisfies the predicate @@ -2189,14 +2189,14 @@ // is the most up-to-date. DenseMap::const_iterator I = Memory.find(P); if (I != Memory.end()) return I->second; - + // Access it. if (GlobalVariable *GV = dyn_cast(P)) { if (GV->hasDefinitiveInitializer()) return GV->getInitializer(); return 0; } - + // Handle a constantexpr getelementptr. if (ConstantExpr *CE = dyn_cast(P)) if (CE->getOpcode() == Instruction::GetElementPtr && @@ -2221,12 +2221,12 @@ // bail out. TODO: we might want to accept limited recursion. if (std::find(CallStack.begin(), CallStack.end(), F) != CallStack.end()) return false; - + CallStack.push_back(F); - + /// Values - As we compute SSA register values, we store their contents here. DenseMap Values; - + // Initialize arguments to the incoming values specified. unsigned ArgNo = 0; for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; @@ -2237,14 +2237,14 @@ /// we can only evaluate any one basic block at most once. This set keeps /// track of what we have executed so we can detect recursive cases etc. SmallPtrSet ExecutedBlocks; - + // CurInst - The current instruction we're evaluating. BasicBlock::iterator CurInst = F->begin()->begin(); - + // This is the main evaluation loop. while (1) { Constant *InstResult = 0; - + if (StoreInst *SI = dyn_cast(CurInst)) { if (SI->isVolatile()) return false; // no volatile accesses. Constant *Ptr = getVal(Values, SI->getOperand(1)); @@ -2290,7 +2290,7 @@ GlobalValue::InternalLinkage, UndefValue::get(Ty), AI->getName())); - InstResult = AllocaTmps.back(); + InstResult = AllocaTmps.back(); } else if (CallInst *CI = dyn_cast(CurInst)) { // Debug info can safely be ignored here. @@ -2324,7 +2324,7 @@ } else { if (Callee->getFunctionType()->isVarArg()) return false; - + Constant *RetVal; // Execute the call, if successful, use the return value. if (!EvaluateFunction(Callee, RetVal, Formals, CallStack, @@ -2342,7 +2342,7 @@ dyn_cast(getVal(Values, BI->getCondition())); if (!Cond) return false; // Cannot determine. - NewBB = BI->getSuccessor(!Cond->getZExtValue()); + NewBB = BI->getSuccessor(!Cond->getZExtValue()); } } else if (SwitchInst *SI = dyn_cast(CurInst)) { ConstantInt *Val = @@ -2358,20 +2358,20 @@ } else if (ReturnInst *RI = dyn_cast(CurInst)) { if (RI->getNumOperands()) RetVal = getVal(Values, RI->getOperand(0)); - + CallStack.pop_back(); // return from fn. return true; // We succeeded at evaluating this ctor! } else { // invoke, unwind, unreachable. return false; // Cannot handle this terminator. } - + // Okay, we succeeded in evaluating this control flow. See if we have // executed the new block before. If so, we have a looping function, // which we cannot evaluate in reasonable time. if (!ExecutedBlocks.insert(NewBB)) return false; // looped! - + // Okay, we have never been in this block before. Check to see if there // are any PHI nodes. If so, evaluate them with information about where // we came from. @@ -2387,10 +2387,10 @@ // Did not know how to evaluate this! return false; } - + if (!CurInst->use_empty()) Values[CurInst] = InstResult; - + // Advance program counter. ++CurInst; } @@ -2408,7 +2408,7 @@ /// to represent its body. This vector is needed so we can delete the /// temporary globals when we are done. std::vector AllocaTmps; - + /// CallStack - This is used to detect recursion. In pathological situations /// we could hit exponential behavior, but at least there is nothing /// unbounded. @@ -2428,13 +2428,13 @@ E = MutatedMemory.end(); I != E; ++I) CommitValueTo(I->second, I->first); } - + // At this point, we are done interpreting. If we created any 'alloca' // temporaries, release them now. while (!AllocaTmps.empty()) { GlobalVariable *Tmp = AllocaTmps.back(); AllocaTmps.pop_back(); - + // If there are still users of the alloca, the program is doing something // silly, e.g. storing the address of the alloca somewhere and using it // later. Since this is undefined, we'll just make it be null. @@ -2442,7 +2442,7 @@ Tmp->replaceAllUsesWith(Constant::getNullValue(Tmp->getType())); delete Tmp; } - + return EvalSuccess; } @@ -2454,7 +2454,7 @@ std::vector Ctors = ParseGlobalCtors(GCL); bool MadeChange = false; if (Ctors.empty()) return false; - + // Loop over global ctors, optimizing them when we can. for (unsigned i = 0; i != Ctors.size(); ++i) { Function *F = Ctors[i]; @@ -2467,10 +2467,10 @@ } break; } - + // We cannot simplify external ctor functions. if (F->empty()) continue; - + // If we can evaluate the ctor at compile time, do. if (EvaluateStaticConstructor(F)) { Ctors.erase(Ctors.begin()+i); @@ -2480,9 +2480,9 @@ continue; } } - + if (!MadeChange) return false; - + GCL = InstallGlobalCtors(GCL, Ctors); return true; } @@ -2546,21 +2546,21 @@ bool GlobalOpt::runOnModule(Module &M) { bool Changed = false; - + // Try to find the llvm.globalctors list. GlobalVariable *GlobalCtors = FindGlobalCtors(M); bool LocalChange = true; while (LocalChange) { LocalChange = false; - + // Delete functions that are trivially dead, ccc -> fastcc LocalChange |= OptimizeFunctions(M); - + // Optimize global_ctors list. if (GlobalCtors) LocalChange |= OptimizeGlobalCtorsList(GlobalCtors); - + // Optimize non-address-taken globals. LocalChange |= OptimizeGlobalVars(M); @@ -2568,9 +2568,9 @@ LocalChange |= OptimizeGlobalAliases(M); Changed |= LocalChange; } - + // TODO: Move all global ctors functions to the end of the module for code // layout. - + return Changed; } From isanbard at gmail.com Mon Oct 18 16:22:31 2010 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 18 Oct 2010 21:22:31 -0000 Subject: [llvm-commits] [llvm] r116750 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/PeepholeOptimizer.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h Message-ID: <20101018212232.08D7E2A6C12C@llvm.org> Author: void Date: Mon Oct 18 16:22:31 2010 New Revision: 116750 URL: http://llvm.org/viewvc/llvm-project?rev=116750&view=rev Log: Don't recompute MachineRegisterInfo in the Optimize* method. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=116750&r1=116749&r2=116750&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Oct 18 16:22:31 2010 @@ -600,6 +600,7 @@ /// *only* if a transformation took place. virtual bool OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int Mask, int Value, + const MachineRegisterInfo *MRI, MachineBasicBlock::iterator &) const { return false; } Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=116750&r1=116749&r2=116750&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original) +++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Mon Oct 18 16:22:31 2010 @@ -247,7 +247,7 @@ return false; // Attempt to optimize the comparison instruction. - if (TII->OptimizeCompareInstr(MI, SrcReg, CmpMask, CmpValue, NextIter)) { + if (TII->OptimizeCompareInstr(MI, SrcReg, CmpMask, CmpValue, MRI, NextIter)) { ++NumEliminated; return true; } Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=116750&r1=116749&r2=116750&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon Oct 18 16:22:31 2010 @@ -1490,13 +1490,13 @@ /// iterator *only* if a transformation took place. bool ARMBaseInstrInfo:: OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int CmpMask, - int CmpValue, MachineBasicBlock::iterator &MII) const { + int CmpValue, const MachineRegisterInfo *MRI, + MachineBasicBlock::iterator &MII) const { if (CmpValue != 0) return false; - MachineRegisterInfo &MRI = CmpInstr->getParent()->getParent()->getRegInfo(); - MachineRegisterInfo::def_iterator DI = MRI.def_begin(SrcReg); - if (llvm::next(DI) != MRI.def_end()) + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); + if (llvm::next(DI) != MRI->def_end()) // Only support one definition. return false; @@ -1506,8 +1506,8 @@ if (CmpMask != ~0) { if (!isSuitableForMask(MI, SrcReg, CmpMask, false)) { MI = 0; - for (MachineRegisterInfo::use_iterator UI = MRI.use_begin(SrcReg), - UE = MRI.use_end(); UI != UE; ++UI) { + for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(SrcReg), + UE = MRI->use_end(); UI != UE; ++UI) { if (UI->getParent() != CmpInstr->getParent()) continue; MachineInstr *PotentialAND = &*UI; if (!isSuitableForMask(PotentialAND, SrcReg, CmpMask, true)) Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=116750&r1=116749&r2=116750&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Mon Oct 18 16:22:31 2010 @@ -341,6 +341,7 @@ /// that we can remove a "comparison with zero". virtual bool OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int CmpMask, int CmpValue, + const MachineRegisterInfo *MRI, MachineBasicBlock::iterator &MII) const; virtual unsigned getNumMicroOps(const MachineInstr *MI, From gohman at apple.com Mon Oct 18 16:28:01 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 21:28:01 -0000 Subject: [llvm-commits] [llvm] r116751 - in /llvm/trunk: include/llvm/Analysis/AliasSetTracker.h lib/Analysis/AliasSetTracker.cpp test/Analysis/TypeBasedAliasAnalysis/licm.ll Message-ID: <20101018212801.231322A6C12C@llvm.org> Author: djg Date: Mon Oct 18 16:28:00 2010 New Revision: 116751 URL: http://llvm.org/viewvc/llvm-project?rev=116751&view=rev Log: Don't pass the raw invalid pointer used to represent conflicting TBAA information to AliasAnalysis. Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=116751&r1=116750&r2=116751&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Mon Oct 18 16:28:00 2010 @@ -67,7 +67,21 @@ unsigned getSize() const { return Size; } - const MDNode *getTBAAInfo() const { return TBAAInfo; } + /// getRawTBAAInfo - Return the raw TBAAInfo member. In addition to + /// being null or a pointer to an MDNode, this could be -1, meaning + /// there was conflicting information. + const MDNode *getRawTBAAInfo() const { + return TBAAInfo; + } + + /// getTBAAInfo - Return the TBAAInfo, or null if there is no + /// information or conflicting information. + const MDNode *getTBAAInfo() const { + // If we have conflicting TBAAInfo, return null. + if (TBAAInfo == reinterpret_cast(-1)) + return 0; + return TBAAInfo; + } AliasSet *getAliasSet(AliasSetTracker &AST) { assert(AS && "No AliasSet yet!"); @@ -195,6 +209,7 @@ Value *getPointer() const { return CurNode->getValue(); } unsigned getSize() const { return CurNode->getSize(); } + const MDNode *getRawTBAAInfo() const { return CurNode->getRawTBAAInfo(); } const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116751&r1=116750&r2=116751&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Mon Oct 18 16:28:00 2010 @@ -158,7 +158,8 @@ // to be sure it doesn't alias the set... for (iterator I = begin(), E = end(); I != E; ++I) if (AA.alias(AliasAnalysis::Location(Ptr, Size, TBAAInfo), - AliasAnalysis::Location(I.getPointer(), I.getSize(), I.getTBAAInfo()))) + AliasAnalysis::Location(I.getPointer(), I.getSize(), + I.getTBAAInfo()))) return true; // Check the call sites list and invoke list... @@ -376,7 +377,7 @@ bool X; for (AliasSet::iterator ASI = AS.begin(), E = AS.end(); ASI != E; ++ASI) { AliasSet &NewAS = addPointer(ASI.getPointer(), ASI.getSize(), - ASI.getTBAAInfo(), + ASI.getRawTBAAInfo(), (AliasSet::AccessType)AS.AccessTy, X); if (AS.isVolatile()) NewAS.setVolatile(); } @@ -531,7 +532,8 @@ // Add it to the alias set it aliases... I = PointerMap.find(From); AliasSet *AS = I->second->getAliasSet(*this); - AS->addPointer(*this, Entry, I->second->getSize(), I->second->getTBAAInfo(), + AS->addPointer(*this, Entry, I->second->getSize(), + I->second->getRawTBAAInfo(), true); } Modified: llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll?rev=116751&r1=116750&r2=116751&view=diff ============================================================================== --- llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll (original) +++ llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/licm.ll Mon Oct 18 16:28:00 2010 @@ -3,6 +3,7 @@ ; LICM should be able to hoist the address load out of the loop ; by using TBAA information. +; CHECK: @foo ; CHECK: entry: ; CHECK-NEXT: %tmp3 = load double** @P, !tbaa !0 ; CHECK-NEXT: br label %for.body @@ -31,3 +32,30 @@ !0 = metadata !{metadata !"root", null} !1 = metadata !{metadata !"pointer", metadata !0} !2 = metadata !{metadata !"double", metadata !0} + +; LICM shouldn't hoist anything here. + +; CHECK: @bar +; CHECK: loop: +; CHECK: load +; CHECK: store +; CHECK: load +; CHECK: store +; CHECK: br label %loop + +define void @bar(i8** %p) nounwind { +entry: + %q = bitcast i8** %p to i8* + br label %loop + +loop: + %tmp51 = load i8** %p, !tbaa !4 + store i8* %tmp51, i8** %p + %tmp40 = load i8* %q, !tbaa !5 + store i8 %tmp40, i8* %q + br label %loop +} + +!3 = metadata !{metadata !"pointer", metadata !4} +!4 = metadata !{metadata !"char", metadata !5} +!5 = metadata !{metadata !"root", null} From jason.w.kim.2009 at gmail.com Mon Oct 18 16:32:41 2010 From: jason.w.kim.2009 at gmail.com (Jason W Kim) Date: Mon, 18 Oct 2010 21:32:41 -0000 Subject: [llvm-commits] [llvm] r116753 - in /llvm/trunk/test: MC/ELF/ Scripts/ Message-ID: <20101018213241.E80FB2A6C12C@llvm.org> Author: jasonwkim Date: Mon Oct 18 16:32:41 2010 New Revision: 116753 URL: http://llvm.org/viewvc/llvm-project?rev=116753&view=rev Log: Changed elf-dump to output hex format by default. Also updated tests. Modified: llvm/trunk/test/MC/ELF/alias.s llvm/trunk/test/MC/ELF/align-bss.s llvm/trunk/test/MC/ELF/align-nops.s llvm/trunk/test/MC/ELF/align-size.s llvm/trunk/test/MC/ELF/align-text.s llvm/trunk/test/MC/ELF/align.s llvm/trunk/test/MC/ELF/basic-elf.ll llvm/trunk/test/MC/ELF/common.s llvm/trunk/test/MC/ELF/common2.s llvm/trunk/test/MC/ELF/diff.s llvm/trunk/test/MC/ELF/empty.s llvm/trunk/test/MC/ELF/entsize.ll llvm/trunk/test/MC/ELF/entsize.s llvm/trunk/test/MC/ELF/file.s llvm/trunk/test/MC/ELF/got.s llvm/trunk/test/MC/ELF/local-reloc.s llvm/trunk/test/MC/ELF/merge.s llvm/trunk/test/MC/ELF/norelocation.s llvm/trunk/test/MC/ELF/pic-diff.s llvm/trunk/test/MC/ELF/plt.s llvm/trunk/test/MC/ELF/relax.s llvm/trunk/test/MC/ELF/relocation-386.s llvm/trunk/test/MC/ELF/relocation.s llvm/trunk/test/MC/ELF/section.s llvm/trunk/test/MC/ELF/size.s llvm/trunk/test/MC/ELF/sleb.s llvm/trunk/test/MC/ELF/uleb.s llvm/trunk/test/MC/ELF/undef.s llvm/trunk/test/MC/ELF/undef2.s llvm/trunk/test/MC/ELF/weak.s llvm/trunk/test/MC/ELF/zero.s llvm/trunk/test/Scripts/elf-dump Modified: llvm/trunk/test/MC/ELF/alias.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/alias.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/alias.s (original) +++ llvm/trunk/test/MC/ELF/alias.s Mon Oct 18 16:32:41 2010 @@ -15,70 +15,70 @@ foo4: bar4 = foo4 -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 5) # 'bar' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x1 +// CHECK-NEXT: (('st_name', 0x5) # 'bar' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 2 -// CHECK-NEXT: (('st_name', 29) # 'bar4' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 2) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x2 +// CHECK-NEXT: (('st_name', 0x1d) # 'bar4' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x2) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 3 -// CHECK-NEXT: (('st_name', 1) # 'foo' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x3 +// CHECK-NEXT: (('st_name', 0x1) # 'foo' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 4 -// CHECK-NEXT: (('st_name', 14) # 'foo3' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x4 +// CHECK-NEXT: (('st_name', 0xe) # 'foo3' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 5 -// CHECK-NEXT: (('st_name', 24) # 'foo4' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 2) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x5 +// CHECK-NEXT: (('st_name', 0x18) # 'foo4' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x2) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 6 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 7 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 8 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 9 -// CHECK-NEXT: (('st_name', 19) # 'bar3' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) -// CHECK: # Symbol 10 -// CHECK-NEXT: (('st_name', 9) # 'bar2' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 0) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x6 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x7 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x8 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x9 +// CHECK-NEXT: (('st_name', 0x13) # 'bar3' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) +// CHECK: # Symbol 0xa +// CHECK-NEXT: (('st_name', 0x9) # 'bar2' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x0) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) Modified: llvm/trunk/test/MC/ELF/align-bss.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-bss.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-bss.s (original) +++ llvm/trunk/test/MC/ELF/align-bss.s Mon Oct 18 16:32:41 2010 @@ -5,13 +5,13 @@ .local foo .comm foo,2048,16 -// CHECK: ('sh_name', 13) # '.bss' -// CHECK-NEXT: ('sh_type', 8) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 2048) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 16) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: ('sh_name', 0xd) # '.bss' +// CHECK-NEXT: ('sh_type', 0x8) +// CHECK-NEXT: ('sh_flags', 0x3) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x800) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x10) +// CHECK-NEXT: ('sh_entsize', 0x0) Modified: llvm/trunk/test/MC/ELF/align-nops.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-nops.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-nops.s (original) +++ llvm/trunk/test/MC/ELF/align-nops.s Mon Oct 18 16:32:41 2010 @@ -15,26 +15,26 @@ .long 0 .align 8 -// CHECK: (('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) +// CHECK: (('sh_name', 0x1) # '.text' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x6) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: ('sh_size', 0x10) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x8) +// CHECK-NEXT: ('sh_entsize', 0x0) // CHECK-NEXT: ('_section_data', '00000000 0f1f4000 00000000 0f1f4000') -// CHECK: (('sh_name', 7) # '.data' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 3) +// CHECK: (('sh_name', 0x7) # '.data' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x3) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: ('sh_size', 0x10) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x8) +// CHECK-NEXT: ('sh_entsize', 0x0) // CHECK-NEXT: ('_section_data', '00000000 90909090 00000000 00000000') Modified: llvm/trunk/test/MC/ELF/align-size.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-size.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-size.s (original) +++ llvm/trunk/test/MC/ELF/align-size.s Mon Oct 18 16:32:41 2010 @@ -5,9 +5,9 @@ .zero 4 .align 8 -// CHECK: (('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 8) +// CHECK: (('sh_name', 0x1) # '.text' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x6) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x8) Modified: llvm/trunk/test/MC/ELF/align-text.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-text.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-text.s (original) +++ llvm/trunk/test/MC/ELF/align-text.s Mon Oct 18 16:32:41 2010 @@ -6,14 +6,14 @@ .text .zero 1 -// CHECK: (('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 2) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: (('sh_name', 0x1) # '.text' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x6) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x2) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) // CHECK-NEXT: ), Modified: llvm/trunk/test/MC/ELF/align.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align.s (original) +++ llvm/trunk/test/MC/ELF/align.s Mon Oct 18 16:32:41 2010 @@ -7,26 +7,26 @@ .section .rodata,"a", at progbits .align 8 -// CHECK: # Section 3 -// CHECK-NEXT: (('sh_name', 13) # '.bss' -// CHECK-NEXT: ('sh_type', 8) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 68) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: # Section 0x3 +// CHECK-NEXT: (('sh_name', 0xd) # '.bss' +// CHECK-NEXT: ('sh_type', 0x8) +// CHECK-NEXT: ('sh_flags', 0x3) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x44) +// CHECK-NEXT: ('sh_size', 0x0) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Section 4 -// CHECK-NEXT: (('sh_name', 18) # '.rodata' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 2) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 72) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: # Section 0x4 +// CHECK-NEXT: (('sh_name', 0x12) # '.rodata' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x2) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x48) +// CHECK-NEXT: ('sh_size', 0x0) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x8) +// CHECK-NEXT: ('sh_entsize', 0x0) Modified: llvm/trunk/test/MC/ELF/basic-elf.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/basic-elf.ll?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/basic-elf.ll (original) +++ llvm/trunk/test/MC/ELF/basic-elf.ll Mon Oct 18 16:32:41 2010 @@ -12,100 +12,100 @@ declare i32 @puts(i8* nocapture) nounwind -; 32: ('e_indent[EI_CLASS]', 1) -; 32: ('e_indent[EI_DATA]', 1) -; 32: ('e_indent[EI_VERSION]', 1) +; 32: ('e_indent[EI_CLASS]', 0x1) +; 32: ('e_indent[EI_DATA]', 0x1) +; 32: ('e_indent[EI_VERSION]', 0x1) ; 32: ('_sections', [ ; 32: # Section 0 -; 32: (('sh_name', 0) # '' +; 32: (('sh_name', 0x0) # '' ; 32: # '.text' -; 32: ('st_bind', 0) -; 32: ('st_type', 3) +; 32: ('st_bind', 0x0) +; 32: ('st_type', 0x3) -; 32: ('st_bind', 0) -; 32: ('st_type', 3) +; 32: ('st_bind', 0x0) +; 32: ('st_type', 0x3) -; 32: ('st_bind', 0) -; 32: ('st_type', 3) +; 32: ('st_bind', 0x0) +; 32: ('st_type', 0x3) ; 32: # 'main' -; 32: ('st_bind', 1) -; 32-NEXT: ('st_type', 2) +; 32: ('st_bind', 0x1) +; 32-NEXT: ('st_type', 0x2) ; 32: # 'puts' -; 32: ('st_bind', 1) -; 32-NEXT: ('st_type', 0) +; 32: ('st_bind', 0x1) +; 32-NEXT: ('st_type', 0x0) ; 32: # '.rel.text' ; 32: ('_relocations', [ -; 32: # Relocation 0 -; 32: (('r_offset', 6) -; 32: ('r_type', 1) +; 32: # Relocation 0x0 +; 32: (('r_offset', 0x6) +; 32: ('r_type', 0x1) ; 32: ), -; 32: # Relocation 1 -; 32: (('r_offset', 11) -; 32: ('r_type', 2) +; 32: # Relocation 0x1 +; 32: (('r_offset', 0xb) +; 32: ('r_type', 0x2) ; 32: ), -; 32: # Relocation 2 -; 32: (('r_offset', 18) -; 32: ('r_type', 1) +; 32: # Relocation 0x2 +; 32: (('r_offset', 0x12) +; 32: ('r_type', 0x1) ; 32: ), -; 32: # Relocation 3 -; 32: (('r_offset', 23) -; 32: ('r_type', 2) +; 32: # Relocation 0x3 +; 32: (('r_offset', 0x17) +; 32: ('r_type', 0x2) ; 32: ), ; 32: ]) -; 64: ('e_indent[EI_CLASS]', 2) -; 64: ('e_indent[EI_DATA]', 1) -; 64: ('e_indent[EI_VERSION]', 1) +; 64: ('e_indent[EI_CLASS]', 0x2) +; 64: ('e_indent[EI_DATA]', 0x1) +; 64: ('e_indent[EI_VERSION]', 0x1) ; 64: ('_sections', [ ; 64: # Section 0 -; 64: (('sh_name', 0) # '' +; 64: (('sh_name', 0x0) # '' ; 64: # '.text' -; 64: ('st_bind', 0) -; 64: ('st_type', 3) +; 64: ('st_bind', 0x0) +; 64: ('st_type', 0x3) -; 64: ('st_bind', 0) -; 64: ('st_type', 3) +; 64: ('st_bind', 0x0) +; 64: ('st_type', 0x3) -; 64: ('st_bind', 0) -; 64: ('st_type', 3) +; 64: ('st_bind', 0x0) +; 64: ('st_type', 0x3) ; 64: # 'main' -; 64-NEXT: ('st_bind', 1) -; 64-NEXT: ('st_type', 2) +; 64-NEXT: ('st_bind', 0x1) +; 64-NEXT: ('st_type', 0x2) ; 64: # 'puts' -; 64-NEXT: ('st_bind', 1) -; 64-NEXT: ('st_type', 0) +; 64-NEXT: ('st_bind', 0x1) +; 64-NEXT: ('st_type', 0x0) ; 64: # '.rela.text' ; 64: ('_relocations', [ -; 64: # Relocation 0 -; 64: (('r_offset', 5) -; 64: ('r_type', 10) -; 64: ('r_addend', 0) +; 64: # Relocation 0x0 +; 64: (('r_offset', 0x5) +; 64: ('r_type', 0xa) +; 64: ('r_addend', 0x0) ; 64: ), -; 64: # Relocation 1 -; 64: (('r_offset', 10) -; 64: ('r_type', 2) -; 64: ('r_addend', -4) +; 64: # Relocation 0x1 +; 64: (('r_offset', 0xa) +; 64: ('r_type', 0x2) +; 64: ('r_addend', -0x4) ; 64: ), -; 64: # Relocation 2 -; 64: (('r_offset', 15) -; 64: ('r_type', 10) -; 64: ('r_addend', 6) +; 64: # Relocation 0x2 +; 64: (('r_offset', 0xf) +; 64: ('r_type', 0xa) +; 64: ('r_addend', 0x6) ; 64: ), -; 64: # Relocation 3 -; 64: (('r_offset', 20) -; 64: ('r_type', 2) -; 64: ('r_addend', -4) +; 64: # Relocation 0x3 +; 64: (('r_offset', 0x14) +; 64: ('r_type', 0x2) +; 64: ('r_addend', -0x4) ; 64: ), ; 64: ]) Modified: llvm/trunk/test/MC/ELF/common.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/common.s (original) +++ llvm/trunk/test/MC/ELF/common.s Mon Oct 18 16:32:41 2010 @@ -8,13 +8,13 @@ .local common1 .comm common1,1,1 -// CHECK: ('st_name', 1) # 'common1' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) +// CHECK: ('st_name', 0x1) # 'common1' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x1) +// CHECK-NEXT: ('st_other', 0x0) // CHECK-NEXT: ('st_shndx', -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x1) // Same as common1, but with directives in a different order. @@ -22,25 +22,25 @@ .type common2, at object .comm common2,1,1 -// CHECK: ('st_name', 9) # 'common2' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) +// CHECK: ('st_name', 0x9) # 'common2' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x1) +// CHECK-NEXT: ('st_other', 0x0) // CHECK-NEXT: ('st_shndx', -// CHECK-NEXT: ('st_value', 1) -// CHECK-NEXT: ('st_size', 1) +// CHECK-NEXT: ('st_value', 0x1) +// CHECK-NEXT: ('st_size', 0x1) // Test that without an explicit .local we produce a global. .type common3, at object .comm common3,4,4 -// CHECK: ('st_name', 17) # 'common3' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 65522) -// CHECK-NEXT: ('st_value', 4) -// CHECK-NEXT: ('st_size', 4) +// CHECK: ('st_name', 0x11) # 'common3' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK-NEXT: ('st_type', 0x1) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0xfff2) +// CHECK-NEXT: ('st_value', 0x4) +// CHECK-NEXT: ('st_size', 0x4) // Test that without an explicit .local we produce a global, even if the first @@ -54,10 +54,10 @@ .type common4, at object .comm common4,40,16 -// CHECK: ('st_name', 29) # 'common4' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 65522) -// CHECK-NEXT: ('st_value', 16) -// CHECK-NEXT: ('st_size', 40) +// CHECK: ('st_name', 0x1d) # 'common4' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK-NEXT: ('st_type', 0x1) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0xfff2) +// CHECK-NEXT: ('st_value', 0x10) +// CHECK-NEXT: ('st_size', 0x28) Modified: llvm/trunk/test/MC/ELF/common2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common2.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/common2.s (original) +++ llvm/trunk/test/MC/ELF/common2.s Mon Oct 18 16:32:41 2010 @@ -9,12 +9,12 @@ .zero 1 .align 8 -// CHECK: (('sh_name', 13) # '.bss' +// CHECK: (('sh_name', 0xd) # '.bss' // CHECK-NEXT: ('sh_type', // CHECK-NEXT: ('sh_flags' // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 9) +// CHECK-NEXT: ('sh_size', 0x9) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', // CHECK-NEXT: ('sh_addralign', Modified: llvm/trunk/test/MC/ELF/diff.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/diff.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/diff.s (original) +++ llvm/trunk/test/MC/ELF/diff.s Mon Oct 18 16:32:41 2010 @@ -8,8 +8,8 @@ zed: mov zed+(bar-foo), %eax -// CHECK: # Relocation 0 -// CHECK-NEXT: (('r_offset', 5) -// CHECK-NEXT: ('r_sym', 6) -// CHECK-NEXT: ('r_type', 11) -// CHECK-NEXT: ('r_addend', 1) +// CHECK: # Relocation 0x0 +// CHECK-NEXT: (('r_offset', 0x5) +// CHECK-NEXT: ('r_sym', 0x6) +// CHECK-NEXT: ('r_type', 0xb) +// CHECK-NEXT: ('r_addend', 0x1) Modified: llvm/trunk/test/MC/ELF/empty.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/empty.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/empty.s (original) +++ llvm/trunk/test/MC/ELF/empty.s Mon Oct 18 16:32:41 2010 @@ -3,68 +3,68 @@ // Test that like gnu as we create text, data and bss by default. Also test // that shstrtab, symtab and strtab are listed in that order. -// CHECK: ('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 7) # '.data' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 13) # '.bss' -// CHECK-NEXT: ('sh_type', 8) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 18) # '.shstrtab' -// CHECK-NEXT: ('sh_type', 3) -// CHECK-NEXT: ('sh_flags', 0) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 44) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 28) # '.symtab' -// CHECK-NEXT: ('sh_type', 2) -// CHECK-NEXT: ('sh_flags', 0) -// CHECK-NEXT: ('sh_addr', 0) +// CHECK: ('sh_name', 0x1) # '.text' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x6) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x0) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) + +// CHECK: ('sh_name', 0x7) # '.data' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x3) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x0) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) + +// CHECK: ('sh_name', 0xd) # '.bss' +// CHECK-NEXT: ('sh_type', 0x8) +// CHECK-NEXT: ('sh_flags', 0x3) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x0) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) + +// CHECK: ('sh_name', 0x12) # '.shstrtab' +// CHECK-NEXT: ('sh_type', 0x3) +// CHECK-NEXT: ('sh_flags', 0x0) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x2c) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x1) +// CHECK-NEXT: ('sh_entsize', 0x0) + +// CHECK: ('sh_name', 0x1c) # '.symtab' +// CHECK-NEXT: ('sh_type', 0x2) +// CHECK-NEXT: ('sh_flags', 0x0) +// CHECK-NEXT: ('sh_addr', 0x0) // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 96) -// CHECK-NEXT: ('sh_link', 6) -// CHECK-NEXT: ('sh_info', 4) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 24) - -// CHECK: ('sh_name', 36) # '.strtab' -// CHECK-NEXT: ('sh_type', 3) -// CHECK-NEXT: ('sh_flags', 0) -// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_size', 0x60) +// CHECK-NEXT: ('sh_link', 0x6) +// CHECK-NEXT: ('sh_info', 0x4) +// CHECK-NEXT: ('sh_addralign', 0x8) +// CHECK-NEXT: ('sh_entsize', 0x18) + +// CHECK: ('sh_name', 0x24) # '.strtab' +// CHECK-NEXT: ('sh_type', 0x3) +// CHECK-NEXT: ('sh_flags', 0x0) +// CHECK-NEXT: ('sh_addr', 0x0) // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 1) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: ('sh_size', 0x1) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x1) +// CHECK-NEXT: ('sh_entsize', 0x0) Modified: llvm/trunk/test/MC/ELF/entsize.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/entsize.ll?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/entsize.ll (original) +++ llvm/trunk/test/MC/ELF/entsize.ll Mon Oct 18 16:32:41 2010 @@ -20,25 +20,25 @@ ;;;;; -; 64: (('sh_name', 18) # '.rodata.str1.1' -; 64-NEXT: ('sh_type', 1) -; 64-NEXT: ('sh_flags', 50) +; 64: (('sh_name', 0x12) # '.rodata.str1.1' +; 64-NEXT: ('sh_type', 0x1) +; 64-NEXT: ('sh_flags', 0x32) ; 64-NEXT: ('sh_addr', ; 64-NEXT: ('sh_offset', -; 64-NEXT: ('sh_size', 13) +; 64-NEXT: ('sh_size', 0xd) ; 64-NEXT: ('sh_link', ; 64-NEXT: ('sh_info', -; 64-NEXT: ('sh_addralign', 1) -; 64-NEXT: ('sh_entsize', 1) +; 64-NEXT: ('sh_addralign', 0x1) +; 64-NEXT: ('sh_entsize', 0x1) -; 64: (('sh_name', 33) # '.rodata.cst8' -; 64-NEXT: ('sh_type', 1) -; 64-NEXT: ('sh_flags', 18) +; 64: (('sh_name', 0x21) # '.rodata.cst8' +; 64-NEXT: ('sh_type', 0x1) +; 64-NEXT: ('sh_flags', 0x12) ; 64-NEXT: ('sh_addr', ; 64-NEXT: ('sh_offset', -; 64-NEXT: ('sh_size', 16) +; 64-NEXT: ('sh_size', 0x10) ; 64-NEXT: ('sh_link', ; 64-NEXT: ('sh_info', -; 64-NEXT: ('sh_addralign', 8) -; 64-NEXT: ('sh_entsize', 8) +; 64-NEXT: ('sh_addralign', 0x8) +; 64-NEXT: ('sh_entsize', 0x8) Modified: llvm/trunk/test/MC/ELF/entsize.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/entsize.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/entsize.s (original) +++ llvm/trunk/test/MC/ELF/entsize.s Mon Oct 18 16:32:41 2010 @@ -32,38 +32,38 @@ .quad 42 .quad 42 -// CHECK: # Section 4 -// CHECK-NEXT: ('sh_name', 18) # '.rodata.str1.1' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 50) +// CHECK: # Section 0x4 +// CHECK-NEXT: ('sh_name', 0x12) # '.rodata.str1.1' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x32) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 13) +// CHECK-NEXT: ('sh_size', 0xd) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 1) +// CHECK-NEXT: ('sh_addralign', 0x1) +// CHECK-NEXT: ('sh_entsize', 0x1) -// CHECK: # Section 5 -// CHECK-NEXT: ('sh_name', 33) # '.rodata.str2.1' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 50) +// CHECK: # Section 0x5 +// CHECK-NEXT: ('sh_name', 0x21) # '.rodata.str2.1' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x32) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) +// CHECK-NEXT: ('sh_size', 0x10) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 2) +// CHECK-NEXT: ('sh_addralign', 0x1) +// CHECK-NEXT: ('sh_entsize', 0x2) -// CHECK: # Section 6 -// CHECK-NEXT: ('sh_name', 48) # '.rodata.cst8 -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 18) +// CHECK: # Section 0x6 +// CHECK-NEXT: ('sh_name', 0x30) # '.rodata.cst8 +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x12) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) +// CHECK-NEXT: ('sh_size', 0x10) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 8) +// CHECK-NEXT: ('sh_addralign', 0x1) +// CHECK-NEXT: ('sh_entsize', 0x8) Modified: llvm/trunk/test/MC/ELF/file.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/file.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/file.s (original) +++ llvm/trunk/test/MC/ELF/file.s Mon Oct 18 16:32:41 2010 @@ -4,20 +4,20 @@ .file "foo" foa: -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 1) # 'foo' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 4) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 65521) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x1 +// CHECK-NEXT: (('st_name', 0x1) # 'foo' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x4) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0xfff1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 2 -// CHECK-NEXT: (('st_name', 5) # 'foa' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x2 +// CHECK-NEXT: (('st_name', 0x5) # 'foa' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) Modified: llvm/trunk/test/MC/ELF/got.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/got.s (original) +++ llvm/trunk/test/MC/ELF/got.s Mon Oct 18 16:32:41 2010 @@ -6,20 +6,20 @@ movl foo at GOT, %eax movl foo at GOTPCREL(%rip), %eax -// CHECK: (('st_name', 5) # '_GLOBAL_OFFSET_TABLE_' -// CHECK-NEXT: ('st_bind', 1) +// CHECK: (('st_name', 0x5) # '_GLOBAL_OFFSET_TABLE_' +// CHECK-NEXT: ('st_bind', 0x1) // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: # Relocation 0x0 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 3) +// CHECK-NEXT: ('r_type', 0x3) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: # Relocation 0x1 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 9) +// CHECK-NEXT: ('r_type', 0x9) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/local-reloc.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/local-reloc.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/local-reloc.s (original) +++ llvm/trunk/test/MC/ELF/local-reloc.s Mon Oct 18 16:32:41 2010 @@ -7,24 +7,24 @@ foo: // Section number 1 is .text -// CHECK: # Section 1 -// CHECK-next: (('sh_name', 1) # '.text' +// CHECK: # Section 0x1 +// CHECK-next: (('sh_name', 0x1) # '.text' // Symbol number 2 is section number 1 -// CHECK: # Symbol 2 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 3) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x2 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x3) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x1) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // Relocation refers to symbol number 2 // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: # Relocation 0x0 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_sym', 0x2) // CHECK-NEXT: ('r_type', // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), Modified: llvm/trunk/test/MC/ELF/merge.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/merge.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/merge.s (original) +++ llvm/trunk/test/MC/ELF/merge.s Mon Oct 18 16:32:41 2010 @@ -23,75 +23,75 @@ foo: // Section 4 is "sec1" -// CHECK: # Section 4 -// CHECK-NEXT: (('sh_name', 18) # '.sec1' +// CHECK: # Section 0x4 +// CHECK-NEXT: (('sh_name', 0x12) # '.sec1' // Symbol number 1 is .Lfoo -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 1) # '.Lfoo' +// CHECK: # Symbol 0x1 +// CHECK-NEXT: (('st_name', 0x1) # '.Lfoo' // Symbol number 2 is foo -// CHECK: # Symbol 2 -// CHECK-NEXT: (('st_name', 7) # 'foo' +// CHECK: # Symbol 0x2 +// CHECK-NEXT: (('st_name', 0x7) # 'foo' // Symbol number 6 is section 4 -// CHECK: # Symbol 6 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 3) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 4) +// CHECK: # Symbol 0x6 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x3) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x4) // Symbol number 8 is zed -// CHECK: # Symbol 8 -// CHECK-NEXT: (('st_name', 11) # 'zed' +// CHECK: # Symbol 0x8 +// CHECK-NEXT: (('st_name', 0xb) # 'zed' // Relocation 0 refers to symbol 1 // CHECK: ('_relocations', [ // CHECK-NEXT: # Relocation 0 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 1) -// CHECK-NEXT: ('r_type', 2 +// CHECK-NEXT: ('r_sym', 0x1) +// CHECK-NEXT: ('r_type', 0x2 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 1 refers to symbol 6 -// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: # Relocation 0x1 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 6) -// CHECK-NEXT: ('r_type', 10) +// CHECK-NEXT: ('r_sym', 0x6) +// CHECK-NEXT: ('r_type', 0xa) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 2 refers to symbol 1 -// CHECK-NEXT: # Relocation 2 +// CHECK-NEXT: # Relocation 0x2 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 1) -// CHECK-NEXT: ('r_type', 10 +// CHECK-NEXT: ('r_sym', 0x1) +// CHECK-NEXT: ('r_type', 0xa // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 3 refers to symbol 2 -// CHECK-NEXT: # Relocation 3 +// CHECK-NEXT: # Relocation 0x3 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 4 +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0x4 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 4 refers to symbol 2 -// CHECK-NEXT: # Relocation 4 +// CHECK-NEXT: # Relocation 0x4 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 9 +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0x9 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 5 refers to symbol 8 -// CHECK-NEXT: # Relocation 5 -// CHECK-NEXT: (('r_offset', 35) -// CHECK-NEXT: ('r_sym', 8) -// CHECK-NEXT: ('r_type', 11) -// CHECK-NEXT: ('r_addend', 0) +// CHECK-NEXT: # Relocation 0x5 +// CHECK-NEXT: (('r_offset', 0x23) +// CHECK-NEXT: ('r_sym', 0x8) +// CHECK-NEXT: ('r_type', 0xb) +// CHECK-NEXT: ('r_addend', 0x0) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/norelocation.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/norelocation.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/norelocation.s (original) +++ llvm/trunk/test/MC/ELF/norelocation.s Mon Oct 18 16:32:41 2010 @@ -3,16 +3,16 @@ call bar bar: -// CHECK: ('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 5) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x1) # '.text' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x6) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x5) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) // CHECK-NEXT: ('_section_data', 'e8000000 00') // CHECK-NOT: .rela.text // CHECK: shstrtab Modified: llvm/trunk/test/MC/ELF/pic-diff.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/pic-diff.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/pic-diff.s (original) +++ llvm/trunk/test/MC/ELF/pic-diff.s Mon Oct 18 16:32:41 2010 @@ -1,21 +1,21 @@ // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s -// CHECK: # Symbol 5 -// CHECK-NEXT: (('st_name', 5) # 'baz' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 0) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x5 +// CHECK-NEXT: (('st_name', 0x5) # 'baz' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK-NEXT: ('st_type', 0x0) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x0) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 -// CHECK-NEXT: (('r_offset', 12) -// CHECK-NEXT: ('r_sym', 5) -// CHECK-NEXT: ('r_type', 2) -// CHECK-NEXT: ('r_addend', 8) +// CHECK-NEXT: # Relocation 0x0 +// CHECK-NEXT: (('r_offset', 0xc) +// CHECK-NEXT: ('r_sym', 0x5) +// CHECK-NEXT: ('r_type', 0x2) +// CHECK-NEXT: ('r_addend', 0x8) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/plt.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/plt.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/plt.s (original) +++ llvm/trunk/test/MC/ELF/plt.s Mon Oct 18 16:32:41 2010 @@ -5,10 +5,10 @@ jmp foo at PLT // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: # Relocation 0x0 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 4) +// CHECK-NEXT: ('r_type', 0x4) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/relax.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relax.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relax.s (original) +++ llvm/trunk/test/MC/ELF/relax.s Mon Oct 18 16:32:41 2010 @@ -12,27 +12,27 @@ jmp bar jmp foo -// CHECK: ('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 7) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x1) # '.text' +// CHECK-NEXT: ('sh_type', 0x1) +// CHECK-NEXT: ('sh_flags', 0x6) +// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_offset', 0x40) +// CHECK-NEXT: ('sh_size', 0x7) +// CHECK-NEXT: ('sh_link', 0x0) +// CHECK-NEXT: ('sh_info', 0x0) +// CHECK-NEXT: ('sh_addralign', 0x4) +// CHECK-NEXT: ('sh_entsize', 0x0) // CHECK-NEXT: ('_section_data', 'ebfee900 000000') -// CHECK: # Symbol 5 -// CHECK-NEXT: (('st_name', 5) # 'foo' +// CHECK: # Symbol 0x5 +// CHECK-NEXT: (('st_name', 0x5) # 'foo' // CHECK: .rela.text // CHECK: ('_relocations', [ -// CHECK-NEXT: Relocation 0 -// CHECK-NEXT: (('r_offset', 3) -// CHECK-NEXT: ('r_sym', 5) -// CHECK-NEXT: ('r_type', 2) -// CHECK-NEXT: ('r_addend', -4) +// CHECK-NEXT: Relocation 0x0 +// CHECK-NEXT: (('r_offset', 0x3) +// CHECK-NEXT: ('r_sym', 0x5) +// CHECK-NEXT: ('r_type', 0x2) +// CHECK-NEXT: ('r_addend', -0x4) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 16:32:41 2010 @@ -4,50 +4,50 @@ // to .Lfoo uses the symbol and not the section. // Section 3 is bss -// CHECK: # Section 3 -// CHECK-NEXT: (('sh_name', 13) # '.bss' +// CHECK: # Section 0x3 +// CHECK-NEXT: (('sh_name', 0xd) # '.bss' -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 5) # '.Lfoo' +// CHECK: # Symbol 0x1 +// CHECK-NEXT: (('st_name', 0x5) # '.Lfoo' // Symbol 6 is section 3 -// CHECK: # Symbol 6 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 3) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 3) - -// CHECK: # Relocation 0 -// CHECK-NEXT: (('r_offset', 2) -// CHECK-NEXT: ('r_sym', 1) -// CHECK-NEXT: ('r_type', 9) +// CHECK: # Symbol 0x6 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: ('st_bind', 0x0) +// CHECK-NEXT: ('st_type', 0x3) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x3) + +// CHECK: # Relocation 0x0 +// CHECK-NEXT: (('r_offset', 0x2) +// CHECK-NEXT: ('r_sym', 0x1) +// CHECK-NEXT: ('r_type', 0x9) // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: # Relocation 0x1 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 4) +// CHECK-NEXT: ('r_type', 0x4) // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 2 +// CHECK-NEXT: # Relocation 0x2 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 10) +// CHECK-NEXT: ('r_type', 0xa) // CHECK-NEXT: ), // Relocation 3 (bar3 at GOTOFF) is done with symbol 6 (bss) -// CHECK-NEXT: # Relocation 3 +// CHECK-NEXT: # Relocation 0x3 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 6 +// CHECK-NEXT: ('r_sym', 0x6 // CHECK-NEXT: ('r_type', // CHECK-NEXT: ), // Relocation 4 (bar2 at GOT) is of type R_386_GOT32 -// CHECK-NEXT: # Relocation 4 +// CHECK-NEXT: # Relocation 0x4 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 3 +// CHECK-NEXT: ('r_type', 0x3 // CHECK-NEXT: ), .text Modified: llvm/trunk/test/MC/ELF/relocation.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation.s (original) +++ llvm/trunk/test/MC/ELF/relocation.s Mon Oct 18 16:32:41 2010 @@ -10,48 +10,48 @@ movq bar, %rdx // R_X86_64_32S .long bar // R_X86_64_32 -// CHECK: # Section 1 -// CHECK: (('sh_name', 1) # '.text' +// CHECK: # Section 0x1 +// CHECK: (('sh_name', 0x1) # '.text' -// CHECK: # Symbol 2 -// CHECK: (('st_name', 0) # '' -// CHECK: ('st_bind', 0) -// CHECK ('st_type', 3) -// CHECK: ('st_other', 0) -// CHECK: ('st_shndx', 1) +// CHECK: # Symbol 0x2 +// CHECK: (('st_name', 0x0) # '' +// CHECK: ('st_bind', 0x0) +// CHECK ('st_type', 0x3) +// CHECK: ('st_other', 0x0) +// CHECK: ('st_shndx', 0x1) -// CHECK: # Relocation 0 -// CHECK-NEXT: (('r_offset', 1) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 10) +// CHECK: # Relocation 0x0 +// CHECK-NEXT: (('r_offset', 0x1) +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0xa) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 1 -// CHECK-NEXT: (('r_offset', 8) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x1 +// CHECK-NEXT: (('r_offset', 0x8) +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0xb) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 2 -// CHECK-NEXT: (('r_offset', 19) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x2 +// CHECK-NEXT: (('r_offset', 0x13) +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0xb) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 3 -// CHECK-NEXT: (('r_offset', 26) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x3 +// CHECK-NEXT: (('r_offset', 0x1a) +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0xb) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 4 -// CHECK-NEXT: (('r_offset', 34) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x4 +// CHECK-NEXT: (('r_offset', 0x22) +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0xb) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 5 -// CHECK-NEXT: (('r_offset', 38) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 10) +// CHECK: # Relocation 0x5 +// CHECK-NEXT: (('r_offset', 0x26) +// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_type', 0xa) // CHECK-NEXT: ('r_addend', Modified: llvm/trunk/test/MC/ELF/section.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/section.s (original) +++ llvm/trunk/test/MC/ELF/section.s Mon Oct 18 16:32:41 2010 @@ -6,6 +6,6 @@ .section .note.GNU-,"", at progbits .section -.note.GNU,"", at progbits -// CHECK: ('sh_name', 18) # '.note.GNU-stack' -// CHECK: ('sh_name', 34) # '.note.GNU-' -// CHECK: ('sh_name', 45) # '-.note.GNU' +// CHECK: ('sh_name', 0x12) # '.note.GNU-stack' +// CHECK: ('sh_name', 0x22) # '.note.GNU-' +// CHECK: ('sh_name', 0x2d) # '-.note.GNU' Modified: llvm/trunk/test/MC/ELF/size.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/size.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/size.s (original) +++ llvm/trunk/test/MC/ELF/size.s Mon Oct 18 16:32:41 2010 @@ -2,8 +2,8 @@ // Mostly a test that this doesn't crash anymore. -// CHECK: # Symbol 4 -// CHECK-NEXT: (('st_name', 1) # 'foo' -// CHECK-NEXT: ('st_bind', 1) +// CHECK: # Symbol 0x4 +// CHECK-NEXT: (('st_name', 0x1) # 'foo' +// CHECK-NEXT: ('st_bind', 0x1) .size foo, .Lbar-foo Modified: llvm/trunk/test/MC/ELF/sleb.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/sleb.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/sleb.s (original) +++ llvm/trunk/test/MC/ELF/sleb.s Mon Oct 18 16:32:41 2010 @@ -19,9 +19,9 @@ .sleb128 8193 -// ELF_32: ('sh_name', 1) # '.text' +// ELF_32: ('sh_name', 0x1) # '.text' // ELF_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') -// ELF_64: ('sh_name', 1) # '.text' +// ELF_64: ('sh_name', 0x1) # '.text' // ELF_64: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // MACHO_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') Modified: llvm/trunk/test/MC/ELF/uleb.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/uleb.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/uleb.s (original) +++ llvm/trunk/test/MC/ELF/uleb.s Mon Oct 18 16:32:41 2010 @@ -12,9 +12,9 @@ .uleb128 16383 .uleb128 16384 -// ELF_32: ('sh_name', 1) # '.text' +// ELF_32: ('sh_name', 0x1) # '.text' // ELF_32: ('_section_data', '00017f80 01ff7f80 8001') -// ELF_64: ('sh_name', 1) # '.text' +// ELF_64: ('sh_name', 0x1) # '.text' // ELF_64: ('_section_data', '00017f80 01ff7f80 8001') // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // MACHO_32: ('_section_data', '00017f80 01ff7f80 8001') Modified: llvm/trunk/test/MC/ELF/undef.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/undef.s (original) +++ llvm/trunk/test/MC/ELF/undef.s Mon Oct 18 16:32:41 2010 @@ -19,27 +19,27 @@ movsd .Lsym8(%rip), %xmm1 // CHECK: ('_symbols', [ -// CHECK-NEXT: # Symbol 0 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 13) # '.Lsym8' -// CHECK: # Symbol 2 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 3 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 4 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 5 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 6 -// CHECK-NEXT: (('st_name', 1) # '.Lsym1' -// CHECK: # Symbol 7 -// CHECK-NEXT: (('st_name', 8) # 'sym6' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 0) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x0 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x1 +// CHECK-NEXT: (('st_name', 0xd) # '.Lsym8' +// CHECK: # Symbol 0x2 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x3 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x4 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x5 +// CHECK-NEXT: (('st_name', 0x0) # '' +// CHECK: # Symbol 0x6 +// CHECK-NEXT: (('st_name', 0x1) # '.Lsym1' +// CHECK: # Symbol 0x7 +// CHECK-NEXT: (('st_name', 0x8) # 'sym6' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK-NEXT: ('st_type', 0x1) +// CHECK-NEXT: ('st_other', 0x0) +// CHECK-NEXT: ('st_shndx', 0x0) +// CHECK-NEXT: ('st_value', 0x0) +// CHECK-NEXT: ('st_size', 0x0) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/undef2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef2.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/undef2.s (original) +++ llvm/trunk/test/MC/ELF/undef2.s Mon Oct 18 16:32:41 2010 @@ -5,6 +5,6 @@ je .Lfoo // CHECK: ('_symbols', [ -// CHECK: (('st_name', 1) # '.Lfoo' -// CHECK-NEXT: ('st_bind', 1) -// CHECK: (('sh_name', 36) # '.strtab' +// CHECK: (('st_name', 0x1) # '.Lfoo' +// CHECK-NEXT: ('st_bind', 0x1) +// CHECK: (('sh_name', 0x24) # '.strtab' Modified: llvm/trunk/test/MC/ELF/weak.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/weak.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/weak.s (original) +++ llvm/trunk/test/MC/ELF/weak.s Mon Oct 18 16:32:41 2010 @@ -9,22 +9,22 @@ .weak bar bar: -//CHECK: # Symbol 4 -//CHECK-NEXT: (('st_name', 5) # 'bar' -//CHECK-NEXT: ('st_bind', 2) -//CHECK-NEXT: ('st_type', 0) -//CHECK-NEXT: ('st_other', 0) -//CHECK-NEXT: ('st_shndx', 1) -//CHECK-NEXT: ('st_value', 0) -//CHECK-NEXT: ('st_size', 0) +//CHECK: # Symbol 0x4 +//CHECK-NEXT: (('st_name', 0x5) # 'bar' +//CHECK-NEXT: ('st_bind', 0x2) +//CHECK-NEXT: ('st_type', 0x0) +//CHECK-NEXT: ('st_other', 0x0) +//CHECK-NEXT: ('st_shndx', 0x1) +//CHECK-NEXT: ('st_value', 0x0) +//CHECK-NEXT: ('st_size', 0x0) //CHECK-NEXT: ), -//CHECK-NEXT: # Symbol 5 -//CHECK: (('st_name', 1) # 'foo' -//CHECK-NEXT: ('st_bind', 2) -//CHECK-NEXT: ('st_type', 0) -//CHECK-NEXT: ('st_other', 0) -//CHECK-NEXT: ('st_shndx', 0) -//CHECK-NEXT: ('st_value', 0) -//CHECK-NEXT: ('st_size', 0) +//CHECK-NEXT: # Symbol 0x5 +//CHECK: (('st_name', 0x1) # 'foo' +//CHECK-NEXT: ('st_bind', 0x2) +//CHECK-NEXT: ('st_type', 0x0) +//CHECK-NEXT: ('st_other', 0x0) +//CHECK-NEXT: ('st_shndx', 0x0) +//CHECK-NEXT: ('st_value', 0x0) +//CHECK-NEXT: ('st_size', 0x0) //CHECK-NEXT: ), //CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/zero.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/zero.s?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/zero.s (original) +++ llvm/trunk/test/MC/ELF/zero.s Mon Oct 18 16:32:41 2010 @@ -3,14 +3,14 @@ .zero 4 .zero 1,42 -// CHECK: ('sh_name', 1) # '.text' -// CHECK: ('sh_type', 1) -// CHECK: ('sh_flags', 6) -// CHECK: ('sh_addr', 0) -// CHECK: ('sh_offset', 64) -// CHECK: ('sh_size', 5) -// CHECK: ('sh_link', 0) -// CHECK: ('sh_info', 0) -// CHECK: ('sh_addralign', 4) -// CHECK: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x1) # '.text' +// CHECK: ('sh_type', 0x1) +// CHECK: ('sh_flags', 0x6) +// CHECK: ('sh_addr', 0x0) +// CHECK: ('sh_offset', 0x40) +// CHECK: ('sh_size', 0x5) +// CHECK: ('sh_link', 0x0) +// CHECK: ('sh_info', 0x0) +// CHECK: ('sh_addralign', 0x4) +// CHECK: ('sh_entsize', 0x0) // CHECK: ('_section_data', '00000000 2a') Modified: llvm/trunk/test/Scripts/elf-dump URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/elf-dump?rev=116753&r1=116752&r2=116753&view=diff ============================================================================== --- llvm/trunk/test/Scripts/elf-dump (original) +++ llvm/trunk/test/Scripts/elf-dump Mon Oct 18 16:32:41 2010 @@ -6,6 +6,8 @@ import common_dump +FormatOutput=hex + class Reader: def __init__(self, path): if path == "-": @@ -77,16 +79,16 @@ self.sh_entsize = f.readWord() def dump(self, shstrtab, f, strtab, dumpdata): - print " (('sh_name', %d) # %r" % (self.sh_name, shstrtab[self.sh_name]) - print " ('sh_type', %d)" % self.sh_type - print " ('sh_flags', %d)" % self.sh_flags - print " ('sh_addr', %d)" % self.sh_addr - print " ('sh_offset', %d)" % self.sh_offset - print " ('sh_size', %d)" % self.sh_size - print " ('sh_link', %d)" % self.sh_link - print " ('sh_info', %d)" % self.sh_info - print " ('sh_addralign', %d)" % self.sh_addralign - print " ('sh_entsize', %d)" % self.sh_entsize + print " (('sh_name', %s)" % FormatOutput(self.sh_name), "# %r" % shstrtab[self.sh_name] + print " ('sh_type', %s)" % FormatOutput(self.sh_type) + print " ('sh_flags', %s)" % FormatOutput(self.sh_flags) + print " ('sh_addr', %s)" % FormatOutput(self.sh_addr) + print " ('sh_offset', %s)" % FormatOutput(self.sh_offset) + print " ('sh_size', %s)" % FormatOutput(self.sh_size) + print " ('sh_link', %s)" % FormatOutput(self.sh_link) + print " ('sh_info', %s)" % FormatOutput(self.sh_info) + print " ('sh_addralign', %s)" % FormatOutput(self.sh_addralign) + print " ('sh_entsize', %s)" % FormatOutput(self.sh_entsize) if self.sh_type == 2: # SHT_SYMTAB print " ('_symbols', [" dumpSymtab(f, self, strtab) @@ -106,20 +108,20 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Symbol %d" % index + print " # Symbol %s" % FormatOutput(index) name = f.read32() - print " (('st_name', %d) # %r" % (name, strtab[name]) + print " (('st_name', %s)" % FormatOutput(name), "# %r" % strtab[name] if not f.is64Bit: - print " ('st_value', %d)" % f.read32() - print " ('st_size', %d)" % f.read32() + print " ('st_value', %s)" % FormatOutput(f.read32()) + print " ('st_size', %s)" % FormatOutput(f.read32()) st_info = f.read8() - print " ('st_bind', %d)" % (st_info >> 4) - print " ('st_type', %d)" % (st_info & 0xf) - print " ('st_other', %d)" % f.read8() - print " ('st_shndx', %d)" % f.read16() + print " ('st_bind', %s)" % FormatOutput((st_info >> 4)) + print " ('st_type', %s)" % FormatOutput((st_info & 0xf)) + print " ('st_other', %s)" % FormatOutput(f.read8()) + print " ('st_shndx', %s)" % FormatOutput(f.read16()) if f.is64Bit: - print " ('st_value', %d)" % f.read64() - print " ('st_size', %d)" % f.read64() + print " ('st_value', %s)" % FormatOutput(f.read64()) + print " ('st_size', %s)" % FormatOutput(f.read64()) print " )," def dumpRel(f, section, dumprela = False): @@ -127,17 +129,17 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Relocation %d" % index - print " (('r_offset', %d)" % f.readWord() + print " # Relocation %s" % FormatOutput(index) + print " (('r_offset', %s)" % FormatOutput(f.readWord()) r_info = f.readWord() if f.is64Bit: - print " ('r_sym', %d)" % (r_info >> 32) - print " ('r_type', %d)" % (r_info & 0xffffffff) + print " ('r_sym', %s)" % FormatOutput((r_info >> 32)) + print " ('r_type', %s)" % FormatOutput((r_info & 0xffffffff)) else: - print " ('r_sym', %d)" % (r_info >> 8) - print " ('r_type', %d)" % (r_info & 0xff) + print " ('r_sym', %s)" % FormatOutput((r_info >> 8)) + print " ('r_type', %s)" % FormatOutput((r_info & 0xff)) if dumprela: - print " ('r_addend', %d)" % f.readWordS() + print " ('r_addend', %s)" % FormatOutput(f.readWordS()) print " )," def dumpELF(path, opts): @@ -152,8 +154,8 @@ elif fileclass == 2: # ELFCLASS64 f.is64Bit = True else: - raise ValueError, "Unknown file class %d" % fileclass - print "('e_indent[EI_CLASS]', %d)" % fileclass + raise ValueError, "Unknown file class %s" % FormatOutput(fileclass) + print "('e_indent[EI_CLASS]', %s)" % FormatOutput(fileclass) byteordering = f.read8() if byteordering == 1: # ELFDATA2LSB @@ -161,32 +163,32 @@ elif byteordering == 2: # ELFDATA2MSB f.isLSB = False else: - raise ValueError, "Unknown byte ordering %d" % byteordering - print "('e_indent[EI_DATA]', %d)" % byteordering + raise ValueError, "Unknown byte ordering %s" % FormatOutput(byteordering) + print "('e_indent[EI_DATA]', %s)" % FormatOutput(byteordering) - print "('e_indent[EI_VERSION]', %d)" % f.read8() - print "('e_indent[EI_OSABI]', %d)" % f.read8() - print "('e_indent[EI_ABIVERSION]', %d)" % f.read8() + print "('e_indent[EI_VERSION]', %s)" % FormatOutput(f.read8()) + print "('e_indent[EI_OSABI]', %s)" % FormatOutput(f.read8()) + print "('e_indent[EI_ABIVERSION]', %s)" % FormatOutput(f.read8()) f.seek(16) # Seek to end of e_ident. - print "('e_type', %d)" % f.read16() - print "('e_machine', %d)" % f.read16() - print "('e_version', %d)" % f.read32() - print "('e_entry', %d)" % f.readWord() - print "('e_phoff', %d)" % f.readWord() + print "('e_type', %s)" % FormatOutput(f.read16()) + print "('e_machine', %s)" % FormatOutput(f.read16()) + print "('e_version', %s)" % FormatOutput(f.read32()) + print "('e_entry', %s)" % FormatOutput(f.readWord()) + print "('e_phoff', %s)" % FormatOutput(f.readWord()) e_shoff = f.readWord() - print "('e_shoff', %d)" % e_shoff - print "('e_flags', %d)" % f.read32() - print "('e_ehsize', %d)" % f.read16() - print "('e_phentsize', %d)" % f.read16() - print "('e_phnum', %d)" % f.read16() + print "('e_shoff', %s)" % FormatOutput(e_shoff) + print "('e_flags', %s)" % FormatOutput(f.read32()) + print "('e_ehsize', %s)" % FormatOutput(f.read16()) + print "('e_phentsize', %s)" % FormatOutput(f.read16()) + print "('e_phnum', %s)" % FormatOutput(f.read16()) e_shentsize = f.read16() - print "('e_shentsize', %d)" % e_shentsize + print "('e_shentsize', %s)" % FormatOutput(e_shentsize) e_shnum = f.read16() - print "('e_shnum', %d)" % e_shnum + print "('e_shnum', %s)" % FormatOutput(e_shnum) e_shstrndx = f.read16() - print "('e_shstrndx', %d)" % e_shstrndx + print "('e_shstrndx', %s)" % FormatOutput(e_shstrndx) # Read all section headers sections = [] @@ -209,7 +211,7 @@ print "('_sections', [" for index in range(e_shnum): - print " # Section %d" % index + print " # Section %s" % FormatOutput(index) sections[index].dump(shstrtab, f, strtab, opts.dumpSectionData) print "])" From rafael.espindola at gmail.com Mon Oct 18 16:51:08 2010 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 18 Oct 2010 17:51:08 -0400 Subject: [llvm-commits] [llvm] r116753 - in /llvm/trunk/test: MC/ELF/ Scripts/ In-Reply-To: <20101018213241.E80FB2A6C12C@llvm.org> References: <20101018213241.E80FB2A6C12C@llvm.org> Message-ID: > Changed elf-dump to output hex format by default. It is not just by default, it is always. That is good. Would you mind propagating the FormatOutput=hex? Cheers, Rafael From jasonwkim at google.com Mon Oct 18 16:53:27 2010 From: jasonwkim at google.com (Jason Kim) Date: Mon, 18 Oct 2010 14:53:27 -0700 Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes In-Reply-To: References: <6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com> <8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com> <8E5A9C6C-BA61-41F8-B445-336D9F96D774@apple.com> Message-ID: On Fri, Oct 15, 2010 at 9:04 PM, Rafael Espindola wrote: >> There's about 30 tests that currently depend upon the decimal output. >> And maybe lots more in the test-suite. >> I don't want to do that in the same patch. I'll add a simplified >> --hex, and --dec (default) option switch the default once I clean up >> the tests. > > elf-dump is only used in "make check-lit", so changing the tests to > use hex shouldn't be hard. You can change just the script and the > tests in the first commit. Example of a similar change: > > http://llvm.org/viewvc/llvm-project?view=rev&revision=113685 Okay, I just committed the convert (all numbers from elf-dump are now hex) as r116753. I attached a new patch that should hopefully address the other issues, > > > > ? ? ? ?126 // Slots for keeping state for above member funcs. > ? ? ? ?127 MCObjectStreamer *ELFStreamer; > ? ? ? ?128 MCAssembler *Asm; > > You don't need all this. As the initialization show you get the asm > from the streamer for example Good call! Thanks! > > ?Asm = &ELFStreamer->getAssembler(); > > > Why do you have many " char empty = 0;". If this is a standard > constant you should put it in a enum somewhere. The first two are size fields (4 byte). , the second is a required null byte in the stream. The equiv. in MC/ELF uses a 0, but in this case, the SmallVector uses a const T& - (T is always a char in this case). I though exactly matching types and a descriptive name would be ok.. Since they are isolated in the helper functions, I'll change it to numeric 0. Is this acceptable? > > // ('S') (i.e. the -F?classic? programmer?s model)-A > > Corrupted file? Has some strange looking characters. Oops. These were from the comments of the ARM manual - I'll fix these. > > Cheers, Here's the patch. http://codereview.chromium.org/3770019 Thanks! -jason > -- > Rafael ?vila de Esp?ndola > -------------- next part -------------- A non-text attachment was scrubbed... Name: arm-mc-elf-s06.patch4 Type: application/octet-stream Size: 12521 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101018/8c63909c/attachment-0001.obj From jasonwkim at google.com Mon Oct 18 16:56:24 2010 From: jasonwkim at google.com (Jason Kim) Date: Mon, 18 Oct 2010 14:56:24 -0700 Subject: [llvm-commits] [llvm] r116753 - in /llvm/trunk/test: MC/ELF/ Scripts/ In-Reply-To: References: <20101018213241.E80FB2A6C12C@llvm.org> Message-ID: Will do! -jason On Mon, Oct 18, 2010 at 2:51 PM, Rafael Esp?ndola wrote: >> Changed elf-dump to output hex format by default. > > It is not just by default, it is always. That is good. Would you mind > propagating the FormatOutput=hex? > > Cheers, > Rafael > From daniel at zuster.org Mon Oct 18 16:55:18 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 18 Oct 2010 21:55:18 -0000 Subject: [llvm-commits] [llvm] r116755 - /llvm/trunk/lib/Support/CrashRecoveryContext.cpp Message-ID: <20101018215518.6A4E32A6C12C@llvm.org> Author: ddunbar Date: Mon Oct 18 16:55:18 2010 New Revision: 116755 URL: http://llvm.org/viewvc/llvm-project?rev=116755&view=rev Log: CrashRecoveryContext: Add missing return, so that the signal fires after we our routine is off the stack. Otherwise we show up rather confusingly in the stack trace. Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CrashRecoveryContext.cpp?rev=116755&r1=116754&r2=116755&view=diff ============================================================================== --- llvm/trunk/lib/Support/CrashRecoveryContext.cpp (original) +++ llvm/trunk/lib/Support/CrashRecoveryContext.cpp Mon Oct 18 16:55:18 2010 @@ -128,6 +128,9 @@ // This call of Disable isn't thread safe, but it doesn't actually matter. CrashRecoveryContext::Disable(); raise(Signal); + + // The signal will be thrown once the signal mask is restored. + return; } // Unblock the signal we received. From jason.w.kim.2009 at gmail.com Mon Oct 18 16:59:38 2010 From: jason.w.kim.2009 at gmail.com (Jason W Kim) Date: Mon, 18 Oct 2010 21:59:38 -0000 Subject: [llvm-commits] [llvm] r116756 - /llvm/trunk/test/Scripts/elf-dump Message-ID: <20101018215938.65FB42A6C12C@llvm.org> Author: jasonwkim Date: Mon Oct 18 16:59:38 2010 New Revision: 116756 URL: http://llvm.org/viewvc/llvm-project?rev=116756&view=rev Log: Get rid of unneeded FormatOutput global variable Modified: llvm/trunk/test/Scripts/elf-dump Modified: llvm/trunk/test/Scripts/elf-dump URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/elf-dump?rev=116756&r1=116755&r2=116756&view=diff ============================================================================== --- llvm/trunk/test/Scripts/elf-dump (original) +++ llvm/trunk/test/Scripts/elf-dump Mon Oct 18 16:59:38 2010 @@ -6,8 +6,6 @@ import common_dump -FormatOutput=hex - class Reader: def __init__(self, path): if path == "-": @@ -79,16 +77,16 @@ self.sh_entsize = f.readWord() def dump(self, shstrtab, f, strtab, dumpdata): - print " (('sh_name', %s)" % FormatOutput(self.sh_name), "# %r" % shstrtab[self.sh_name] - print " ('sh_type', %s)" % FormatOutput(self.sh_type) - print " ('sh_flags', %s)" % FormatOutput(self.sh_flags) - print " ('sh_addr', %s)" % FormatOutput(self.sh_addr) - print " ('sh_offset', %s)" % FormatOutput(self.sh_offset) - print " ('sh_size', %s)" % FormatOutput(self.sh_size) - print " ('sh_link', %s)" % FormatOutput(self.sh_link) - print " ('sh_info', %s)" % FormatOutput(self.sh_info) - print " ('sh_addralign', %s)" % FormatOutput(self.sh_addralign) - print " ('sh_entsize', %s)" % FormatOutput(self.sh_entsize) + print " (('sh_name', %s)" % hex(self.sh_name), "# %r" % shstrtab[self.sh_name] + print " ('sh_type', %s)" % hex(self.sh_type) + print " ('sh_flags', %s)" % hex(self.sh_flags) + print " ('sh_addr', %s)" % hex(self.sh_addr) + print " ('sh_offset', %s)" % hex(self.sh_offset) + print " ('sh_size', %s)" % hex(self.sh_size) + print " ('sh_link', %s)" % hex(self.sh_link) + print " ('sh_info', %s)" % hex(self.sh_info) + print " ('sh_addralign', %s)" % hex(self.sh_addralign) + print " ('sh_entsize', %s)" % hex(self.sh_entsize) if self.sh_type == 2: # SHT_SYMTAB print " ('_symbols', [" dumpSymtab(f, self, strtab) @@ -108,20 +106,20 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Symbol %s" % FormatOutput(index) + print " # Symbol %s" % hex(index) name = f.read32() - print " (('st_name', %s)" % FormatOutput(name), "# %r" % strtab[name] + print " (('st_name', %s)" % hex(name), "# %r" % strtab[name] if not f.is64Bit: - print " ('st_value', %s)" % FormatOutput(f.read32()) - print " ('st_size', %s)" % FormatOutput(f.read32()) + print " ('st_value', %s)" % hex(f.read32()) + print " ('st_size', %s)" % hex(f.read32()) st_info = f.read8() - print " ('st_bind', %s)" % FormatOutput((st_info >> 4)) - print " ('st_type', %s)" % FormatOutput((st_info & 0xf)) - print " ('st_other', %s)" % FormatOutput(f.read8()) - print " ('st_shndx', %s)" % FormatOutput(f.read16()) + print " ('st_bind', %s)" % hex((st_info >> 4)) + print " ('st_type', %s)" % hex((st_info & 0xf)) + print " ('st_other', %s)" % hex(f.read8()) + print " ('st_shndx', %s)" % hex(f.read16()) if f.is64Bit: - print " ('st_value', %s)" % FormatOutput(f.read64()) - print " ('st_size', %s)" % FormatOutput(f.read64()) + print " ('st_value', %s)" % hex(f.read64()) + print " ('st_size', %s)" % hex(f.read64()) print " )," def dumpRel(f, section, dumprela = False): @@ -129,17 +127,17 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Relocation %s" % FormatOutput(index) - print " (('r_offset', %s)" % FormatOutput(f.readWord()) + print " # Relocation %s" % hex(index) + print " (('r_offset', %s)" % hex(f.readWord()) r_info = f.readWord() if f.is64Bit: - print " ('r_sym', %s)" % FormatOutput((r_info >> 32)) - print " ('r_type', %s)" % FormatOutput((r_info & 0xffffffff)) + print " ('r_sym', %s)" % hex((r_info >> 32)) + print " ('r_type', %s)" % hex((r_info & 0xffffffff)) else: - print " ('r_sym', %s)" % FormatOutput((r_info >> 8)) - print " ('r_type', %s)" % FormatOutput((r_info & 0xff)) + print " ('r_sym', %s)" % hex((r_info >> 8)) + print " ('r_type', %s)" % hex((r_info & 0xff)) if dumprela: - print " ('r_addend', %s)" % FormatOutput(f.readWordS()) + print " ('r_addend', %s)" % hex(f.readWordS()) print " )," def dumpELF(path, opts): @@ -154,8 +152,8 @@ elif fileclass == 2: # ELFCLASS64 f.is64Bit = True else: - raise ValueError, "Unknown file class %s" % FormatOutput(fileclass) - print "('e_indent[EI_CLASS]', %s)" % FormatOutput(fileclass) + raise ValueError, "Unknown file class %s" % hex(fileclass) + print "('e_indent[EI_CLASS]', %s)" % hex(fileclass) byteordering = f.read8() if byteordering == 1: # ELFDATA2LSB @@ -163,32 +161,32 @@ elif byteordering == 2: # ELFDATA2MSB f.isLSB = False else: - raise ValueError, "Unknown byte ordering %s" % FormatOutput(byteordering) - print "('e_indent[EI_DATA]', %s)" % FormatOutput(byteordering) + raise ValueError, "Unknown byte ordering %s" % hex(byteordering) + print "('e_indent[EI_DATA]', %s)" % hex(byteordering) - print "('e_indent[EI_VERSION]', %s)" % FormatOutput(f.read8()) - print "('e_indent[EI_OSABI]', %s)" % FormatOutput(f.read8()) - print "('e_indent[EI_ABIVERSION]', %s)" % FormatOutput(f.read8()) + print "('e_indent[EI_VERSION]', %s)" % hex(f.read8()) + print "('e_indent[EI_OSABI]', %s)" % hex(f.read8()) + print "('e_indent[EI_ABIVERSION]', %s)" % hex(f.read8()) f.seek(16) # Seek to end of e_ident. - print "('e_type', %s)" % FormatOutput(f.read16()) - print "('e_machine', %s)" % FormatOutput(f.read16()) - print "('e_version', %s)" % FormatOutput(f.read32()) - print "('e_entry', %s)" % FormatOutput(f.readWord()) - print "('e_phoff', %s)" % FormatOutput(f.readWord()) + print "('e_type', %s)" % hex(f.read16()) + print "('e_machine', %s)" % hex(f.read16()) + print "('e_version', %s)" % hex(f.read32()) + print "('e_entry', %s)" % hex(f.readWord()) + print "('e_phoff', %s)" % hex(f.readWord()) e_shoff = f.readWord() - print "('e_shoff', %s)" % FormatOutput(e_shoff) - print "('e_flags', %s)" % FormatOutput(f.read32()) - print "('e_ehsize', %s)" % FormatOutput(f.read16()) - print "('e_phentsize', %s)" % FormatOutput(f.read16()) - print "('e_phnum', %s)" % FormatOutput(f.read16()) + print "('e_shoff', %s)" % hex(e_shoff) + print "('e_flags', %s)" % hex(f.read32()) + print "('e_ehsize', %s)" % hex(f.read16()) + print "('e_phentsize', %s)" % hex(f.read16()) + print "('e_phnum', %s)" % hex(f.read16()) e_shentsize = f.read16() - print "('e_shentsize', %s)" % FormatOutput(e_shentsize) + print "('e_shentsize', %s)" % hex(e_shentsize) e_shnum = f.read16() - print "('e_shnum', %s)" % FormatOutput(e_shnum) + print "('e_shnum', %s)" % hex(e_shnum) e_shstrndx = f.read16() - print "('e_shstrndx', %s)" % FormatOutput(e_shstrndx) + print "('e_shstrndx', %s)" % hex(e_shstrndx) # Read all section headers sections = [] @@ -211,7 +209,7 @@ print "('_sections', [" for index in range(e_shnum): - print " # Section %s" % FormatOutput(index) + print " # Section %s" % hex(index) sections[index].dump(shstrtab, f, strtab, opts.dumpSectionData) print "])" From rafael.espindola at gmail.com Mon Oct 18 17:05:37 2010 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 18 Oct 2010 18:05:37 -0400 Subject: [llvm-commits] [llvm] r116756 - /llvm/trunk/test/Scripts/elf-dump In-Reply-To: <20101018215938.65FB42A6C12C@llvm.org> References: <20101018215938.65FB42A6C12C@llvm.org> Message-ID: On 18 October 2010 17:59, Jason W Kim wrote: > Author: jasonwkim > Date: Mon Oct 18 16:59:38 2010 > New Revision: 116756 > > URL: http://llvm.org/viewvc/llvm-project?rev=116756&view=rev > Log: > Get rid of unneeded FormatOutput global variable Thanks, Rafael From gohman at apple.com Mon Oct 18 17:35:57 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 15:35:57 -0700 Subject: [llvm-commits] [llvm] r116720 - in /llvm/trunk: include/llvm/Support/ lib/Analysis/ lib/CodeGen/ test/Analysis/BasicAA/ test/Analysis/GlobalsModRef/ test/Analysis/LoopDependenceAnalysis/ test/Analysis/TypeBasedAliasAnalysis/ test/Other/ test/Transforms/ArgumentPromotion/ test/Transforms/DeadStoreElimination/ test/Transforms/GVN/ test/Transforms/Inline/ test/Transforms/LICM/ test/Transforms/MemCpyOpt/ test/Transforms/Sink/ In-Reply-To: <4CBCA240.3020300@free.fr> References: <20101018180449.02B6E2A6C12C@llvm.org> <4CBCA240.3020300@free.fr> Message-ID: On Oct 18, 2010, at 12:38 PM, Duncan Sands wrote: > Hi Dan, > >> Make BasicAliasAnalysis a normal AliasAnalysis implementation which >> does normal initialization and normal chaining. Change the default >> AliasAnalysis implementation to NoAlias. >> >> Update StandardCompileOpts.h and friends to explicitly request >> BasicAliasAnalysis. > > it used to be that if you requested a more advanced alias analysis > (eg: globalsmodref-aa) then it would be used for the following pass, > but later passes would go back to basic-aa. Has this been fixed? No. It works for TBAA now only because TBAA is an ImmutablePass and the ImmutablePass case is now fixed. Dan From echristo at apple.com Mon Oct 18 17:53:53 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 18 Oct 2010 22:53:53 -0000 Subject: [llvm-commits] [llvm] r116762 - in /llvm/trunk: lib/Target/ARM/ARMFastISel.cpp test/CodeGen/ARM/fast-isel.ll Message-ID: <20101018225353.B31D52A6C12C@llvm.org> Author: echristo Date: Mon Oct 18 17:53:53 2010 New Revision: 116762 URL: http://llvm.org/viewvc/llvm-project?rev=116762&view=rev Log: Revert r116220 - thus turning arm fast isel back on by default. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp llvm/trunk/test/CodeGen/ARM/fast-isel.ll Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116762&r1=116761&r2=116762&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 18 17:53:53 2010 @@ -48,8 +48,8 @@ using namespace llvm; static cl::opt -EnableARMFastISel("arm-fast-isel", - cl::desc("Turn on experimental ARM fast-isel support"), +DisableARMFastISel("disable-arm-fast-isel", + cl::desc("Turn off experimental ARM fast-isel support"), cl::init(false), cl::Hidden); namespace { @@ -1660,7 +1660,7 @@ // Completely untested on non-darwin. const TargetMachine &TM = funcInfo.MF->getTarget(); const ARMSubtarget *Subtarget = &TM.getSubtarget(); - if (Subtarget->isTargetDarwin() && EnableARMFastISel) + if (Subtarget->isTargetDarwin() && !DisableARMFastISel) return new ARMFastISel(funcInfo); return 0; } Modified: llvm/trunk/test/CodeGen/ARM/fast-isel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fast-isel.ll?rev=116762&r1=116761&r2=116762&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/fast-isel.ll (original) +++ llvm/trunk/test/CodeGen/ARM/fast-isel.ll Mon Oct 18 17:53:53 2010 @@ -1,5 +1,5 @@ -; RUN: llc < %s -O0 -arm-fast-isel -fast-isel-abort -mtriple=armv7-apple-darwin -; RUN: llc < %s -O0 -arm-fast-isel -fast-isel-abort -mtriple=thumbv7-apple-darwin +; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv7-apple-darwin +; RUN: llc < %s -O0 -fast-isel-abort -mtriple=thumbv7-apple-darwin ; Very basic fast-isel functionality. From chandlerc at gmail.com Mon Oct 18 18:18:51 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 18 Oct 2010 23:18:51 -0000 Subject: [llvm-commits] [llvm] r116766 - /llvm/trunk/include/llvm/MC/MCObjectFormat.h Message-ID: <20101018231851.791912A6C12C@llvm.org> Author: chandlerc Date: Mon Oct 18 18:18:51 2010 New Revision: 116766 URL: http://llvm.org/viewvc/llvm-project?rev=116766&view=rev Log: Add a virtual destructor to silence a GCC warning. Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116766&r1=116765&r2=116766&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 18:18:51 2010 @@ -15,6 +15,8 @@ class MCObjectFormat { public: + virtual ~MCObjectFormat() {} + /// isAbsolute - Check if A - B is an absolute value /// /// \param InSet - True if this expression is in a set. For example: From gohman at apple.com Mon Oct 18 18:31:47 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 23:31:47 -0000 Subject: [llvm-commits] [llvm] r116767 - in /llvm/trunk: include/llvm/Analysis/AliasSetTracker.h lib/Analysis/AliasSetTracker.cpp Message-ID: <20101018233147.708A82A6C12C@llvm.org> Author: djg Date: Mon Oct 18 18:31:47 2010 New Revision: 116767 URL: http://llvm.org/viewvc/llvm-project?rev=116767&view=rev Log: Make the representation of AliasSets explicitly differentiate between "not known yet" and "known no tbaa info" so that it can merge them properly. Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/lib/Analysis/AliasSetTracker.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=116767&r1=116766&r2=116767&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Mon Oct 18 18:31:47 2010 @@ -44,7 +44,8 @@ const MDNode *TBAAInfo; public: PointerRec(Value *V) - : Val(V), PrevInList(0), NextInList(0), AS(0), Size(0), TBAAInfo(0) {} + : Val(V), PrevInList(0), NextInList(0), AS(0), Size(0), + TBAAInfo(DenseMapInfo::getEmptyKey()) {} Value *getValue() const { return Val; } @@ -59,26 +60,22 @@ void updateSizeAndTBAAInfo(unsigned NewSize, const MDNode *NewTBAAInfo) { if (NewSize > Size) Size = NewSize; - if (!TBAAInfo) + if (TBAAInfo == DenseMapInfo::getEmptyKey()) + // We don't have a TBAAInfo yet. Set it to NewTBAAInfo. TBAAInfo = NewTBAAInfo; else if (TBAAInfo != NewTBAAInfo) - TBAAInfo = reinterpret_cast(-1); + // NewTBAAInfo conflicts with TBAAInfo. + TBAAInfo = DenseMapInfo::getTombstoneKey(); } unsigned getSize() const { return Size; } - /// getRawTBAAInfo - Return the raw TBAAInfo member. In addition to - /// being null or a pointer to an MDNode, this could be -1, meaning - /// there was conflicting information. - const MDNode *getRawTBAAInfo() const { - return TBAAInfo; - } - /// getTBAAInfo - Return the TBAAInfo, or null if there is no /// information or conflicting information. const MDNode *getTBAAInfo() const { - // If we have conflicting TBAAInfo, return null. - if (TBAAInfo == reinterpret_cast(-1)) + // If we have missing or conflicting TBAAInfo, return null. + if (TBAAInfo == DenseMapInfo::getEmptyKey() || + TBAAInfo == DenseMapInfo::getTombstoneKey()) return 0; return TBAAInfo; } @@ -209,7 +206,6 @@ Value *getPointer() const { return CurNode->getValue(); } unsigned getSize() const { return CurNode->getSize(); } - const MDNode *getRawTBAAInfo() const { return CurNode->getRawTBAAInfo(); } const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116767&r1=116766&r2=116767&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Mon Oct 18 18:31:47 2010 @@ -377,7 +377,7 @@ bool X; for (AliasSet::iterator ASI = AS.begin(), E = AS.end(); ASI != E; ++ASI) { AliasSet &NewAS = addPointer(ASI.getPointer(), ASI.getSize(), - ASI.getRawTBAAInfo(), + ASI.getTBAAInfo(), (AliasSet::AccessType)AS.AccessTy, X); if (AS.isVolatile()) NewAS.setVolatile(); } @@ -533,7 +533,7 @@ I = PointerMap.find(From); AliasSet *AS = I->second->getAliasSet(*this); AS->addPointer(*this, Entry, I->second->getSize(), - I->second->getRawTBAAInfo(), + I->second->getTBAAInfo(), true); } From grosbach at apple.com Mon Oct 18 18:35:38 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 18 Oct 2010 23:35:38 -0000 Subject: [llvm-commits] [llvm] r116768 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Message-ID: <20101018233538.2C9A22A6C12C@llvm.org> Author: grosbach Date: Mon Oct 18 18:35:38 2010 New Revision: 116768 URL: http://llvm.org/viewvc/llvm-project?rev=116768&view=rev Log: ARM encoding information for [SU]SAT* instructions. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=116768&r1=116767&r2=116768&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Oct 18 18:35:38 2010 @@ -2059,50 +2059,94 @@ // Unsigned Sum of Absolute Differences [and Accumulate] -- for disassembly only -def USAD8 : AI<(outs GPR:$dst), (ins GPR:$a, GPR:$b), +def USAD8 : AI<(outs GPR:$Rd), (ins GPR:$Rn, GPR:$Rm), MulFrm /* for convenience */, NoItinerary, "usad8", - "\t$dst, $a, $b", []>, + "\t$Rd, $Rn, $Rm", []>, Requires<[IsARM, HasV6]> { + bits<4> Rd; + bits<4> Rn; + bits<4> Rm; let Inst{27-20} = 0b01111000; let Inst{15-12} = 0b1111; let Inst{7-4} = 0b0001; + let Inst{19-16} = Rd; + let Inst{11-8} = Rm; + let Inst{3-0} = Rn; } -def USADA8 : AI<(outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), +def USADA8 : AI<(outs GPR:$Rd), (ins GPR:$Rn, GPR:$Rm, GPR:$Ra), MulFrm /* for convenience */, NoItinerary, "usada8", - "\t$dst, $a, $b, $acc", []>, + "\t$Rd, $Rn, $Rm, $Ra", []>, Requires<[IsARM, HasV6]> { + bits<4> Rd; + bits<4> Rn; + bits<4> Rm; + bits<4> Ra; let Inst{27-20} = 0b01111000; let Inst{7-4} = 0b0001; + let Inst{19-16} = Rd; + let Inst{15-12} = Ra; + let Inst{11-8} = Rm; + let Inst{3-0} = Rn; } // Signed/Unsigned saturate -- for disassembly only -def SSAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, shift_imm:$sh), - SatFrm, NoItinerary, "ssat", "\t$dst, $bit_pos, $a$sh", +def SSAT : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$a, shift_imm:$sh), + SatFrm, NoItinerary, "ssat", "\t$Rd, $sat_imm, $a$sh", [/* For disassembly only; pattern left blank */]> { + bits<4> Rd; + bits<5> sat_imm; + bits<4> Rn; + bits<8> sh; let Inst{27-21} = 0b0110101; let Inst{5-4} = 0b01; + let Inst{20-16} = sat_imm; + let Inst{15-12} = Rd; + let Inst{11-7} = sh{7-3}; + let Inst{6} = sh{0}; + let Inst{3-0} = Rn; } -def SSAT16 : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a), SatFrm, - NoItinerary, "ssat16", "\t$dst, $bit_pos, $a", +def SSAT16 : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$Rn), SatFrm, + NoItinerary, "ssat16", "\t$Rd, $sat_imm, $Rn", [/* For disassembly only; pattern left blank */]> { + bits<4> Rd; + bits<4> sat_imm; + bits<4> Rn; let Inst{27-20} = 0b01101010; - let Inst{7-4} = 0b0011; + let Inst{11-4} = 0b11110011; + let Inst{15-12} = Rd; + let Inst{19-16} = sat_imm; + let Inst{3-0} = Rn; } -def USAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, shift_imm:$sh), - SatFrm, NoItinerary, "usat", "\t$dst, $bit_pos, $a$sh", +def USAT : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$a, shift_imm:$sh), + SatFrm, NoItinerary, "usat", "\t$Rd, $sat_imm, $a$sh", [/* For disassembly only; pattern left blank */]> { + bits<4> Rd; + bits<5> sat_imm; + bits<4> Rn; + bits<8> sh; let Inst{27-21} = 0b0110111; let Inst{5-4} = 0b01; + let Inst{15-12} = Rd; + let Inst{11-7} = sh{7-3}; + let Inst{6} = sh{0}; + let Inst{20-16} = sat_imm; + let Inst{3-0} = Rn; } -def USAT16 : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a), SatFrm, - NoItinerary, "usat16", "\t$dst, $bit_pos, $a", +def USAT16 : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$a), SatFrm, + NoItinerary, "usat16", "\t$Rd, $sat_imm, $a", [/* For disassembly only; pattern left blank */]> { + bits<4> Rd; + bits<4> sat_imm; + bits<4> Rn; let Inst{27-20} = 0b01101110; - let Inst{7-4} = 0b0011; + let Inst{11-4} = 0b11110011; + let Inst{15-12} = Rd; + let Inst{19-16} = sat_imm; + let Inst{3-0} = Rn; } def : ARMV6Pat<(int_arm_ssat GPR:$a, imm:$pos), (SSAT imm:$pos, GPR:$a, 0)>; From wendling at apple.com Mon Oct 18 18:47:50 2010 From: wendling at apple.com (Bill Wendling) Date: Mon, 18 Oct 2010 16:47:50 -0700 Subject: [llvm-commits] [llvm] r116766 - /llvm/trunk/include/llvm/MC/MCObjectFormat.h In-Reply-To: <20101018231851.791912A6C12C@llvm.org> References: <20101018231851.791912A6C12C@llvm.org> Message-ID: <08E3005E-AD77-4832-BEDA-62DE68A06309@apple.com> On Oct 18, 2010, at 4:18 PM, Chandler Carruth wrote: > Author: chandlerc > Date: Mon Oct 18 18:18:51 2010 > New Revision: 116766 > > URL: http://llvm.org/viewvc/llvm-project?rev=116766&view=rev > Log: > Add a virtual destructor to silence a GCC warning. > > Modified: > llvm/trunk/include/llvm/MC/MCObjectFormat.h > > Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116766&r1=116765&r2=116766&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) > +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 18:18:51 2010 > @@ -15,6 +15,8 @@ > > class MCObjectFormat { > public: > + virtual ~MCObjectFormat() {} > + Hi Chandler, Should the definition for this go in the MCObjectFormat.cpp file to "anchor" the vtable? -bw From chandlerc at gmail.com Mon Oct 18 18:52:57 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 18 Oct 2010 16:52:57 -0700 Subject: [llvm-commits] [llvm] r116766 - /llvm/trunk/include/llvm/MC/MCObjectFormat.h In-Reply-To: <08E3005E-AD77-4832-BEDA-62DE68A06309@apple.com> References: <20101018231851.791912A6C12C@llvm.org> <08E3005E-AD77-4832-BEDA-62DE68A06309@apple.com> Message-ID: On Mon, Oct 18, 2010 at 4:47 PM, Bill Wendling wrote: > On Oct 18, 2010, at 4:18 PM, Chandler Carruth wrote: > > > Author: chandlerc > > Date: Mon Oct 18 18:18:51 2010 > > New Revision: 116766 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=116766&view=rev > > Log: > > Add a virtual destructor to silence a GCC warning. > > > > Modified: > > llvm/trunk/include/llvm/MC/MCObjectFormat.h > > > > Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h > > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116766&r1=116765&r2=116766&view=diff > > > ============================================================================== > > --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) > > +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 18:18:51 2010 > > @@ -15,6 +15,8 @@ > > > > class MCObjectFormat { > > public: > > + virtual ~MCObjectFormat() {} > > + > > Hi Chandler, > > Should the definition for this go in the MCObjectFormat.cpp file to > "anchor" the vtable? > I wasn't sure. I placed it here as that seemed like the minimal change from the original code (it is an abstract interface afterall). I'm happy to move it to the cpp file if anchoring the vtable (and forcing this call to be out-of-line) is desirable. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101018/4f6dab41/attachment.html From enderby at apple.com Mon Oct 18 19:01:44 2010 From: enderby at apple.com (Kevin Enderby) Date: Tue, 19 Oct 2010 00:01:44 -0000 Subject: [llvm-commits] [llvm] r116773 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp lib/Target/X86/X86InstrSystem.td test/MC/X86/x86-32.s test/MC/X86/x86-64.s Message-ID: <20101019000144.4F3F52A6C12C@llvm.org> Author: enderby Date: Mon Oct 18 19:01:44 2010 New Revision: 116773 URL: http://llvm.org/viewvc/llvm-project?rev=116773&view=rev Log: Added a few tweaks to the Intel Descriptor-table support instructions to allow word forms and suffixed versions to match the darwin assembler in 32-bit and 64-bit modes. This is again for use just with assembly source for llvm-mc . Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp llvm/trunk/lib/Target/X86/X86InstrSystem.td llvm/trunk/test/MC/X86/x86-32.s llvm/trunk/test/MC/X86/x86-64.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=116773&r1=116772&r2=116773&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Oct 18 19:01:44 2010 @@ -1089,6 +1089,46 @@ Operands.push_back(X86Operand::CreateImm(A, NameLoc, NameLoc)); } + // "lgdtl" is not ambiguous 32-bit mode and is the same as "lgdt". + // "lgdtq" is not ambiguous 64-bit mode and is the same as "lgdt". + if ((Name == "lgdtl" && Is64Bit == false) || + (Name == "lgdtq" && Is64Bit == true)) { + const char *NewName = "lgdt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + + // "lidtl" is not ambiguous 32-bit mode and is the same as "lidt". + // "lidtq" is not ambiguous 64-bit mode and is the same as "lidt". + if ((Name == "lidtl" && Is64Bit == false) || + (Name == "lidtq" && Is64Bit == true)) { + const char *NewName = "lidt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + + // "sgdtl" is not ambiguous 32-bit mode and is the same as "sgdt". + // "sgdtq" is not ambiguous 64-bit mode and is the same as "sgdt". + if ((Name == "sgdtl" && Is64Bit == false) || + (Name == "sgdtq" && Is64Bit == true)) { + const char *NewName = "sgdt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + + // "sidtl" is not ambiguous 32-bit mode and is the same as "sidt". + // "sidtq" is not ambiguous 64-bit mode and is the same as "sidt". + if ((Name == "sidtl" && Is64Bit == false) || + (Name == "sidtq" && Is64Bit == true)) { + const char *NewName = "sidt"; + delete Operands[0]; + Operands[0] = X86Operand::CreateToken(NewName, NameLoc); + Name = NewName; + } + return false; } Modified: llvm/trunk/lib/Target/X86/X86InstrSystem.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSystem.td?rev=116773&r1=116772&r2=116773&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSystem.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSystem.td Mon Oct 18 19:01:44 2010 @@ -321,8 +321,12 @@ //===----------------------------------------------------------------------===// // Descriptor-table support instructions +def SGDT16m : I<0x01, MRM0m, (outs opaque48mem:$dst), (ins), + "sgdtw\t$dst", []>, TB, OpSize, Requires<[In32BitMode]>; def SGDTm : I<0x01, MRM0m, (outs opaque48mem:$dst), (ins), "sgdt\t$dst", []>, TB; +def SIDT16m : I<0x01, MRM1m, (outs opaque48mem:$dst), (ins), + "sidtw\t$dst", []>, TB, OpSize, Requires<[In32BitMode]>; def SIDTm : I<0x01, MRM1m, (outs opaque48mem:$dst), (ins), "sidt\t$dst", []>, TB; def SLDT16r : I<0x00, MRM0r, (outs GR16:$dst), (ins), @@ -339,8 +343,12 @@ def SLDT64m : RI<0x00, MRM0m, (outs i16mem:$dst), (ins), "sldt{q}\t$dst", []>, TB; +def LGDT16m : I<0x01, MRM2m, (outs), (ins opaque48mem:$src), + "lgdtw\t$src", []>, TB, OpSize, Requires<[In32BitMode]>; def LGDTm : I<0x01, MRM2m, (outs), (ins opaque48mem:$src), "lgdt\t$src", []>, TB; +def LIDT16m : I<0x01, MRM3m, (outs), (ins opaque48mem:$src), + "lidtw\t$src", []>, TB, OpSize, Requires<[In32BitMode]>; def LIDTm : I<0x01, MRM3m, (outs), (ins opaque48mem:$src), "lidt\t$src", []>, TB; def LLDT16r : I<0x00, MRM2r, (outs), (ins GR16:$src), Modified: llvm/trunk/test/MC/X86/x86-32.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-32.s?rev=116773&r1=116772&r2=116773&view=diff ============================================================================== --- llvm/trunk/test/MC/X86/x86-32.s (original) +++ llvm/trunk/test/MC/X86/x86-32.s Mon Oct 18 19:01:44 2010 @@ -654,3 +654,51 @@ // CHECK: arpl %bx, 6(%ecx) // CHECK: encoding: [0x63,0x59,0x06] arpl %bx,6(%ecx) + +// CHECK: lgdtw 4(%eax) +// CHECK: encoding: [0x66,0x0f,0x01,0x50,0x04] + lgdtw 4(%eax) + +// CHECK: lgdt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x50,0x04] + lgdt 4(%eax) + +// CHECK: lgdt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x50,0x04] + lgdtl 4(%eax) + +// CHECK: lidtw 4(%eax) +// CHECK: encoding: [0x66,0x0f,0x01,0x58,0x04] + lidtw 4(%eax) + +// CHECK: lidt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x58,0x04] + lidt 4(%eax) + +// CHECK: lidt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x58,0x04] + lidtl 4(%eax) + +// CHECK: sgdtw 4(%eax) +// CHECK: encoding: [0x66,0x0f,0x01,0x40,0x04] + sgdtw 4(%eax) + +// CHECK: sgdt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x40,0x04] + sgdt 4(%eax) + +// CHECK: sgdt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x40,0x04] + sgdtl 4(%eax) + +// CHECK: sidtw 4(%eax) +// CHECK: encoding: [0x66,0x0f,0x01,0x48,0x04] + sidtw 4(%eax) + +// CHECK: sidt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x48,0x04] + sidt 4(%eax) + +// CHECK: sidt 4(%eax) +// CHECK: encoding: [0x0f,0x01,0x48,0x04] + sidtl 4(%eax) Modified: llvm/trunk/test/MC/X86/x86-64.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=116773&r1=116772&r2=116773&view=diff ============================================================================== --- llvm/trunk/test/MC/X86/x86-64.s (original) +++ llvm/trunk/test/MC/X86/x86-64.s Mon Oct 18 19:01:44 2010 @@ -795,3 +795,35 @@ decw %ax // CHECK: decw %ax # encoding: [0x66,0xff,0xc8] decl %eax // CHECK: decl %eax # encoding: [0xff,0xc8] +// rdar://8416805 +// CHECK: lgdt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x50,0x04] + lgdt 4(%rax) + +// CHECK: lgdt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x50,0x04] + lgdtq 4(%rax) + +// CHECK: lidt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x58,0x04] + lidt 4(%rax) + +// CHECK: lidt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x58,0x04] + lidtq 4(%rax) + +// CHECK: sgdt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x40,0x04] + sgdt 4(%rax) + +// CHECK: sgdt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x40,0x04] + sgdtq 4(%rax) + +// CHECK: sidt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x48,0x04] + sidt 4(%rax) + +// CHECK: sidt 4(%rax) +// CHECK: encoding: [0x0f,0x01,0x48,0x04] + sidtq 4(%rax) From bob.wilson at apple.com Mon Oct 18 19:16:32 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 19 Oct 2010 00:16:32 -0000 Subject: [llvm-commits] [llvm] r116776 - in /llvm/trunk: lib/Target/ARM/ARMISelDAGToDAG.cpp test/CodeGen/ARM/vldlane.ll test/CodeGen/ARM/vstlane.ll Message-ID: <20101019001632.479492A6C12C@llvm.org> Author: bwilson Date: Mon Oct 18 19:16:32 2010 New Revision: 116776 URL: http://llvm.org/viewvc/llvm-project?rev=116776&view=rev Log: Support alignment for NEON vld-lane and vst-lane instructions. Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/test/CodeGen/ARM/vldlane.ll llvm/trunk/test/CodeGen/ARM/vstlane.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=116776&r1=116775&r2=116776&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Oct 18 19:16:32 2010 @@ -1298,6 +1298,17 @@ EVT VT = IsLoad ? N->getValueType(0) : N->getOperand(3).getValueType(); bool is64BitVector = VT.is64BitVector(); + if (NumVecs != 3) { + unsigned Alignment = cast(N)->getAlignment(); + unsigned NumBytes = NumVecs * VT.getVectorElementType().getSizeInBits()/8; + if (Alignment > NumBytes) + Alignment = NumBytes; + // Alignment must be a power of two; make sure of that. + Alignment = (Alignment & -Alignment); + if (Alignment > 1) + Align = CurDAG->getTargetConstant(Alignment, MVT::i32); + } + unsigned OpcodeIndex; switch (VT.getSimpleVT().SimpleTy) { default: llvm_unreachable("unhandled vld/vst lane type"); Modified: llvm/trunk/test/CodeGen/ARM/vldlane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vldlane.ll?rev=116776&r1=116775&r2=116776&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vldlane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vldlane.ll Mon Oct 18 19:16:32 2010 @@ -11,9 +11,10 @@ define <8 x i8> @vld2lanei8(i8* %A, <8 x i8>* %B) nounwind { ;CHECK: vld2lanei8: -;CHECK: vld2.8 +;Check the alignment value. Max for this instruction is 16 bits: +;CHECK: vld2.8 {d16[1], d17[1]}, [r0, :16] %tmp1 = load <8 x i8>* %B - %tmp2 = call %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 4) %tmp3 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int8x8x2_t %tmp2, 1 %tmp5 = add <8 x i8> %tmp3, %tmp4 @@ -22,10 +23,11 @@ define <4 x i16> @vld2lanei16(i16* %A, <4 x i16>* %B) nounwind { ;CHECK: vld2lanei16: -;CHECK: vld2.16 +;Check the alignment value. Max for this instruction is 32 bits: +;CHECK: vld2.16 {d16[1], d17[1]}, [r0, :32] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <4 x i16>* %B - %tmp2 = call %struct.__neon_int16x4x2_t @llvm.arm.neon.vld2lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int16x4x2_t @llvm.arm.neon.vld2lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8) %tmp3 = extractvalue %struct.__neon_int16x4x2_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int16x4x2_t %tmp2, 1 %tmp5 = add <4 x i16> %tmp3, %tmp4 @@ -58,10 +60,11 @@ define <8 x i16> @vld2laneQi16(i16* %A, <8 x i16>* %B) nounwind { ;CHECK: vld2laneQi16: -;CHECK: vld2.16 +;Check the (default) alignment. +;CHECK: vld2.16 {d17[1], d19[1]}, [r0] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <8 x i16>* %B - %tmp2 = call %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 5, i32 1) %tmp3 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int16x8x2_t %tmp2, 1 %tmp5 = add <8 x i16> %tmp3, %tmp4 @@ -70,10 +73,11 @@ define <4 x i32> @vld2laneQi32(i32* %A, <4 x i32>* %B) nounwind { ;CHECK: vld2laneQi32: -;CHECK: vld2.32 +;Check the alignment value. Max for this instruction is 64 bits: +;CHECK: vld2.32 {d17[0], d19[0]}, [r0, :64] %tmp0 = bitcast i32* %A to i8* %tmp1 = load <4 x i32>* %B - %tmp2 = call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 1) + %tmp2 = call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 16) %tmp3 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int32x4x2_t %tmp2, 1 %tmp5 = add <4 x i32> %tmp3, %tmp4 @@ -125,10 +129,11 @@ define <4 x i16> @vld3lanei16(i16* %A, <4 x i16>* %B) nounwind { ;CHECK: vld3lanei16: -;CHECK: vld3.16 +;Check the (default) alignment value. VLD3 does not support alignment. +;CHECK: vld3.16 {d16[1], d17[1], d18[1]}, [r0] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <4 x i16>* %B - %tmp2 = call %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8) %tmp3 = extractvalue %struct.__neon_int16x4x3_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int16x4x3_t %tmp2, 1 %tmp5 = extractvalue %struct.__neon_int16x4x3_t %tmp2, 2 @@ -167,10 +172,11 @@ define <8 x i16> @vld3laneQi16(i16* %A, <8 x i16>* %B) nounwind { ;CHECK: vld3laneQi16: -;CHECK: vld3.16 +;Check the (default) alignment value. VLD3 does not support alignment. +;CHECK: vld3.16 {d16[1], d18[1], d20[1]}, [r0] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <8 x i16>* %B - %tmp2 = call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 8) %tmp3 = extractvalue %struct.__neon_int16x8x3_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int16x8x3_t %tmp2, 1 %tmp5 = extractvalue %struct.__neon_int16x8x3_t %tmp2, 2 @@ -227,9 +233,10 @@ define <8 x i8> @vld4lanei8(i8* %A, <8 x i8>* %B) nounwind { ;CHECK: vld4lanei8: -;CHECK: vld4.8 +;Check the alignment value. Max for this instruction is 32 bits: +;CHECK: vld4.8 {d16[1], d17[1], d18[1], d19[1]}, [r0, :32] %tmp1 = load <8 x i8>* %B - %tmp2 = call %struct.__neon_int8x8x4_t @llvm.arm.neon.vld4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int8x8x4_t @llvm.arm.neon.vld4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 8) %tmp3 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 1 %tmp5 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 2 @@ -258,10 +265,11 @@ define <2 x i32> @vld4lanei32(i32* %A, <2 x i32>* %B) nounwind { ;CHECK: vld4lanei32: -;CHECK: vld4.32 +;Check the alignment value. Max for this instruction is 128 bits: +;CHECK: vld4.32 {d16[1], d17[1], d18[1], d19[1]}, [r0, :128] %tmp0 = bitcast i32* %A to i8* %tmp1 = load <2 x i32>* %B - %tmp2 = call %struct.__neon_int32x2x4_t @llvm.arm.neon.vld4lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int32x2x4_t @llvm.arm.neon.vld4lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 16) %tmp3 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 1 %tmp5 = extractvalue %struct.__neon_int32x2x4_t %tmp2, 2 @@ -290,10 +298,11 @@ define <8 x i16> @vld4laneQi16(i16* %A, <8 x i16>* %B) nounwind { ;CHECK: vld4laneQi16: -;CHECK: vld4.16 +;Check the alignment value. Max for this instruction is 64 bits: +;CHECK: vld4.16 {d16[1], d18[1], d20[1], d22[1]}, [r0, :64] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <8 x i16>* %B - %tmp2 = call %struct.__neon_int16x8x4_t @llvm.arm.neon.vld4lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int16x8x4_t @llvm.arm.neon.vld4lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 16) %tmp3 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 1 %tmp5 = extractvalue %struct.__neon_int16x8x4_t %tmp2, 2 @@ -306,10 +315,11 @@ define <4 x i32> @vld4laneQi32(i32* %A, <4 x i32>* %B) nounwind { ;CHECK: vld4laneQi32: -;CHECK: vld4.32 +;Check the (default) alignment. +;CHECK: vld4.32 {d17[0], d19[0], d21[0], d23[0]}, [r0] %tmp0 = bitcast i32* %A to i8* %tmp1 = load <4 x i32>* %B - %tmp2 = call %struct.__neon_int32x4x4_t @llvm.arm.neon.vld4lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 1, i32 1) + %tmp2 = call %struct.__neon_int32x4x4_t @llvm.arm.neon.vld4lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 1) %tmp3 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 0 %tmp4 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 1 %tmp5 = extractvalue %struct.__neon_int32x4x4_t %tmp2, 2 Modified: llvm/trunk/test/CodeGen/ARM/vstlane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vstlane.ll?rev=116776&r1=116775&r2=116776&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vstlane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vstlane.ll Mon Oct 18 19:16:32 2010 @@ -2,18 +2,20 @@ define void @vst2lanei8(i8* %A, <8 x i8>* %B) nounwind { ;CHECK: vst2lanei8: -;CHECK: vst2.8 +;Check the alignment value. Max for this instruction is 16 bits: +;CHECK: vst2.8 {d16[1], d17[1]}, [r0, :16] %tmp1 = load <8 x i8>* %B - call void @llvm.arm.neon.vst2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1) + call void @llvm.arm.neon.vst2lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 4) ret void } define void @vst2lanei16(i16* %A, <4 x i16>* %B) nounwind { ;CHECK: vst2lanei16: -;CHECK: vst2.16 +;Check the alignment value. Max for this instruction is 32 bits: +;CHECK: vst2.16 {d16[1], d17[1]}, [r0, :32] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <4 x i16>* %B - call void @llvm.arm.neon.vst2lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 1) + call void @llvm.arm.neon.vst2lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8) ret void } @@ -37,19 +39,21 @@ define void @vst2laneQi16(i16* %A, <8 x i16>* %B) nounwind { ;CHECK: vst2laneQi16: -;CHECK: vst2.16 +;Check the (default) alignment. +;CHECK: vst2.16 {d17[1], d19[1]}, [r0] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <8 x i16>* %B - call void @llvm.arm.neon.vst2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 1) + call void @llvm.arm.neon.vst2lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 5, i32 1) ret void } define void @vst2laneQi32(i32* %A, <4 x i32>* %B) nounwind { ;CHECK: vst2laneQi32: -;CHECK: vst2.32 +;Check the alignment value. Max for this instruction is 64 bits: +;CHECK: vst2.32 {d17[0], d19[0]}, [r0, :64] %tmp0 = bitcast i32* %A to i8* %tmp1 = load <4 x i32>* %B - call void @llvm.arm.neon.vst2lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 1) + call void @llvm.arm.neon.vst2lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 16) ret void } @@ -81,10 +85,11 @@ define void @vst3lanei16(i16* %A, <4 x i16>* %B) nounwind { ;CHECK: vst3lanei16: -;CHECK: vst3.16 +;Check the (default) alignment value. VST3 does not support alignment. +;CHECK: vst3.16 {d16[1], d17[1], d18[1]}, [r0] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <4 x i16>* %B - call void @llvm.arm.neon.vst3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 1) + call void @llvm.arm.neon.vst3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8) ret void } @@ -108,10 +113,11 @@ define void @vst3laneQi16(i16* %A, <8 x i16>* %B) nounwind { ;CHECK: vst3laneQi16: -;CHECK: vst3.16 +;Check the (default) alignment value. VST3 does not support alignment. +;CHECK: vst3.16 {d17[2], d19[2], d21[2]}, [r0] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <8 x i16>* %B - call void @llvm.arm.neon.vst3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 6, i32 1) + call void @llvm.arm.neon.vst3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 6, i32 8) ret void } @@ -145,9 +151,10 @@ define void @vst4lanei8(i8* %A, <8 x i8>* %B) nounwind { ;CHECK: vst4lanei8: -;CHECK: vst4.8 +;Check the alignment value. Max for this instruction is 32 bits: +;CHECK: vst4.8 {d16[1], d17[1], d18[1], d19[1]}, [r0, :32] %tmp1 = load <8 x i8>* %B - call void @llvm.arm.neon.vst4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 1) + call void @llvm.arm.neon.vst4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 8) ret void } @@ -162,10 +169,11 @@ define void @vst4lanei32(i32* %A, <2 x i32>* %B) nounwind { ;CHECK: vst4lanei32: -;CHECK: vst4.32 +;Check the alignment value. Max for this instruction is 128 bits: +;CHECK: vst4.32 {d16[1], d17[1], d18[1], d19[1]}, [r0, :128] %tmp0 = bitcast i32* %A to i8* %tmp1 = load <2 x i32>* %B - call void @llvm.arm.neon.vst4lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 1) + call void @llvm.arm.neon.vst4lane.v2i32(i8* %tmp0, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, <2 x i32> %tmp1, i32 1, i32 16) ret void } @@ -180,16 +188,18 @@ define void @vst4laneQi16(i16* %A, <8 x i16>* %B) nounwind { ;CHECK: vst4laneQi16: -;CHECK: vst4.16 +;Check the alignment value. Max for this instruction is 64 bits: +;CHECK: vst4.16 {d17[3], d19[3], d21[3], d23[3]}, [r0, :64] %tmp0 = bitcast i16* %A to i8* %tmp1 = load <8 x i16>* %B - call void @llvm.arm.neon.vst4lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 7, i32 1) + call void @llvm.arm.neon.vst4lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 7, i32 16) ret void } define void @vst4laneQi32(i32* %A, <4 x i32>* %B) nounwind { ;CHECK: vst4laneQi32: -;CHECK: vst4.32 +;Check the (default) alignment. +;CHECK: vst4.32 {d17[0], d19[0], d21[0], d23[0]}, [r0] %tmp0 = bitcast i32* %A to i8* %tmp1 = load <4 x i32>* %B call void @llvm.arm.neon.vst4lane.v4i32(i8* %tmp0, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, <4 x i32> %tmp1, i32 2, i32 1) From echristo at apple.com Mon Oct 18 19:19:49 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 19 Oct 2010 00:19:49 -0000 Subject: [llvm-commits] [llvm] r116777 - in /llvm/trunk/test: MC/ELF/ Scripts/ Message-ID: <20101019001949.DBADA2A6C12C@llvm.org> Author: echristo Date: Mon Oct 18 19:19:49 2010 New Revision: 116777 URL: http://llvm.org/viewvc/llvm-project?rev=116777&view=rev Log: Speculatively revert 116753 and 116756 to attempt to fix the bots. Modified: llvm/trunk/test/MC/ELF/alias.s llvm/trunk/test/MC/ELF/align-bss.s llvm/trunk/test/MC/ELF/align-nops.s llvm/trunk/test/MC/ELF/align-size.s llvm/trunk/test/MC/ELF/align-text.s llvm/trunk/test/MC/ELF/align.s llvm/trunk/test/MC/ELF/basic-elf.ll llvm/trunk/test/MC/ELF/common.s llvm/trunk/test/MC/ELF/common2.s llvm/trunk/test/MC/ELF/diff.s llvm/trunk/test/MC/ELF/empty.s llvm/trunk/test/MC/ELF/entsize.ll llvm/trunk/test/MC/ELF/entsize.s llvm/trunk/test/MC/ELF/file.s llvm/trunk/test/MC/ELF/got.s llvm/trunk/test/MC/ELF/local-reloc.s llvm/trunk/test/MC/ELF/merge.s llvm/trunk/test/MC/ELF/norelocation.s llvm/trunk/test/MC/ELF/pic-diff.s llvm/trunk/test/MC/ELF/plt.s llvm/trunk/test/MC/ELF/relax.s llvm/trunk/test/MC/ELF/relocation-386.s llvm/trunk/test/MC/ELF/relocation.s llvm/trunk/test/MC/ELF/section.s llvm/trunk/test/MC/ELF/size.s llvm/trunk/test/MC/ELF/sleb.s llvm/trunk/test/MC/ELF/uleb.s llvm/trunk/test/MC/ELF/undef.s llvm/trunk/test/MC/ELF/undef2.s llvm/trunk/test/MC/ELF/weak.s llvm/trunk/test/MC/ELF/zero.s llvm/trunk/test/Scripts/elf-dump Modified: llvm/trunk/test/MC/ELF/alias.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/alias.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/alias.s (original) +++ llvm/trunk/test/MC/ELF/alias.s Mon Oct 18 19:19:49 2010 @@ -15,70 +15,70 @@ foo4: bar4 = foo4 -// CHECK: # Symbol 0x1 -// CHECK-NEXT: (('st_name', 0x5) # 'bar' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK: # Symbol 1 +// CHECK-NEXT: (('st_name', 5) # 'bar' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 0x2 -// CHECK-NEXT: (('st_name', 0x1d) # 'bar4' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x2) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 2 +// CHECK-NEXT: (('st_name', 29) # 'bar4' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 2) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 0x3 -// CHECK-NEXT: (('st_name', 0x1) # 'foo' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 3 +// CHECK-NEXT: (('st_name', 1) # 'foo' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 0x4 -// CHECK-NEXT: (('st_name', 0xe) # 'foo3' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 4 +// CHECK-NEXT: (('st_name', 14) # 'foo3' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 0x5 -// CHECK-NEXT: (('st_name', 0x18) # 'foo4' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x2) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 5 +// CHECK-NEXT: (('st_name', 24) # 'foo4' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 2) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 0x6 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x7 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x8 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x9 -// CHECK-NEXT: (('st_name', 0x13) # 'bar3' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) -// CHECK: # Symbol 0xa -// CHECK-NEXT: (('st_name', 0x9) # 'bar2' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x0) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 6 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 7 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 8 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 9 +// CHECK-NEXT: (('st_name', 19) # 'bar3' +// CHECK-NEXT: ('st_bind', 1) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 10 +// CHECK-NEXT: (('st_name', 9) # 'bar2' +// CHECK-NEXT: ('st_bind', 1) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 0) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) Modified: llvm/trunk/test/MC/ELF/align-bss.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-bss.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-bss.s (original) +++ llvm/trunk/test/MC/ELF/align-bss.s Mon Oct 18 19:19:49 2010 @@ -5,13 +5,13 @@ .local foo .comm foo,2048,16 -// CHECK: ('sh_name', 0xd) # '.bss' -// CHECK-NEXT: ('sh_type', 0x8) -// CHECK-NEXT: ('sh_flags', 0x3) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x800) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x10) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK: ('sh_name', 13) # '.bss' +// CHECK-NEXT: ('sh_type', 8) +// CHECK-NEXT: ('sh_flags', 3) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 2048) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 16) +// CHECK-NEXT: ('sh_entsize', 0) Modified: llvm/trunk/test/MC/ELF/align-nops.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-nops.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-nops.s (original) +++ llvm/trunk/test/MC/ELF/align-nops.s Mon Oct 18 19:19:49 2010 @@ -15,26 +15,26 @@ .long 0 .align 8 -// CHECK: (('sh_name', 0x1) # '.text' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x6) +// CHECK: (('sh_name', 1) # '.text' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 6) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x10) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x8) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK-NEXT: ('sh_size', 16) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 8) +// CHECK-NEXT: ('sh_entsize', 0) // CHECK-NEXT: ('_section_data', '00000000 0f1f4000 00000000 0f1f4000') -// CHECK: (('sh_name', 0x7) # '.data' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x3) +// CHECK: (('sh_name', 7) # '.data' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 3) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x10) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x8) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK-NEXT: ('sh_size', 16) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 8) +// CHECK-NEXT: ('sh_entsize', 0) // CHECK-NEXT: ('_section_data', '00000000 90909090 00000000 00000000') Modified: llvm/trunk/test/MC/ELF/align-size.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-size.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-size.s (original) +++ llvm/trunk/test/MC/ELF/align-size.s Mon Oct 18 19:19:49 2010 @@ -5,9 +5,9 @@ .zero 4 .align 8 -// CHECK: (('sh_name', 0x1) # '.text' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x6) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x8) +// CHECK: (('sh_name', 1) # '.text' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 6) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 8) Modified: llvm/trunk/test/MC/ELF/align-text.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-text.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-text.s (original) +++ llvm/trunk/test/MC/ELF/align-text.s Mon Oct 18 19:19:49 2010 @@ -6,14 +6,14 @@ .text .zero 1 -// CHECK: (('sh_name', 0x1) # '.text' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x6) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x2) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK: (('sh_name', 1) # '.text' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 6) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 2) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) // CHECK-NEXT: ), Modified: llvm/trunk/test/MC/ELF/align.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align.s (original) +++ llvm/trunk/test/MC/ELF/align.s Mon Oct 18 19:19:49 2010 @@ -7,26 +7,26 @@ .section .rodata,"a", at progbits .align 8 -// CHECK: # Section 0x3 -// CHECK-NEXT: (('sh_name', 0xd) # '.bss' -// CHECK-NEXT: ('sh_type', 0x8) -// CHECK-NEXT: ('sh_flags', 0x3) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x44) -// CHECK-NEXT: ('sh_size', 0x0) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK: # Section 3 +// CHECK-NEXT: (('sh_name', 13) # '.bss' +// CHECK-NEXT: ('sh_type', 8) +// CHECK-NEXT: ('sh_flags', 3) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 68) +// CHECK-NEXT: ('sh_size', 0) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Section 0x4 -// CHECK-NEXT: (('sh_name', 0x12) # '.rodata' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x2) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x48) -// CHECK-NEXT: ('sh_size', 0x0) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x8) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK-NEXT: # Section 4 +// CHECK-NEXT: (('sh_name', 18) # '.rodata' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 2) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 72) +// CHECK-NEXT: ('sh_size', 0) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 8) +// CHECK-NEXT: ('sh_entsize', 0) Modified: llvm/trunk/test/MC/ELF/basic-elf.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/basic-elf.ll?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/basic-elf.ll (original) +++ llvm/trunk/test/MC/ELF/basic-elf.ll Mon Oct 18 19:19:49 2010 @@ -12,100 +12,100 @@ declare i32 @puts(i8* nocapture) nounwind -; 32: ('e_indent[EI_CLASS]', 0x1) -; 32: ('e_indent[EI_DATA]', 0x1) -; 32: ('e_indent[EI_VERSION]', 0x1) +; 32: ('e_indent[EI_CLASS]', 1) +; 32: ('e_indent[EI_DATA]', 1) +; 32: ('e_indent[EI_VERSION]', 1) ; 32: ('_sections', [ ; 32: # Section 0 -; 32: (('sh_name', 0x0) # '' +; 32: (('sh_name', 0) # '' ; 32: # '.text' -; 32: ('st_bind', 0x0) -; 32: ('st_type', 0x3) +; 32: ('st_bind', 0) +; 32: ('st_type', 3) -; 32: ('st_bind', 0x0) -; 32: ('st_type', 0x3) +; 32: ('st_bind', 0) +; 32: ('st_type', 3) -; 32: ('st_bind', 0x0) -; 32: ('st_type', 0x3) +; 32: ('st_bind', 0) +; 32: ('st_type', 3) ; 32: # 'main' -; 32: ('st_bind', 0x1) -; 32-NEXT: ('st_type', 0x2) +; 32: ('st_bind', 1) +; 32-NEXT: ('st_type', 2) ; 32: # 'puts' -; 32: ('st_bind', 0x1) -; 32-NEXT: ('st_type', 0x0) +; 32: ('st_bind', 1) +; 32-NEXT: ('st_type', 0) ; 32: # '.rel.text' ; 32: ('_relocations', [ -; 32: # Relocation 0x0 -; 32: (('r_offset', 0x6) -; 32: ('r_type', 0x1) +; 32: # Relocation 0 +; 32: (('r_offset', 6) +; 32: ('r_type', 1) ; 32: ), -; 32: # Relocation 0x1 -; 32: (('r_offset', 0xb) -; 32: ('r_type', 0x2) +; 32: # Relocation 1 +; 32: (('r_offset', 11) +; 32: ('r_type', 2) ; 32: ), -; 32: # Relocation 0x2 -; 32: (('r_offset', 0x12) -; 32: ('r_type', 0x1) +; 32: # Relocation 2 +; 32: (('r_offset', 18) +; 32: ('r_type', 1) ; 32: ), -; 32: # Relocation 0x3 -; 32: (('r_offset', 0x17) -; 32: ('r_type', 0x2) +; 32: # Relocation 3 +; 32: (('r_offset', 23) +; 32: ('r_type', 2) ; 32: ), ; 32: ]) -; 64: ('e_indent[EI_CLASS]', 0x2) -; 64: ('e_indent[EI_DATA]', 0x1) -; 64: ('e_indent[EI_VERSION]', 0x1) +; 64: ('e_indent[EI_CLASS]', 2) +; 64: ('e_indent[EI_DATA]', 1) +; 64: ('e_indent[EI_VERSION]', 1) ; 64: ('_sections', [ ; 64: # Section 0 -; 64: (('sh_name', 0x0) # '' +; 64: (('sh_name', 0) # '' ; 64: # '.text' -; 64: ('st_bind', 0x0) -; 64: ('st_type', 0x3) +; 64: ('st_bind', 0) +; 64: ('st_type', 3) -; 64: ('st_bind', 0x0) -; 64: ('st_type', 0x3) +; 64: ('st_bind', 0) +; 64: ('st_type', 3) -; 64: ('st_bind', 0x0) -; 64: ('st_type', 0x3) +; 64: ('st_bind', 0) +; 64: ('st_type', 3) ; 64: # 'main' -; 64-NEXT: ('st_bind', 0x1) -; 64-NEXT: ('st_type', 0x2) +; 64-NEXT: ('st_bind', 1) +; 64-NEXT: ('st_type', 2) ; 64: # 'puts' -; 64-NEXT: ('st_bind', 0x1) -; 64-NEXT: ('st_type', 0x0) +; 64-NEXT: ('st_bind', 1) +; 64-NEXT: ('st_type', 0) ; 64: # '.rela.text' ; 64: ('_relocations', [ -; 64: # Relocation 0x0 -; 64: (('r_offset', 0x5) -; 64: ('r_type', 0xa) -; 64: ('r_addend', 0x0) +; 64: # Relocation 0 +; 64: (('r_offset', 5) +; 64: ('r_type', 10) +; 64: ('r_addend', 0) ; 64: ), -; 64: # Relocation 0x1 -; 64: (('r_offset', 0xa) -; 64: ('r_type', 0x2) -; 64: ('r_addend', -0x4) +; 64: # Relocation 1 +; 64: (('r_offset', 10) +; 64: ('r_type', 2) +; 64: ('r_addend', -4) ; 64: ), -; 64: # Relocation 0x2 -; 64: (('r_offset', 0xf) -; 64: ('r_type', 0xa) -; 64: ('r_addend', 0x6) +; 64: # Relocation 2 +; 64: (('r_offset', 15) +; 64: ('r_type', 10) +; 64: ('r_addend', 6) ; 64: ), -; 64: # Relocation 0x3 -; 64: (('r_offset', 0x14) -; 64: ('r_type', 0x2) -; 64: ('r_addend', -0x4) +; 64: # Relocation 3 +; 64: (('r_offset', 20) +; 64: ('r_type', 2) +; 64: ('r_addend', -4) ; 64: ), ; 64: ]) Modified: llvm/trunk/test/MC/ELF/common.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/common.s (original) +++ llvm/trunk/test/MC/ELF/common.s Mon Oct 18 19:19:49 2010 @@ -8,13 +8,13 @@ .local common1 .comm common1,1,1 -// CHECK: ('st_name', 0x1) # 'common1' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x1) -// CHECK-NEXT: ('st_other', 0x0) +// CHECK: ('st_name', 1) # 'common1' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 1) +// CHECK-NEXT: ('st_other', 0) // CHECK-NEXT: ('st_shndx', -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 1) // Same as common1, but with directives in a different order. @@ -22,25 +22,25 @@ .type common2, at object .comm common2,1,1 -// CHECK: ('st_name', 0x9) # 'common2' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x1) -// CHECK-NEXT: ('st_other', 0x0) +// CHECK: ('st_name', 9) # 'common2' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 1) +// CHECK-NEXT: ('st_other', 0) // CHECK-NEXT: ('st_shndx', -// CHECK-NEXT: ('st_value', 0x1) -// CHECK-NEXT: ('st_size', 0x1) +// CHECK-NEXT: ('st_value', 1) +// CHECK-NEXT: ('st_size', 1) // Test that without an explicit .local we produce a global. .type common3, at object .comm common3,4,4 -// CHECK: ('st_name', 0x11) # 'common3' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK-NEXT: ('st_type', 0x1) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0xfff2) -// CHECK-NEXT: ('st_value', 0x4) -// CHECK-NEXT: ('st_size', 0x4) +// CHECK: ('st_name', 17) # 'common3' +// CHECK-NEXT: ('st_bind', 1) +// CHECK-NEXT: ('st_type', 1) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 65522) +// CHECK-NEXT: ('st_value', 4) +// CHECK-NEXT: ('st_size', 4) // Test that without an explicit .local we produce a global, even if the first @@ -54,10 +54,10 @@ .type common4, at object .comm common4,40,16 -// CHECK: ('st_name', 0x1d) # 'common4' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK-NEXT: ('st_type', 0x1) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0xfff2) -// CHECK-NEXT: ('st_value', 0x10) -// CHECK-NEXT: ('st_size', 0x28) +// CHECK: ('st_name', 29) # 'common4' +// CHECK-NEXT: ('st_bind', 1) +// CHECK-NEXT: ('st_type', 1) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 65522) +// CHECK-NEXT: ('st_value', 16) +// CHECK-NEXT: ('st_size', 40) Modified: llvm/trunk/test/MC/ELF/common2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common2.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/common2.s (original) +++ llvm/trunk/test/MC/ELF/common2.s Mon Oct 18 19:19:49 2010 @@ -9,12 +9,12 @@ .zero 1 .align 8 -// CHECK: (('sh_name', 0xd) # '.bss' +// CHECK: (('sh_name', 13) # '.bss' // CHECK-NEXT: ('sh_type', // CHECK-NEXT: ('sh_flags' // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x9) +// CHECK-NEXT: ('sh_size', 9) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', // CHECK-NEXT: ('sh_addralign', Modified: llvm/trunk/test/MC/ELF/diff.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/diff.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/diff.s (original) +++ llvm/trunk/test/MC/ELF/diff.s Mon Oct 18 19:19:49 2010 @@ -8,8 +8,8 @@ zed: mov zed+(bar-foo), %eax -// CHECK: # Relocation 0x0 -// CHECK-NEXT: (('r_offset', 0x5) -// CHECK-NEXT: ('r_sym', 0x6) -// CHECK-NEXT: ('r_type', 0xb) -// CHECK-NEXT: ('r_addend', 0x1) +// CHECK: # Relocation 0 +// CHECK-NEXT: (('r_offset', 5) +// CHECK-NEXT: ('r_sym', 6) +// CHECK-NEXT: ('r_type', 11) +// CHECK-NEXT: ('r_addend', 1) Modified: llvm/trunk/test/MC/ELF/empty.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/empty.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/empty.s (original) +++ llvm/trunk/test/MC/ELF/empty.s Mon Oct 18 19:19:49 2010 @@ -3,68 +3,68 @@ // Test that like gnu as we create text, data and bss by default. Also test // that shstrtab, symtab and strtab are listed in that order. -// CHECK: ('sh_name', 0x1) # '.text' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x6) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x0) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) - -// CHECK: ('sh_name', 0x7) # '.data' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x3) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x0) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) - -// CHECK: ('sh_name', 0xd) # '.bss' -// CHECK-NEXT: ('sh_type', 0x8) -// CHECK-NEXT: ('sh_flags', 0x3) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x0) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) - -// CHECK: ('sh_name', 0x12) # '.shstrtab' -// CHECK-NEXT: ('sh_type', 0x3) -// CHECK-NEXT: ('sh_flags', 0x0) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x2c) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x1) -// CHECK-NEXT: ('sh_entsize', 0x0) - -// CHECK: ('sh_name', 0x1c) # '.symtab' -// CHECK-NEXT: ('sh_type', 0x2) -// CHECK-NEXT: ('sh_flags', 0x0) -// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK: ('sh_name', 1) # '.text' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 6) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 0) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) + +// CHECK: ('sh_name', 7) # '.data' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 3) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 0) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) + +// CHECK: ('sh_name', 13) # '.bss' +// CHECK-NEXT: ('sh_type', 8) +// CHECK-NEXT: ('sh_flags', 3) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 0) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) + +// CHECK: ('sh_name', 18) # '.shstrtab' +// CHECK-NEXT: ('sh_type', 3) +// CHECK-NEXT: ('sh_flags', 0) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 44) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 1) +// CHECK-NEXT: ('sh_entsize', 0) + +// CHECK: ('sh_name', 28) # '.symtab' +// CHECK-NEXT: ('sh_type', 2) +// CHECK-NEXT: ('sh_flags', 0) +// CHECK-NEXT: ('sh_addr', 0) // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x60) -// CHECK-NEXT: ('sh_link', 0x6) -// CHECK-NEXT: ('sh_info', 0x4) -// CHECK-NEXT: ('sh_addralign', 0x8) -// CHECK-NEXT: ('sh_entsize', 0x18) - -// CHECK: ('sh_name', 0x24) # '.strtab' -// CHECK-NEXT: ('sh_type', 0x3) -// CHECK-NEXT: ('sh_flags', 0x0) -// CHECK-NEXT: ('sh_addr', 0x0) +// CHECK-NEXT: ('sh_size', 96) +// CHECK-NEXT: ('sh_link', 6) +// CHECK-NEXT: ('sh_info', 4) +// CHECK-NEXT: ('sh_addralign', 8) +// CHECK-NEXT: ('sh_entsize', 24) + +// CHECK: ('sh_name', 36) # '.strtab' +// CHECK-NEXT: ('sh_type', 3) +// CHECK-NEXT: ('sh_flags', 0) +// CHECK-NEXT: ('sh_addr', 0) // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x1) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x1) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK-NEXT: ('sh_size', 1) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 1) +// CHECK-NEXT: ('sh_entsize', 0) Modified: llvm/trunk/test/MC/ELF/entsize.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/entsize.ll?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/entsize.ll (original) +++ llvm/trunk/test/MC/ELF/entsize.ll Mon Oct 18 19:19:49 2010 @@ -20,25 +20,25 @@ ;;;;; -; 64: (('sh_name', 0x12) # '.rodata.str1.1' -; 64-NEXT: ('sh_type', 0x1) -; 64-NEXT: ('sh_flags', 0x32) +; 64: (('sh_name', 18) # '.rodata.str1.1' +; 64-NEXT: ('sh_type', 1) +; 64-NEXT: ('sh_flags', 50) ; 64-NEXT: ('sh_addr', ; 64-NEXT: ('sh_offset', -; 64-NEXT: ('sh_size', 0xd) +; 64-NEXT: ('sh_size', 13) ; 64-NEXT: ('sh_link', ; 64-NEXT: ('sh_info', -; 64-NEXT: ('sh_addralign', 0x1) -; 64-NEXT: ('sh_entsize', 0x1) +; 64-NEXT: ('sh_addralign', 1) +; 64-NEXT: ('sh_entsize', 1) -; 64: (('sh_name', 0x21) # '.rodata.cst8' -; 64-NEXT: ('sh_type', 0x1) -; 64-NEXT: ('sh_flags', 0x12) +; 64: (('sh_name', 33) # '.rodata.cst8' +; 64-NEXT: ('sh_type', 1) +; 64-NEXT: ('sh_flags', 18) ; 64-NEXT: ('sh_addr', ; 64-NEXT: ('sh_offset', -; 64-NEXT: ('sh_size', 0x10) +; 64-NEXT: ('sh_size', 16) ; 64-NEXT: ('sh_link', ; 64-NEXT: ('sh_info', -; 64-NEXT: ('sh_addralign', 0x8) -; 64-NEXT: ('sh_entsize', 0x8) +; 64-NEXT: ('sh_addralign', 8) +; 64-NEXT: ('sh_entsize', 8) Modified: llvm/trunk/test/MC/ELF/entsize.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/entsize.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/entsize.s (original) +++ llvm/trunk/test/MC/ELF/entsize.s Mon Oct 18 19:19:49 2010 @@ -32,38 +32,38 @@ .quad 42 .quad 42 -// CHECK: # Section 0x4 -// CHECK-NEXT: ('sh_name', 0x12) # '.rodata.str1.1' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x32) +// CHECK: # Section 4 +// CHECK-NEXT: ('sh_name', 18) # '.rodata.str1.1' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 50) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0xd) +// CHECK-NEXT: ('sh_size', 13) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 0x1) -// CHECK-NEXT: ('sh_entsize', 0x1) +// CHECK-NEXT: ('sh_addralign', 1) +// CHECK-NEXT: ('sh_entsize', 1) -// CHECK: # Section 0x5 -// CHECK-NEXT: ('sh_name', 0x21) # '.rodata.str2.1' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x32) +// CHECK: # Section 5 +// CHECK-NEXT: ('sh_name', 33) # '.rodata.str2.1' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 50) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x10) +// CHECK-NEXT: ('sh_size', 16) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 0x1) -// CHECK-NEXT: ('sh_entsize', 0x2) +// CHECK-NEXT: ('sh_addralign', 1) +// CHECK-NEXT: ('sh_entsize', 2) -// CHECK: # Section 0x6 -// CHECK-NEXT: ('sh_name', 0x30) # '.rodata.cst8 -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x12) +// CHECK: # Section 6 +// CHECK-NEXT: ('sh_name', 48) # '.rodata.cst8 +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 18) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 0x10) +// CHECK-NEXT: ('sh_size', 16) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 0x1) -// CHECK-NEXT: ('sh_entsize', 0x8) +// CHECK-NEXT: ('sh_addralign', 1) +// CHECK-NEXT: ('sh_entsize', 8) Modified: llvm/trunk/test/MC/ELF/file.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/file.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/file.s (original) +++ llvm/trunk/test/MC/ELF/file.s Mon Oct 18 19:19:49 2010 @@ -4,20 +4,20 @@ .file "foo" foa: -// CHECK: # Symbol 0x1 -// CHECK-NEXT: (('st_name', 0x1) # 'foo' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x4) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0xfff1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK: # Symbol 1 +// CHECK-NEXT: (('st_name', 1) # 'foo' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 4) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 65521) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 0x2 -// CHECK-NEXT: (('st_name', 0x5) # 'foa' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 2 +// CHECK-NEXT: (('st_name', 5) # 'foa' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) Modified: llvm/trunk/test/MC/ELF/got.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/got.s (original) +++ llvm/trunk/test/MC/ELF/got.s Mon Oct 18 19:19:49 2010 @@ -6,20 +6,20 @@ movl foo at GOT, %eax movl foo at GOTPCREL(%rip), %eax -// CHECK: (('st_name', 0x5) # '_GLOBAL_OFFSET_TABLE_' -// CHECK-NEXT: ('st_bind', 0x1) +// CHECK: (('st_name', 5) # '_GLOBAL_OFFSET_TABLE_' +// CHECK-NEXT: ('st_bind', 1) // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0x0 +// CHECK-NEXT: # Relocation 0 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 0x3) +// CHECK-NEXT: ('r_type', 3) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 0x1 +// CHECK-NEXT: # Relocation 1 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 0x9) +// CHECK-NEXT: ('r_type', 9) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/local-reloc.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/local-reloc.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/local-reloc.s (original) +++ llvm/trunk/test/MC/ELF/local-reloc.s Mon Oct 18 19:19:49 2010 @@ -7,24 +7,24 @@ foo: // Section number 1 is .text -// CHECK: # Section 0x1 -// CHECK-next: (('sh_name', 0x1) # '.text' +// CHECK: # Section 1 +// CHECK-next: (('sh_name', 1) # '.text' // Symbol number 2 is section number 1 -// CHECK: # Symbol 0x2 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x3) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x1) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK: # Symbol 2 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 3) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 1) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // Relocation refers to symbol number 2 // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0x0 +// CHECK-NEXT: # Relocation 0 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x2) +// CHECK-NEXT: ('r_sym', 2) // CHECK-NEXT: ('r_type', // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), Modified: llvm/trunk/test/MC/ELF/merge.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/merge.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/merge.s (original) +++ llvm/trunk/test/MC/ELF/merge.s Mon Oct 18 19:19:49 2010 @@ -23,75 +23,75 @@ foo: // Section 4 is "sec1" -// CHECK: # Section 0x4 -// CHECK-NEXT: (('sh_name', 0x12) # '.sec1' +// CHECK: # Section 4 +// CHECK-NEXT: (('sh_name', 18) # '.sec1' // Symbol number 1 is .Lfoo -// CHECK: # Symbol 0x1 -// CHECK-NEXT: (('st_name', 0x1) # '.Lfoo' +// CHECK: # Symbol 1 +// CHECK-NEXT: (('st_name', 1) # '.Lfoo' // Symbol number 2 is foo -// CHECK: # Symbol 0x2 -// CHECK-NEXT: (('st_name', 0x7) # 'foo' +// CHECK: # Symbol 2 +// CHECK-NEXT: (('st_name', 7) # 'foo' // Symbol number 6 is section 4 -// CHECK: # Symbol 0x6 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x3) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x4) +// CHECK: # Symbol 6 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 3) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 4) // Symbol number 8 is zed -// CHECK: # Symbol 0x8 -// CHECK-NEXT: (('st_name', 0xb) # 'zed' +// CHECK: # Symbol 8 +// CHECK-NEXT: (('st_name', 11) # 'zed' // Relocation 0 refers to symbol 1 // CHECK: ('_relocations', [ // CHECK-NEXT: # Relocation 0 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x1) -// CHECK-NEXT: ('r_type', 0x2 +// CHECK-NEXT: ('r_sym', 1) +// CHECK-NEXT: ('r_type', 2 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 1 refers to symbol 6 -// CHECK-NEXT: # Relocation 0x1 +// CHECK-NEXT: # Relocation 1 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x6) -// CHECK-NEXT: ('r_type', 0xa) +// CHECK-NEXT: ('r_sym', 6) +// CHECK-NEXT: ('r_type', 10) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 2 refers to symbol 1 -// CHECK-NEXT: # Relocation 0x2 +// CHECK-NEXT: # Relocation 2 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x1) -// CHECK-NEXT: ('r_type', 0xa +// CHECK-NEXT: ('r_sym', 1) +// CHECK-NEXT: ('r_type', 10 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 3 refers to symbol 2 -// CHECK-NEXT: # Relocation 0x3 +// CHECK-NEXT: # Relocation 3 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0x4 +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 4 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 4 refers to symbol 2 -// CHECK-NEXT: # Relocation 0x4 +// CHECK-NEXT: # Relocation 4 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0x9 +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 9 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 5 refers to symbol 8 -// CHECK-NEXT: # Relocation 0x5 -// CHECK-NEXT: (('r_offset', 0x23) -// CHECK-NEXT: ('r_sym', 0x8) -// CHECK-NEXT: ('r_type', 0xb) -// CHECK-NEXT: ('r_addend', 0x0) +// CHECK-NEXT: # Relocation 5 +// CHECK-NEXT: (('r_offset', 35) +// CHECK-NEXT: ('r_sym', 8) +// CHECK-NEXT: ('r_type', 11) +// CHECK-NEXT: ('r_addend', 0) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/norelocation.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/norelocation.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/norelocation.s (original) +++ llvm/trunk/test/MC/ELF/norelocation.s Mon Oct 18 19:19:49 2010 @@ -3,16 +3,16 @@ call bar bar: -// CHECK: ('sh_name', 0x1) # '.text' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x6) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x5) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK: ('sh_name', 1) # '.text' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 6) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 5) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) // CHECK-NEXT: ('_section_data', 'e8000000 00') // CHECK-NOT: .rela.text // CHECK: shstrtab Modified: llvm/trunk/test/MC/ELF/pic-diff.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/pic-diff.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/pic-diff.s (original) +++ llvm/trunk/test/MC/ELF/pic-diff.s Mon Oct 18 19:19:49 2010 @@ -1,21 +1,21 @@ // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s -// CHECK: # Symbol 0x5 -// CHECK-NEXT: (('st_name', 0x5) # 'baz' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK-NEXT: ('st_type', 0x0) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x0) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK: # Symbol 5 +// CHECK-NEXT: (('st_name', 5) # 'baz' +// CHECK-NEXT: ('st_bind', 1) +// CHECK-NEXT: ('st_type', 0) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 0) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0x0 -// CHECK-NEXT: (('r_offset', 0xc) -// CHECK-NEXT: ('r_sym', 0x5) -// CHECK-NEXT: ('r_type', 0x2) -// CHECK-NEXT: ('r_addend', 0x8) +// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: (('r_offset', 12) +// CHECK-NEXT: ('r_sym', 5) +// CHECK-NEXT: ('r_type', 2) +// CHECK-NEXT: ('r_addend', 8) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/plt.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/plt.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/plt.s (original) +++ llvm/trunk/test/MC/ELF/plt.s Mon Oct 18 19:19:49 2010 @@ -5,10 +5,10 @@ jmp foo at PLT // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0x0 +// CHECK-NEXT: # Relocation 0 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 0x4) +// CHECK-NEXT: ('r_type', 4) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/relax.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relax.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relax.s (original) +++ llvm/trunk/test/MC/ELF/relax.s Mon Oct 18 19:19:49 2010 @@ -12,27 +12,27 @@ jmp bar jmp foo -// CHECK: ('sh_name', 0x1) # '.text' -// CHECK-NEXT: ('sh_type', 0x1) -// CHECK-NEXT: ('sh_flags', 0x6) -// CHECK-NEXT: ('sh_addr', 0x0) -// CHECK-NEXT: ('sh_offset', 0x40) -// CHECK-NEXT: ('sh_size', 0x7) -// CHECK-NEXT: ('sh_link', 0x0) -// CHECK-NEXT: ('sh_info', 0x0) -// CHECK-NEXT: ('sh_addralign', 0x4) -// CHECK-NEXT: ('sh_entsize', 0x0) +// CHECK: ('sh_name', 1) # '.text' +// CHECK-NEXT: ('sh_type', 1) +// CHECK-NEXT: ('sh_flags', 6) +// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_offset', 64) +// CHECK-NEXT: ('sh_size', 7) +// CHECK-NEXT: ('sh_link', 0) +// CHECK-NEXT: ('sh_info', 0) +// CHECK-NEXT: ('sh_addralign', 4) +// CHECK-NEXT: ('sh_entsize', 0) // CHECK-NEXT: ('_section_data', 'ebfee900 000000') -// CHECK: # Symbol 0x5 -// CHECK-NEXT: (('st_name', 0x5) # 'foo' +// CHECK: # Symbol 5 +// CHECK-NEXT: (('st_name', 5) # 'foo' // CHECK: .rela.text // CHECK: ('_relocations', [ -// CHECK-NEXT: Relocation 0x0 -// CHECK-NEXT: (('r_offset', 0x3) -// CHECK-NEXT: ('r_sym', 0x5) -// CHECK-NEXT: ('r_type', 0x2) -// CHECK-NEXT: ('r_addend', -0x4) +// CHECK-NEXT: Relocation 0 +// CHECK-NEXT: (('r_offset', 3) +// CHECK-NEXT: ('r_sym', 5) +// CHECK-NEXT: ('r_type', 2) +// CHECK-NEXT: ('r_addend', -4) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Mon Oct 18 19:19:49 2010 @@ -4,50 +4,50 @@ // to .Lfoo uses the symbol and not the section. // Section 3 is bss -// CHECK: # Section 0x3 -// CHECK-NEXT: (('sh_name', 0xd) # '.bss' +// CHECK: # Section 3 +// CHECK-NEXT: (('sh_name', 13) # '.bss' -// CHECK: # Symbol 0x1 -// CHECK-NEXT: (('st_name', 0x5) # '.Lfoo' +// CHECK: # Symbol 1 +// CHECK-NEXT: (('st_name', 5) # '.Lfoo' // Symbol 6 is section 3 -// CHECK: # Symbol 0x6 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) -// CHECK-NEXT: ('st_bind', 0x0) -// CHECK-NEXT: ('st_type', 0x3) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x3) - -// CHECK: # Relocation 0x0 -// CHECK-NEXT: (('r_offset', 0x2) -// CHECK-NEXT: ('r_sym', 0x1) -// CHECK-NEXT: ('r_type', 0x9) +// CHECK: # Symbol 6 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: ('st_bind', 0) +// CHECK-NEXT: ('st_type', 3) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 3) + +// CHECK: # Relocation 0 +// CHECK-NEXT: (('r_offset', 2) +// CHECK-NEXT: ('r_sym', 1) +// CHECK-NEXT: ('r_type', 9) // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 0x1 +// CHECK-NEXT: # Relocation 1 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 0x4) +// CHECK-NEXT: ('r_type', 4) // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 0x2 +// CHECK-NEXT: # Relocation 2 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 0xa) +// CHECK-NEXT: ('r_type', 10) // CHECK-NEXT: ), // Relocation 3 (bar3 at GOTOFF) is done with symbol 6 (bss) -// CHECK-NEXT: # Relocation 0x3 +// CHECK-NEXT: # Relocation 3 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 0x6 +// CHECK-NEXT: ('r_sym', 6 // CHECK-NEXT: ('r_type', // CHECK-NEXT: ), // Relocation 4 (bar2 at GOT) is of type R_386_GOT32 -// CHECK-NEXT: # Relocation 0x4 +// CHECK-NEXT: # Relocation 4 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 0x3 +// CHECK-NEXT: ('r_type', 3 // CHECK-NEXT: ), .text Modified: llvm/trunk/test/MC/ELF/relocation.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation.s (original) +++ llvm/trunk/test/MC/ELF/relocation.s Mon Oct 18 19:19:49 2010 @@ -10,48 +10,48 @@ movq bar, %rdx // R_X86_64_32S .long bar // R_X86_64_32 -// CHECK: # Section 0x1 -// CHECK: (('sh_name', 0x1) # '.text' +// CHECK: # Section 1 +// CHECK: (('sh_name', 1) # '.text' -// CHECK: # Symbol 0x2 -// CHECK: (('st_name', 0x0) # '' -// CHECK: ('st_bind', 0x0) -// CHECK ('st_type', 0x3) -// CHECK: ('st_other', 0x0) -// CHECK: ('st_shndx', 0x1) +// CHECK: # Symbol 2 +// CHECK: (('st_name', 0) # '' +// CHECK: ('st_bind', 0) +// CHECK ('st_type', 3) +// CHECK: ('st_other', 0) +// CHECK: ('st_shndx', 1) -// CHECK: # Relocation 0x0 -// CHECK-NEXT: (('r_offset', 0x1) -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0xa) +// CHECK: # Relocation 0 +// CHECK-NEXT: (('r_offset', 1) +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 10) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 0x1 -// CHECK-NEXT: (('r_offset', 0x8) -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0xb) +// CHECK: # Relocation 1 +// CHECK-NEXT: (('r_offset', 8) +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 11) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 0x2 -// CHECK-NEXT: (('r_offset', 0x13) -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0xb) +// CHECK: # Relocation 2 +// CHECK-NEXT: (('r_offset', 19) +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 11) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 0x3 -// CHECK-NEXT: (('r_offset', 0x1a) -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0xb) +// CHECK: # Relocation 3 +// CHECK-NEXT: (('r_offset', 26) +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 11) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 0x4 -// CHECK-NEXT: (('r_offset', 0x22) -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0xb) +// CHECK: # Relocation 4 +// CHECK-NEXT: (('r_offset', 34) +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 11) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 0x5 -// CHECK-NEXT: (('r_offset', 0x26) -// CHECK-NEXT: ('r_sym', 0x2) -// CHECK-NEXT: ('r_type', 0xa) +// CHECK: # Relocation 5 +// CHECK-NEXT: (('r_offset', 38) +// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_type', 10) // CHECK-NEXT: ('r_addend', Modified: llvm/trunk/test/MC/ELF/section.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/section.s (original) +++ llvm/trunk/test/MC/ELF/section.s Mon Oct 18 19:19:49 2010 @@ -6,6 +6,6 @@ .section .note.GNU-,"", at progbits .section -.note.GNU,"", at progbits -// CHECK: ('sh_name', 0x12) # '.note.GNU-stack' -// CHECK: ('sh_name', 0x22) # '.note.GNU-' -// CHECK: ('sh_name', 0x2d) # '-.note.GNU' +// CHECK: ('sh_name', 18) # '.note.GNU-stack' +// CHECK: ('sh_name', 34) # '.note.GNU-' +// CHECK: ('sh_name', 45) # '-.note.GNU' Modified: llvm/trunk/test/MC/ELF/size.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/size.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/size.s (original) +++ llvm/trunk/test/MC/ELF/size.s Mon Oct 18 19:19:49 2010 @@ -2,8 +2,8 @@ // Mostly a test that this doesn't crash anymore. -// CHECK: # Symbol 0x4 -// CHECK-NEXT: (('st_name', 0x1) # 'foo' -// CHECK-NEXT: ('st_bind', 0x1) +// CHECK: # Symbol 4 +// CHECK-NEXT: (('st_name', 1) # 'foo' +// CHECK-NEXT: ('st_bind', 1) .size foo, .Lbar-foo Modified: llvm/trunk/test/MC/ELF/sleb.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/sleb.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/sleb.s (original) +++ llvm/trunk/test/MC/ELF/sleb.s Mon Oct 18 19:19:49 2010 @@ -19,9 +19,9 @@ .sleb128 8193 -// ELF_32: ('sh_name', 0x1) # '.text' +// ELF_32: ('sh_name', 1) # '.text' // ELF_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') -// ELF_64: ('sh_name', 0x1) # '.text' +// ELF_64: ('sh_name', 1) # '.text' // ELF_64: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // MACHO_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') Modified: llvm/trunk/test/MC/ELF/uleb.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/uleb.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/uleb.s (original) +++ llvm/trunk/test/MC/ELF/uleb.s Mon Oct 18 19:19:49 2010 @@ -12,9 +12,9 @@ .uleb128 16383 .uleb128 16384 -// ELF_32: ('sh_name', 0x1) # '.text' +// ELF_32: ('sh_name', 1) # '.text' // ELF_32: ('_section_data', '00017f80 01ff7f80 8001') -// ELF_64: ('sh_name', 0x1) # '.text' +// ELF_64: ('sh_name', 1) # '.text' // ELF_64: ('_section_data', '00017f80 01ff7f80 8001') // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // MACHO_32: ('_section_data', '00017f80 01ff7f80 8001') Modified: llvm/trunk/test/MC/ELF/undef.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/undef.s (original) +++ llvm/trunk/test/MC/ELF/undef.s Mon Oct 18 19:19:49 2010 @@ -19,27 +19,27 @@ movsd .Lsym8(%rip), %xmm1 // CHECK: ('_symbols', [ -// CHECK-NEXT: # Symbol 0x0 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x1 -// CHECK-NEXT: (('st_name', 0xd) # '.Lsym8' -// CHECK: # Symbol 0x2 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x3 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x4 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x5 -// CHECK-NEXT: (('st_name', 0x0) # '' -// CHECK: # Symbol 0x6 -// CHECK-NEXT: (('st_name', 0x1) # '.Lsym1' -// CHECK: # Symbol 0x7 -// CHECK-NEXT: (('st_name', 0x8) # 'sym6' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK-NEXT: ('st_type', 0x1) -// CHECK-NEXT: ('st_other', 0x0) -// CHECK-NEXT: ('st_shndx', 0x0) -// CHECK-NEXT: ('st_value', 0x0) -// CHECK-NEXT: ('st_size', 0x0) +// CHECK-NEXT: # Symbol 0 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 1 +// CHECK-NEXT: (('st_name', 13) # '.Lsym8' +// CHECK: # Symbol 2 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 3 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 4 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 5 +// CHECK-NEXT: (('st_name', 0) # '' +// CHECK: # Symbol 6 +// CHECK-NEXT: (('st_name', 1) # '.Lsym1' +// CHECK: # Symbol 7 +// CHECK-NEXT: (('st_name', 8) # 'sym6' +// CHECK-NEXT: ('st_bind', 1) +// CHECK-NEXT: ('st_type', 1) +// CHECK-NEXT: ('st_other', 0) +// CHECK-NEXT: ('st_shndx', 0) +// CHECK-NEXT: ('st_value', 0) +// CHECK-NEXT: ('st_size', 0) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/undef2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef2.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/undef2.s (original) +++ llvm/trunk/test/MC/ELF/undef2.s Mon Oct 18 19:19:49 2010 @@ -5,6 +5,6 @@ je .Lfoo // CHECK: ('_symbols', [ -// CHECK: (('st_name', 0x1) # '.Lfoo' -// CHECK-NEXT: ('st_bind', 0x1) -// CHECK: (('sh_name', 0x24) # '.strtab' +// CHECK: (('st_name', 1) # '.Lfoo' +// CHECK-NEXT: ('st_bind', 1) +// CHECK: (('sh_name', 36) # '.strtab' Modified: llvm/trunk/test/MC/ELF/weak.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/weak.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/weak.s (original) +++ llvm/trunk/test/MC/ELF/weak.s Mon Oct 18 19:19:49 2010 @@ -9,22 +9,22 @@ .weak bar bar: -//CHECK: # Symbol 0x4 -//CHECK-NEXT: (('st_name', 0x5) # 'bar' -//CHECK-NEXT: ('st_bind', 0x2) -//CHECK-NEXT: ('st_type', 0x0) -//CHECK-NEXT: ('st_other', 0x0) -//CHECK-NEXT: ('st_shndx', 0x1) -//CHECK-NEXT: ('st_value', 0x0) -//CHECK-NEXT: ('st_size', 0x0) +//CHECK: # Symbol 4 +//CHECK-NEXT: (('st_name', 5) # 'bar' +//CHECK-NEXT: ('st_bind', 2) +//CHECK-NEXT: ('st_type', 0) +//CHECK-NEXT: ('st_other', 0) +//CHECK-NEXT: ('st_shndx', 1) +//CHECK-NEXT: ('st_value', 0) +//CHECK-NEXT: ('st_size', 0) //CHECK-NEXT: ), -//CHECK-NEXT: # Symbol 0x5 -//CHECK: (('st_name', 0x1) # 'foo' -//CHECK-NEXT: ('st_bind', 0x2) -//CHECK-NEXT: ('st_type', 0x0) -//CHECK-NEXT: ('st_other', 0x0) -//CHECK-NEXT: ('st_shndx', 0x0) -//CHECK-NEXT: ('st_value', 0x0) -//CHECK-NEXT: ('st_size', 0x0) +//CHECK-NEXT: # Symbol 5 +//CHECK: (('st_name', 1) # 'foo' +//CHECK-NEXT: ('st_bind', 2) +//CHECK-NEXT: ('st_type', 0) +//CHECK-NEXT: ('st_other', 0) +//CHECK-NEXT: ('st_shndx', 0) +//CHECK-NEXT: ('st_value', 0) +//CHECK-NEXT: ('st_size', 0) //CHECK-NEXT: ), //CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/zero.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/zero.s?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/zero.s (original) +++ llvm/trunk/test/MC/ELF/zero.s Mon Oct 18 19:19:49 2010 @@ -3,14 +3,14 @@ .zero 4 .zero 1,42 -// CHECK: ('sh_name', 0x1) # '.text' -// CHECK: ('sh_type', 0x1) -// CHECK: ('sh_flags', 0x6) -// CHECK: ('sh_addr', 0x0) -// CHECK: ('sh_offset', 0x40) -// CHECK: ('sh_size', 0x5) -// CHECK: ('sh_link', 0x0) -// CHECK: ('sh_info', 0x0) -// CHECK: ('sh_addralign', 0x4) -// CHECK: ('sh_entsize', 0x0) +// CHECK: ('sh_name', 1) # '.text' +// CHECK: ('sh_type', 1) +// CHECK: ('sh_flags', 6) +// CHECK: ('sh_addr', 0) +// CHECK: ('sh_offset', 64) +// CHECK: ('sh_size', 5) +// CHECK: ('sh_link', 0) +// CHECK: ('sh_info', 0) +// CHECK: ('sh_addralign', 4) +// CHECK: ('sh_entsize', 0) // CHECK: ('_section_data', '00000000 2a') Modified: llvm/trunk/test/Scripts/elf-dump URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/elf-dump?rev=116777&r1=116776&r2=116777&view=diff ============================================================================== --- llvm/trunk/test/Scripts/elf-dump (original) +++ llvm/trunk/test/Scripts/elf-dump Mon Oct 18 19:19:49 2010 @@ -77,16 +77,16 @@ self.sh_entsize = f.readWord() def dump(self, shstrtab, f, strtab, dumpdata): - print " (('sh_name', %s)" % hex(self.sh_name), "# %r" % shstrtab[self.sh_name] - print " ('sh_type', %s)" % hex(self.sh_type) - print " ('sh_flags', %s)" % hex(self.sh_flags) - print " ('sh_addr', %s)" % hex(self.sh_addr) - print " ('sh_offset', %s)" % hex(self.sh_offset) - print " ('sh_size', %s)" % hex(self.sh_size) - print " ('sh_link', %s)" % hex(self.sh_link) - print " ('sh_info', %s)" % hex(self.sh_info) - print " ('sh_addralign', %s)" % hex(self.sh_addralign) - print " ('sh_entsize', %s)" % hex(self.sh_entsize) + print " (('sh_name', %d) # %r" % (self.sh_name, shstrtab[self.sh_name]) + print " ('sh_type', %d)" % self.sh_type + print " ('sh_flags', %d)" % self.sh_flags + print " ('sh_addr', %d)" % self.sh_addr + print " ('sh_offset', %d)" % self.sh_offset + print " ('sh_size', %d)" % self.sh_size + print " ('sh_link', %d)" % self.sh_link + print " ('sh_info', %d)" % self.sh_info + print " ('sh_addralign', %d)" % self.sh_addralign + print " ('sh_entsize', %d)" % self.sh_entsize if self.sh_type == 2: # SHT_SYMTAB print " ('_symbols', [" dumpSymtab(f, self, strtab) @@ -106,20 +106,20 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Symbol %s" % hex(index) + print " # Symbol %d" % index name = f.read32() - print " (('st_name', %s)" % hex(name), "# %r" % strtab[name] + print " (('st_name', %d) # %r" % (name, strtab[name]) if not f.is64Bit: - print " ('st_value', %s)" % hex(f.read32()) - print " ('st_size', %s)" % hex(f.read32()) + print " ('st_value', %d)" % f.read32() + print " ('st_size', %d)" % f.read32() st_info = f.read8() - print " ('st_bind', %s)" % hex((st_info >> 4)) - print " ('st_type', %s)" % hex((st_info & 0xf)) - print " ('st_other', %s)" % hex(f.read8()) - print " ('st_shndx', %s)" % hex(f.read16()) + print " ('st_bind', %d)" % (st_info >> 4) + print " ('st_type', %d)" % (st_info & 0xf) + print " ('st_other', %d)" % f.read8() + print " ('st_shndx', %d)" % f.read16() if f.is64Bit: - print " ('st_value', %s)" % hex(f.read64()) - print " ('st_size', %s)" % hex(f.read64()) + print " ('st_value', %d)" % f.read64() + print " ('st_size', %d)" % f.read64() print " )," def dumpRel(f, section, dumprela = False): @@ -127,17 +127,17 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Relocation %s" % hex(index) - print " (('r_offset', %s)" % hex(f.readWord()) + print " # Relocation %d" % index + print " (('r_offset', %d)" % f.readWord() r_info = f.readWord() if f.is64Bit: - print " ('r_sym', %s)" % hex((r_info >> 32)) - print " ('r_type', %s)" % hex((r_info & 0xffffffff)) + print " ('r_sym', %d)" % (r_info >> 32) + print " ('r_type', %d)" % (r_info & 0xffffffff) else: - print " ('r_sym', %s)" % hex((r_info >> 8)) - print " ('r_type', %s)" % hex((r_info & 0xff)) + print " ('r_sym', %d)" % (r_info >> 8) + print " ('r_type', %d)" % (r_info & 0xff) if dumprela: - print " ('r_addend', %s)" % hex(f.readWordS()) + print " ('r_addend', %d)" % f.readWordS() print " )," def dumpELF(path, opts): @@ -152,8 +152,8 @@ elif fileclass == 2: # ELFCLASS64 f.is64Bit = True else: - raise ValueError, "Unknown file class %s" % hex(fileclass) - print "('e_indent[EI_CLASS]', %s)" % hex(fileclass) + raise ValueError, "Unknown file class %d" % fileclass + print "('e_indent[EI_CLASS]', %d)" % fileclass byteordering = f.read8() if byteordering == 1: # ELFDATA2LSB @@ -161,32 +161,32 @@ elif byteordering == 2: # ELFDATA2MSB f.isLSB = False else: - raise ValueError, "Unknown byte ordering %s" % hex(byteordering) - print "('e_indent[EI_DATA]', %s)" % hex(byteordering) + raise ValueError, "Unknown byte ordering %d" % byteordering + print "('e_indent[EI_DATA]', %d)" % byteordering - print "('e_indent[EI_VERSION]', %s)" % hex(f.read8()) - print "('e_indent[EI_OSABI]', %s)" % hex(f.read8()) - print "('e_indent[EI_ABIVERSION]', %s)" % hex(f.read8()) + print "('e_indent[EI_VERSION]', %d)" % f.read8() + print "('e_indent[EI_OSABI]', %d)" % f.read8() + print "('e_indent[EI_ABIVERSION]', %d)" % f.read8() f.seek(16) # Seek to end of e_ident. - print "('e_type', %s)" % hex(f.read16()) - print "('e_machine', %s)" % hex(f.read16()) - print "('e_version', %s)" % hex(f.read32()) - print "('e_entry', %s)" % hex(f.readWord()) - print "('e_phoff', %s)" % hex(f.readWord()) + print "('e_type', %d)" % f.read16() + print "('e_machine', %d)" % f.read16() + print "('e_version', %d)" % f.read32() + print "('e_entry', %d)" % f.readWord() + print "('e_phoff', %d)" % f.readWord() e_shoff = f.readWord() - print "('e_shoff', %s)" % hex(e_shoff) - print "('e_flags', %s)" % hex(f.read32()) - print "('e_ehsize', %s)" % hex(f.read16()) - print "('e_phentsize', %s)" % hex(f.read16()) - print "('e_phnum', %s)" % hex(f.read16()) + print "('e_shoff', %d)" % e_shoff + print "('e_flags', %d)" % f.read32() + print "('e_ehsize', %d)" % f.read16() + print "('e_phentsize', %d)" % f.read16() + print "('e_phnum', %d)" % f.read16() e_shentsize = f.read16() - print "('e_shentsize', %s)" % hex(e_shentsize) + print "('e_shentsize', %d)" % e_shentsize e_shnum = f.read16() - print "('e_shnum', %s)" % hex(e_shnum) + print "('e_shnum', %d)" % e_shnum e_shstrndx = f.read16() - print "('e_shstrndx', %s)" % hex(e_shstrndx) + print "('e_shstrndx', %d)" % e_shstrndx # Read all section headers sections = [] @@ -209,7 +209,7 @@ print "('_sections', [" for index in range(e_shnum): - print " # Section %s" % hex(index) + print " # Section %d" % index sections[index].dump(shstrtab, f, strtab, opts.dumpSectionData) print "])" From wendling at apple.com Mon Oct 18 19:25:44 2010 From: wendling at apple.com (Bill Wendling) Date: Mon, 18 Oct 2010 17:25:44 -0700 Subject: [llvm-commits] [llvm] r116766 - /llvm/trunk/include/llvm/MC/MCObjectFormat.h In-Reply-To: References: <20101018231851.791912A6C12C@llvm.org> <08E3005E-AD77-4832-BEDA-62DE68A06309@apple.com> Message-ID: <58F7424E-8374-4424-BA43-698A7535B2A6@apple.com> On Oct 18, 2010, at 4:52 PM, Chandler Carruth wrote: > On Mon, Oct 18, 2010 at 4:47 PM, Bill Wendling wrote: > On Oct 18, 2010, at 4:18 PM, Chandler Carruth wrote: > > > Author: chandlerc > > Date: Mon Oct 18 18:18:51 2010 > > New Revision: 116766 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=116766&view=rev > > Log: > > Add a virtual destructor to silence a GCC warning. > > > > Modified: > > llvm/trunk/include/llvm/MC/MCObjectFormat.h > > > > Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h > > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116766&r1=116765&r2=116766&view=diff > > ============================================================================== > > --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) > > +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 18:18:51 2010 > > @@ -15,6 +15,8 @@ > > > > class MCObjectFormat { > > public: > > + virtual ~MCObjectFormat() {} > > + > > Hi Chandler, > > Should the definition for this go in the MCObjectFormat.cpp file to "anchor" the vtable? > > I wasn't sure. I placed it here as that seemed like the minimal change from the original code (it is an abstract interface afterall). I'm happy to move it to the cpp file if anchoring the vtable (and forcing this call to be out-of-line) is desirable. As long as it complies with http://llvm.org/docs/CodingStandards.html#ll_virtual_anch it will be okay. :) -bw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101018/82f7a949/attachment.html From gohman at apple.com Mon Oct 18 19:38:36 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 18 Oct 2010 17:38:36 -0700 Subject: [llvm-commits] [PATCH] Add RegionPass framework In-Reply-To: <4CB5964E.2080407@fim.uni-passau.de> References: <4CB5964E.2080407@fim.uni-passau.de> Message-ID: On Oct 13, 2010, at 4:21 AM, Tobias Grosser wrote: > Hi, > > ether and I would like to add a RegionPass framework to LLVM. RegionPasses are like loop passes, except that they are working on Regions provided by the RegionInfo pass instead of Loops provided by the LoopInfo pass. Hi Tobias, This looks reasonable to me. Dan From chandlerc at gmail.com Mon Oct 18 19:37:30 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Tue, 19 Oct 2010 00:37:30 -0000 Subject: [llvm-commits] [llvm] r116779 - in /llvm/trunk: include/llvm/MC/MCObjectFormat.h lib/MC/MCObjectFormat.cpp Message-ID: <20101019003730.AC2E72A6C12C@llvm.org> Author: chandlerc Date: Mon Oct 18 19:37:30 2010 New Revision: 116779 URL: http://llvm.org/viewvc/llvm-project?rev=116779&view=rev Log: Move the definition of this to the source file to anchor the vtable. Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h llvm/trunk/lib/MC/MCObjectFormat.cpp Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116779&r1=116778&r2=116779&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 19:37:30 2010 @@ -15,7 +15,7 @@ class MCObjectFormat { public: - virtual ~MCObjectFormat() {} + virtual ~MCObjectFormat(); /// isAbsolute - Check if A - B is an absolute value /// Modified: llvm/trunk/lib/MC/MCObjectFormat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFormat.cpp?rev=116779&r1=116778&r2=116779&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCObjectFormat.cpp (original) +++ llvm/trunk/lib/MC/MCObjectFormat.cpp Mon Oct 18 19:37:30 2010 @@ -12,6 +12,9 @@ using namespace llvm; +MCObjectFormat::~MCObjectFormat() { +} + bool MCELFObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, const MCSymbol &B) const { // On ELF A - B is absolute if A and B are in the same section. From chandlerc at gmail.com Mon Oct 18 19:39:33 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 18 Oct 2010 17:39:33 -0700 Subject: [llvm-commits] [llvm] r116766 - /llvm/trunk/include/llvm/MC/MCObjectFormat.h In-Reply-To: <58F7424E-8374-4424-BA43-698A7535B2A6@apple.com> References: <20101018231851.791912A6C12C@llvm.org> <08E3005E-AD77-4832-BEDA-62DE68A06309@apple.com> <58F7424E-8374-4424-BA43-698A7535B2A6@apple.com> Message-ID: On Mon, Oct 18, 2010 at 5:25 PM, Bill Wendling wrote: > > On Oct 18, 2010, at 4:52 PM, Chandler Carruth wrote: > > On Mon, Oct 18, 2010 at 4:47 PM, Bill Wendling wrote: > >> On Oct 18, 2010, at 4:18 PM, Chandler Carruth wrote: >> >> > Author: chandlerc >> > Date: Mon Oct 18 18:18:51 2010 >> > New Revision: 116766 >> > >> > URL: http://llvm.org/viewvc/llvm-project?rev=116766&view=rev >> > Log: >> > Add a virtual destructor to silence a GCC warning. >> > >> > Modified: >> > llvm/trunk/include/llvm/MC/MCObjectFormat.h >> > >> > Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h >> > URL: >> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116766&r1=116765&r2=116766&view=diff >> > >> ============================================================================== >> > --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) >> > +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 18:18:51 2010 >> > @@ -15,6 +15,8 @@ >> > >> > class MCObjectFormat { >> > public: >> > + virtual ~MCObjectFormat() {} >> > + >> >> Hi Chandler, >> >> Should the definition for this go in the MCObjectFormat.cpp file to >> "anchor" the vtable? >> > > I wasn't sure. I placed it here as that seemed like the minimal change from > the original code (it is an abstract interface afterall). I'm happy to move > it to the cpp file if anchoring the vtable (and forcing this call to be > out-of-line) is desirable. > > > As long as it complies with > http://llvm.org/docs/CodingStandards.html#ll_virtual_anch it will be okay. > :) > Hadn't realized we had a formal policy on it, thanks. Fixed in r116779. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101018/84b9bb3e/attachment.html From evan.cheng at apple.com Mon Oct 18 19:55:07 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 19 Oct 2010 00:55:07 -0000 Subject: [llvm-commits] [llvm] r116781 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/MachineLICM.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h test/CodeGen/ARM/remat.ll test/CodeGen/Thumb2/machine-licm-vdup.ll test/CodeGen/X86/2008-10-27-CoalescerBug.ll test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Message-ID: <20101019005507.606E42A6C12C@llvm.org> Author: evancheng Date: Mon Oct 18 19:55:07 2010 New Revision: 116781 URL: http://llvm.org/viewvc/llvm-project?rev=116781&view=rev Log: - Add a hook for target to determine whether an instruction def is "long latency" enough to hoist even if it may increase spilling. Reloading a value from spill slot is often cheaper than performing an expensive computation in the loop. For X86, that means machine LICM will hoist SQRT, DIV, etc. ARM will be somewhat aggressive with VFP and NEON instructions. - Enable register pressure aware machine LICM by default. Removed: llvm/trunk/test/CodeGen/ARM/remat.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Oct 18 19:55:07 2010 @@ -24,6 +24,7 @@ class LiveVariables; class MCAsmInfo; class MachineMemOperand; +class MachineRegisterInfo; class MDNode; class MCInst; class SDNode; @@ -625,6 +626,19 @@ int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const; + + /// hasHighOperandLatency - Compute operand latency between a def of 'Reg' + /// and an use in the current loop, return true if the target considered + /// it 'high'. This is used by optimization passes such as machine LICM to + /// determine whether it makes sense to hoist an instruction out even in + /// high register pressure situation. + virtual + bool hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const { + return false; + } }; /// TargetInstrInfoImpl - This is the default implementation of Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon Oct 18 19:55:07 2010 @@ -43,11 +43,6 @@ using namespace llvm; -static cl::opt -TrackRegPressure("rp-aware-machine-licm", - cl::desc("Register pressure aware machine LICM"), - cl::init(false), cl::Hidden); - STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops"); STATISTIC(NumLowRP, @@ -124,6 +119,7 @@ RegSeen.clear(); RegPressure.clear(); RegLimit.clear(); + BackTrace.clear(); for (DenseMap >::iterator CI = CSEMap.begin(), CE = CSEMap.end(); CI != CE; ++CI) CI->second.clear(); @@ -171,9 +167,10 @@ /// bool IsLoopInvariantInst(MachineInstr &I); - /// ComputeOperandLatency - Compute operand latency between a def of 'Reg' - /// and an use in the current loop. - int ComputeOperandLatency(MachineInstr &MI, unsigned DefIdx, unsigned Reg); + /// HasHighOperandLatency - Compute operand latency between a def of 'Reg' + /// and an use in the current loop, return true if the target considered + /// it 'high'. + bool HasHighOperandLatency(MachineInstr &MI, unsigned DefIdx, unsigned Reg); /// IncreaseHighRegPressure - Visit BBs from preheader to current BB, check /// if hoisting an instruction of the given cost matrix can cause high @@ -556,28 +553,24 @@ if (!Preheader) return; - if (TrackRegPressure) { - if (IsHeader) { - // Compute registers which are liveout of preheader. - RegSeen.clear(); - BackTrace.clear(); - InitRegPressure(Preheader); - } - - // Remember livein register pressure. - BackTrace.push_back(RegPressure); + if (IsHeader) { + // Compute registers which are liveout of preheader. + RegSeen.clear(); + BackTrace.clear(); + InitRegPressure(Preheader); } + // Remember livein register pressure. + BackTrace.push_back(RegPressure); + for (MachineBasicBlock::iterator MII = BB->begin(), E = BB->end(); MII != E; ) { MachineBasicBlock::iterator NextMII = MII; ++NextMII; MachineInstr *MI = &*MII; - if (TrackRegPressure) - UpdateRegPressureBefore(MI); + UpdateRegPressureBefore(MI); Hoist(MI, Preheader); - if (TrackRegPressure) - UpdateRegPressureAfter(MI); + UpdateRegPressureAfter(MI); MII = NextMII; } @@ -591,8 +584,7 @@ HoistRegion(Children[I]); } - if (TrackRegPressure) - BackTrace.pop_back(); + BackTrace.pop_back(); } /// InitRegPressure - Find all virtual register references that are liveout of @@ -788,15 +780,14 @@ } } -/// ComputeOperandLatency - Compute operand latency between a def of 'Reg' -/// and an use in the current loop. -int MachineLICM::ComputeOperandLatency(MachineInstr &MI, - unsigned DefIdx, unsigned Reg) { +/// HasHighOperandLatency - Compute operand latency between a def of 'Reg' +/// and an use in the current loop, return true if the target considered +/// it 'high'. +bool MachineLICM::HasHighOperandLatency(MachineInstr &MI, + unsigned DefIdx, unsigned Reg) { if (MRI->use_nodbg_empty(Reg)) - // No use? Return arbitrary large number! - return 300; + return false; - int Latency = -1; for (MachineRegisterInfo::use_nodbg_iterator I = MRI->use_nodbg_begin(Reg), E = MRI->use_nodbg_end(); I != E; ++I) { MachineInstr *UseMI = &*I; @@ -810,18 +801,15 @@ if (MOReg != Reg) continue; - int UseCycle = TII->getOperandLatency(InstrItins, &MI, DefIdx, UseMI, i); - Latency = std::max(Latency, UseCycle); + if (TII->hasHighOperandLatency(InstrItins, MRI, &MI, DefIdx, UseMI, i)) + return true; } - if (Latency != -1) - break; + // Only look at the first in loop use. + break; } - if (Latency == -1) - Latency = InstrItins->getOperandCycle(MI.getDesc().getSchedClass(), DefIdx); - - return Latency; + return false; } /// IncreaseHighRegPressure - Visit BBs from preheader to current BB, check @@ -855,19 +843,19 @@ if (MI.isImplicitDef()) return true; - // FIXME: For now, only hoist re-materilizable instructions. LICM will - // increase register pressure. We want to make sure it doesn't increase - // spilling. + // If the instruction is cheap, only hoist if it is re-materilizable. LICM + // will increase register pressure. It's probably not worth it if the + // instruction is cheap. // Also hoist loads from constant memory, e.g. load from stubs, GOT. Hoisting // these tend to help performance in low register pressure situation. The // trade off is it may cause spill in high pressure situation. It will end up // adding a store in the loop preheader. But the reload is no more expensive. // The side benefit is these loads are frequently CSE'ed. - if (!TrackRegPressure || MI.getDesc().isAsCheapAsAMove()) { - if (!TII->isTriviallyReMaterializable(&MI, AA) && - !isLoadFromConstantMemory(&MI)) + if (MI.getDesc().isAsCheapAsAMove()) { + if (!TII->isTriviallyReMaterializable(&MI, AA)) return false; } else { + // Estimate register pressure to determine whether to LICM the instruction. // In low register pressure situation, we can be more aggressive about // hoisting. Also, favors hoisting long latency instructions even in // moderately high pressure situation. @@ -880,13 +868,9 @@ if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue; if (MO.isDef()) { - if (InstrItins && !InstrItins->isEmpty()) { - int Cycle = ComputeOperandLatency(MI, i, Reg); - if (Cycle > 3) { - // FIXME: Target specific high latency limit? - ++NumHighLatency; - return true; - } + if (HasHighOperandLatency(MI, i, Reg)) { + ++NumHighLatency; + return true; } const TargetRegisterClass *RC = MRI->getRegClass(Reg); Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon Oct 18 19:55:07 2010 @@ -1925,3 +1925,23 @@ return getOperandLatency(ItinData, DefTID, DefIdx, DefAlign, UseTID, UseIdx, UseAlign); } + +bool ARMBaseInstrInfo:: +hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const { + unsigned DDomain = DefMI->getDesc().TSFlags & ARMII::DomainMask; + unsigned UDomain = UseMI->getDesc().TSFlags & ARMII::DomainMask; + if (Subtarget.isCortexA8() && + (DDomain == ARMII::DomainVFP || UDomain == ARMII::DomainVFP)) + // CortexA8 VFP instructions are not pipelined. + return true; + + // Hoist VFP / NEON instructions with 4 or higher latency. + int Latency = getOperandLatency(ItinData, DefMI, DefIdx, UseMI, UseIdx); + if (Latency <= 3) + return false; + return DDomain == ARMII::DomainVFP || DDomain == ARMII::DomainNEON || + UDomain == ARMII::DomainVFP || UDomain == ARMII::DomainNEON; +} Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Mon Oct 18 19:55:07 2010 @@ -377,6 +377,11 @@ unsigned DefIdx, unsigned DefAlign, const TargetInstrDesc &UseTID, unsigned UseIdx, unsigned UseAlign) const; + + bool hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const; }; static inline Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Oct 18 19:55:07 2010 @@ -3152,6 +3152,41 @@ NopInst.setOpcode(X86::NOOP); } +bool X86InstrInfo:: +hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const { + switch (DefMI->getOpcode()) { + default: return false; + case X86::DIVSDrm: + case X86::DIVSDrm_Int: + case X86::DIVSDrr: + case X86::DIVSDrr_Int: + case X86::DIVSSrm: + case X86::DIVSSrm_Int: + case X86::DIVSSrr: + case X86::DIVSSrr_Int: + case X86::SQRTPDm: + case X86::SQRTPDm_Int: + case X86::SQRTPDr: + case X86::SQRTPDr_Int: + case X86::SQRTPSm: + case X86::SQRTPSm_Int: + case X86::SQRTPSr: + case X86::SQRTPSr_Int: + case X86::SQRTSDm: + case X86::SQRTSDm_Int: + case X86::SQRTSDr: + case X86::SQRTSDr_Int: + case X86::SQRTSSm: + case X86::SQRTSSm_Int: + case X86::SQRTSSr: + case X86::SQRTSSr_Int: + return true; + } +} + namespace { /// CGBR - Create Global Base Reg pass. This initializes the PIC /// global base register for x86-32. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Mon Oct 18 19:55:07 2010 @@ -864,6 +864,11 @@ unsigned OpNum, const SmallVectorImpl &MOs, unsigned Size, unsigned Alignment) const; + + bool hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const; private: MachineInstr * convertToThreeAddressWithLEA(unsigned MIOpc, Removed: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=116780&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/remat.ll (original) +++ llvm/trunk/test/CodeGen/ARM/remat.ll (removed) @@ -1,65 +0,0 @@ -; RUN: llc < %s -march=arm -mattr=+v6,+vfp2 -o /dev/null -stats -info-output-file - | grep "Number of re-materialization" - -define i32 @main(i32 %argc, i8** nocapture %argv, double %d1, double %d2) nounwind { -entry: - br i1 undef, label %smvp.exit, label %bb.i3 - -bb.i3: ; preds = %bb.i3, %bb134 - br i1 undef, label %smvp.exit, label %bb.i3 - -smvp.exit: ; preds = %bb.i3 - %0 = fmul double %d1, 2.400000e-03 ; [#uses=2] - br i1 undef, label %bb138.preheader, label %bb159 - -bb138.preheader: ; preds = %smvp.exit - br label %bb138 - -bb138: ; preds = %bb138, %bb138.preheader - br i1 undef, label %bb138, label %bb145.loopexit - -bb142: ; preds = %bb.nph218.bb.nph218.split_crit_edge, %phi0.exit - %1 = fmul double %d1, -1.200000e-03 ; [#uses=1] - %2 = fadd double %d2, %1 ; [#uses=1] - %3 = fmul double %2, %d2 ; [#uses=1] - %4 = fsub double 0.000000e+00, %3 ; [#uses=1] - br i1 %14, label %phi1.exit, label %bb.i35 - -bb.i35: ; preds = %bb142 - %5 = call double @sin(double %15) nounwind readonly ; [#uses=1] - %6 = fmul double %5, 0x4031740AFA84AD8A ; [#uses=1] - %7 = fsub double 1.000000e+00, undef ; [#uses=1] - %8 = fdiv double %7, 6.000000e-01 ; [#uses=1] - br label %phi1.exit - -phi1.exit: ; preds = %bb.i35, %bb142 - %.pn = phi double [ %6, %bb.i35 ], [ 0.000000e+00, %bb142 ] ; [#uses=1] - %9 = phi double [ %8, %bb.i35 ], [ 0.000000e+00, %bb142 ] ; [#uses=1] - %10 = fmul double %.pn, %9 ; [#uses=1] - br i1 %14, label %phi0.exit, label %bb.i - -bb.i: ; preds = %phi1.exit - unreachable - -phi0.exit: ; preds = %phi1.exit - %11 = fsub double %4, %10 ; [#uses=1] - %12 = fadd double 0.000000e+00, %11 ; [#uses=1] - store double %12, double* undef, align 4 - br label %bb142 - -bb145.loopexit: ; preds = %bb138 - br i1 undef, label %bb.nph218.bb.nph218.split_crit_edge, label %bb159 - -bb.nph218.bb.nph218.split_crit_edge: ; preds = %bb145.loopexit - %13 = fmul double %0, 0x401921FB54442D18 ; [#uses=1] - %14 = fcmp ugt double %0, 6.000000e-01 ; [#uses=2] - %15 = fdiv double %13, 6.000000e-01 ; [#uses=1] - br label %bb142 - -bb159: ; preds = %bb145.loopexit, %smvp.exit, %bb134 - unreachable - -bb166: ; preds = %bb127 - unreachable -} - -declare double @sin(double) nounwind readonly Modified: llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll Mon Oct 18 19:55:07 2010 @@ -2,17 +2,16 @@ ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim -arm-vdup-splat | FileCheck %s ; Modified version of machine-licm.ll with -arm-vdup-splat turned on, 8003375. ; Eventually this should become the default and be moved into machine-licm.ll. -; FIXME: the vdup should be hoisted out of the loop, 8248029. define void @t2(i8* %ptr1, i8* %ptr2) nounwind { entry: ; CHECK: t2: ; CHECK: mov.w r3, #1065353216 +; CHECK: vdup.32 q{{.*}}, r3 br i1 undef, label %bb1, label %bb2 bb1: ; CHECK-NEXT: %bb1 -; CHECK: vdup.32 q{{.*}}, r3 %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ] %tmp1 = shl i32 %indvar, 2 %gep1 = getelementptr i8* %ptr1, i32 %tmp1 Modified: llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll Mon Oct 18 19:55:07 2010 @@ -1,6 +1,9 @@ -; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& not grep {Number of register spills} +; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -stats |& FileCheck %s +; Now this test spills one register. But a reload in the loop is cheaper than +; the divsd so it's a win. define fastcc void @fourn(double* %data, i32 %isign) nounwind { +; CHECK: fourn entry: br label %bb @@ -11,6 +14,11 @@ %1 = icmp sgt i32 %0, 2 ; [#uses=1] br i1 %1, label %bb30.loopexit, label %bb +; CHECK: %bb30.loopexit +; CHECK: divsd %xmm0 +; CHECK: movsd %xmm0, 16(%esp) +; CHECK: .align +; CHECK-NEXT: %bb3 bb3: ; preds = %bb30.loopexit, %bb25, %bb3 %2 = load i32* null, align 4 ; [#uses=1] %3 = mul i32 %2, 0 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll?rev=116781&r1=116780&r2=116781&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Mon Oct 18 19:55:07 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -stats |& grep {6 machine-licm} +; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -stats |& grep {7 machine-licm} ; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 | FileCheck %s ; rdar://6627786 ; rdar://7792037 From geek4civic at gmail.com Mon Oct 18 20:21:55 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 19 Oct 2010 01:21:55 -0000 Subject: [llvm-commits] [llvm] r116784 - /llvm/trunk/lib/Support/raw_ostream.cpp Message-ID: <20101019012155.610742A6C12C@llvm.org> Author: chapuni Date: Mon Oct 18 20:21:55 2010 New Revision: 116784 URL: http://llvm.org/viewvc/llvm-project?rev=116784&view=rev Log: lib/Support/raw_ostream.cpp: Fix Cygwin's build. setmode is provided by io.h on Cygwin. Modified: llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=116784&r1=116783&r2=116784&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Mon Oct 18 20:21:55 2010 @@ -32,6 +32,10 @@ # include #endif +#if defined(__CYGWIN__) +#include +#endif + #if defined(_MSC_VER) #include #include From geek4civic at gmail.com Mon Oct 18 20:22:02 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 19 Oct 2010 01:22:02 -0000 Subject: [llvm-commits] [llvm] r116785 - /llvm/trunk/lib/System/Win32/ThreadLocal.inc Message-ID: <20101019012202.27CB12A6C12C@llvm.org> Author: chapuni Date: Mon Oct 18 20:22:01 2010 New Revision: 116785 URL: http://llvm.org/viewvc/llvm-project?rev=116785&view=rev Log: lib/System/Win32/ThreadLocal.inc: Suppress "unused" warning on -Asserts. Modified: llvm/trunk/lib/System/Win32/ThreadLocal.inc Modified: llvm/trunk/lib/System/Win32/ThreadLocal.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/ThreadLocal.inc?rev=116785&r1=116784&r2=116785&view=diff ============================================================================== --- llvm/trunk/lib/System/Win32/ThreadLocal.inc (original) +++ llvm/trunk/lib/System/Win32/ThreadLocal.inc Mon Oct 18 20:22:01 2010 @@ -44,6 +44,7 @@ DWORD* tls = static_cast(data); int errorcode = TlsSetValue(*tls, const_cast(d)); assert(errorcode != 0); + (void)errorcode; } void ThreadLocalImpl::removeInstance() { From rafael.espindola at gmail.com Mon Oct 18 21:02:57 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 19 Oct 2010 02:02:57 -0000 Subject: [llvm-commits] [llvm] r116788 - in /llvm/trunk: lib/Linker/LinkModules.cpp test/Linker/PR8300.ll Message-ID: <20101019020257.BB5AA2A6C12C@llvm.org> Author: rafael Date: Mon Oct 18 21:02:57 2010 New Revision: 116788 URL: http://llvm.org/viewvc/llvm-project?rev=116788&view=rev Log: Fix PR8300 by remembering to keep the bitcast in all cases. Added: llvm/trunk/test/Linker/PR8300.ll Modified: llvm/trunk/lib/Linker/LinkModules.cpp Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=116788&r1=116787&r2=116788&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Oct 18 21:02:57 2010 @@ -668,6 +668,13 @@ GlobalValue* DAliasee = cast(VMI->second); GlobalValue* DGV = NULL; + // Fixup aliases to bitcasts. Note that aliases to GEPs are still broken + // by this, but aliases to GEPs are broken to a lot of other things, so + // it's less important. + Constant *DAliaseeConst = DAliasee; + if (SGA->getType() != DAliasee->getType()) + DAliaseeConst = ConstantExpr::getBitCast(DAliasee, SGA->getType()); + // Try to find something 'similar' to SGA in destination module. if (!DGV && !SGA->hasLocalLinkage()) { DGV = Dest->getNamedAlias(SGA->getName()); @@ -721,7 +728,7 @@ "': aliasee is not global variable"); NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(), - SGA->getName(), DAliasee, Dest); + SGA->getName(), DAliaseeConst, Dest); CopyGVAttributes(NewGA, SGA); // Any uses of DGV need to change to NewGA, with cast, if needed. @@ -750,7 +757,7 @@ "': aliasee is not function"); NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(), - SGA->getName(), DAliasee, Dest); + SGA->getName(), DAliaseeConst, Dest); CopyGVAttributes(NewGA, SGA); // Any uses of DF need to change to NewGA, with cast, if needed. @@ -772,14 +779,8 @@ } else { // No linking to be performed, simply create an identical version of the // alias over in the dest module... - Constant *Aliasee = DAliasee; - // Fixup aliases to bitcasts. Note that aliases to GEPs are still broken - // by this, but aliases to GEPs are broken to a lot of other things, so - // it's less important. - if (SGA->getType() != DAliasee->getType()) - Aliasee = ConstantExpr::getBitCast(DAliasee, SGA->getType()); NewGA = new GlobalAlias(SGA->getType(), SGA->getLinkage(), - SGA->getName(), Aliasee, Dest); + SGA->getName(), DAliaseeConst, Dest); CopyGVAttributes(NewGA, SGA); // Proceed to 'common' steps Added: llvm/trunk/test/Linker/PR8300.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/PR8300.ll?rev=116788&view=auto ============================================================================== --- llvm/trunk/test/Linker/PR8300.ll (added) +++ llvm/trunk/test/Linker/PR8300.ll Mon Oct 18 21:02:57 2010 @@ -0,0 +1,13 @@ +; RUN: echo {%foo2 = type \{ \[8 x i8\] \} \ +; RUN: declare void @zed(%foo2*) } > %t.ll +; RUN: llvm-link %t.ll %s -o %t.bc + +%foo = type { [8 x i8] } +%bar = type { [9 x i8] } + + at zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*) + +define void @xyz(%bar* %this) { +entry: + ret void +} From atrick at apple.com Mon Oct 18 21:50:50 2010 From: atrick at apple.com (Andrew Trick) Date: Tue, 19 Oct 2010 02:50:50 -0000 Subject: [llvm-commits] [llvm] r116790 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp Message-ID: <20101019025050.67F922A6C12C@llvm.org> Author: atrick Date: Mon Oct 18 21:50:50 2010 New Revision: 116790 URL: http://llvm.org/viewvc/llvm-project?rev=116790&view=rev Log: Fix for machine licm assert: RCCost <= RegPressure[RCId] in MultiSource/Benchmarks/VersaBench/beamformer/beamformer. SmallSet.insert returns true if the element is inserted. Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=116790&r1=116789&r2=116790&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon Oct 18 21:50:50 2010 @@ -604,7 +604,7 @@ if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue; - bool isNew = !RegSeen.insert(Reg); + bool isNew = RegSeen.insert(Reg); const TargetRegisterClass *RC = MRI->getRegClass(Reg); EVT VT = *RC->vt_begin(); unsigned RCId = TLI->getRepRegClassFor(VT)->getID(); @@ -634,7 +634,7 @@ if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue; - bool isNew = !RegSeen.insert(Reg); + bool isNew = RegSeen.insert(Reg); if (NoImpact) continue; From evan.cheng at apple.com Mon Oct 18 22:20:53 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 18 Oct 2010 20:20:53 -0700 Subject: [llvm-commits] [llvm] r116790 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp In-Reply-To: <20101019025050.67F922A6C12C@llvm.org> References: <20101019025050.67F922A6C12C@llvm.org> Message-ID: <5248B2D7-11F6-4DE8-8E52-82B63B766E36@apple.com> Oops. Thanks for fixing this! Evan On Oct 18, 2010, at 7:50 PM, Andrew Trick wrote: > Author: atrick > Date: Mon Oct 18 21:50:50 2010 > New Revision: 116790 > > URL: http://llvm.org/viewvc/llvm-project?rev=116790&view=rev > Log: > Fix for machine licm assert: RCCost <= RegPressure[RCId] > in MultiSource/Benchmarks/VersaBench/beamformer/beamformer. > SmallSet.insert returns true if the element is inserted. > > Modified: > llvm/trunk/lib/CodeGen/MachineLICM.cpp > > Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=116790&r1=116789&r2=116790&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon Oct 18 21:50:50 2010 > @@ -604,7 +604,7 @@ > if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) > continue; > > - bool isNew = !RegSeen.insert(Reg); > + bool isNew = RegSeen.insert(Reg); > const TargetRegisterClass *RC = MRI->getRegClass(Reg); > EVT VT = *RC->vt_begin(); > unsigned RCId = TLI->getRepRegClassFor(VT)->getID(); > @@ -634,7 +634,7 @@ > if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) > continue; > > - bool isNew = !RegSeen.insert(Reg); > + bool isNew = RegSeen.insert(Reg); > if (NoImpact) > continue; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From geek4civic at gmail.com Mon Oct 18 22:24:42 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 19 Oct 2010 03:24:42 -0000 Subject: [llvm-commits] [llvm] r116791 - /llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Message-ID: <20101019032442.E5B042A6C12C@llvm.org> Author: chapuni Date: Mon Oct 18 22:24:42 2010 New Revision: 116791 URL: http://llvm.org/viewvc/llvm-project?rev=116791&view=rev Log: lib/CodeGen/TargetLoweringObjectFileImpl.cpp: Tweak to emit ".{section}${name}" instead of ".{section}$linkonce_{name}" for linkonce sections. It seems GNU ld/PECOFF relies on section names, linking with g++'s libstdc++.a would fail. 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=116791&r1=116790&r2=116791&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Mon Oct 18 22:24:42 2010 @@ -981,12 +981,12 @@ static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) { if (Kind.isText()) - return ".text$linkonce"; + return ".text$"; if (Kind.isBSS ()) - return ".bss$linkonce"; + return ".bss$"; if (Kind.isWriteable()) - return ".data$linkonce"; - return ".rdata$linkonce"; + return ".data$"; + return ".rdata$"; } @@ -1001,7 +1001,7 @@ const char *Prefix = getCOFFSectionPrefixForUniqueGlobal(Kind); SmallString<128> Name(Prefix, Prefix+strlen(Prefix)); MCSymbol *Sym = Mang->getSymbol(GV); - Name.append(Sym->getName().begin(), Sym->getName().end()); + Name.append(Sym->getName().begin() + 1, Sym->getName().end()); unsigned Characteristics = getCOFFSectionFlags(Kind); From geek4civic at gmail.com Mon Oct 18 22:35:16 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 19 Oct 2010 12:35:16 +0900 Subject: [llvm-commits] [Review request] Tweak section names of linkonce on PECOFF In-Reply-To: References: Message-ID: Applied in r116791, thank you. Let me know when you met another issue. I concluded GNU ld/PECOFF would rely on section names for resolving linkonce sections. ...Takumi 2010/10/16 Anton Korobeynikov : > Hello Takumi, > >> My patch would be needed to build selfhost with g++'s libstdc++. >> Do we get rid of supporting ld-2.19 anyway? > Yes, we already did ~3 releases ago. It's impossible to preserve > necessary alignment with this old binutils. > >> as-2.18 does not accept ".comm foo,4,2" and it seems requirements >> would not be satisfied. >> I will add it to GettingStarted.html later. > Yes, just add the note that the requirements are same as for mingw > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > From anton at korobeynikov.info Tue Oct 19 01:04:39 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 19 Oct 2010 10:04:39 +0400 Subject: [llvm-commits] [llvm] r116791 - /llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp In-Reply-To: <20101019032442.E5B042A6C12C@llvm.org> References: <20101019032442.E5B042A6C12C@llvm.org> Message-ID: > lib/CodeGen/TargetLoweringObjectFileImpl.cpp: Tweak to emit ".{section}${name}" instead of ".{section}$linkonce_{name}" for linkonce sections. Thanks! -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From bigcheesegs at gmail.com Tue Oct 19 02:32:42 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 19 Oct 2010 07:32:42 -0000 Subject: [llvm-commits] [llvm] r116800 - in /llvm/trunk/lib/Target: TargetData.cpp X86/X86ISelLowering.cpp Message-ID: <20101019073242.7CA402A6C12D@llvm.org> Author: mspencer Date: Tue Oct 19 02:32:42 2010 New Revision: 116800 URL: http://llvm.org/viewvc/llvm-project?rev=116800&view=rev Log: Fix Whitespace. Modified: llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=116800&r1=116799&r2=116800&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Tue Oct 19 02:32:42 2010 @@ -83,7 +83,7 @@ assert((SI == &MemberOffsets[0] || *(SI-1) <= Offset) && (SI+1 == &MemberOffsets[NumElements] || *(SI+1) > Offset) && "Upper bound didn't work!"); - + // Multiple fields can have the same offset if any of them are zero sized. // For example, in { i32, [0 x i32], i32 }, searching for offset 4 will stop // at the i32 element, because it is the last element at that offset. This is @@ -153,16 +153,16 @@ std::pair Split = Desc.split('-'); StringRef Token = Split.first; Desc = Split.second; - + if (Token.empty()) continue; - + Split = Token.split(':'); StringRef Specifier = Split.first; Token = Split.second; - + assert(!Specifier.empty() && "Can't be empty here"); - + switch (Specifier[0]) { case 'E': LittleEndian = false; @@ -197,7 +197,7 @@ unsigned Size = getInt(Specifier.substr(1)); Split = Token.split(':'); unsigned ABIAlign = getInt(Split.first) / 8; - + Split = Split.second.split(':'); unsigned PrefAlign = getInt(Split.first) / 8; if (PrefAlign == 0) @@ -215,7 +215,7 @@ Token = Split.second; } while (!Specifier.empty() || !Token.empty()); break; - + default: break; } @@ -231,7 +231,7 @@ "Tool did not specify a TargetData to use?"); } -TargetData::TargetData(const Module *M) +TargetData::TargetData(const Module *M) : ImmutablePass(ID) { init(M->getDataLayout()); } @@ -249,14 +249,14 @@ return; } } - + Alignments.push_back(TargetAlignElem::get(align_type, abi_align, pref_align, bit_width)); } -/// getAlignmentInfo - Return the alignment (either ABI if ABIInfo = true or +/// getAlignmentInfo - Return the alignment (either ABI if ABIInfo = true or /// preferred if ABIInfo = false) the target wants for the specified datatype. -unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType, +unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType, uint32_t BitWidth, bool ABIInfo, const Type *Ty) const { // Check to see if we have an exact match and remember the best match we see. @@ -266,18 +266,18 @@ if (Alignments[i].AlignType == AlignType && Alignments[i].TypeBitWidth == BitWidth) return ABIInfo ? Alignments[i].ABIAlign : Alignments[i].PrefAlign; - + // The best match so far depends on what we're looking for. - if (AlignType == INTEGER_ALIGN && + if (AlignType == INTEGER_ALIGN && Alignments[i].AlignType == INTEGER_ALIGN) { // The "best match" for integers is the smallest size that is larger than // the BitWidth requested. - if (Alignments[i].TypeBitWidth > BitWidth && (BestMatchIdx == -1 || + if (Alignments[i].TypeBitWidth > BitWidth && (BestMatchIdx == -1 || Alignments[i].TypeBitWidth < Alignments[BestMatchIdx].TypeBitWidth)) BestMatchIdx = i; // However, if there isn't one that's larger, then we must use the // largest one we have (see below) - if (LargestInt == -1 || + if (LargestInt == -1 || Alignments[i].TypeBitWidth > Alignments[LargestInt].TypeBitWidth) LargestInt = i; } @@ -322,8 +322,8 @@ I->first->removeAbstractTypeUser(this); LayoutInfo.erase(I); } - - + + /// refineAbstractType - The callback method invoked when an abstract type is /// resolved to another type. An object must override this method to update /// its internal state to reference NewType instead of OldType. @@ -385,21 +385,21 @@ const StructLayout *TargetData::getStructLayout(const StructType *Ty) const { if (!LayoutMap) LayoutMap = new StructLayoutMap(); - + StructLayoutMap *STM = static_cast(LayoutMap); StructLayout *&SL = (*STM)[Ty]; if (SL) return SL; - // Otherwise, create the struct layout. Because it is variable length, we + // Otherwise, create the struct layout. Because it is variable length, we // malloc it, then use placement new. int NumElts = Ty->getNumElements(); StructLayout *L = (StructLayout *)malloc(sizeof(StructLayout)+(NumElts-1) * sizeof(uint64_t)); - + // Set SL before calling StructLayout's ctor. The ctor could cause other // entries to be added to TheMap, invalidating our reference. SL = L; - + new (L) StructLayout(Ty, *this); if (Ty->isAbstract()) @@ -414,14 +414,14 @@ /// avoid a dangling pointer in this cache. void TargetData::InvalidateStructLayoutInfo(const StructType *Ty) const { if (!LayoutMap) return; // No cache. - + static_cast(LayoutMap)->InvalidateEntry(Ty); } std::string TargetData::getStringRepresentation() const { std::string Result; raw_string_ostream OS(Result); - + OS << (LittleEndian ? "e" : "E") << "-p:" << PointerMemSize*8 << ':' << PointerABIAlign*8 << ':' << PointerPrefAlign*8; @@ -430,10 +430,10 @@ OS << '-' << (char)AI.AlignType << AI.TypeBitWidth << ':' << AI.ABIAlign*8 << ':' << AI.PrefAlign*8; } - + if (!LegalIntWidths.empty()) { OS << "-n" << (unsigned)LegalIntWidths[0]; - + for (unsigned i = 1, e = LegalIntWidths.size(); i != e; ++i) OS << ':' << (unsigned)LegalIntWidths[i]; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=116800&r1=116799&r2=116800&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Oct 19 02:32:42 2010 @@ -7602,7 +7602,7 @@ if (ArgMode == 2) { // Sanity Check: Make sure using fp_offset makes sense. - assert(!UseSoftFloat && + assert(!UseSoftFloat && !(DAG.getMachineFunction() .getFunction()->hasFnAttr(Attribute::NoImplicitFloat)) && Subtarget->hasSSE1()); From bigcheesegs at gmail.com Tue Oct 19 02:32:52 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 19 Oct 2010 07:32:52 -0000 Subject: [llvm-commits] [llvm] r116801 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <20101019073253.08AEF2A6C12D@llvm.org> Author: mspencer Date: Tue Oct 19 02:32:52 2010 New Revision: 116801 URL: http://llvm.org/viewvc/llvm-project?rev=116801&view=rev Log: X86: Add MS-CRT libcalls. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=116801&r1=116800&r2=116801&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Oct 19 02:32:52 2010 @@ -101,9 +101,11 @@ setLibcallName(RTLIB::SDIV_I64, "_alldiv"); setLibcallName(RTLIB::UDIV_I64, "_aulldiv"); setLibcallName(RTLIB::FPTOUINT_F64_I64, "_ftol2"); + setLibcallName(RTLIB::FPTOUINT_F32_I64, "_ftol2"); setLibcallCallingConv(RTLIB::SDIV_I64, CallingConv::X86_StdCall); setLibcallCallingConv(RTLIB::UDIV_I64, CallingConv::X86_StdCall); setLibcallCallingConv(RTLIB::FPTOUINT_F64_I64, CallingConv::X86_StdCall); + setLibcallCallingConv(RTLIB::FPTOUINT_F32_I64, CallingConv::X86_StdCall); } if (Subtarget->isTargetDarwin()) { From chandlerc at gmail.com Tue Oct 19 03:21:25 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Tue, 19 Oct 2010 08:21:25 -0000 Subject: [llvm-commits] [llvm] r116802 - in /llvm/trunk: CMakeLists.txt autoconf/configure.ac configure include/llvm/Config/config.h.cmake include/llvm/Config/config.h.in Message-ID: <20101019082126.0D2AC2A6C12C@llvm.org> Author: chandlerc Date: Tue Oct 19 03:21:25 2010 New Revision: 116802 URL: http://llvm.org/viewvc/llvm-project?rev=116802&view=rev Log: First step to allowing the resource directory of Clang to be adjusted for strange packaging environments. The primary result of this is to expose a (normally empty) CLANG_RESOURCE_DIR string in the autoconf and CMake builds. This will in turn be used by a subsequent commit to Clang. Regenerated configure and config.h.in thanks to Nick. =D Modified: llvm/trunk/CMakeLists.txt llvm/trunk/autoconf/configure.ac llvm/trunk/configure llvm/trunk/include/llvm/Config/config.h.cmake llvm/trunk/include/llvm/Config/config.h.in Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=116802&r1=116801&r2=116802&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Tue Oct 19 03:21:25 2010 @@ -80,6 +80,9 @@ CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") endif( MSVC ) +set(CLANG_RESOURCE_DIR "" CACHE STRING + "Relative directory from the Clang binary to its resource files.") + set(C_INCLUDE_DIRS "" CACHE STRING "Colon separated list of directories clang will search for headers.") Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=116802&r1=116801&r2=116802&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Oct 19 03:21:25 2010 @@ -804,6 +804,13 @@ *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;; esac +AC_ARG_WITH(clang-resource-dir, + AS_HELP_STRING([--with-clang-resource-dir], + [Relative directory from the Clang binary for resource files]),, + withval="") +AC_DEFINE_UNQUOTED(CLANG_RESOURCE_DIR,"$withval", + [Relative directory for resource files]) + AC_ARG_WITH(c-include-dirs, AS_HELP_STRING([--with-c-include-dirs], [Colon separated list of directories clang will search for headers]),, Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=116802&r1=116801&r2=116802&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Tue Oct 19 03:21:25 2010 @@ -1442,6 +1442,9 @@ --with-extra-options Specify additional options to compile LLVM with --with-ocaml-libdir Specify install location for ocaml bindings (default is stdlib) + --with-clang-resource-dir + Relative directory from the Clang binary for + resource files --with-c-include-dirs Colon separated list of directories clang will search for headers --with-cxx-include-root Directory with the libstdc++ headers. @@ -5279,6 +5282,20 @@ esac +# Check whether --with-clang-resource-dir was given. +if test "${with_clang_resource_dir+set}" = set; then + withval=$with_clang_resource_dir; +else + withval="" +fi + + +cat >>confdefs.h <<_ACEOF +#define CLANG_RESOURCE_DIR "$withval" +_ACEOF + + + # Check whether --with-c-include-dirs was given. if test "${with_c_include_dirs+set}" = set; then withval=$with_c_include_dirs; @@ -11450,7 +11467,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < References: <20101018231851.791912A6C12C@llvm.org> <08E3005E-AD77-4832-BEDA-62DE68A06309@apple.com> <58F7424E-8374-4424-BA43-698A7535B2A6@apple.com> Message-ID: On Oct 18, 2010, at 5:39 PM, Chandler Carruth wrote: > On Mon, Oct 18, 2010 at 5:25 PM, Bill Wendling wrote: > > On Oct 18, 2010, at 4:52 PM, Chandler Carruth wrote: > >> On Mon, Oct 18, 2010 at 4:47 PM, Bill Wendling wrote: >> On Oct 18, 2010, at 4:18 PM, Chandler Carruth wrote: >> >> > Author: chandlerc >> > Date: Mon Oct 18 18:18:51 2010 >> > New Revision: 116766 >> > >> > URL: http://llvm.org/viewvc/llvm-project?rev=116766&view=rev >> > Log: >> > Add a virtual destructor to silence a GCC warning. >> > >> > Modified: >> > llvm/trunk/include/llvm/MC/MCObjectFormat.h >> > >> > Modified: llvm/trunk/include/llvm/MC/MCObjectFormat.h >> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFormat.h?rev=116766&r1=116765&r2=116766&view=diff >> > ============================================================================== >> > --- llvm/trunk/include/llvm/MC/MCObjectFormat.h (original) >> > +++ llvm/trunk/include/llvm/MC/MCObjectFormat.h Mon Oct 18 18:18:51 2010 >> > @@ -15,6 +15,8 @@ >> > >> > class MCObjectFormat { >> > public: >> > + virtual ~MCObjectFormat() {} >> > + >> >> Hi Chandler, >> >> Should the definition for this go in the MCObjectFormat.cpp file to "anchor" the vtable? >> >> I wasn't sure. I placed it here as that seemed like the minimal change from the original code (it is an abstract interface afterall). I'm happy to move it to the cpp file if anchoring the vtable (and forcing this call to be out-of-line) is desirable. > > As long as it complies with http://llvm.org/docs/CodingStandards.html#ll_virtual_anch it will be okay. :) > > Hadn't realized we had a formal policy on it, thanks. Fixed in r116779. > Thanks! :-) -bw From isanbard at gmail.com Tue Oct 19 05:18:23 2010 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 19 Oct 2010 10:18:23 -0000 Subject: [llvm-commits] [llvm] r116804 - /llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp Message-ID: <20101019101823.A3CC52A6C12C@llvm.org> Author: void Date: Tue Oct 19 05:18:23 2010 New Revision: 116804 URL: http://llvm.org/viewvc/llvm-project?rev=116804&view=rev Log: Fix spelling. Modified: llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp Modified: llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp?rev=116804&r1=116803&r2=116804&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp (original) +++ llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp Tue Oct 19 05:18:23 2010 @@ -305,7 +305,7 @@ // // FIXME: This isn't really what 'as' does; I think it just uses the implicit // alignment on the section (e.g., if one manually inserts bytes into the - // section, then just issueing the section switch directive will not realign + // section, then just issuing the section switch directive will not realign // the section. However, this is arguably more reasonable behavior, and there // is no good reason for someone to intentionally emit incorrectly sized // values into the implicitly aligned sections. From clchiou at gmail.com Tue Oct 19 08:14:40 2010 From: clchiou at gmail.com (Che-Liang Chiou) Date: Tue, 19 Oct 2010 13:14:40 -0000 Subject: [llvm-commits] [llvm] r116805 - in /llvm/trunk/lib/Target/PTX: AsmPrinter/PTXAsmPrinter.cpp PTXISelLowering.cpp PTXInstrInfo.cpp PTXInstrInfo.h PTXInstrInfo.td PTXRegisterInfo.h PTXRegisterInfo.td Message-ID: <20101019131440.71DD52A6C12C@llvm.org> Author: clchiou Date: Tue Oct 19 08:14:40 2010 New Revision: 116805 URL: http://llvm.org/viewvc/llvm-project?rev=116805&view=rev Log: Add lower argument and return of device function Modified: llvm/trunk/lib/Target/PTX/AsmPrinter/PTXAsmPrinter.cpp llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp llvm/trunk/lib/Target/PTX/PTXInstrInfo.h llvm/trunk/lib/Target/PTX/PTXInstrInfo.td llvm/trunk/lib/Target/PTX/PTXRegisterInfo.h llvm/trunk/lib/Target/PTX/PTXRegisterInfo.td Modified: llvm/trunk/lib/Target/PTX/AsmPrinter/PTXAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/AsmPrinter/PTXAsmPrinter.cpp?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/AsmPrinter/PTXAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PTX/AsmPrinter/PTXAsmPrinter.cpp Tue Oct 19 08:14:40 2010 @@ -32,6 +32,8 @@ virtual void EmitInstruction(const MachineInstr *MI); + void printOperand(const MachineInstr *MI, int opNum, raw_ostream &OS); + // autogen'd. void printInstruction(const MachineInstr *MI, raw_ostream &OS); static const char *getRegisterName(unsigned RegNo); @@ -40,10 +42,27 @@ void PTXAsmPrinter::EmitInstruction(const MachineInstr *MI) { SmallString<128> str; - raw_svector_ostream os(str); - printInstruction(MI, os); - os << ';'; - OutStreamer.EmitRawText(os.str()); + raw_svector_ostream OS(str); + printInstruction(MI, OS); + OS << ';'; + OutStreamer.EmitRawText(OS.str()); +} + +void PTXAsmPrinter::printOperand(const MachineInstr *MI, int opNum, + raw_ostream &OS) { + const MachineOperand &MO = MI->getOperand(opNum); + + switch (MO.getType()) { + default: + llvm_unreachable(""); + break; + case MachineOperand::MO_Register: + OS << getRegisterName(MO.getReg()); + break; + case MachineOperand::MO_Immediate: + OS << (int) MO.getImm(); + break; + } } #include "PTXGenAsmWriter.inc" Modified: llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp Tue Oct 19 08:14:40 2010 @@ -11,9 +11,12 @@ // //===----------------------------------------------------------------------===// +#include "PTX.h" #include "PTXISelLowering.h" #include "PTXRegisterInfo.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" @@ -22,7 +25,8 @@ PTXTargetLowering::PTXTargetLowering(TargetMachine &TM) : TargetLowering(TM, new TargetLoweringObjectFileELF()) { // Set up the register classes. - addRegisterClass(MVT::i1, PTX::PredsRegisterClass); + addRegisterClass(MVT::i1, PTX::PredsRegisterClass); + addRegisterClass(MVT::i32, PTX::RRegs32RegisterClass); // Compute derived properties from the register classes computeRegisterProperties(); @@ -40,6 +44,57 @@ // Calling Convention Implementation //===----------------------------------------------------------------------===// +static struct argmap_entry { + MVT::SimpleValueType VT; + TargetRegisterClass *RC; + TargetRegisterClass::iterator loc; + + argmap_entry(MVT::SimpleValueType _VT, TargetRegisterClass *_RC) + : VT(_VT), RC(_RC), loc(_RC->begin()) {} + + void reset(void) { loc = RC->begin(); } + bool operator==(MVT::SimpleValueType _VT) { return VT == _VT; } +} argmap[] = { + argmap_entry(MVT::i1, PTX::PredsRegisterClass), + argmap_entry(MVT::i32, PTX::RRegs32RegisterClass) +}; + +static SDValue lower_kernel_argument(int i, + SDValue Chain, + DebugLoc dl, + MVT::SimpleValueType VT, + argmap_entry *entry, + SelectionDAG &DAG, + unsigned *argreg) { + // TODO + llvm_unreachable("Not implemented yet"); +} + +static SDValue lower_device_argument(int i, + SDValue Chain, + DebugLoc dl, + MVT::SimpleValueType VT, + argmap_entry *entry, + SelectionDAG &DAG, + unsigned *argreg) { + MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo(); + + unsigned preg = *++(entry->loc); // allocate start from register 1 + unsigned vreg = RegInfo.createVirtualRegister(entry->RC); + RegInfo.addLiveIn(preg, vreg); + + *argreg = preg; + return DAG.getCopyFromReg(Chain, dl, vreg, VT); +} + +typedef SDValue (*lower_argument_func)(int i, + SDValue Chain, + DebugLoc dl, + MVT::SimpleValueType VT, + argmap_entry *entry, + SelectionDAG &DAG, + unsigned *argreg); + SDValue PTXTargetLowering:: LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, @@ -48,6 +103,40 @@ DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { + if (isVarArg) llvm_unreachable("PTX does not support varargs"); + + lower_argument_func lower_argument; + + switch (CallConv) { + default: + llvm_unreachable("Unsupported calling convention"); + break; + case CallingConv::PTX_Kernel: + lower_argument = lower_kernel_argument; + break; + case CallingConv::PTX_Device: + lower_argument = lower_device_argument; + break; + } + + // Reset argmap before allocation + for (struct argmap_entry *i = argmap, *e = argmap + array_lengthof(argmap); + i != e; ++ i) + i->reset(); + + for (int i = 0, e = Ins.size(); i != e; ++ i) { + MVT::SimpleValueType VT = Ins[i].VT.getSimpleVT().SimpleTy; + + struct argmap_entry *entry = std::find(argmap, + argmap + array_lengthof(argmap), VT); + if (entry == argmap + array_lengthof(argmap)) + llvm_unreachable("Type of argument is not supported"); + + unsigned reg; + SDValue arg = lower_argument(i, Chain, dl, VT, entry, DAG, ®); + InVals.push_back(arg); + } + return Chain; } @@ -59,7 +148,7 @@ const SmallVectorImpl &OutVals, DebugLoc dl, SelectionDAG &DAG) const { - assert(!isVarArg && "PTX does not support var args."); + if (isVarArg) llvm_unreachable("PTX does not support varargs"); switch (CallConv) { default: @@ -74,10 +163,26 @@ // PTX_Device + // return void if (Outs.size() == 0) return DAG.getNode(PTXISD::RET, dl, MVT::Other, Chain); - // TODO: allocate return register + assert(Outs[0].VT == MVT::i32 && "Can return only basic types"); + SDValue Flag; + unsigned reg = PTX::R0; + + // If this is the first return lowered for this function, add the regs to the + // liveout set for the function + if (DAG.getMachineFunction().getRegInfo().liveout_empty()) + DAG.getMachineFunction().getRegInfo().addLiveOut(reg); + + // Copy the result values into the output registers + Chain = DAG.getCopyToReg(Chain, dl, reg, OutVals[0], Flag); + + // Guarantee that all emitted copies are stuck together, + // avoiding something bad + Flag = Chain.getValue(1); + return DAG.getNode(PTXISD::RET, dl, MVT::Other, Chain, Flag); } Modified: llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp Tue Oct 19 08:14:40 2010 @@ -11,7 +11,9 @@ // //===----------------------------------------------------------------------===// +#include "PTX.h" #include "PTXInstrInfo.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" using namespace llvm; @@ -20,3 +22,66 @@ PTXInstrInfo::PTXInstrInfo(PTXTargetMachine &_TM) : TargetInstrInfoImpl(PTXInsts, array_lengthof(PTXInsts)), RI(_TM, *this), TM(_TM) {} + +static const struct map_entry { + const TargetRegisterClass *cls; + const int opcode; +} map[] = { + { &PTX::RRegs32RegClass, PTX::MOVrr }, + { &PTX::PredsRegClass, PTX::MOVpp } +}; + +void PTXInstrInfo::copyPhysReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, DebugLoc DL, + unsigned DstReg, unsigned SrcReg, + bool KillSrc) const { + for (int i = 0, e = sizeof(map)/sizeof(map[0]); i != e; ++ i) + if (PTX::RRegs32RegClass.contains(DstReg, SrcReg)) { + BuildMI(MBB, I, DL, + get(PTX::MOVrr), DstReg).addReg(SrcReg, getKillRegState(KillSrc)); + return; + } + + llvm_unreachable("Impossible reg-to-reg copy"); +} + +bool PTXInstrInfo::copyRegToReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, + unsigned DstReg, unsigned SrcReg, + const TargetRegisterClass *DstRC, + const TargetRegisterClass *SrcRC, + DebugLoc DL) const { + if (DstRC != SrcRC) + return false; + + for (int i = 0, e = sizeof(map)/sizeof(map[0]); i != e; ++ i) + if (DstRC == map[i].cls) { + MachineInstr *MI = BuildMI(MBB, I, DL, get(map[i].opcode), + DstReg).addReg(SrcReg); + if (MI->findFirstPredOperandIdx() == -1) { + MI->addOperand(MachineOperand::CreateReg(0, false)); + MI->addOperand(MachineOperand::CreateImm(/*IsInv=*/0)); + } + return true; + } + + return false; +} + +bool PTXInstrInfo::isMoveInstr(const MachineInstr& MI, + unsigned &SrcReg, unsigned &DstReg, + unsigned &SrcSubIdx, unsigned &DstSubIdx) const { + switch (MI.getOpcode()) { + default: + return false; + case PTX::MOVpp: + case PTX::MOVrr: + assert(MI.getNumOperands() >= 2 && + MI.getOperand(0).isReg() && MI.getOperand(1).isReg() && + "Invalid register-register move instruction"); + SrcSubIdx = DstSubIdx = 0; // No sub-registers + DstReg = MI.getOperand(0).getReg(); + SrcReg = MI.getOperand(1).getReg(); + return true; + } +} Modified: llvm/trunk/lib/Target/PTX/PTXInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXInstrInfo.h?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXInstrInfo.h (original) +++ llvm/trunk/lib/Target/PTX/PTXInstrInfo.h Tue Oct 19 08:14:40 2010 @@ -29,6 +29,22 @@ explicit PTXInstrInfo(PTXTargetMachine &_TM); virtual const PTXRegisterInfo &getRegisterInfo() const { return RI; } + + virtual void copyPhysReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, DebugLoc DL, + unsigned DstReg, unsigned SrcReg, + bool KillSrc) const; + + virtual bool copyRegToReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, + unsigned DstReg, unsigned SrcReg, + const TargetRegisterClass *DstRC, + const TargetRegisterClass *SrcRC, + DebugLoc DL) const; + + virtual bool isMoveInstr(const MachineInstr& MI, + unsigned &SrcReg, unsigned &DstReg, + unsigned &SrcSubIdx, unsigned &DstSubIdx) const; }; // class PTXInstrInfo } // namespace llvm Modified: llvm/trunk/lib/Target/PTX/PTXInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXInstrInfo.td?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXInstrInfo.td (original) +++ llvm/trunk/lib/Target/PTX/PTXInstrInfo.td Tue Oct 19 08:14:40 2010 @@ -30,6 +30,27 @@ // Instructions //===----------------------------------------------------------------------===// +///===- Data Movement and Conversion Instructions -------------------------===// + +let neverHasSideEffects = 1 in { + // rely on isMoveInstr to separate MOVpp, MOVrr, etc. + def MOVpp + : InstPTX<(outs Preds:$d), (ins Preds:$a), "mov.pred\t$d, $a", []>; + def MOVrr + : InstPTX<(outs RRegs32:$d), (ins RRegs32:$a), "mov.s32\t$d, $a", []>; +} + +let isReMaterializable = 1, isAsCheapAsAMove = 1 in { + def MOVpi + : InstPTX<(outs Preds:$d), (ins i1imm:$a), "mov.pred\t$d, $a", + [(set Preds:$d, imm:$a)]>; + def MOVri + : InstPTX<(outs RRegs32:$d), (ins i32imm:$a), "mov.s32\t$d, $a", + [(set RRegs32:$d, imm:$a)]>; +} + +///===- Control Flow Instructions -----------------------------------------===// + let isReturn = 1, isTerminator = 1, isBarrier = 1 in { def EXIT : InstPTX<(outs), (ins), "exit", [(PTXexit)]>; def RET : InstPTX<(outs), (ins), "ret", [(PTXret)]>; Modified: llvm/trunk/lib/Target/PTX/PTXRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXRegisterInfo.h?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXRegisterInfo.h (original) +++ llvm/trunk/lib/Target/PTX/PTXRegisterInfo.h Tue Oct 19 08:14:40 2010 @@ -40,10 +40,11 @@ virtual bool hasFP(const MachineFunction &MF) const { return false; } - // FIXME: Given that PTX does not support stack frame, what should we do here? virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, - RegScavenger *RS = NULL) const {} + RegScavenger *RS = NULL) const { + llvm_unreachable("PTX does not support general function call"); + } virtual void emitPrologue(MachineFunction &MF) const {} virtual void emitEpilogue(MachineFunction &MF, Modified: llvm/trunk/lib/Target/PTX/PTXRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXRegisterInfo.td?rev=116805&r1=116804&r2=116805&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXRegisterInfo.td (original) +++ llvm/trunk/lib/Target/PTX/PTXRegisterInfo.td Tue Oct 19 08:14:40 2010 @@ -52,6 +52,39 @@ def P30 : PTXReg<"p30">; def P31 : PTXReg<"p31">; +def R0 : PTXReg<"r0">; +def R1 : PTXReg<"r1">; +def R2 : PTXReg<"r2">; +def R3 : PTXReg<"r3">; +def R4 : PTXReg<"r4">; +def R5 : PTXReg<"r5">; +def R6 : PTXReg<"r6">; +def R7 : PTXReg<"r7">; +def R8 : PTXReg<"r8">; +def R9 : PTXReg<"r9">; +def R10 : PTXReg<"r10">; +def R11 : PTXReg<"r11">; +def R12 : PTXReg<"r12">; +def R13 : PTXReg<"r13">; +def R14 : PTXReg<"r14">; +def R15 : PTXReg<"r15">; +def R16 : PTXReg<"r16">; +def R17 : PTXReg<"r17">; +def R18 : PTXReg<"r18">; +def R19 : PTXReg<"r19">; +def R20 : PTXReg<"r20">; +def R21 : PTXReg<"r21">; +def R22 : PTXReg<"r22">; +def R23 : PTXReg<"r23">; +def R24 : PTXReg<"r24">; +def R25 : PTXReg<"r25">; +def R26 : PTXReg<"r26">; +def R27 : PTXReg<"r27">; +def R28 : PTXReg<"r28">; +def R29 : PTXReg<"r29">; +def R30 : PTXReg<"r30">; +def R31 : PTXReg<"r31">; + //===----------------------------------------------------------------------===// // Register classes //===----------------------------------------------------------------------===// @@ -61,3 +94,9 @@ P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, P23, P24, P25, P26, P27, P28, P29, P30, P31]>; + +def RRegs32 : RegisterClass<"PTX", [i32], 32, + [R0, R1, R2, 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]>; From clchiou at gmail.com Tue Oct 19 08:21:51 2010 From: clchiou at gmail.com (Che-Liang Chiou) Date: Tue, 19 Oct 2010 13:21:51 -0000 Subject: [llvm-commits] [llvm] r116806 - /llvm/trunk/test/CodeGen/PTX/mov.ll Message-ID: <20101019132151.B3F292A6C12C@llvm.org> Author: clchiou Date: Tue Oct 19 08:21:51 2010 New Revision: 116806 URL: http://llvm.org/viewvc/llvm-project?rev=116806&view=rev Log: Add test case mov.ll for PTX device function Added: llvm/trunk/test/CodeGen/PTX/mov.ll Added: llvm/trunk/test/CodeGen/PTX/mov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PTX/mov.ll?rev=116806&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PTX/mov.ll (added) +++ llvm/trunk/test/CodeGen/PTX/mov.ll Tue Oct 19 08:21:51 2010 @@ -0,0 +1,13 @@ +; RUN: llc < %s -march=ptx | FileCheck %s + +define ptx_device i32 @t1() { +;CHECK: mov.s32 r0, 0; +;CHECK: ret; + ret i32 0 +} + +define ptx_device i32 @t2(i32 %x) { +;CHECK: mov.s32 r0, r1; +;CHECK: ret; + ret i32 %x +} From clchiou at gmail.com Tue Oct 19 08:28:18 2010 From: clchiou at gmail.com (Che-Liang Chiou) Date: Tue, 19 Oct 2010 13:28:18 -0000 Subject: [llvm-commits] [llvm] r116807 - /llvm/trunk/lib/Target/PTX/ Message-ID: <20101019132818.E7C902A6C12C@llvm.org> Author: clchiou Date: Tue Oct 19 08:28:18 2010 New Revision: 116807 URL: http://llvm.org/viewvc/llvm-project?rev=116807&view=rev Log: Add svn:ignore to lib/Target/PTX/ Modified: llvm/trunk/lib/Target/PTX/ (props changed) Propchange: llvm/trunk/lib/Target/PTX/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 19 08:28:18 2010 @@ -0,0 +1,10 @@ +Debug +Debug+Checks +Debug+Coverage +Debug+Coverage-Asserts +*.inc +Release +Release-Asserts +Release+Coverage +Debug+Asserts +Release+Asserts From clchiou at gmail.com Tue Oct 19 08:46:32 2010 From: clchiou at gmail.com (Che-Liang Chiou) Date: Tue, 19 Oct 2010 13:46:32 -0000 Subject: [llvm-commits] [llvm] r116808 - in /llvm/trunk: include/llvm/Config/ lib/Target/PTX/AsmPrinter/ lib/Target/PTX/TargetInfo/ test/ test/CodeGen/PTX/ tools/bugpoint-passes/ tools/llvmc/src/ Message-ID: <20101019134632.601B72A6C12C@llvm.org> Author: clchiou Date: Tue Oct 19 08:46:32 2010 New Revision: 116808 URL: http://llvm.org/viewvc/llvm-project?rev=116808&view=rev Log: Add svn:ignore Modified: llvm/trunk/include/llvm/Config/ (props changed) llvm/trunk/lib/Target/PTX/AsmPrinter/ (props changed) llvm/trunk/lib/Target/PTX/TargetInfo/ (props changed) llvm/trunk/test/ (props changed) llvm/trunk/test/CodeGen/PTX/ (props changed) llvm/trunk/tools/bugpoint-passes/ (props changed) llvm/trunk/tools/llvmc/src/ (props changed) Propchange: llvm/trunk/include/llvm/Config/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -4,3 +4,4 @@ Targets.def AsmParsers.def Disassemblers.def +llvm-config.h Propchange: llvm/trunk/lib/Target/PTX/AsmPrinter/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -0,0 +1,9 @@ +Debug +Debug+Checks +Debug+Coverage +Debug+Coverage-Asserts +Release +Release-Asserts +Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/lib/Target/PTX/TargetInfo/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -0,0 +1,9 @@ +Debug +Debug+Checks +Debug+Coverage +Debug+Coverage-Asserts +Release +Release-Asserts +Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/test/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -2,3 +2,4 @@ *.sum site.exp site.bak +lit.site.cfg Propchange: llvm/trunk/test/CodeGen/PTX/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -0,0 +1 @@ +Output Propchange: llvm/trunk/tools/bugpoint-passes/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -0,0 +1,9 @@ +Debug +Debug+Checks +Debug+Coverage +Debug+Coverage-Asserts +Release +Release-Asserts +Release+Coverage +Debug+Asserts +Release+Asserts Propchange: llvm/trunk/tools/llvmc/src/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 19 08:46:32 2010 @@ -0,0 +1,11 @@ +Debug +Debug+Checks +Debug+Coverage +Debug+Coverage-Asserts +Release +Release-Asserts +Release+Coverage +Debug+Asserts +Release+Asserts +AutoGenerated.inc +Base.td From baldrick at free.fr Tue Oct 19 08:55:15 2010 From: baldrick at free.fr (Duncan Sands) Date: Tue, 19 Oct 2010 15:55:15 +0200 Subject: [llvm-commits] [PATCH] Promote all possible memory to registers In-Reply-To: References: Message-ID: <4CBDA343.8090608@free.fr> Hi Kenneth, > This is a new pass, activated by the "-allmem2reg" switch for opt. It > is a generalization of the SSA algorithm, attempting to promote all > non-volatile loads within a function, not just those from alloca's > which haven't had their address taken. unfortunately your patch does not apply to top-of-tree. Ciao, Duncan. From kennethuil at gmail.com Tue Oct 19 09:19:48 2010 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Tue, 19 Oct 2010 09:19:48 -0500 Subject: [llvm-commits] [PATCH] Promote all possible memory to registers In-Reply-To: <4CBDA343.8090608@free.fr> References: <4CBDA343.8090608@free.fr> Message-ID: On Tue, Oct 19, 2010 at 8:55 AM, Duncan Sands wrote: > Hi Kenneth, > >> This is a new pass, activated by the "-allmem2reg" switch for opt. ?It >> is a generalization of the SSA algorithm, attempting to promote all >> non-volatile loads within a function, not just those from alloca's >> which haven't had their address taken. > > unfortunately your patch does not apply to top-of-tree. > > Ciao, > > Duncan. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > I'm working on another patch; I found some bugs yesterday. I should have posted something to that effect, but I assumed that y'all were waiting on my measurements anyway. From aggarwa4 at illinois.edu Tue Oct 19 11:03:34 2010 From: aggarwa4 at illinois.edu (Arushi Aggarwal) Date: Tue, 19 Oct 2010 16:03:34 -0000 Subject: [llvm-commits] [poolalloc] r116810 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Message-ID: <20101019160334.0D6942A6C12C@llvm.org> Author: aggarwa4 Date: Tue Oct 19 11:03:33 2010 New Revision: 116810 URL: http://llvm.org/viewvc/llvm-project?rev=116810&view=rev Log: Changes to allow for a more complete call graph. Merge information back from globals graph into the individual function's graph, so that more exact call graph can be constructed, for calls, made through global objects/structs. Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=116810&r1=116809&r2=116810&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Tue Oct 19 11:03:33 2010 @@ -141,16 +141,18 @@ formGlobalECs(); // Merge the globals variables (not the calls) from the globals graph back - // into the main function's graph so that the main function contains all of - // the information about global pools and GV usage in the program. - for (std::vector::iterator ii = EntryPoints.begin(), - ee = EntryPoints.end(); ii != ee; ++ii) { - DSGraph* MainGraph = getOrCreateGraph(*ii); - cloneGlobalsInto(MainGraph); - - MainGraph->maskIncompleteMarkers(); - MainGraph->markIncompleteNodes(DSGraph::MarkFormalArgs | + // into the individual function's graph so that changes made to globals during + // BU can be reflected. This is specifically needed for correct call graph + + for (Module::iterator F = M.begin(); F != M.end(); ++F) { + if (!(F->isDeclaration())){ + DSGraph *Graph = getOrCreateGraph(F); + cloneGlobalsInto(Graph); + Graph->maskIncompleteMarkers(); + Graph->markIncompleteNodes(DSGraph::MarkFormalArgs | DSGraph::IgnoreGlobals); + + } } NumCallEdges += callgraph.size(); @@ -161,7 +163,7 @@ // callgraph.buildSCCs(); callgraph.buildRoots(); - + return false; } @@ -509,6 +511,7 @@ return MyID; // == Min } +#if 0 // // Method: postOrder() // @@ -608,6 +611,7 @@ GlobalsGraph->getScalarMap().clear_scalars(); } +#endif // // Method: CloneAuxIntoGlobal() @@ -686,7 +690,7 @@ // Fast path for noop calls. Note that we don't care about merging globals // in the callee with nodes in the caller here. - if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0 && !CS.isVarArg()) { + if (!CS.isIndirectCall() && CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0 && !CS.isVarArg()) { TempFCs.erase(TempFCs.begin()); continue; } @@ -742,7 +746,7 @@ std::sort(NodeCallees.begin(), NodeCallees.end()); eraseCS = std::includes(CalledFuncs.begin(), CalledFuncs.end(), NodeCallees.begin(), NodeCallees.end()); - } + } // // Update the statistics on resolved indirect function calls. From grosbach at apple.com Tue Oct 19 11:16:18 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 19 Oct 2010 09:16:18 -0700 Subject: [llvm-commits] [llvm] r116785 - /llvm/trunk/lib/System/Win32/ThreadLocal.inc In-Reply-To: <20101019012202.27CB12A6C12C@llvm.org> References: <20101019012202.27CB12A6C12C@llvm.org> Message-ID: Can you add a comment saying why that line is necessary? Otherwise some well meaning person may remove the "unusued" statement. -Jim On Oct 18, 2010, at 6:22 PM, NAKAMURA Takumi wrote: > Author: chapuni > Date: Mon Oct 18 20:22:01 2010 > New Revision: 116785 > > URL: http://llvm.org/viewvc/llvm-project?rev=116785&view=rev > Log: > lib/System/Win32/ThreadLocal.inc: Suppress "unused" warning on -Asserts. > > Modified: > llvm/trunk/lib/System/Win32/ThreadLocal.inc > > Modified: llvm/trunk/lib/System/Win32/ThreadLocal.inc > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/ThreadLocal.inc?rev=116785&r1=116784&r2=116785&view=diff > ============================================================================== > --- llvm/trunk/lib/System/Win32/ThreadLocal.inc (original) > +++ llvm/trunk/lib/System/Win32/ThreadLocal.inc Mon Oct 18 20:22:01 2010 > @@ -44,6 +44,7 @@ > DWORD* tls = static_cast(data); > int errorcode = TlsSetValue(*tls, const_cast(d)); > assert(errorcode != 0); > + (void)errorcode; > } > > void ThreadLocalImpl::removeInstance() { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From foldr at codedgers.com Tue Oct 19 11:47:15 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Tue, 19 Oct 2010 16:47:15 -0000 Subject: [llvm-commits] [llvm] r116811 - /llvm/trunk/include/llvm/GlobalVariable.h Message-ID: <20101019164715.31E492A6C12C@llvm.org> Author: foldr Date: Tue Oct 19 11:47:15 2010 New Revision: 116811 URL: http://llvm.org/viewvc/llvm-project?rev=116811&view=rev Log: Trailing whitespace. Modified: llvm/trunk/include/llvm/GlobalVariable.h Modified: llvm/trunk/include/llvm/GlobalVariable.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalVariable.h?rev=116811&r1=116810&r2=116811&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalVariable.h (original) +++ llvm/trunk/include/llvm/GlobalVariable.h Tue Oct 19 11:47:15 2010 @@ -68,7 +68,7 @@ /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); - /// isDeclaration - Is this global variable lacking an initializer? If so, + /// isDeclaration - Is this global variable lacking an initializer? If so, /// the global variable is defined in some other translation unit, and is thus /// only a declaration here. virtual bool isDeclaration() const { return getNumOperands() == 0; } From foldr at codedgers.com Tue Oct 19 11:47:23 2010 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Tue, 19 Oct 2010 16:47:23 -0000 Subject: [llvm-commits] [llvm] r116812 - in /llvm/trunk: include/llvm/GlobalVariable.h lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll Message-ID: <20101019164724.0CD4E2A6C12C@llvm.org> Author: foldr Date: Tue Oct 19 11:47:23 2010 New Revision: 116812 URL: http://llvm.org/viewvc/llvm-project?rev=116812&view=rev Log: GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals. Fixes PR8389. Added: llvm/trunk/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll Modified: llvm/trunk/include/llvm/GlobalVariable.h llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/include/llvm/GlobalVariable.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalVariable.h?rev=116812&r1=116811&r2=116812&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalVariable.h (original) +++ llvm/trunk/include/llvm/GlobalVariable.h Tue Oct 19 11:47:23 2010 @@ -80,7 +80,21 @@ inline bool hasInitializer() const { return !isDeclaration(); } /// hasDefinitiveInitializer - Whether the global variable has an initializer, - /// and this is the initializer that will be used in the final executable. + /// and any other instances of the global (this can happen due to weak + /// linkage) are guaranteed to have the same initializer. + /// + /// Note that if you want to transform a global, you must use + /// hasUniqueInitializer() instead, because of the *_odr linkage type. + /// + /// Example: + /// + /// @a = global SomeType* null - Initializer is both definitive and unique. + /// + /// @b = global weak SomeType* null - Initializer is neither definitive nor + /// unique. + /// + /// @c = global weak_odr SomeType* null - Initializer is definitive, but not + /// unique. inline bool hasDefinitiveInitializer() const { return hasInitializer() && // The initializer of a global variable with weak linkage may change at @@ -88,6 +102,19 @@ !mayBeOverridden(); } + /// hasUniqueInitializer - Whether the global variable has an initializer, and + /// any changes made to the initializer will turn up in the final executable. + inline bool hasUniqueInitializer() const { + return hasInitializer() && + // It's not safe to modify initializers of global variables with weak + // linkage, because the linker might choose to discard the initializer and + // use the initializer from another instance of the global variable + // instead. It is wrong to modify the initializer of a global variable + // with *_odr linkage because then different instances of the global may + // have different initializers, breaking the One Definition Rule. + !isWeakForLinker(); + } + /// getInitializer - Return the initializer for this global variable. It is /// illegal to call this method if the global is external, because we cannot /// tell what the value is initialized to! Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=116812&r1=116811&r2=116812&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Oct 19 11:47:23 2010 @@ -1944,8 +1944,9 @@ FTy->isVarArg() || FTy->getNumParams() != 0) return 0; - // Verify that the initializer is simple enough for us to handle. - if (!I->hasDefinitiveInitializer()) return 0; + // Verify that the initializer is simple enough for us to handle. We are + // only allowed to optimize the initializer if it is unique. + if (!I->hasUniqueInitializer()) return 0; ConstantArray *CA = dyn_cast(I->getInitializer()); if (!CA) return 0; for (User::op_iterator i = CA->op_begin(), e = CA->op_end(); i != e; ++i) @@ -2062,9 +2063,9 @@ return false; if (GlobalVariable *GV = dyn_cast(C)) - // Do not allow weak/linkonce/dllimport/dllexport linkage or + // Do not allow weak/*_odr/linkonce/dllimport/dllexport linkage or // external globals. - return GV->hasDefinitiveInitializer(); + return GV->hasUniqueInitializer(); if (ConstantExpr *CE = dyn_cast(C)) // Handle a constantexpr gep. @@ -2072,9 +2073,9 @@ isa(CE->getOperand(0)) && cast(CE)->isInBounds()) { GlobalVariable *GV = cast(CE->getOperand(0)); - // Do not allow weak/linkonce/dllimport/dllexport linkage or + // Do not allow weak/*_odr/linkonce/dllimport/dllexport linkage or // external globals. - if (!GV->hasDefinitiveInitializer()) + if (!GV->hasUniqueInitializer()) return false; // The first index must be zero. Added: llvm/trunk/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll?rev=116812&view=auto ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll (added) +++ llvm/trunk/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll Tue Oct 19 11:47:23 2010 @@ -0,0 +1,16 @@ +; RUN: opt < %s -globalopt -S | FileCheck %s + +; PR8389: Globals with weak_odr linkage type must not be modified + +; CHECK: weak_odr global i32 0 + + at SomeVar = weak_odr global i32 0 + + at llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ] + +define internal void @CTOR() { + store i32 23, i32* @SomeVar + ret void +} + + From gohman at apple.com Tue Oct 19 12:06:23 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 19 Oct 2010 17:06:23 -0000 Subject: [llvm-commits] [llvm] r116815 - in /llvm/trunk/lib: Analysis/AliasAnalysis.cpp Analysis/AliasAnalysisEvaluator.cpp Analysis/Lint.cpp Transforms/Scalar/DeadStoreElimination.cpp Transforms/Scalar/MemCpyOptimizer.cpp Message-ID: <20101019170623.4069A2A6C12C@llvm.org> Author: djg Date: Tue Oct 19 12:06:23 2010 New Revision: 116815 URL: http://llvm.org/viewvc/llvm-project?rev=116815&view=rev Log: Consistently use AliasAnalysis::UnknownSize instead of hardcoding ~0u. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=116815&r1=116814&r2=116815&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Oct 19 12:06:23 2010 @@ -284,7 +284,7 @@ /// if known, or a conservative value otherwise. /// unsigned AliasAnalysis::getTypeStoreSize(const Type *Ty) { - return TD ? TD->getTypeStoreSize(Ty) : ~0u; + return TD ? TD->getTypeStoreSize(Ty) : UnknownSize; } /// canBasicBlockModify - Return true if it is possible for execution of the Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=116815&r1=116814&r2=116815&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Oct 19 12:06:23 2010 @@ -166,12 +166,12 @@ // 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; + unsigned I1Size = AliasAnalysis::UnknownSize; const Type *I1ElTy = cast((*I1)->getType())->getElementType(); if (I1ElTy->isSized()) I1Size = AA.getTypeStoreSize(I1ElTy); for (SetVector::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { - unsigned I2Size = ~0u; + unsigned I2Size = AliasAnalysis::UnknownSize; const Type *I2ElTy =cast((*I2)->getType())->getElementType(); if (I2ElTy->isSized()) I2Size = AA.getTypeStoreSize(I2ElTy); @@ -198,7 +198,7 @@ for (SetVector::iterator V = Pointers.begin(), Ve = Pointers.end(); V != Ve; ++V) { - unsigned Size = ~0u; + unsigned Size = AliasAnalysis::UnknownSize; const Type *ElTy = cast((*V)->getType())->getElementType(); if (ElTy->isSized()) Size = AA.getTypeStoreSize(ElTy); Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=116815&r1=116814&r2=116815&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Oct 19 12:06:23 2010 @@ -191,7 +191,8 @@ Instruction &I = *CS.getInstruction(); Value *Callee = CS.getCalledValue(); - visitMemoryReference(I, Callee, ~0u, 0, 0, MemRef::Callee); + visitMemoryReference(I, Callee, AliasAnalysis::UnknownSize, + 0, 0, MemRef::Callee); if (Function *F = dyn_cast(findValue(Callee, /*OffsetOk=*/false))) { Assert1(CS.getCallingConv() == F->getCallingConv(), @@ -264,9 +265,11 @@ case Intrinsic::memcpy: { MemCpyInst *MCI = cast(&I); // TODO: If the size is known, use it. - visitMemoryReference(I, MCI->getDest(), ~0u, MCI->getAlignment(), 0, + visitMemoryReference(I, MCI->getDest(), AliasAnalysis::UnknownSize, + MCI->getAlignment(), 0, MemRef::Write); - visitMemoryReference(I, MCI->getSource(), ~0u, MCI->getAlignment(), 0, + visitMemoryReference(I, MCI->getSource(), AliasAnalysis::UnknownSize, + MCI->getAlignment(), 0, MemRef::Read); // Check that the memcpy arguments don't overlap. The AliasAnalysis API @@ -286,16 +289,19 @@ case Intrinsic::memmove: { MemMoveInst *MMI = cast(&I); // TODO: If the size is known, use it. - visitMemoryReference(I, MMI->getDest(), ~0u, MMI->getAlignment(), 0, + visitMemoryReference(I, MMI->getDest(), AliasAnalysis::UnknownSize, + MMI->getAlignment(), 0, MemRef::Write); - visitMemoryReference(I, MMI->getSource(), ~0u, MMI->getAlignment(), 0, + visitMemoryReference(I, MMI->getSource(), AliasAnalysis::UnknownSize, + MMI->getAlignment(), 0, MemRef::Read); break; } case Intrinsic::memset: { MemSetInst *MSI = cast(&I); // TODO: If the size is known, use it. - visitMemoryReference(I, MSI->getDest(), ~0u, MSI->getAlignment(), 0, + visitMemoryReference(I, MSI->getDest(), AliasAnalysis::UnknownSize, + MSI->getAlignment(), 0, MemRef::Write); break; } @@ -305,24 +311,26 @@ "Undefined behavior: va_start called in a non-varargs function", &I); - visitMemoryReference(I, CS.getArgument(0), ~0u, 0, 0, - MemRef::Read | MemRef::Write); + visitMemoryReference(I, CS.getArgument(0), AliasAnalysis::UnknownSize, + 0, 0, MemRef::Read | MemRef::Write); break; case Intrinsic::vacopy: - visitMemoryReference(I, CS.getArgument(0), ~0u, 0, 0, MemRef::Write); - visitMemoryReference(I, CS.getArgument(1), ~0u, 0, 0, MemRef::Read); + visitMemoryReference(I, CS.getArgument(0), AliasAnalysis::UnknownSize, + 0, 0, MemRef::Write); + visitMemoryReference(I, CS.getArgument(1), AliasAnalysis::UnknownSize, + 0, 0, MemRef::Read); break; case Intrinsic::vaend: - visitMemoryReference(I, CS.getArgument(0), ~0u, 0, 0, - MemRef::Read | MemRef::Write); + visitMemoryReference(I, CS.getArgument(0), AliasAnalysis::UnknownSize, + 0, 0, MemRef::Read | MemRef::Write); break; case Intrinsic::stackrestore: // Stackrestore doesn't read or write memory, but it sets the // stack pointer, which the compiler may read from or write to // at any time, so check it for both readability and writeability. - visitMemoryReference(I, CS.getArgument(0), ~0u, 0, 0, - MemRef::Read | MemRef::Write); + visitMemoryReference(I, CS.getArgument(0), AliasAnalysis::UnknownSize, + 0, 0, MemRef::Read | MemRef::Write); break; } } @@ -495,12 +503,13 @@ } void Lint::visitVAArgInst(VAArgInst &I) { - visitMemoryReference(I, I.getOperand(0), ~0u, 0, 0, + visitMemoryReference(I, I.getOperand(0), AliasAnalysis::UnknownSize, 0, 0, MemRef::Read | MemRef::Write); } void Lint::visitIndirectBrInst(IndirectBrInst &I) { - visitMemoryReference(I, I.getAddress(), ~0u, 0, 0, MemRef::Branchee); + visitMemoryReference(I, I.getAddress(), AliasAnalysis::UnknownSize, 0, 0, + MemRef::Branchee); Assert1(I.getNumDestinations() != 0, "Undefined behavior: indirectbr with no destinations", &I); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=116815&r1=116814&r2=116815&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Oct 19 12:06:23 2010 @@ -59,7 +59,7 @@ bool handleFreeWithNonTrivialDependency(const CallInst *F, MemDepResult Dep); bool handleEndBlock(BasicBlock &BB); - bool RemoveUndeadPointers(Value *Ptr, uint64_t killPointerSize, + bool RemoveUndeadPointers(Value *Ptr, unsigned killPointerSize, BasicBlock::iterator &BBI, SmallPtrSet &deadPointers); void DeleteDeadInstruction(Instruction *I, @@ -371,7 +371,7 @@ } Value *killPointer = 0; - uint64_t killPointerSize = ~0UL; + unsigned killPointerSize = AliasAnalysis::UnknownSize; // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst *L = dyn_cast(BBI)) { @@ -470,7 +470,7 @@ /// RemoveUndeadPointers - check for uses of a pointer that make it /// undead when scanning for dead stores to alloca's. -bool DSE::RemoveUndeadPointers(Value *killPointer, uint64_t killPointerSize, +bool DSE::RemoveUndeadPointers(Value *killPointer, unsigned killPointerSize, BasicBlock::iterator &BBI, SmallPtrSet &deadPointers) { AliasAnalysis &AA = getAnalysis(); @@ -575,5 +575,5 @@ return TD->getTypeAllocSize(PT->getElementType()); } } - return ~0U; + return AliasAnalysis::UnknownSize; } Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=116815&r1=116814&r2=116815&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Tue Oct 19 12:06:23 2010 @@ -770,7 +770,7 @@ // If the memmove is a constant size, use it for the alias query, this allows // us to optimize things like: memmove(P, P+64, 64); - uint64_t MemMoveSize = ~0ULL; + unsigned MemMoveSize = AliasAnalysis::UnknownSize; if (ConstantInt *Len = dyn_cast(M->getLength())) MemMoveSize = Len->getZExtValue(); From daniel at zuster.org Tue Oct 19 12:14:24 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 19 Oct 2010 17:14:24 -0000 Subject: [llvm-commits] [llvm] r116816 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/MachineLICM.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h test/CodeGen/ARM/remat.ll test/CodeGen/Thumb2/machine-licm-vdup.ll test/CodeGen/X86/2008-10-27-CoalescerBug.ll test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Message-ID: <20101019171424.56B6F2A6C12C@llvm.org> Author: ddunbar Date: Tue Oct 19 12:14:24 2010 New Revision: 116816 URL: http://llvm.org/viewvc/llvm-project?rev=116816&view=rev Log: Revert r116781 "- Add a hook for target to determine whether an instruction def is", which breaks some nightly tests. Added: llvm/trunk/test/CodeGen/ARM/remat.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Tue Oct 19 12:14:24 2010 @@ -24,7 +24,6 @@ class LiveVariables; class MCAsmInfo; class MachineMemOperand; -class MachineRegisterInfo; class MDNode; class MCInst; class SDNode; @@ -626,19 +625,6 @@ int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const; - - /// hasHighOperandLatency - Compute operand latency between a def of 'Reg' - /// and an use in the current loop, return true if the target considered - /// it 'high'. This is used by optimization passes such as machine LICM to - /// determine whether it makes sense to hoist an instruction out even in - /// high register pressure situation. - virtual - bool hasHighOperandLatency(const InstrItineraryData *ItinData, - const MachineRegisterInfo *MRI, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) const { - return false; - } }; /// TargetInstrInfoImpl - This is the default implementation of Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Tue Oct 19 12:14:24 2010 @@ -43,6 +43,11 @@ using namespace llvm; +static cl::opt +TrackRegPressure("rp-aware-machine-licm", + cl::desc("Register pressure aware machine LICM"), + cl::init(false), cl::Hidden); + STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops"); STATISTIC(NumLowRP, @@ -119,7 +124,6 @@ RegSeen.clear(); RegPressure.clear(); RegLimit.clear(); - BackTrace.clear(); for (DenseMap >::iterator CI = CSEMap.begin(), CE = CSEMap.end(); CI != CE; ++CI) CI->second.clear(); @@ -167,10 +171,9 @@ /// bool IsLoopInvariantInst(MachineInstr &I); - /// HasHighOperandLatency - Compute operand latency between a def of 'Reg' - /// and an use in the current loop, return true if the target considered - /// it 'high'. - bool HasHighOperandLatency(MachineInstr &MI, unsigned DefIdx, unsigned Reg); + /// ComputeOperandLatency - Compute operand latency between a def of 'Reg' + /// and an use in the current loop. + int ComputeOperandLatency(MachineInstr &MI, unsigned DefIdx, unsigned Reg); /// IncreaseHighRegPressure - Visit BBs from preheader to current BB, check /// if hoisting an instruction of the given cost matrix can cause high @@ -553,24 +556,28 @@ if (!Preheader) return; - if (IsHeader) { - // Compute registers which are liveout of preheader. - RegSeen.clear(); - BackTrace.clear(); - InitRegPressure(Preheader); - } + if (TrackRegPressure) { + if (IsHeader) { + // Compute registers which are liveout of preheader. + RegSeen.clear(); + BackTrace.clear(); + InitRegPressure(Preheader); + } - // Remember livein register pressure. - BackTrace.push_back(RegPressure); + // Remember livein register pressure. + BackTrace.push_back(RegPressure); + } for (MachineBasicBlock::iterator MII = BB->begin(), E = BB->end(); MII != E; ) { MachineBasicBlock::iterator NextMII = MII; ++NextMII; MachineInstr *MI = &*MII; - UpdateRegPressureBefore(MI); + if (TrackRegPressure) + UpdateRegPressureBefore(MI); Hoist(MI, Preheader); - UpdateRegPressureAfter(MI); + if (TrackRegPressure) + UpdateRegPressureAfter(MI); MII = NextMII; } @@ -584,7 +591,8 @@ HoistRegion(Children[I]); } - BackTrace.pop_back(); + if (TrackRegPressure) + BackTrace.pop_back(); } /// InitRegPressure - Find all virtual register references that are liveout of @@ -780,14 +788,15 @@ } } -/// HasHighOperandLatency - Compute operand latency between a def of 'Reg' -/// and an use in the current loop, return true if the target considered -/// it 'high'. -bool MachineLICM::HasHighOperandLatency(MachineInstr &MI, - unsigned DefIdx, unsigned Reg) { +/// ComputeOperandLatency - Compute operand latency between a def of 'Reg' +/// and an use in the current loop. +int MachineLICM::ComputeOperandLatency(MachineInstr &MI, + unsigned DefIdx, unsigned Reg) { if (MRI->use_nodbg_empty(Reg)) - return false; + // No use? Return arbitrary large number! + return 300; + int Latency = -1; for (MachineRegisterInfo::use_nodbg_iterator I = MRI->use_nodbg_begin(Reg), E = MRI->use_nodbg_end(); I != E; ++I) { MachineInstr *UseMI = &*I; @@ -801,15 +810,18 @@ if (MOReg != Reg) continue; - if (TII->hasHighOperandLatency(InstrItins, MRI, &MI, DefIdx, UseMI, i)) - return true; + int UseCycle = TII->getOperandLatency(InstrItins, &MI, DefIdx, UseMI, i); + Latency = std::max(Latency, UseCycle); } - // Only look at the first in loop use. - break; + if (Latency != -1) + break; } - return false; + if (Latency == -1) + Latency = InstrItins->getOperandCycle(MI.getDesc().getSchedClass(), DefIdx); + + return Latency; } /// IncreaseHighRegPressure - Visit BBs from preheader to current BB, check @@ -843,19 +855,19 @@ if (MI.isImplicitDef()) return true; - // If the instruction is cheap, only hoist if it is re-materilizable. LICM - // will increase register pressure. It's probably not worth it if the - // instruction is cheap. + // FIXME: For now, only hoist re-materilizable instructions. LICM will + // increase register pressure. We want to make sure it doesn't increase + // spilling. // Also hoist loads from constant memory, e.g. load from stubs, GOT. Hoisting // these tend to help performance in low register pressure situation. The // trade off is it may cause spill in high pressure situation. It will end up // adding a store in the loop preheader. But the reload is no more expensive. // The side benefit is these loads are frequently CSE'ed. - if (MI.getDesc().isAsCheapAsAMove()) { - if (!TII->isTriviallyReMaterializable(&MI, AA)) + if (!TrackRegPressure || MI.getDesc().isAsCheapAsAMove()) { + if (!TII->isTriviallyReMaterializable(&MI, AA) && + !isLoadFromConstantMemory(&MI)) return false; } else { - // Estimate register pressure to determine whether to LICM the instruction. // In low register pressure situation, we can be more aggressive about // hoisting. Also, favors hoisting long latency instructions even in // moderately high pressure situation. @@ -868,9 +880,13 @@ if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue; if (MO.isDef()) { - if (HasHighOperandLatency(MI, i, Reg)) { - ++NumHighLatency; - return true; + if (InstrItins && !InstrItins->isEmpty()) { + int Cycle = ComputeOperandLatency(MI, i, Reg); + if (Cycle > 3) { + // FIXME: Target specific high latency limit? + ++NumHighLatency; + return true; + } } const TargetRegisterClass *RC = MRI->getRegClass(Reg); Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Oct 19 12:14:24 2010 @@ -1925,23 +1925,3 @@ return getOperandLatency(ItinData, DefTID, DefIdx, DefAlign, UseTID, UseIdx, UseAlign); } - -bool ARMBaseInstrInfo:: -hasHighOperandLatency(const InstrItineraryData *ItinData, - const MachineRegisterInfo *MRI, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) const { - unsigned DDomain = DefMI->getDesc().TSFlags & ARMII::DomainMask; - unsigned UDomain = UseMI->getDesc().TSFlags & ARMII::DomainMask; - if (Subtarget.isCortexA8() && - (DDomain == ARMII::DomainVFP || UDomain == ARMII::DomainVFP)) - // CortexA8 VFP instructions are not pipelined. - return true; - - // Hoist VFP / NEON instructions with 4 or higher latency. - int Latency = getOperandLatency(ItinData, DefMI, DefIdx, UseMI, UseIdx); - if (Latency <= 3) - return false; - return DDomain == ARMII::DomainVFP || DDomain == ARMII::DomainNEON || - UDomain == ARMII::DomainVFP || UDomain == ARMII::DomainNEON; -} Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Tue Oct 19 12:14:24 2010 @@ -377,11 +377,6 @@ unsigned DefIdx, unsigned DefAlign, const TargetInstrDesc &UseTID, unsigned UseIdx, unsigned UseAlign) const; - - bool hasHighOperandLatency(const InstrItineraryData *ItinData, - const MachineRegisterInfo *MRI, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) const; }; static inline Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Oct 19 12:14:24 2010 @@ -3152,41 +3152,6 @@ NopInst.setOpcode(X86::NOOP); } -bool X86InstrInfo:: -hasHighOperandLatency(const InstrItineraryData *ItinData, - const MachineRegisterInfo *MRI, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) const { - switch (DefMI->getOpcode()) { - default: return false; - case X86::DIVSDrm: - case X86::DIVSDrm_Int: - case X86::DIVSDrr: - case X86::DIVSDrr_Int: - case X86::DIVSSrm: - case X86::DIVSSrm_Int: - case X86::DIVSSrr: - case X86::DIVSSrr_Int: - case X86::SQRTPDm: - case X86::SQRTPDm_Int: - case X86::SQRTPDr: - case X86::SQRTPDr_Int: - case X86::SQRTPSm: - case X86::SQRTPSm_Int: - case X86::SQRTPSr: - case X86::SQRTPSr_Int: - case X86::SQRTSDm: - case X86::SQRTSDm_Int: - case X86::SQRTSDr: - case X86::SQRTSDr_Int: - case X86::SQRTSSm: - case X86::SQRTSSm_Int: - case X86::SQRTSSr: - case X86::SQRTSSr_Int: - return true; - } -} - namespace { /// CGBR - Create Global Base Reg pass. This initializes the PIC /// global base register for x86-32. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Tue Oct 19 12:14:24 2010 @@ -864,11 +864,6 @@ unsigned OpNum, const SmallVectorImpl &MOs, unsigned Size, unsigned Alignment) const; - - bool hasHighOperandLatency(const InstrItineraryData *ItinData, - const MachineRegisterInfo *MRI, - const MachineInstr *DefMI, unsigned DefIdx, - const MachineInstr *UseMI, unsigned UseIdx) const; private: MachineInstr * convertToThreeAddressWithLEA(unsigned MIOpc, Added: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=116816&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/remat.ll (added) +++ llvm/trunk/test/CodeGen/ARM/remat.ll Tue Oct 19 12:14:24 2010 @@ -0,0 +1,65 @@ +; RUN: llc < %s -march=arm -mattr=+v6,+vfp2 -o /dev/null -stats -info-output-file - | grep "Number of re-materialization" + +define i32 @main(i32 %argc, i8** nocapture %argv, double %d1, double %d2) nounwind { +entry: + br i1 undef, label %smvp.exit, label %bb.i3 + +bb.i3: ; preds = %bb.i3, %bb134 + br i1 undef, label %smvp.exit, label %bb.i3 + +smvp.exit: ; preds = %bb.i3 + %0 = fmul double %d1, 2.400000e-03 ; [#uses=2] + br i1 undef, label %bb138.preheader, label %bb159 + +bb138.preheader: ; preds = %smvp.exit + br label %bb138 + +bb138: ; preds = %bb138, %bb138.preheader + br i1 undef, label %bb138, label %bb145.loopexit + +bb142: ; preds = %bb.nph218.bb.nph218.split_crit_edge, %phi0.exit + %1 = fmul double %d1, -1.200000e-03 ; [#uses=1] + %2 = fadd double %d2, %1 ; [#uses=1] + %3 = fmul double %2, %d2 ; [#uses=1] + %4 = fsub double 0.000000e+00, %3 ; [#uses=1] + br i1 %14, label %phi1.exit, label %bb.i35 + +bb.i35: ; preds = %bb142 + %5 = call double @sin(double %15) nounwind readonly ; [#uses=1] + %6 = fmul double %5, 0x4031740AFA84AD8A ; [#uses=1] + %7 = fsub double 1.000000e+00, undef ; [#uses=1] + %8 = fdiv double %7, 6.000000e-01 ; [#uses=1] + br label %phi1.exit + +phi1.exit: ; preds = %bb.i35, %bb142 + %.pn = phi double [ %6, %bb.i35 ], [ 0.000000e+00, %bb142 ] ; [#uses=1] + %9 = phi double [ %8, %bb.i35 ], [ 0.000000e+00, %bb142 ] ; [#uses=1] + %10 = fmul double %.pn, %9 ; [#uses=1] + br i1 %14, label %phi0.exit, label %bb.i + +bb.i: ; preds = %phi1.exit + unreachable + +phi0.exit: ; preds = %phi1.exit + %11 = fsub double %4, %10 ; [#uses=1] + %12 = fadd double 0.000000e+00, %11 ; [#uses=1] + store double %12, double* undef, align 4 + br label %bb142 + +bb145.loopexit: ; preds = %bb138 + br i1 undef, label %bb.nph218.bb.nph218.split_crit_edge, label %bb159 + +bb.nph218.bb.nph218.split_crit_edge: ; preds = %bb145.loopexit + %13 = fmul double %0, 0x401921FB54442D18 ; [#uses=1] + %14 = fcmp ugt double %0, 6.000000e-01 ; [#uses=2] + %15 = fdiv double %13, 6.000000e-01 ; [#uses=1] + br label %bb142 + +bb159: ; preds = %bb145.loopexit, %smvp.exit, %bb134 + unreachable + +bb166: ; preds = %bb127 + unreachable +} + +declare double @sin(double) nounwind readonly Modified: llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll Tue Oct 19 12:14:24 2010 @@ -2,16 +2,17 @@ ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim -arm-vdup-splat | FileCheck %s ; Modified version of machine-licm.ll with -arm-vdup-splat turned on, 8003375. ; Eventually this should become the default and be moved into machine-licm.ll. +; FIXME: the vdup should be hoisted out of the loop, 8248029. define void @t2(i8* %ptr1, i8* %ptr2) nounwind { entry: ; CHECK: t2: ; CHECK: mov.w r3, #1065353216 -; CHECK: vdup.32 q{{.*}}, r3 br i1 undef, label %bb1, label %bb2 bb1: ; CHECK-NEXT: %bb1 +; CHECK: vdup.32 q{{.*}}, r3 %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ] %tmp1 = shl i32 %indvar, 2 %gep1 = getelementptr i8* %ptr1, i32 %tmp1 Modified: llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll Tue Oct 19 12:14:24 2010 @@ -1,9 +1,6 @@ -; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -stats |& FileCheck %s -; Now this test spills one register. But a reload in the loop is cheaper than -; the divsd so it's a win. +; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& not grep {Number of register spills} define fastcc void @fourn(double* %data, i32 %isign) nounwind { -; CHECK: fourn entry: br label %bb @@ -14,11 +11,6 @@ %1 = icmp sgt i32 %0, 2 ; [#uses=1] br i1 %1, label %bb30.loopexit, label %bb -; CHECK: %bb30.loopexit -; CHECK: divsd %xmm0 -; CHECK: movsd %xmm0, 16(%esp) -; CHECK: .align -; CHECK-NEXT: %bb3 bb3: ; preds = %bb30.loopexit, %bb25, %bb3 %2 = load i32* null, align 4 ; [#uses=1] %3 = mul i32 %2, 0 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll?rev=116816&r1=116815&r2=116816&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Tue Oct 19 12:14:24 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -stats |& grep {7 machine-licm} +; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -stats |& grep {6 machine-licm} ; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 | FileCheck %s ; rdar://6627786 ; rdar://7792037 From aggarwa4 at illinois.edu Tue Oct 19 12:17:44 2010 From: aggarwa4 at illinois.edu (Arushi Aggarwal) Date: Tue, 19 Oct 2010 17:17:44 -0000 Subject: [llvm-commits] [poolalloc] r116818 - /poolalloc/trunk/lib/DSA/DSTest.cpp Message-ID: <20101019171744.B33162A6C12C@llvm.org> Author: aggarwa4 Date: Tue Oct 19 12:17:44 2010 New Revision: 116818 URL: http://llvm.org/viewvc/llvm-project?rev=116818&view=rev Log: Allow for checking of call graph. 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=116818&r1=116817&r2=116818&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSTest.cpp (original) +++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Oct 19 12:17:44 2010 @@ -36,6 +36,7 @@ #include "dsa/DataStructure.h" #include "dsa/DSGraph.h" #include "dsa/DSNode.h" +#include "dsa/DSCallGraph.h" #include "llvm/Module.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/CommandLine.h" @@ -62,6 +63,9 @@ // For each value, verify that type is as given cl::list CheckType("check-type", cl::CommaSeparated, cl::ReallyHidden); + // For first function, verify that it calls the other functions + cl::list CheckCallees("check-callees", + cl::CommaSeparated, cl::ReallyHidden); } /// NodeValue -- represents a particular node in a DSGraph @@ -197,7 +201,7 @@ assert(V && "Parsing value failed!"); } - + /// stripAtIfRequired -- removes the leading '@' character if one exists /// StringRef stripAtIfRequired(StringRef v) { @@ -534,9 +538,40 @@ } return true; } - return false; +} +/// checkCallees -- Verify callees for the given functions +/// Returns true iff the user specified anything for this option +/// +/// checks that the first function calls the rest of the +/// functions in the list +static bool checkCallees(llvm::raw_ostream &O, const Module *M, const DataStructures *DS) { + + cl::list::iterator I = CheckCallees.begin(), + E = CheckCallees.end(); + // If the user specified that a set of values should be in the same node... + if (I != E) { + std::string &func = *(I); + Function *caller = M->getFunction(func); + assert(caller && "Function not found in module"); + const DSCallGraph callgraph = DS->getCallGraph(); + ++I; + while(I != E ){ + std::string &func = *(I); + Function *callee = M->getFunction(func); + bool found = false; + for(DSCallGraph::flat_iterator CI = callgraph.flat_callee_begin(caller); CI != callgraph.flat_callee_end(caller); CI ++) { + if ( callee == *CI) + found = true; + //(*CI)->dump(); + } + assert(found && "callee not in call graph"); + ++I; + } + return true; + } + return false; } /// handleTest -- handles any user-specified testing options. @@ -551,6 +586,7 @@ tested |= checkIfNodesAreNotSame(O,M,this); tested |= verifyFlags(O,M,this); tested |= checkTypes(O,M,this); + tested |= checkCallees(O,M,this); return tested; } From stoklund at 2pi.dk Tue Oct 19 12:20:50 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 19 Oct 2010 10:20:50 -0700 Subject: [llvm-commits] [PATCH] Shrink MachineOperand from 40 to 32 bytes Message-ID: <02FBA740-0F28-4F5E-B8DF-7224FA2E19DF@2pi.dk> Hi, The attached patch shrinks MachineOperand from 40 to 32 bytes on 64-bit hosts. The Contents union contains pointers, so it becomes 8-byte aligned. That creates padding because the largest member has two pointers and an unsigned. The patch moves the unsigned outside the union in a way that makes it pack optimally on both 32-bit and 64-bit hosts. It is a bit icky, so I wanted your opinions before committing. I measured a (statistically significant) 0.8% speedup of code generation on 64-bit Darwin with the patch applied. -------------- next part -------------- A non-text attachment was scrubbed... Name: MachineOperand.patch Type: application/octet-stream Size: 3810 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101019/977d276f/attachment.obj From resistor at mac.com Tue Oct 19 12:21:59 2010 From: resistor at mac.com (Owen Anderson) Date: Tue, 19 Oct 2010 17:21:59 -0000 Subject: [llvm-commits] [llvm] r116820 - in /llvm/trunk: include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/Analysis/IPA/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/CBackend/ lib/Transforms/IPO/ lib/Transforms/InstCombine/ lib/Transforms/Instrumentation/ lib/Transforms/Scalar/ lib/Transforms/Utils/ lib/VMCore/ tools/bugpoint/ tools/llvm-ld/ tools/opt/ unittests/VMCore/ Message-ID: <20101019172200.84AC92A6C12C@llvm.org> Author: resistor Date: Tue Oct 19 12:21:58 2010 New Revision: 116820 URL: http://llvm.org/viewvc/llvm-project?rev=116820&view=rev Log: Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. Modified: llvm/trunk/include/llvm/Analysis/Dominators.h llvm/trunk/include/llvm/Analysis/FindUsedTypes.h llvm/trunk/include/llvm/Analysis/IntervalPartition.h llvm/trunk/include/llvm/Analysis/LazyValueInfo.h llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/include/llvm/Analysis/PostDominators.h llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h llvm/trunk/include/llvm/CodeGen/SlotIndexes.h llvm/trunk/include/llvm/InitializePasses.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasDebugger.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/lib/Analysis/DomPrinter.cpp llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Analysis/IVUsers.cpp llvm/trunk/lib/Analysis/InstCount.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Analysis/LiveValues.cpp llvm/trunk/lib/Analysis/MemDepPrinter.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp llvm/trunk/lib/Analysis/ProfileInfo.cpp llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp llvm/trunk/lib/Analysis/RegionInfo.cpp llvm/trunk/lib/Analysis/RegionPrinter.cpp llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp llvm/trunk/lib/CodeGen/CodeGen.cpp llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp llvm/trunk/lib/CodeGen/GCMetadata.cpp llvm/trunk/lib/CodeGen/GCStrategy.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/MachineCSE.cpp llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/MachineSink.cpp llvm/trunk/lib/CodeGen/MachineVerifier.cpp llvm/trunk/lib/CodeGen/OptimizePHIs.cpp llvm/trunk/lib/CodeGen/PHIElimination.h llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.h llvm/trunk/lib/CodeGen/RegAllocFast.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp llvm/trunk/lib/CodeGen/RenderMachineFunction.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/lib/CodeGen/Splitter.h llvm/trunk/lib/CodeGen/StackProtector.cpp llvm/trunk/lib/CodeGen/StackSlotColoring.cpp llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp llvm/trunk/lib/Transforms/IPO/Internalize.cpp llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/InstCombine/InstCombine.h llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp llvm/trunk/lib/Transforms/Scalar/DCE.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/Sink.cpp llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp llvm/trunk/tools/llvm-ld/llvm-ld.cpp llvm/trunk/tools/opt/opt.cpp llvm/trunk/unittests/VMCore/PassManagerTest.cpp Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Tue Oct 19 12:21:58 2010 @@ -717,6 +717,7 @@ DominatorTreeBase* DT; DominatorTree() : FunctionPass(ID) { + initializeDominatorTreePass(*PassRegistry::getPassRegistry()); DT = new DominatorTreeBase(false); } @@ -1028,7 +1029,9 @@ public: static char ID; // Pass ID, replacement for typeid DominanceFrontier() : - DominanceFrontierBase(ID, false) {} + DominanceFrontierBase(ID, false) { + initializeDominanceFrontierPass(*PassRegistry::getPassRegistry()); + } BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); Modified: llvm/trunk/include/llvm/Analysis/FindUsedTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/FindUsedTypes.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/FindUsedTypes.h (original) +++ llvm/trunk/include/llvm/Analysis/FindUsedTypes.h Tue Oct 19 12:21:58 2010 @@ -26,7 +26,9 @@ std::set UsedTypes; public: static char ID; // Pass identification, replacement for typeid - FindUsedTypes() : ModulePass(ID) {} + FindUsedTypes() : ModulePass(ID) { + initializeFindUsedTypesPass(*PassRegistry::getPassRegistry()); + } /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. Modified: llvm/trunk/include/llvm/Analysis/IntervalPartition.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalPartition.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/IntervalPartition.h (original) +++ llvm/trunk/include/llvm/Analysis/IntervalPartition.h Tue Oct 19 12:21:58 2010 @@ -48,7 +48,9 @@ public: static char ID; // Pass identification, replacement for typeid - IntervalPartition() : FunctionPass(ID), RootInterval(0) {} + IntervalPartition() : FunctionPass(ID), RootInterval(0) { + initializeIntervalPartitionPass(*PassRegistry::getPassRegistry()); + } // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h Tue Oct 19 12:21:58 2010 @@ -31,7 +31,9 @@ void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT. public: static char ID; - LazyValueInfo() : FunctionPass(ID), PImpl(0) {} + LazyValueInfo() : FunctionPass(ID), PImpl(0) { + initializeLazyValueInfoPass(*PassRegistry::getPassRegistry()); + } ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); } /// Tristate - This is used to return true/false/dunno results. Modified: llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h Tue Oct 19 12:21:58 2010 @@ -28,10 +28,12 @@ LibCallInfo *LCI; explicit LibCallAliasAnalysis(LibCallInfo *LC = 0) - : FunctionPass(ID), LCI(LC) { + : FunctionPass(ID), LCI(LC) { + initializeLibCallAliasAnalysisPass(*PassRegistry::getPassRegistry()); } explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC) - : FunctionPass(ID), LCI(LC) { + : FunctionPass(ID), LCI(LC) { + initializeLibCallAliasAnalysisPass(*PassRegistry::getPassRegistry()); } ~LibCallAliasAnalysis(); Modified: llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h Tue Oct 19 12:21:58 2010 @@ -91,7 +91,9 @@ public: static char ID; // Class identification, replacement for typeinfo - LoopDependenceAnalysis() : LoopPass(ID) {} + LoopDependenceAnalysis() : LoopPass(ID) { + initializeLoopDependenceAnalysisPass(*PassRegistry::getPassRegistry()); + } /// isDependencePair - Check whether two values can possibly give rise to /// a data dependence: that is the case if both are instructions accessing Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Oct 19 12:21:58 2010 @@ -939,7 +939,9 @@ public: static char ID; // Pass identification, replacement for typeid - LoopInfo() : FunctionPass(ID) {} + LoopInfo() : FunctionPass(ID) { + initializeLoopInfoPass(*PassRegistry::getPassRegistry()); + } LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/PostDominators.h (original) +++ llvm/trunk/include/llvm/Analysis/PostDominators.h Tue Oct 19 12:21:58 2010 @@ -26,6 +26,7 @@ DominatorTreeBase* DT; PostDominatorTree() : FunctionPass(ID) { + initializePostDominatorTreePass(*PassRegistry::getPassRegistry()); DT = new DominatorTreeBase(true); } @@ -106,7 +107,9 @@ struct PostDominanceFrontier : public DominanceFrontierBase { static char ID; PostDominanceFrontier() - : DominanceFrontierBase(ID, true) {} + : DominanceFrontierBase(ID, true) { + initializePostDominanceFrontierPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &) { Frontiers.clear(); Modified: llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h (original) +++ llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h Tue Oct 19 12:21:58 2010 @@ -48,7 +48,9 @@ public: static char ID; - CalculateSpillWeights() : MachineFunctionPass(ID) {} + CalculateSpillWeights() : MachineFunctionPass(ID) { + initializeCalculateSpillWeightsPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Oct 19 12:21:58 2010 @@ -68,7 +68,9 @@ public: static char ID; // Pass identification, replacement for typeid - LiveIntervals() : MachineFunctionPass(ID) {} + LiveIntervals() : MachineFunctionPass(ID) { + initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); + } // Calculate the spill weight to assign to a single instruction. static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth); Modified: llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h Tue Oct 19 12:21:58 2010 @@ -39,7 +39,9 @@ public: static char ID; // Pass identification, replacement for typeid - LiveStacks() : MachineFunctionPass(ID) {} + LiveStacks() : MachineFunctionPass(ID) { + initializeLiveStacksPass(*PassRegistry::getPassRegistry()); + } typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::const_iterator const_iterator; Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Tue Oct 19 12:21:58 2010 @@ -46,7 +46,9 @@ class LiveVariables : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid - LiveVariables() : MachineFunctionPass(ID) {} + LiveVariables() : MachineFunctionPass(ID) { + initializeLiveVariablesPass(*PassRegistry::getPassRegistry()); + } /// VarInfo - This represents the regions where a virtual register is live in /// the program. We represent this with three different pieces of Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Tue Oct 19 12:21:58 2010 @@ -67,7 +67,9 @@ public: static char ID; // Pass identification, replacement for typeid - MachineLoopInfo() : MachineFunctionPass(ID) {} + MachineLoopInfo() : MachineFunctionPass(ID) { + initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry()); + } LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h (original) +++ llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h Tue Oct 19 12:21:58 2010 @@ -31,7 +31,9 @@ public: static char ID; - ProcessImplicitDefs() : MachineFunctionPass(ID) {} + ProcessImplicitDefs() : MachineFunctionPass(ID) { + initializeProcessImplicitDefsPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Tue Oct 19 12:21:58 2010 @@ -469,7 +469,9 @@ public: static char ID; - SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) {} + SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) { + initializeSlotIndexesPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void releaseMemory(); Modified: llvm/trunk/include/llvm/InitializePasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/InitializePasses.h (original) +++ llvm/trunk/include/llvm/InitializePasses.h Tue Oct 19 12:21:58 2010 @@ -132,6 +132,7 @@ void initializeLoopUnrollPass(PassRegistry&); void initializeLoopUnswitchPass(PassRegistry&); void initializeLowerAtomicPass(PassRegistry&); +void initializeLowerIntrinsicsPass(PassRegistry&); void initializeLowerInvokePass(PassRegistry&); void initializeLowerSetJmpPass(PassRegistry&); void initializeLowerSwitchPass(PassRegistry&); Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Tue Oct 19 12:21:58 2010 @@ -151,8 +151,7 @@ sys::MemoryFence(); \ } \ } \ - } \ - static RegisterPass passName ## _info(arg, name, cfg, analysis); + } #define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis) \ static void* initialize##passName##PassOnce(PassRegistry &Registry) { @@ -183,8 +182,7 @@ sys::MemoryFence(); \ } \ } \ - } \ - static RegisterPass passName ## _info(arg, name, cfg, analysis); + } template Pass *callDefaultCtor() { return new PassName(); } @@ -282,12 +280,12 @@ sys::MemoryFence(); \ } \ } \ - } \ - static RegisterAnalysisGroup agName##_info (name); + } #define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \ static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ + if (!def) initialize##agName##AnalysisGroup(Registry); \ PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \ PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \ Registry.registerPass(*PI); \ @@ -311,13 +309,12 @@ sys::MemoryFence(); \ } \ } \ - } \ - static RegisterPass passName ## _info(arg, name, cfg, analysis); \ - static RegisterAnalysisGroup passName ## _ag(passName ## _info); + } #define INITIALIZE_AG_PASS_BEGIN(passName, agName, arg, n, cfg, analysis, def) \ - static void* initialize##passName##PassOnce(PassRegistry &Registry) { + static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ + if (!def) initialize##agName##AnalysisGroup(Registry); #define INITIALIZE_AG_PASS_END(passName, agName, arg, n, cfg, analysis, def) \ PassInfo *PI = new PassInfo(n, arg, & passName ::ID, \ @@ -343,9 +340,7 @@ sys::MemoryFence(); \ } \ } \ - } \ - static RegisterPass passName ## _info(arg, n, cfg, analysis); \ - static RegisterAnalysisGroup passName ## _ag(passName ## _info); + } //===--------------------------------------------------------------------------- /// PassRegistrationListener class - This class is meant to be derived from by Modified: llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Tue Oct 19 12:21:58 2010 @@ -27,7 +27,9 @@ public: static char ID; // Pass identification, replacement for typeid UnifyFunctionExitNodes() : FunctionPass(ID), - ReturnBlock(0), UnwindBlock(0) {} + ReturnBlock(0), UnwindBlock(0) { + initializeUnifyFunctionExitNodesPass(*PassRegistry::getPassRegistry()); + } // We can preserve non-critical-edgeness when we unify function exit nodes virtual void getAnalysisUsage(AnalysisUsage &AU) const; Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Oct 19 12:21:58 2010 @@ -36,7 +36,7 @@ using namespace llvm; // Register the AliasAnalysis interface, providing a nice name to refer to. -INITIALIZE_ANALYSIS_GROUP(AliasAnalysis, "Alias Analysis", BasicAliasAnalysis) +INITIALIZE_ANALYSIS_GROUP(AliasAnalysis, "Alias Analysis", NoAA) char AliasAnalysis::ID = 0; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Tue Oct 19 12:21:58 2010 @@ -35,6 +35,7 @@ public: static char ID; // Class identification, replacement for typeinfo AliasAnalysisCounter() : ModulePass(ID) { + initializeAliasAnalysisCounterPass(*PassRegistry::getPassRegistry()); No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Oct 19 12:21:58 2010 @@ -50,7 +50,9 @@ public: static char ID; // Pass identification, replacement for typeid - AAEval() : FunctionPass(ID) {} + AAEval() : FunctionPass(ID) { + initializeAAEvalPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original) +++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Tue Oct 19 12:21:58 2010 @@ -39,7 +39,9 @@ public: static char ID; // Class identification, replacement for typeinfo - AliasDebugger() : ModulePass(ID) {} + AliasDebugger() : ModulePass(ID) { + initializeAliasDebuggerPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Tue Oct 19 12:21:58 2010 @@ -614,7 +614,9 @@ AliasSetTracker *Tracker; public: static char ID; // Pass identification, replacement for typeid - AliasSetPrinter() : FunctionPass(ID) {} + AliasSetPrinter() : FunctionPass(ID) { + initializeAliasSetPrinterPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Oct 19 12:21:58 2010 @@ -140,8 +140,10 @@ /// struct NoAA : public ImmutablePass, public AliasAnalysis { static char ID; // Class identification, replacement for typeinfo - NoAA() : ImmutablePass(ID) {} - explicit NoAA(char &PID) : ImmutablePass(PID) { } + NoAA() : ImmutablePass(ID) { + initializeNoAAPass(*PassRegistry::getPassRegistry()); + } + explicit NoAA(char &PID) : ImmutablePass(PID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { } @@ -490,7 +492,9 @@ /// derives from the NoAA class. struct BasicAliasAnalysis : public NoAA { static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA(ID) {} + BasicAliasAnalysis() : NoAA(ID) { + initializeBasicAliasAnalysisPass(*PassRegistry::getPassRegistry()); + } virtual void initializePass() { InitializeAliasAnalysis(this); Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Tue Oct 19 12:21:58 2010 @@ -25,7 +25,9 @@ namespace { struct CFGViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGViewer() : FunctionPass(ID) {} + CFGViewer() : FunctionPass(ID) { + initializeCFGOnlyViewerPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F) { F.viewCFG(); @@ -46,7 +48,9 @@ namespace { struct CFGOnlyViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGOnlyViewer() : FunctionPass(ID) {} + CFGOnlyViewer() : FunctionPass(ID) { + initializeCFGOnlyViewerPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F) { F.viewCFGOnly(); @@ -68,7 +72,9 @@ namespace { struct CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGPrinter() : FunctionPass(ID) {} + CFGPrinter() : FunctionPass(ID) { + initializeCFGPrinterPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; @@ -100,7 +106,10 @@ namespace { struct CFGOnlyPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGOnlyPrinter() : FunctionPass(ID) {} + CFGOnlyPrinter() : FunctionPass(ID) { + initializeCFGOnlyPrinterPass(*PassRegistry::getPassRegistry()); + } + virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; errs() << "Writing '" << Filename << "'..."; Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Tue Oct 19 12:21:58 2010 @@ -40,7 +40,9 @@ void printVariableDeclaration(const Value *V); public: static char ID; // Pass identification - PrintDbgInfo() : FunctionPass(ID), Out(errs()) {} + PrintDbgInfo() : FunctionPass(ID), Out(errs()) { + initializePrintDbgInfoPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/DomPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DomPrinter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DomPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DomPrinter.cpp Tue Oct 19 12:21:58 2010 @@ -86,27 +86,35 @@ struct DomViewer : public DOTGraphTraitsViewer { static char ID; - DomViewer() : DOTGraphTraitsViewer("dom", ID){} + DomViewer() : DOTGraphTraitsViewer("dom", ID){ + initializeDomViewerPass(*PassRegistry::getPassRegistry()); + } }; struct DomOnlyViewer : public DOTGraphTraitsViewer { static char ID; - DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){} + DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){ + initializeDomOnlyViewerPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomViewer : public DOTGraphTraitsViewer { static char ID; PostDomViewer() : - DOTGraphTraitsViewer("postdom", ID){} + DOTGraphTraitsViewer("postdom", ID){ + initializePostDomViewerPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomOnlyViewer : public DOTGraphTraitsViewer { static char ID; PostDomOnlyViewer() : - DOTGraphTraitsViewer("postdomonly", ID){} + DOTGraphTraitsViewer("postdomonly", ID){ + initializePostDomOnlyViewerPass(*PassRegistry::getPassRegistry()); + } }; } // end anonymous namespace @@ -133,27 +141,35 @@ struct DomPrinter : public DOTGraphTraitsPrinter { static char ID; - DomPrinter() : DOTGraphTraitsPrinter("dom", ID) {} + DomPrinter() : DOTGraphTraitsPrinter("dom", ID) { + initializeDomPrinterPass(*PassRegistry::getPassRegistry()); + } }; struct DomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; - DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) {} + DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) { + initializeDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomPrinter() : - DOTGraphTraitsPrinter("postdom", ID) {} + DOTGraphTraitsPrinter("postdom", ID) { + initializePostDomPrinterPass(*PassRegistry::getPassRegistry()); + } }; struct PostDomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomOnlyPrinter() : - DOTGraphTraitsPrinter("postdomonly", ID) {} + DOTGraphTraitsPrinter("postdomonly", ID) { + initializePostDomOnlyPrinterPass(*PassRegistry::getPassRegistry()); + } }; } // end anonymous namespace Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Tue Oct 19 12:21:58 2010 @@ -43,7 +43,9 @@ public: static char ID; // Class identification, replacement for typeinfo BasicCallGraph() : ModulePass(ID), Root(0), - ExternalCallingNode(0), CallsExternalNode(0) {} + ExternalCallingNode(0), CallsExternalNode(0) { + initializeBasicCallGraphPass(*PassRegistry::getPassRegistry()); + } // runOnModule - Compute the call graph for the specified module. virtual bool runOnModule(Module &M) { Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Tue Oct 19 12:21:58 2010 @@ -88,7 +88,9 @@ public: static char ID; - GlobalsModRef() : ModulePass(ID) {} + GlobalsModRef() : ModulePass(ID) { + initializeGlobalsModRefPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class Modified: llvm/trunk/lib/Analysis/IVUsers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IVUsers.cpp (original) +++ llvm/trunk/lib/Analysis/IVUsers.cpp Tue Oct 19 12:21:58 2010 @@ -149,7 +149,8 @@ } IVUsers::IVUsers() - : LoopPass(ID) { + : LoopPass(ID) { + initializeIVUsersPass(*PassRegistry::getPassRegistry()); } void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/InstCount.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/InstCount.cpp (original) +++ llvm/trunk/lib/Analysis/InstCount.cpp Tue Oct 19 12:21:58 2010 @@ -51,7 +51,9 @@ } public: static char ID; // Pass identification, replacement for typeid - InstCount() : FunctionPass(ID) {} + InstCount() : FunctionPass(ID) { + initializeInstCountPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Oct 19 12:21:58 2010 @@ -108,7 +108,9 @@ raw_string_ostream MessagesStr; static char ID; // Pass identification, replacement for typeid - Lint() : FunctionPass(ID), MessagesStr(Messages) {} + Lint() : FunctionPass(ID), MessagesStr(Messages) { + initializeLintPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/LiveValues.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LiveValues.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LiveValues.cpp (original) +++ llvm/trunk/lib/Analysis/LiveValues.cpp Tue Oct 19 12:21:58 2010 @@ -29,7 +29,9 @@ INITIALIZE_PASS_END(LiveValues, "live-values", "Value Liveness Analysis", false, true) -LiveValues::LiveValues() : FunctionPass(ID) {} +LiveValues::LiveValues() : FunctionPass(ID) { + initializeLiveValuesPass(*PassRegistry::getPassRegistry()); +} void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/MemDepPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemDepPrinter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemDepPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/MemDepPrinter.cpp Tue Oct 19 12:21:58 2010 @@ -31,7 +31,9 @@ DepSetMap Deps; static char ID; // Pass identifcation, replacement for typeid - MemDepPrinter() : FunctionPass(ID) {} + MemDepPrinter() : FunctionPass(ID) { + initializeMemDepPrinterPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Oct 19 12:21:58 2010 @@ -55,6 +55,7 @@ MemoryDependenceAnalysis::MemoryDependenceAnalysis() : FunctionPass(ID), PredCache(0) { + initializeMemoryDependenceAnalysisPass(*PassRegistry::getPassRegistry()); } MemoryDependenceAnalysis::~MemoryDependenceAnalysis() { } Modified: llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp Tue Oct 19 12:21:58 2010 @@ -30,7 +30,9 @@ DebugInfoFinder Finder; public: static char ID; // Pass identification, replacement for typeid - ModuleDebugInfoPrinter() : ModulePass(ID) {} + ModuleDebugInfoPrinter() : ModulePass(ID) { + initializeModuleDebugInfoPrinterPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp Tue Oct 19 12:21:58 2010 @@ -39,7 +39,8 @@ public: static char ID; // Class identification, replacement for typeinfo explicit ProfileEstimatorPass(const double execcount = 0) - : FunctionPass(ID), ExecCount(execcount) { + : FunctionPass(ID), ExecCount(execcount) { + initializeProfileEstimatorPassPass(*PassRegistry::getPassRegistry()); if (execcount == 0) ExecCount = LoopWeight; } Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Tue Oct 19 12:21:58 2010 @@ -1077,7 +1077,9 @@ namespace { struct NoProfileInfo : public ImmutablePass, public ProfileInfo { static char ID; // Class identification, replacement for typeinfo - NoProfileInfo() : ImmutablePass(ID) {} + NoProfileInfo() : ImmutablePass(ID) { + initializeNoProfileInfoPass(*PassRegistry::getPassRegistry()); + } /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Tue Oct 19 12:21:58 2010 @@ -46,6 +46,7 @@ static char ID; // Class identification, replacement for typeinfo explicit LoaderPass(const std::string &filename = "") : ModulePass(ID), Filename(filename) { + initializeLoaderPassPass(*PassRegistry::getPassRegistry()); if (filename.empty()) Filename = ProfileInfoFilename; } Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Tue Oct 19 12:21:58 2010 @@ -60,10 +60,12 @@ static char ID; // Class identification, replacement for typeinfo explicit ProfileVerifierPassT () : FunctionPass(ID) { + initializeProfileVerifierPassPass(*PassRegistry::getPassRegistry()); DisableAssertions = ProfileVerifierDisableAssertions; } explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), DisableAssertions(da) { + initializeProfileVerifierPassPass(*PassRegistry::getPassRegistry()); } void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original) +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Tue Oct 19 12:21:58 2010 @@ -662,6 +662,7 @@ } RegionInfo::RegionInfo() : FunctionPass(ID) { + initializeRegionInfoPass(*PassRegistry::getPassRegistry()); TopLevelRegion = 0; } Modified: llvm/trunk/lib/Analysis/RegionPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPrinter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/RegionPrinter.cpp Tue Oct 19 12:21:58 2010 @@ -121,14 +121,18 @@ struct RegionViewer : public DOTGraphTraitsViewer { static char ID; - RegionViewer() : DOTGraphTraitsViewer("reg", ID){} + RegionViewer() : DOTGraphTraitsViewer("reg", ID){ + initializeRegionViewerPass(*PassRegistry::getPassRegistry()); + } }; char RegionViewer::ID = 0; struct RegionOnlyViewer : public DOTGraphTraitsViewer { static char ID; - RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", ID){} + RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", ID) { + initializeRegionOnlyViewerPass(*PassRegistry::getPassRegistry()); + } }; char RegionOnlyViewer::ID = 0; @@ -136,7 +140,9 @@ : public DOTGraphTraitsPrinter { static char ID; RegionPrinter() : - DOTGraphTraitsPrinter("reg", ID) {} + DOTGraphTraitsPrinter("reg", ID) { + initializeRegionPrinterPass(*PassRegistry::getPassRegistry()); + } }; char RegionPrinter::ID = 0; } //end anonymous namespace @@ -157,7 +163,9 @@ : public DOTGraphTraitsPrinter { static char ID; RegionOnlyPrinter() : - DOTGraphTraitsPrinter("reg", ID) {} + DOTGraphTraitsPrinter("reg", ID) { + initializeRegionOnlyPrinterPass(*PassRegistry::getPassRegistry()); + } }; } Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Oct 19 12:21:58 2010 @@ -5835,6 +5835,7 @@ ScalarEvolution::ScalarEvolution() : FunctionPass(ID), FirstUnknown(0) { + initializeScalarEvolutionPass(*PassRegistry::getPassRegistry()); } bool ScalarEvolution::runOnFunction(Function &F) { Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Tue Oct 19 12:21:58 2010 @@ -34,7 +34,10 @@ public: static char ID; // Class identification, replacement for typeinfo - ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) {} + ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) { + initializeScalarEvolutionAliasAnalysisPass( + *PassRegistry::getPassRegistry()); + } /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Tue Oct 19 12:21:58 2010 @@ -85,7 +85,9 @@ public AliasAnalysis { public: static char ID; // Class identification, replacement for typeinfo - TypeBasedAliasAnalysis() : ImmutablePass(ID) {} + TypeBasedAliasAnalysis() : ImmutablePass(ID) { + initializeTypeBasedAliasAnalysisPass(*PassRegistry::getPassRegistry()); + } virtual void initializePass() { InitializeAliasAnalysis(this); Modified: llvm/trunk/lib/CodeGen/CodeGen.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CodeGen.cpp (original) +++ llvm/trunk/lib/CodeGen/CodeGen.cpp Tue Oct 19 12:21:58 2010 @@ -52,6 +52,7 @@ initializeUnreachableBlockElimPass(Registry); initializeUnreachableMachineBlockElimPass(Registry); initializeVirtRegMapPass(Registry); + initializeLowerIntrinsicsPass(Registry); } void LLVMInitializeCodeGen(LLVMPassRegistryRef R) { Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original) +++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ public: static char ID; // Pass identification, replacement for typeid - DeadMachineInstructionElim() : MachineFunctionPass(ID) {} + DeadMachineInstructionElim() : MachineFunctionPass(ID) { + initializeDeadMachineInstructionElimPass(*PassRegistry::getPassRegistry()); + } private: bool isDead(const MachineInstr *MI) const; Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Tue Oct 19 12:21:58 2010 @@ -100,7 +100,9 @@ DwarfEHPrepare(const TargetMachine *tm) : FunctionPass(ID), TM(tm), TLI(TM->getTargetLowering()), ExceptionValueIntrinsic(0), SelectorIntrinsic(0), - URoR(0), EHCatchAllValue(0), RewindFunction(0) {} + URoR(0), EHCatchAllValue(0), RewindFunction(0) { + initializeDominatorTreePass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &Fn); Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original) +++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Tue Oct 19 12:21:58 2010 @@ -69,7 +69,9 @@ char GCModuleInfo::ID = 0; GCModuleInfo::GCModuleInfo() - : ImmutablePass(ID) {} + : ImmutablePass(ID) { + initializeGCModuleInfoPass(*PassRegistry::getPassRegistry()); +} GCModuleInfo::~GCModuleInfo() { clear(); Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original) +++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Tue Oct 19 12:21:58 2010 @@ -123,6 +123,11 @@ // ----------------------------------------------------------------------------- +INITIALIZE_PASS_BEGIN(LowerIntrinsics, "gc-lowering", "GC Lowering", + false, false) +INITIALIZE_PASS_DEPENDENCY(GCModuleInfo) +INITIALIZE_PASS_END(LowerIntrinsics, "gc-lowering", "GC Lowering", false, false) + FunctionPass *llvm::createGCLoweringPass() { return new LowerIntrinsics(); } @@ -130,7 +135,9 @@ char LowerIntrinsics::ID = 0; LowerIntrinsics::LowerIntrinsics() - : FunctionPass(ID) {} + : FunctionPass(ID) { + initializeLowerIntrinsicsPass(*PassRegistry::getPassRegistry()); + } const char *LowerIntrinsics::getPassName() const { return "Lower Garbage Collection Instructions"; Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Tue Oct 19 12:21:58 2010 @@ -158,7 +158,9 @@ int FnNum; public: static char ID; - IfConverter() : MachineFunctionPass(ID), FnNum(-1) {} + IfConverter() : MachineFunctionPass(ID), FnNum(-1) { + initializeIfConverterPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Tue Oct 19 12:21:58 2010 @@ -41,7 +41,9 @@ MachineRegisterInfo *MRI; public: static char ID; // Pass identification - MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) {} + MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) { + initializeMachineCSEPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Tue Oct 19 12:21:58 2010 @@ -42,6 +42,7 @@ MachineDominatorTree::MachineDominatorTree() : MachineFunctionPass(ID) { + initializeMachineDominatorTreePass(*PassRegistry::getPassRegistry()); DT = new DominatorTreeBase(false); } Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Tue Oct 19 12:21:58 2010 @@ -101,10 +101,14 @@ public: static char ID; // Pass identification, replacement for typeid MachineLICM() : - MachineFunctionPass(ID), PreRegAlloc(true) {} + MachineFunctionPass(ID), PreRegAlloc(true) { + initializeMachineLICMPass(*PassRegistry::getPassRegistry()); + } explicit MachineLICM(bool PreRA) : - MachineFunctionPass(ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(ID), PreRegAlloc(PreRA) { + initializeMachineLICMPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Tue Oct 19 12:21:58 2010 @@ -258,6 +258,7 @@ ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false), CallsExternalFunctionWithFloatingPointArguments(false) { + initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry()); // Always emit some info, by default "no personality" info. Personalities.push_back(NULL); AddrLabelSymbols = 0; Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Tue Oct 19 12:21:58 2010 @@ -57,7 +57,9 @@ public: static char ID; // Pass identification - MachineSinking() : MachineFunctionPass(ID) {} + MachineSinking() : MachineFunctionPass(ID) { + initializeMachineSinkingPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Tue Oct 19 12:21:58 2010 @@ -195,7 +195,9 @@ static char ID; // Pass ID, replacement for typeid MachineVerifierPass() - : MachineFunctionPass(ID) {} + : MachineFunctionPass(ID) { + initializeMachineVerifierPassPass(*PassRegistry::getPassRegistry()); + } void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/CodeGen/OptimizePHIs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizePHIs.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizePHIs.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizePHIs.cpp Tue Oct 19 12:21:58 2010 @@ -33,7 +33,9 @@ public: static char ID; // Pass identification - OptimizePHIs() : MachineFunctionPass(ID) {} + OptimizePHIs() : MachineFunctionPass(ID) { + initializeOptimizePHIsPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/PHIElimination.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.h (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.h Tue Oct 19 12:21:58 2010 @@ -27,7 +27,9 @@ public: static char ID; // Pass identification, replacement for typeid - PHIElimination() : MachineFunctionPass(ID) {} + PHIElimination() : MachineFunctionPass(ID) { + initializePHIEliminationPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original) +++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Tue Oct 19 12:21:58 2010 @@ -62,7 +62,9 @@ public: static char ID; // Pass identification - PeepholeOptimizer() : MachineFunctionPass(ID) {} + PeepholeOptimizer() : MachineFunctionPass(ID) { + initializePeepholeOptimizerPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original) +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Tue Oct 19 12:21:58 2010 @@ -91,8 +91,9 @@ public: static char ID; - PreAllocSplitting() - : MachineFunctionPass(ID) {} + PreAllocSplitting() : MachineFunctionPass(ID) { + initializePreAllocSplittingPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.h (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.h Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ class PEI : public MachineFunctionPass { public: static char ID; - PEI() : MachineFunctionPass(ID) {} + PEI() : MachineFunctionPass(ID) { + initializePEIPass(*PassRegistry::getPassRegistry()); + } const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Tue Oct 19 12:21:58 2010 @@ -48,7 +48,10 @@ public: static char ID; RAFast() : MachineFunctionPass(ID), StackSlotForVirtReg(-1), - isBulkSpilling(false) {} + isBulkSpilling(false) { + initializePHIEliminationPass(*PassRegistry::getPassRegistry()); + initializeTwoAddressInstructionPassPass(*PassRegistry::getPassRegistry()); + } private: const TargetMachine *TM; MachineFunction *MF; Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Tue Oct 19 12:21:58 2010 @@ -91,6 +91,17 @@ struct RALinScan : public MachineFunctionPass { static char ID; RALinScan() : MachineFunctionPass(ID) { + initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); + initializeStrongPHIEliminationPass(*PassRegistry::getPassRegistry()); + initializeRegisterCoalescerAnalysisGroup( + *PassRegistry::getPassRegistry()); + initializeCalculateSpillWeightsPass(*PassRegistry::getPassRegistry()); + initializePreAllocSplittingPass(*PassRegistry::getPassRegistry()); + initializeLiveStacksPass(*PassRegistry::getPassRegistry()); + initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry()); + initializeVirtRegMapPass(*PassRegistry::getPassRegistry()); + initializeMachineDominatorTreePass(*PassRegistry::getPassRegistry()); + // Initialize the queue to record recently-used registers. if (NumRecentlyUsedRegs > 0) RecentRegs.resize(NumRecentlyUsedRegs, 0); Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Tue Oct 19 12:21:58 2010 @@ -84,7 +84,18 @@ static char ID; /// Construct a PBQP register allocator. - RegAllocPBQP(std::auto_ptr b) : MachineFunctionPass(ID), builder(b) {} + RegAllocPBQP(std::auto_ptr b) + : MachineFunctionPass(ID), builder(b) { + initializeSlotIndexesPass(*PassRegistry::getPassRegistry()); + initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); + initializeRegisterCoalescerAnalysisGroup(*PassRegistry::getPassRegistry()); + initializeCalculateSpillWeightsPass(*PassRegistry::getPassRegistry()); + initializeLiveStacksPass(*PassRegistry::getPassRegistry()); + initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry()); + initializeLoopSplitterPass(*PassRegistry::getPassRegistry()); + initializeVirtRegMapPass(*PassRegistry::getPassRegistry()); + initializeRenderMachineFunctionPass(*PassRegistry::getPassRegistry()); + } /// Return the pass name. virtual const char* getPassName() const { Modified: llvm/trunk/lib/CodeGen/RenderMachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RenderMachineFunction.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RenderMachineFunction.h (original) +++ llvm/trunk/lib/CodeGen/RenderMachineFunction.h Tue Oct 19 12:21:58 2010 @@ -202,7 +202,9 @@ public: static char ID; - RenderMachineFunction() : MachineFunctionPass(ID) {} + RenderMachineFunction() : MachineFunctionPass(ID) { + initializeRenderMachineFunctionPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Oct 19 12:21:58 2010 @@ -177,8 +177,10 @@ SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)), GFI(), OptLevel(OL), - DAGSize(0) -{} + DAGSize(0) { + initializeGCModuleInfoPass(*PassRegistry::getPassRegistry()); + initializeAliasAnalysisAnalysisGroup(*PassRegistry::getPassRegistry()); + } SelectionDAGISel::~SelectionDAGISel() { delete SDB; Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Tue Oct 19 12:21:58 2010 @@ -63,7 +63,9 @@ public: static char ID; // Pass identifcation, replacement for typeid - SimpleRegisterCoalescing() : MachineFunctionPass(ID) {} + SimpleRegisterCoalescing() : MachineFunctionPass(ID) { + initializeSimpleRegisterCoalescingPass(*PassRegistry::getPassRegistry()); + } struct InstrSlots { enum { Modified: llvm/trunk/lib/CodeGen/Splitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Splitter.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/Splitter.h (original) +++ llvm/trunk/lib/CodeGen/Splitter.h Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ public: static char ID; - LoopSplitter() : MachineFunctionPass(ID) {} + LoopSplitter() : MachineFunctionPass(ID) { + initializeLoopSplitterPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Oct 19 12:21:58 2010 @@ -62,9 +62,13 @@ bool RequiresStackProtector() const; public: static char ID; // Pass identification, replacement for typeid. - StackProtector() : FunctionPass(ID), TLI(0) {} + StackProtector() : FunctionPass(ID), TLI(0) { + initializeStackProtectorPass(*PassRegistry::getPassRegistry()); + } StackProtector(const TargetLowering *tli) - : FunctionPass(ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) { + initializeStackProtectorPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &Fn); }; Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original) +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Tue Oct 19 12:21:58 2010 @@ -95,9 +95,13 @@ public: static char ID; // Pass identification StackSlotColoring() : - MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) {} + MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) { + initializeStackSlotColoringPass(*PassRegistry::getPassRegistry()); + } StackSlotColoring(bool RegColor) : - MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) {} + MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) { + initializeStackSlotColoringPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Oct 19 12:21:58 2010 @@ -39,7 +39,9 @@ namespace { struct StrongPHIElimination : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid - StrongPHIElimination() : MachineFunctionPass(ID) {} + StrongPHIElimination() : MachineFunctionPass(ID) { + initializeStrongPHIEliminationPass(*PassRegistry::getPassRegistry()); + } // Waiting stores, for each MBB, the set of copies that need to // be inserted into that MBB Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Oct 19 12:21:58 2010 @@ -138,7 +138,9 @@ public: static char ID; // Pass identification, replacement for typeid - TwoAddressInstructionPass() : MachineFunctionPass(ID) {} + TwoAddressInstructionPass() : MachineFunctionPass(ID) { + initializeTwoAddressInstructionPassPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Tue Oct 19 12:21:58 2010 @@ -43,7 +43,9 @@ virtual bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - UnreachableBlockElim() : FunctionPass(ID) {} + UnreachableBlockElim() : FunctionPass(ID) { + initializeUnreachableBlockElimPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Tue Oct 19 12:21:58 2010 @@ -77,7 +77,9 @@ public: static char ID; CBackendNameAllUsedStructsAndMergeFunctions() - : ModulePass(ID) {} + : ModulePass(ID) { + initializeFindUsedTypesPass(*PassRegistry::getPassRegistry()); + } void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -117,6 +119,7 @@ : FunctionPass(ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TCtx(0), TD(0), OpaqueCounter(0), NextAnonValueNumber(0) { + initializeLoopInfoPass(*PassRegistry::getPassRegistry()); FPCounter = 0; } Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Tue Oct 19 12:21:58 2010 @@ -131,6 +131,8 @@ } void TargetData::init(StringRef Desc) { + initializeTargetDataPass(*PassRegistry::getPassRegistry()); + LayoutMap = 0; LittleEndian = false; PointerMemSize = 8; Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Tue Oct 19 12:21:58 2010 @@ -67,7 +67,9 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid explicit ArgPromotion(unsigned maxElements = 3) - : CallGraphSCCPass(ID), maxElements(maxElements) {} + : CallGraphSCCPass(ID), maxElements(maxElements) { + initializeArgPromotionPass(*PassRegistry::getPassRegistry()); + } /// A vector used to hold the indices of a single GEP instruction typedef std::vector IndicesVector; Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Tue Oct 19 12:21:58 2010 @@ -33,7 +33,9 @@ namespace { struct ConstantMerge : public ModulePass { static char ID; // Pass identification, replacement for typeid - ConstantMerge() : ModulePass(ID) {} + ConstantMerge() : ModulePass(ID) { + initializeConstantMergePass(*PassRegistry::getPassRegistry()); + } // run - For this pass, process all of the globals in the module, // eliminating duplicate constants. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Oct 19 12:21:58 2010 @@ -126,7 +126,9 @@ public: static char ID; // Pass identification, replacement for typeid - DAE() : ModulePass(ID) {} + DAE() : ModulePass(ID) { + initializeDAEPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp Tue Oct 19 12:21:58 2010 @@ -26,7 +26,9 @@ namespace { struct DTE : public ModulePass { static char ID; // Pass identification, replacement for typeid - DTE() : ModulePass(ID) {} + DTE() : ModulePass(ID) { + initializeDTEPass(*PassRegistry::getPassRegistry()); + } // doPassInitialization - For this pass, it removes global symbol table // entries for primitive types. These are never used for linking in GCC and Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Tue Oct 19 12:21:58 2010 @@ -41,7 +41,9 @@ namespace { struct FunctionAttrs : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - FunctionAttrs() : CallGraphSCCPass(ID) {} + FunctionAttrs() : CallGraphSCCPass(ID) { + initializeFunctionAttrsPass(*PassRegistry::getPassRegistry()); + } // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Tue Oct 19 12:21:58 2010 @@ -31,7 +31,9 @@ namespace { struct GlobalDCE : public ModulePass { static char ID; // Pass identification, replacement for typeid - GlobalDCE() : ModulePass(ID) {} + GlobalDCE() : ModulePass(ID) { + initializeGlobalDCEPass(*PassRegistry::getPassRegistry()); + } // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Oct 19 12:21:58 2010 @@ -59,7 +59,9 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - GlobalOpt() : ModulePass(ID) {} + GlobalOpt() : ModulePass(ID) { + initializeGlobalOptPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Tue Oct 19 12:21:58 2010 @@ -35,7 +35,9 @@ /// struct IPCP : public ModulePass { static char ID; // Pass identification, replacement for typeid - IPCP() : ModulePass(ID) {} + IPCP() : ModulePass(ID) { + initializeIPCPPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M); private: Modified: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ InlineCostAnalyzer CA; public: // Use extremely low threshold. - AlwaysInliner() : Inliner(ID, -2000000000) {} + AlwaysInliner() : Inliner(ID, -2000000000) { + initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); + } static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); @@ -61,7 +63,10 @@ } char AlwaysInliner::ID = 0; -INITIALIZE_PASS(AlwaysInliner, "always-inline", +INITIALIZE_PASS_BEGIN(AlwaysInliner, "always-inline", + "Inliner for always_inline functions", false, false) +INITIALIZE_AG_DEPENDENCY(CallGraph) +INITIALIZE_PASS_END(AlwaysInliner, "always-inline", "Inliner for always_inline functions", false, false) Pass *llvm::createAlwaysInlinerPass() { return new AlwaysInliner(); } Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Tue Oct 19 12:21:58 2010 @@ -33,8 +33,12 @@ SmallPtrSet NeverInline; InlineCostAnalyzer CA; public: - SimpleInliner() : Inliner(ID) {} - SimpleInliner(int Threshold) : Inliner(ID, Threshold) {} + SimpleInliner() : Inliner(ID) { + initializeSimpleInlinerPass(*PassRegistry::getPassRegistry()); + } + SimpleInliner(int Threshold) : Inliner(ID, Threshold) { + initializeSimpleInlinerPass(*PassRegistry::getPassRegistry()); + } static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Tue Oct 19 12:21:58 2010 @@ -68,6 +68,7 @@ InternalizePass::InternalizePass(bool AllButMain) : ModulePass(ID), AllButMain(AllButMain){ + initializeInternalizePassPass(*PassRegistry::getPassRegistry()); if (!APIFile.empty()) // If a filename is specified, use it. LoadFile(APIFile.c_str()); if (!APIList.empty()) // If a list is specified, use it as well. @@ -76,6 +77,7 @@ InternalizePass::InternalizePass(const std::vector&exportList) : ModulePass(ID), AllButMain(false){ + initializeInternalizePassPass(*PassRegistry::getPassRegistry()); for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Tue Oct 19 12:21:58 2010 @@ -37,7 +37,9 @@ unsigned NumLoops; explicit LoopExtractor(unsigned numLoops = ~0) - : LoopPass(ID), NumLoops(numLoops) {} + : LoopPass(ID), NumLoops(numLoops) { + initializeLoopExtractorPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Tue Oct 19 12:21:58 2010 @@ -109,7 +109,9 @@ bool IsTransformableFunction(StringRef Name); public: static char ID; // Pass identification, replacement for typeid - LowerSetJmp() : ModulePass(ID) {} + LowerSetJmp() : ModulePass(ID) { + initializeLowerSetJmpPass(*PassRegistry::getPassRegistry()); + } void visitCallInst(CallInst& CI); void visitInvokeInst(InvokeInst& II); Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Tue Oct 19 12:21:58 2010 @@ -151,7 +151,9 @@ class MergeFunctions : public ModulePass { public: static char ID; - MergeFunctions() : ModulePass(ID) {} + MergeFunctions() : ModulePass(ID) { + initializeMergeFunctionsPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp Tue Oct 19 12:21:58 2010 @@ -30,7 +30,9 @@ struct PartialInliner : public ModulePass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - PartialInliner() : ModulePass(ID) {} + PartialInliner() : ModulePass(ID) { + initializePartialInlinerPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module& M); Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Tue Oct 19 12:21:58 2010 @@ -46,7 +46,9 @@ InlineCostAnalyzer CA; public : static char ID; // Pass identification, replacement for typeid - PartSpec() : ModulePass(ID) {} + PartSpec() : ModulePass(ID) { + initializePartSpecPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M); }; } Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Tue Oct 19 12:21:58 2010 @@ -37,7 +37,9 @@ namespace { struct PruneEH : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - PruneEH() : CallGraphSCCPass(ID) {} + PruneEH() : CallGraphSCCPass(ID) { + initializePruneEHPass(*PassRegistry::getPassRegistry()); + } // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp Tue Oct 19 12:21:58 2010 @@ -29,7 +29,9 @@ class StripDeadPrototypesPass : public ModulePass { public: static char ID; // Pass identification, replacement for typeid - StripDeadPrototypesPass() : ModulePass(ID) { } + StripDeadPrototypesPass() : ModulePass(ID) { + initializeStripDeadPrototypesPassPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Tue Oct 19 12:21:58 2010 @@ -39,7 +39,9 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripSymbols(bool ODI = false) - : ModulePass(ID), OnlyDebugInfo(ODI) {} + : ModulePass(ID), OnlyDebugInfo(ODI) { + initializeStripSymbolsPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M); @@ -52,7 +54,9 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripNonDebugSymbols() - : ModulePass(ID) {} + : ModulePass(ID) { + initializeStripNonDebugSymbolsPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M); @@ -65,7 +69,9 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDebugDeclare() - : ModulePass(ID) {} + : ModulePass(ID) { + initializeStripDebugDeclarePass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M); @@ -78,7 +84,9 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDeadDebugInfo() - : ModulePass(ID) {} + : ModulePass(ID) { + initializeStripDeadDebugInfoPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Tue Oct 19 12:21:58 2010 @@ -50,7 +50,9 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid - SRETPromotion() : CallGraphSCCPass(ID) {} + SRETPromotion() : CallGraphSCCPass(ID) { + initializeSRETPromotionPass(*PassRegistry::getPassRegistry()); + } private: CallGraphNode *PromoteReturn(CallGraphNode *CGN); Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombine.h?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombine.h (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombine.h Tue Oct 19 12:21:58 2010 @@ -81,7 +81,9 @@ BuilderTy *Builder; static char ID; // Pass identification, replacement for typeid - InstCombiner() : FunctionPass(ID), TD(0), Builder(0) {} + InstCombiner() : FunctionPass(ID), TD(0), Builder(0) { + initializeInstCombinerPass(*PassRegistry::getPassRegistry()); + } public: virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp Tue Oct 19 12:21:58 2010 @@ -34,7 +34,9 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - EdgeProfiler() : ModulePass(ID) {} + EdgeProfiler() : ModulePass(ID) { + initializeEdgeProfilerPass(*PassRegistry::getPassRegistry()); + } virtual const char *getPassName() const { return "Edge Profiler"; Modified: llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - OptimalEdgeProfiler() : ModulePass(ID) {} + OptimalEdgeProfiler() : ModulePass(ID) { + initializeOptimalEdgeProfilerPass(*PassRegistry::getPassRegistry()); + } void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(ProfileEstimatorPassID); Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Tue Oct 19 12:21:58 2010 @@ -33,7 +33,9 @@ namespace { struct ADCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ADCE() : FunctionPass(ID) {} + ADCE() : FunctionPass(ID) { + initializeADCEPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp Tue Oct 19 12:21:58 2010 @@ -41,7 +41,9 @@ namespace { struct BlockPlacement : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BlockPlacement() : FunctionPass(ID) {} + BlockPlacement() : FunctionPass(ID) { + initializeBlockPlacementPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Tue Oct 19 12:21:58 2010 @@ -63,7 +63,9 @@ public: static char ID; // Pass identification, replacement for typeid explicit CodeGenPrepare(const TargetLowering *tli = 0) - : FunctionPass(ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) { + initializeCodeGenPreparePass(*PassRegistry::getPassRegistry()); + } bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Tue Oct 19 12:21:58 2010 @@ -34,7 +34,9 @@ namespace { struct ConstantPropagation : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ConstantPropagation() : FunctionPass(ID) {} + ConstantPropagation() : FunctionPass(ID) { + initializeConstantPropagationPass(*PassRegistry::getPassRegistry()); + } bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp Tue Oct 19 12:21:58 2010 @@ -39,7 +39,9 @@ public: static char ID; - CorrelatedValuePropagation(): FunctionPass(ID) { } + CorrelatedValuePropagation(): FunctionPass(ID) { + initializeCorrelatedValuePropagationPass(*PassRegistry::getPassRegistry()); + } bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Tue Oct 19 12:21:58 2010 @@ -35,7 +35,9 @@ // struct DeadInstElimination : public BasicBlockPass { static char ID; // Pass identification, replacement for typeid - DeadInstElimination() : BasicBlockPass(ID) {} + DeadInstElimination() : BasicBlockPass(ID) { + initializeDeadInstEliminationPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) { @@ -70,7 +72,9 @@ // struct DCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - DCE() : FunctionPass(ID) {} + DCE() : FunctionPass(ID) { + initializeDCEPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Oct 19 12:21:58 2010 @@ -40,7 +40,9 @@ TargetData *TD; static char ID; // Pass identification, replacement for typeid - DSE() : FunctionPass(ID) {} + DSE() : FunctionPass(ID) { + initializeDSEPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F) { bool Changed = false; Modified: llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp Tue Oct 19 12:21:58 2010 @@ -27,7 +27,9 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: static char ID; // Pass identification, replacement for typeid - explicit GEPSplitter() : FunctionPass(ID) {} + explicit GEPSplitter() : FunctionPass(ID) { + initializeGEPSplitterPass(*PassRegistry::getPassRegistry()); + } }; } Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Oct 19 12:21:58 2010 @@ -662,7 +662,9 @@ public: static char ID; // Pass identification, replacement for typeid explicit GVN(bool noloads = false) - : FunctionPass(ID), NoLoads(noloads), MD(0) { } + : FunctionPass(ID), NoLoads(noloads), MD(0) { + initializeGVNPass(*PassRegistry::getPassRegistry()); + } private: bool NoLoads; Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Oct 19 12:21:58 2010 @@ -77,7 +77,9 @@ public: static char ID; // Pass identification, replacement for typeid - IndVarSimplify() : LoopPass(ID) {} + IndVarSimplify() : LoopPass(ID) { + initializeIndVarSimplifyPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Tue Oct 19 12:21:58 2010 @@ -86,7 +86,9 @@ }; public: static char ID; // Pass identification - JumpThreading() : FunctionPass(ID) {} + JumpThreading() : FunctionPass(ID) { + initializeJumpThreadingPass(*PassRegistry::getPassRegistry()); + } bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Oct 19 12:21:58 2010 @@ -67,7 +67,9 @@ namespace { struct LICM : public LoopPass { static char ID; // Pass identification, replacement for typeid - LICM() : LoopPass(ID) {} + LICM() : LoopPass(ID) { + initializeLICMPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Tue Oct 19 12:21:58 2010 @@ -28,7 +28,9 @@ class LoopDeletion : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopDeletion() : LoopPass(ID) {} + LoopDeletion() : LoopPass(ID) { + initializeLoopDeletionPass(*PassRegistry::getPassRegistry()); + } // Possibly eliminate loop L if it is dead. bool runOnLoop(Loop* L, LPPassManager& LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Tue Oct 19 12:21:58 2010 @@ -35,7 +35,9 @@ class LoopRotate : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopRotate() : LoopPass(ID) {} + LoopRotate() : LoopPass(ID) { + initializeLoopRotatePass(*PassRegistry::getPassRegistry()); + } // Rotate Loop L as many times as possible. Return true if // loop is rotated at least once. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Oct 19 12:21:58 2010 @@ -3807,7 +3807,9 @@ } LoopStrengthReduce::LoopStrengthReduce(const TargetLowering *tli) - : LoopPass(ID), TLI(tli) {} + : LoopPass(ID), TLI(tli) { + initializeLoopStrengthReducePass(*PassRegistry::getPassRegistry()); + } void LoopStrengthReduce::getAnalysisUsage(AnalysisUsage &AU) const { // We split critical edges, so we change the CFG. However, we do update Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Tue Oct 19 12:21:58 2010 @@ -43,7 +43,9 @@ class LoopUnroll : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopUnroll() : LoopPass(ID) {} + LoopUnroll() : LoopPass(ID) { + initializeLoopUnrollPass(*PassRegistry::getPassRegistry()); + } /// A magic value for use with the Threshold parameter to indicate /// that the loop unroll should be performed regardless of how much Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Oct 19 12:21:58 2010 @@ -93,7 +93,9 @@ explicit LoopUnswitch(bool Os = false) : LoopPass(ID), OptimizeForSize(Os), redoLoop(false), currentLoop(NULL), DT(NULL), loopHeader(NULL), - loopPreheader(NULL) {} + loopPreheader(NULL) { + initializeLoopUnswitchPass(*PassRegistry::getPassRegistry()); + } bool runOnLoop(Loop *L, LPPassManager &LPM); bool processCurrentLoop(); Modified: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Tue Oct 19 12:21:58 2010 @@ -118,7 +118,9 @@ namespace { struct LowerAtomic : public BasicBlockPass { static char ID; - LowerAtomic() : BasicBlockPass(ID) {} + LowerAtomic() : BasicBlockPass(ID) { + initializeLowerAtomicPass(*PassRegistry::getPassRegistry()); + } bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Tue Oct 19 12:21:58 2010 @@ -304,7 +304,9 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - MemCpyOpt() : FunctionPass(ID) {} + MemCpyOpt() : FunctionPass(ID) { + initializeMemCpyOptPass(*PassRegistry::getPassRegistry()); + } private: // This transformation requires dominator postdominator info Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Tue Oct 19 12:21:58 2010 @@ -77,7 +77,9 @@ bool MadeChange; public: static char ID; // Pass identification, replacement for typeid - Reassociate() : FunctionPass(ID) {} + Reassociate() : FunctionPass(ID) { + initializeReassociatePass(*PassRegistry::getPassRegistry()); + } bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ namespace { struct RegToMem : public FunctionPass { static char ID; // Pass identification, replacement for typeid - RegToMem() : FunctionPass(ID) {} + RegToMem() : FunctionPass(ID) { + initializeRegToMemPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Tue Oct 19 12:21:58 2010 @@ -1585,7 +1585,9 @@ /// struct SCCP : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SCCP() : FunctionPass(ID) {} + SCCP() : FunctionPass(ID) { + initializeSCCPPass(*PassRegistry::getPassRegistry()); + } // runOnFunction - Run the Sparse Conditional Constant Propagation // algorithm, and return true if the function was modified. @@ -1701,7 +1703,9 @@ /// struct IPSCCP : public ModulePass { static char ID; - IPSCCP() : ModulePass(ID) {} + IPSCCP() : ModulePass(ID) { + initializeIPSCCPPass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M); }; } // end anonymous namespace Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Oct 19 12:21:58 2010 @@ -53,6 +53,7 @@ struct SROA : public FunctionPass { static char ID; // Pass identification, replacement for typeid explicit SROA(signed T = -1) : FunctionPass(ID) { + initializeSROAPass(*PassRegistry::getPassRegistry()); if (T == -1) SRThreshold = 128; else Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Tue Oct 19 12:21:58 2010 @@ -42,7 +42,9 @@ namespace { struct CFGSimplifyPass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSimplifyPass() : FunctionPass(ID) {} + CFGSimplifyPass() : FunctionPass(ID) { + initializeCFGSimplifyPassPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); }; Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp Tue Oct 19 12:21:58 2010 @@ -32,7 +32,9 @@ const TargetData *TD; public: static char ID; // Pass identification - SimplifyHalfPowrLibCalls() : FunctionPass(ID) {} + SimplifyHalfPowrLibCalls() : FunctionPass(ID) { + initializeSimplifyHalfPowrLibCallsPass(*PassRegistry::getPassRegistry()); + } bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Tue Oct 19 12:21:58 2010 @@ -1374,7 +1374,9 @@ bool Modified; // This is only used by doInitialization. public: static char ID; // Pass identification - SimplifyLibCalls() : FunctionPass(ID), StrCpy(false), StrCpyChk(true) {} + SimplifyLibCalls() : FunctionPass(ID), StrCpy(false), StrCpyChk(true) { + initializeSimplifyLibCallsPass(*PassRegistry::getPassRegistry()); + } void InitOptimizations(); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Sink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Sink.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Sink.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Tue Oct 19 12:21:58 2010 @@ -35,7 +35,9 @@ public: static char ID; // Pass identification - Sinking() : FunctionPass(ID) {} + Sinking() : FunctionPass(ID) { + initializeSinkingPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Tue Oct 19 12:21:58 2010 @@ -49,7 +49,9 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - TailDup() : FunctionPass(ID) {} + TailDup() : FunctionPass(ID) { + initializeTailDupPass(*PassRegistry::getPassRegistry()); + } private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned); Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Tue Oct 19 12:21:58 2010 @@ -72,7 +72,9 @@ namespace { struct TailCallElim : public FunctionPass { static char ID; // Pass identification, replacement for typeid - TailCallElim() : FunctionPass(ID) {} + TailCallElim() : FunctionPass(ID) { + initializeTailCallElimPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Oct 19 12:21:58 2010 @@ -36,7 +36,9 @@ namespace { struct BreakCriticalEdges : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BreakCriticalEdges() : FunctionPass(ID) {} + BreakCriticalEdges() : FunctionPass(ID) { + initializeBreakCriticalEdgesPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp Tue Oct 19 12:21:58 2010 @@ -23,7 +23,9 @@ namespace { struct InstNamer : public FunctionPass { static char ID; // Pass identification, replacement for typeid - InstNamer() : FunctionPass(ID) {} + InstNamer() : FunctionPass(ID) { + initializeInstNamerPass(*PassRegistry::getPassRegistry()); + } void getAnalysisUsage(AnalysisUsage &Info) const { Info.setPreservesAll(); Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Tue Oct 19 12:21:58 2010 @@ -47,7 +47,9 @@ namespace { struct LCSSA : public LoopPass { static char ID; // Pass identification, replacement for typeid - LCSSA() : LoopPass(ID) {} + LCSSA() : LoopPass(ID) { + initializeLCSSAPass(*PassRegistry::getPassRegistry()); + } // Cached analysis information for the current function. DominatorTree *DT; Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Tue Oct 19 12:21:58 2010 @@ -65,7 +65,9 @@ namespace { struct LoopSimplify : public LoopPass { static char ID; // Pass identification, replacement for typeid - LoopSimplify() : LoopPass(ID) {} + LoopSimplify() : LoopPass(ID) { + initializeLoopSimplifyPass(*PassRegistry::getPassRegistry()); + } // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. @@ -111,11 +113,6 @@ "Canonicalize natural loops", true, false) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_DEPENDENCY(LoopInfo) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) -INITIALIZE_PASS_DEPENDENCY(BreakCriticalEdges) -INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) -INITIALIZE_PASS_DEPENDENCY(LCSSA) -INITIALIZE_AG_DEPENDENCY(AliasAnalysis) INITIALIZE_PASS_END(LoopSimplify, "loopsimplify", "Canonicalize natural loops", true, false) Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Tue Oct 19 12:21:58 2010 @@ -79,7 +79,9 @@ explicit LowerInvoke(const TargetLowering *tli = NULL, bool useExpensiveEHSupport = ExpensiveEHSupport) : FunctionPass(ID), useExpensiveEHSupport(useExpensiveEHSupport), - TLI(tli) { } + TLI(tli) { + initializeLowerInvokePass(*PassRegistry::getPassRegistry()); + } bool doInitialization(Module &M); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Tue Oct 19 12:21:58 2010 @@ -33,7 +33,9 @@ class LowerSwitch : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - LowerSwitch() : FunctionPass(ID) {} + LowerSwitch() : FunctionPass(ID) { + initializeLowerSwitchPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Tue Oct 19 12:21:58 2010 @@ -27,7 +27,9 @@ namespace { struct PromotePass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - PromotePass() : FunctionPass(ID) {} + PromotePass() : FunctionPass(ID) { + initializePromotePassPass(*PassRegistry::getPassRegistry()); + } // runOnFunction - To run this pass, first we calculate the alloca // instructions that are safe for promotion, then we promote each one. Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Oct 19 12:21:58 2010 @@ -72,7 +72,9 @@ struct PreVerifier : public FunctionPass { static char ID; // Pass ID, replacement for typeid - PreVerifier() : FunctionPass(ID) { } + PreVerifier() : FunctionPass(ID) { + initializePreVerifierPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -184,11 +186,15 @@ Verifier() : FunctionPass(ID), Broken(false), RealPass(true), action(AbortProcessAction), - Mod(0), Context(0), DT(0), MessagesStr(Messages) {} + Mod(0), Context(0), DT(0), MessagesStr(Messages) { + initializeVerifierPass(*PassRegistry::getPassRegistry()); + } explicit Verifier(VerifierFailureAction ctn) : FunctionPass(ID), Broken(false), RealPass(true), action(ctn), Mod(0), Context(0), DT(0), - MessagesStr(Messages) {} + MessagesStr(Messages) { + initializeVerifierPass(*PassRegistry::getPassRegistry()); + } bool doInitialization(Module &M) { Mod = &M; Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Tue Oct 19 12:21:58 2010 @@ -94,6 +94,19 @@ llvm::sys::PrintStackTraceOnErrorSignal(); llvm::PrettyStackTraceProgram X(argc, argv); llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. + + // Initialize passes + PassRegistry &Registry = *PassRegistry::getPassRegistry(); + initializeCore(Registry); + initializeScalarOpts(Registry); + initializeIPO(Registry); + initializeAnalysis(Registry); + initializeIPA(Registry); + initializeTransformUtils(Registry); + initializeInstCombine(Registry); + initializeInstrumentation(Registry); + initializeTarget(Registry); + cl::ParseCommandLineOptions(argc, argv, "LLVM automatic testcase reducer. See\nhttp://" "llvm.org/cmds/bugpoint.html" Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original) +++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Tue Oct 19 12:21:58 2010 @@ -514,6 +514,17 @@ LLVMContext &Context = getGlobalContext(); llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. + // Initialize passes + PassRegistry &Registry = *PassRegistry::getPassRegistry(); + initializeCore(Registry); + initializeScalarOpts(Registry); + initializeIPO(Registry); + initializeAnalysis(Registry); + initializeIPA(Registry); + initializeTransformUtils(Registry); + initializeInstCombine(Registry); + initializeTarget(Registry); + // Initial global variable above for convenience printing of program name. progname = sys::Path(argv[0]).getBasename(); Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Tue Oct 19 12:21:58 2010 @@ -394,6 +394,18 @@ llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. LLVMContext &Context = getGlobalContext(); + // Initialize passes + PassRegistry &Registry = *PassRegistry::getPassRegistry(); + initializeCore(Registry); + initializeScalarOpts(Registry); + initializeIPO(Registry); + initializeAnalysis(Registry); + initializeIPA(Registry); + initializeTransformUtils(Registry); + initializeInstCombine(Registry); + initializeInstrumentation(Registry); + initializeTarget(Registry); + cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n"); Modified: llvm/trunk/unittests/VMCore/PassManagerTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/PassManagerTest.cpp?rev=116820&r1=116819&r2=116820&view=diff ============================================================================== --- llvm/trunk/unittests/VMCore/PassManagerTest.cpp (original) +++ llvm/trunk/unittests/VMCore/PassManagerTest.cpp Tue Oct 19 12:21:58 2010 @@ -32,7 +32,15 @@ #include "llvm/Assembly/PrintModulePass.h" #include "gtest/gtest.h" +using namespace llvm; + namespace llvm { + void initializeModuleNDMPass(PassRegistry&); + void initializeFPassPass(PassRegistry&); + void initializeCGPassPass(PassRegistry&); + void initializeLPassPass(PassRegistry&); + void initializeBPassPass(PassRegistry&); + namespace { // ND = no deps // NM = no modifications @@ -40,7 +48,7 @@ public: static char run; static char ID; - ModuleNDNM() : ModulePass(ID) {} + ModuleNDNM() : ModulePass(ID) { } virtual bool runOnModule(Module &M) { run++; return false; @@ -64,7 +72,6 @@ }; char ModuleNDM::ID=0; char ModuleNDM::run=0; - RegisterPass X("mndm","mndm",false,false); struct ModuleNDM2 : public ModulePass { public: @@ -83,7 +90,9 @@ public: static char run; static char ID; - ModuleDNM() : ModulePass(ID) {} + ModuleDNM() : ModulePass(ID) { + initializeModuleNDMPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); run++; @@ -154,13 +163,15 @@ struct CGPass : public PassTest { public: + CGPass() { + initializeCGPassPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnSCC(CallGraphSCC &SCMM) { EXPECT_TRUE(getAnalysisIfAvailable()); run(); return false; } }; - RegisterPass X1("cgp","cgp"); struct FPass : public PassTest { public: @@ -171,7 +182,6 @@ return false; } }; - RegisterPass X2("fp","fp"); struct LPass : public PassTestBase { private: @@ -179,6 +189,7 @@ static int fincount; public: LPass() { + initializeLPassPass(*PassRegistry::getPassRegistry()); initcount = 0; fincount=0; EXPECT_FALSE(initialized); } @@ -205,7 +216,6 @@ }; int LPass::initcount=0; int LPass::fincount=0; - RegisterPass X3("lp","lp"); struct BPass : public PassTestBase { private: @@ -248,12 +258,13 @@ }; int BPass::inited=0; int BPass::fin=0; - RegisterPass X4("bp","bp"); struct OnTheFlyTest: public ModulePass { public: static char ID; - OnTheFlyTest() : ModulePass(ID) {} + OnTheFlyTest() : ModulePass(ID) { + initializeFPassPass(*PassRegistry::getPassRegistry()); + } virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) { @@ -525,3 +536,13 @@ } } + +INITIALIZE_PASS(ModuleNDM, "mndm", "mndm", false, false) +INITIALIZE_PASS_BEGIN(CGPass, "cgp","cgp", false, false) +INITIALIZE_AG_DEPENDENCY(CallGraph) +INITIALIZE_PASS_END(CGPass, "cgp","cgp", false, false) +INITIALIZE_PASS(FPass, "fp","fp", false, false) +INITIALIZE_PASS_BEGIN(LPass, "lp","lp", false, false) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_END(LPass, "lp","lp", false, false) +INITIALIZE_PASS(BPass, "bp","bp", false, false) From matthewbg at google.com Mon Oct 18 17:51:11 2010 From: matthewbg at google.com (Matt Beaumont-Gay) Date: Mon, 18 Oct 2010 15:51:11 -0700 Subject: [llvm-commits] [PATCH] Add trivial virtual dtor to MCObjectFormat Message-ID: LLVM currently fails to build with g++ -Wall -Werror: include/llvm/MC/MCObjectFormat.h:16: error: 'class llvm::MCObjectFormat' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor] Attached patch fixes this. -Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: fix_mc_compile.patch Type: text/x-patch Size: 460 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101018/b00676bc/attachment.bin From espindola at google.com Tue Oct 19 10:01:26 2010 From: espindola at google.com (Rafael Espindola) Date: Tue, 19 Oct 2010 11:01:26 -0400 Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes In-Reply-To: References: <6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com> <8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com> <8E5A9C6C-BA61-41F8-B445-336D9F96D774@apple.com> Message-ID: > Okay, I just committed the convert (all numbers from elf-dump are now > hex) as r116753. I noticed that was reverted. The first thing is to fix it and commit again. Once it is in: + + case ELF::SHT_ARM_EXIDX: + case ELF::SHT_ARM_PREEMPTMAP: + assert(0 && "FIXME: sh_type value not supported!"); + break; + + case ELF::SHT_ARM_ATTRIBUTES: + break; + + case ELF::SHT_ARM_DEBUGOVERLAY: + case ELF::SHT_ARM_OVERLAYSECTION: default: assert(0 && "FIXME: sh_type value not supported!"); break; The two new cases are exactly like the default. Same for the last two new one. Can you just use the default? Another option is to list every enum value and remove the default so that we get a warning if one is missing. Not sure if there are two many for this to be practical. It still looks like you are creating more class members than you need to. Take headFragment for example. It is only assigned in one place in the code, emitARMAttributeSection. emitARMAttributeSection is only called once in emitAttributes. emitARMAttributeSection can "return" the headFragment and that can then be passed to fixupAttrSizes. Cheers, -- Rafael ?vila de Esp?ndola From aggarwa4 at illinois.edu Tue Oct 19 12:31:35 2010 From: aggarwa4 at illinois.edu (Arushi Aggarwal) Date: Tue, 19 Oct 2010 17:31:35 -0000 Subject: [llvm-commits] [poolalloc] r116821 - in /poolalloc/trunk/test/dsa/callgraph: ./ inheritance1.ll inheritance2.ll inheritance3.ll Message-ID: <20101019173135.3A0BD2A6C12C@llvm.org> Author: aggarwa4 Date: Tue Oct 19 12:31:35 2010 New Revision: 116821 URL: http://llvm.org/viewvc/llvm-project?rev=116821&view=rev Log: New testcases for callgraph construction Added: poolalloc/trunk/test/dsa/callgraph/ poolalloc/trunk/test/dsa/callgraph/inheritance1.ll poolalloc/trunk/test/dsa/callgraph/inheritance2.ll poolalloc/trunk/test/dsa/callgraph/inheritance3.ll Added: poolalloc/trunk/test/dsa/callgraph/inheritance1.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/inheritance1.ll?rev=116821&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/callgraph/inheritance1.ll (added) +++ poolalloc/trunk/test/dsa/callgraph/inheritance1.ll Tue Oct 19 12:31:35 2010 @@ -0,0 +1,325 @@ +;RUN: dsaopt %s -dsa-cbu -analyze -check-callees=main,_ZN9BaseClass10myFunctionEv,_ZN13DerivedClass110myFunctionEv,_ZN13DerivedClass210myFunctionEv + +; ModuleID = 'inheritance1.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" + +%0 = type { i32, void ()* } +%struct..0__pthread_mutex_s = type { i32, i32, i32, i32, i32, i32, %struct.__pthread_list_t } +%struct.BaseClass = type { i32 (...)** } +%struct.DerivedClass1 = type { %struct.BaseClass } +%struct.DerivedClass2 = type { %struct.DerivedClass1 } +%struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo } +%struct.__locale_struct = type { [13 x %struct.locale_data*], i16*, i32*, i32*, [13 x i8*] } +%struct.__pthread_list_t = type { %struct.__pthread_list_t*, %struct.__pthread_list_t* } +%struct.__si_class_type_info_pseudo = type { %struct.__type_info_pseudo, %"struct.std::type_info"* } +%struct.__type_info_pseudo = type { i8*, i8* } +%struct.locale_data = type opaque +%"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::num_get > >"*, %"struct.std::num_get > >"* } +%"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" } +%"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" } +%"struct.std::ctype" = type { %"struct.std::locale::facet", %struct.__locale_struct*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 } +%"struct.std::ios_base" = type { i32 (...)**, i64, i64, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" } +%"struct.std::ios_base::Init" = type <{ i8 }> +%"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 } +%"struct.std::ios_base::_Words" = type { i8*, i64 } +%"struct.std::locale" = type { %"struct.std::locale::_Impl"* } +%"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i64, %"struct.std::locale::facet"**, i8** } +%"struct.std::locale::facet" = type { i32 (...)**, i32 } +%"struct.std::locale::facet.base.64" = type { i32 (...)**, i32 } +%"struct.std::num_get > >" = type { %"struct.std::locale::facet" } +%"struct.std::num_put > >" = type { %"struct.std::locale::facet" } +%"struct.std::type_info" = type { i32 (...)**, i8* } +%union.pthread_attr_t = type { i64, [12 x i32] } +%union.pthread_mutex_t = type { %struct..0__pthread_mutex_s } +%union.pthread_mutexattr_t = type { i32 } + + at _ZTV9BaseClass = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__class_type_info_pseudo* @_ZTI9BaseClass to i32 (...)*), i32 (...)* bitcast (void (%struct.BaseClass*)* @_ZN9BaseClass10myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI9BaseClass = internal constant %struct.__class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv117__class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([11 x i8]* @_ZTS9BaseClass, i64 0, i64 0) } }, align 16 ; <%struct.__class_type_info_pseudo*> [#uses=2] + at _ZTVN10__cxxabiv117__class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1] + at _ZTS9BaseClass = internal constant [11 x i8] c"9BaseClass\00" ; <[11 x i8]*> [#uses=1] + at _ZTV13DerivedClass1 = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass1 to i32 (...)*), i32 (...)* bitcast (void (%struct.DerivedClass1*)* @_ZN13DerivedClass110myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI13DerivedClass1 = internal constant %struct.__si_class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv120__si_class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([16 x i8]* @_ZTS13DerivedClass1, i64 0, i64 0) }, %"struct.std::type_info"* bitcast (%struct.__class_type_info_pseudo* @_ZTI9BaseClass to %"struct.std::type_info"*) }, align 16 ; <%struct.__si_class_type_info_pseudo*> [#uses=2] + at _ZTVN10__cxxabiv120__si_class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1] + at _ZTS13DerivedClass1 = internal constant [16 x i8] c"13DerivedClass1\00", align 16 ; <[16 x i8]*> [#uses=1] + at _ZTV13DerivedClass2 = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass2 to i32 (...)*), i32 (...)* bitcast (void (%struct.DerivedClass2*)* @_ZN13DerivedClass210myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI13DerivedClass2 = internal constant %struct.__si_class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv120__si_class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([16 x i8]* @_ZTS13DerivedClass2, i64 0, i64 0) }, %"struct.std::type_info"* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass1 to %"struct.std::type_info"*) }, align 16 ; <%struct.__si_class_type_info_pseudo*> [#uses=1] + at _ZTS13DerivedClass2 = internal constant [16 x i8] c"13DerivedClass2\00", align 16 ; <[16 x i8]*> [#uses=1] + at _ZSt4cout = external global %"struct.std::basic_ostream >" ; <%"struct.std::basic_ostream >"*> [#uses=3] + at .str = private constant [41 x i8] c"Using BaseClass version of myFunction()\0A\00", align 8 ; <[41 x i8]*> [#uses=1] + at .str1 = private constant [47 x i8] c"Using DerivedClass1's version of myFunction()\0A\00", align 8 ; <[47 x i8]*> [#uses=1] + at .str2 = private constant [47 x i8] c"Using DerivedClass2's version of myFunction()\0A\00", align 8 ; <[47 x i8]*> [#uses=1] + at _ZStL8__ioinit = internal global %"struct.std::ios_base::Init" zeroinitializer ; <%"struct.std::ios_base::Init"*> [#uses=2] + at __dso_handle = external global i8* ; [#uses=1] + at llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_main }] ; <[1 x %0]*> [#uses=0] + + at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0] + at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0] + at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0] + at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0] + at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0] + at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0] + at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init ; [#uses=0] + at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0] + at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0] + at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy ; [#uses=0] + +define i32 @main() { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %p = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=9] + %ob = alloca %struct.BaseClass ; <%struct.BaseClass*> [#uses=2] + %derivedObject1 = alloca %struct.DerivedClass1 ; <%struct.DerivedClass1*> [#uses=2] + %derivedObject2 = alloca %struct.DerivedClass2 ; <%struct.DerivedClass2*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @_ZN9BaseClassC1Ev(%struct.BaseClass* %ob) nounwind + call void @_ZN13DerivedClass1C1Ev(%struct.DerivedClass1* %derivedObject1) nounwind + call void @_ZN13DerivedClass2C1Ev(%struct.DerivedClass2* %derivedObject2) nounwind + store %struct.BaseClass* %ob, %struct.BaseClass** %p, align 8 + %1 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %2 = getelementptr inbounds %struct.BaseClass* %1, i32 0, i32 0 ; [#uses=1] + %3 = load i32 (...)*** %2, align 8 ; [#uses=1] + %4 = getelementptr inbounds i32 (...)** %3, i64 0 ; [#uses=1] + %5 = load i32 (...)** %4, align 1 ; [#uses=1] + %6 = bitcast i32 (...)* %5 to void (%struct.BaseClass*)* ; [#uses=1] + %7 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %6(%struct.BaseClass* %7) + %8 = getelementptr inbounds %struct.DerivedClass1* %derivedObject1, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %8, %struct.BaseClass** %p, align 8 + %9 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %10 = getelementptr inbounds %struct.BaseClass* %9, i32 0, i32 0 ; [#uses=1] + %11 = load i32 (...)*** %10, align 8 ; [#uses=1] + %12 = getelementptr inbounds i32 (...)** %11, i64 0 ; [#uses=1] + %13 = load i32 (...)** %12, align 1 ; [#uses=1] + %14 = bitcast i32 (...)* %13 to void (%struct.BaseClass*)* ; [#uses=1] + %15 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %14(%struct.BaseClass* %15) + %16 = getelementptr inbounds %struct.DerivedClass2* %derivedObject2, i32 0, i32 0 ; <%struct.DerivedClass1*> [#uses=1] + %17 = getelementptr inbounds %struct.DerivedClass1* %16, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %17, %struct.BaseClass** %p, align 8 + %18 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %19 = getelementptr inbounds %struct.BaseClass* %18, i32 0, i32 0 ; [#uses=1] + %20 = load i32 (...)*** %19, align 8 ; [#uses=1] + %21 = getelementptr inbounds i32 (...)** %20, i64 0 ; [#uses=1] + %22 = load i32 (...)** %21, align 1 ; [#uses=1] + %23 = bitcast i32 (...)* %22 to void (%struct.BaseClass*)* ; [#uses=1] + %24 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %23(%struct.BaseClass* %24) + store i32 0, i32* %0, align 4 + %25 = load i32* %0, align 4 ; [#uses=1] + store i32 %25, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} + +define internal void @_GLOBAL__I_main() { +entry: + call void @_Z41__static_initialization_and_destruction_0ii(i32 1, i32 65535) + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClassC2Ev(%struct.BaseClass* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = load %struct.BaseClass** %this_addr, align 8 ; <%struct.BaseClass*> [#uses=1] + %1 = getelementptr inbounds %struct.BaseClass* %0, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV9BaseClass, i64 0, i64 2), i32 (...)*** %1, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClass10myFunctionEv(%struct.BaseClass* %this) align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([41 x i8]* @.str, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClassC1Ev(%struct.BaseClass* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = load %struct.BaseClass** %this_addr, align 8 ; <%struct.BaseClass*> [#uses=1] + %1 = getelementptr inbounds %struct.BaseClass* %0, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV9BaseClass, i64 0, i64 2), i32 (...)*** %1, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass1C2Ev(%struct.DerivedClass1* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass1* %0, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + call void @_ZN9BaseClassC2Ev(%struct.BaseClass* %1) nounwind + %2 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass1* %2, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %4 = getelementptr inbounds %struct.BaseClass* %3, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass1, i64 0, i64 2), i32 (...)*** %4, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass110myFunctionEv(%struct.DerivedClass1* %this) align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([47 x i8]* @.str1, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass1C1Ev(%struct.DerivedClass1* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass1* %0, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + call void @_ZN9BaseClassC2Ev(%struct.BaseClass* %1) nounwind + %2 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass1* %2, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %4 = getelementptr inbounds %struct.BaseClass* %3, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass1, i64 0, i64 2), i32 (...)*** %4, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass2C1Ev(%struct.DerivedClass2* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass2* ; <%struct.DerivedClass2**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass2* %this, %struct.DerivedClass2** %this_addr + %0 = load %struct.DerivedClass2** %this_addr, align 8 ; <%struct.DerivedClass2*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass2* %0, i32 0, i32 0 ; <%struct.DerivedClass1*> [#uses=1] + call void @_ZN13DerivedClass1C2Ev(%struct.DerivedClass1* %1) nounwind + %2 = load %struct.DerivedClass2** %this_addr, align 8 ; <%struct.DerivedClass2*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass2* %2, i32 0, i32 0 ; <%struct.DerivedClass1*> [#uses=1] + %4 = getelementptr inbounds %struct.DerivedClass1* %3, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %5 = getelementptr inbounds %struct.BaseClass* %4, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass2, i64 0, i64 2), i32 (...)*** %5, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass210myFunctionEv(%struct.DerivedClass2* %this) align 2 { +entry: + %this_addr = alloca %struct.DerivedClass2* ; <%struct.DerivedClass2**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass2* %this, %struct.DerivedClass2** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([47 x i8]* @.str2, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +declare %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"*, i8*) + +define internal void @_Z41__static_initialization_and_destruction_0ii(i32 %__initialize_p, i32 %__priority) { +entry: + %__initialize_p_addr = alloca i32 ; [#uses=2] + %__priority_addr = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %__initialize_p, i32* %__initialize_p_addr + store i32 %__priority, i32* %__priority_addr + %0 = load i32* %__initialize_p_addr, align 4 ; [#uses=1] + %1 = icmp eq i32 %0, 1 ; [#uses=1] + br i1 %1, label %bb, label %bb2 + +bb: ; preds = %entry + %2 = load i32* %__priority_addr, align 4 ; [#uses=1] + %3 = icmp eq i32 %2, 65535 ; [#uses=1] + br i1 %3, label %bb1, label %bb2 + +bb1: ; preds = %bb + call void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ios_base::Init"* @_ZStL8__ioinit) + %4 = call i32 @__cxa_atexit(void (i8*)* @__tcf_0, i8* null, i8* bitcast (i8** @__dso_handle to i8*)) nounwind ; [#uses=0] + br label %bb2 + +bb2: ; preds = %bb1, %bb, %entry + br label %return + +return: ; preds = %bb2 + ret void +} + +declare void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ios_base::Init"*) + +declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) nounwind + +define internal void @__tcf_0(i8* %unnamed_arg) { +entry: + %unnamed_arg_addr = alloca i8* ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i8* %unnamed_arg, i8** %unnamed_arg_addr + call void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ios_base::Init"* @_ZStL8__ioinit) + br label %return + +return: ; preds = %entry + ret void +} + +declare void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ios_base::Init"*) + +declare extern_weak i32 @pthread_once(i32*, void ()*) + +declare extern_weak i8* @pthread_getspecific(i32) + +declare extern_weak i32 @pthread_setspecific(i32, i8*) + +declare extern_weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) + +declare extern_weak i32 @pthread_cancel(i64) + +declare extern_weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*) + +declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) + +declare extern_weak i32 @pthread_key_delete(i32) + +declare extern_weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*) + +declare extern_weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32) + +declare extern_weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*) Added: poolalloc/trunk/test/dsa/callgraph/inheritance2.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/inheritance2.ll?rev=116821&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/callgraph/inheritance2.ll (added) +++ poolalloc/trunk/test/dsa/callgraph/inheritance2.ll Tue Oct 19 12:31:35 2010 @@ -0,0 +1,371 @@ +;RUN: dsaopt %s -dsa-cbu -analyze -check-callees=main,_ZN9BaseClass10myFunctionEv,_ZN13DerivedClass110myFunctionEv,_ZN13DerivedClass210myFunctionEv,_Z4initi + +; ModuleID = 'inheritance2.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" + +%0 = type { i32, void ()* } +%struct..0__pthread_mutex_s = type { i32, i32, i32, i32, i32, i32, %struct.__pthread_list_t } +%struct.BaseClass = type { i32 (...)** } +%struct.DerivedClass1 = type { %struct.BaseClass } +%struct.DerivedClass2 = type { %struct.DerivedClass1 } +%struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo } +%struct.__locale_struct = type { [13 x %struct.locale_data*], i16*, i32*, i32*, [13 x i8*] } +%struct.__pthread_list_t = type { %struct.__pthread_list_t*, %struct.__pthread_list_t* } +%struct.__si_class_type_info_pseudo = type { %struct.__type_info_pseudo, %"struct.std::type_info"* } +%struct.__type_info_pseudo = type { i8*, i8* } +%struct.locale_data = type opaque +%"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::num_get > >"*, %"struct.std::num_get > >"* } +%"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" } +%"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" } +%"struct.std::ctype" = type { %"struct.std::locale::facet", %struct.__locale_struct*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 } +%"struct.std::ios_base" = type { i32 (...)**, i64, i64, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" } +%"struct.std::ios_base::Init" = type <{ i8 }> +%"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 } +%"struct.std::ios_base::_Words" = type { i8*, i64 } +%"struct.std::locale" = type { %"struct.std::locale::_Impl"* } +%"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i64, %"struct.std::locale::facet"**, i8** } +%"struct.std::locale::facet" = type { i32 (...)**, i32 } +%"struct.std::locale::facet.base.64" = type { i32 (...)**, i32 } +%"struct.std::num_get > >" = type { %"struct.std::locale::facet" } +%"struct.std::num_put > >" = type { %"struct.std::locale::facet" } +%"struct.std::type_info" = type { i32 (...)**, i8* } +%union.pthread_attr_t = type { i64, [12 x i32] } +%union.pthread_mutex_t = type { %struct..0__pthread_mutex_s } +%union.pthread_mutexattr_t = type { i32 } + + at ob = internal global %struct.BaseClass zeroinitializer ; <%struct.BaseClass*> [#uses=2] + at derivedObject1 = internal global %struct.DerivedClass1 zeroinitializer ; <%struct.DerivedClass1*> [#uses=2] + at derivedObject2 = internal global %struct.DerivedClass2 zeroinitializer ; <%struct.DerivedClass2*> [#uses=2] + at _ZSt4cout = external global %"struct.std::basic_ostream >" ; <%"struct.std::basic_ostream >"*> [#uses=3] + at .str = private constant [41 x i8] c"Using BaseClass version of myFunction()\0A\00", align 8 ; <[41 x i8]*> [#uses=1] + at .str1 = private constant [47 x i8] c"Using DerivedClass1's version of myFunction()\0A\00", align 8 ; <[47 x i8]*> [#uses=1] + at .str2 = private constant [47 x i8] c"Using DerivedClass2's version of myFunction()\0A\00", align 8 ; <[47 x i8]*> [#uses=1] + at _ZTV9BaseClass = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__class_type_info_pseudo* @_ZTI9BaseClass to i32 (...)*), i32 (...)* bitcast (void (%struct.BaseClass*)* @_ZN9BaseClass10myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI9BaseClass = internal constant %struct.__class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv117__class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([11 x i8]* @_ZTS9BaseClass, i64 0, i64 0) } }, align 16 ; <%struct.__class_type_info_pseudo*> [#uses=2] + at _ZTVN10__cxxabiv117__class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1] + at _ZTS9BaseClass = internal constant [11 x i8] c"9BaseClass\00" ; <[11 x i8]*> [#uses=1] + at _ZTV13DerivedClass1 = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass1 to i32 (...)*), i32 (...)* bitcast (void (%struct.DerivedClass1*)* @_ZN13DerivedClass110myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI13DerivedClass1 = internal constant %struct.__si_class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv120__si_class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([16 x i8]* @_ZTS13DerivedClass1, i64 0, i64 0) }, %"struct.std::type_info"* bitcast (%struct.__class_type_info_pseudo* @_ZTI9BaseClass to %"struct.std::type_info"*) }, align 16 ; <%struct.__si_class_type_info_pseudo*> [#uses=2] + at _ZTVN10__cxxabiv120__si_class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1] + at _ZTS13DerivedClass1 = internal constant [16 x i8] c"13DerivedClass1\00", align 16 ; <[16 x i8]*> [#uses=1] + at _ZTV13DerivedClass2 = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass2 to i32 (...)*), i32 (...)* bitcast (void (%struct.DerivedClass2*)* @_ZN13DerivedClass210myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI13DerivedClass2 = internal constant %struct.__si_class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv120__si_class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([16 x i8]* @_ZTS13DerivedClass2, i64 0, i64 0) }, %"struct.std::type_info"* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass1 to %"struct.std::type_info"*) }, align 16 ; <%struct.__si_class_type_info_pseudo*> [#uses=1] + at _ZTS13DerivedClass2 = internal constant [16 x i8] c"13DerivedClass2\00", align 16 ; <[16 x i8]*> [#uses=1] + at _ZStL8__ioinit = internal global %"struct.std::ios_base::Init" zeroinitializer ; <%"struct.std::ios_base::Init"*> [#uses=2] + at __dso_handle = external global i8* ; [#uses=1] + at llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_ob }] ; <[1 x %0]*> [#uses=0] + + at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0] + at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0] + at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0] + at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0] + at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0] + at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0] + at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init ; [#uses=0] + at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0] + at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0] + at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy ; [#uses=0] + +define internal void @_GLOBAL__I_ob() { +entry: + call void @_Z41__static_initialization_and_destruction_0ii(i32 1, i32 65535) + br label %return + +return: ; preds = %entry + ret void +} + +define internal %struct.BaseClass* @_Z4initi(i32 %i) nounwind { +entry: + %i_addr = alloca i32 ; [#uses=4] + %retval = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %0 = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=4] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %i, i32* %i_addr + %1 = load i32* %i_addr, align 4 ; [#uses=1] + %2 = icmp eq i32 %1, 1 ; [#uses=1] + br i1 %2, label %bb, label %bb1 + +bb: ; preds = %entry + store %struct.BaseClass* @ob, %struct.BaseClass** %0, align 8 + br label %bb6 + +bb1: ; preds = %entry + %3 = load i32* %i_addr, align 4 ; [#uses=1] + %4 = icmp eq i32 %3, 2 ; [#uses=1] + br i1 %4, label %bb2, label %bb3 + +bb2: ; preds = %bb1 + store %struct.BaseClass* getelementptr inbounds (%struct.DerivedClass1* @derivedObject1, i64 0, i32 0), %struct.BaseClass** %0, align 8 + br label %bb6 + +bb3: ; preds = %bb1 + %5 = load i32* %i_addr, align 4 ; [#uses=1] + %6 = icmp eq i32 %5, 3 ; [#uses=1] + br i1 %6, label %bb4, label %bb5 + +bb4: ; preds = %bb3 + store %struct.BaseClass* getelementptr inbounds (%struct.DerivedClass2* @derivedObject2, i64 0, i32 0, i32 0), %struct.BaseClass** %0, align 8 + br label %bb6 + +bb5: ; preds = %bb3 + br label %return + +bb6: ; preds = %bb4, %bb2, %bb + %7 = load %struct.BaseClass** %0, align 8 ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %7, %struct.BaseClass** %retval, align 8 + br label %return + +return: ; preds = %bb6, %bb5 + %retval7 = load %struct.BaseClass** %retval ; <%struct.BaseClass*> [#uses=1] + ret %struct.BaseClass* %retval7 +} + +define i32 @main() { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %p = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=9] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = call %struct.BaseClass* @_Z4initi(i32 2) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %1, %struct.BaseClass** %p, align 8 + %2 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %3 = getelementptr inbounds %struct.BaseClass* %2, i32 0, i32 0 ; [#uses=1] + %4 = load i32 (...)*** %3, align 8 ; [#uses=1] + %5 = getelementptr inbounds i32 (...)** %4, i64 0 ; [#uses=1] + %6 = load i32 (...)** %5, align 1 ; [#uses=1] + %7 = bitcast i32 (...)* %6 to void (%struct.BaseClass*)* ; [#uses=1] + %8 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %7(%struct.BaseClass* %8) + %9 = call %struct.BaseClass* @_Z4initi(i32 3) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %9, %struct.BaseClass** %p, align 8 + %10 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %11 = getelementptr inbounds %struct.BaseClass* %10, i32 0, i32 0 ; [#uses=1] + %12 = load i32 (...)*** %11, align 8 ; [#uses=1] + %13 = getelementptr inbounds i32 (...)** %12, i64 0 ; [#uses=1] + %14 = load i32 (...)** %13, align 1 ; [#uses=1] + %15 = bitcast i32 (...)* %14 to void (%struct.BaseClass*)* ; [#uses=1] + %16 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %15(%struct.BaseClass* %16) + %17 = call %struct.BaseClass* @_Z4initi(i32 4) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %17, %struct.BaseClass** %p, align 8 + %18 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %19 = getelementptr inbounds %struct.BaseClass* %18, i32 0, i32 0 ; [#uses=1] + %20 = load i32 (...)*** %19, align 8 ; [#uses=1] + %21 = getelementptr inbounds i32 (...)** %20, i64 0 ; [#uses=1] + %22 = load i32 (...)** %21, align 1 ; [#uses=1] + %23 = bitcast i32 (...)* %22 to void (%struct.BaseClass*)* ; [#uses=1] + %24 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %23(%struct.BaseClass* %24) + store i32 0, i32* %0, align 4 + %25 = load i32* %0, align 4 ; [#uses=1] + store i32 %25, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} + +define internal void @_ZN9BaseClass10myFunctionEv(%struct.BaseClass* %this) align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([41 x i8]* @.str, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +declare %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"*, i8*) + +define internal void @_ZN13DerivedClass110myFunctionEv(%struct.DerivedClass1* %this) align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([47 x i8]* @.str1, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass210myFunctionEv(%struct.DerivedClass2* %this) align 2 { +entry: + %this_addr = alloca %struct.DerivedClass2* ; <%struct.DerivedClass2**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass2* %this, %struct.DerivedClass2** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([47 x i8]* @.str2, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClassC2Ev(%struct.BaseClass* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = load %struct.BaseClass** %this_addr, align 8 ; <%struct.BaseClass*> [#uses=1] + %1 = getelementptr inbounds %struct.BaseClass* %0, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV9BaseClass, i64 0, i64 2), i32 (...)*** %1, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClassC1Ev(%struct.BaseClass* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = load %struct.BaseClass** %this_addr, align 8 ; <%struct.BaseClass*> [#uses=1] + %1 = getelementptr inbounds %struct.BaseClass* %0, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV9BaseClass, i64 0, i64 2), i32 (...)*** %1, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass1C2Ev(%struct.DerivedClass1* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass1* %0, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + call void @_ZN9BaseClassC2Ev(%struct.BaseClass* %1) nounwind + %2 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass1* %2, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %4 = getelementptr inbounds %struct.BaseClass* %3, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass1, i64 0, i64 2), i32 (...)*** %4, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass1C1Ev(%struct.DerivedClass1* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass1* %0, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + call void @_ZN9BaseClassC2Ev(%struct.BaseClass* %1) nounwind + %2 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass1* %2, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %4 = getelementptr inbounds %struct.BaseClass* %3, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass1, i64 0, i64 2), i32 (...)*** %4, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass2C1Ev(%struct.DerivedClass2* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass2* ; <%struct.DerivedClass2**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass2* %this, %struct.DerivedClass2** %this_addr + %0 = load %struct.DerivedClass2** %this_addr, align 8 ; <%struct.DerivedClass2*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass2* %0, i32 0, i32 0 ; <%struct.DerivedClass1*> [#uses=1] + call void @_ZN13DerivedClass1C2Ev(%struct.DerivedClass1* %1) nounwind + %2 = load %struct.DerivedClass2** %this_addr, align 8 ; <%struct.DerivedClass2*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass2* %2, i32 0, i32 0 ; <%struct.DerivedClass1*> [#uses=1] + %4 = getelementptr inbounds %struct.DerivedClass1* %3, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %5 = getelementptr inbounds %struct.BaseClass* %4, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass2, i64 0, i64 2), i32 (...)*** %5, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_Z41__static_initialization_and_destruction_0ii(i32 %__initialize_p, i32 %__priority) { +entry: + %__initialize_p_addr = alloca i32 ; [#uses=2] + %__priority_addr = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %__initialize_p, i32* %__initialize_p_addr + store i32 %__priority, i32* %__priority_addr + %0 = load i32* %__initialize_p_addr, align 4 ; [#uses=1] + %1 = icmp eq i32 %0, 1 ; [#uses=1] + br i1 %1, label %bb, label %bb2 + +bb: ; preds = %entry + %2 = load i32* %__priority_addr, align 4 ; [#uses=1] + %3 = icmp eq i32 %2, 65535 ; [#uses=1] + br i1 %3, label %bb1, label %bb2 + +bb1: ; preds = %bb + call void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ios_base::Init"* @_ZStL8__ioinit) + %4 = call i32 @__cxa_atexit(void (i8*)* @__tcf_0, i8* null, i8* bitcast (i8** @__dso_handle to i8*)) nounwind ; [#uses=0] + call void @_ZN9BaseClassC1Ev(%struct.BaseClass* @ob) nounwind + call void @_ZN13DerivedClass1C1Ev(%struct.DerivedClass1* @derivedObject1) nounwind + call void @_ZN13DerivedClass2C1Ev(%struct.DerivedClass2* @derivedObject2) nounwind + br label %bb2 + +bb2: ; preds = %bb1, %bb, %entry + br label %return + +return: ; preds = %bb2 + ret void +} + +declare void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ios_base::Init"*) + +declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) nounwind + +define internal void @__tcf_0(i8* %unnamed_arg) { +entry: + %unnamed_arg_addr = alloca i8* ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i8* %unnamed_arg, i8** %unnamed_arg_addr + call void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ios_base::Init"* @_ZStL8__ioinit) + br label %return + +return: ; preds = %entry + ret void +} + +declare void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ios_base::Init"*) + +declare extern_weak i32 @pthread_once(i32*, void ()*) + +declare extern_weak i8* @pthread_getspecific(i32) + +declare extern_weak i32 @pthread_setspecific(i32, i8*) + +declare extern_weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) + +declare extern_weak i32 @pthread_cancel(i64) + +declare extern_weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*) + +declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) + +declare extern_weak i32 @pthread_key_delete(i32) + +declare extern_weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*) + +declare extern_weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32) + +declare extern_weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*) Added: poolalloc/trunk/test/dsa/callgraph/inheritance3.ll URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/inheritance3.ll?rev=116821&view=auto ============================================================================== --- poolalloc/trunk/test/dsa/callgraph/inheritance3.ll (added) +++ poolalloc/trunk/test/dsa/callgraph/inheritance3.ll Tue Oct 19 12:31:35 2010 @@ -0,0 +1,328 @@ +;RUN: dsaopt %s -dsa-cbu -analyze -check-callees=main,_ZN9BaseClass10myFunctionEv,_ZN13DerivedClass110myFunctionEv,_Z4initi +;RUN: dsaopt %s -dsa-cbu -analyze -check-callees=_Z4funcv,_ZN9BaseClass10myFunctionEv,_ZN13DerivedClass110myFunctionEv,_Z4initi + +; ModuleID = 'inheritance3.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" + +%0 = type { i32, void ()* } +%struct..0__pthread_mutex_s = type { i32, i32, i32, i32, i32, i32, %struct.__pthread_list_t } +%struct.BaseClass = type { i32 (...)** } +%struct.DerivedClass1 = type { %struct.BaseClass } +%struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo } +%struct.__locale_struct = type { [13 x %struct.locale_data*], i16*, i32*, i32*, [13 x i8*] } +%struct.__pthread_list_t = type { %struct.__pthread_list_t*, %struct.__pthread_list_t* } +%struct.__si_class_type_info_pseudo = type { %struct.__type_info_pseudo, %"struct.std::type_info"* } +%struct.__type_info_pseudo = type { i8*, i8* } +%struct.locale_data = type opaque +%"struct.std::basic_ios >" = type { %"struct.std::ios_base", %"struct.std::basic_ostream >"*, i8, i8, %"struct.std::basic_streambuf >"*, %"struct.std::ctype"*, %"struct.std::num_get > >"*, %"struct.std::num_get > >"* } +%"struct.std::basic_ostream >" = type { i32 (...)**, %"struct.std::basic_ios >" } +%"struct.std::basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %"struct.std::locale" } +%"struct.std::ctype" = type { %"struct.std::locale::facet", %struct.__locale_struct*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 } +%"struct.std::ios_base" = type { i32 (...)**, i64, i64, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"struct.std::locale" } +%"struct.std::ios_base::Init" = type <{ i8 }> +%"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"struct.std::ios_base"*, i32)*, i32, i32 } +%"struct.std::ios_base::_Words" = type { i8*, i64 } +%"struct.std::locale" = type { %"struct.std::locale::_Impl"* } +%"struct.std::locale::_Impl" = type { i32, %"struct.std::locale::facet"**, i64, %"struct.std::locale::facet"**, i8** } +%"struct.std::locale::facet" = type { i32 (...)**, i32 } +%"struct.std::locale::facet.base.64" = type { i32 (...)**, i32 } +%"struct.std::num_get > >" = type { %"struct.std::locale::facet" } +%"struct.std::num_put > >" = type { %"struct.std::locale::facet" } +%"struct.std::type_info" = type { i32 (...)**, i8* } +%union.pthread_attr_t = type { i64, [12 x i32] } +%union.pthread_mutex_t = type { %struct..0__pthread_mutex_s } +%union.pthread_mutexattr_t = type { i32 } + + at ob = internal global %struct.BaseClass zeroinitializer ; <%struct.BaseClass*> [#uses=2] + at derivedObject1 = internal global %struct.DerivedClass1 zeroinitializer ; <%struct.DerivedClass1*> [#uses=2] + at _ZSt4cout = external global %"struct.std::basic_ostream >" ; <%"struct.std::basic_ostream >"*> [#uses=2] + at .str = private constant [41 x i8] c"Using BaseClass version of myFunction()\0A\00", align 8 ; <[41 x i8]*> [#uses=1] + at .str1 = private constant [47 x i8] c"Using DerivedClass1's version of myFunction()\0A\00", align 8 ; <[47 x i8]*> [#uses=1] + at _ZTV9BaseClass = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__class_type_info_pseudo* @_ZTI9BaseClass to i32 (...)*), i32 (...)* bitcast (void (%struct.BaseClass*)* @_ZN9BaseClass10myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI9BaseClass = internal constant %struct.__class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv117__class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([11 x i8]* @_ZTS9BaseClass, i64 0, i64 0) } }, align 16 ; <%struct.__class_type_info_pseudo*> [#uses=2] + at _ZTVN10__cxxabiv117__class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1] + at _ZTS9BaseClass = internal constant [11 x i8] c"9BaseClass\00" ; <[11 x i8]*> [#uses=1] + at _ZTV13DerivedClass1 = internal constant [3 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI13DerivedClass1 to i32 (...)*), i32 (...)* bitcast (void (%struct.DerivedClass1*)* @_ZN13DerivedClass110myFunctionEv to i32 (...)*)], align 16 ; <[3 x i32 (...)*]*> [#uses=1] + at _ZTI13DerivedClass1 = internal constant %struct.__si_class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv120__si_class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([16 x i8]* @_ZTS13DerivedClass1, i64 0, i64 0) }, %"struct.std::type_info"* bitcast (%struct.__class_type_info_pseudo* @_ZTI9BaseClass to %"struct.std::type_info"*) }, align 16 ; <%struct.__si_class_type_info_pseudo*> [#uses=1] + at _ZTVN10__cxxabiv120__si_class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1] + at _ZTS13DerivedClass1 = internal constant [16 x i8] c"13DerivedClass1\00", align 16 ; <[16 x i8]*> [#uses=1] + at _ZStL8__ioinit = internal global %"struct.std::ios_base::Init" zeroinitializer ; <%"struct.std::ios_base::Init"*> [#uses=2] + at __dso_handle = external global i8* ; [#uses=1] + at llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_ob }] ; <[1 x %0]*> [#uses=0] + + at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0] + at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0] + at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0] + at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0] + at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0] + at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0] + at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0] + at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init ; [#uses=0] + at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0] + at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0] + at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype ; [#uses=0] + at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy ; [#uses=0] + +define internal void @_GLOBAL__I_ob() { +entry: + call void @_Z41__static_initialization_and_destruction_0ii(i32 1, i32 65535) + br label %return + +return: ; preds = %entry + ret void +} + +define internal %struct.BaseClass* @_Z4initi(i32 %i) nounwind { +entry: + %i_addr = alloca i32 ; [#uses=3] + %retval = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %0 = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %i, i32* %i_addr + %1 = load i32* %i_addr, align 4 ; [#uses=1] + %2 = icmp eq i32 %1, 1 ; [#uses=1] + br i1 %2, label %bb, label %bb1 + +bb: ; preds = %entry + store %struct.BaseClass* @ob, %struct.BaseClass** %0, align 8 + br label %bb4 + +bb1: ; preds = %entry + %3 = load i32* %i_addr, align 4 ; [#uses=1] + %4 = icmp eq i32 %3, 2 ; [#uses=1] + br i1 %4, label %bb2, label %bb3 + +bb2: ; preds = %bb1 + store %struct.BaseClass* getelementptr inbounds (%struct.DerivedClass1* @derivedObject1, i64 0, i32 0), %struct.BaseClass** %0, align 8 + br label %bb4 + +bb3: ; preds = %bb1 + br label %return + +bb4: ; preds = %bb2, %bb + %5 = load %struct.BaseClass** %0, align 8 ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %5, %struct.BaseClass** %retval, align 8 + br label %return + +return: ; preds = %bb4, %bb3 + %retval5 = load %struct.BaseClass** %retval ; <%struct.BaseClass*> [#uses=1] + ret %struct.BaseClass* %retval5 +} + +define internal void @_Z4funcv() { +entry: + %p = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %0 = call %struct.BaseClass* @_Z4initi(i32 2) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %0, %struct.BaseClass** %p, align 8 + %1 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %2 = getelementptr inbounds %struct.BaseClass* %1, i32 0, i32 0 ; [#uses=1] + %3 = load i32 (...)*** %2, align 8 ; [#uses=1] + %4 = getelementptr inbounds i32 (...)** %3, i64 0 ; [#uses=1] + %5 = load i32 (...)** %4, align 1 ; [#uses=1] + %6 = bitcast i32 (...)* %5 to void (%struct.BaseClass*)* ; [#uses=1] + %7 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %6(%struct.BaseClass* %7) + br label %return + +return: ; preds = %entry + ret void +} + +define i32 @main() { +entry: + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %p = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=9] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %1 = call %struct.BaseClass* @_Z4initi(i32 2) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %1, %struct.BaseClass** %p, align 8 + %2 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %3 = getelementptr inbounds %struct.BaseClass* %2, i32 0, i32 0 ; [#uses=1] + %4 = load i32 (...)*** %3, align 8 ; [#uses=1] + %5 = getelementptr inbounds i32 (...)** %4, i64 0 ; [#uses=1] + %6 = load i32 (...)** %5, align 1 ; [#uses=1] + %7 = bitcast i32 (...)* %6 to void (%struct.BaseClass*)* ; [#uses=1] + %8 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %7(%struct.BaseClass* %8) + %9 = call %struct.BaseClass* @_Z4initi(i32 3) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %9, %struct.BaseClass** %p, align 8 + %10 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %11 = getelementptr inbounds %struct.BaseClass* %10, i32 0, i32 0 ; [#uses=1] + %12 = load i32 (...)*** %11, align 8 ; [#uses=1] + %13 = getelementptr inbounds i32 (...)** %12, i64 0 ; [#uses=1] + %14 = load i32 (...)** %13, align 1 ; [#uses=1] + %15 = bitcast i32 (...)* %14 to void (%struct.BaseClass*)* ; [#uses=1] + %16 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %15(%struct.BaseClass* %16) + %17 = call %struct.BaseClass* @_Z4initi(i32 4) nounwind ; <%struct.BaseClass*> [#uses=1] + store %struct.BaseClass* %17, %struct.BaseClass** %p, align 8 + %18 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + %19 = getelementptr inbounds %struct.BaseClass* %18, i32 0, i32 0 ; [#uses=1] + %20 = load i32 (...)*** %19, align 8 ; [#uses=1] + %21 = getelementptr inbounds i32 (...)** %20, i64 0 ; [#uses=1] + %22 = load i32 (...)** %21, align 1 ; [#uses=1] + %23 = bitcast i32 (...)* %22 to void (%struct.BaseClass*)* ; [#uses=1] + %24 = load %struct.BaseClass** %p, align 8 ; <%struct.BaseClass*> [#uses=1] + call void %23(%struct.BaseClass* %24) + call void @_Z4funcv() + store i32 0, i32* %0, align 4 + %25 = load i32* %0, align 4 ; [#uses=1] + store i32 %25, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + ret i32 %retval1 +} + +define internal void @_ZN9BaseClass10myFunctionEv(%struct.BaseClass* %this) align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([41 x i8]* @.str, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +declare %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"*, i8*) + +define internal void @_ZN13DerivedClass110myFunctionEv(%struct.DerivedClass1* %this) align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = call %"struct.std::basic_ostream >"* @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"struct.std::basic_ostream >"* @_ZSt4cout, i8* getelementptr inbounds ([47 x i8]* @.str1, i64 0, i64 0)) ; <%"struct.std::basic_ostream >"*> [#uses=0] + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClassC2Ev(%struct.BaseClass* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = load %struct.BaseClass** %this_addr, align 8 ; <%struct.BaseClass*> [#uses=1] + %1 = getelementptr inbounds %struct.BaseClass* %0, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV9BaseClass, i64 0, i64 2), i32 (...)*** %1, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN9BaseClassC1Ev(%struct.BaseClass* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.BaseClass* ; <%struct.BaseClass**> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.BaseClass* %this, %struct.BaseClass** %this_addr + %0 = load %struct.BaseClass** %this_addr, align 8 ; <%struct.BaseClass*> [#uses=1] + %1 = getelementptr inbounds %struct.BaseClass* %0, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV9BaseClass, i64 0, i64 2), i32 (...)*** %1, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_ZN13DerivedClass1C1Ev(%struct.DerivedClass1* %this) nounwind align 2 { +entry: + %this_addr = alloca %struct.DerivedClass1* ; <%struct.DerivedClass1**> [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store %struct.DerivedClass1* %this, %struct.DerivedClass1** %this_addr + %0 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %1 = getelementptr inbounds %struct.DerivedClass1* %0, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + call void @_ZN9BaseClassC2Ev(%struct.BaseClass* %1) nounwind + %2 = load %struct.DerivedClass1** %this_addr, align 8 ; <%struct.DerivedClass1*> [#uses=1] + %3 = getelementptr inbounds %struct.DerivedClass1* %2, i32 0, i32 0 ; <%struct.BaseClass*> [#uses=1] + %4 = getelementptr inbounds %struct.BaseClass* %3, i32 0, i32 0 ; [#uses=1] + store i32 (...)** getelementptr inbounds ([3 x i32 (...)*]* @_ZTV13DerivedClass1, i64 0, i64 2), i32 (...)*** %4, align 8 + br label %return + +return: ; preds = %entry + ret void +} + +define internal void @_Z41__static_initialization_and_destruction_0ii(i32 %__initialize_p, i32 %__priority) { +entry: + %__initialize_p_addr = alloca i32 ; [#uses=2] + %__priority_addr = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %__initialize_p, i32* %__initialize_p_addr + store i32 %__priority, i32* %__priority_addr + %0 = load i32* %__initialize_p_addr, align 4 ; [#uses=1] + %1 = icmp eq i32 %0, 1 ; [#uses=1] + br i1 %1, label %bb, label %bb2 + +bb: ; preds = %entry + %2 = load i32* %__priority_addr, align 4 ; [#uses=1] + %3 = icmp eq i32 %2, 65535 ; [#uses=1] + br i1 %3, label %bb1, label %bb2 + +bb1: ; preds = %bb + call void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ios_base::Init"* @_ZStL8__ioinit) + %4 = call i32 @__cxa_atexit(void (i8*)* @__tcf_0, i8* null, i8* bitcast (i8** @__dso_handle to i8*)) nounwind ; [#uses=0] + call void @_ZN9BaseClassC1Ev(%struct.BaseClass* @ob) nounwind + call void @_ZN13DerivedClass1C1Ev(%struct.DerivedClass1* @derivedObject1) nounwind + br label %bb2 + +bb2: ; preds = %bb1, %bb, %entry + br label %return + +return: ; preds = %bb2 + ret void +} + +declare void @_ZNSt8ios_base4InitC1Ev(%"struct.std::ios_base::Init"*) + +declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) nounwind + +define internal void @__tcf_0(i8* %unnamed_arg) { +entry: + %unnamed_arg_addr = alloca i8* ; [#uses=1] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i8* %unnamed_arg, i8** %unnamed_arg_addr + call void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ios_base::Init"* @_ZStL8__ioinit) + br label %return + +return: ; preds = %entry + ret void +} + +declare void @_ZNSt8ios_base4InitD1Ev(%"struct.std::ios_base::Init"*) + +declare extern_weak i32 @pthread_once(i32*, void ()*) + +declare extern_weak i8* @pthread_getspecific(i32) + +declare extern_weak i32 @pthread_setspecific(i32, i8*) + +declare extern_weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) + +declare extern_weak i32 @pthread_cancel(i64) + +declare extern_weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*) + +declare extern_weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*) + +declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) + +declare extern_weak i32 @pthread_key_delete(i32) + +declare extern_weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*) + +declare extern_weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32) + +declare extern_weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*) From bigcheesegs at gmail.com Tue Oct 19 12:39:55 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Tue, 19 Oct 2010 13:39:55 -0400 Subject: [llvm-commits] [llvm] r116682 - in /llvm/trunk: cmake/modules/LLVMProcessSources.cmake examples/ExceptionDemo/CMakeLists.txt examples/Kaleidoscope/Chapter7/CMakeLists.txt lib/Support/CMakeLists.txt lib/System/CMakeLists.txt lib/VMCore/CMakeLists. Message-ID: On Sat, Oct 16, 2010 at 10:26 PM, Oscar Fuentes wrote: > Author: ofv > Date: Sat Oct 16 21:26:16 2010 > New Revision: 116682 > > URL: http://llvm.org/viewvc/llvm-project?rev=116682&view=rev > Log: > Build with RTTI and exceptions disabled. Only in GCC for now. > > Modified: > ? ?llvm/trunk/cmake/modules/LLVMProcessSources.cmake > ? ?llvm/trunk/examples/ExceptionDemo/CMakeLists.txt > ? ?llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt > ? ?llvm/trunk/lib/Support/CMakeLists.txt > ? ?llvm/trunk/lib/System/CMakeLists.txt > ? ?llvm/trunk/lib/VMCore/CMakeLists.txt > ? ?llvm/trunk/utils/TableGen/CMakeLists.txt > ? ?llvm/trunk/utils/unittest/CMakeLists.txt > > Modified: llvm/trunk/cmake/modules/LLVMProcessSources.cmake > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMProcessSources.cmake?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/cmake/modules/LLVMProcessSources.cmake (original) > +++ llvm/trunk/cmake/modules/LLVMProcessSources.cmake Sat Oct 16 21:26:16 2010 > @@ -36,6 +36,19 @@ > ? ? add_td_sources(sources) > ? ? add_header_files(sources) > ? endif() > + > + ?# Set common compiler options: > + ?if( NOT LLVM_REQUIRES_EH ) > + ? ?if( CMAKE_COMPILER_IS_GNUCXX ) > + ? ? ?add_definitions( -fno-exceptions ) > + ? ?endif() > + ?endif() > + ?if( NOT LLVM_REQUIRES_RTTI ) > + ? ?if( CMAKE_COMPILER_IS_GNUCXX ) > + ? ? ?add_definitions( -fno-rtti ) > + ? ?endif() > + ?endif() > + > ? set( ${OUT_VAR} ${sources} PARENT_SCOPE ) > ?endfunction(llvm_process_sources) > > > Modified: llvm/trunk/examples/ExceptionDemo/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/examples/ExceptionDemo/CMakeLists.txt (original) > +++ llvm/trunk/examples/ExceptionDemo/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -1,4 +1,5 @@ > ?set(LLVM_LINK_COMPONENTS jit nativecodegen) > +set(LLVM_REQUIRES_EH 1) > > ?add_llvm_example(ExceptionDemo > ? ExceptionDemo.cpp > > Modified: llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt (original) > +++ llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -1,4 +1,5 @@ > ?set(LLVM_LINK_COMPONENTS core jit interpreter native) > +set(LLVM_REQUIRES_RTTI 1) > > ?add_llvm_example(Kaleidoscope-Ch7 > ? toy.cpp > > Modified: llvm/trunk/lib/Support/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/lib/Support/CMakeLists.txt (original) > +++ llvm/trunk/lib/Support/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -1,3 +1,6 @@ > +## FIXME: This only requires RTTI because tblgen uses it. ?Fix that. > +set(LLVM_REQUIRES_RTTI 1) > + > ?add_llvm_library(LLVMSupport > ? APFloat.cpp > ? APInt.cpp > > Modified: llvm/trunk/lib/System/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/lib/System/CMakeLists.txt (original) > +++ llvm/trunk/lib/System/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -1,3 +1,8 @@ > +set(LLVM_REQUIRES_RTTI 1) > +if( MINGW ) > + ?set(LLVM_REQUIRES_EH 1) > +endif() > + > ?add_llvm_library(LLVMSystem > ? Alarm.cpp > ? Atomic.cpp > > Modified: llvm/trunk/lib/VMCore/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/lib/VMCore/CMakeLists.txt (original) > +++ llvm/trunk/lib/VMCore/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -1,3 +1,5 @@ > +set(LLVM_REQUIRES_RTTI 1) > + > ?add_llvm_library(LLVMCore > ? AsmWriter.cpp > ? Attributes.cpp > > Modified: llvm/trunk/utils/TableGen/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/utils/TableGen/CMakeLists.txt (original) > +++ llvm/trunk/utils/TableGen/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -1,3 +1,6 @@ > +set(LLVM_REQUIRES_EH 1) > +set(LLVM_REQUIRES_RTTI 1) > + > ?add_executable(tblgen > ? ARMDecoderEmitter.cpp > ? AsmMatcherEmitter.cpp > > Modified: llvm/trunk/utils/unittest/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff > ============================================================================== > --- llvm/trunk/utils/unittest/CMakeLists.txt (original) > +++ llvm/trunk/utils/unittest/CMakeLists.txt Sat Oct 16 21:26:16 2010 > @@ -24,6 +24,12 @@ > ? add_definitions("-Wno-variadic-macros") > ?endif() > > +set(LLVM_REQUIRES_RTTI 1) > +add_definitions( -DGTEST_HAS_RTTI=0 ) > +# libstdc++'s TR1 header depends on RTTI and uses C++'0x features not > +# supported by Clang, so force googletest to use its own tuple implementation. > +add_definitions( -DGTEST_USE_OWN_TR1_TUPLE ) This breaks the build on VS2010. I handle tuple header selection inside the header files where I actually have access to the compiler version and other assorted macros needed to figure this out. - Michael Spencer > + > ?add_llvm_library(gtest > ? googletest/gtest.cc > ? googletest/gtest-death-test.cc > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From jason.w.kim.2009 at gmail.com Tue Oct 19 12:39:10 2010 From: jason.w.kim.2009 at gmail.com (Jason W Kim) Date: Tue, 19 Oct 2010 17:39:10 -0000 Subject: [llvm-commits] [llvm] r116823 - in /llvm/trunk/test: MC/ELF/ Scripts/ Message-ID: <20101019173910.A90842A6C12C@llvm.org> Author: jasonwkim Date: Tue Oct 19 12:39:10 2010 New Revision: 116823 URL: http://llvm.org/viewvc/llvm-project?rev=116823&view=rev Log: Fixing r116753 r116756 r116777 The failures in r116753 r116756 were caused by a python issue - Python likes to append 'L' suffix to stringified numbers if the number is larger than a machine int. Unfortunately, this causes a divergence of behavior between 32 and 64 bit python versions. I re-crafted elf-dump/common_dump to take care of these issues by: 1. always printing 0x (makes for easy sed/regex) 2. always print fixed length (exactly 2 + numBits/4 digits long) by mod ((2^numBits) - 1) 3. left-padded with '0' There is a residual common routine that is also used by macho-dump (dataToHex) , so I left the 'section_data' test values alone. Modified: llvm/trunk/test/MC/ELF/alias.s llvm/trunk/test/MC/ELF/align-bss.s llvm/trunk/test/MC/ELF/align-nops.s llvm/trunk/test/MC/ELF/align-size.s llvm/trunk/test/MC/ELF/align-text.s llvm/trunk/test/MC/ELF/align.s llvm/trunk/test/MC/ELF/basic-elf.ll llvm/trunk/test/MC/ELF/common.s llvm/trunk/test/MC/ELF/common2.s llvm/trunk/test/MC/ELF/diff.s llvm/trunk/test/MC/ELF/empty.s llvm/trunk/test/MC/ELF/entsize.ll llvm/trunk/test/MC/ELF/entsize.s llvm/trunk/test/MC/ELF/file.s llvm/trunk/test/MC/ELF/got.s llvm/trunk/test/MC/ELF/local-reloc.s llvm/trunk/test/MC/ELF/merge.s llvm/trunk/test/MC/ELF/norelocation.s llvm/trunk/test/MC/ELF/pic-diff.s llvm/trunk/test/MC/ELF/plt.s llvm/trunk/test/MC/ELF/relax.s llvm/trunk/test/MC/ELF/relocation-386.s llvm/trunk/test/MC/ELF/relocation.s llvm/trunk/test/MC/ELF/section.s llvm/trunk/test/MC/ELF/size.s llvm/trunk/test/MC/ELF/sleb.s llvm/trunk/test/MC/ELF/uleb.s llvm/trunk/test/MC/ELF/undef.s llvm/trunk/test/MC/ELF/undef2.s llvm/trunk/test/MC/ELF/weak.s llvm/trunk/test/MC/ELF/zero.s llvm/trunk/test/Scripts/common_dump.py llvm/trunk/test/Scripts/elf-dump Modified: llvm/trunk/test/MC/ELF/alias.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/alias.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/alias.s (original) +++ llvm/trunk/test/MC/ELF/alias.s Tue Oct 19 12:39:10 2010 @@ -15,70 +15,70 @@ foo4: bar4 = foo4 -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 5) # 'bar' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x00000001 +// CHECK-NEXT: (('st_name', 0x00000005) # 'bar' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 2 -// CHECK-NEXT: (('st_name', 29) # 'bar4' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 2) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000002 +// CHECK-NEXT: (('st_name', 0x0000001d) # 'bar4' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000002) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 3 -// CHECK-NEXT: (('st_name', 1) # 'foo' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000003 +// CHECK-NEXT: (('st_name', 0x00000001) # 'foo' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 4 -// CHECK-NEXT: (('st_name', 14) # 'foo3' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000004 +// CHECK-NEXT: (('st_name', 0x0000000e) # 'foo3' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 5 -// CHECK-NEXT: (('st_name', 24) # 'foo4' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 2) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000005 +// CHECK-NEXT: (('st_name', 0x00000018) # 'foo4' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000002) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 6 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 7 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 8 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 9 -// CHECK-NEXT: (('st_name', 19) # 'bar3' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) -// CHECK: # Symbol 10 -// CHECK-NEXT: (('st_name', 9) # 'bar2' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 0) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000006 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000007 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000008 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000009 +// CHECK-NEXT: (('st_name', 0x00000013) # 'bar3' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK: # Symbol 0x0000000a +// CHECK-NEXT: (('st_name', 0x00000009) # 'bar2' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) Modified: llvm/trunk/test/MC/ELF/align-bss.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-bss.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-bss.s (original) +++ llvm/trunk/test/MC/ELF/align-bss.s Tue Oct 19 12:39:10 2010 @@ -5,13 +5,13 @@ .local foo .comm foo,2048,16 -// CHECK: ('sh_name', 13) # '.bss' -// CHECK-NEXT: ('sh_type', 8) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 2048) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 16) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x0000000d) # '.bss' +// CHECK-NEXT: ('sh_type', 0x00000008) +// CHECK-NEXT: ('sh_flags', 0x00000003) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000800) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000010) +// CHECK-NEXT: ('sh_entsize', 0x00000000) Modified: llvm/trunk/test/MC/ELF/align-nops.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-nops.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-nops.s (original) +++ llvm/trunk/test/MC/ELF/align-nops.s Tue Oct 19 12:39:10 2010 @@ -4,37 +4,37 @@ .text f0: .long 0 - .align 8, 0x90 + .align 8, 0x00000090 .long 0 .align 8 // But not in another section .data .long 0 - .align 8, 0x90 + .align 8, 0x00000090 .long 0 .align 8 -// CHECK: (('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) +// CHECK: (('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: ('sh_size', 0x00000010) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000008) +// CHECK-NEXT: ('sh_entsize', 0x00000000) // CHECK-NEXT: ('_section_data', '00000000 0f1f4000 00000000 0f1f4000') -// CHECK: (('sh_name', 7) # '.data' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 3) +// CHECK: (('sh_name', 0x00000007) # '.data' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000003) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: ('sh_size', 0x00000010) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000008) +// CHECK-NEXT: ('sh_entsize', 0x00000000) // CHECK-NEXT: ('_section_data', '00000000 90909090 00000000 00000000') Modified: llvm/trunk/test/MC/ELF/align-size.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-size.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-size.s (original) +++ llvm/trunk/test/MC/ELF/align-size.s Tue Oct 19 12:39:10 2010 @@ -5,9 +5,9 @@ .zero 4 .align 8 -// CHECK: (('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 8) +// CHECK: (('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000008) Modified: llvm/trunk/test/MC/ELF/align-text.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-text.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align-text.s (original) +++ llvm/trunk/test/MC/ELF/align-text.s Tue Oct 19 12:39:10 2010 @@ -6,14 +6,14 @@ .text .zero 1 -// CHECK: (('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 2) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: (('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000002) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) // CHECK-NEXT: ), Modified: llvm/trunk/test/MC/ELF/align.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/align.s (original) +++ llvm/trunk/test/MC/ELF/align.s Tue Oct 19 12:39:10 2010 @@ -7,26 +7,26 @@ .section .rodata,"a", at progbits .align 8 -// CHECK: # Section 3 -// CHECK-NEXT: (('sh_name', 13) # '.bss' -// CHECK-NEXT: ('sh_type', 8) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 68) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: # Section 0x00000003 +// CHECK-NEXT: (('sh_name', 0x0000000d) # '.bss' +// CHECK-NEXT: ('sh_type', 0x00000008) +// CHECK-NEXT: ('sh_flags', 0x00000003) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000044) +// CHECK-NEXT: ('sh_size', 0x00000000) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Section 4 -// CHECK-NEXT: (('sh_name', 18) # '.rodata' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 2) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 72) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: # Section 0x00000004 +// CHECK-NEXT: (('sh_name', 0x00000012) # '.rodata' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000002) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000048) +// CHECK-NEXT: ('sh_size', 0x00000000) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000008) +// CHECK-NEXT: ('sh_entsize', 0x00000000) Modified: llvm/trunk/test/MC/ELF/basic-elf.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/basic-elf.ll?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/basic-elf.ll (original) +++ llvm/trunk/test/MC/ELF/basic-elf.ll Tue Oct 19 12:39:10 2010 @@ -12,100 +12,100 @@ declare i32 @puts(i8* nocapture) nounwind -; 32: ('e_indent[EI_CLASS]', 1) -; 32: ('e_indent[EI_DATA]', 1) -; 32: ('e_indent[EI_VERSION]', 1) +; 32: ('e_indent[EI_CLASS]', 0x00000001) +; 32: ('e_indent[EI_DATA]', 0x00000001) +; 32: ('e_indent[EI_VERSION]', 0x00000001) ; 32: ('_sections', [ ; 32: # Section 0 -; 32: (('sh_name', 0) # '' +; 32: (('sh_name', 0x00000000) # '' ; 32: # '.text' -; 32: ('st_bind', 0) -; 32: ('st_type', 3) +; 32: ('st_bind', 0x00000000) +; 32: ('st_type', 0x00000003) -; 32: ('st_bind', 0) -; 32: ('st_type', 3) +; 32: ('st_bind', 0x00000000) +; 32: ('st_type', 0x00000003) -; 32: ('st_bind', 0) -; 32: ('st_type', 3) +; 32: ('st_bind', 0x00000000) +; 32: ('st_type', 0x00000003) ; 32: # 'main' -; 32: ('st_bind', 1) -; 32-NEXT: ('st_type', 2) +; 32: ('st_bind', 0x00000001) +; 32-NEXT: ('st_type', 0x00000002) ; 32: # 'puts' -; 32: ('st_bind', 1) -; 32-NEXT: ('st_type', 0) +; 32: ('st_bind', 0x00000001) +; 32-NEXT: ('st_type', 0x00000000) ; 32: # '.rel.text' ; 32: ('_relocations', [ -; 32: # Relocation 0 -; 32: (('r_offset', 6) -; 32: ('r_type', 1) +; 32: # Relocation 0x00000000 +; 32: (('r_offset', 0x00000006) +; 32: ('r_type', 0x00000001) ; 32: ), -; 32: # Relocation 1 -; 32: (('r_offset', 11) -; 32: ('r_type', 2) +; 32: # Relocation 0x00000001 +; 32: (('r_offset', 0x0000000b) +; 32: ('r_type', 0x00000002) ; 32: ), -; 32: # Relocation 2 -; 32: (('r_offset', 18) -; 32: ('r_type', 1) +; 32: # Relocation 0x00000002 +; 32: (('r_offset', 0x00000012) +; 32: ('r_type', 0x00000001) ; 32: ), -; 32: # Relocation 3 -; 32: (('r_offset', 23) -; 32: ('r_type', 2) +; 32: # Relocation 0x00000003 +; 32: (('r_offset', 0x00000017) +; 32: ('r_type', 0x00000002) ; 32: ), ; 32: ]) -; 64: ('e_indent[EI_CLASS]', 2) -; 64: ('e_indent[EI_DATA]', 1) -; 64: ('e_indent[EI_VERSION]', 1) +; 64: ('e_indent[EI_CLASS]', 0x00000002) +; 64: ('e_indent[EI_DATA]', 0x00000001) +; 64: ('e_indent[EI_VERSION]', 0x00000001) ; 64: ('_sections', [ ; 64: # Section 0 -; 64: (('sh_name', 0) # '' +; 64: (('sh_name', 0x00000000) # '' ; 64: # '.text' -; 64: ('st_bind', 0) -; 64: ('st_type', 3) +; 64: ('st_bind', 0x00000000) +; 64: ('st_type', 0x00000003) -; 64: ('st_bind', 0) -; 64: ('st_type', 3) +; 64: ('st_bind', 0x00000000) +; 64: ('st_type', 0x00000003) -; 64: ('st_bind', 0) -; 64: ('st_type', 3) +; 64: ('st_bind', 0x00000000) +; 64: ('st_type', 0x00000003) ; 64: # 'main' -; 64-NEXT: ('st_bind', 1) -; 64-NEXT: ('st_type', 2) +; 64-NEXT: ('st_bind', 0x00000001) +; 64-NEXT: ('st_type', 0x00000002) ; 64: # 'puts' -; 64-NEXT: ('st_bind', 1) -; 64-NEXT: ('st_type', 0) +; 64-NEXT: ('st_bind', 0x00000001) +; 64-NEXT: ('st_type', 0x00000000) ; 64: # '.rela.text' ; 64: ('_relocations', [ -; 64: # Relocation 0 -; 64: (('r_offset', 5) -; 64: ('r_type', 10) -; 64: ('r_addend', 0) +; 64: # Relocation 0x00000000 +; 64: (('r_offset', 0x00000005) +; 64: ('r_type', 0x0000000a) +; 64: ('r_addend', 0x00000000) ; 64: ), -; 64: # Relocation 1 -; 64: (('r_offset', 10) -; 64: ('r_type', 2) -; 64: ('r_addend', -4) +; 64: # Relocation 0x00000001 +; 64: (('r_offset', 0x0000000a) +; 64: ('r_type', 0x00000002) +; 64: ('r_addend', 0xfffffffc) ; 64: ), -; 64: # Relocation 2 -; 64: (('r_offset', 15) -; 64: ('r_type', 10) -; 64: ('r_addend', 6) +; 64: # Relocation 0x00000002 +; 64: (('r_offset', 0x0000000f) +; 64: ('r_type', 0x0000000a) +; 64: ('r_addend', 0x00000006) ; 64: ), -; 64: # Relocation 3 -; 64: (('r_offset', 20) -; 64: ('r_type', 2) -; 64: ('r_addend', -4) +; 64: # Relocation 0x00000003 +; 64: (('r_offset', 0x00000014) +; 64: ('r_type', 0x00000002) +; 64: ('r_addend', 0xfffffffc) ; 64: ), ; 64: ]) Modified: llvm/trunk/test/MC/ELF/common.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/common.s (original) +++ llvm/trunk/test/MC/ELF/common.s Tue Oct 19 12:39:10 2010 @@ -8,13 +8,13 @@ .local common1 .comm common1,1,1 -// CHECK: ('st_name', 1) # 'common1' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) +// CHECK: ('st_name', 0x00000001) # 'common1' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000001) +// CHECK-NEXT: ('st_other', 0x00000000) // CHECK-NEXT: ('st_shndx', -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 1) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000001) // Same as common1, but with directives in a different order. @@ -22,25 +22,25 @@ .type common2, at object .comm common2,1,1 -// CHECK: ('st_name', 9) # 'common2' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) +// CHECK: ('st_name', 0x00000009) # 'common2' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000001) +// CHECK-NEXT: ('st_other', 0x00000000) // CHECK-NEXT: ('st_shndx', -// CHECK-NEXT: ('st_value', 1) -// CHECK-NEXT: ('st_size', 1) +// CHECK-NEXT: ('st_value', 0x00000001) +// CHECK-NEXT: ('st_size', 0x00000001) // Test that without an explicit .local we produce a global. .type common3, at object .comm common3,4,4 -// CHECK: ('st_name', 17) # 'common3' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 65522) -// CHECK-NEXT: ('st_value', 4) -// CHECK-NEXT: ('st_size', 4) +// CHECK: ('st_name', 0x00000011) # 'common3' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000001) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x0000fff2) +// CHECK-NEXT: ('st_value', 0x00000004) +// CHECK-NEXT: ('st_size', 0x00000004) // Test that without an explicit .local we produce a global, even if the first @@ -54,10 +54,10 @@ .type common4, at object .comm common4,40,16 -// CHECK: ('st_name', 29) # 'common4' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 65522) -// CHECK-NEXT: ('st_value', 16) -// CHECK-NEXT: ('st_size', 40) +// CHECK: ('st_name', 0x0000001d) # 'common4' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000001) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x0000fff2) +// CHECK-NEXT: ('st_value', 0x00000010) +// CHECK-NEXT: ('st_size', 0x00000028) Modified: llvm/trunk/test/MC/ELF/common2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common2.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/common2.s (original) +++ llvm/trunk/test/MC/ELF/common2.s Tue Oct 19 12:39:10 2010 @@ -9,12 +9,12 @@ .zero 1 .align 8 -// CHECK: (('sh_name', 13) # '.bss' +// CHECK: (('sh_name', 0x0000000d) # '.bss' // CHECK-NEXT: ('sh_type', // CHECK-NEXT: ('sh_flags' // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 9) +// CHECK-NEXT: ('sh_size', 0x00000009) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', // CHECK-NEXT: ('sh_addralign', Modified: llvm/trunk/test/MC/ELF/diff.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/diff.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/diff.s (original) +++ llvm/trunk/test/MC/ELF/diff.s Tue Oct 19 12:39:10 2010 @@ -8,8 +8,8 @@ zed: mov zed+(bar-foo), %eax -// CHECK: # Relocation 0 -// CHECK-NEXT: (('r_offset', 5) -// CHECK-NEXT: ('r_sym', 6) -// CHECK-NEXT: ('r_type', 11) -// CHECK-NEXT: ('r_addend', 1) +// CHECK: # Relocation 0x00000000 +// CHECK-NEXT: (('r_offset', 0x00000005) +// CHECK-NEXT: ('r_sym', 0x00000006) +// CHECK-NEXT: ('r_type', 0x0000000b) +// CHECK-NEXT: ('r_addend', 0x00000001) Modified: llvm/trunk/test/MC/ELF/empty.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/empty.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/empty.s (original) +++ llvm/trunk/test/MC/ELF/empty.s Tue Oct 19 12:39:10 2010 @@ -3,68 +3,68 @@ // Test that like gnu as we create text, data and bss by default. Also test // that shstrtab, symtab and strtab are listed in that order. -// CHECK: ('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 7) # '.data' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 13) # '.bss' -// CHECK-NEXT: ('sh_type', 8) -// CHECK-NEXT: ('sh_flags', 3) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 0) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 18) # '.shstrtab' -// CHECK-NEXT: ('sh_type', 3) -// CHECK-NEXT: ('sh_flags', 0) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 44) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 0) - -// CHECK: ('sh_name', 28) # '.symtab' -// CHECK-NEXT: ('sh_type', 2) -// CHECK-NEXT: ('sh_flags', 0) -// CHECK-NEXT: ('sh_addr', 0) +// CHECK: ('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000000) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) + +// CHECK: ('sh_name', 0x00000007) # '.data' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000003) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000000) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) + +// CHECK: ('sh_name', 0x0000000d) # '.bss' +// CHECK-NEXT: ('sh_type', 0x00000008) +// CHECK-NEXT: ('sh_flags', 0x00000003) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000000) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) + +// CHECK: ('sh_name', 0x00000012) # '.shstrtab' +// CHECK-NEXT: ('sh_type', 0x00000003) +// CHECK-NEXT: ('sh_flags', 0x00000000) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x0000002c) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000001) +// CHECK-NEXT: ('sh_entsize', 0x00000000) + +// CHECK: ('sh_name', 0x0000001c) # '.symtab' +// CHECK-NEXT: ('sh_type', 0x00000002) +// CHECK-NEXT: ('sh_flags', 0x00000000) +// CHECK-NEXT: ('sh_addr', 0x00000000) // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 96) -// CHECK-NEXT: ('sh_link', 6) -// CHECK-NEXT: ('sh_info', 4) -// CHECK-NEXT: ('sh_addralign', 8) -// CHECK-NEXT: ('sh_entsize', 24) - -// CHECK: ('sh_name', 36) # '.strtab' -// CHECK-NEXT: ('sh_type', 3) -// CHECK-NEXT: ('sh_flags', 0) -// CHECK-NEXT: ('sh_addr', 0) +// CHECK-NEXT: ('sh_size', 0x00000060) +// CHECK-NEXT: ('sh_link', 0x00000006) +// CHECK-NEXT: ('sh_info', 0x00000004) +// CHECK-NEXT: ('sh_addralign', 0x00000008) +// CHECK-NEXT: ('sh_entsize', 0x00000018) + +// CHECK: ('sh_name', 0x00000024) # '.strtab' +// CHECK-NEXT: ('sh_type', 0x00000003) +// CHECK-NEXT: ('sh_flags', 0x00000000) +// CHECK-NEXT: ('sh_addr', 0x00000000) // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 1) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK-NEXT: ('sh_size', 0x00000001) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000001) +// CHECK-NEXT: ('sh_entsize', 0x00000000) Modified: llvm/trunk/test/MC/ELF/entsize.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/entsize.ll?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/entsize.ll (original) +++ llvm/trunk/test/MC/ELF/entsize.ll Tue Oct 19 12:39:10 2010 @@ -20,25 +20,25 @@ ;;;;; -; 64: (('sh_name', 18) # '.rodata.str1.1' -; 64-NEXT: ('sh_type', 1) -; 64-NEXT: ('sh_flags', 50) +; 64: (('sh_name', 0x00000012) # '.rodata.str1.1' +; 64-NEXT: ('sh_type', 0x00000001) +; 64-NEXT: ('sh_flags', 0x00000032) ; 64-NEXT: ('sh_addr', ; 64-NEXT: ('sh_offset', -; 64-NEXT: ('sh_size', 13) +; 64-NEXT: ('sh_size', 0x0000000d) ; 64-NEXT: ('sh_link', ; 64-NEXT: ('sh_info', -; 64-NEXT: ('sh_addralign', 1) -; 64-NEXT: ('sh_entsize', 1) +; 64-NEXT: ('sh_addralign', 0x00000001) +; 64-NEXT: ('sh_entsize', 0x00000001) -; 64: (('sh_name', 33) # '.rodata.cst8' -; 64-NEXT: ('sh_type', 1) -; 64-NEXT: ('sh_flags', 18) +; 64: (('sh_name', 0x00000021) # '.rodata.cst8' +; 64-NEXT: ('sh_type', 0x00000001) +; 64-NEXT: ('sh_flags', 0x00000012) ; 64-NEXT: ('sh_addr', ; 64-NEXT: ('sh_offset', -; 64-NEXT: ('sh_size', 16) +; 64-NEXT: ('sh_size', 0x00000010) ; 64-NEXT: ('sh_link', ; 64-NEXT: ('sh_info', -; 64-NEXT: ('sh_addralign', 8) -; 64-NEXT: ('sh_entsize', 8) +; 64-NEXT: ('sh_addralign', 0x00000008) +; 64-NEXT: ('sh_entsize', 0x00000008) Modified: llvm/trunk/test/MC/ELF/entsize.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/entsize.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/entsize.s (original) +++ llvm/trunk/test/MC/ELF/entsize.s Tue Oct 19 12:39:10 2010 @@ -32,38 +32,38 @@ .quad 42 .quad 42 -// CHECK: # Section 4 -// CHECK-NEXT: ('sh_name', 18) # '.rodata.str1.1' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 50) +// CHECK: # Section 0x00000004 +// CHECK-NEXT: ('sh_name', 0x00000012) # '.rodata.str1.1' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000032) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 13) +// CHECK-NEXT: ('sh_size', 0x0000000d) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 1) +// CHECK-NEXT: ('sh_addralign', 0x00000001) +// CHECK-NEXT: ('sh_entsize', 0x00000001) -// CHECK: # Section 5 -// CHECK-NEXT: ('sh_name', 33) # '.rodata.str2.1' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 50) +// CHECK: # Section 0x00000005 +// CHECK-NEXT: ('sh_name', 0x00000021) # '.rodata.str2.1' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000032) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) +// CHECK-NEXT: ('sh_size', 0x00000010) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 2) +// CHECK-NEXT: ('sh_addralign', 0x00000001) +// CHECK-NEXT: ('sh_entsize', 0x00000002) -// CHECK: # Section 6 -// CHECK-NEXT: ('sh_name', 48) # '.rodata.cst8 -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 18) +// CHECK: # Section 0x00000006 +// CHECK-NEXT: ('sh_name', 0x00000030) # '.rodata.cst8 +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000012) // CHECK-NEXT: ('sh_addr', // CHECK-NEXT: ('sh_offset', -// CHECK-NEXT: ('sh_size', 16) +// CHECK-NEXT: ('sh_size', 0x00000010) // CHECK-NEXT: ('sh_link', // CHECK-NEXT: ('sh_info', -// CHECK-NEXT: ('sh_addralign', 1) -// CHECK-NEXT: ('sh_entsize', 8) +// CHECK-NEXT: ('sh_addralign', 0x00000001) +// CHECK-NEXT: ('sh_entsize', 0x00000008) Modified: llvm/trunk/test/MC/ELF/file.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/file.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/file.s (original) +++ llvm/trunk/test/MC/ELF/file.s Tue Oct 19 12:39:10 2010 @@ -4,20 +4,20 @@ .file "foo" foa: -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 1) # 'foo' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 4) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 65521) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x00000001 +// CHECK-NEXT: (('st_name', 0x00000001) # 'foo' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000004) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x0000fff1) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), -// CHECK-NEXT: # Symbol 2 -// CHECK-NEXT: (('st_name', 5) # 'foa' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000002 +// CHECK-NEXT: (('st_name', 0x00000005) # 'foa' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) Modified: llvm/trunk/test/MC/ELF/got.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/got.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/got.s (original) +++ llvm/trunk/test/MC/ELF/got.s Tue Oct 19 12:39:10 2010 @@ -6,20 +6,20 @@ movl foo at GOT, %eax movl foo at GOTPCREL(%rip), %eax -// CHECK: (('st_name', 5) # '_GLOBAL_OFFSET_TABLE_' -// CHECK-NEXT: ('st_bind', 1) +// CHECK: (('st_name', 0x00000005) # '_GLOBAL_OFFSET_TABLE_' +// CHECK-NEXT: ('st_bind', 0x00000001) // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: # Relocation 0x00000000 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 3) +// CHECK-NEXT: ('r_type', 0x00000003) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: # Relocation 0x00000001 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 9) +// CHECK-NEXT: ('r_type', 0x00000009) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/local-reloc.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/local-reloc.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/local-reloc.s (original) +++ llvm/trunk/test/MC/ELF/local-reloc.s Tue Oct 19 12:39:10 2010 @@ -7,24 +7,24 @@ foo: // Section number 1 is .text -// CHECK: # Section 1 -// CHECK-next: (('sh_name', 1) # '.text' +// CHECK: # Section 0x00000001 +// CHECK-next: (('sh_name', 0x00000001) # '.text' // Symbol number 2 is section number 1 -// CHECK: # Symbol 2 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 3) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 1) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x00000002 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000003) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000001) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // Relocation refers to symbol number 2 // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: # Relocation 0x00000000 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 2) +// CHECK-NEXT: ('r_sym', 0x00000002) // CHECK-NEXT: ('r_type', // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), Modified: llvm/trunk/test/MC/ELF/merge.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/merge.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/merge.s (original) +++ llvm/trunk/test/MC/ELF/merge.s Tue Oct 19 12:39:10 2010 @@ -23,75 +23,75 @@ foo: // Section 4 is "sec1" -// CHECK: # Section 4 -// CHECK-NEXT: (('sh_name', 18) # '.sec1' +// CHECK: # Section 0x00000004 +// CHECK-NEXT: (('sh_name', 0x00000012) # '.sec1' // Symbol number 1 is .Lfoo -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 1) # '.Lfoo' +// CHECK: # Symbol 0x00000001 +// CHECK-NEXT: (('st_name', 0x00000001) # '.Lfoo' // Symbol number 2 is foo -// CHECK: # Symbol 2 -// CHECK-NEXT: (('st_name', 7) # 'foo' +// CHECK: # Symbol 0x00000002 +// CHECK-NEXT: (('st_name', 0x00000007) # 'foo' // Symbol number 6 is section 4 -// CHECK: # Symbol 6 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 3) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 4) +// CHECK: # Symbol 0x00000006 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000003) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000004) // Symbol number 8 is zed -// CHECK: # Symbol 8 -// CHECK-NEXT: (('st_name', 11) # 'zed' +// CHECK: # Symbol 0x00000008 +// CHECK-NEXT: (('st_name', 0x0000000b) # 'zed' // Relocation 0 refers to symbol 1 // CHECK: ('_relocations', [ // CHECK-NEXT: # Relocation 0 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 1) -// CHECK-NEXT: ('r_type', 2 +// CHECK-NEXT: ('r_sym', 0x00000001) +// CHECK-NEXT: ('r_type', 0x00000002 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 1 refers to symbol 6 -// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: # Relocation 0x00000001 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 6) -// CHECK-NEXT: ('r_type', 10) +// CHECK-NEXT: ('r_sym', 0x00000006) +// CHECK-NEXT: ('r_type', 0x0000000a) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 2 refers to symbol 1 -// CHECK-NEXT: # Relocation 2 +// CHECK-NEXT: # Relocation 0x00000002 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 1) -// CHECK-NEXT: ('r_type', 10 +// CHECK-NEXT: ('r_sym', 0x00000001) +// CHECK-NEXT: ('r_type', 0x0000000a // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 3 refers to symbol 2 -// CHECK-NEXT: # Relocation 3 +// CHECK-NEXT: # Relocation 0x00000003 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 4 +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x00000004 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 4 refers to symbol 2 -// CHECK-NEXT: # Relocation 4 +// CHECK-NEXT: # Relocation 0x00000004 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 9 +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x00000009 // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // Relocation 5 refers to symbol 8 -// CHECK-NEXT: # Relocation 5 -// CHECK-NEXT: (('r_offset', 35) -// CHECK-NEXT: ('r_sym', 8) -// CHECK-NEXT: ('r_type', 11) -// CHECK-NEXT: ('r_addend', 0) +// CHECK-NEXT: # Relocation 0x00000005 +// CHECK-NEXT: (('r_offset', 0x00000023) +// CHECK-NEXT: ('r_sym', 0x00000008) +// CHECK-NEXT: ('r_type', 0x0000000b) +// CHECK-NEXT: ('r_addend', 0x00000000) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/norelocation.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/norelocation.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/norelocation.s (original) +++ llvm/trunk/test/MC/ELF/norelocation.s Tue Oct 19 12:39:10 2010 @@ -3,16 +3,16 @@ call bar bar: -// CHECK: ('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 5) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000005) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) // CHECK-NEXT: ('_section_data', 'e8000000 00') // CHECK-NOT: .rela.text // CHECK: shstrtab Modified: llvm/trunk/test/MC/ELF/pic-diff.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/pic-diff.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/pic-diff.s (original) +++ llvm/trunk/test/MC/ELF/pic-diff.s Tue Oct 19 12:39:10 2010 @@ -1,21 +1,21 @@ // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s -// CHECK: # Symbol 5 -// CHECK-NEXT: (('st_name', 5) # 'baz' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 0) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 0) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK: # Symbol 0x00000005 +// CHECK-NEXT: (('st_name', 0x00000005) # 'baz' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000000) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 -// CHECK-NEXT: (('r_offset', 12) -// CHECK-NEXT: ('r_sym', 5) -// CHECK-NEXT: ('r_type', 2) -// CHECK-NEXT: ('r_addend', 8) +// CHECK-NEXT: # Relocation 0x00000000 +// CHECK-NEXT: (('r_offset', 0x0000000c) +// CHECK-NEXT: ('r_sym', 0x00000005) +// CHECK-NEXT: ('r_type', 0x00000002) +// CHECK-NEXT: ('r_addend', 0x00000008) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/plt.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/plt.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/plt.s (original) +++ llvm/trunk/test/MC/ELF/plt.s Tue Oct 19 12:39:10 2010 @@ -5,10 +5,10 @@ jmp foo at PLT // CHECK: ('_relocations', [ -// CHECK-NEXT: # Relocation 0 +// CHECK-NEXT: # Relocation 0x00000000 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 4) +// CHECK-NEXT: ('r_type', 0x00000004) // CHECK-NEXT: ('r_addend', // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/relax.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relax.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relax.s (original) +++ llvm/trunk/test/MC/ELF/relax.s Tue Oct 19 12:39:10 2010 @@ -12,27 +12,27 @@ jmp bar jmp foo -// CHECK: ('sh_name', 1) # '.text' -// CHECK-NEXT: ('sh_type', 1) -// CHECK-NEXT: ('sh_flags', 6) -// CHECK-NEXT: ('sh_addr', 0) -// CHECK-NEXT: ('sh_offset', 64) -// CHECK-NEXT: ('sh_size', 7) -// CHECK-NEXT: ('sh_link', 0) -// CHECK-NEXT: ('sh_info', 0) -// CHECK-NEXT: ('sh_addralign', 4) -// CHECK-NEXT: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000007) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) // CHECK-NEXT: ('_section_data', 'ebfee900 000000') -// CHECK: # Symbol 5 -// CHECK-NEXT: (('st_name', 5) # 'foo' +// CHECK: # Symbol 0x00000005 +// CHECK-NEXT: (('st_name', 0x00000005) # 'foo' // CHECK: .rela.text // CHECK: ('_relocations', [ -// CHECK-NEXT: Relocation 0 -// CHECK-NEXT: (('r_offset', 3) -// CHECK-NEXT: ('r_sym', 5) -// CHECK-NEXT: ('r_type', 2) -// CHECK-NEXT: ('r_addend', -4) +// CHECK-NEXT: Relocation 0x00000000 +// CHECK-NEXT: (('r_offset', 0x00000003) +// CHECK-NEXT: ('r_sym', 0x00000005) +// CHECK-NEXT: ('r_type', 0x00000002) +// CHECK-NEXT: ('r_addend', 0xfffffffc) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/relocation-386.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation-386.s (original) +++ llvm/trunk/test/MC/ELF/relocation-386.s Tue Oct 19 12:39:10 2010 @@ -4,50 +4,50 @@ // to .Lfoo uses the symbol and not the section. // Section 3 is bss -// CHECK: # Section 3 -// CHECK-NEXT: (('sh_name', 13) # '.bss' +// CHECK: # Section 0x00000003 +// CHECK-NEXT: (('sh_name', 0x0000000d) # '.bss' -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 5) # '.Lfoo' +// CHECK: # Symbol 0x00000001 +// CHECK-NEXT: (('st_name', 0x00000005) # '.Lfoo' // Symbol 6 is section 3 -// CHECK: # Symbol 6 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) -// CHECK-NEXT: ('st_bind', 0) -// CHECK-NEXT: ('st_type', 3) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 3) - -// CHECK: # Relocation 0 -// CHECK-NEXT: (('r_offset', 2) -// CHECK-NEXT: ('r_sym', 1) -// CHECK-NEXT: ('r_type', 9) +// CHECK: # Symbol 0x00000006 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) +// CHECK-NEXT: ('st_bind', 0x00000000) +// CHECK-NEXT: ('st_type', 0x00000003) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000003) + +// CHECK: # Relocation 0x00000000 +// CHECK-NEXT: (('r_offset', 0x00000002) +// CHECK-NEXT: ('r_sym', 0x00000001) +// CHECK-NEXT: ('r_type', 0x00000009) // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 1 +// CHECK-NEXT: # Relocation 0x00000001 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 4) +// CHECK-NEXT: ('r_type', 0x00000004) // CHECK-NEXT: ), -// CHECK-NEXT: # Relocation 2 +// CHECK-NEXT: # Relocation 0x00000002 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 10) +// CHECK-NEXT: ('r_type', 0x0000000a) // CHECK-NEXT: ), // Relocation 3 (bar3 at GOTOFF) is done with symbol 6 (bss) -// CHECK-NEXT: # Relocation 3 +// CHECK-NEXT: # Relocation 0x00000003 // CHECK-NEXT: (('r_offset', -// CHECK-NEXT: ('r_sym', 6 +// CHECK-NEXT: ('r_sym', 0x00000006 // CHECK-NEXT: ('r_type', // CHECK-NEXT: ), // Relocation 4 (bar2 at GOT) is of type R_386_GOT32 -// CHECK-NEXT: # Relocation 4 +// CHECK-NEXT: # Relocation 0x00000004 // CHECK-NEXT: (('r_offset', // CHECK-NEXT: ('r_sym', -// CHECK-NEXT: ('r_type', 3 +// CHECK-NEXT: ('r_type', 0x00000003 // CHECK-NEXT: ), .text Modified: llvm/trunk/test/MC/ELF/relocation.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/relocation.s (original) +++ llvm/trunk/test/MC/ELF/relocation.s Tue Oct 19 12:39:10 2010 @@ -10,48 +10,48 @@ movq bar, %rdx // R_X86_64_32S .long bar // R_X86_64_32 -// CHECK: # Section 1 -// CHECK: (('sh_name', 1) # '.text' +// CHECK: # Section 0x00000001 +// CHECK: (('sh_name', 0x00000001) # '.text' -// CHECK: # Symbol 2 -// CHECK: (('st_name', 0) # '' -// CHECK: ('st_bind', 0) -// CHECK ('st_type', 3) -// CHECK: ('st_other', 0) -// CHECK: ('st_shndx', 1) +// CHECK: # Symbol 0x00000002 +// CHECK: (('st_name', 0x00000000) # '' +// CHECK: ('st_bind', 0x00000000) +// CHECK ('st_type', 0x00000003) +// CHECK: ('st_other', 0x00000000) +// CHECK: ('st_shndx', 0x00000001) -// CHECK: # Relocation 0 -// CHECK-NEXT: (('r_offset', 1) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 10) +// CHECK: # Relocation 0x00000000 +// CHECK-NEXT: (('r_offset', 0x00000001) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000a) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 1 -// CHECK-NEXT: (('r_offset', 8) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x00000001 +// CHECK-NEXT: (('r_offset', 0x00000008) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000b) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 2 -// CHECK-NEXT: (('r_offset', 19) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x00000002 +// CHECK-NEXT: (('r_offset', 0x00000013) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000b) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 3 -// CHECK-NEXT: (('r_offset', 26) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x00000003 +// CHECK-NEXT: (('r_offset', 0x0000001a) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000b) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 4 -// CHECK-NEXT: (('r_offset', 34) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 11) +// CHECK: # Relocation 0x00000004 +// CHECK-NEXT: (('r_offset', 0x00000022) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000b) // CHECK-NEXT: ('r_addend', -// CHECK: # Relocation 5 -// CHECK-NEXT: (('r_offset', 38) -// CHECK-NEXT: ('r_sym', 2) -// CHECK-NEXT: ('r_type', 10) +// CHECK: # Relocation 0x00000005 +// CHECK-NEXT: (('r_offset', 0x00000026) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000a) // CHECK-NEXT: ('r_addend', Modified: llvm/trunk/test/MC/ELF/section.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/section.s (original) +++ llvm/trunk/test/MC/ELF/section.s Tue Oct 19 12:39:10 2010 @@ -6,6 +6,6 @@ .section .note.GNU-,"", at progbits .section -.note.GNU,"", at progbits -// CHECK: ('sh_name', 18) # '.note.GNU-stack' -// CHECK: ('sh_name', 34) # '.note.GNU-' -// CHECK: ('sh_name', 45) # '-.note.GNU' +// CHECK: ('sh_name', 0x00000012) # '.note.GNU-stack' +// CHECK: ('sh_name', 0x00000022) # '.note.GNU-' +// CHECK: ('sh_name', 0x0000002d) # '-.note.GNU' Modified: llvm/trunk/test/MC/ELF/size.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/size.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/size.s (original) +++ llvm/trunk/test/MC/ELF/size.s Tue Oct 19 12:39:10 2010 @@ -2,8 +2,8 @@ // Mostly a test that this doesn't crash anymore. -// CHECK: # Symbol 4 -// CHECK-NEXT: (('st_name', 1) # 'foo' -// CHECK-NEXT: ('st_bind', 1) +// CHECK: # Symbol 0x00000004 +// CHECK-NEXT: (('st_name', 0x00000001) # 'foo' +// CHECK-NEXT: ('st_bind', 0x00000001) .size foo, .Lbar-foo Modified: llvm/trunk/test/MC/ELF/sleb.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/sleb.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/sleb.s (original) +++ llvm/trunk/test/MC/ELF/sleb.s Tue Oct 19 12:39:10 2010 @@ -19,9 +19,9 @@ .sleb128 8193 -// ELF_32: ('sh_name', 1) # '.text' +// ELF_32: ('sh_name', 0x00000001) # '.text' // ELF_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') -// ELF_64: ('sh_name', 1) # '.text' +// ELF_64: ('sh_name', 0x00000001) # '.text' // ELF_64: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // MACHO_32: ('_section_data', '00017f3f 40c000bf 7fff3f80 4081c000') Modified: llvm/trunk/test/MC/ELF/uleb.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/uleb.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/uleb.s (original) +++ llvm/trunk/test/MC/ELF/uleb.s Tue Oct 19 12:39:10 2010 @@ -12,9 +12,9 @@ .uleb128 16383 .uleb128 16384 -// ELF_32: ('sh_name', 1) # '.text' +// ELF_32: ('sh_name', 0x00000001) # '.text' // ELF_32: ('_section_data', '00017f80 01ff7f80 8001') -// ELF_64: ('sh_name', 1) # '.text' +// ELF_64: ('sh_name', 0x00000001) # '.text' // ELF_64: ('_section_data', '00017f80 01ff7f80 8001') // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') // MACHO_32: ('_section_data', '00017f80 01ff7f80 8001') Modified: llvm/trunk/test/MC/ELF/undef.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/undef.s (original) +++ llvm/trunk/test/MC/ELF/undef.s Tue Oct 19 12:39:10 2010 @@ -19,27 +19,27 @@ movsd .Lsym8(%rip), %xmm1 // CHECK: ('_symbols', [ -// CHECK-NEXT: # Symbol 0 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 1 -// CHECK-NEXT: (('st_name', 13) # '.Lsym8' -// CHECK: # Symbol 2 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 3 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 4 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 5 -// CHECK-NEXT: (('st_name', 0) # '' -// CHECK: # Symbol 6 -// CHECK-NEXT: (('st_name', 1) # '.Lsym1' -// CHECK: # Symbol 7 -// CHECK-NEXT: (('st_name', 8) # 'sym6' -// CHECK-NEXT: ('st_bind', 1) -// CHECK-NEXT: ('st_type', 1) -// CHECK-NEXT: ('st_other', 0) -// CHECK-NEXT: ('st_shndx', 0) -// CHECK-NEXT: ('st_value', 0) -// CHECK-NEXT: ('st_size', 0) +// CHECK-NEXT: # Symbol 0x00000000 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000001 +// CHECK-NEXT: (('st_name', 0x0000000d) # '.Lsym8' +// CHECK: # Symbol 0x00000002 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000003 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000004 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000005 +// CHECK-NEXT: (('st_name', 0x00000000) # '' +// CHECK: # Symbol 0x00000006 +// CHECK-NEXT: (('st_name', 0x00000001) # '.Lsym1' +// CHECK: # Symbol 0x00000007 +// CHECK-NEXT: (('st_name', 0x00000008) # 'sym6' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK-NEXT: ('st_type', 0x00000001) +// CHECK-NEXT: ('st_other', 0x00000000) +// CHECK-NEXT: ('st_shndx', 0x00000000) +// CHECK-NEXT: ('st_value', 0x00000000) +// CHECK-NEXT: ('st_size', 0x00000000) // CHECK-NEXT: ), // CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/undef2.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/undef2.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/undef2.s (original) +++ llvm/trunk/test/MC/ELF/undef2.s Tue Oct 19 12:39:10 2010 @@ -5,6 +5,6 @@ je .Lfoo // CHECK: ('_symbols', [ -// CHECK: (('st_name', 1) # '.Lfoo' -// CHECK-NEXT: ('st_bind', 1) -// CHECK: (('sh_name', 36) # '.strtab' +// CHECK: (('st_name', 0x00000001) # '.Lfoo' +// CHECK-NEXT: ('st_bind', 0x00000001) +// CHECK: (('sh_name', 0x00000024) # '.strtab' Modified: llvm/trunk/test/MC/ELF/weak.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/weak.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/weak.s (original) +++ llvm/trunk/test/MC/ELF/weak.s Tue Oct 19 12:39:10 2010 @@ -9,22 +9,22 @@ .weak bar bar: -//CHECK: # Symbol 4 -//CHECK-NEXT: (('st_name', 5) # 'bar' -//CHECK-NEXT: ('st_bind', 2) -//CHECK-NEXT: ('st_type', 0) -//CHECK-NEXT: ('st_other', 0) -//CHECK-NEXT: ('st_shndx', 1) -//CHECK-NEXT: ('st_value', 0) -//CHECK-NEXT: ('st_size', 0) +//CHECK: # Symbol 0x00000004 +//CHECK-NEXT: (('st_name', 0x00000005) # 'bar' +//CHECK-NEXT: ('st_bind', 0x00000002) +//CHECK-NEXT: ('st_type', 0x00000000) +//CHECK-NEXT: ('st_other', 0x00000000) +//CHECK-NEXT: ('st_shndx', 0x00000001) +//CHECK-NEXT: ('st_value', 0x00000000) +//CHECK-NEXT: ('st_size', 0x00000000) //CHECK-NEXT: ), -//CHECK-NEXT: # Symbol 5 -//CHECK: (('st_name', 1) # 'foo' -//CHECK-NEXT: ('st_bind', 2) -//CHECK-NEXT: ('st_type', 0) -//CHECK-NEXT: ('st_other', 0) -//CHECK-NEXT: ('st_shndx', 0) -//CHECK-NEXT: ('st_value', 0) -//CHECK-NEXT: ('st_size', 0) +//CHECK-NEXT: # Symbol 0x00000005 +//CHECK: (('st_name', 0x00000001) # 'foo' +//CHECK-NEXT: ('st_bind', 0x00000002) +//CHECK-NEXT: ('st_type', 0x00000000) +//CHECK-NEXT: ('st_other', 0x00000000) +//CHECK-NEXT: ('st_shndx', 0x00000000) +//CHECK-NEXT: ('st_value', 0x00000000) +//CHECK-NEXT: ('st_size', 0x00000000) //CHECK-NEXT: ), //CHECK-NEXT: ]) Modified: llvm/trunk/test/MC/ELF/zero.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/zero.s?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/MC/ELF/zero.s (original) +++ llvm/trunk/test/MC/ELF/zero.s Tue Oct 19 12:39:10 2010 @@ -3,14 +3,14 @@ .zero 4 .zero 1,42 -// CHECK: ('sh_name', 1) # '.text' -// CHECK: ('sh_type', 1) -// CHECK: ('sh_flags', 6) -// CHECK: ('sh_addr', 0) -// CHECK: ('sh_offset', 64) -// CHECK: ('sh_size', 5) -// CHECK: ('sh_link', 0) -// CHECK: ('sh_info', 0) -// CHECK: ('sh_addralign', 4) -// CHECK: ('sh_entsize', 0) +// CHECK: ('sh_name', 0x00000001) # '.text' +// CHECK: ('sh_type', 0x00000001) +// CHECK: ('sh_flags', 0x00000006) +// CHECK: ('sh_addr', 0x00000000) +// CHECK: ('sh_offset', 0x00000040) +// CHECK: ('sh_size', 0x00000005) +// CHECK: ('sh_link', 0x00000000) +// CHECK: ('sh_info', 0x00000000) +// CHECK: ('sh_addralign', 0x00000004) +// CHECK: ('sh_entsize', 0x00000000) // CHECK: ('_section_data', '00000000 2a') Modified: llvm/trunk/test/Scripts/common_dump.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/common_dump.py?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/Scripts/common_dump.py (original) +++ llvm/trunk/test/Scripts/common_dump.py Tue Oct 19 12:39:10 2010 @@ -11,3 +11,36 @@ hex_byte += ' ' bytes.append(hex_byte) return ''.join(bytes).strip() + +def dataToHexUnified(d): + """ Convert the raw data in 'd' to an hex string with a space every 4 bytes. + Each 4byte number is prefixed with 0x for easy sed/rx + Fixme: convert all MC tests to use this routine instead of the above + """ + bytes = [] + for i,c in enumerate(d): + byte = ord(c) + hex_byte = hex(byte)[2:] + if byte <= 0xf: + hex_byte = '0' + hex_byte + if i % 4 == 0: + hex_byte = '0x' + hex_byte + if i % 4 == 3: + hex_byte += ' ' + bytes.append(hex_byte) + return ''.join(bytes).strip() + + +def HexDump(val, numBits=32): + """ + 1. do not print 'L' + 2. Handle negatives and large numbers by mod (2^numBits) + 3. print fixed length, prepend with zeros. + Length is exactly 2+(numBits/4) + 4. Do print 0x Why? + so that they can be easily distinguished using sed/rx + """ + val = val & (( 1 << numBits) - 1) + newFmt = "0x%0" + "%d" % (numBits / 4) + "x" + return newFmt % val + Modified: llvm/trunk/test/Scripts/elf-dump URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Scripts/elf-dump?rev=116823&r1=116822&r2=116823&view=diff ============================================================================== --- llvm/trunk/test/Scripts/elf-dump (original) +++ llvm/trunk/test/Scripts/elf-dump Tue Oct 19 12:39:10 2010 @@ -6,6 +6,8 @@ import common_dump +FormatOutput=hex + class Reader: def __init__(self, path): if path == "-": @@ -77,16 +79,16 @@ self.sh_entsize = f.readWord() def dump(self, shstrtab, f, strtab, dumpdata): - print " (('sh_name', %d) # %r" % (self.sh_name, shstrtab[self.sh_name]) - print " ('sh_type', %d)" % self.sh_type - print " ('sh_flags', %d)" % self.sh_flags - print " ('sh_addr', %d)" % self.sh_addr - print " ('sh_offset', %d)" % self.sh_offset - print " ('sh_size', %d)" % self.sh_size - print " ('sh_link', %d)" % self.sh_link - print " ('sh_info', %d)" % self.sh_info - print " ('sh_addralign', %d)" % self.sh_addralign - print " ('sh_entsize', %d)" % self.sh_entsize + print " (('sh_name', %s)" % common_dump.HexDump(self.sh_name), "# %r" % shstrtab[self.sh_name] + print " ('sh_type', %s)" % common_dump.HexDump(self.sh_type) + print " ('sh_flags', %s)" % common_dump.HexDump(self.sh_flags) + print " ('sh_addr', %s)" % common_dump.HexDump(self.sh_addr) + print " ('sh_offset', %s)" % common_dump.HexDump(self.sh_offset) + print " ('sh_size', %s)" % common_dump.HexDump(self.sh_size) + print " ('sh_link', %s)" % common_dump.HexDump(self.sh_link) + print " ('sh_info', %s)" % common_dump.HexDump(self.sh_info) + print " ('sh_addralign', %s)" % common_dump.HexDump(self.sh_addralign) + print " ('sh_entsize', %s)" % common_dump.HexDump(self.sh_entsize) if self.sh_type == 2: # SHT_SYMTAB print " ('_symbols', [" dumpSymtab(f, self, strtab) @@ -106,20 +108,20 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Symbol %d" % index + print " # Symbol %s" % common_dump.HexDump(index) name = f.read32() - print " (('st_name', %d) # %r" % (name, strtab[name]) + print " (('st_name', %s)" % common_dump.HexDump(name), "# %r" % strtab[name] if not f.is64Bit: - print " ('st_value', %d)" % f.read32() - print " ('st_size', %d)" % f.read32() + print " ('st_value', %s)" % common_dump.HexDump(f.read32()) + print " ('st_size', %s)" % common_dump.HexDump(f.read32()) st_info = f.read8() - print " ('st_bind', %d)" % (st_info >> 4) - print " ('st_type', %d)" % (st_info & 0xf) - print " ('st_other', %d)" % f.read8() - print " ('st_shndx', %d)" % f.read16() + print " ('st_bind', %s)" % common_dump.HexDump((st_info >> 4)) + print " ('st_type', %s)" % common_dump.HexDump((st_info & 0xf)) + print " ('st_other', %s)" % common_dump.HexDump(f.read8()) + print " ('st_shndx', %s)" % common_dump.HexDump(f.read16()) if f.is64Bit: - print " ('st_value', %d)" % f.read64() - print " ('st_size', %d)" % f.read64() + print " ('st_value', %s)" % common_dump.HexDump(f.read64()) + print " ('st_size', %s)" % common_dump.HexDump(f.read64()) print " )," def dumpRel(f, section, dumprela = False): @@ -127,17 +129,17 @@ for index in range(entries): f.seek(section.sh_offset + index * section.sh_entsize) - print " # Relocation %d" % index - print " (('r_offset', %d)" % f.readWord() + print " # Relocation %s" % common_dump.HexDump(index) + print " (('r_offset', %s)" % common_dump.HexDump(f.readWord()) r_info = f.readWord() if f.is64Bit: - print " ('r_sym', %d)" % (r_info >> 32) - print " ('r_type', %d)" % (r_info & 0xffffffff) + print " ('r_sym', %s)" % common_dump.HexDump((r_info >> 32)) + print " ('r_type', %s)" % common_dump.HexDump((r_info & 0xffffffff)) else: - print " ('r_sym', %d)" % (r_info >> 8) - print " ('r_type', %d)" % (r_info & 0xff) + print " ('r_sym', %s)" % common_dump.HexDump((r_info >> 8)) + print " ('r_type', %s)" % common_dump.HexDump((r_info & 0xff)) if dumprela: - print " ('r_addend', %d)" % f.readWordS() + print " ('r_addend', %s)" % common_dump.HexDump(f.readWordS()) print " )," def dumpELF(path, opts): @@ -152,8 +154,8 @@ elif fileclass == 2: # ELFCLASS64 f.is64Bit = True else: - raise ValueError, "Unknown file class %d" % fileclass - print "('e_indent[EI_CLASS]', %d)" % fileclass + raise ValueError, "Unknown file class %s" % common_dump.HexDump(fileclass) + print "('e_indent[EI_CLASS]', %s)" % common_dump.HexDump(fileclass) byteordering = f.read8() if byteordering == 1: # ELFDATA2LSB @@ -161,32 +163,32 @@ elif byteordering == 2: # ELFDATA2MSB f.isLSB = False else: - raise ValueError, "Unknown byte ordering %d" % byteordering - print "('e_indent[EI_DATA]', %d)" % byteordering + raise ValueError, "Unknown byte ordering %s" % common_dump.HexDump(byteordering) + print "('e_indent[EI_DATA]', %s)" % common_dump.HexDump(byteordering) - print "('e_indent[EI_VERSION]', %d)" % f.read8() - print "('e_indent[EI_OSABI]', %d)" % f.read8() - print "('e_indent[EI_ABIVERSION]', %d)" % f.read8() + print "('e_indent[EI_VERSION]', %s)" % common_dump.HexDump(f.read8()) + print "('e_indent[EI_OSABI]', %s)" % common_dump.HexDump(f.read8()) + print "('e_indent[EI_ABIVERSION]', %s)" % common_dump.HexDump(f.read8()) f.seek(16) # Seek to end of e_ident. - print "('e_type', %d)" % f.read16() - print "('e_machine', %d)" % f.read16() - print "('e_version', %d)" % f.read32() - print "('e_entry', %d)" % f.readWord() - print "('e_phoff', %d)" % f.readWord() + print "('e_type', %s)" % common_dump.HexDump(f.read16()) + print "('e_machine', %s)" % common_dump.HexDump(f.read16()) + print "('e_version', %s)" % common_dump.HexDump(f.read32()) + print "('e_entry', %s)" % common_dump.HexDump(f.readWord()) + print "('e_phoff', %s)" % common_dump.HexDump(f.readWord()) e_shoff = f.readWord() - print "('e_shoff', %d)" % e_shoff - print "('e_flags', %d)" % f.read32() - print "('e_ehsize', %d)" % f.read16() - print "('e_phentsize', %d)" % f.read16() - print "('e_phnum', %d)" % f.read16() + print "('e_shoff', %s)" % common_dump.HexDump(e_shoff) + print "('e_flags', %s)" % common_dump.HexDump(f.read32()) + print "('e_ehsize', %s)" % common_dump.HexDump(f.read16()) + print "('e_phentsize', %s)" % common_dump.HexDump(f.read16()) + print "('e_phnum', %s)" % common_dump.HexDump(f.read16()) e_shentsize = f.read16() - print "('e_shentsize', %d)" % e_shentsize + print "('e_shentsize', %s)" % common_dump.HexDump(e_shentsize) e_shnum = f.read16() - print "('e_shnum', %d)" % e_shnum + print "('e_shnum', %s)" % common_dump.HexDump(e_shnum) e_shstrndx = f.read16() - print "('e_shstrndx', %d)" % e_shstrndx + print "('e_shstrndx', %s)" % common_dump.HexDump(e_shstrndx) # Read all section headers sections = [] @@ -209,7 +211,7 @@ print "('_sections', [" for index in range(e_shnum): - print " # Section %d" % index + print " # Section %s" % common_dump.HexDump(index) sections[index].dump(shstrtab, f, strtab, opts.dumpSectionData) print "])" From bob.wilson at apple.com Tue Oct 19 12:42:22 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 19 Oct 2010 10:42:22 -0700 Subject: [llvm-commits] [PATCH] Shrink MachineOperand from 40 to 32 bytes In-Reply-To: <02FBA740-0F28-4F5E-B8DF-7224FA2E19DF@2pi.dk> References: <02FBA740-0F28-4F5E-B8DF-7224FA2E19DF@2pi.dk> Message-ID: You could make it marginally less icky by making UnsignedContents into a separate union with RegNo and OffsetLo members. Besides the speedup you measured, this should also help memory usage, so I agree that it's worth putting up with some ickiness. On Oct 19, 2010, at 10:20 AM, Jakob Stoklund Olesen wrote: > Hi, > > The attached patch shrinks MachineOperand from 40 to 32 bytes on 64-bit hosts. > > The Contents union contains pointers, so it becomes 8-byte aligned. That creates padding because the largest member has two pointers and an unsigned. > > The patch moves the unsigned outside the union in a way that makes it pack optimally on both 32-bit and 64-bit hosts. > > It is a bit icky, so I wanted your opinions before committing. > > I measured a (statistically significant) 0.8% speedup of code generation on 64-bit Darwin with the patch applied. > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Oct 19 13:00:03 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 19 Oct 2010 18:00:03 -0000 Subject: [llvm-commits] [llvm] r116831 - in /llvm/trunk/lib/Analysis: AliasAnalysis.cpp AliasAnalysisEvaluator.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp Lint.cpp Message-ID: <20101019180003.196AC2A6C12C@llvm.org> Author: djg Date: Tue Oct 19 13:00:02 2010 New Revision: 116831 URL: http://llvm.org/viewvc/llvm-project?rev=116831&view=rev Log: Change AliasAnalysis and its clients to use uint64_t instead of unsigned for representing object sizes, for consistency with other parts of LLVM. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/Lint.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=116831&r1=116830&r2=116831&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Oct 19 13:00:02 2010 @@ -283,7 +283,7 @@ /// getTypeStoreSize - Return the TargetData store size for the given type, /// if known, or a conservative value otherwise. /// -unsigned AliasAnalysis::getTypeStoreSize(const Type *Ty) { +uint64_t AliasAnalysis::getTypeStoreSize(const Type *Ty) { return TD ? TD->getTypeStoreSize(Ty) : UnknownSize; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=116831&r1=116830&r2=116831&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Oct 19 13:00:02 2010 @@ -168,12 +168,12 @@ // 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 = AliasAnalysis::UnknownSize; + uint64_t I1Size = AliasAnalysis::UnknownSize; const Type *I1ElTy = cast((*I1)->getType())->getElementType(); if (I1ElTy->isSized()) I1Size = AA.getTypeStoreSize(I1ElTy); for (SetVector::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { - unsigned I2Size = AliasAnalysis::UnknownSize; + uint64_t I2Size = AliasAnalysis::UnknownSize; const Type *I2ElTy =cast((*I2)->getType())->getElementType(); if (I2ElTy->isSized()) I2Size = AA.getTypeStoreSize(I2ElTy); @@ -200,7 +200,7 @@ for (SetVector::iterator V = Pointers.begin(), Ve = Pointers.end(); V != Ve; ++V) { - unsigned Size = AliasAnalysis::UnknownSize; + uint64_t Size = AliasAnalysis::UnknownSize; const Type *ElTy = cast((*V)->getType())->getElementType(); if (ElTy->isSized()) Size = AA.getTypeStoreSize(ElTy); Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116831&r1=116830&r2=116831&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Tue Oct 19 13:00:02 2010 @@ -88,7 +88,7 @@ } void AliasSet::addPointer(AliasSetTracker &AST, PointerRec &Entry, - unsigned Size, const MDNode *TBAAInfo, + uint64_t Size, const MDNode *TBAAInfo, bool KnownMustAlias) { assert(!Entry.hasAliasSet() && "Entry already in set!"); @@ -138,7 +138,7 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// -bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size, +bool AliasSet::aliasesPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo, AliasAnalysis &AA) const { if (AliasTy == MustAlias) { @@ -210,7 +210,7 @@ /// that may alias the pointer, merge them together and return the unified set. /// AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr, - unsigned Size, + uint64_t Size, const MDNode *TBAAInfo) { AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) { @@ -229,7 +229,7 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. -bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size, +bool AliasSetTracker::containsPointer(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) const { for (const_iterator I = begin(), E = end(); I != E; ++I) if (!I->Forward && I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) @@ -258,7 +258,7 @@ /// getAliasSetForPointer - Return the alias set that the specified pointer /// lives in. -AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size, +AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, uint64_t Size, const MDNode *TBAAInfo, bool *New) { AliasSet::PointerRec &Entry = getEntryFor(Pointer); @@ -283,7 +283,7 @@ return AliasSets.back(); } -bool AliasSetTracker::add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { +bool AliasSetTracker::add(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) { bool NewPtr; addPointer(Ptr, Size, TBAAInfo, AliasSet::NoModRef, NewPtr); return NewPtr; @@ -414,7 +414,7 @@ } bool -AliasSetTracker::remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { +AliasSetTracker::remove(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) { AliasSet *AS = findAliasSetForPointer(Ptr, Size, TBAAInfo); if (!AS) return false; remove(*AS); @@ -422,7 +422,7 @@ } bool AliasSetTracker::remove(LoadInst *LI) { - unsigned Size = AA.getTypeStoreSize(LI->getType()); + uint64_t Size = AA.getTypeStoreSize(LI->getType()); const MDNode *TBAAInfo = LI->getMetadata(LLVMContext::MD_tbaa); AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size, TBAAInfo); if (!AS) return false; @@ -431,7 +431,7 @@ } bool AliasSetTracker::remove(StoreInst *SI) { - unsigned Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); + uint64_t Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); const MDNode *TBAAInfo = SI->getMetadata(LLVMContext::MD_tbaa); AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size, TBAAInfo); if (!AS) return false; Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=116831&r1=116830&r2=116831&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Oct 19 13:00:02 2010 @@ -98,7 +98,7 @@ /// isObjectSmallerThan - Return true if we can prove that the object specified /// by V is smaller than Size. -static bool isObjectSmallerThan(const Value *V, unsigned Size, +static bool isObjectSmallerThan(const Value *V, uint64_t Size, const TargetData &TD) { const Type *AccessTy; if (const GlobalVariable *GV = dyn_cast(V)) { @@ -552,27 +552,27 @@ // aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP // instruction against another. - AliasResult aliasGEP(const GEPOperator *V1, unsigned V1Size, - const Value *V2, unsigned V2Size, + AliasResult aliasGEP(const GEPOperator *V1, uint64_t V1Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2); // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI // instruction against another. - AliasResult aliasPHI(const PHINode *PN, unsigned PNSize, + AliasResult aliasPHI(const PHINode *PN, uint64_t PNSize, const MDNode *PNTBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo); /// aliasSelect - Disambiguate a Select instruction against another value. - AliasResult aliasSelect(const SelectInst *SI, unsigned SISize, + AliasResult aliasSelect(const SelectInst *SI, uint64_t SISize, const MDNode *SITBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo); - AliasResult aliasCheck(const Value *V1, unsigned V1Size, + AliasResult aliasCheck(const Value *V1, uint64_t V1Size, const MDNode *V1TBAATag, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAATag); }; } // End of anonymous namespace @@ -691,7 +691,7 @@ default: break; case Intrinsic::memcpy: case Intrinsic::memmove: { - unsigned Len = UnknownSize; + uint64_t Len = UnknownSize; if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); @@ -707,7 +707,7 @@ // Since memset is 'accesses arguments' only, the AliasAnalysis base class // will handle it for the variable length case. if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { - unsigned Len = LenCI->getZExtValue(); + uint64_t Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); if (isNoAlias(Location(Dest, Len), Loc)) return NoModRef; @@ -727,7 +727,7 @@ case Intrinsic::atomic_load_umin: if (TD) { Value *Op1 = II->getArgOperand(0); - unsigned Op1Size = TD->getTypeStoreSize(Op1->getType()); + uint64_t Op1Size = TD->getTypeStoreSize(Op1->getType()); MDNode *Tag = II->getMetadata(LLVMContext::MD_tbaa); if (isNoAlias(Location(Op1, Op1Size, Tag), Loc)) return NoModRef; @@ -736,7 +736,7 @@ case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: { - unsigned PtrSize = + uint64_t PtrSize = cast(II->getArgOperand(0))->getZExtValue(); if (isNoAlias(Location(II->getArgOperand(1), PtrSize, @@ -746,7 +746,7 @@ break; } case Intrinsic::invariant_end: { - unsigned PtrSize = + uint64_t PtrSize = cast(II->getArgOperand(1))->getZExtValue(); if (isNoAlias(Location(II->getArgOperand(2), PtrSize, @@ -767,8 +767,8 @@ /// UnderlyingV2 is the same for V2. /// AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, unsigned V1Size, - const Value *V2, unsigned V2Size, +BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2) { @@ -878,8 +878,10 @@ // If our known offset is bigger than the access size, we know we don't have // an alias. if (GEP1BaseOffset) { - if (GEP1BaseOffset >= (int64_t)V2Size || - GEP1BaseOffset <= -(int64_t)V1Size) + if (GEP1BaseOffset >= 0 ? + (V2Size != UnknownSize && (uint64_t)GEP1BaseOffset >= V2Size) : + (V1Size != UnknownSize && -(uint64_t)GEP1BaseOffset >= V1Size && + GEP1BaseOffset != INT64_MIN)) return NoAlias; } @@ -889,9 +891,9 @@ /// aliasSelect - Provide a bunch of ad-hoc rules to disambiguate a Select /// instruction against another. AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasSelect(const SelectInst *SI, unsigned SISize, +BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize, const MDNode *SITBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { // If this select has been visited before, we're on a use-def cycle. // Such cycles are only valid when PHI nodes are involved or in unreachable @@ -939,9 +941,9 @@ // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI instruction // against another. AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasPHI(const PHINode *PN, unsigned PNSize, +BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize, const MDNode *PNTBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { // The PHI node has already been visited, avoid recursion any further. if (!Visited.insert(PN)) @@ -1013,9 +1015,9 @@ // such as array references. // AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, +BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size, const MDNode *V1TBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { // If either of the memory references is empty, it doesn't matter what the // pointer values are. Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=116831&r1=116830&r2=116831&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Oct 19 13:00:02 2010 @@ -70,7 +70,7 @@ void visitCallSite(CallSite CS); void visitMemoryReference(Instruction &I, Value *Ptr, - unsigned Size, unsigned Align, + uint64_t Size, unsigned Align, const Type *Ty, unsigned Flags); void visitCallInst(CallInst &I); @@ -277,7 +277,7 @@ // Check that the memcpy arguments don't overlap. The AliasAnalysis API // isn't expressive enough for what we really want to do. Known partial // overlap is not distinguished from the case where nothing is known. - unsigned Size = 0; + uint64_t Size = 0; if (const ConstantInt *Len = dyn_cast(findValue(MCI->getLength(), /*OffsetOk=*/false))) @@ -361,7 +361,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, + Value *Ptr, uint64_t Size, unsigned Align, const Type *Ty, unsigned Flags) { // If no memory is being referenced, it doesn't matter if the pointer // is valid. From resistor at mac.com Tue Oct 19 13:02:07 2010 From: resistor at mac.com (Owen Anderson) Date: Tue, 19 Oct 2010 18:02:07 -0000 Subject: [llvm-commits] [llvm] r116832 - /llvm/trunk/include/llvm/PassSupport.h Message-ID: <20101019180207.1CC2A2A6C12C@llvm.org> Author: resistor Date: Tue Oct 19 13:02:06 2010 New Revision: 116832 URL: http://llvm.org/viewvc/llvm-project?rev=116832&view=rev Log: Factor out the call-once implementation into its own macro. Modified: llvm/trunk/include/llvm/PassSupport.h Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=116832&r1=116831&r2=116832&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Tue Oct 19 13:02:06 2010 @@ -129,6 +129,22 @@ PassInfo(const PassInfo &); // do not implement }; +#define CALL_ONCE_INITIALIZATION(function) \ + static volatile sys::cas_flag initialized = 0; \ + sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ + if (old_val == 0) { \ + function(Registry); \ + sys::MemoryFence(); \ + initialized = 2; \ + } else { \ + sys::cas_flag tmp = initialized; \ + sys::MemoryFence(); \ + while (tmp != 2) { \ + tmp = initialized; \ + sys::MemoryFence(); \ + } \ + } \ + #define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \ static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \ @@ -137,20 +153,7 @@ return PI; \ } \ void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ - static volatile sys::cas_flag initialized = 0; \ - sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ - if (old_val == 0) { \ - initialize##passName##PassOnce(Registry); \ - sys::MemoryFence(); \ - initialized = 2; \ - } else { \ - sys::cas_flag tmp = initialized; \ - sys::MemoryFence(); \ - while (tmp != 2) { \ - tmp = initialized; \ - sys::MemoryFence(); \ - } \ - } \ + CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ } #define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis) \ @@ -168,20 +171,7 @@ return PI; \ } \ void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ - static volatile sys::cas_flag initialized = 0; \ - sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ - if (old_val == 0) { \ - initialize##passName##PassOnce(Registry); \ - sys::MemoryFence(); \ - initialized = 2; \ - } else { \ - sys::cas_flag tmp = initialized; \ - sys::MemoryFence(); \ - while (tmp != 2) { \ - tmp = initialized; \ - sys::MemoryFence(); \ - } \ - } \ + CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ } template @@ -266,20 +256,7 @@ return AI; \ } \ void llvm::initialize##agName##AnalysisGroup(PassRegistry &Registry) { \ - static volatile sys::cas_flag initialized = 0; \ - sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ - if (old_val == 0) { \ - initialize##agName##AnalysisGroupOnce(Registry); \ - sys::MemoryFence(); \ - initialized = 2; \ - } else { \ - sys::cas_flag tmp = initialized; \ - sys::MemoryFence(); \ - while (tmp != 2) { \ - tmp = initialized; \ - sys::MemoryFence(); \ - } \ - } \ + CALL_ONCE_INITIALIZATION(initialize##agName##AnalysisGroupOnce) \ } @@ -295,20 +272,7 @@ return AI; \ } \ void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ - static volatile sys::cas_flag initialized = 0; \ - sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ - if (old_val == 0) { \ - initialize##passName##PassOnce(Registry); \ - sys::MemoryFence(); \ - initialized = 2; \ - } else { \ - sys::cas_flag tmp = initialized; \ - sys::MemoryFence(); \ - while (tmp != 2) { \ - tmp = initialized; \ - sys::MemoryFence(); \ - } \ - } \ + CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ } @@ -326,20 +290,7 @@ return AI; \ } \ void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ - static volatile sys::cas_flag initialized = 0; \ - sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ - if (old_val == 0) { \ - initialize##passName##PassOnce(Registry); \ - sys::MemoryFence(); \ - initialized = 2; \ - } else { \ - sys::cas_flag tmp = initialized; \ - sys::MemoryFence(); \ - while (tmp != 2) { \ - tmp = initialized; \ - sys::MemoryFence(); \ - } \ - } \ + CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ } //===--------------------------------------------------------------------------- From bigcheesegs at gmail.com Tue Oct 19 13:04:06 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 19 Oct 2010 18:04:06 -0000 Subject: [llvm-commits] [llvm] r116833 - /llvm/trunk/utils/unittest/CMakeLists.txt Message-ID: <20101019180406.D38F42A6C12C@llvm.org> Author: mspencer Date: Tue Oct 19 13:04:06 2010 New Revision: 116833 URL: http://llvm.org/viewvc/llvm-project?rev=116833&view=rev Log: Fix VC2010 build. Modified: llvm/trunk/utils/unittest/CMakeLists.txt Modified: llvm/trunk/utils/unittest/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/CMakeLists.txt?rev=116833&r1=116832&r2=116833&view=diff ============================================================================== --- llvm/trunk/utils/unittest/CMakeLists.txt (original) +++ llvm/trunk/utils/unittest/CMakeLists.txt Tue Oct 19 13:04:06 2010 @@ -26,9 +26,6 @@ set(LLVM_REQUIRES_RTTI 1) add_definitions( -DGTEST_HAS_RTTI=0 ) -# libstdc++'s TR1 header depends on RTTI and uses C++'0x features not -# supported by Clang, so force googletest to use its own tuple implementation. -add_definitions( -DGTEST_USE_OWN_TR1_TUPLE ) add_llvm_library(gtest googletest/gtest.cc From bigcheesegs at gmail.com Tue Oct 19 13:04:19 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 19 Oct 2010 18:04:19 -0000 Subject: [llvm-commits] [llvm] r116834 - /llvm/trunk/unittests/CMakeLists.txt Message-ID: <20101019180419.9BE852A6C12C@llvm.org> Author: mspencer Date: Tue Oct 19 13:04:19 2010 New Revision: 116834 URL: http://llvm.org/viewvc/llvm-project?rev=116834&view=rev Log: unittests: Use the correct defines and global variables when building on CMake. Modified: llvm/trunk/unittests/CMakeLists.txt Modified: llvm/trunk/unittests/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=116834&r1=116833&r2=116834&view=diff ============================================================================== --- llvm/trunk/unittests/CMakeLists.txt (original) +++ llvm/trunk/unittests/CMakeLists.txt Tue Oct 19 13:04:19 2010 @@ -13,6 +13,8 @@ endfunction() include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) +set(LLVM_REQUIRES_RTTI 1) +add_definitions(-DGTEST_HAS_RTTI=0) set(LLVM_LINK_COMPONENTS jit From gohman at apple.com Tue Oct 19 13:08:27 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 19 Oct 2010 18:08:27 -0000 Subject: [llvm-commits] [llvm] r116839 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/AliasSetTracker.h lib/Transforms/Scalar/DeadStoreElimination.cpp lib/Transforms/Scalar/MemCpyOptimizer.cpp Message-ID: <20101019180827.7A58F2A6C12C@llvm.org> Author: djg Date: Tue Oct 19 13:08:27 2010 New Revision: 116839 URL: http://llvm.org/viewvc/llvm-project?rev=116839&view=rev Log: Oops, check in all the files for converting AliasAnalysis to use uint64_t. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=116839&r1=116838&r2=116839&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Oct 19 13:08:27 2010 @@ -67,7 +67,7 @@ /// UnknownSize - This is a special value which can be used with the /// size arguments in alias queries to indicate that the caller does not /// know the sizes of the potential memory references. - static unsigned const UnknownSize = ~0u; + static uint64_t const UnknownSize = ~UINT64_C(0); /// getTargetData - Return a pointer to the current TargetData object, or /// null if no TargetData object is available. @@ -77,7 +77,7 @@ /// getTypeStoreSize - Return the TargetData store size for the given type, /// if known, or a conservative value otherwise. /// - unsigned getTypeStoreSize(const Type *Ty); + uint64_t getTypeStoreSize(const Type *Ty); //===--------------------------------------------------------------------===// /// Alias Queries... @@ -88,13 +88,13 @@ /// Ptr - The address of the start of the location. const Value *Ptr; /// Size - The size of the location. - unsigned Size; + uint64_t Size; /// TBAATag - The metadata node which describes the TBAA type of /// the location, or null if there is no (unique) tag. const MDNode *TBAATag; explicit Location(const Value *P = 0, - unsigned S = UnknownSize, + uint64_t S = UnknownSize, const MDNode *N = 0) : Ptr(P), Size(S), TBAATag(N) {} @@ -129,8 +129,8 @@ virtual AliasResult alias(const Location &LocA, const Location &LocB); /// alias - A convenience wrapper. - AliasResult alias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { + AliasResult alias(const Value *V1, uint64_t V1Size, + const Value *V2, uint64_t V2Size) { return alias(Location(V1, V1Size), Location(V2, V2Size)); } @@ -146,8 +146,8 @@ } /// isNoAlias - A convenience wrapper. - bool isNoAlias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { + bool isNoAlias(const Value *V1, uint64_t V1Size, + const Value *V2, uint64_t V2Size) { return isNoAlias(Location(V1, V1Size), Location(V2, V2Size)); } @@ -278,7 +278,7 @@ /// getModRefInfo - A convenience wrapper. ModRefResult getModRefInfo(const Instruction *I, - const Value *P, unsigned Size) { + const Value *P, uint64_t Size) { return getModRefInfo(I, Location(P, Size)); } @@ -289,7 +289,7 @@ /// getModRefInfo (for call sites) - A convenience wrapper. ModRefResult getModRefInfo(ImmutableCallSite CS, - const Value *P, unsigned Size) { + const Value *P, uint64_t Size) { return getModRefInfo(CS, Location(P, Size)); } @@ -300,7 +300,7 @@ } /// getModRefInfo (for calls) - A convenience wrapper. - ModRefResult getModRefInfo(const CallInst *C, const Value *P, unsigned Size) { + ModRefResult getModRefInfo(const CallInst *C, const Value *P, uint64_t Size) { return getModRefInfo(C, Location(P, Size)); } @@ -313,7 +313,7 @@ /// getModRefInfo (for invokes) - A convenience wrapper. ModRefResult getModRefInfo(const InvokeInst *I, - const Value *P, unsigned Size) { + const Value *P, uint64_t Size) { return getModRefInfo(I, Location(P, Size)); } @@ -322,7 +322,7 @@ ModRefResult getModRefInfo(const LoadInst *L, const Location &Loc); /// getModRefInfo (for loads) - A convenience wrapper. - ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size) { + ModRefResult getModRefInfo(const LoadInst *L, const Value *P, uint64_t Size) { return getModRefInfo(L, Location(P, Size)); } @@ -331,7 +331,7 @@ ModRefResult getModRefInfo(const StoreInst *S, const Location &Loc); /// getModRefInfo (for stores) - A convenience wrapper. - ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) { + ModRefResult getModRefInfo(const StoreInst *S, const Value *P, uint64_t Size) { return getModRefInfo(S, Location(P, Size)); } @@ -340,7 +340,7 @@ ModRefResult getModRefInfo(const VAArgInst* I, const Location &Loc); /// getModRefInfo (for va_args) - A convenience wrapper. - ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, unsigned Size) { + ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, uint64_t Size) { return getModRefInfo(I, Location(P, Size)); } @@ -360,7 +360,7 @@ bool canBasicBlockModify(const BasicBlock &BB, const Location &Loc); /// canBasicBlockModify - A convenience wrapper. - bool canBasicBlockModify(const BasicBlock &BB, const Value *P, unsigned Size){ + bool canBasicBlockModify(const BasicBlock &BB, const Value *P, uint64_t Size){ return canBasicBlockModify(BB, Location(P, Size)); } @@ -373,7 +373,7 @@ /// canInstructionRangeModify - A convenience wrapper. bool canInstructionRangeModify(const Instruction &I1, const Instruction &I2, - const Value *Ptr, unsigned Size) { + const Value *Ptr, uint64_t Size) { return canInstructionRangeModify(I1, I2, Location(Ptr, Size)); } Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=116839&r1=116838&r2=116839&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Tue Oct 19 13:08:27 2010 @@ -40,7 +40,7 @@ Value *Val; // The pointer this record corresponds to. PointerRec **PrevInList, *NextInList; AliasSet *AS; - unsigned Size; + uint64_t Size; const MDNode *TBAAInfo; public: PointerRec(Value *V) @@ -57,7 +57,7 @@ return &NextInList; } - void updateSizeAndTBAAInfo(unsigned NewSize, const MDNode *NewTBAAInfo) { + void updateSizeAndTBAAInfo(uint64_t NewSize, const MDNode *NewTBAAInfo) { if (NewSize > Size) Size = NewSize; if (TBAAInfo == DenseMapInfo::getEmptyKey()) @@ -68,7 +68,7 @@ TBAAInfo = DenseMapInfo::getTombstoneKey(); } - unsigned getSize() const { return Size; } + uint64_t getSize() const { return Size; } /// getTBAAInfo - Return the TBAAInfo, or null if there is no /// information or conflicting information. @@ -205,7 +205,7 @@ value_type *operator->() const { return &operator*(); } Value *getPointer() const { return CurNode->getValue(); } - unsigned getSize() const { return CurNode->getSize(); } + uint64_t getSize() const { return CurNode->getSize(); } const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement @@ -250,7 +250,7 @@ void removeFromTracker(AliasSetTracker &AST); - void addPointer(AliasSetTracker &AST, PointerRec &Entry, unsigned Size, + void addPointer(AliasSetTracker &AST, PointerRec &Entry, uint64_t Size, const MDNode *TBAAInfo, bool KnownMustAlias = false); void addCallSite(CallSite CS, AliasAnalysis &AA); @@ -266,7 +266,7 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// - bool aliasesPointer(const Value *Ptr, unsigned Size, const MDNode *TBAAInfo, + bool aliasesPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo, AliasAnalysis &AA) const; bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const; }; @@ -320,7 +320,7 @@ /// These methods return true if inserting the instruction resulted in the /// addition of a new alias set (i.e., the pointer did not alias anything). /// - bool add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); // Add a location + bool add(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); // Add a location bool add(LoadInst *LI); bool add(StoreInst *SI); bool add(VAArgInst *VAAI); @@ -335,7 +335,7 @@ /// be aliased by the specified instruction. These methods return true if any /// alias sets were eliminated. // Remove a location - bool remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); + bool remove(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); bool remove(LoadInst *LI); bool remove(StoreInst *SI); bool remove(VAArgInst *VAAI); @@ -355,13 +355,13 @@ /// lives in. If the New argument is non-null, this method sets the value to /// true if a new alias set is created to contain the pointer (because the /// pointer didn't alias anything). - AliasSet &getAliasSetForPointer(Value *P, unsigned Size, + AliasSet &getAliasSetForPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo, bool *New = 0); /// getAliasSetForPointerIfExists - Return the alias set containing the /// location specified if one exists, otherwise return null. - AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size, + AliasSet *getAliasSetForPointerIfExists(Value *P, uint64_t Size, const MDNode *TBAAInfo) { return findAliasSetForPointer(P, Size, TBAAInfo); } @@ -369,7 +369,7 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. - bool containsPointer(Value *P, unsigned Size, const MDNode *TBAAInfo) const; + bool containsPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo) const; /// getAliasAnalysis - Return the underlying alias analysis object used by /// this tracker. @@ -416,7 +416,7 @@ return *Entry; } - AliasSet &addPointer(Value *P, unsigned Size, const MDNode *TBAAInfo, + AliasSet &addPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo, AliasSet::AccessType E, bool &NewSet) { NewSet = false; @@ -424,7 +424,7 @@ AS.AccessTy |= E; return AS; } - AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size, + AliasSet *findAliasSetForPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); AliasSet *findAliasSetForCallSite(CallSite CS); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=116839&r1=116838&r2=116839&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Oct 19 13:08:27 2010 @@ -79,7 +79,7 @@ AU.addPreserved(); } - unsigned getPointerSize(Value *V) const; + uint64_t getPointerSize(Value *V) const; }; } @@ -373,7 +373,7 @@ } Value *killPointer = 0; - unsigned killPointerSize = AliasAnalysis::UnknownSize; + uint64_t killPointerSize = AliasAnalysis::UnknownSize; // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst *L = dyn_cast(BBI)) { @@ -565,7 +565,7 @@ } while (!NowDeadInsts.empty()); } -unsigned DSE::getPointerSize(Value *V) const { +uint64_t DSE::getPointerSize(Value *V) const { if (TD) { if (AllocaInst *A = dyn_cast(V)) { // Get size information for the alloca Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=116839&r1=116838&r2=116839&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Tue Oct 19 13:08:27 2010 @@ -772,7 +772,7 @@ // If the memmove is a constant size, use it for the alias query, this allows // us to optimize things like: memmove(P, P+64, 64); - unsigned MemMoveSize = AliasAnalysis::UnknownSize; + uint64_t MemMoveSize = AliasAnalysis::UnknownSize; if (ConstantInt *Len = dyn_cast(M->getLength())) MemMoveSize = Len->getZExtValue(); From eli.friedman at gmail.com Tue Oct 19 13:29:48 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Tue, 19 Oct 2010 11:29:48 -0700 Subject: [llvm-commits] [Review request] clang bug 8355: generating wrong code due to incorrect name mangling In-Reply-To: <44413.10.0.7.178.1287321144.squirrel@webmail.cantab.net> References: <44413.10.0.7.178.1287321144.squirrel@webmail.cantab.net> Message-ID: On Sun, Oct 17, 2010 at 6:12 AM, Richard Smith wrote: > Hello, > > While porting a large C++ codebase to clang, I found a bug where incorrect > code would be generated if two polymorphic classes with the same name were > defined within a function -- specifically, the name mangling code didn't > fall into the case and gave the same mangled name for both > vtables. This is filed as bug#8355. > > The attached patch corrects this behaviour. I've also changed the > discriminator numbering for local classes to more closely match the > Itanium C++ ABI and g++ -- the numbering is now incremented for each > top-level type within a function, and not for each mangled local name. > > I'd appreciate any review comments you might have. Please CC me on any > replies. 1) Please send clang patches to cfe-commits, not here. 2) In case you didn't spot it, see clang r116752 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20101018/035564.html). -Eli From ofv at wanadoo.es Tue Oct 19 13:39:16 2010 From: ofv at wanadoo.es (=?utf-8?Q?=C3=93scar_Fuentes?=) Date: Tue, 19 Oct 2010 20:39:16 +0200 Subject: [llvm-commits] [llvm] r116834 - /llvm/trunk/unittests/CMakeLists.txt References: <20101019180419.9BE852A6C12C@llvm.org> Message-ID: <87y69uvxgr.fsf@telefonica.net> "Michael J. Spencer" writes: > Author: mspencer > Date: Tue Oct 19 13:04:19 2010 > New Revision: 116834 > > URL: http://llvm.org/viewvc/llvm-project?rev=116834&view=rev > Log: > unittests: Use the correct defines and global variables when building on CMake. > > Modified: > llvm/trunk/unittests/CMakeLists.txt > > Modified: llvm/trunk/unittests/CMakeLists.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=116834&r1=116833&r2=116834&view=diff > ============================================================================== > --- llvm/trunk/unittests/CMakeLists.txt (original) > +++ llvm/trunk/unittests/CMakeLists.txt Tue Oct 19 13:04:19 2010 > @@ -13,6 +13,8 @@ > endfunction() > > include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) > +set(LLVM_REQUIRES_RTTI 1) > +add_definitions(-DGTEST_HAS_RTTI=0) This is not what the corresponding Makefile does. If you must diverge from the settings on the Makefile's (both on unittests/CMakeLists.txt and tools/unittests/CMakeLists.txt) please leave a comment explaining the reason. From evan.cheng at apple.com Tue Oct 19 13:58:51 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 19 Oct 2010 18:58:51 -0000 Subject: [llvm-commits] [llvm] r116845 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/MachineLICM.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h test/CodeGen/ARM/remat.ll test/CodeGen/Thumb2/machine-licm-vdup.ll test/CodeGen/X86/2008-10-27-CoalescerBug.ll test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Message-ID: <20101019185851.713E62A6C12C@llvm.org> Author: evancheng Date: Tue Oct 19 13:58:51 2010 New Revision: 116845 URL: http://llvm.org/viewvc/llvm-project?rev=116845&view=rev Log: Re-enable register pressure aware machine licm with fixes. Hoist() may have erased the instruction during LICM so UpdateRegPressureAfter() should not reference it afterwards. Removed: llvm/trunk/test/CodeGen/ARM/remat.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Tue Oct 19 13:58:51 2010 @@ -24,6 +24,7 @@ class LiveVariables; class MCAsmInfo; class MachineMemOperand; +class MachineRegisterInfo; class MDNode; class MCInst; class SDNode; @@ -625,6 +626,19 @@ int getOperandLatency(const InstrItineraryData *ItinData, SDNode *DefNode, unsigned DefIdx, SDNode *UseNode, unsigned UseIdx) const; + + /// hasHighOperandLatency - Compute operand latency between a def of 'Reg' + /// and an use in the current loop, return true if the target considered + /// it 'high'. This is used by optimization passes such as machine LICM to + /// determine whether it makes sense to hoist an instruction out even in + /// high register pressure situation. + virtual + bool hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const { + return false; + } }; /// TargetInstrInfoImpl - This is the default implementation of Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Tue Oct 19 13:58:51 2010 @@ -43,11 +43,6 @@ using namespace llvm; -static cl::opt -TrackRegPressure("rp-aware-machine-licm", - cl::desc("Register pressure aware machine LICM"), - cl::init(false), cl::Hidden); - STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops"); STATISTIC(NumLowRP, @@ -128,6 +123,7 @@ RegSeen.clear(); RegPressure.clear(); RegLimit.clear(); + BackTrace.clear(); for (DenseMap >::iterator CI = CSEMap.begin(), CE = CSEMap.end(); CI != CE; ++CI) CI->second.clear(); @@ -175,9 +171,10 @@ /// bool IsLoopInvariantInst(MachineInstr &I); - /// ComputeOperandLatency - Compute operand latency between a def of 'Reg' - /// and an use in the current loop. - int ComputeOperandLatency(MachineInstr &MI, unsigned DefIdx, unsigned Reg); + /// HasHighOperandLatency - Compute operand latency between a def of 'Reg' + /// and an use in the current loop, return true if the target considered + /// it 'high'. + bool HasHighOperandLatency(MachineInstr &MI, unsigned DefIdx, unsigned Reg); /// IncreaseHighRegPressure - Visit BBs from preheader to current BB, check /// if hoisting an instruction of the given cost matrix can cause high @@ -203,8 +200,9 @@ /// UpdateRegPressureBefore / UpdateRegPressureAfter - Update estimate of /// register pressure before and after executing a specifi instruction. - void UpdateRegPressureBefore(const MachineInstr *MI); - void UpdateRegPressureAfter(const MachineInstr *MI); + void UpdateRegPressureBefore(const MachineInstr *MI, + SmallVector &Defs); + void UpdateRegPressureAfter(SmallVector &Defs); /// isLoadFromConstantMemory - Return true if the given instruction is a /// load from constant memory. @@ -560,28 +558,26 @@ if (!Preheader) return; - if (TrackRegPressure) { - if (IsHeader) { - // Compute registers which are liveout of preheader. - RegSeen.clear(); - BackTrace.clear(); - InitRegPressure(Preheader); - } - - // Remember livein register pressure. - BackTrace.push_back(RegPressure); + if (IsHeader) { + // Compute registers which are liveout of preheader. + RegSeen.clear(); + BackTrace.clear(); + InitRegPressure(Preheader); } + // Remember livein register pressure. + BackTrace.push_back(RegPressure); + + SmallVector Defs; for (MachineBasicBlock::iterator MII = BB->begin(), E = BB->end(); MII != E; ) { MachineBasicBlock::iterator NextMII = MII; ++NextMII; MachineInstr *MI = &*MII; - if (TrackRegPressure) - UpdateRegPressureBefore(MI); + assert(Defs.empty()); + UpdateRegPressureBefore(MI, Defs); Hoist(MI, Preheader); - if (TrackRegPressure) - UpdateRegPressureAfter(MI); + UpdateRegPressureAfter(Defs); MII = NextMII; } @@ -595,8 +591,7 @@ HoistRegion(Children[I]); } - if (TrackRegPressure) - BackTrace.pop_back(); + BackTrace.pop_back(); } /// InitRegPressure - Find all virtual register references that are liveout of @@ -635,12 +630,13 @@ /// UpdateRegPressureBefore / UpdateRegPressureAfter - Update estimate of /// register pressure before and after executing a specifi instruction. -void MachineLICM::UpdateRegPressureBefore(const MachineInstr *MI) { +void MachineLICM::UpdateRegPressureBefore(const MachineInstr *MI, + SmallVector &Defs) { bool NoImpact = MI->isImplicitDef() || MI->isPHI(); for (unsigned i = 0, e = MI->getDesc().getNumOperands(); i != e; ++i) { const MachineOperand &MO = MI->getOperand(i); - if (!MO.isReg() || MO.isImplicit() || !MO.isUse()) + if (!MO.isReg() || MO.isImplicit()) continue; unsigned Reg = MO.getReg(); if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) @@ -650,33 +646,26 @@ if (NoImpact) continue; - if (!isNew && MO.isKill()) { - const TargetRegisterClass *RC = MRI->getRegClass(Reg); - EVT VT = *RC->vt_begin(); - unsigned RCId = TLI->getRepRegClassFor(VT)->getID(); - unsigned RCCost = TLI->getRepRegClassCostFor(VT); + if (MO.isDef()) + Defs.push_back(Reg); + else { + if (!isNew && MO.isKill()) { + const TargetRegisterClass *RC = MRI->getRegClass(Reg); + EVT VT = *RC->vt_begin(); + unsigned RCId = TLI->getRepRegClassFor(VT)->getID(); + unsigned RCCost = TLI->getRepRegClassCostFor(VT); - assert(RCCost <= RegPressure[RCId]); - RegPressure[RCId] -= RCCost; + assert(RCCost <= RegPressure[RCId]); + RegPressure[RCId] -= RCCost; + } } } } -void MachineLICM::UpdateRegPressureAfter(const MachineInstr *MI) { - bool NoImpact = MI->isImplicitDef() || MI->isPHI(); - - for (unsigned i = 0, e = MI->getDesc().getNumOperands(); i != e; ++i) { - const MachineOperand &MO = MI->getOperand(i); - if (!MO.isReg() || MO.isImplicit() || !MO.isDef()) - continue; - unsigned Reg = MO.getReg(); - if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) - continue; - +void MachineLICM::UpdateRegPressureAfter(SmallVector &Defs) { + while (!Defs.empty()) { + unsigned Reg = Defs.pop_back_val(); RegSeen.insert(Reg); - if (NoImpact) - continue; - const TargetRegisterClass *RC = MRI->getRegClass(Reg); EVT VT = *RC->vt_begin(); unsigned RCId = TLI->getRepRegClassFor(VT)->getID(); @@ -792,15 +781,14 @@ } } -/// ComputeOperandLatency - Compute operand latency between a def of 'Reg' -/// and an use in the current loop. -int MachineLICM::ComputeOperandLatency(MachineInstr &MI, - unsigned DefIdx, unsigned Reg) { +/// HasHighOperandLatency - Compute operand latency between a def of 'Reg' +/// and an use in the current loop, return true if the target considered +/// it 'high'. +bool MachineLICM::HasHighOperandLatency(MachineInstr &MI, + unsigned DefIdx, unsigned Reg) { if (MRI->use_nodbg_empty(Reg)) - // No use? Return arbitrary large number! - return 300; + return false; - int Latency = -1; for (MachineRegisterInfo::use_nodbg_iterator I = MRI->use_nodbg_begin(Reg), E = MRI->use_nodbg_end(); I != E; ++I) { MachineInstr *UseMI = &*I; @@ -814,18 +802,15 @@ if (MOReg != Reg) continue; - int UseCycle = TII->getOperandLatency(InstrItins, &MI, DefIdx, UseMI, i); - Latency = std::max(Latency, UseCycle); + if (TII->hasHighOperandLatency(InstrItins, MRI, &MI, DefIdx, UseMI, i)) + return true; } - if (Latency != -1) - break; + // Only look at the first in loop use. + break; } - if (Latency == -1) - Latency = InstrItins->getOperandCycle(MI.getDesc().getSchedClass(), DefIdx); - - return Latency; + return false; } /// IncreaseHighRegPressure - Visit BBs from preheader to current BB, check @@ -859,19 +844,19 @@ if (MI.isImplicitDef()) return true; - // FIXME: For now, only hoist re-materilizable instructions. LICM will - // increase register pressure. We want to make sure it doesn't increase - // spilling. + // If the instruction is cheap, only hoist if it is re-materilizable. LICM + // will increase register pressure. It's probably not worth it if the + // instruction is cheap. // Also hoist loads from constant memory, e.g. load from stubs, GOT. Hoisting // these tend to help performance in low register pressure situation. The // trade off is it may cause spill in high pressure situation. It will end up // adding a store in the loop preheader. But the reload is no more expensive. // The side benefit is these loads are frequently CSE'ed. - if (!TrackRegPressure || MI.getDesc().isAsCheapAsAMove()) { - if (!TII->isTriviallyReMaterializable(&MI, AA) && - !isLoadFromConstantMemory(&MI)) + if (MI.getDesc().isAsCheapAsAMove()) { + if (!TII->isTriviallyReMaterializable(&MI, AA)) return false; } else { + // Estimate register pressure to determine whether to LICM the instruction. // In low register pressure situation, we can be more aggressive about // hoisting. Also, favors hoisting long latency instructions even in // moderately high pressure situation. @@ -884,13 +869,9 @@ if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue; if (MO.isDef()) { - if (InstrItins && !InstrItins->isEmpty()) { - int Cycle = ComputeOperandLatency(MI, i, Reg); - if (Cycle > 3) { - // FIXME: Target specific high latency limit? - ++NumHighLatency; - return true; - } + if (HasHighOperandLatency(MI, i, Reg)) { + ++NumHighLatency; + return true; } const TargetRegisterClass *RC = MRI->getRegClass(Reg); Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Oct 19 13:58:51 2010 @@ -1925,3 +1925,23 @@ return getOperandLatency(ItinData, DefTID, DefIdx, DefAlign, UseTID, UseIdx, UseAlign); } + +bool ARMBaseInstrInfo:: +hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const { + unsigned DDomain = DefMI->getDesc().TSFlags & ARMII::DomainMask; + unsigned UDomain = UseMI->getDesc().TSFlags & ARMII::DomainMask; + if (Subtarget.isCortexA8() && + (DDomain == ARMII::DomainVFP || UDomain == ARMII::DomainVFP)) + // CortexA8 VFP instructions are not pipelined. + return true; + + // Hoist VFP / NEON instructions with 4 or higher latency. + int Latency = getOperandLatency(ItinData, DefMI, DefIdx, UseMI, UseIdx); + if (Latency <= 3) + return false; + return DDomain == ARMII::DomainVFP || DDomain == ARMII::DomainNEON || + UDomain == ARMII::DomainVFP || UDomain == ARMII::DomainNEON; +} Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Tue Oct 19 13:58:51 2010 @@ -377,6 +377,11 @@ unsigned DefIdx, unsigned DefAlign, const TargetInstrDesc &UseTID, unsigned UseIdx, unsigned UseAlign) const; + + bool hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const; }; static inline Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Oct 19 13:58:51 2010 @@ -3152,6 +3152,41 @@ NopInst.setOpcode(X86::NOOP); } +bool X86InstrInfo:: +hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const { + switch (DefMI->getOpcode()) { + default: return false; + case X86::DIVSDrm: + case X86::DIVSDrm_Int: + case X86::DIVSDrr: + case X86::DIVSDrr_Int: + case X86::DIVSSrm: + case X86::DIVSSrm_Int: + case X86::DIVSSrr: + case X86::DIVSSrr_Int: + case X86::SQRTPDm: + case X86::SQRTPDm_Int: + case X86::SQRTPDr: + case X86::SQRTPDr_Int: + case X86::SQRTPSm: + case X86::SQRTPSm_Int: + case X86::SQRTPSr: + case X86::SQRTPSr_Int: + case X86::SQRTSDm: + case X86::SQRTSDm_Int: + case X86::SQRTSDr: + case X86::SQRTSDr_Int: + case X86::SQRTSSm: + case X86::SQRTSSm_Int: + case X86::SQRTSSr: + case X86::SQRTSSr_Int: + return true; + } +} + namespace { /// CGBR - Create Global Base Reg pass. This initializes the PIC /// global base register for x86-32. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Tue Oct 19 13:58:51 2010 @@ -864,6 +864,11 @@ unsigned OpNum, const SmallVectorImpl &MOs, unsigned Size, unsigned Alignment) const; + + bool hasHighOperandLatency(const InstrItineraryData *ItinData, + const MachineRegisterInfo *MRI, + const MachineInstr *DefMI, unsigned DefIdx, + const MachineInstr *UseMI, unsigned UseIdx) const; private: MachineInstr * convertToThreeAddressWithLEA(unsigned MIOpc, Removed: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=116844&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/remat.ll (original) +++ llvm/trunk/test/CodeGen/ARM/remat.ll (removed) @@ -1,65 +0,0 @@ -; RUN: llc < %s -march=arm -mattr=+v6,+vfp2 -o /dev/null -stats -info-output-file - | grep "Number of re-materialization" - -define i32 @main(i32 %argc, i8** nocapture %argv, double %d1, double %d2) nounwind { -entry: - br i1 undef, label %smvp.exit, label %bb.i3 - -bb.i3: ; preds = %bb.i3, %bb134 - br i1 undef, label %smvp.exit, label %bb.i3 - -smvp.exit: ; preds = %bb.i3 - %0 = fmul double %d1, 2.400000e-03 ; [#uses=2] - br i1 undef, label %bb138.preheader, label %bb159 - -bb138.preheader: ; preds = %smvp.exit - br label %bb138 - -bb138: ; preds = %bb138, %bb138.preheader - br i1 undef, label %bb138, label %bb145.loopexit - -bb142: ; preds = %bb.nph218.bb.nph218.split_crit_edge, %phi0.exit - %1 = fmul double %d1, -1.200000e-03 ; [#uses=1] - %2 = fadd double %d2, %1 ; [#uses=1] - %3 = fmul double %2, %d2 ; [#uses=1] - %4 = fsub double 0.000000e+00, %3 ; [#uses=1] - br i1 %14, label %phi1.exit, label %bb.i35 - -bb.i35: ; preds = %bb142 - %5 = call double @sin(double %15) nounwind readonly ; [#uses=1] - %6 = fmul double %5, 0x4031740AFA84AD8A ; [#uses=1] - %7 = fsub double 1.000000e+00, undef ; [#uses=1] - %8 = fdiv double %7, 6.000000e-01 ; [#uses=1] - br label %phi1.exit - -phi1.exit: ; preds = %bb.i35, %bb142 - %.pn = phi double [ %6, %bb.i35 ], [ 0.000000e+00, %bb142 ] ; [#uses=1] - %9 = phi double [ %8, %bb.i35 ], [ 0.000000e+00, %bb142 ] ; [#uses=1] - %10 = fmul double %.pn, %9 ; [#uses=1] - br i1 %14, label %phi0.exit, label %bb.i - -bb.i: ; preds = %phi1.exit - unreachable - -phi0.exit: ; preds = %phi1.exit - %11 = fsub double %4, %10 ; [#uses=1] - %12 = fadd double 0.000000e+00, %11 ; [#uses=1] - store double %12, double* undef, align 4 - br label %bb142 - -bb145.loopexit: ; preds = %bb138 - br i1 undef, label %bb.nph218.bb.nph218.split_crit_edge, label %bb159 - -bb.nph218.bb.nph218.split_crit_edge: ; preds = %bb145.loopexit - %13 = fmul double %0, 0x401921FB54442D18 ; [#uses=1] - %14 = fcmp ugt double %0, 6.000000e-01 ; [#uses=2] - %15 = fdiv double %13, 6.000000e-01 ; [#uses=1] - br label %bb142 - -bb159: ; preds = %bb145.loopexit, %smvp.exit, %bb134 - unreachable - -bb166: ; preds = %bb127 - unreachable -} - -declare double @sin(double) nounwind readonly Modified: llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll Tue Oct 19 13:58:51 2010 @@ -2,17 +2,16 @@ ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim -arm-vdup-splat | FileCheck %s ; Modified version of machine-licm.ll with -arm-vdup-splat turned on, 8003375. ; Eventually this should become the default and be moved into machine-licm.ll. -; FIXME: the vdup should be hoisted out of the loop, 8248029. define void @t2(i8* %ptr1, i8* %ptr2) nounwind { entry: ; CHECK: t2: ; CHECK: mov.w r3, #1065353216 +; CHECK: vdup.32 q{{.*}}, r3 br i1 undef, label %bb1, label %bb2 bb1: ; CHECK-NEXT: %bb1 -; CHECK: vdup.32 q{{.*}}, r3 %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ] %tmp1 = shl i32 %indvar, 2 %gep1 = getelementptr i8* %ptr1, i32 %tmp1 Modified: llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-10-27-CoalescerBug.ll Tue Oct 19 13:58:51 2010 @@ -1,6 +1,9 @@ -; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& not grep {Number of register spills} +; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -stats |& FileCheck %s +; Now this test spills one register. But a reload in the loop is cheaper than +; the divsd so it's a win. define fastcc void @fourn(double* %data, i32 %isign) nounwind { +; CHECK: fourn entry: br label %bb @@ -11,6 +14,11 @@ %1 = icmp sgt i32 %0, 2 ; [#uses=1] br i1 %1, label %bb30.loopexit, label %bb +; CHECK: %bb30.loopexit +; CHECK: divsd %xmm0 +; CHECK: movsd %xmm0, 16(%esp) +; CHECK: .align +; CHECK-NEXT: %bb3 bb3: ; preds = %bb30.loopexit, %bb25, %bb3 %2 = load i32* null, align 4 ; [#uses=1] %3 = mul i32 %2, 0 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll?rev=116845&r1=116844&r2=116845&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll Tue Oct 19 13:58:51 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -stats |& grep {6 machine-licm} +; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -stats |& grep {7 machine-licm} ; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 | FileCheck %s ; rdar://6627786 ; rdar://7792037 From rafael.espindola at gmail.com Tue Oct 19 14:31:38 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 19 Oct 2010 19:31:38 -0000 Subject: [llvm-commits] [llvm] r116848 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp Message-ID: <20101019193138.197D12A6C12C@llvm.org> Author: rafael Date: Tue Oct 19 14:31:37 2010 New Revision: 116848 URL: http://llvm.org/viewvc/llvm-project?rev=116848&view=rev Log: Small cleanups and fixes in preparation for fixing _GLOBAL_OFFSET_TABLE_. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116848&r1=116847&r2=116848&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Oct 19 14:31:37 2010 @@ -703,9 +703,16 @@ // instead? case X86::reloc_signed_4byte: case X86::reloc_pcrel_4byte: + case FK_Data_4: switch (Modifier) { default: llvm_unreachable("Unimplemented"); + case MCSymbolRefExpr::VK_None: + if (Symbol->getName() == "_GLOBAL_OFFSET_TABLE_") + Type = ELF::R_386_GOTPC; + else + Type = ELF::R_386_32; + break; case MCSymbolRefExpr::VK_GOT: Type = ELF::R_386_GOT32; break; @@ -714,12 +721,6 @@ break; } break; - case FK_Data_4: - if (Symbol->getName() == "_GLOBAL_OFFSET_TABLE_") - Type = ELF::R_386_GOTPC; - else - Type = ELF::R_386_32; - break; case FK_Data_2: Type = ELF::R_386_16; break; case X86::reloc_pcrel_1byte: case FK_Data_1: Type = ELF::R_386_8; break; @@ -761,11 +762,14 @@ static bool isInSymtab(const MCAssembler &Asm, const MCSymbolData &Data, bool Used) { + if (Used) + return true; + const MCSymbol &Symbol = Data.getSymbol(); if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined()) return false; - if (!Used && Symbol.isTemporary()) + if (Symbol.isTemporary()) return false; return true; From wendling at apple.com Tue Oct 19 14:48:25 2010 From: wendling at apple.com (Bill Wendling) Date: Tue, 19 Oct 2010 12:48:25 -0700 Subject: [llvm-commits] [llvm] r116785 - /llvm/trunk/lib/System/Win32/ThreadLocal.inc In-Reply-To: References: <20101019012202.27CB12A6C12C@llvm.org> Message-ID: <0B4E5E66-4CA0-441F-B6B9-D93C1D3F2F1A@apple.com> Or better yet, use the ATTRIBUTE_UNUSED attribute in llvm/Support/Compiler.h. -bw On Oct 19, 2010, at 9:16 AM, Jim Grosbach wrote: > Can you add a comment saying why that line is necessary? Otherwise some well meaning person may remove the "unusued" statement. > > -Jim > > On Oct 18, 2010, at 6:22 PM, NAKAMURA Takumi wrote: > >> Author: chapuni >> Date: Mon Oct 18 20:22:01 2010 >> New Revision: 116785 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=116785&view=rev >> Log: >> lib/System/Win32/ThreadLocal.inc: Suppress "unused" warning on -Asserts. >> >> Modified: >> llvm/trunk/lib/System/Win32/ThreadLocal.inc >> >> Modified: llvm/trunk/lib/System/Win32/ThreadLocal.inc >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/ThreadLocal.inc?rev=116785&r1=116784&r2=116785&view=diff >> ============================================================================== >> --- llvm/trunk/lib/System/Win32/ThreadLocal.inc (original) >> +++ llvm/trunk/lib/System/Win32/ThreadLocal.inc Mon Oct 18 20:22:01 2010 >> @@ -44,6 +44,7 @@ >> DWORD* tls = static_cast(data); >> int errorcode = TlsSetValue(*tls, const_cast(d)); >> assert(errorcode != 0); >> + (void)errorcode; >> } >> >> void ThreadLocalImpl::removeInstance() { >> >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101019/e8a186b3/attachment.html From jasonwkim at google.com Tue Oct 19 14:48:32 2010 From: jasonwkim at google.com (Jason Kim) Date: Tue, 19 Oct 2010 12:48:32 -0700 Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes In-Reply-To: References: <6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com> <8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com> <8E5A9C6C-BA61-41F8-B445-336D9F96D774@apple.com> Message-ID: On Tue, Oct 19, 2010 at 8:01 AM, Rafael Espindola wrote: >> Okay, I just committed the convert (all numbers from elf-dump are now >> hex) as r116753. > > I noticed that was reverted. The first thing is to fix it and commit > again. Once it is in: > > + > + ? ?case ELF::SHT_ARM_EXIDX: > + ? ?case ELF::SHT_ARM_PREEMPTMAP: > + ? ? ?assert(0 && "FIXME: sh_type value not supported!"); > + ? ? ?break; > + > + ? ?case ELF::SHT_ARM_ATTRIBUTES: > + ? ? ?break; > + > + ? ?case ELF::SHT_ARM_DEBUGOVERLAY: > + ? ?case ELF::SHT_ARM_OVERLAYSECTION: > ? ? default: > ? ? ? assert(0 && "FIXME: sh_type value not supported!"); > ? ? ? break; > > The two new cases are exactly like the default. Same for the last two > new one. Can you just use the default? Another option is to list every > enum value and remove the default so that we get a warning if one is > missing. Not sure if there are two many for this to be practical. It is new code, and the 5 cases I added (in order of their numeric values) are the complete set of ARM specific sections. I guess having only active ones be 'cased' makes sense too. I'll do your first suggestion. I removed the 3 dangling explicitly unsupported cases, and have them fall through to default. Now only explicitly supported cases are listed in the switch. Hope this is OK. > > It still looks like you are creating more class members than you need > to. Take headFragment for example. It is only assigned in one place in > the code, emitARMAttributeSection. emitARMAttributeSection is only > called once in emitAttributes. emitARMAttributeSection can "return" > the headFragment and that can then be passed to fixupAttrSizes. I humbly beg to differ on this one :-) Since emitARMAttributeSection() gets called both for .s and .o, I don't think it makes sense for it to a MCDataFragment when it is emitting a .s It seems cleaner for it to just return nothing and save some state (in case of .o emission only) instead of passing a bunch of pointer values trampoline fashion in case of .o emission to save some slots. Even if it were to return the headFragment, what about the currFileFragment? (and possibly the currSectionFragment and currSymbolFragment in the future?) The currFileFragment is needed elsewhere, so it makes sense to save it somewhere. If it makes sense to store one blob, why not its container? Does this make sense? Am I missing something? > Cheers, > -- > Rafael ?vila de Esp?ndola > Thanks! -------------- next part -------------- A non-text attachment was scrubbed... Name: arm-mc-elf-s06.patch6 Type: application/octet-stream Size: 12330 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101019/d21d5ca4/attachment.obj From wendling at apple.com Tue Oct 19 14:54:18 2010 From: wendling at apple.com (Bill Wendling) Date: Tue, 19 Oct 2010 12:54:18 -0700 Subject: [llvm-commits] [llvm] r116832 - /llvm/trunk/include/llvm/PassSupport.h In-Reply-To: <20101019180207.1CC2A2A6C12C@llvm.org> References: <20101019180207.1CC2A2A6C12C@llvm.org> Message-ID: <81A42438-0387-4554-82A3-4EA74BF54D68@apple.com> On Oct 19, 2010, at 11:02 AM, Owen Anderson wrote: > Author: resistor > Date: Tue Oct 19 13:02:06 2010 > New Revision: 116832 > > URL: http://llvm.org/viewvc/llvm-project?rev=116832&view=rev > Log: > Factor out the call-once implementation into its own macro. > > Modified: > llvm/trunk/include/llvm/PassSupport.h > > Modified: llvm/trunk/include/llvm/PassSupport.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=116832&r1=116831&r2=116832&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/PassSupport.h (original) > +++ llvm/trunk/include/llvm/PassSupport.h Tue Oct 19 13:02:06 2010 > @@ -129,6 +129,22 @@ > PassInfo(const PassInfo &); // do not implement > }; > > +#define CALL_ONCE_INITIALIZATION(function) \ > + static volatile sys::cas_flag initialized = 0; \ > + sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \ > + if (old_val == 0) { \ > + function(Registry); \ > + sys::MemoryFence(); \ > + initialized = 2; \ > + } else { \ > + sys::cas_flag tmp = initialized; \ > + sys::MemoryFence(); \ > + while (tmp != 2) { \ > + tmp = initialized; \ > + sys::MemoryFence(); \ > + } \ > + } \ > + Could you remove the final backslash here? It's not needed and relies upon proper spacing in the file. (And is a pet peeve of mine. :-) -bw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101019/9fff07d7/attachment.html From resistor at mac.com Tue Oct 19 14:54:48 2010 From: resistor at mac.com (Owen Anderson) Date: Tue, 19 Oct 2010 19:54:48 -0000 Subject: [llvm-commits] [llvm] r116851 - /llvm/trunk/include/llvm/PassSupport.h Message-ID: <20101019195448.617CF2A6C12C@llvm.org> Author: resistor Date: Tue Oct 19 14:54:48 2010 New Revision: 116851 URL: http://llvm.org/viewvc/llvm-project?rev=116851&view=rev Log: Remove extraneous slash. Modified: llvm/trunk/include/llvm/PassSupport.h Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=116851&r1=116850&r2=116851&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Tue Oct 19 14:54:48 2010 @@ -143,7 +143,7 @@ tmp = initialized; \ sys::MemoryFence(); \ } \ - } \ + } #define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \ static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ From dalej at apple.com Tue Oct 19 15:00:17 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 19 Oct 2010 20:00:17 -0000 Subject: [llvm-commits] [llvm] r116852 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/Thumb2/machine-licm-vdup.ll test/CodeGen/Thumb2/machine-licm.ll Message-ID: <20101019200017.A28342A6C12C@llvm.org> Author: johannes Date: Tue Oct 19 15:00:17 2010 New Revision: 116852 URL: http://llvm.org/viewvc/llvm-project?rev=116852&view=rev Log: Enable using vdup for vector constants which are splat of integers by default, and remove the controlling flag, now that LICM will hoist such vdup's. 8003375. Removed: llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=116852&r1=116851&r2=116852&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Oct 19 15:00:17 2010 @@ -59,13 +59,6 @@ cl::desc("Generate tail calls (TEMPORARY OPTION)."), cl::init(false)); -// This option should go away when Machine LICM is smart enough to hoist a -// reg-to-reg VDUP. -static cl::opt -EnableARMVDUPsplat("arm-vdup-splat", cl::Hidden, - cl::desc("Generate VDUP for integer constant splats (TEMPORARY OPTION)."), - cl::init(false)); - static cl::opt EnableARMLongCalls("arm-long-calls", cl::Hidden, cl::desc("Generate calls via indirect call instructions"), @@ -3442,26 +3435,24 @@ unsigned EltSize = VT.getVectorElementType().getSizeInBits(); - if (EnableARMVDUPsplat) { - // Use VDUP for non-constant splats. For f32 constant splats, reduce to - // i32 and try again. - if (usesOnlyOneValue && EltSize <= 32) { - if (!isConstant) - return DAG.getNode(ARMISD::VDUP, dl, VT, Value); - if (VT.getVectorElementType().isFloatingPoint()) { - SmallVector Ops; - for (unsigned i = 0; i < NumElts; ++i) - Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, dl, MVT::i32, - Op.getOperand(i))); - SDValue Val = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, &Ops[0], - NumElts); - return DAG.getNode(ISD::BIT_CONVERT, dl, VT, - LowerBUILD_VECTOR(Val, DAG, ST)); - } - SDValue Val = IsSingleInstrConstant(Value, DAG, ST, dl); - if (Val.getNode()) - return DAG.getNode(ARMISD::VDUP, dl, VT, Val); - } + // Use VDUP for non-constant splats. For f32 constant splats, reduce to + // i32 and try again. + if (usesOnlyOneValue && EltSize <= 32) { + if (!isConstant) + return DAG.getNode(ARMISD::VDUP, dl, VT, Value); + if (VT.getVectorElementType().isFloatingPoint()) { + SmallVector Ops; + for (unsigned i = 0; i < NumElts; ++i) + Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, dl, MVT::i32, + Op.getOperand(i))); + SDValue Val = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, &Ops[0], + NumElts); + return DAG.getNode(ISD::BIT_CONVERT, dl, VT, + LowerBUILD_VECTOR(Val, DAG, ST)); + } + SDValue Val = IsSingleInstrConstant(Value, DAG, ST, dl); + if (Val.getNode()) + return DAG.getNode(ARMISD::VDUP, dl, VT, Val); } // If all elements are constants and the case above didn't get hit, fall back @@ -3470,12 +3461,6 @@ if (isConstant) return SDValue(); - if (!EnableARMVDUPsplat) { - // Use VDUP for non-constant splats. - if (usesOnlyOneValue && EltSize <= 32) - return DAG.getNode(ARMISD::VDUP, dl, VT, Value); - } - // Vectors with 32- or 64-bit elements can be built by directly assigning // the subregisters. Lower it to an ARMISD::BUILD_VECTOR so the operands // will be legalized. Removed: llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll?rev=116851&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/machine-licm-vdup.ll (removed) @@ -1,37 +0,0 @@ -; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -disable-fp-elim -arm-vdup-splat | FileCheck %s -; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim -arm-vdup-splat | FileCheck %s -; Modified version of machine-licm.ll with -arm-vdup-splat turned on, 8003375. -; Eventually this should become the default and be moved into machine-licm.ll. - -define void @t2(i8* %ptr1, i8* %ptr2) nounwind { -entry: -; CHECK: t2: -; CHECK: mov.w r3, #1065353216 -; CHECK: vdup.32 q{{.*}}, r3 - br i1 undef, label %bb1, label %bb2 - -bb1: -; CHECK-NEXT: %bb1 - %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ] - %tmp1 = shl i32 %indvar, 2 - %gep1 = getelementptr i8* %ptr1, i32 %tmp1 - %tmp2 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* %gep1, i32 1) - %tmp3 = call <4 x float> @llvm.arm.neon.vmaxs.v4f32(<4 x float> , <4 x float> %tmp2) - %gep2 = getelementptr i8* %ptr2, i32 %tmp1 - call void @llvm.arm.neon.vst1.v4f32(i8* %gep2, <4 x float> %tmp3, i32 1) - %indvar.next = add i32 %indvar, 1 - %cond = icmp eq i32 %indvar.next, 10 - br i1 %cond, label %bb2, label %bb1 - -bb2: - ret void -} - -; CHECK-NOT: LCPI1_0: -; CHECK: .subsections_via_symbols - -declare <4 x float> @llvm.arm.neon.vld1.v4f32(i8*, i32) nounwind readonly - -declare void @llvm.arm.neon.vst1.v4f32(i8*, <4 x float>, i32) nounwind - -declare <4 x float> @llvm.arm.neon.vmaxs.v4f32(<4 x float>, <4 x float>) nounwind readnone Modified: llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll?rev=116852&r1=116851&r2=116852&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll Tue Oct 19 15:00:17 2010 @@ -55,8 +55,8 @@ define void @t2(i8* %ptr1, i8* %ptr2) nounwind { entry: ; CHECK: t2: -; CHECK: adr r{{.}}, #LCPI1_0 -; CHECK: vldmia r3, {d16, d17} +; CHECK: mov.w r3, #1065353216 +; CHECK: vdup.32 q{{.*}}, r3 br i1 undef, label %bb1, label %bb2 bb1: @@ -76,8 +76,8 @@ ret void } -; CHECK: LCPI1_0: -; CHECK: .section +; CHECK-NOT: LCPI1_0: +; CHECK: .subsections_via_symbols declare <4 x float> @llvm.arm.neon.vld1.v4f32(i8*, i32) nounwind readonly From wendling at apple.com Tue Oct 19 15:08:10 2010 From: wendling at apple.com (Bill Wendling) Date: Tue, 19 Oct 2010 13:08:10 -0700 Subject: [llvm-commits] [llvm] r116851 - /llvm/trunk/include/llvm/PassSupport.h In-Reply-To: <20101019195448.617CF2A6C12C@llvm.org> References: <20101019195448.617CF2A6C12C@llvm.org> Message-ID: Thanks! :-) -bw On Oct 19, 2010, at 12:54 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Oct 19 14:54:48 2010 > New Revision: 116851 > > URL: http://llvm.org/viewvc/llvm-project?rev=116851&view=rev > Log: > Remove extraneous slash. > > Modified: > llvm/trunk/include/llvm/PassSupport.h > > Modified: llvm/trunk/include/llvm/PassSupport.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=116851&r1=116850&r2=116851&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/PassSupport.h (original) > +++ llvm/trunk/include/llvm/PassSupport.h Tue Oct 19 14:54:48 2010 > @@ -143,7 +143,7 @@ > tmp = initialized; \ > sys::MemoryFence(); \ > } \ > - } \ > + } > > #define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \ > static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ > > > _______________________________________________ > 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/20101019/8e59c782/attachment.html From resistor at mac.com Tue Oct 19 15:08:44 2010 From: resistor at mac.com (Owen Anderson) Date: Tue, 19 Oct 2010 20:08:44 -0000 Subject: [llvm-commits] [llvm] r116854 - in /llvm/trunk/lib/Transforms: Scalar/LICM.cpp Scalar/LoopDeletion.cpp Scalar/LoopRotation.cpp Scalar/LoopStrengthReduce.cpp Scalar/LoopUnrollPass.cpp Scalar/LoopUnswitch.cpp Utils/LCSSA.cpp Utils/Mem2Reg.cpp Message-ID: <20101019200844.907362A6C12C@llvm.org> Author: resistor Date: Tue Oct 19 15:08:44 2010 New Revision: 116854 URL: http://llvm.org/viewvc/llvm-project?rev=116854&view=rev Log: Passes do not need to recursively initialize passes that they preserve, if they do not also require them. This allows us to reduce inter-pass linkage dependencies. Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Oct 19 15:08:44 2010 @@ -207,7 +207,6 @@ INITIALIZE_PASS_BEGIN(LICM, "licm", "Loop Invariant Code Motion", false, false) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_DEPENDENCY(LoopInfo) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_DEPENDENCY(LoopSimplify) INITIALIZE_AG_DEPENDENCY(AliasAnalysis) INITIALIZE_PASS_END(LICM, "licm", "Loop Invariant Code Motion", false, false) Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Tue Oct 19 15:08:44 2010 @@ -64,7 +64,6 @@ INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_DEPENDENCY(LoopSimplify) INITIALIZE_PASS_DEPENDENCY(LCSSA) -INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) INITIALIZE_PASS_END(LoopDeletion, "loop-deletion", "Delete dead loops", false, false) Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Tue Oct 19 15:08:44 2010 @@ -82,12 +82,9 @@ char LoopRotate::ID = 0; INITIALIZE_PASS_BEGIN(LoopRotate, "loop-rotate", "Rotate Loops", false, false) -INITIALIZE_PASS_DEPENDENCY(DominatorTree) -INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) INITIALIZE_PASS_DEPENDENCY(LoopInfo) INITIALIZE_PASS_DEPENDENCY(LoopSimplify) INITIALIZE_PASS_DEPENDENCY(LCSSA) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_END(LoopRotate, "loop-rotate", "Rotate Loops", false, false) Pass *llvm::createLoopRotatePass() { return new LoopRotate(); } Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Oct 19 15:08:44 2010 @@ -3793,11 +3793,11 @@ char LoopStrengthReduce::ID = 0; INITIALIZE_PASS_BEGIN(LoopStrengthReduce, "loop-reduce", "Loop Strength Reduction", false, false) -INITIALIZE_PASS_DEPENDENCY(LoopSimplify) -INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_DEPENDENCY(IVUsers) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_DEPENDENCY(LoopSimplify) INITIALIZE_PASS_END(LoopStrengthReduce, "loop-reduce", "Loop Strength Reduction", false, false) Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Tue Oct 19 15:08:44 2010 @@ -85,8 +85,6 @@ INITIALIZE_PASS_DEPENDENCY(LoopInfo) INITIALIZE_PASS_DEPENDENCY(LoopSimplify) INITIALIZE_PASS_DEPENDENCY(LCSSA) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) -INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_END(LoopUnroll, "loop-unroll", "Unroll loops", false, false) Pass *llvm::createLoopUnrollPass() { return new LoopUnroll(); } Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Oct 19 15:08:44 2010 @@ -165,7 +165,6 @@ INITIALIZE_PASS_DEPENDENCY(LoopSimplify) INITIALIZE_PASS_DEPENDENCY(LoopInfo) INITIALIZE_PASS_DEPENDENCY(LCSSA) -INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_END(LoopUnswitch, "loop-unswitch", "Unswitch loops", false, false) Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Tue Oct 19 15:08:44 2010 @@ -94,10 +94,7 @@ char LCSSA::ID = 0; INITIALIZE_PASS_BEGIN(LCSSA, "lcssa", "Loop-Closed SSA Form Pass", false, false) INITIALIZE_PASS_DEPENDENCY(DominatorTree) -INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) INITIALIZE_PASS_DEPENDENCY(LoopInfo) -INITIALIZE_PASS_DEPENDENCY(LoopSimplify) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_END(LCSSA, "lcssa", "Loop-Closed SSA Form Pass", false, false) Pass *llvm::createLCSSAPass() { return new LCSSA(); } Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=116854&r1=116853&r2=116854&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Tue Oct 19 15:08:44 2010 @@ -55,9 +55,6 @@ false, false) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) -INITIALIZE_PASS_DEPENDENCY(UnifyFunctionExitNodes) -INITIALIZE_PASS_DEPENDENCY(LowerSwitch) -INITIALIZE_PASS_DEPENDENCY(LowerInvoke) INITIALIZE_PASS_END(PromotePass, "mem2reg", "Promote Memory to Register", false, false) From stoklund at 2pi.dk Tue Oct 19 15:56:32 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 19 Oct 2010 20:56:32 -0000 Subject: [llvm-commits] [llvm] r116857 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp Message-ID: <20101019205633.09A7D2A6C12C@llvm.org> Author: stoklund Date: Tue Oct 19 15:56:32 2010 New Revision: 116857 URL: http://llvm.org/viewvc/llvm-project?rev=116857&view=rev Log: Shrink MachineOperand from 40 to 32 bytes on 64-bit hosts. Pull an unsigned out of the Contents union such that it has the same size as two pointers and no padding. Arrange members such that the Contents union and all pointers can be 8-byte aligned without padding. This speeds up code generation by 0.8% on a 64-bit host. 32-bit hosts should be unaffected. Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h llvm/trunk/lib/CodeGen/MachineInstr.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=116857&r1=116856&r2=116857&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Tue Oct 19 15:56:32 2010 @@ -94,6 +94,15 @@ /// not a real instruction. Such uses should be ignored during codegen. bool IsDebug : 1; + /// SmallContents - Thisreally should be part of the Contents union, but lives + /// out here so we can get a better packed struct. + /// MO_Register: Register number. + /// OffsetedInfo: Low bits of offset. + union { + unsigned RegNo; // For MO_Register. + unsigned OffsetLo; // Matches Contents.OffsetedInfo.OffsetHi. + } SmallContents; + /// ParentMI - This is the instruction that this operand is embedded into. /// This is valid for all operand types, when the operand is in an instr. MachineInstr *ParentMI; @@ -107,7 +116,7 @@ MCSymbol *Sym; // For MO_MCSymbol struct { // For MO_Register. - unsigned RegNo; + // Register number is in SmallContents.RegNo. MachineOperand **Prev; // Access list for register. MachineOperand *Next; } Reg; @@ -121,7 +130,8 @@ const GlobalValue *GV; // For MO_GlobalAddress. const BlockAddress *BA; // For MO_BlockAddress. } Val; - int64_t Offset; // An offset from the object. + // Low bits of offset are in SmallContents.OffsetLo. + int OffsetHi; // An offset from the object, high 32 bits. } OffsetedInfo; } Contents; @@ -180,7 +190,7 @@ /// getReg - Returns the register number. unsigned getReg() const { assert(isReg() && "This is not a register operand!"); - return Contents.Reg.RegNo; + return SmallContents.RegNo; } unsigned getSubReg() const { @@ -349,7 +359,8 @@ int64_t getOffset() const { assert((isGlobal() || isSymbol() || isCPI() || isBlockAddress()) && "Wrong MachineOperand accessor"); - return Contents.OffsetedInfo.Offset; + return (int64_t(Contents.OffsetedInfo.OffsetHi) << 32) | + SmallContents.OffsetLo; } const char *getSymbolName() const { @@ -374,7 +385,8 @@ void setOffset(int64_t Offset) { assert((isGlobal() || isSymbol() || isCPI() || isBlockAddress()) && "Wrong MachineOperand accessor"); - Contents.OffsetedInfo.Offset = Offset; + SmallContents.OffsetLo = unsigned(Offset); + Contents.OffsetedInfo.OffsetHi = int(Offset >> 32); } void setIndex(int Idx) { @@ -438,7 +450,7 @@ Op.IsUndef = isUndef; Op.IsEarlyClobber = isEarlyClobber; Op.IsDebug = isDebug; - Op.Contents.Reg.RegNo = Reg; + Op.SmallContents.RegNo = Reg; Op.Contents.Reg.Prev = 0; Op.Contents.Reg.Next = 0; Op.SubReg = SubReg; Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=116857&r1=116856&r2=116857&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Oct 19 15:56:32 2010 @@ -102,13 +102,13 @@ if (MachineBasicBlock *MBB = MI->getParent()) if (MachineFunction *MF = MBB->getParent()) { RemoveRegOperandFromRegInfo(); - Contents.Reg.RegNo = Reg; + SmallContents.RegNo = Reg; AddRegOperandToRegInfo(&MF->getRegInfo()); return; } // Otherwise, just change the register, no problem. :) - Contents.Reg.RegNo = Reg; + SmallContents.RegNo = Reg; } void MachineOperand::substVirtReg(unsigned Reg, unsigned SubIdx, @@ -159,7 +159,7 @@ } else { // Otherwise, change this to a register and set the reg#. OpKind = MO_Register; - Contents.Reg.RegNo = Reg; + SmallContents.RegNo = Reg; // If this operand is embedded in a function, add the operand to the // register's use/def list. From gohman at apple.com Tue Oct 19 16:06:16 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 19 Oct 2010 21:06:16 -0000 Subject: [llvm-commits] [llvm] r116858 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/AliasSetTracker.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/AliasAnalysisEvaluator.cpp lib/Analysis/AliasSetTracker.cpp lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/Lint.cpp lib/Transforms/Scalar/DeadStoreElimination.cpp lib/Transforms/Scalar/MemCpyOptimizer.cpp Message-ID: <20101019210616.801C82A6C12C@llvm.org> Author: djg Date: Tue Oct 19 16:06:16 2010 New Revision: 116858 URL: http://llvm.org/viewvc/llvm-project?rev=116858&view=rev Log: Revert r116831 and r116839, which are breaking selfhost builds. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Oct 19 16:06:16 2010 @@ -67,7 +67,7 @@ /// UnknownSize - This is a special value which can be used with the /// size arguments in alias queries to indicate that the caller does not /// know the sizes of the potential memory references. - static uint64_t const UnknownSize = ~UINT64_C(0); + static unsigned const UnknownSize = ~0u; /// getTargetData - Return a pointer to the current TargetData object, or /// null if no TargetData object is available. @@ -77,7 +77,7 @@ /// getTypeStoreSize - Return the TargetData store size for the given type, /// if known, or a conservative value otherwise. /// - uint64_t getTypeStoreSize(const Type *Ty); + unsigned getTypeStoreSize(const Type *Ty); //===--------------------------------------------------------------------===// /// Alias Queries... @@ -88,13 +88,13 @@ /// Ptr - The address of the start of the location. const Value *Ptr; /// Size - The size of the location. - uint64_t Size; + unsigned Size; /// TBAATag - The metadata node which describes the TBAA type of /// the location, or null if there is no (unique) tag. const MDNode *TBAATag; explicit Location(const Value *P = 0, - uint64_t S = UnknownSize, + unsigned S = UnknownSize, const MDNode *N = 0) : Ptr(P), Size(S), TBAATag(N) {} @@ -129,8 +129,8 @@ virtual AliasResult alias(const Location &LocA, const Location &LocB); /// alias - A convenience wrapper. - AliasResult alias(const Value *V1, uint64_t V1Size, - const Value *V2, uint64_t V2Size) { + AliasResult alias(const Value *V1, unsigned V1Size, + const Value *V2, unsigned V2Size) { return alias(Location(V1, V1Size), Location(V2, V2Size)); } @@ -146,8 +146,8 @@ } /// isNoAlias - A convenience wrapper. - bool isNoAlias(const Value *V1, uint64_t V1Size, - const Value *V2, uint64_t V2Size) { + bool isNoAlias(const Value *V1, unsigned V1Size, + const Value *V2, unsigned V2Size) { return isNoAlias(Location(V1, V1Size), Location(V2, V2Size)); } @@ -278,7 +278,7 @@ /// getModRefInfo - A convenience wrapper. ModRefResult getModRefInfo(const Instruction *I, - const Value *P, uint64_t Size) { + const Value *P, unsigned Size) { return getModRefInfo(I, Location(P, Size)); } @@ -289,7 +289,7 @@ /// getModRefInfo (for call sites) - A convenience wrapper. ModRefResult getModRefInfo(ImmutableCallSite CS, - const Value *P, uint64_t Size) { + const Value *P, unsigned Size) { return getModRefInfo(CS, Location(P, Size)); } @@ -300,7 +300,7 @@ } /// getModRefInfo (for calls) - A convenience wrapper. - ModRefResult getModRefInfo(const CallInst *C, const Value *P, uint64_t Size) { + ModRefResult getModRefInfo(const CallInst *C, const Value *P, unsigned Size) { return getModRefInfo(C, Location(P, Size)); } @@ -313,7 +313,7 @@ /// getModRefInfo (for invokes) - A convenience wrapper. ModRefResult getModRefInfo(const InvokeInst *I, - const Value *P, uint64_t Size) { + const Value *P, unsigned Size) { return getModRefInfo(I, Location(P, Size)); } @@ -322,7 +322,7 @@ ModRefResult getModRefInfo(const LoadInst *L, const Location &Loc); /// getModRefInfo (for loads) - A convenience wrapper. - ModRefResult getModRefInfo(const LoadInst *L, const Value *P, uint64_t Size) { + ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size) { return getModRefInfo(L, Location(P, Size)); } @@ -331,7 +331,7 @@ ModRefResult getModRefInfo(const StoreInst *S, const Location &Loc); /// getModRefInfo (for stores) - A convenience wrapper. - ModRefResult getModRefInfo(const StoreInst *S, const Value *P, uint64_t Size) { + ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) { return getModRefInfo(S, Location(P, Size)); } @@ -340,7 +340,7 @@ ModRefResult getModRefInfo(const VAArgInst* I, const Location &Loc); /// getModRefInfo (for va_args) - A convenience wrapper. - ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, uint64_t Size) { + ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, unsigned Size) { return getModRefInfo(I, Location(P, Size)); } @@ -360,7 +360,7 @@ bool canBasicBlockModify(const BasicBlock &BB, const Location &Loc); /// canBasicBlockModify - A convenience wrapper. - bool canBasicBlockModify(const BasicBlock &BB, const Value *P, uint64_t Size){ + bool canBasicBlockModify(const BasicBlock &BB, const Value *P, unsigned Size){ return canBasicBlockModify(BB, Location(P, Size)); } @@ -373,7 +373,7 @@ /// canInstructionRangeModify - A convenience wrapper. bool canInstructionRangeModify(const Instruction &I1, const Instruction &I2, - const Value *Ptr, uint64_t Size) { + const Value *Ptr, unsigned Size) { return canInstructionRangeModify(I1, I2, Location(Ptr, Size)); } Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Tue Oct 19 16:06:16 2010 @@ -40,7 +40,7 @@ Value *Val; // The pointer this record corresponds to. PointerRec **PrevInList, *NextInList; AliasSet *AS; - uint64_t Size; + unsigned Size; const MDNode *TBAAInfo; public: PointerRec(Value *V) @@ -57,7 +57,7 @@ return &NextInList; } - void updateSizeAndTBAAInfo(uint64_t NewSize, const MDNode *NewTBAAInfo) { + void updateSizeAndTBAAInfo(unsigned NewSize, const MDNode *NewTBAAInfo) { if (NewSize > Size) Size = NewSize; if (TBAAInfo == DenseMapInfo::getEmptyKey()) @@ -68,7 +68,7 @@ TBAAInfo = DenseMapInfo::getTombstoneKey(); } - uint64_t getSize() const { return Size; } + unsigned getSize() const { return Size; } /// getTBAAInfo - Return the TBAAInfo, or null if there is no /// information or conflicting information. @@ -205,7 +205,7 @@ value_type *operator->() const { return &operator*(); } Value *getPointer() const { return CurNode->getValue(); } - uint64_t getSize() const { return CurNode->getSize(); } + unsigned getSize() const { return CurNode->getSize(); } const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement @@ -250,7 +250,7 @@ void removeFromTracker(AliasSetTracker &AST); - void addPointer(AliasSetTracker &AST, PointerRec &Entry, uint64_t Size, + void addPointer(AliasSetTracker &AST, PointerRec &Entry, unsigned Size, const MDNode *TBAAInfo, bool KnownMustAlias = false); void addCallSite(CallSite CS, AliasAnalysis &AA); @@ -266,7 +266,7 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// - bool aliasesPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo, + bool aliasesPointer(const Value *Ptr, unsigned Size, const MDNode *TBAAInfo, AliasAnalysis &AA) const; bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const; }; @@ -320,7 +320,7 @@ /// These methods return true if inserting the instruction resulted in the /// addition of a new alias set (i.e., the pointer did not alias anything). /// - bool add(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); // Add a location + bool add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); // Add a location bool add(LoadInst *LI); bool add(StoreInst *SI); bool add(VAArgInst *VAAI); @@ -335,7 +335,7 @@ /// be aliased by the specified instruction. These methods return true if any /// alias sets were eliminated. // Remove a location - bool remove(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); + bool remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); bool remove(LoadInst *LI); bool remove(StoreInst *SI); bool remove(VAArgInst *VAAI); @@ -355,13 +355,13 @@ /// lives in. If the New argument is non-null, this method sets the value to /// true if a new alias set is created to contain the pointer (because the /// pointer didn't alias anything). - AliasSet &getAliasSetForPointer(Value *P, uint64_t Size, + AliasSet &getAliasSetForPointer(Value *P, unsigned Size, const MDNode *TBAAInfo, bool *New = 0); /// getAliasSetForPointerIfExists - Return the alias set containing the /// location specified if one exists, otherwise return null. - AliasSet *getAliasSetForPointerIfExists(Value *P, uint64_t Size, + AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size, const MDNode *TBAAInfo) { return findAliasSetForPointer(P, Size, TBAAInfo); } @@ -369,7 +369,7 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. - bool containsPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo) const; + bool containsPointer(Value *P, unsigned Size, const MDNode *TBAAInfo) const; /// getAliasAnalysis - Return the underlying alias analysis object used by /// this tracker. @@ -416,7 +416,7 @@ return *Entry; } - AliasSet &addPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo, + AliasSet &addPointer(Value *P, unsigned Size, const MDNode *TBAAInfo, AliasSet::AccessType E, bool &NewSet) { NewSet = false; @@ -424,7 +424,7 @@ AS.AccessTy |= E; return AS; } - AliasSet *findAliasSetForPointer(const Value *Ptr, uint64_t Size, + AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size, const MDNode *TBAAInfo); AliasSet *findAliasSetForCallSite(CallSite CS); Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Oct 19 16:06:16 2010 @@ -283,7 +283,7 @@ /// getTypeStoreSize - Return the TargetData store size for the given type, /// if known, or a conservative value otherwise. /// -uint64_t AliasAnalysis::getTypeStoreSize(const Type *Ty) { +unsigned AliasAnalysis::getTypeStoreSize(const Type *Ty) { return TD ? TD->getTypeStoreSize(Ty) : UnknownSize; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Oct 19 16:06:16 2010 @@ -168,12 +168,12 @@ // iterate over the worklist, and run the full (n^2)/2 disambiguations for (SetVector::iterator I1 = Pointers.begin(), E = Pointers.end(); I1 != E; ++I1) { - uint64_t I1Size = AliasAnalysis::UnknownSize; + unsigned I1Size = AliasAnalysis::UnknownSize; const Type *I1ElTy = cast((*I1)->getType())->getElementType(); if (I1ElTy->isSized()) I1Size = AA.getTypeStoreSize(I1ElTy); for (SetVector::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { - uint64_t I2Size = AliasAnalysis::UnknownSize; + unsigned I2Size = AliasAnalysis::UnknownSize; const Type *I2ElTy =cast((*I2)->getType())->getElementType(); if (I2ElTy->isSized()) I2Size = AA.getTypeStoreSize(I2ElTy); @@ -200,7 +200,7 @@ for (SetVector::iterator V = Pointers.begin(), Ve = Pointers.end(); V != Ve; ++V) { - uint64_t Size = AliasAnalysis::UnknownSize; + unsigned Size = AliasAnalysis::UnknownSize; const Type *ElTy = cast((*V)->getType())->getElementType(); if (ElTy->isSized()) Size = AA.getTypeStoreSize(ElTy); Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Tue Oct 19 16:06:16 2010 @@ -88,7 +88,7 @@ } void AliasSet::addPointer(AliasSetTracker &AST, PointerRec &Entry, - uint64_t Size, const MDNode *TBAAInfo, + unsigned Size, const MDNode *TBAAInfo, bool KnownMustAlias) { assert(!Entry.hasAliasSet() && "Entry already in set!"); @@ -138,7 +138,7 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// -bool AliasSet::aliasesPointer(const Value *Ptr, uint64_t Size, +bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size, const MDNode *TBAAInfo, AliasAnalysis &AA) const { if (AliasTy == MustAlias) { @@ -210,7 +210,7 @@ /// that may alias the pointer, merge them together and return the unified set. /// AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr, - uint64_t Size, + unsigned Size, const MDNode *TBAAInfo) { AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) { @@ -229,7 +229,7 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. -bool AliasSetTracker::containsPointer(Value *Ptr, uint64_t Size, +bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) const { for (const_iterator I = begin(), E = end(); I != E; ++I) if (!I->Forward && I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) @@ -258,7 +258,7 @@ /// getAliasSetForPointer - Return the alias set that the specified pointer /// lives in. -AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, uint64_t Size, +AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size, const MDNode *TBAAInfo, bool *New) { AliasSet::PointerRec &Entry = getEntryFor(Pointer); @@ -283,7 +283,7 @@ return AliasSets.back(); } -bool AliasSetTracker::add(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) { +bool AliasSetTracker::add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { bool NewPtr; addPointer(Ptr, Size, TBAAInfo, AliasSet::NoModRef, NewPtr); return NewPtr; @@ -414,7 +414,7 @@ } bool -AliasSetTracker::remove(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) { +AliasSetTracker::remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { AliasSet *AS = findAliasSetForPointer(Ptr, Size, TBAAInfo); if (!AS) return false; remove(*AS); @@ -422,7 +422,7 @@ } bool AliasSetTracker::remove(LoadInst *LI) { - uint64_t Size = AA.getTypeStoreSize(LI->getType()); + unsigned Size = AA.getTypeStoreSize(LI->getType()); const MDNode *TBAAInfo = LI->getMetadata(LLVMContext::MD_tbaa); AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size, TBAAInfo); if (!AS) return false; @@ -431,7 +431,7 @@ } bool AliasSetTracker::remove(StoreInst *SI) { - uint64_t Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); + unsigned Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); const MDNode *TBAAInfo = SI->getMetadata(LLVMContext::MD_tbaa); AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size, TBAAInfo); if (!AS) return false; Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Oct 19 16:06:16 2010 @@ -98,7 +98,7 @@ /// isObjectSmallerThan - Return true if we can prove that the object specified /// by V is smaller than Size. -static bool isObjectSmallerThan(const Value *V, uint64_t Size, +static bool isObjectSmallerThan(const Value *V, unsigned Size, const TargetData &TD) { const Type *AccessTy; if (const GlobalVariable *GV = dyn_cast(V)) { @@ -552,27 +552,27 @@ // aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP // instruction against another. - AliasResult aliasGEP(const GEPOperator *V1, uint64_t V1Size, - const Value *V2, uint64_t V2Size, + AliasResult aliasGEP(const GEPOperator *V1, unsigned V1Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2); // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI // instruction against another. - AliasResult aliasPHI(const PHINode *PN, uint64_t PNSize, + AliasResult aliasPHI(const PHINode *PN, unsigned PNSize, const MDNode *PNTBAAInfo, - const Value *V2, uint64_t V2Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo); /// aliasSelect - Disambiguate a Select instruction against another value. - AliasResult aliasSelect(const SelectInst *SI, uint64_t SISize, + AliasResult aliasSelect(const SelectInst *SI, unsigned SISize, const MDNode *SITBAAInfo, - const Value *V2, uint64_t V2Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo); - AliasResult aliasCheck(const Value *V1, uint64_t V1Size, + AliasResult aliasCheck(const Value *V1, unsigned V1Size, const MDNode *V1TBAATag, - const Value *V2, uint64_t V2Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAATag); }; } // End of anonymous namespace @@ -691,7 +691,7 @@ default: break; case Intrinsic::memcpy: case Intrinsic::memmove: { - uint64_t Len = UnknownSize; + unsigned Len = UnknownSize; if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); @@ -707,7 +707,7 @@ // Since memset is 'accesses arguments' only, the AliasAnalysis base class // will handle it for the variable length case. if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { - uint64_t Len = LenCI->getZExtValue(); + unsigned Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); if (isNoAlias(Location(Dest, Len), Loc)) return NoModRef; @@ -727,7 +727,7 @@ case Intrinsic::atomic_load_umin: if (TD) { Value *Op1 = II->getArgOperand(0); - uint64_t Op1Size = TD->getTypeStoreSize(Op1->getType()); + unsigned Op1Size = TD->getTypeStoreSize(Op1->getType()); MDNode *Tag = II->getMetadata(LLVMContext::MD_tbaa); if (isNoAlias(Location(Op1, Op1Size, Tag), Loc)) return NoModRef; @@ -736,7 +736,7 @@ case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: { - uint64_t PtrSize = + unsigned PtrSize = cast(II->getArgOperand(0))->getZExtValue(); if (isNoAlias(Location(II->getArgOperand(1), PtrSize, @@ -746,7 +746,7 @@ break; } case Intrinsic::invariant_end: { - uint64_t PtrSize = + unsigned PtrSize = cast(II->getArgOperand(1))->getZExtValue(); if (isNoAlias(Location(II->getArgOperand(2), PtrSize, @@ -767,8 +767,8 @@ /// UnderlyingV2 is the same for V2. /// AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, - const Value *V2, uint64_t V2Size, +BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, unsigned V1Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2) { @@ -878,10 +878,8 @@ // If our known offset is bigger than the access size, we know we don't have // an alias. if (GEP1BaseOffset) { - if (GEP1BaseOffset >= 0 ? - (V2Size != UnknownSize && (uint64_t)GEP1BaseOffset >= V2Size) : - (V1Size != UnknownSize && -(uint64_t)GEP1BaseOffset >= V1Size && - GEP1BaseOffset != INT64_MIN)) + if (GEP1BaseOffset >= (int64_t)V2Size || + GEP1BaseOffset <= -(int64_t)V1Size) return NoAlias; } @@ -891,9 +889,9 @@ /// aliasSelect - Provide a bunch of ad-hoc rules to disambiguate a Select /// instruction against another. AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize, +BasicAliasAnalysis::aliasSelect(const SelectInst *SI, unsigned SISize, const MDNode *SITBAAInfo, - const Value *V2, uint64_t V2Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo) { // If this select has been visited before, we're on a use-def cycle. // Such cycles are only valid when PHI nodes are involved or in unreachable @@ -941,9 +939,9 @@ // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI instruction // against another. AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize, +BasicAliasAnalysis::aliasPHI(const PHINode *PN, unsigned PNSize, const MDNode *PNTBAAInfo, - const Value *V2, uint64_t V2Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo) { // The PHI node has already been visited, avoid recursion any further. if (!Visited.insert(PN)) @@ -1015,9 +1013,9 @@ // such as array references. // AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size, +BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, const MDNode *V1TBAAInfo, - const Value *V2, uint64_t V2Size, + const Value *V2, unsigned V2Size, const MDNode *V2TBAAInfo) { // If either of the memory references is empty, it doesn't matter what the // pointer values are. Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Oct 19 16:06:16 2010 @@ -70,7 +70,7 @@ void visitCallSite(CallSite CS); void visitMemoryReference(Instruction &I, Value *Ptr, - uint64_t Size, unsigned Align, + unsigned Size, unsigned Align, const Type *Ty, unsigned Flags); void visitCallInst(CallInst &I); @@ -277,7 +277,7 @@ // Check that the memcpy arguments don't overlap. The AliasAnalysis API // isn't expressive enough for what we really want to do. Known partial // overlap is not distinguished from the case where nothing is known. - uint64_t Size = 0; + unsigned Size = 0; if (const ConstantInt *Len = dyn_cast(findValue(MCI->getLength(), /*OffsetOk=*/false))) @@ -361,7 +361,7 @@ // TODO: Check that the reference is in bounds. // TODO: Check readnone/readonly function attributes. void Lint::visitMemoryReference(Instruction &I, - Value *Ptr, uint64_t Size, unsigned Align, + Value *Ptr, unsigned Size, unsigned Align, const Type *Ty, unsigned Flags) { // If no memory is being referenced, it doesn't matter if the pointer // is valid. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Oct 19 16:06:16 2010 @@ -79,7 +79,7 @@ AU.addPreserved(); } - uint64_t getPointerSize(Value *V) const; + unsigned getPointerSize(Value *V) const; }; } @@ -373,7 +373,7 @@ } Value *killPointer = 0; - uint64_t killPointerSize = AliasAnalysis::UnknownSize; + unsigned killPointerSize = AliasAnalysis::UnknownSize; // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst *L = dyn_cast(BBI)) { @@ -565,7 +565,7 @@ } while (!NowDeadInsts.empty()); } -uint64_t DSE::getPointerSize(Value *V) const { +unsigned DSE::getPointerSize(Value *V) const { if (TD) { if (AllocaInst *A = dyn_cast(V)) { // Get size information for the alloca Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=116858&r1=116857&r2=116858&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Tue Oct 19 16:06:16 2010 @@ -772,7 +772,7 @@ // If the memmove is a constant size, use it for the alias query, this allows // us to optimize things like: memmove(P, P+64, 64); - uint64_t MemMoveSize = AliasAnalysis::UnknownSize; + unsigned MemMoveSize = AliasAnalysis::UnknownSize; if (ConstantInt *Len = dyn_cast(M->getLength())) MemMoveSize = Len->getZExtValue(); From rafael.espindola at gmail.com Tue Oct 19 16:08:45 2010 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Tue, 19 Oct 2010 17:08:45 -0400 Subject: [llvm-commits] [rfc][patch] How should we handle _GLOBAL_OFFSET_TABLE_? Message-ID: Consider the instruction addl $_GLOBAL_OFFSET_TABLE_, %ebx It should assemble to something like 81 c3 02 00 00 00 add $0x2,%ebx The "2" in the add comes from the first two bytes. This is a special treatment for _GLOBAL_OFFSET_TABLE_. It also produces a special kind of relocation (R_386_GOTPC). The relocation kind can be handled in the writer (and is). The problem is that it is then too late to find the offset of the relocation inside the instruction. This patch does it by modifying X86MCCodeEmitter.cpp. This might be undesirable as this code is also used for non-ELF targets. I tried to do this on the ELF streamer, but failed because EncodeInstruction is also called directly from the assembler when handling relaxations and the streamer cannot patch it up. Another way I can see this being done is having a object specific wrapper for CodeEmitter::EncodeInstruction. This would be a nop for MachO and COFF, but ELF 32 bits could then patch it up to account for _GLOBAL_OFFSET_TABLE_. Any better ideas on how to implement this? P.S.: Ugly as the attached patch is, it gets clang to build itself on 32 bits with the integrated assembler :-) Cheers, Rafael -------------- next part -------------- A non-text attachment was scrubbed... Name: GlobalOffsetTable.patch Type: text/x-patch Size: 1663 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101019/ff90b747/attachment.bin From grosbach at apple.com Tue Oct 19 16:34:47 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 19 Oct 2010 21:34:47 -0000 Subject: [llvm-commits] [llvm] r116863 - /llvm/trunk/lib/Target/ARM/ARMMachineFunctionInfo.h Message-ID: <20101019213447.5346D2A6C12C@llvm.org> Author: grosbach Date: Tue Oct 19 16:34:47 2010 New Revision: 116863 URL: http://llvm.org/viewvc/llvm-project?rev=116863&view=rev Log: Update comments to remove obsolete references. Modified: llvm/trunk/lib/Target/ARM/ARMMachineFunctionInfo.h Modified: llvm/trunk/lib/Target/ARM/ARMMachineFunctionInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMMachineFunctionInfo.h?rev=116863&r1=116862&r2=116863&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMMachineFunctionInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMMachineFunctionInfo.h Tue Oct 19 16:34:47 2010 @@ -55,8 +55,8 @@ /// spill stack offset. unsigned FramePtrSpillOffset; - /// GPRCSOffset, GPRCS2Offset, DPRCSOffset - Starting offset of callee saved - /// register spills areas (excluding R9 for Mac OS X): + /// GPRCSOffset, DPRCSOffset - Starting offset of callee saved register + /// spills areas (excluding R9 for Mac OS X): /// /// GPR callee-saved (1) : r4, r5, r6, r7, r8, r9, r10, r11, lr /// -------------------------------------------- @@ -64,13 +64,12 @@ unsigned GPRCSOffset; unsigned DPRCSOffset; - /// GPRCSSize, GPRCS2Size, DPRCSSize - Sizes of callee saved register spills - /// areas. + /// GPRCSSize, DPRCSSize - Sizes of callee saved register spills areas. unsigned GPRCSSize; unsigned DPRCSSize; - /// GPRCSFrames, GPRCS2Frames, DPRCSFrames - Keeps track of frame indices - /// which belong to these spill areas. + /// GPRCSFrames, DPRCSFrames - Keeps track of frame indices which belong + /// to these spill areas. BitVector GPRCSFrames; BitVector DPRCSFrames; From dgregor at apple.com Tue Oct 19 17:13:48 2010 From: dgregor at apple.com (Douglas Gregor) Date: Tue, 19 Oct 2010 22:13:48 -0000 Subject: [llvm-commits] [llvm] r116867 - in /llvm/trunk: include/llvm/ADT/StringRef.h lib/Support/StringRef.cpp Message-ID: <20101019221349.0CFB32A6C12C@llvm.org> Author: dgregor Date: Tue Oct 19 17:13:48 2010 New Revision: 116867 URL: http://llvm.org/viewvc/llvm-project?rev=116867&view=rev Log: Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed edit distance Modified: llvm/trunk/include/llvm/ADT/StringRef.h llvm/trunk/lib/Support/StringRef.cpp Modified: llvm/trunk/include/llvm/ADT/StringRef.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=116867&r1=116866&r2=116867&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/StringRef.h (original) +++ llvm/trunk/include/llvm/ADT/StringRef.h Tue Oct 19 17:13:48 2010 @@ -142,11 +142,16 @@ /// operation, rather than as two operations (an insertion and a /// removal). /// + /// \param MaxEditDistance If non-zero, the maximum edit distance that + /// this routine is allowed to compute. If the edit distance will exceed + /// that maximum, returns \c MaxEditDistance+1. + /// /// \returns the minimum number of character insertions, removals, /// or (if \p AllowReplacements is \c true) replacements needed to /// transform one of the given strings into the other. If zero, /// the strings are identical. - unsigned edit_distance(StringRef Other, bool AllowReplacements = true); + unsigned edit_distance(StringRef Other, bool AllowReplacements = true, + unsigned MaxEditDistance = 0); /// str - Get the contents as an std::string. std::string str() const { Modified: llvm/trunk/lib/Support/StringRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StringRef.cpp?rev=116867&r1=116866&r2=116867&view=diff ============================================================================== --- llvm/trunk/lib/Support/StringRef.cpp (original) +++ llvm/trunk/lib/Support/StringRef.cpp Tue Oct 19 17:13:48 2010 @@ -68,7 +68,8 @@ // Compute the edit distance between the two given strings. unsigned StringRef::edit_distance(llvm::StringRef Other, - bool AllowReplacements) { + bool AllowReplacements, + unsigned MaxEditDistance) { // The algorithm implemented below is the "classic" // dynamic-programming algorithm for computing the Levenshtein // distance, which is described here: @@ -94,6 +95,8 @@ for (size_type y = 1; y <= m; ++y) { current[0] = y; + unsigned BestThisRow = current[0]; + for (size_type x = 1; x <= n; ++x) { if (AllowReplacements) { current[x] = min(previous[x-1] + ((*this)[y-1] == Other[x-1]? 0u:1u), @@ -103,8 +106,12 @@ if ((*this)[y-1] == Other[x-1]) current[x] = previous[x-1]; else current[x] = min(current[x-1], previous[x]) + 1; } + BestThisRow = min(BestThisRow, current[x]); } + if (MaxEditDistance && BestThisRow > MaxEditDistance) + return MaxEditDistance + 1; + unsigned *tmp = current; current = previous; previous = tmp; From daniel at zuster.org Tue Oct 19 17:30:36 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 19 Oct 2010 22:30:36 -0000 Subject: [llvm-commits] [test-suite] r116872 - /test-suite/trunk/SingleSource/Benchmarks/Misc/salsa20.c Message-ID: <20101019223036.93F472A6C12C@llvm.org> Author: ddunbar Date: Tue Oct 19 17:30:36 2010 New Revision: 116872 URL: http://llvm.org/viewvc/llvm-project?rev=116872&view=rev Log: Fix test to honor SMALL_PROBLEM_SIZE, this test is stupid. Modified: test-suite/trunk/SingleSource/Benchmarks/Misc/salsa20.c Modified: test-suite/trunk/SingleSource/Benchmarks/Misc/salsa20.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc/salsa20.c?rev=116872&r1=116871&r2=116872&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc/salsa20.c (original) +++ test-suite/trunk/SingleSource/Benchmarks/Misc/salsa20.c Tue Oct 19 17:30:36 2010 @@ -51,14 +51,24 @@ int main(void) { uint32_t val, i; +#ifdef SMALL_PROBLEM_SIZE + uint32_t count = 5379194; + uint32_t offset = 0xf655703d - 0xb67e7950; +#else + uint32_t count = 537919488; + uint32_t offset = 0; +#endif for(i=0; i<16; i++) STATE[i] = (0xedababe5+(i+13))^(0xdeadbeef-i); - for(i=0; i<537919488; i++) + for(i=0; i References: <20101019223036.93F472A6C12C@llvm.org> Message-ID: On Oct 19, 2010, at 3:30 PM, Daniel Dunbar wrote: > Author: ddunbar > Date: Tue Oct 19 17:30:36 2010 > New Revision: 116872 > > URL: http://llvm.org/viewvc/llvm-project?rev=116872&view=rev > Log: > Fix test to honor SMALL_PROBLEM_SIZE, this test is stupid. You could remove the comparison entirely and provide a separate reference output for -small. This test is interesting for register allocation because mem2reg converts the whole x[16] array to registers, creating a very high register pressure. A stupid allocator can make it go really slow :-) From gohman at apple.com Tue Oct 19 17:54:46 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 19 Oct 2010 22:54:46 -0000 Subject: [llvm-commits] [llvm] r116875 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/AliasSetTracker.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/AliasAnalysisEvaluator.cpp lib/Analysis/AliasSetTracker.cpp lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/Lint.cpp lib/Analysis/Loads.cpp lib/Transforms/IPO/ArgumentPromotion.cpp lib/Transforms/Scalar/DeadStoreElimination.cpp lib/Transforms/Scalar/LICM.cpp lib/Transforms/Scalar/MemCpyOptimizer.cpp lib/Transforms/Scalar/Sink.cpp Message-ID: <20101019225446.545992A6C12C@llvm.org> Author: djg Date: Tue Oct 19 17:54:46 2010 New Revision: 116875 URL: http://llvm.org/viewvc/llvm-project?rev=116875&view=rev Log: Reapply r116831 and r116839, converting AliasAnalysis to use uint64_t, plus fixes for places I missed before. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Analysis/Loads.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/Sink.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Oct 19 17:54:46 2010 @@ -67,7 +67,7 @@ /// UnknownSize - This is a special value which can be used with the /// size arguments in alias queries to indicate that the caller does not /// know the sizes of the potential memory references. - static unsigned const UnknownSize = ~0u; + static uint64_t const UnknownSize = ~UINT64_C(0); /// getTargetData - Return a pointer to the current TargetData object, or /// null if no TargetData object is available. @@ -77,7 +77,7 @@ /// getTypeStoreSize - Return the TargetData store size for the given type, /// if known, or a conservative value otherwise. /// - unsigned getTypeStoreSize(const Type *Ty); + uint64_t getTypeStoreSize(const Type *Ty); //===--------------------------------------------------------------------===// /// Alias Queries... @@ -88,13 +88,13 @@ /// Ptr - The address of the start of the location. const Value *Ptr; /// Size - The size of the location. - unsigned Size; + uint64_t Size; /// TBAATag - The metadata node which describes the TBAA type of /// the location, or null if there is no (unique) tag. const MDNode *TBAATag; explicit Location(const Value *P = 0, - unsigned S = UnknownSize, + uint64_t S = UnknownSize, const MDNode *N = 0) : Ptr(P), Size(S), TBAATag(N) {} @@ -129,8 +129,8 @@ virtual AliasResult alias(const Location &LocA, const Location &LocB); /// alias - A convenience wrapper. - AliasResult alias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { + AliasResult alias(const Value *V1, uint64_t V1Size, + const Value *V2, uint64_t V2Size) { return alias(Location(V1, V1Size), Location(V2, V2Size)); } @@ -146,8 +146,8 @@ } /// isNoAlias - A convenience wrapper. - bool isNoAlias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { + bool isNoAlias(const Value *V1, uint64_t V1Size, + const Value *V2, uint64_t V2Size) { return isNoAlias(Location(V1, V1Size), Location(V2, V2Size)); } @@ -278,7 +278,7 @@ /// getModRefInfo - A convenience wrapper. ModRefResult getModRefInfo(const Instruction *I, - const Value *P, unsigned Size) { + const Value *P, uint64_t Size) { return getModRefInfo(I, Location(P, Size)); } @@ -289,7 +289,7 @@ /// getModRefInfo (for call sites) - A convenience wrapper. ModRefResult getModRefInfo(ImmutableCallSite CS, - const Value *P, unsigned Size) { + const Value *P, uint64_t Size) { return getModRefInfo(CS, Location(P, Size)); } @@ -300,7 +300,7 @@ } /// getModRefInfo (for calls) - A convenience wrapper. - ModRefResult getModRefInfo(const CallInst *C, const Value *P, unsigned Size) { + ModRefResult getModRefInfo(const CallInst *C, const Value *P, uint64_t Size) { return getModRefInfo(C, Location(P, Size)); } @@ -313,7 +313,7 @@ /// getModRefInfo (for invokes) - A convenience wrapper. ModRefResult getModRefInfo(const InvokeInst *I, - const Value *P, unsigned Size) { + const Value *P, uint64_t Size) { return getModRefInfo(I, Location(P, Size)); } @@ -322,7 +322,7 @@ ModRefResult getModRefInfo(const LoadInst *L, const Location &Loc); /// getModRefInfo (for loads) - A convenience wrapper. - ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size) { + ModRefResult getModRefInfo(const LoadInst *L, const Value *P, uint64_t Size) { return getModRefInfo(L, Location(P, Size)); } @@ -331,7 +331,7 @@ ModRefResult getModRefInfo(const StoreInst *S, const Location &Loc); /// getModRefInfo (for stores) - A convenience wrapper. - ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) { + ModRefResult getModRefInfo(const StoreInst *S, const Value *P, uint64_t Size) { return getModRefInfo(S, Location(P, Size)); } @@ -340,7 +340,7 @@ ModRefResult getModRefInfo(const VAArgInst* I, const Location &Loc); /// getModRefInfo (for va_args) - A convenience wrapper. - ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, unsigned Size) { + ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, uint64_t Size) { return getModRefInfo(I, Location(P, Size)); } @@ -360,7 +360,7 @@ bool canBasicBlockModify(const BasicBlock &BB, const Location &Loc); /// canBasicBlockModify - A convenience wrapper. - bool canBasicBlockModify(const BasicBlock &BB, const Value *P, unsigned Size){ + bool canBasicBlockModify(const BasicBlock &BB, const Value *P, uint64_t Size){ return canBasicBlockModify(BB, Location(P, Size)); } @@ -373,7 +373,7 @@ /// canInstructionRangeModify - A convenience wrapper. bool canInstructionRangeModify(const Instruction &I1, const Instruction &I2, - const Value *Ptr, unsigned Size) { + const Value *Ptr, uint64_t Size) { return canInstructionRangeModify(I1, I2, Location(Ptr, Size)); } Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Tue Oct 19 17:54:46 2010 @@ -40,7 +40,7 @@ Value *Val; // The pointer this record corresponds to. PointerRec **PrevInList, *NextInList; AliasSet *AS; - unsigned Size; + uint64_t Size; const MDNode *TBAAInfo; public: PointerRec(Value *V) @@ -57,7 +57,7 @@ return &NextInList; } - void updateSizeAndTBAAInfo(unsigned NewSize, const MDNode *NewTBAAInfo) { + void updateSizeAndTBAAInfo(uint64_t NewSize, const MDNode *NewTBAAInfo) { if (NewSize > Size) Size = NewSize; if (TBAAInfo == DenseMapInfo::getEmptyKey()) @@ -68,7 +68,7 @@ TBAAInfo = DenseMapInfo::getTombstoneKey(); } - unsigned getSize() const { return Size; } + uint64_t getSize() const { return Size; } /// getTBAAInfo - Return the TBAAInfo, or null if there is no /// information or conflicting information. @@ -205,7 +205,7 @@ value_type *operator->() const { return &operator*(); } Value *getPointer() const { return CurNode->getValue(); } - unsigned getSize() const { return CurNode->getSize(); } + uint64_t getSize() const { return CurNode->getSize(); } const MDNode *getTBAAInfo() const { return CurNode->getTBAAInfo(); } iterator& operator++() { // Preincrement @@ -250,7 +250,7 @@ void removeFromTracker(AliasSetTracker &AST); - void addPointer(AliasSetTracker &AST, PointerRec &Entry, unsigned Size, + void addPointer(AliasSetTracker &AST, PointerRec &Entry, uint64_t Size, const MDNode *TBAAInfo, bool KnownMustAlias = false); void addCallSite(CallSite CS, AliasAnalysis &AA); @@ -266,7 +266,7 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// - bool aliasesPointer(const Value *Ptr, unsigned Size, const MDNode *TBAAInfo, + bool aliasesPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo, AliasAnalysis &AA) const; bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const; }; @@ -320,7 +320,7 @@ /// These methods return true if inserting the instruction resulted in the /// addition of a new alias set (i.e., the pointer did not alias anything). /// - bool add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); // Add a location + bool add(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); // Add a location bool add(LoadInst *LI); bool add(StoreInst *SI); bool add(VAArgInst *VAAI); @@ -335,7 +335,7 @@ /// be aliased by the specified instruction. These methods return true if any /// alias sets were eliminated. // Remove a location - bool remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo); + bool remove(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); bool remove(LoadInst *LI); bool remove(StoreInst *SI); bool remove(VAArgInst *VAAI); @@ -355,13 +355,13 @@ /// lives in. If the New argument is non-null, this method sets the value to /// true if a new alias set is created to contain the pointer (because the /// pointer didn't alias anything). - AliasSet &getAliasSetForPointer(Value *P, unsigned Size, + AliasSet &getAliasSetForPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo, bool *New = 0); /// getAliasSetForPointerIfExists - Return the alias set containing the /// location specified if one exists, otherwise return null. - AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size, + AliasSet *getAliasSetForPointerIfExists(Value *P, uint64_t Size, const MDNode *TBAAInfo) { return findAliasSetForPointer(P, Size, TBAAInfo); } @@ -369,7 +369,7 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. - bool containsPointer(Value *P, unsigned Size, const MDNode *TBAAInfo) const; + bool containsPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo) const; /// getAliasAnalysis - Return the underlying alias analysis object used by /// this tracker. @@ -416,7 +416,7 @@ return *Entry; } - AliasSet &addPointer(Value *P, unsigned Size, const MDNode *TBAAInfo, + AliasSet &addPointer(Value *P, uint64_t Size, const MDNode *TBAAInfo, AliasSet::AccessType E, bool &NewSet) { NewSet = false; @@ -424,7 +424,7 @@ AS.AccessTy |= E; return AS; } - AliasSet *findAliasSetForPointer(const Value *Ptr, unsigned Size, + AliasSet *findAliasSetForPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo); AliasSet *findAliasSetForCallSite(CallSite CS); Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Oct 19 17:54:46 2010 @@ -283,7 +283,7 @@ /// getTypeStoreSize - Return the TargetData store size for the given type, /// if known, or a conservative value otherwise. /// -unsigned AliasAnalysis::getTypeStoreSize(const Type *Ty) { +uint64_t AliasAnalysis::getTypeStoreSize(const Type *Ty) { return TD ? TD->getTypeStoreSize(Ty) : UnknownSize; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Oct 19 17:54:46 2010 @@ -168,12 +168,12 @@ // 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 = AliasAnalysis::UnknownSize; + uint64_t I1Size = AliasAnalysis::UnknownSize; const Type *I1ElTy = cast((*I1)->getType())->getElementType(); if (I1ElTy->isSized()) I1Size = AA.getTypeStoreSize(I1ElTy); for (SetVector::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { - unsigned I2Size = AliasAnalysis::UnknownSize; + uint64_t I2Size = AliasAnalysis::UnknownSize; const Type *I2ElTy =cast((*I2)->getType())->getElementType(); if (I2ElTy->isSized()) I2Size = AA.getTypeStoreSize(I2ElTy); @@ -200,7 +200,7 @@ for (SetVector::iterator V = Pointers.begin(), Ve = Pointers.end(); V != Ve; ++V) { - unsigned Size = AliasAnalysis::UnknownSize; + uint64_t Size = AliasAnalysis::UnknownSize; const Type *ElTy = cast((*V)->getType())->getElementType(); if (ElTy->isSized()) Size = AA.getTypeStoreSize(ElTy); Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Tue Oct 19 17:54:46 2010 @@ -88,7 +88,7 @@ } void AliasSet::addPointer(AliasSetTracker &AST, PointerRec &Entry, - unsigned Size, const MDNode *TBAAInfo, + uint64_t Size, const MDNode *TBAAInfo, bool KnownMustAlias) { assert(!Entry.hasAliasSet() && "Entry already in set!"); @@ -138,7 +138,7 @@ /// aliasesPointer - Return true if the specified pointer "may" (or must) /// alias one of the members in the set. /// -bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size, +bool AliasSet::aliasesPointer(const Value *Ptr, uint64_t Size, const MDNode *TBAAInfo, AliasAnalysis &AA) const { if (AliasTy == MustAlias) { @@ -210,7 +210,7 @@ /// that may alias the pointer, merge them together and return the unified set. /// AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr, - unsigned Size, + uint64_t Size, const MDNode *TBAAInfo) { AliasSet *FoundSet = 0; for (iterator I = begin(), E = end(); I != E; ++I) { @@ -229,7 +229,7 @@ /// containsPointer - Return true if the specified location is represented by /// this alias set, false otherwise. This does not modify the AST object or /// alias sets. -bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size, +bool AliasSetTracker::containsPointer(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) const { for (const_iterator I = begin(), E = end(); I != E; ++I) if (!I->Forward && I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) @@ -258,7 +258,7 @@ /// getAliasSetForPointer - Return the alias set that the specified pointer /// lives in. -AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size, +AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, uint64_t Size, const MDNode *TBAAInfo, bool *New) { AliasSet::PointerRec &Entry = getEntryFor(Pointer); @@ -283,7 +283,7 @@ return AliasSets.back(); } -bool AliasSetTracker::add(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { +bool AliasSetTracker::add(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) { bool NewPtr; addPointer(Ptr, Size, TBAAInfo, AliasSet::NoModRef, NewPtr); return NewPtr; @@ -414,7 +414,7 @@ } bool -AliasSetTracker::remove(Value *Ptr, unsigned Size, const MDNode *TBAAInfo) { +AliasSetTracker::remove(Value *Ptr, uint64_t Size, const MDNode *TBAAInfo) { AliasSet *AS = findAliasSetForPointer(Ptr, Size, TBAAInfo); if (!AS) return false; remove(*AS); @@ -422,7 +422,7 @@ } bool AliasSetTracker::remove(LoadInst *LI) { - unsigned Size = AA.getTypeStoreSize(LI->getType()); + uint64_t Size = AA.getTypeStoreSize(LI->getType()); const MDNode *TBAAInfo = LI->getMetadata(LLVMContext::MD_tbaa); AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size, TBAAInfo); if (!AS) return false; @@ -431,7 +431,7 @@ } bool AliasSetTracker::remove(StoreInst *SI) { - unsigned Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); + uint64_t Size = AA.getTypeStoreSize(SI->getOperand(0)->getType()); const MDNode *TBAAInfo = SI->getMetadata(LLVMContext::MD_tbaa); AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size, TBAAInfo); if (!AS) return false; Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Oct 19 17:54:46 2010 @@ -98,7 +98,7 @@ /// isObjectSmallerThan - Return true if we can prove that the object specified /// by V is smaller than Size. -static bool isObjectSmallerThan(const Value *V, unsigned Size, +static bool isObjectSmallerThan(const Value *V, uint64_t Size, const TargetData &TD) { const Type *AccessTy; if (const GlobalVariable *GV = dyn_cast(V)) { @@ -552,27 +552,27 @@ // aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP // instruction against another. - AliasResult aliasGEP(const GEPOperator *V1, unsigned V1Size, - const Value *V2, unsigned V2Size, + AliasResult aliasGEP(const GEPOperator *V1, uint64_t V1Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2); // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI // instruction against another. - AliasResult aliasPHI(const PHINode *PN, unsigned PNSize, + AliasResult aliasPHI(const PHINode *PN, uint64_t PNSize, const MDNode *PNTBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo); /// aliasSelect - Disambiguate a Select instruction against another value. - AliasResult aliasSelect(const SelectInst *SI, unsigned SISize, + AliasResult aliasSelect(const SelectInst *SI, uint64_t SISize, const MDNode *SITBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo); - AliasResult aliasCheck(const Value *V1, unsigned V1Size, + AliasResult aliasCheck(const Value *V1, uint64_t V1Size, const MDNode *V1TBAATag, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAATag); }; } // End of anonymous namespace @@ -691,7 +691,7 @@ default: break; case Intrinsic::memcpy: case Intrinsic::memmove: { - unsigned Len = UnknownSize; + uint64_t Len = UnknownSize; if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); @@ -707,7 +707,7 @@ // Since memset is 'accesses arguments' only, the AliasAnalysis base class // will handle it for the variable length case. if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { - unsigned Len = LenCI->getZExtValue(); + uint64_t Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); if (isNoAlias(Location(Dest, Len), Loc)) return NoModRef; @@ -727,7 +727,7 @@ case Intrinsic::atomic_load_umin: if (TD) { Value *Op1 = II->getArgOperand(0); - unsigned Op1Size = TD->getTypeStoreSize(Op1->getType()); + uint64_t Op1Size = TD->getTypeStoreSize(Op1->getType()); MDNode *Tag = II->getMetadata(LLVMContext::MD_tbaa); if (isNoAlias(Location(Op1, Op1Size, Tag), Loc)) return NoModRef; @@ -736,7 +736,7 @@ case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: { - unsigned PtrSize = + uint64_t PtrSize = cast(II->getArgOperand(0))->getZExtValue(); if (isNoAlias(Location(II->getArgOperand(1), PtrSize, @@ -746,7 +746,7 @@ break; } case Intrinsic::invariant_end: { - unsigned PtrSize = + uint64_t PtrSize = cast(II->getArgOperand(1))->getZExtValue(); if (isNoAlias(Location(II->getArgOperand(2), PtrSize, @@ -767,8 +767,8 @@ /// UnderlyingV2 is the same for V2. /// AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, unsigned V1Size, - const Value *V2, unsigned V2Size, +BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo, const Value *UnderlyingV1, const Value *UnderlyingV2) { @@ -878,8 +878,10 @@ // If our known offset is bigger than the access size, we know we don't have // an alias. if (GEP1BaseOffset) { - if (GEP1BaseOffset >= (int64_t)V2Size || - GEP1BaseOffset <= -(int64_t)V1Size) + if (GEP1BaseOffset >= 0 ? + (V2Size != UnknownSize && (uint64_t)GEP1BaseOffset >= V2Size) : + (V1Size != UnknownSize && -(uint64_t)GEP1BaseOffset >= V1Size && + GEP1BaseOffset != INT64_MIN)) return NoAlias; } @@ -889,9 +891,9 @@ /// aliasSelect - Provide a bunch of ad-hoc rules to disambiguate a Select /// instruction against another. AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasSelect(const SelectInst *SI, unsigned SISize, +BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize, const MDNode *SITBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { // If this select has been visited before, we're on a use-def cycle. // Such cycles are only valid when PHI nodes are involved or in unreachable @@ -939,9 +941,9 @@ // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI instruction // against another. AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasPHI(const PHINode *PN, unsigned PNSize, +BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize, const MDNode *PNTBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { // The PHI node has already been visited, avoid recursion any further. if (!Visited.insert(PN)) @@ -1013,9 +1015,9 @@ // such as array references. // AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, +BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size, const MDNode *V1TBAAInfo, - const Value *V2, unsigned V2Size, + const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { // If either of the memory references is empty, it doesn't matter what the // pointer values are. Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Tue Oct 19 17:54:46 2010 @@ -70,7 +70,7 @@ void visitCallSite(CallSite CS); void visitMemoryReference(Instruction &I, Value *Ptr, - unsigned Size, unsigned Align, + uint64_t Size, unsigned Align, const Type *Ty, unsigned Flags); void visitCallInst(CallInst &I); @@ -277,7 +277,7 @@ // Check that the memcpy arguments don't overlap. The AliasAnalysis API // isn't expressive enough for what we really want to do. Known partial // overlap is not distinguished from the case where nothing is known. - unsigned Size = 0; + uint64_t Size = 0; if (const ConstantInt *Len = dyn_cast(findValue(MCI->getLength(), /*OffsetOk=*/false))) @@ -361,7 +361,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, + Value *Ptr, uint64_t Size, unsigned Align, const Type *Ty, unsigned Flags) { // If no memory is being referenced, it doesn't matter if the pointer // is valid. Modified: llvm/trunk/lib/Analysis/Loads.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Loads.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Loads.cpp (original) +++ llvm/trunk/lib/Analysis/Loads.cpp Tue Oct 19 17:54:46 2010 @@ -166,7 +166,7 @@ if (MaxInstsToScan == 0) MaxInstsToScan = ~0U; // If we're using alias analysis to disambiguate get the size of *Ptr. - unsigned AccessSize = 0; + uint64_t AccessSize = 0; if (AA) { const Type *AccessTy = cast(Ptr->getType())->getElementType(); AccessSize = AA->getTypeStoreSize(AccessTy); Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Tue Oct 19 17:54:46 2010 @@ -451,7 +451,7 @@ const PointerType *LoadTy = cast(Load->getPointerOperand()->getType()); - unsigned LoadSize =(unsigned)TD->getTypeStoreSize(LoadTy->getElementType()); + uint64_t LoadSize = TD->getTypeStoreSize(LoadTy->getElementType()); if (AA.canInstructionRangeModify(BB->front(), *Load, Arg, LoadSize)) return false; // Pointer is invalidated! Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Oct 19 17:54:46 2010 @@ -61,7 +61,7 @@ bool handleFreeWithNonTrivialDependency(const CallInst *F, MemDepResult Dep); bool handleEndBlock(BasicBlock &BB); - bool RemoveUndeadPointers(Value *Ptr, unsigned killPointerSize, + bool RemoveUndeadPointers(Value *Ptr, uint64_t killPointerSize, BasicBlock::iterator &BBI, SmallPtrSet &deadPointers); void DeleteDeadInstruction(Instruction *I, @@ -79,7 +79,7 @@ AU.addPreserved(); } - unsigned getPointerSize(Value *V) const; + uint64_t getPointerSize(Value *V) const; }; } @@ -142,11 +142,11 @@ } /// getStoreSize - Return the length in bytes of the write by the clobbering -/// instruction. If variable or unknown, returns -1. -static unsigned getStoreSize(Instruction *I, const TargetData *TD) { +/// instruction. If variable or unknown, returns AliasAnalysis::UnknownSize. +static uint64_t getStoreSize(Instruction *I, const TargetData *TD) { assert(doesClobberMemory(I)); if (StoreInst *SI = dyn_cast(I)) { - if (!TD) return -1u; + if (!TD) return AliasAnalysis::UnknownSize; return TD->getTypeStoreSize(SI->getOperand(0)->getType()); } @@ -158,7 +158,7 @@ switch (II->getIntrinsicID()) { default: assert(false && "Unexpected intrinsic!"); case Intrinsic::init_trampoline: - return -1u; + return AliasAnalysis::UnknownSize; case Intrinsic::lifetime_end: Len = II->getArgOperand(0); break; @@ -167,7 +167,7 @@ if (ConstantInt *LenCI = dyn_cast(Len)) if (!LenCI->isAllOnesValue()) return LenCI->getZExtValue(); - return -1u; + return AliasAnalysis::UnknownSize; } /// isStoreAtLeastAsWideAs - Return true if the size of the store in I1 is @@ -182,10 +182,12 @@ // Exactly the same type, must have exactly the same size. if (I1Ty == I2Ty) return true; - int I1Size = getStoreSize(I1, TD); - int I2Size = getStoreSize(I2, TD); + uint64_t I1Size = getStoreSize(I1, TD); + uint64_t I2Size = getStoreSize(I2, TD); - return I1Size != -1 && I2Size != -1 && I1Size >= I2Size; + return I1Size != AliasAnalysis::UnknownSize && + I2Size != AliasAnalysis::UnknownSize && + I1Size >= I2Size; } bool DSE::runOnBasicBlock(BasicBlock &BB) { @@ -373,7 +375,7 @@ } Value *killPointer = 0; - unsigned killPointerSize = AliasAnalysis::UnknownSize; + uint64_t killPointerSize = AliasAnalysis::UnknownSize; // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst *L = dyn_cast(BBI)) { @@ -472,7 +474,7 @@ /// RemoveUndeadPointers - check for uses of a pointer that make it /// undead when scanning for dead stores to alloca's. -bool DSE::RemoveUndeadPointers(Value *killPointer, unsigned killPointerSize, +bool DSE::RemoveUndeadPointers(Value *killPointer, uint64_t killPointerSize, BasicBlock::iterator &BBI, SmallPtrSet &deadPointers) { AliasAnalysis &AA = getAnalysis(); @@ -565,7 +567,7 @@ } while (!NowDeadInsts.empty()); } -unsigned DSE::getPointerSize(Value *V) const { +uint64_t DSE::getPointerSize(Value *V) const { if (TD) { if (AllocaInst *A = dyn_cast(V)) { // Get size information for the alloca Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Oct 19 17:54:46 2010 @@ -190,7 +190,7 @@ /// pointerInvalidatedByLoop - Return true if the body of this loop may /// store into the memory location pointed to by V. /// - bool pointerInvalidatedByLoop(Value *V, unsigned Size, + bool pointerInvalidatedByLoop(Value *V, uint64_t Size, const MDNode *TBAAInfo) { // Check to see if any of the basic blocks in CurLoop invalidate *V. return CurAST->getAliasSetForPointer(V, Size, TBAAInfo).isMod(); @@ -402,7 +402,7 @@ return true; // Don't hoist loads which have may-aliased stores in loop. - unsigned Size = 0; + uint64_t Size = 0; if (LI->getType()->isSized()) Size = AA->getTypeStoreSize(LI->getType()); return !pointerInvalidatedByLoop(LI->getOperand(0), Size, Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Tue Oct 19 17:54:46 2010 @@ -772,7 +772,7 @@ // If the memmove is a constant size, use it for the alias query, this allows // us to optimize things like: memmove(P, P+64, 64); - unsigned MemMoveSize = AliasAnalysis::UnknownSize; + uint64_t MemMoveSize = AliasAnalysis::UnknownSize; if (ConstantInt *Len = dyn_cast(M->getLength())) MemMoveSize = Len->getZExtValue(); Modified: llvm/trunk/lib/Transforms/Scalar/Sink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Sink.cpp?rev=116875&r1=116874&r2=116875&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Sink.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Tue Oct 19 17:54:46 2010 @@ -157,7 +157,7 @@ if (L->isVolatile()) return false; Value *Ptr = L->getPointerOperand(); - unsigned Size = AA->getTypeStoreSize(L->getType()); + uint64_t Size = AA->getTypeStoreSize(L->getType()); for (SmallPtrSet::iterator I = Stores.begin(), E = Stores.end(); I != E; ++I) if (AA->getModRefInfo(*I, Ptr, Size) & AliasAnalysis::Mod) From gohman at apple.com Tue Oct 19 18:09:08 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 19 Oct 2010 23:09:08 -0000 Subject: [llvm-commits] [llvm] r116876 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/Passes.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/NoAliasAnalysis.cpp Message-ID: <20101019230908.914A82A6C12C@llvm.org> Author: djg Date: Tue Oct 19 18:09:08 2010 New Revision: 116876 URL: http://llvm.org/viewvc/llvm-project?rev=116876&view=rev Log: Move NoAA out of BasicAliasAnalysis.cpp into its own file, now that it doesn't have a special relationship with BasicAliasAnalysis anymore. Added: llvm/trunk/lib/Analysis/NoAliasAnalysis.cpp - copied, changed from r116875, llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/include/llvm/Analysis/Passes.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=116876&r1=116875&r2=116876&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Oct 19 18:09:08 2010 @@ -28,7 +28,6 @@ #define LLVM_ANALYSIS_ALIAS_ANALYSIS_H #include "llvm/Support/CallSite.h" -#include "llvm/System/IncludeFile.h" #include namespace llvm { @@ -422,11 +421,4 @@ } // End llvm namespace -// Because of the way .a files work, we must force the BasicAA implementation to -// be pulled in if the AliasAnalysis header is included. Otherwise we run -// the risk of AliasAnalysis being used, but the default implementation not -// being linked into the tool that uses it. -FORCE_DEFINING_FILE_TO_BE_LINKED(AliasAnalysis) -FORCE_DEFINING_FILE_TO_BE_LINKED(BasicAliasAnalysis) - #endif Modified: llvm/trunk/include/llvm/Analysis/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=116876&r1=116875&r2=116876&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Passes.h (original) +++ llvm/trunk/include/llvm/Analysis/Passes.h Tue Oct 19 18:09:08 2010 @@ -59,7 +59,7 @@ //===--------------------------------------------------------------------===// // - // createBasicAliasAnalysisPass - This pass implements the default alias + // createBasicAliasAnalysisPass - This pass implements the stateless alias // analysis. // ImmutablePass *createBasicAliasAnalysisPass(); Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=116876&r1=116875&r2=116876&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Oct 19 18:09:08 2010 @@ -342,9 +342,3 @@ return A->hasNoAliasAttr() || A->hasByValAttr(); return false; } - -// Because of the way .a files work, we must force the BasicAA implementation to -// be pulled in if the AliasAnalysis classes are pulled in. Otherwise we run -// the risk of AliasAnalysis being used, but the default implementation not -// being linked into the tool that uses it. -DEFINING_FILE_FOR(AliasAnalysis) Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=116876&r1=116875&r2=116876&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Oct 19 18:09:08 2010 @@ -1,4 +1,4 @@ -//===- BasicAliasAnalysis.cpp - Local Alias Analysis Impl -----------------===// +//===- BasicAliasAnalysis.cpp - Stateless Alias Analysis Impl -------------===// // // The LLVM Compiler Infrastructure // @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// // -// This file 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. +// This file defines the primary stateless implementation of the +// Alias Analysis interface that implements identities (two different +// globals cannot alias, etc), but does no stateful analysis. // //===----------------------------------------------------------------------===// @@ -129,74 +129,6 @@ } //===----------------------------------------------------------------------===// -// NoAA Pass -//===----------------------------------------------------------------------===// - -namespace { - /// NoAA - This class implements the -no-aa pass, which always returns "I - /// don't know" for alias queries. NoAA is unlike other alias analysis - /// implementations, in that it does not chain to a previous analysis. As - /// such it doesn't follow many of the rules that other alias analyses must. - /// - struct NoAA : public ImmutablePass, public AliasAnalysis { - static char ID; // Class identification, replacement for typeinfo - NoAA() : ImmutablePass(ID) { - initializeNoAAPass(*PassRegistry::getPassRegistry()); - } - explicit NoAA(char &PID) : ImmutablePass(PID) {} - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - } - - virtual void initializePass() { - TD = getAnalysisIfAvailable(); - } - - virtual AliasResult alias(const Location &LocA, const Location &LocB) { - return MayAlias; - } - - virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS) { - return UnknownModRefBehavior; - } - virtual ModRefBehavior getModRefBehavior(const Function *F) { - return UnknownModRefBehavior; - } - - virtual bool pointsToConstantMemory(const Location &Loc) { return false; } - virtual ModRefResult getModRefInfo(ImmutableCallSite CS, - const Location &Loc) { - return ModRef; - } - virtual ModRefResult getModRefInfo(ImmutableCallSite CS1, - ImmutableCallSite CS2) { - return ModRef; - } - - virtual void deleteValue(Value *V) {} - virtual void copyValue(Value *From, Value *To) {} - - /// getAdjustedAnalysisPointer - This method is used when a pass implements - /// an analysis interface through multiple inheritance. If needed, it - /// should override this to adjust the this pointer as needed for the - /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const void *ID) { - if (ID == &AliasAnalysis::ID) - return (AliasAnalysis*)this; - return this; - } - }; -} // End of anonymous namespace - -// Register this pass... -char NoAA::ID = 0; -INITIALIZE_AG_PASS(NoAA, AliasAnalysis, "no-aa", - "No Alias Analysis (always returns 'may' alias)", - true, true, true) - -ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } - -//===----------------------------------------------------------------------===// // GetElementPtr Instruction Decomposition and Analysis //===----------------------------------------------------------------------===// @@ -487,12 +419,10 @@ #endif namespace { - /// BasicAliasAnalysis - This is the default alias analysis implementation. - /// Because it doesn't chain to a previous alias analysis (like -no-aa), it - /// derives from the NoAA class. - struct BasicAliasAnalysis : public NoAA { + /// BasicAliasAnalysis - This is the primary alias analysis implementation. + struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis { static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA(ID) { + BasicAliasAnalysis() : ImmutablePass(ID) { initializeBasicAliasAnalysisPass(*PassRegistry::getPassRegistry()); } @@ -580,7 +510,7 @@ // Register this pass... char BasicAliasAnalysis::ID = 0; INITIALIZE_AG_PASS(BasicAliasAnalysis, AliasAnalysis, "basicaa", - "Basic Alias Analysis (default AA impl)", + "Basic Alias Analysis (stateless AA impl)", false, true, false) ImmutablePass *llvm::createBasicAliasAnalysisPass() { @@ -1125,6 +1055,3 @@ return AliasAnalysis::alias(Location(V1, V1Size, V1TBAAInfo), Location(V2, V2Size, V2TBAAInfo)); } - -// Make sure that anything that uses AliasAnalysis pulls in this file. -DEFINING_FILE_FOR(BasicAliasAnalysis) Copied: llvm/trunk/lib/Analysis/NoAliasAnalysis.cpp (from r116875, llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/NoAliasAnalysis.cpp?p2=llvm/trunk/lib/Analysis/NoAliasAnalysis.cpp&p1=llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp&r1=116875&r2=116876&rev=116876&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/NoAliasAnalysis.cpp Tue Oct 19 18:09:08 2010 @@ -1,4 +1,4 @@ -//===- BasicAliasAnalysis.cpp - Local Alias Analysis Impl -----------------===// +//===- NoAliasAnalysis.cpp - Minimal Alias Analysis Impl ------------------===// // // The LLVM Compiler Infrastructure // @@ -8,130 +8,16 @@ //===----------------------------------------------------------------------===// // // This file 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. +// that simply returns "I don't know" for all queries. // //===----------------------------------------------------------------------===// #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/Passes.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Function.h" -#include "llvm/GlobalAlias.h" -#include "llvm/GlobalVariable.h" -#include "llvm/Instructions.h" -#include "llvm/IntrinsicInst.h" -#include "llvm/LLVMContext.h" -#include "llvm/Operator.h" #include "llvm/Pass.h" -#include "llvm/Analysis/CaptureTracking.h" -#include "llvm/Analysis/MemoryBuiltins.h" -#include "llvm/Analysis/ValueTracking.h" #include "llvm/Target/TargetData.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/GetElementPtrTypeIterator.h" -#include using namespace llvm; -//===----------------------------------------------------------------------===// -// Useful predicates -//===----------------------------------------------------------------------===// - -/// isKnownNonNull - Return true if we know that the specified value is never -/// null. -static bool isKnownNonNull(const Value *V) { - // Alloca never returns null, malloc might. - if (isa(V)) return true; - - // A byval argument is never null. - if (const Argument *A = dyn_cast(V)) - return A->hasByValAttr(); - - // Global values are not null unless extern weak. - if (const GlobalValue *GV = dyn_cast(V)) - return !GV->hasExternalWeakLinkage(); - return false; -} - -/// isNonEscapingLocalObject - Return true if the pointer is to a function-local -/// object that never escapes from the function. -static bool isNonEscapingLocalObject(const Value *V) { - // If this is a local allocation, check to see if it escapes. - if (isa(V) || isNoAliasCall(V)) - // Set StoreCaptures to True so that we can assume in our callers that the - // pointer is not the result of a load instruction. Currently - // PointerMayBeCaptured doesn't have any special analysis for the - // StoreCaptures=false case; if it did, our callers could be refined to be - // more precise. - return !PointerMayBeCaptured(V, false, /*StoreCaptures=*/true); - - // If this is an argument that corresponds to a byval or noalias argument, - // then it has not escaped before entering the function. Check if it escapes - // inside the function. - if (const Argument *A = dyn_cast(V)) - if (A->hasByValAttr() || A->hasNoAliasAttr()) { - // Don't bother analyzing arguments already known not to escape. - if (A->hasNoCaptureAttr()) - return true; - return !PointerMayBeCaptured(V, false, /*StoreCaptures=*/true); - } - return false; -} - -/// isEscapeSource - Return true if the pointer is one which would have -/// been considered an escape by isNonEscapingLocalObject. -static bool isEscapeSource(const Value *V) { - if (isa(V) || isa(V) || isa(V)) - return true; - - // The load case works because isNonEscapingLocalObject considers all - // stores to be escapes (it passes true for the StoreCaptures argument - // to PointerMayBeCaptured). - if (isa(V)) - return true; - - return false; -} - -/// isObjectSmallerThan - Return true if we can prove that the object specified -/// by V is smaller than Size. -static bool isObjectSmallerThan(const Value *V, uint64_t Size, - const TargetData &TD) { - const Type *AccessTy; - if (const GlobalVariable *GV = dyn_cast(V)) { - AccessTy = GV->getType()->getElementType(); - } else if (const AllocaInst *AI = dyn_cast(V)) { - if (!AI->isArrayAllocation()) - AccessTy = AI->getType()->getElementType(); - else - return false; - } else if (const CallInst* CI = extractMallocCall(V)) { - if (!isArrayMalloc(V, &TD)) - // The size is the argument to the malloc call. - if (const ConstantInt* C = dyn_cast(CI->getArgOperand(0))) - return (C->getZExtValue() < Size); - return false; - } else if (const Argument *A = dyn_cast(V)) { - if (A->hasByValAttr()) - AccessTy = cast(A->getType())->getElementType(); - else - return false; - } else { - return false; - } - - if (AccessTy->isSized()) - return TD.getTypeAllocSize(AccessTy) < Size; - return false; -} - -//===----------------------------------------------------------------------===// -// NoAA Pass -//===----------------------------------------------------------------------===// - namespace { /// NoAA - This class implements the -no-aa pass, which always returns "I /// don't know" for alias queries. NoAA is unlike other alias analysis @@ -143,12 +29,13 @@ NoAA() : ImmutablePass(ID) { initializeNoAAPass(*PassRegistry::getPassRegistry()); } - explicit NoAA(char &PID) : ImmutablePass(PID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { } virtual void initializePass() { + // Note: NoAA does not call InitializeAliasAnalysis because it's + // special and does not support chaining. TD = getAnalysisIfAvailable(); } @@ -195,936 +82,3 @@ true, true, true) ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } - -//===----------------------------------------------------------------------===// -// GetElementPtr Instruction Decomposition and Analysis -//===----------------------------------------------------------------------===// - -namespace { - enum ExtensionKind { - EK_NotExtended, - EK_SignExt, - EK_ZeroExt - }; - - struct VariableGEPIndex { - const Value *V; - ExtensionKind Extension; - int64_t Scale; - }; -} - - -/// GetLinearExpression - Analyze the specified value as a linear expression: -/// "A*V + B", where A and B are constant integers. Return the scale and offset -/// values as APInts and return V as a Value*, and return whether we looked -/// through any sign or zero extends. The incoming Value is known to have -/// IntegerType and it may already be sign or zero extended. -/// -/// Note that this looks through extends, so the high bits may not be -/// represented in the result. -static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset, - ExtensionKind &Extension, - const TargetData &TD, unsigned Depth) { - assert(V->getType()->isIntegerTy() && "Not an integer value"); - - // Limit our recursion depth. - if (Depth == 6) { - Scale = 1; - Offset = 0; - return V; - } - - if (BinaryOperator *BOp = dyn_cast(V)) { - if (ConstantInt *RHSC = dyn_cast(BOp->getOperand(1))) { - switch (BOp->getOpcode()) { - default: break; - case Instruction::Or: - // X|C == X+C if all the bits in C are unset in X. Otherwise we can't - // analyze it. - if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(), &TD)) - break; - // FALL THROUGH. - case Instruction::Add: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, Extension, - TD, Depth+1); - Offset += RHSC->getValue(); - return V; - case Instruction::Mul: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, Extension, - TD, Depth+1); - Offset *= RHSC->getValue(); - Scale *= RHSC->getValue(); - return V; - case Instruction::Shl: - V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, Extension, - TD, Depth+1); - Offset <<= RHSC->getValue().getLimitedValue(); - Scale <<= RHSC->getValue().getLimitedValue(); - return V; - } - } - } - - // Since GEP indices are sign extended anyway, we don't care about the high - // bits of a sign or zero extended value - just scales and offsets. The - // extensions have to be consistent though. - if ((isa(V) && Extension != EK_ZeroExt) || - (isa(V) && Extension != EK_SignExt)) { - Value *CastOp = cast(V)->getOperand(0); - unsigned OldWidth = Scale.getBitWidth(); - unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits(); - Scale.trunc(SmallWidth); - Offset.trunc(SmallWidth); - Extension = isa(V) ? EK_SignExt : EK_ZeroExt; - - Value *Result = GetLinearExpression(CastOp, Scale, Offset, Extension, - TD, Depth+1); - Scale.zext(OldWidth); - Offset.zext(OldWidth); - - return Result; - } - - Scale = 1; - Offset = 0; - return V; -} - -/// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose it -/// into a base pointer with a constant offset and a number of scaled symbolic -/// offsets. -/// -/// The scaled symbolic offsets (represented by pairs of a Value* and a scale in -/// the VarIndices vector) are Value*'s that are known to be scaled by the -/// specified amount, but which may have other unrepresented high bits. As such, -/// the gep cannot necessarily be reconstructed from its decomposed form. -/// -/// When TargetData is around, this function is capable of analyzing everything -/// that Value::getUnderlyingObject() can look through. When not, it just looks -/// through pointer casts. -/// -static const Value * -DecomposeGEPExpression(const Value *V, int64_t &BaseOffs, - SmallVectorImpl &VarIndices, - const TargetData *TD) { - // Limit recursion depth to limit compile time in crazy cases. - unsigned MaxLookup = 6; - - BaseOffs = 0; - do { - // See if this is a bitcast or GEP. - const Operator *Op = dyn_cast(V); - if (Op == 0) { - // The only non-operator case we can handle are GlobalAliases. - if (const GlobalAlias *GA = dyn_cast(V)) { - if (!GA->mayBeOverridden()) { - V = GA->getAliasee(); - continue; - } - } - return V; - } - - if (Op->getOpcode() == Instruction::BitCast) { - V = Op->getOperand(0); - continue; - } - - const GEPOperator *GEPOp = dyn_cast(Op); - if (GEPOp == 0) - return V; - - // Don't attempt to analyze GEPs over unsized objects. - if (!cast(GEPOp->getOperand(0)->getType()) - ->getElementType()->isSized()) - return V; - - // If we are lacking TargetData information, we can't compute the offets of - // elements computed by GEPs. However, we can handle bitcast equivalent - // GEPs. - if (TD == 0) { - if (!GEPOp->hasAllZeroIndices()) - return V; - V = GEPOp->getOperand(0); - continue; - } - - // Walk the indices of the GEP, accumulating them into BaseOff/VarIndices. - gep_type_iterator GTI = gep_type_begin(GEPOp); - for (User::const_op_iterator I = GEPOp->op_begin()+1, - E = GEPOp->op_end(); I != E; ++I) { - Value *Index = *I; - // Compute the (potentially symbolic) offset in bytes for this index. - if (const StructType *STy = dyn_cast(*GTI++)) { - // For a struct, add the member offset. - unsigned FieldNo = cast(Index)->getZExtValue(); - if (FieldNo == 0) continue; - - BaseOffs += TD->getStructLayout(STy)->getElementOffset(FieldNo); - continue; - } - - // For an array/pointer, add the element offset, explicitly scaled. - if (ConstantInt *CIdx = dyn_cast(Index)) { - if (CIdx->isZero()) continue; - BaseOffs += TD->getTypeAllocSize(*GTI)*CIdx->getSExtValue(); - continue; - } - - uint64_t Scale = TD->getTypeAllocSize(*GTI); - ExtensionKind Extension = EK_NotExtended; - - // If the integer type is smaller than the pointer size, it is implicitly - // sign extended to pointer size. - unsigned Width = cast(Index->getType())->getBitWidth(); - if (TD->getPointerSizeInBits() > Width) - Extension = EK_SignExt; - - // Use GetLinearExpression to decompose the index into a C1*V+C2 form. - APInt IndexScale(Width, 0), IndexOffset(Width, 0); - Index = GetLinearExpression(Index, IndexScale, IndexOffset, Extension, - *TD, 0); - - // The GEP index scale ("Scale") scales C1*V+C2, yielding (C1*V+C2)*Scale. - // This gives us an aggregate computation of (C1*Scale)*V + C2*Scale. - BaseOffs += IndexOffset.getSExtValue()*Scale; - Scale *= IndexScale.getSExtValue(); - - - // If we already had an occurrance of this index variable, merge this - // scale into it. For example, we want to handle: - // A[x][x] -> x*16 + x*4 -> x*20 - // This also ensures that 'x' only appears in the index list once. - for (unsigned i = 0, e = VarIndices.size(); i != e; ++i) { - if (VarIndices[i].V == Index && - VarIndices[i].Extension == Extension) { - Scale += VarIndices[i].Scale; - VarIndices.erase(VarIndices.begin()+i); - break; - } - } - - // Make sure that we have a scale that makes sense for this target's - // pointer size. - if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) { - Scale <<= ShiftBits; - Scale = (int64_t)Scale >> ShiftBits; - } - - if (Scale) { - VariableGEPIndex Entry = {Index, Extension, Scale}; - VarIndices.push_back(Entry); - } - } - - // Analyze the base pointer next. - V = GEPOp->getOperand(0); - } while (--MaxLookup); - - // If the chain of expressions is too deep, just return early. - return V; -} - -/// GetIndexDifference - Dest and Src are the variable indices from two -/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base -/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic -/// difference between the two pointers. -static void GetIndexDifference(SmallVectorImpl &Dest, - const SmallVectorImpl &Src) { - if (Src.empty()) return; - - for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].V; - ExtensionKind Extension = Src[i].Extension; - int64_t Scale = Src[i].Scale; - - // Find V in Dest. This is N^2, but pointer indices almost never have more - // than a few variable indexes. - for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].V != V || Dest[j].Extension != Extension) continue; - - // If we found it, subtract off Scale V's from the entry in Dest. If it - // goes to zero, remove the entry. - if (Dest[j].Scale != Scale) - Dest[j].Scale -= Scale; - else - Dest.erase(Dest.begin()+j); - Scale = 0; - break; - } - - // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) { - VariableGEPIndex Entry = { V, Extension, -Scale }; - Dest.push_back(Entry); - } - } -} - -//===----------------------------------------------------------------------===// -// BasicAliasAnalysis Pass -//===----------------------------------------------------------------------===// - -#ifndef NDEBUG -static const Function *getParent(const Value *V) { - if (const Instruction *inst = dyn_cast(V)) - return inst->getParent()->getParent(); - - if (const Argument *arg = dyn_cast(V)) - return arg->getParent(); - - return NULL; -} - -static bool notDifferentParent(const Value *O1, const Value *O2) { - - const Function *F1 = getParent(O1); - const Function *F2 = getParent(O2); - - return !F1 || !F2 || F1 == F2; -} -#endif - -namespace { - /// BasicAliasAnalysis - This is the default alias analysis implementation. - /// Because it doesn't chain to a previous alias analysis (like -no-aa), it - /// derives from the NoAA class. - struct BasicAliasAnalysis : public NoAA { - static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA(ID) { - initializeBasicAliasAnalysisPass(*PassRegistry::getPassRegistry()); - } - - virtual void initializePass() { - InitializeAliasAnalysis(this); - } - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - } - - virtual AliasResult alias(const Location &LocA, - const Location &LocB) { - assert(Visited.empty() && "Visited must be cleared after use!"); - assert(notDifferentParent(LocA.Ptr, LocB.Ptr) && - "BasicAliasAnalysis doesn't support interprocedural queries."); - AliasResult Alias = aliasCheck(LocA.Ptr, LocA.Size, LocA.TBAATag, - LocB.Ptr, LocB.Size, LocB.TBAATag); - Visited.clear(); - return Alias; - } - - virtual ModRefResult getModRefInfo(ImmutableCallSite CS, - const Location &Loc); - - virtual ModRefResult getModRefInfo(ImmutableCallSite CS1, - ImmutableCallSite CS2) { - // The AliasAnalysis base class has some smarts, lets use them. - return AliasAnalysis::getModRefInfo(CS1, CS2); - } - - /// pointsToConstantMemory - Chase pointers until we find a (constant - /// global) or not. - virtual bool pointsToConstantMemory(const Location &Loc); - - /// getModRefBehavior - Return the behavior when calling the given - /// call site. - virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS); - - /// getModRefBehavior - Return the behavior when calling the given function. - /// For use when the call site is not known. - virtual ModRefBehavior getModRefBehavior(const Function *F); - - /// getAdjustedAnalysisPointer - This method is used when a pass implements - /// an analysis interface through multiple inheritance. If needed, it - /// should override this to adjust the this pointer as needed for the - /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const void *ID) { - if (ID == &AliasAnalysis::ID) - return (AliasAnalysis*)this; - return this; - } - - private: - // Visited - Track instructions visited by a aliasPHI, aliasSelect(), and aliasGEP(). - SmallPtrSet Visited; - - // aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP - // instruction against another. - AliasResult aliasGEP(const GEPOperator *V1, uint64_t V1Size, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo, - const Value *UnderlyingV1, const Value *UnderlyingV2); - - // aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI - // instruction against another. - AliasResult aliasPHI(const PHINode *PN, uint64_t PNSize, - const MDNode *PNTBAAInfo, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo); - - /// aliasSelect - Disambiguate a Select instruction against another value. - AliasResult aliasSelect(const SelectInst *SI, uint64_t SISize, - const MDNode *SITBAAInfo, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo); - - AliasResult aliasCheck(const Value *V1, uint64_t V1Size, - const MDNode *V1TBAATag, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAATag); - }; -} // End of anonymous namespace - -// Register this pass... -char BasicAliasAnalysis::ID = 0; -INITIALIZE_AG_PASS(BasicAliasAnalysis, AliasAnalysis, "basicaa", - "Basic Alias Analysis (default AA impl)", - false, true, false) - -ImmutablePass *llvm::createBasicAliasAnalysisPass() { - return new BasicAliasAnalysis(); -} - - -/// pointsToConstantMemory - Chase pointers until we find a (constant -/// global) or not. -bool BasicAliasAnalysis::pointsToConstantMemory(const Location &Loc) { - if (const GlobalVariable *GV = - dyn_cast(Loc.Ptr->getUnderlyingObject())) - // Note: this doesn't require GV to be "ODR" because it isn't legal for a - // global to be marked constant in some modules and non-constant in others. - // GV may even be a declaration, not a definition. - return GV->isConstant(); - - return AliasAnalysis::pointsToConstantMemory(Loc); -} - -/// getModRefBehavior - Return the behavior when calling the given call site. -AliasAnalysis::ModRefBehavior -BasicAliasAnalysis::getModRefBehavior(ImmutableCallSite CS) { - if (CS.doesNotAccessMemory()) - // Can't do better than this. - return DoesNotAccessMemory; - - ModRefBehavior Min = UnknownModRefBehavior; - - // If the callsite knows it only reads memory, don't return worse - // than that. - if (CS.onlyReadsMemory()) - Min = OnlyReadsMemory; - - // The AliasAnalysis base class has some smarts, lets use them. - return std::min(AliasAnalysis::getModRefBehavior(CS), Min); -} - -/// getModRefBehavior - Return the behavior when calling the given function. -/// For use when the call site is not known. -AliasAnalysis::ModRefBehavior -BasicAliasAnalysis::getModRefBehavior(const Function *F) { - if (F->doesNotAccessMemory()) - // Can't do better than this. - return DoesNotAccessMemory; - if (F->onlyReadsMemory()) - return OnlyReadsMemory; - if (unsigned id = F->getIntrinsicID()) - return getIntrinsicModRefBehavior(id); - - return AliasAnalysis::getModRefBehavior(F); -} - -/// getModRefInfo - Check to see if the specified callsite can clobber the -/// specified memory object. Since we only look at local properties of this -/// function, we really can't say much about this query. We do, however, use -/// simple "address taken" analysis on local objects. -AliasAnalysis::ModRefResult -BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS, - const Location &Loc) { - assert(notDifferentParent(CS.getInstruction(), Loc.Ptr) && - "AliasAnalysis query involving multiple functions!"); - - const Value *Object = Loc.Ptr->getUnderlyingObject(); - - // If this is a tail call and Loc.Ptr points to a stack location, we know that - // the tail call cannot access or modify the local stack. - // We cannot exclude byval arguments here; these belong to the caller of - // the current function not to the current function, and a tail callee - // may reference them. - if (isa(Object)) - if (const CallInst *CI = dyn_cast(CS.getInstruction())) - if (CI->isTailCall()) - return NoModRef; - - // 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 && - isNonEscapingLocalObject(Object)) { - bool PassedAsArg = false; - unsigned ArgNo = 0; - for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end(); - CI != CE; ++CI, ++ArgNo) { - // Only look at the no-capture pointer arguments. - if (!(*CI)->getType()->isPointerTy() || - !CS.paramHasAttr(ArgNo+1, Attribute::NoCapture)) - continue; - - // If this is a no-capture pointer argument, see if we can tell that it - // is impossible to alias the pointer we're checking. If not, we have to - // assume that the call could touch the pointer, even though it doesn't - // escape. - if (!isNoAlias(Location(cast(CI)), Loc)) { - PassedAsArg = true; - break; - } - } - - if (!PassedAsArg) - return NoModRef; - } - - // Finally, handle specific knowledge of intrinsics. - const IntrinsicInst *II = dyn_cast(CS.getInstruction()); - if (II != 0) - switch (II->getIntrinsicID()) { - default: break; - case Intrinsic::memcpy: - case Intrinsic::memmove: { - uint64_t Len = UnknownSize; - if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) - Len = LenCI->getZExtValue(); - Value *Dest = II->getArgOperand(0); - Value *Src = II->getArgOperand(1); - if (isNoAlias(Location(Dest, Len), Loc)) { - if (isNoAlias(Location(Src, Len), Loc)) - return NoModRef; - return Ref; - } - break; - } - case Intrinsic::memset: - // Since memset is 'accesses arguments' only, the AliasAnalysis base class - // will handle it for the variable length case. - if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { - uint64_t Len = LenCI->getZExtValue(); - Value *Dest = II->getArgOperand(0); - if (isNoAlias(Location(Dest, Len), Loc)) - return NoModRef; - } - break; - case Intrinsic::atomic_cmp_swap: - case Intrinsic::atomic_swap: - case Intrinsic::atomic_load_add: - case Intrinsic::atomic_load_sub: - case Intrinsic::atomic_load_and: - case Intrinsic::atomic_load_nand: - case Intrinsic::atomic_load_or: - case Intrinsic::atomic_load_xor: - case Intrinsic::atomic_load_max: - case Intrinsic::atomic_load_min: - case Intrinsic::atomic_load_umax: - case Intrinsic::atomic_load_umin: - if (TD) { - Value *Op1 = II->getArgOperand(0); - uint64_t Op1Size = TD->getTypeStoreSize(Op1->getType()); - MDNode *Tag = II->getMetadata(LLVMContext::MD_tbaa); - if (isNoAlias(Location(Op1, Op1Size, Tag), Loc)) - return NoModRef; - } - break; - case Intrinsic::lifetime_start: - case Intrinsic::lifetime_end: - case Intrinsic::invariant_start: { - uint64_t PtrSize = - cast(II->getArgOperand(0))->getZExtValue(); - if (isNoAlias(Location(II->getArgOperand(1), - PtrSize, - II->getMetadata(LLVMContext::MD_tbaa)), - Loc)) - return NoModRef; - break; - } - case Intrinsic::invariant_end: { - uint64_t PtrSize = - cast(II->getArgOperand(1))->getZExtValue(); - if (isNoAlias(Location(II->getArgOperand(2), - PtrSize, - II->getMetadata(LLVMContext::MD_tbaa)), - Loc)) - return NoModRef; - break; - } - } - - // The AliasAnalysis base class has some smarts, lets use them. - return AliasAnalysis::getModRefInfo(CS, Loc); -} - -/// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction -/// against another pointer. We know that V1 is a GEP, but we don't know -/// anything about V2. UnderlyingV1 is GEP1->getUnderlyingObject(), -/// UnderlyingV2 is the same for V2. -/// -AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo, - const Value *UnderlyingV1, - const Value *UnderlyingV2) { - // If this GEP has been visited before, we're on a use-def cycle. - // Such cycles are only valid when PHI nodes are involved or in unreachable - // code. The visitPHI function catches cycles containing PHIs, but there - // could still be a cycle without PHIs in unreachable code. - if (!Visited.insert(GEP1)) - return MayAlias; - - int64_t GEP1BaseOffset; - SmallVector GEP1VariableIndices; - - // If we have two gep instructions with must-alias'ing base pointers, figure - // out if the indexes to the GEP tell us anything about the derived pointer. - if (const GEPOperator *GEP2 = dyn_cast(V2)) { - // Do the base pointers alias? - AliasResult BaseAlias = aliasCheck(UnderlyingV1, UnknownSize, 0, - UnderlyingV2, UnknownSize, 0); - - // If we get a No or May, then return it immediately, no amount of analysis - // will improve this situation. - if (BaseAlias != MustAlias) return BaseAlias; - - // Otherwise, we have a MustAlias. Since the base pointers alias each other - // exactly, see if the computed offset from the common pointer tells us - // about the relation of the resulting pointer. - const Value *GEP1BasePtr = - DecomposeGEPExpression(GEP1, GEP1BaseOffset, GEP1VariableIndices, TD); - - int64_t GEP2BaseOffset; - SmallVector GEP2VariableIndices; - const Value *GEP2BasePtr = - DecomposeGEPExpression(GEP2, GEP2BaseOffset, GEP2VariableIndices, TD); - - // If DecomposeGEPExpression isn't able to look all the way through the - // addressing operation, we must not have TD and this is too complex for us - // to handle without it. - if (GEP1BasePtr != UnderlyingV1 || GEP2BasePtr != UnderlyingV2) { - assert(TD == 0 && - "DecomposeGEPExpression and getUnderlyingObject disagree!"); - return MayAlias; - } - - // Subtract the GEP2 pointer from the GEP1 pointer to find out their - // symbolic difference. - GEP1BaseOffset -= GEP2BaseOffset; - GetIndexDifference(GEP1VariableIndices, GEP2VariableIndices); - - } else { - // Check to see if these two pointers are related by the getelementptr - // instruction. If one pointer is a GEP with a non-zero index of the other - // pointer, we know they cannot alias. - - // If both accesses are unknown size, we can't do anything useful here. - if (V1Size == UnknownSize && V2Size == UnknownSize) - return MayAlias; - - AliasResult R = aliasCheck(UnderlyingV1, UnknownSize, 0, - V2, V2Size, V2TBAAInfo); - if (R != MustAlias) - // If V2 may alias GEP base pointer, conservatively returns MayAlias. - // If V2 is known not to alias GEP base pointer, then the two values - // cannot alias per GEP semantics: "A pointer value formed from a - // getelementptr instruction is associated with the addresses associated - // with the first operand of the getelementptr". - return R; - - const Value *GEP1BasePtr = - DecomposeGEPExpression(GEP1, GEP1BaseOffset, GEP1VariableIndices, TD); - - // If DecomposeGEPExpression isn't able to look all the way through the - // addressing operation, we must not have TD and this is too complex for us - // to handle without it. - if (GEP1BasePtr != UnderlyingV1) { - assert(TD == 0 && - "DecomposeGEPExpression and getUnderlyingObject disagree!"); - return MayAlias; - } - } - - // In the two GEP Case, if there is no difference in the offsets of the - // computed pointers, the resultant pointers are a must alias. This - // hapens when we have two lexically identical GEP's (for example). - // - // In the other case, if we have getelementptr , 0, 0, 0, 0, ... and V2 - // must aliases the GEP, the end result is a must alias also. - if (GEP1BaseOffset == 0 && GEP1VariableIndices.empty()) - return MustAlias; - - // If we have a known constant offset, see if this offset is larger than the - // access size being queried. If so, and if no variable indices can remove - // pieces of this constant, then we know we have a no-alias. For example, - // &A[100] != &A. - - // In order to handle cases like &A[100][i] where i is an out of range - // subscript, we have to ignore all constant offset pieces that are a multiple - // of a scaled index. Do this by removing constant offsets that are a - // multiple of any of our variable indices. This allows us to transform - // things like &A[i][1] because i has a stride of (e.g.) 8 bytes but the 1 - // provides an offset of 4 bytes (assuming a <= 4 byte access). - for (unsigned i = 0, e = GEP1VariableIndices.size(); - i != e && GEP1BaseOffset;++i) - if (int64_t RemovedOffset = GEP1BaseOffset/GEP1VariableIndices[i].Scale) - GEP1BaseOffset -= RemovedOffset*GEP1VariableIndices[i].Scale; - - // If our known offset is bigger than the access size, we know we don't have - // an alias. - if (GEP1BaseOffset) { - if (GEP1BaseOffset >= 0 ? - (V2Size != UnknownSize && (uint64_t)GEP1BaseOffset >= V2Size) : - (V1Size != UnknownSize && -(uint64_t)GEP1BaseOffset >= V1Size && - GEP1BaseOffset != INT64_MIN)) - return NoAlias; - } - - return MayAlias; -} - -/// aliasSelect - Provide a bunch of ad-hoc rules to disambiguate a Select -/// instruction against another. -AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize, - const MDNode *SITBAAInfo, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo) { - // If this select has been visited before, we're on a use-def cycle. - // Such cycles are only valid when PHI nodes are involved or in unreachable - // code. The visitPHI function catches cycles containing PHIs, but there - // could still be a cycle without PHIs in unreachable code. - if (!Visited.insert(SI)) - return MayAlias; - - // If the values are Selects with the same condition, we can do a more precise - // check: just check for aliases between the values on corresponding arms. - if (const SelectInst *SI2 = dyn_cast(V2)) - if (SI->getCondition() == SI2->getCondition()) { - AliasResult Alias = - aliasCheck(SI->getTrueValue(), SISize, SITBAAInfo, - SI2->getTrueValue(), V2Size, V2TBAAInfo); - if (Alias == MayAlias) - return MayAlias; - AliasResult ThisAlias = - aliasCheck(SI->getFalseValue(), SISize, SITBAAInfo, - SI2->getFalseValue(), V2Size, V2TBAAInfo); - if (ThisAlias != Alias) - return MayAlias; - return Alias; - } - - // If both arms of the Select node NoAlias or MustAlias V2, then returns - // NoAlias / MustAlias. Otherwise, returns MayAlias. - AliasResult Alias = - aliasCheck(V2, V2Size, V2TBAAInfo, SI->getTrueValue(), SISize, SITBAAInfo); - if (Alias == MayAlias) - return MayAlias; - - // If V2 is visited, the recursive case will have been caught in the - // above aliasCheck call, so these subsequent calls to aliasCheck - // don't need to assume that V2 is being visited recursively. - Visited.erase(V2); - - AliasResult ThisAlias = - aliasCheck(V2, V2Size, V2TBAAInfo, SI->getFalseValue(), SISize, SITBAAInfo); - if (ThisAlias != Alias) - return MayAlias; - return Alias; -} - -// aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI instruction -// against another. -AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize, - const MDNode *PNTBAAInfo, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo) { - // The PHI node has already been visited, avoid recursion any further. - if (!Visited.insert(PN)) - return MayAlias; - - // If the values are PHIs in the same block, we can do a more precise - // as well as efficient check: just check for aliases between the values - // on corresponding edges. - if (const PHINode *PN2 = dyn_cast(V2)) - if (PN2->getParent() == PN->getParent()) { - AliasResult Alias = - aliasCheck(PN->getIncomingValue(0), PNSize, PNTBAAInfo, - PN2->getIncomingValueForBlock(PN->getIncomingBlock(0)), - V2Size, V2TBAAInfo); - if (Alias == MayAlias) - return MayAlias; - for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i) { - AliasResult ThisAlias = - aliasCheck(PN->getIncomingValue(i), PNSize, PNTBAAInfo, - PN2->getIncomingValueForBlock(PN->getIncomingBlock(i)), - V2Size, V2TBAAInfo); - if (ThisAlias != Alias) - return MayAlias; - } - return Alias; - } - - SmallPtrSet UniqueSrc; - SmallVector V1Srcs; - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { - Value *PV1 = PN->getIncomingValue(i); - if (isa(PV1)) - // If any of the source itself is a PHI, return MayAlias conservatively - // to avoid compile time explosion. The worst possible case is if both - // sides are PHI nodes. In which case, this is O(m x n) time where 'm' - // and 'n' are the number of PHI sources. - return MayAlias; - if (UniqueSrc.insert(PV1)) - V1Srcs.push_back(PV1); - } - - AliasResult Alias = aliasCheck(V2, V2Size, V2TBAAInfo, - V1Srcs[0], PNSize, PNTBAAInfo); - // Early exit if the check of the first PHI source against V2 is MayAlias. - // Other results are not possible. - if (Alias == MayAlias) - return MayAlias; - - // If all sources of the PHI node NoAlias or MustAlias V2, then returns - // NoAlias / MustAlias. Otherwise, returns MayAlias. - for (unsigned i = 1, e = V1Srcs.size(); i != e; ++i) { - Value *V = V1Srcs[i]; - - // If V2 is visited, the recursive case will have been caught in the - // above aliasCheck call, so these subsequent calls to aliasCheck - // don't need to assume that V2 is being visited recursively. - Visited.erase(V2); - - AliasResult ThisAlias = aliasCheck(V2, V2Size, V2TBAAInfo, - V, PNSize, PNTBAAInfo); - if (ThisAlias != Alias || ThisAlias == MayAlias) - return MayAlias; - } - - return Alias; -} - -// aliasCheck - Provide a bunch of ad-hoc rules to disambiguate in common cases, -// such as array references. -// -AliasAnalysis::AliasResult -BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size, - const MDNode *V1TBAAInfo, - const Value *V2, uint64_t V2Size, - const MDNode *V2TBAAInfo) { - // If either of the memory references is empty, it doesn't matter what the - // pointer values are. - if (V1Size == 0 || V2Size == 0) - return NoAlias; - - // Strip off any casts if they exist. - V1 = V1->stripPointerCasts(); - V2 = V2->stripPointerCasts(); - - // Are we checking for alias of the same value? - if (V1 == V2) return MustAlias; - - if (!V1->getType()->isPointerTy() || !V2->getType()->isPointerTy()) - return NoAlias; // Scalars cannot alias each other - - // Figure out what objects these things are pointing to if we can. - const Value *O1 = V1->getUnderlyingObject(); - const Value *O2 = V2->getUnderlyingObject(); - - // Null values in the default address space don't point to any object, so they - // don't alias any other pointer. - if (const ConstantPointerNull *CPN = dyn_cast(O1)) - if (CPN->getType()->getAddressSpace() == 0) - return NoAlias; - if (const ConstantPointerNull *CPN = dyn_cast(O2)) - if (CPN->getType()->getAddressSpace() == 0) - return NoAlias; - - if (O1 != O2) { - // If V1/V2 point to two different objects we know that we have no alias. - if (isIdentifiedObject(O1) && isIdentifiedObject(O2)) - return NoAlias; - - // Constant pointers can't alias with non-const isIdentifiedObject objects. - 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 (((isa(O1) && (isa(O2) || isNoAliasCall(O2))) || - (isa(O2) && (isa(O1) || isNoAliasCall(O1))))) - return NoAlias; - - // Most objects can't alias null. - 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) - if ((V1Size != UnknownSize && isObjectSmallerThan(O2, V1Size, *TD)) || - (V2Size != UnknownSize && isObjectSmallerThan(O1, V2Size, *TD))) - 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)) { - std::swap(V1, V2); - std::swap(V1Size, V2Size); - std::swap(O1, O2); - } - if (const GEPOperator *GV1 = dyn_cast(V1)) { - AliasResult Result = aliasGEP(GV1, V1Size, V2, V2Size, V2TBAAInfo, O1, O2); - if (Result != MayAlias) return Result; - } - - if (isa(V2) && !isa(V1)) { - std::swap(V1, V2); - std::swap(V1Size, V2Size); - } - if (const PHINode *PN = dyn_cast(V1)) { - AliasResult Result = aliasPHI(PN, V1Size, V1TBAAInfo, - V2, V2Size, V2TBAAInfo); - if (Result != MayAlias) return Result; - } - - if (isa(V2) && !isa(V1)) { - std::swap(V1, V2); - std::swap(V1Size, V2Size); - } - if (const SelectInst *S1 = dyn_cast(V1)) { - AliasResult Result = aliasSelect(S1, V1Size, V1TBAAInfo, - V2, V2Size, V2TBAAInfo); - if (Result != MayAlias) return Result; - } - - return AliasAnalysis::alias(Location(V1, V1Size, V1TBAAInfo), - Location(V2, V2Size, V2TBAAInfo)); -} - -// Make sure that anything that uses AliasAnalysis pulls in this file. -DEFINING_FILE_FOR(BasicAliasAnalysis) From bigcheesegs at gmail.com Tue Oct 19 18:20:51 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Tue, 19 Oct 2010 19:20:51 -0400 Subject: [llvm-commits] [rfc][patch] How should we handle _GLOBAL_OFFSET_TABLE_? In-Reply-To: References: Message-ID: 2010/10/19 Rafael Esp?ndola : > Consider the instruction > > addl ? ?$_GLOBAL_OFFSET_TABLE_, %ebx > > It should assemble to something like > > 81 c3 02 00 00 00 ? ? ? add ? ?$0x2,%ebx > > The "2" in the add comes from the first two bytes. This is a special > treatment for _GLOBAL_OFFSET_TABLE_. It also produces a special kind > of relocation (R_386_GOTPC). Is it too late to do it when the special relocation is generated? Or does that happen inside the ELF streamer/writer? > The relocation kind can be handled in the writer (and is). The problem > is that it is then too late to find the offset of the relocation > inside the instruction. This patch does it by modifying > X86MCCodeEmitter.cpp. This might be undesirable as this code is also > used for non-ELF targets. I tend to dislike relying on string literals, but this patch seems to be fine for now. The relocation is x86 specific, so I would think that it is OK for this to occur in the x86 back-end. > I tried to do this on the ELF streamer, but failed because > EncodeInstruction is also called directly from the assembler when > handling relaxations and the streamer cannot patch it up. > > Another way I can see this being done is having a object specific > wrapper for CodeEmitter::EncodeInstruction. This would be a nop for > MachO and COFF, but ELF 32 bits could then patch it up to account for > _GLOBAL_OFFSET_TABLE_. > > Any better ideas on how to implement this? I would prefer this happen whenever the relocation is generated in the x86 backend. Object file formats really shouldn't care about instructions. I don't object to adding an object specific hook, but it does seem to be of limited use. > P.S.: Ugly as the attached patch is, it gets clang to build itself on > 32 bits with the integrated assembler :-) > > Cheers, > Rafael This patch (with some comments) looks fine to me for now, but I would prefer a solution that doesn't depend on the symbol name. - Michael Spencer From grosbach at apple.com Tue Oct 19 18:27:08 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 19 Oct 2010 23:27:08 -0000 Subject: [llvm-commits] [llvm] r116879 - in /llvm/trunk: docs/ExceptionHandling.html include/llvm/CodeGen/ISDOpcodes.h include/llvm/Intrinsics.td lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SjLjEHPrepare.cpp lib/Target/ARM/ARMBaseInstrInfo.h lib/Target/ARM/ARMExpandPseudoInsts.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/Thumb1RegisterInfo.cpp Message-ID: <20101019232708.93CF62A6C12C@llvm.org> Author: grosbach Date: Tue Oct 19 18:27:08 2010 New Revision: 116879 URL: http://llvm.org/viewvc/llvm-project?rev=116879&view=rev Log: Add a pre-dispatch SjLj EH hook on the unwind edge for targets to do any setup they require. Use this for ARM/Darwin to rematerialize the base pointer from the frame pointer when required. rdar://8564268 Modified: llvm/trunk/docs/ExceptionHandling.html llvm/trunk/include/llvm/CodeGen/ISDOpcodes.h llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp Modified: llvm/trunk/docs/ExceptionHandling.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ExceptionHandling.html?rev=116879&r1=116878&r2=116879&view=diff ============================================================================== --- llvm/trunk/docs/ExceptionHandling.html (original) +++ llvm/trunk/docs/ExceptionHandling.html Tue Oct 19 18:27:08 2010 @@ -40,6 +40,7 @@
  • llvm.eh.sjlj.longjmp
  • llvm.eh.sjlj.lsda
  • llvm.eh.sjlj.callsite
  • +
  • llvm.eh.sjlj.dispatchsetup
  • Asm Table Formats
      @@ -548,6 +549,23 @@ +